Skip to content

Instantly share code, notes, and snippets.

/test.java Secret

Created July 1, 2014 12:04
Show Gist options
  • Save anonymous/35b94fea2a993fc350e4 to your computer and use it in GitHub Desktop.
Save anonymous/35b94fea2a993fc350e4 to your computer and use it in GitHub Desktop.
public static void main(String[] args) {
Map<String, MyStaticClass> map = new HashMap<String,MyStaticClass>();
MyStaticClass _class = map.get("test");
if(_class.test2) {
System.out.println("You won't reach here");
}
}
private static class MyStaticClass {
private Boolean test;
private Boolean test2;
}
/*
The exception thrown. It is thrown at the property declaration, not at the class declaration.
Exception in thread "main" java.lang.NullPointerException
at org.test.Main$MyStaticClass.access$0(AutoLink.java:81)
at org.test.Main.main(AutoLink.java:74)
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment