16
16
17
17
package com .google .turbine .lower ;
18
18
19
- import static com .google .common .base .StandardSystemProperty .JAVA_CLASS_VERSION ;
20
19
import static com .google .common .collect .ImmutableMap .toImmutableMap ;
21
- import static org . junit . Assert . assertEquals ;
20
+ import static com . google . common . truth . Truth . assertThat ;
22
21
23
22
import com .google .common .base .Supplier ;
24
23
import com .google .common .collect .ImmutableList ;
25
24
import com .google .common .collect .ImmutableMap ;
26
25
import com .google .turbine .binder .ClassPath ;
27
- import com .google .turbine .binder .CtSymClassBinder ;
28
26
import com .google .turbine .binder .JimageClassBinder ;
29
27
import com .google .turbine .binder .bound .ModuleInfo ;
30
28
import com .google .turbine .binder .bytecode .BytecodeBoundClass ;
@@ -51,10 +49,7 @@ public void test() throws Exception {
51
49
IntegrationTestSupport .runJavac (
52
50
sources , ImmutableList .of (), ImmutableList .of ("--release" , "9" , "--module-version=42" ));
53
51
54
- ClassPath base =
55
- Double .parseDouble (JAVA_CLASS_VERSION .value ()) < 54
56
- ? JimageClassBinder .bindDefault ()
57
- : CtSymClassBinder .bind (9 );
52
+ ClassPath base = JimageClassBinder .bindDefault ();
58
53
ClassPath bootclasspath =
59
54
new ClassPath () {
60
55
@ Override
@@ -93,7 +88,10 @@ public TopLevelIndex index() {
93
88
Optional .of ("42" ),
94
89
/* javacopts= */ ImmutableList .of ());
95
90
96
- assertEquals (dump (expected ), dump (actual ));
91
+ // normalize output after https://bugs.openjdk.org/browse/JDK-8320766
92
+ String expectedOutput = dump (expected ).replace (" // version 9\n " , "" );
93
+
94
+ assertThat (dump (actual )).isEqualTo (expectedOutput );
97
95
}
98
96
99
97
private String dump (Map <String , byte []> map ) throws Exception {
0 commit comments