platinumhamburg commented on PR #2922: URL: https://github.com/apache/fluss/pull/2922#issuecomment-4147960981
Hi @vaibhavk1992, thanks for putting this together — really solid guide overall! One thing I noticed: the doc mentions "Java 11" in Prerequisites (Section 11) and briefly notes "runtime Java 8 compatible" in the CI section, but there's no explicit rule telling AI agents that **all code must compile at Java 8 source level**. This is actually one of the most common pitfalls for AI coding agents — if they see "Java 11" as a prerequisite, they'll naturally reach for Java 9+ APIs and language features, which will then fail the `compile-on-jdk8` CI stage. I'd suggest adding a dedicated rule in Section 1 (Critical Rules), something like: ```markdown ### Java Version Compatibility **Source level: Java 8** — All code MUST compile with JDK 8. CI enforces this via `compile-on-jdk8`. **FORBIDDEN Java 9+ features:** - ❌ `var` keyword (Java 10) - ❌ `List.of()`, `Map.of()`, `Set.of()` (Java 9) → ✅ `Collections.singletonList()`, `Collections.unmodifiableMap()` - ❌ `Optional.isEmpty()` (Java 11) → ✅ `!optional.isPresent()` - ❌ `String.strip()`, `String.isBlank()` (Java 11) → ✅ `String.trim()`, `string.trim().isEmpty()` - ❌ Switch expressions, text blocks, records, sealed classes, pattern matching - ❌ `Map.entry()`, `Map.ofEntries()` (Java 9) - ❌ `InputStream.transferTo()` (Java 9) - ❌ `Stream.toList()` (Java 16) → ✅ `Collectors.toList()` ``` This follows the same DO/DON'T pattern already used in the doc (e.g., forbidden imports, MapUtils), so it should fit in naturally. Given how frequently AI agents trip over this, I think it deserves a prominent spot in the Critical Rules section. What do you think? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
