File tree Expand file tree Collapse file tree 1 file changed +10
-11
lines changed
src/main/java/com/github/fge/jsonpatch Expand file tree Collapse file tree 1 file changed +10
-11
lines changed Original file line number Diff line number Diff line change @@ -75,20 +75,19 @@ public final static String getLast(JsonPointer jsonPointer)
7575 {
7676 String representation = jsonPointer .toString ();
7777
78- if (representation != null )
78+ if (representation == null ) return "" ;
79+
80+ int slashPosition = -1 ;
81+ if ((slashPosition = representation .lastIndexOf ('/' )) != -1 )
7982 {
80- int slashPosition = -1 ;
81- if ((slashPosition = representation .lastIndexOf ('/' )) != -1 )
82- {
83- return representation .substring (slashPosition +1 );
84- }
85- else
86- {
87- return representation ;
88- }
83+ return representation .substring (slashPosition +1 );
8984 }
85+ else
86+ {
87+ return representation ;
88+ }
89+
9090
91- return "" ;
9291 }
9392
9493 public final static JsonPointer empty ()
You can’t perform that action at this time.
0 commit comments