Skip to content
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

Draft: Fix javacc deprecation warning #3016

Merged
merged 5 commits into from
Feb 7, 2023
Merged

Draft: Fix javacc deprecation warning #3016

merged 5 commits into from
Feb 7, 2023

Conversation

jwiesler
Copy link
Contributor

@jwiesler jwiesler commented Feb 2, 2023

Fixes the warning

> Task :key.core:compileJava
/home/runner/work/key/key/key.core/build/generated-src/javacc/main/de/uka/ilkd/key/parser/proofjava/JavaCharStream.java:348: warning: [dep-ann] deprecated item is not annotated with @Deprecated
  static public int getColumn() {
                    ^
/home/runner/work/key/key/key.core/build/generated-src/javacc/main/de/uka/ilkd/key/parser/proofjava/JavaCharStream.java:357: warning: [dep-ann] deprecated item is not annotated with @Deprecated
  static public int getLine() {
                    ^
/home/runner/work/key/key/key.core/build/generated-src/javacc/main/de/uka/ilkd/key/parser/schemajava/JavaCharStream.java:348: warning: [dep-ann] deprecated item is not annotated with @Deprecated
  static public int getColumn() {
                    ^
/home/runner/work/key/key/key.core/build/generated-src/javacc/main/de/uka/ilkd/key/parser/schemajava/JavaCharStream.java:357: warning: [dep-ann] deprecated item is not annotated with @Deprecated
  static public int getLine() {
                    ^

@jwiesler jwiesler requested a review from wadoon February 2, 2023 13:39
@jwiesler jwiesler self-assigned this Feb 2, 2023
@jwiesler jwiesler added the 🛠 Maintenance Code quality and related things w/o functional changes label Feb 2, 2023
@jwiesler jwiesler changed the title Fix javacc deprecation warning Draft: Fix javacc deprecation warning Feb 2, 2023
Copy link
Member

@mattulbrich mattulbrich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As discussed recenty: I like that, but would suggest we do the other item here too.

I wondered: Is it enough to add our own implementations. Would the generator not still produce its versions in the gen folder? Can we reliably guarantee that these versions have priority over the generated java files? Is this build in into gradle's build process?

@jwiesler
Copy link
Contributor Author

jwiesler commented Feb 6, 2023

I added draft because this does not work. The files get ignored and regenerated. This happens for the already existing Token.java as well, it serves no purpose right now as fas as i see it.

@wadoon
Copy link
Member

wadoon commented Feb 6, 2023

I added draft because this does not work. The files get ignored and regenerated. This happens for the already existing Token.java as well, it serves no purpose right now as fas as i see it.

Does the copy in Line 48 does not do the trick for Token.java? Maybe you need to change it for your classes.

@jwiesler
Copy link
Contributor Author

jwiesler commented Feb 6, 2023

Oh I didn't see that. However the log output states that Token.java does not exist and is generated...

Reading from file /home/runner/work/key/key/key.core/src/main/javacc/de/uka/ilkd/key/parser/schemajava/SchemaJavaParser.jj . . .
Warning: Output directory "/home/runner/work/key/key/key.core/build/generated-src/javacc/main/tmp/de/uka/ilkd/key/parser/schemajava" does not exist. Creating the directory.
File "TokenMgrError.java" does not exist.  Will create one.
File "ParseException.java" does not exist.  Will create one.
File "Token.java" does not exist.  Will create one.
File "JavaCharStream.java" does not exist.  Will create one.
Parser generated with 0 errors and 1 warnings.
Java Compiler Compiler Version 4.0 (Parser Generator)
(type "javacc" with no arguments for help)
Reading from file /home/runner/work/key/key/key.core/src/main/javacc/de/uka/ilkd/key/parser/proofjava/ProofJavaParser.jj . . .
File "TokenMgrError.java" does not exist.  Will create one.
File "ParseException.java" does not exist.  Will create one.
File "Token.java" does not exist.  Will create one.
File "JavaCharStream.java" does not exist.  Will create one.
Parser generated with 0 errors and 1 warnings.
Warning: Output directory "/home/runner/work/key/key/key.core/build/generated-src/javacc/main/tmp/de/uka/ilkd/key/parser/proofjava" does not exist. Creating the directory.

@wadoon
Copy link
Member

wadoon commented Feb 6, 2023

Oh I didn't see that. However the log output states that Token.java does not exist and is generated...

JavaCC generates these files, and we are overwriting them. The internal mechanism of JavaCC 4.0 to detect these files seems to be broken.

@jwiesler
Copy link
Contributor Author

jwiesler commented Feb 6, 2023

Did everything you asked for, the warnings are gone as far as I see it and I added the exception so \union produces a correct location info in the issue dialog.

Should be ready to be merged once the tests are done.

@wadoon wadoon enabled auto-merge February 6, 2023 19:55
@wadoon wadoon merged commit 4194ee3 into KeYProject:main Feb 7, 2023
@jwiesler jwiesler deleted the fix/javaccdeprecationWarning branch March 10, 2023 12:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🛠 Maintenance Code quality and related things w/o functional changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants