-
Notifications
You must be signed in to change notification settings - Fork 30
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
That one patch + my own modifications #1
Conversation
ZeroOne3010
commented
Feb 13, 2013
- Applied the patch submitted by someone into the original issue tracker of this project at Google Code
- Did some changes to the generated code, as required when strict compiler settings are being used in Eclipse
- Some miscellaneous refactorings
…ogle.com/p/bpep/issues/detail?id=9: "Additions: - Added the action to the main "Source" menu - Activated the action binding and changed it to Ctrl + Alt + B - Pressing enter in the builder dialog starts the generation process - Added an option (activated by default) to add a copy constructor to the generated builder (takes the respective bean and copies its members) Changes: - An existing builder class implementation will be replaced instead of appending a new class (custom changes to the class will therefore be lost)"
… with strict enough compiler settings in Eclipse (Preferences -> Java -> Compiler -> Errors/Warnings -> Name shadowing and conflicts) the previous parameter name format caused lots of errors or warnings ('The parameter xxxx is hiding a field from type Yyyy.Builder').
…ate, i.e. removed the 'private' keyword. This is to stop Eclipse from complaining in the builder-constructor of the containing class that 'Read access to enclosing field Yyyy.Builder.xxxx is emulated by a synthetic accessor method', which it will do with strict enough compiler settings.
…ng class if the compiler settings are strict enough, so changed the constructor into package-private.
Great work! |
That one patch + my own modifications
Thanks for accepting my pull request! By the way, I submitted bpep to Ohloh, a service that tracks and creates statistics for open source projects: https://www.ohloh.net/p/bpep :) |
The update site url referenced at Ohloh is not working any more. That Don't know if it is possible to host an update site at github. 2013/2/14 Ville Saalo notifications@github.com
Henning |
Good catch! Luckily it's easy to modify a project's information at Ohloh, so I removed the outdated information. :) |
Hey, what a blast from the past. Thanks for letting me know @ZeroOne3010 and good job cleaning up my changes. There is one small bugfix missing which wasn't part of the code I posted on Google Code. In the GenerateBuilderAction.java you should add editor = window.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor(); as the first line in the run method. Otherwise the action might run using the wrong editor. Apparently the setActiveEditor isn't getting called when changing the active editor (or at least that was the case when I originally made these changes). |
@frederikb Hey, thanks for the comment! Unfortunately the window-variable is not available at the run-method. There is a "public void init(IWorkbenchWindow window)" method in the class that does exactly what you just said, but I guess it does not get called, as I was indeed able to reproduce the bug of the action running in a wrong editor. Would you mind taking a look at it again? |
The action is only instantiated once. Every further invocation of the action uses the same instance. After instantiating the action the platform will call the init-method. In here, we set the window member of the GenerateBuilderAction object to our workbench window (the parameter of the init-method). this.window = window Therefore, we do have the window-variable accessible in the run-method. |