Skip to content
This repository was archived by the owner on Aug 10, 2022. It is now read-only.

Commit b60d745

Browse files
committed
Removing unused throws clauses and adding unit tests
1 parent 063b726 commit b60d745

File tree

14 files changed

+1731
-1230
lines changed

14 files changed

+1731
-1230
lines changed

build.gradle

Lines changed: 15 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,15 @@
22
// Jacoco and a coveralls upload plugin needed for publishing coverage results
33
['jacoco', 'com.github.kt3k.coveralls'].each { apply plugin: it }
44

5+
// We require building with JDK 8 or later. We turn off doclint since our
6+
// generated *TokenMakers have horrible documentation (see https://github.com/jflex-de/jflex/issues/182)
7+
assert org.gradle.api.JavaVersion.current().isJava8Compatible()
8+
allprojects {
9+
tasks.withType(Javadoc) {
10+
options.addStringOption('Xdoclint:none', '-quiet')
11+
}
12+
}
13+
514
group = 'com.fifesoft'
615
archivesBaseName = 'rsyntaxtextarea'
716

@@ -20,7 +29,7 @@ buildscript {
2029
mavenCentral()
2130
}
2231
dependencies {
23-
classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.0.1'
32+
classpath 'org.kt3k.gradle.plugin:coveralls-gradle-plugin:2.6.3'
2433
}
2534
}
2635

@@ -36,15 +45,6 @@ checkstyle {
3645
configFile = 'config/checkstyle/checkstyle.xml' as File
3746
}
3847

39-
// We require building with JDK 8 or later. We turn off doclint since our
40-
// generated *TokenMakers have horrible documentation (see https://github.com/jflex-de/jflex/issues/182)
41-
assert org.gradle.api.JavaVersion.current().isJava8Compatible()
42-
allprojects {
43-
tasks.withType(Javadoc) {
44-
options.addStringOption('Xdoclint:none', '-quiet')
45-
}
46-
}
47-
4848
compileJava {
4949
sourceCompatibility javaVersion
5050
targetCompatibility javaVersion
@@ -201,37 +201,16 @@ uploadArchives {
201201
}
202202
}
203203

204-
// Says to enforce 1.5 compatibility when building
205-
// Doesn't work as of Gradle 2.0 due to a Groovy bug; see
206-
// http://jira.codehaus.org/browse/GROOVY-7023
207-
// For now, append it via XML directly
208-
/*
209-
build {
210-
plugins {
211-
plugin {
212-
artifactId 'maven-compiler-plugin'
213-
version '2.3.2'
214-
executions {
215-
execution {
216-
id 'default-compile'
217-
configuration {
218-
source '1.5'
219-
target '1.5'
220-
}
221-
}
222-
}
223-
}
224-
}
225-
}
226-
*/
204+
// Ugh, have to do this for the "build" section
205+
// http://stackoverflow.com/questions/27975786/trouble-injecting-the-build-block-while-exporting-a-maven-pom-xml-file-from-grad
227206
withXml {
228207
def pluginNode = asNode().appendNode('build').appendNode('plugins').appendNode('plugin')
229208
pluginNode.appendNode('artifactId', 'maven-compiler-plugin')
230-
pluginNode.appendNode('version', '2.3.2')
209+
pluginNode.appendNode('version', '3.5.1')
231210
def executionNode = pluginNode.appendNode('executions').appendNode('execution')
232211
executionNode.appendNode('id', 'default-compile')
233-
executionNode.appendNode('configuration').appendNode('source', '1.5').
234-
parent().appendNode('target', '1.5')
212+
executionNode.appendNode('configuration').appendNode('source', javaVersion).
213+
parent().appendNode('target', javaVersion)
235214
}
236215
}
237216
}

src/main/java/org/fife/ui/rsyntaxtextarea/modes/ClojureTokenMaker.flex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -360,7 +360,7 @@ URL = (((https?|f(tp|ile))"://"|"www.")({URLCharacters}{URLEndCharacter})?)
360360
"*current-namespace*" |
361361
"*in*" |
362362
"*out*" |
363-
"*print-meta*"
363+
"*print-meta*" |
364364
"->" |
365365
".." |
366366
"agent" |

src/main/java/org/fife/ui/rsyntaxtextarea/modes/ClojureTokenMaker.java

Lines changed: 1140 additions & 1141 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/java/org/fife/ui/rsyntaxtextarea/modes/DtdTokenMaker.flex

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ import org.fife.ui.rsyntaxtextarea.*;
171171
* @return Whether tokens of this type should have "mark occurrences"
172172
* enabled.
173173
*/
174+
@Override
174175
public boolean getMarkOccurrencesOfTokenType(int type) {
175176
return false;
176177
}
@@ -311,12 +312,12 @@ URL = (((https?|f(tp|ile))"://"|"www.")({URLCharacters}{URLEndCharacter})?)
311312

312313
<COMMENT> {
313314
[^hwf\n\-]+ {}
314-
{URL} { int temp=zzStartRead; addToken(start,zzStartRead-1, Token.COMMENT_MULTILINE); addHyperlinkToken(temp,zzMarkedPos-1, Token.COMMENT_MULTILINE); start = zzMarkedPos; }
315+
{URL} { int temp=zzStartRead; addToken(start,zzStartRead-1, Token.MARKUP_COMMENT); addHyperlinkToken(temp,zzMarkedPos-1, Token.MARKUP_COMMENT); start = zzMarkedPos; }
315316
[hwf] {}
316-
"-->" { int temp = zzMarkedPos; addToken(start,zzStartRead+2, Token.COMMENT_MULTILINE); start = temp; yybegin(prevState); }
317+
"-->" { int temp = zzMarkedPos; addToken(start,zzStartRead+2, Token.MARKUP_COMMENT); start = temp; yybegin(prevState); }
317318
"-" {}
318319
{LineTerminator} |
319-
<<EOF>> { addToken(start,zzStartRead-1, Token.COMMENT_MULTILINE); addEndToken(INTERNAL_IN_COMMENT - prevState); return firstToken; }
320+
<<EOF>> { addToken(start,zzStartRead-1, Token.MARKUP_COMMENT); addEndToken(INTERNAL_IN_COMMENT - prevState); return firstToken; }
320321
}
321322

322323
<INTAG_START> {

src/main/java/org/fife/ui/rsyntaxtextarea/modes/DtdTokenMaker.java

Lines changed: 19 additions & 16 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/java/org/fife/ui/rsyntaxtextarea/modes/ScalaTokenMaker.flex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ import org.fife.ui.rsyntaxtextarea.*;
199199
*
200200
* @param reader the new input stream
201201
*/
202-
public final void yyreset(java.io.Reader reader) throws IOException {
202+
public final void yyreset(java.io.Reader reader) {
203203
// 's' has been updated.
204204
zzBuffer = s.array;
205205
/*

src/main/java/org/fife/ui/rsyntaxtextarea/modes/ScalaTokenMaker.java

Lines changed: 7 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/main/java/org/fife/ui/rtextarea/RTATextTransferHandler.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ else if (stringFlavor != null) {
106106
* Import the given stream data into the text component.
107107
*/
108108
protected void handleReaderImport(Reader in, JTextComponent c)
109-
throws BadLocationException, IOException {
109+
throws IOException {
110110

111111
char[] buff = new char[1024];
112112
int nch;
@@ -299,8 +299,6 @@ public boolean importData(JComponent comp, Transferable t) {
299299
imported = true;
300300
} catch (UnsupportedFlavorException ufe) {
301301
ufe.printStackTrace();
302-
} catch (BadLocationException ble) {
303-
ble.printStackTrace();
304302
} catch (IOException ioe) {
305303
ioe.printStackTrace();
306304
}

src/test/java/org/fife/ui/rsyntaxtextarea/modes/AbstractTokenMakerTest2.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,8 @@ protected void assertAllTokensOfType(String[] tokens, int expectedType) {
4545
Segment segment = createSegment(token);
4646
TokenMaker tm = createTokenMaker();
4747
Token t = tm.getTokenList(segment, TokenTypes.NULL, 0);
48-
Assert.assertEquals("Token has unexpected type: " + token, expectedType, t.getType());
48+
Assert.assertEquals("Token has unexpected type: orig=" + token +
49+
", actual=" + t, expectedType, t.getType());
4950
}
5051

5152
}

0 commit comments

Comments
 (0)