-
Notifications
You must be signed in to change notification settings - Fork 3.7k
Ignore the current class while going over variables #2970
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
Conversation
|
rerun integration tests |
| localRunArgs.add(new Gson().toJson(sinkConfig)); | ||
| for (Field field : this.getClass().getDeclaredFields()) { | ||
| if (field.getName().startsWith("DEPRECATED")) continue; | ||
| if(field.getName().startsWith("this$0")) continue; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since all anonymous classes and lambdas defined within a class will contain $N or $lambdaN, we should ignore everything with a $
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
| for (Field field : this.getClass().getDeclaredFields()) { | ||
| if (field.getName().startsWith("DEPRECATED")) continue; | ||
| if(field.getName().startsWith("this$0")) continue; | ||
| if(field.getName().startsWith("$")) continue; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it should be contains() instead of startsWith(), no? Anything with $ was auto created by compiler anyway.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good point. I have consolidated the logic
|
rerun integration tests |
Motivation
We go over all the declared fields in LocalRunner class to generate the command for localrunner. However one of the items that getDeclartedFields returns is the this$0 which should be ignored.
Modifications
Describe the modifications you've done.
Result
After your change, what will change.