Skip to content

Commit 515e7d7

Browse files
committed
Build: Fix build for Java 1.6
1 parent 3a9d98c commit 515e7d7

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

config/codenarc/codenarc.xml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@
99
<rule-config name='MisorderedStaticImports'>
1010
<property name='comesBefore' value='false'/>
1111
</rule-config>
12+
<rule-config name='NoWildcardImports'>
13+
<property name='doNotApplyToFilesMatching' value='AsynchronousChannelHelperSmokeTestSpecification.groovy'/>
14+
</rule-config>
1215
</ruleset-ref>
1316

1417
<ruleset-ref path='rulesets/basic.xml'/>

driver-async/src/test/functional/com/mongodb/async/client/gridfs/helpers/AsynchronousChannelHelperSmokeTestSpecification.groovy

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,8 @@ import org.bson.Document
2626
import spock.lang.Requires
2727

2828
import java.nio.ByteBuffer
29-
import java.nio.channels.AsynchronousFileChannel
30-
import java.nio.file.Files
31-
import java.nio.file.NoSuchFileException
32-
import java.nio.file.Path
33-
import java.nio.file.Paths
34-
import java.nio.file.StandardOpenOption
29+
import java.nio.channels.* // Wildcard import to work around Java 1.6
30+
import java.nio.file.* // Wildcard import to work around Java 1.6
3531

3632
import static GridFSTestHelper.TestAsynchronousByteChannel
3733
import static GridFSTestHelper.run
@@ -89,7 +85,7 @@ class AsynchronousChannelHelperSmokeTestSpecification extends FunctionalSpecific
8985
if (outputPath) {
9086
try {
9187
Files.delete(outputPath)
92-
} catch (NoSuchFileException e) {
88+
} catch (IOException e) {
9389
println(e.getMessage())
9490
}
9591
}

0 commit comments

Comments
 (0)