changeset 495:631a273dac0f

6926703: apt tests should run with assertions enabled Reviewed-by: jjg
author darcy
date Mon, 15 Feb 2010 20:17:57 -0800
parents fe17a9dbef03
children 16b9b7f45933 67f0e05098fa
files src/share/classes/com/sun/mirror/util/SourceOrderDeclScanner.java
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/com/sun/mirror/util/SourceOrderDeclScanner.java	Mon Feb 15 20:06:11 2010 -0800
+++ b/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();