Skip to content

Commit 2a27a17

Browse files
committed
Maintain compatibility with Java 11
1 parent 397a11a commit 2a27a17

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

pom.xml

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@
1818
<properties>
1919
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
2020
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
21+
<maven.compiler.target>11</maven.compiler.target>
22+
<maven.compiler.source>11</maven.compiler.source>
2123
</properties>
2224
<dependencies>
2325
<dependency>
@@ -172,9 +174,8 @@
172174
<artifactId>maven-compiler-plugin</artifactId>
173175
<version>3.14.0</version>
174176
<configuration>
175-
<debug>true</debug>
176-
<debuglevel>none</debuglevel>
177-
<release>17</release>
177+
<debug>false</debug>
178+
<release>11</release>
178179
<compilerArgument>-Xlint:all</compilerArgument>
179180
<compilerArguments>
180181
<Werror />

src/main/java/com/grack/nanojson/LazyString.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,8 @@ public boolean equals(Object obj) {
101101
return true;
102102
if (!(obj instanceof CharSequence))
103103
return false;
104-
if (obj instanceof LazyString other) {
104+
if (obj instanceof LazyString) {
105+
LazyString other = (LazyString) obj;
105106
String str = stringValue; // Local ref copy to avoid race
106107
String otherStr = other.stringValue; // Local ref copy to avoid race
107108
if (str != null && otherStr != null) {

0 commit comments

Comments
 (0)