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

That one patch + my own modifications #1

Merged
merged 6 commits into from
Feb 14, 2013

Conversation

ZeroOne3010
Copy link
Contributor

  • 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.
@henningjensen
Copy link
Owner

Great work!

henningjensen added a commit that referenced this pull request Feb 14, 2013
That one patch + my own modifications
@henningjensen henningjensen merged commit c8570ed into henningjensen:master Feb 14, 2013
@ZeroOne3010
Copy link
Contributor Author

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 :)

@henningjensen
Copy link
Owner

The update site url referenced at Ohloh is not working any more. That
server has been removed.

Don't know if it is possible to host an update site at github.

2013/2/14 Ville Saalo notifications@github.com

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 :)


Reply to this email directly or view it on GitHubhttps://github.com//pull/1#issuecomment-13545117.

Henning

@ZeroOne3010
Copy link
Contributor Author

Good catch! Luckily it's easy to modify a project's information at Ohloh, so I removed the outdated information. :)

@frederikb
Copy link

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).

@ZeroOne3010
Copy link
Contributor Author

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

@frederikb
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants