Skip to content

Commit

Permalink
JDK 9 compatibility
Browse files Browse the repository at this point in the history
  • Loading branch information
gnodet committed Dec 13, 2016
1 parent 6262a4b commit 0e30d9f
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 2 deletions.
17 changes: 16 additions & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@
<jna.version>4.2.2</jna.version>
<jansi.version>1.14</jansi.version>
<juniversalchardet.version>1.0.3</juniversalchardet.version>

<surefire.argLine/>
</properties>

<prerequisites>
Expand Down Expand Up @@ -233,7 +235,7 @@
<redirectTestOutputToFile>${maven.test.redirectTestOutputToFile}</redirectTestOutputToFile>
<!-- force use of property -->
<forkMode>once</forkMode>
<argLine>-ea</argLine>
<argLine>${surefire.argLine}</argLine>
<failIfNoTests>false</failIfNoTests>
<workingDirectory>${project.build.directory}</workingDirectory>
<excludes>
Expand Down Expand Up @@ -372,4 +374,17 @@
</plugins>
</build>

<profiles>
<profile>
<id>java9</id>
<properties>
<surefire.argLine>--add-opens java.base/java.io=ALL-UNNAMED</surefire.argLine>
</properties>
<activation>
<jdk>9</jdk>
</activation>
</profile>
</profiles>


</project>
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ protected static FileDescriptor newDescriptor(int fd) {
Constructor<FileDescriptor> cns = FileDescriptor.class.getDeclaredConstructor(int.class);
cns.setAccessible(true);
return cns.newInstance(fd);
} catch (Exception e) {
} catch (Throwable e) {
throw new RuntimeException("Unable to create FileDescriptor", e);
}
}
Expand Down
21 changes: 21 additions & 0 deletions src/test/java/org/jline/terminal/impl/jna/JnaNativePtyTest.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
* Copyright (c) 2002-2016, the original author or authors.
*
* This software is distributable under the BSD license. See the terms of the
* BSD license in the documentation provided with this software.
*
* http://www.opensource.org/licenses/bsd-license.php
*/
package org.jline.terminal.impl.jna;

import org.junit.Test;

import static org.junit.Assert.assertNotNull;

public class JnaNativePtyTest {

@Test
public void testDescriptor() {
assertNotNull(JnaNativePty.newDescriptor(4));
}
}

0 comments on commit 0e30d9f

Please sign in to comment.