-
Notifications
You must be signed in to change notification settings - Fork 2.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Please do not use underscores as Java identifiers in source code #3045
Comments
We used to return nil for invalid .java source code. Now we throw an exception, with the parsing error diagnostics as part of the ex-data. Note that this doesn't change user-facing behavior, since all exceptions are caught by default in `orchard.java.parser/source-info` / `orchard.java.parser-next/source-info`. This helps debug faulty .java source code, see e.g. aws/aws-sdk-java#3045
We used to return nil for invalid .java source code. Now we throw an exception, with the parsing error diagnostics as part of the ex-data. Note that this doesn't change user-facing behavior, since all exceptions are caught by default in `orchard.java.parser/source-info` / `orchard.java.parser-next/source-info`. This helps debug faulty .java source code, see e.g. aws/aws-sdk-java#3045
We used to return nil for invalid .java source code. Now we throw an exception, with the parsing error diagnostics as part of the ex-data. Note that this doesn't change user-facing behavior, since all exceptions are caught by default in `orchard.java.parser/source-info` / `orchard.java.parser-next/source-info`. This helps debug faulty .java source code, see e.g. aws/aws-sdk-java#3045
…le (#205) We used to return nil for invalid .java source code. Now we throw an exception, with the parsing error diagnostics as part of the ex-data. Note that this doesn't change user-facing behavior, since all exceptions are caught by default in `orchard.java.parser/source-info` / `orchard.java.parser-next/source-info`. This helps debug faulty .java source code, see e.g. aws/aws-sdk-java#3045
@vemv I understand the issue, I'll see if we can make the change in That said, you don't need to compile the Java SDK code to be able to use it. The recommended way to consume the SDK is to add the modules as dependencies, as showed in the Developer Guide - https://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/setup-project-maven.html#configuring-maven
The SDK is compiled against JDK7, so you won't be blocked by this error when consuming as dependencies. |
Thanks! Yes, I understand. My issue is not created from the perspective of a SDK consumer but rather, from the perspective of a tooling maker. My tooling parses source jars such as |
@vemv We removed the underscore, the change is available in the latest release: aws-sdk-java/aws-java-sdk-core/src/main/java/com/amazonaws/internal/ResettableInputStream.java Line 143 in 9acdd7a
|
This issue is now closed. Comments on closed issues are hard for our team to see. |
Thanks - appreciated! |
Describe the bug
The java source code of these libraries, as distributed in e.g.
aws-java-sdk-core-1.12.576-sources.jar(/com/amazonaws/internal/ResettableInputStream.java):143
can occasionally use underscores as identifiers.That's no longer valid after Java 9 and hinders any modern tooling that would want to parse your source code (e.g. for extracting useful info from its doc comments).
Expected Behavior
The Java source code is valid for JDK9+.
Current Behavior
It uses underscores as identifiers, and official tooling (e.g.
javax.tools.DocumentationTool
) will complain:Reproduction Steps
Try running
javac
and/or other official JDK tools over your source code using a target version >= 9Possible Solution
Update
_
identifiers to e.g._ignored
Additional Information/Context
No response
AWS Java SDK version used
1.12.576
JDK version used
openjdk version "16.0.1" 2021-04-20
Operating System and version
macOS
The text was updated successfully, but these errors were encountered: