Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- someObject.getSomething().getSomethingElse().
- getAnotherThing().getYetAnotherObject().getValue();
- Exception in thread "main" java.lang.NullPointerException
- at package.SomeClass.someMethod(SomeClass.java:12)
- Foo ret1 = someObject.getSomething();
- Bar ret2 = ret1.getSomethingElse();
- Baz ret3 = ret2.getAnotherThing();
- Bam ret4 = ret3.getYetAnotherOject();
- int ret5 = ret4.getValue();
- a.getB().getC().getD().getE();
- someObject.getSomething()
- .getSomethingElse()
- .getAnotherThing()
- .getYetAnotherObject()
- .getValue();
- public Foo getSomething()
- {
- Foo result;
- ...
- if (result == null) {
- throw new IllegalStateException("Something is missing");
- }
- return result;
- }
- someObject.getSomething().getSomethingElse().
- getAnotherThing().getYetAnotherObject().getValue();
Add Comment
Please, Sign In to add comment