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

Findbugs / PMD / Junit Updates #21

Merged
merged 1 commit into from
Aug 19, 2012
Merged

Findbugs / PMD / Junit Updates #21

merged 1 commit into from
Aug 19, 2012

Conversation

hazendaz
Copy link
Member

The basic idea here was to upgrade junit 3 style tests to junit 4 annotation style. In addition findbugs and pmd were used to flush out any potential issues. Overall there were not really anything significant found through those tools but they did point out a number of issues. All is fixed below. This consists of 127 files. A couple of those simply were changing spacing to tabs such as in build files. The rest relate to below. I was going to separate out breaking changes but due to how imbedded throughout they were, I simply clearly listed them in the release notes. The breaking changes are minor and would only cause external users if they extend things to change a few names. No actual code changes are really necessary in these cases unless they looked for returned arrays and expect null rather than empty.

Updated code based on findbug and pmd results.
Updated junit 3 style to junit 4 style tests
Within waffle code, any methods returning boolean with getter now use
is*, see release notes for further details.
Fixed case on method in interface, see release notes.
All arrays used on getters that did return null now return empty arrays.

Updated code based on findbug and pmd results.
Updated junit 3 style to junit 4 style tests
Within waffle code, any methods returning boolean with getter now use
is*
@@ -92,7 +92,6 @@ public void dispose() {
if (WinError.SEC_E_OK != rc) {
throw new Win32Exception(rc);
}
_handle = null;
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This kind of stuff is useful for debugging. This way we know the handle has been disposed and the object is in sync. Is there a good reason to remove it?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Findbugs / PMD usually complains about this kind of thing as the handle will be disposed of naturally by garbage collection. Years ago there was some theory that nulling things out early guaranteed that the memory was cleaned up but that theory has long since gone away. I think that with java 4 and before it probably was necessary but as of java 5 -> it shouldn’t be an issue any longer. Both these tools simply state to stop doing this and to remove the code.

Thanks for merging!

I do have a couple of issues I really was trying to resolve in all of this. I have issues with 3 tests that have never ran on my machine. I’ll keep digging on those. Maybe I can get lucky and get the issues resolved. For the new “git” ant task you added, what software specifically do I need to add for that to work? When I build, it fails so I have to comment that out to get the build working at the moment. I’m guessing I simply need a different version of git than I’m using. I’m using git hub for windows so likely need another client.

Thanks,

Jeremy

From: Daniel Doubrovkine (dB.) [mailto:[email protected]]
Sent: Sunday, August 19, 2012 12:07 PM
To: dblock/waffle
Cc: Jeremy Landis
Subject: Re: [waffle] Findbugs / PMD / Junit Updates (#21)

In Source/JNA/waffle-core/src/waffle/windows/auth/impl/WindowsCredentialsHandleImpl.java:

@@ -92,7 +92,6 @@ public void dispose() {
if (WinError.SEC_E_OK != rc) {
throw new Win32Exception(rc);
}

  •                _handle = null;
    

This kind of stuff is useful for debugging. This way we know the handle has been disposed and the object is in sync. Is there a good reason to remove it?


Reply to this email directly or view it on GitHub https://github.com/dblock/waffle/pull/21/files#r1410118 .

https://github.com/notifications/beacon/cfbemxk8F8smNvKeAYgxsfGkJ_8-7DJ1XLdoVKfSKExIACJewjVQPil_mPry_E1h.gif


No virus found in this message.
Checked by AVG - www.avg.com
Version: 2012.0.2197 / Virus Database: 2437/5209 - Release Date: 08/19/12

@dblock dblock merged commit f2fdaf3 into Waffle:1.5 Aug 19, 2012
@dblock
Copy link
Collaborator

dblock commented Aug 19, 2012

Well done, I've merged this change, thanks.

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

2 participants