Skip to content

Commit d4dbc90

Browse files
committed
Continued cleanup of old AppleJavaExtrensions and moving to Java 11
Delete other old files related to AppleJavaExtensions Clean up button ordering and dialog titles in TregexGUI Change build files to specify Java 11
1 parent 5ef39a5 commit d4dbc90

13 files changed

+53
-1251
lines changed

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ apply plugin: 'eclipse'
77
apply plugin: 'application'
88

99
// Gradle java plugin
10-
sourceCompatibility = 1.8
11-
targetCompatibility = 1.8
10+
sourceCompatibility = 11
11+
targetCompatibility = 11
1212
compileJava.options.encoding = 'UTF-8'
1313

1414
version = '4.5.10'

build.xml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
<property name="compile.debug" value="true"/>
1717
<property name="compile.deprecation" value="false"/>
1818
<property name="compile.optimize" value="true"/>
19-
<property name="compile.source" value="1.8" />
20-
<property name="compile.target" value="1.8" />
19+
<property name="compile.source" value="11" />
20+
<property name="compile.target" value="11" />
2121
<property name="compile.encoding" value="utf-8" />
2222

2323
<target name="classpath" description="Sets the classpath">
@@ -56,7 +56,7 @@
5656
<javadoc destdir="${javadoc.path}"
5757
maxmemory="1200m"
5858
author="true"
59-
source="1.8"
59+
source="11"
6060
Overview="${basedir}/src/edu/stanford/nlp/overview.html"
6161
Doctitle="Stanford JavaNLP API Documentation"
6262
Windowtitle="Stanford JavaNLP API"
@@ -81,7 +81,7 @@
8181
</classpath>
8282

8383
<bottom><![CDATA[<font size="2"><a href="https://nlp.stanford.edu" target="_top">Stanford NLP Group</a></font>]]></bottom>
84-
<link href="http://docs.oracle.com/javase/8/docs/api/"/>
84+
<link href="https://docs.oracle.com/en/java/javase/11/docs/api/"/>
8585
</javadoc>
8686

8787
</target>

module_core.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<property name="module.jdk.bin.core" value="${project.jdk.bin}"/>
77
<property name="module.jdk.classpath.core" value="${project.jdk.classpath}"/>
88

9-
<property name="compiler.args.core" value="-encoding UTF-8 -source 8 ${compiler.args}"/>
9+
<property name="compiler.args.core" value="-encoding UTF-8 -source 11 ${compiler.args}"/>
1010

1111
<property name="core.output.dir" value="${module.core.basedir}/../action_parsing/out/production/core"/>
1212
<property name="core.testoutput.dir" value="${module.core.basedir}/../action_parsing/out/test/core"/>
@@ -81,4 +81,4 @@
8181
<delete dir="${core.output.dir}"/>
8282
<delete dir="${core.testoutput.dir}"/>
8383
</target>
84-
</project>
84+
</project>

pom-java-11.xml

Lines changed: 0 additions & 210 deletions
This file was deleted.

pom.xml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,6 @@
3535
</developer>
3636
</developers>
3737
<properties>
38-
<maven.compiler.source>1.8</maven.compiler.source>
39-
<maven.compiler.target>1.8</maven.compiler.target>
4038
<encoding>UTF-8</encoding>
4139
</properties>
4240
<dependencies>
@@ -158,7 +156,7 @@
158156
<artifactId>jaxb-api</artifactId>
159157
<version>2.4.0-b180830.0359</version>
160158
</dependency>
161-
159+
162160
<dependency>
163161
<groupId>com.sun.istack</groupId>
164162
<artifactId>istack-commons-runtime</artifactId>
@@ -199,6 +197,14 @@
199197
</execution>
200198
</executions>
201199
</plugin>
200+
<plugin>
201+
<groupId>org.apache.maven.plugins</groupId>
202+
<artifactId>maven-compiler-plugin</artifactId>
203+
<version>3.8.1</version>
204+
<configuration>
205+
<release>11</release>
206+
</configuration>
207+
</plugin>
202208
</plugins>
203209
</build>
204210
</project>

src/edu/stanford/nlp/trees/tregex/TregexPatternCompiler.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,14 @@ public void addMacro(String original, String replacement) {
130130
* @throws TregexParseException If the expression is syntactically invalid
131131
*/
132132
public TregexPattern compile(String tregex) {
133+
if (tregex == null || tregex.isEmpty()) {
134+
throw new TregexParseException("Empty Tregex expression", null);
135+
}
133136
for (Pair<String, String> macro : macros) {
134137
tregex = tregex.replaceAll(macro.first(), macro.second());
135138
}
136139
TregexPattern pattern;
140+
137141
try {
138142
TregexParser parser = new TregexParser(new StringReader(tregex + '\n'),
139143
basicCatFunction, headFinder);

src/edu/stanford/nlp/trees/tregex/gui/ABOUT-AppleJavaExtensions.txt

Lines changed: 0 additions & 29 deletions
This file was deleted.

src/edu/stanford/nlp/trees/tregex/gui/DisplayMatchesPanel.java

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -261,21 +261,20 @@ private void addMatch(TreeFromFile match, List<Tree> matchedParts) {
261261
}
262262

263263
void showPrevMatchedPart() {
264-
if (matchedPartCoordinates.size() == 0)
264+
if (matchedPartCoordinates == null || matchedPartCoordinates.size() == 0) {
265265
return;
266-
else if (matchedPartCoordinateIdx <= 0)
266+
} else if (matchedPartCoordinateIdx <= 0)
267267
matchedPartCoordinateIdx = matchedPartCoordinates.size();
268268

269269
matchedPartCoordinateIdx--;
270270
showMatchedPart(matchedPartCoordinateIdx);
271271
}
272272

273273
void showNextMatchedPart() {
274-
if (matchedPartCoordinates.size() == 0)
274+
if (matchedPartCoordinates == null || matchedPartCoordinates.size() == 0) {
275275
return;
276-
277-
matchedPartCoordinateIdx =
278-
++matchedPartCoordinateIdx % matchedPartCoordinates.size();
276+
}
277+
matchedPartCoordinateIdx = ++matchedPartCoordinateIdx % matchedPartCoordinates.size();
279278
showMatchedPart(matchedPartCoordinateIdx);
280279
}
281280

0 commit comments

Comments
 (0)