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

cannot use @Override and @Deprecated in static mode #619

Closed
knupel opened this issue Dec 6, 2022 · 12 comments · Fixed by #622
Closed

cannot use @Override and @Deprecated in static mode #619

knupel opened this issue Dec 6, 2022 · 12 comments · Fixed by #622

Comments

@knupel
Copy link
Contributor

knupel commented Dec 6, 2022

I just updated Processing for version 4.1.1 and now when I run sketch when there is
@Override @Deprecated inside class Processing don't run, that's a regression ? or there is a goal behind that ?
Before that's work fine withe processing 4.0b7... and all the version before that from 1.5.1

the console return:

Cannot find a class or type named @Overridepublic...

or

Cannot find a class or type named @Deprecatedpublic...

And always bravo for the Processing Team !!!!

@benfry
Copy link
Owner

benfry commented Dec 6, 2022

@sampottinger Possible regression with the preproc changes?

@sampottinger
Copy link
Collaborator

Yeah I'll take a look @benfry! @knupel are you comfortable sharing a code example?

@knupel
Copy link
Contributor Author

knupel commented Dec 7, 2022

Hi @sampottinger I think it's something like that :

class Truc {
  Truc(){}
  @Deprecated void machin() {
  }
  
  
  @Override String toString() {
    return "oalala";
  }
}

I try to make something simple with my tiny time, the problem is here for @Override
https://github.com/knupel/Rope_framework/blob/master/Rope_framework/Z_R_Table_info.pde#L1222

and here for @deprecated
https://github.com/knupel/Rope_framework/blob/master/Rope_framework/Z_R_Science.pde#L455

If you need more information, I can work on it this week-end

@sampottinger
Copy link
Collaborator

This is great thanks! Will see if I can take a look at this either this weekend or early next week.

@sampottinger
Copy link
Collaborator

Thanks @knupel! We seem to be passing our current annotations unit test but possible I missed something. I’ll try to make a new test to address your case.

@sampottinger
Copy link
Collaborator

@benfry made fix at #622. Note that I believe #619 does not impact most uses of annotations. I think this is limited to the following:

method with no visibility modifier && method with annotation && (static mode || class definitions extending PApplet)

See https://github.com/processing/processing4/blob/main/java/src/processing/mode/java/preproc/PdeParseTreeListener.java#L530. Thanks!

@sampottinger sampottinger changed the title cannot use @Override and @Deprecated cannot use @Override and @Deprecated in static mode Dec 10, 2022
@knupel
Copy link
Contributor Author

knupel commented Dec 11, 2022

Thx a lot !!!!

@benfry
Copy link
Owner

benfry commented Jan 10, 2023

Awesome, thanks Sam.

This will be in 4.1.2.

@tomuGo
Copy link

tomuGo commented Jan 16, 2023

can early version work?

@sampottinger
Copy link
Collaborator

Hey @tomuGo! I think the fix was accepted. So the resolution for this will be included in the next processing release. Also, if you build processing yourself, the fix is currently on main. Does that help?

@sampottinger
Copy link
Collaborator

Sorry @tomuGo you might be able to use 4.0.2 to get around this. I think this is before the issue came up - https://github.com/processing/processing4/releases/tag/processing-1287-4.0.2

@github-actions
Copy link

This issue has been automatically locked. To avoid confusion with reports that have already been resolved, closed issues are automatically locked 30 days after the last comment. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Feb 16, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants