From b8574a9e3b7099182656d58ae93e74d977b79d58 Mon Sep 17 00:00:00 2001 From: Joe Darcy Date: Mon, 15 Feb 2010 20:17:57 -0800 Subject: [PATCH] 6926703: apt tests should run with assertions enabled Reviewed-by: jjg --- .../classes/com/sun/mirror/util/SourceOrderDeclScanner.java | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/langtools/src/share/classes/com/sun/mirror/util/SourceOrderDeclScanner.java b/langtools/src/share/classes/com/sun/mirror/util/SourceOrderDeclScanner.java index 62b7209dde4..30574383625 100644 --- a/langtools/src/share/classes/com/sun/mirror/util/SourceOrderDeclScanner.java +++ b/langtools/src/share/classes/com/sun/mirror/util/SourceOrderDeclScanner.java @@ -101,7 +101,11 @@ class SourceOrderDeclScanner extends DeclarationScanner { } @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();