Skip to content

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

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

Closed
processing-bot opened this issue Dec 6, 2022 · 12 comments
Closed

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

processing-bot opened this issue Dec 6, 2022 · 12 comments

Comments

@processing-bot
Copy link
Collaborator

Created by: knupel

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 !!!!

@processing-bot
Copy link
Collaborator Author

Created by: benfry

@sampottinger Possible regression with the preproc changes?

@processing-bot
Copy link
Collaborator Author

Created by: sampottinger

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

@processing-bot
Copy link
Collaborator Author

Created by: knupel

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

@processing-bot
Copy link
Collaborator Author

Created by: sampottinger

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

@processing-bot
Copy link
Collaborator Author

Created by: sampottinger

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.

@processing-bot
Copy link
Collaborator Author

Created by: sampottinger

@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!

@processing-bot
Copy link
Collaborator Author

Created by: knupel

Thx a lot !!!!

@processing-bot
Copy link
Collaborator Author

Created by: benfry

Awesome, thanks Sam.

This will be in 4.1.2.

@processing-bot
Copy link
Collaborator Author

Created by: tomuGo

can early version work?

@processing-bot
Copy link
Collaborator Author

Created by: sampottinger

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?

@processing-bot
Copy link
Collaborator Author

Created by: sampottinger

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

@processing-bot
Copy link
Collaborator Author

Created by: github-actions[bot]

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 Sep 17, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

1 participant