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

Patch for /trunk/src/nl/jqno/equalsverifier/util/AnnotationAccessor.java #43

Closed
GoogleCodeExporter opened this issue Mar 29, 2015 · 5 comments

Comments

@GoogleCodeExporter
Copy link

It is possible that Class.getClassLoader() will return null (to represent the 
bootstrap class loader).  Therefore, if classLoader is null we try to use the 
system class loader instead.

Original issue reported on code.google.com by [email protected] on 31 Mar 2011 at 2:17

Attachments:

@GoogleCodeExporter
Copy link
Author

Sorry about the whitespace damage in the patch - this is just what Google code 
editor seemed to do!

Original comment by [email protected] on 31 Mar 2011 at 2:20

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

Thanks, indeed you're right, I didn't realise Class.getClassLoader() might 
return null.

However, the javadoc is kind of vague about when this will actually happen. 
Could you give me a scenario that exposes this issue? I prefer to have a unit 
test, before changing the code.

Original comment by [email protected] on 3 Apr 2011 at 6:50

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

From what I can work out, anything in rt.jar is loaded by the bootstrap 
classloader.  So to get this problem, all you have to do is subclass something 
in that jar and ask EqualsVerfier to verify it.  For example, 

public class MyMap extends HashMap {}

EqualsVerifier.forClass(MyMap.class).verify();

I hit this problem by subclassing javax.management.Notification.

Original comment by [email protected] on 4 Apr 2011 at 1:51

  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

You're right; I've reproduced it with a subclass of ArrayList.
I'll fix it in the next release.

Original comment by [email protected] on 11 Apr 2011 at 6:41

  • Changed state: Accepted
  • Added labels: ****
  • Removed labels: ****

@GoogleCodeExporter
Copy link
Author

The release is done!

Original comment by [email protected] on 17 Apr 2011 at 11:22

  • Changed state: Fixed
  • Added labels: ****
  • Removed labels: ****

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

No branches or pull requests

1 participant