6926703: apt tests should run with assertions enabled
authordarcy
Mon, 15 Feb 2010 20:17:57 -0800
changeset 4936 abf1a22d9bcf
parent 4935 ff8adaa7bb8e
child 4937 2fc03fb01efa
child 4938 83dcfb52d99a
6926703: apt tests should run with assertions enabled Reviewed-by: jjg
langtools/src/share/classes/com/sun/mirror/util/SourceOrderDeclScanner.java
--- a/langtools/src/share/classes/com/sun/mirror/util/SourceOrderDeclScanner.java	Mon Feb 15 20:06:11 2010 -0800
+++ b/langtools/src/share/classes/com/sun/mirror/util/SourceOrderDeclScanner.java	Mon Feb 15 20:17:57 2010 -0800
@@ -101,7 +101,11 @@
         }
         @SuppressWarnings("cast")
         private int compareEqualPosition(Declaration d1, Declaration d2) {
-            assert d1.getPosition() == d2.getPosition();
+            assert
+                (d1.getPosition() == d2.getPosition()) || // Handles d1 == d2 == null
+                (d1.getPosition().file().compareTo(d2.getPosition().file()) == 0 &&
+                 d1.getPosition().line()   == d2.getPosition().line() &&
+                 d1.getPosition().column() == d2.getPosition().column());
 
             DeclPartialOrder dpo1 = new DeclPartialOrder();
             DeclPartialOrder dpo2 = new DeclPartialOrder();