Almost OK!

http://gwt-code-reviews.appspot.com/1727807/diff/7/user/src/com/google/gwt/editor/client/impl/SimpleViolation.java
File user/src/com/google/gwt/editor/client/impl/SimpleViolation.java
(right):

http://gwt-code-reviews.appspot.com/1727807/diff/7/user/src/com/google/gwt/editor/client/impl/SimpleViolation.java#newcode129
user/src/com/google/gwt/editor/client/impl/SimpleViolation.java:129:
String originalAbsolutePath = absolutePath;
Make it 'final' to make sure we don't screw it by mistake.

http://gwt-code-reviews.appspot.com/1727807/diff/7/user/src/com/google/gwt/editor/client/impl/SimpleViolation.java#newcode162
user/src/com/google/gwt/editor/client/impl/SimpleViolation.java:162: //
Traverse upwards in the path to the parents in order
That block should go in an 'else' clause: we don't want to do that if
we'll terminate the loop right next, when found==true; this case is only
needed when 'found' is still 'false'.

http://gwt-code-reviews.appspot.com/1727807/diff/7/user/src/com/google/gwt/editor/client/impl/SimpleViolation.java#newcode172
user/src/com/google/gwt/editor/client/impl/SimpleViolation.java:172:
assert found :
We won't ever break out the loop unless 'found' is 'false'. This
'assert' should be just before the 'int dotIdx = ...' line and should be
rewritten to either

   assert !absolutePath.isEmpty()

or

   assert !absolutePath.equals(basePath)

Actually, we should probably change it to an 'if', to make sure that
we'll never have an infinite loop when assertions are disabled (e.g. in
production mode):

   if (absolutePath.isEmpty()) {
     // There should always be a delegate for ""
     // Break out of the infinite loop.
     throw new IllegalStateException();
   }

http://gwt-code-reviews.appspot.com/1727807/

--
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to