Skip to content

Commit 685f765

Browse files
committed
added javax.xml.bind to pom for Java 9+ support
1 parent 9018416 commit 685f765

File tree

5 files changed

+19
-3
lines changed

5 files changed

+19
-3
lines changed

pom.xml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,14 @@
132132
<version>4.5.3</version>
133133
</dependency>
134134

135+
<!-- Java 9+ support -->
136+
<dependency>
137+
<groupId>javax.xml.bind</groupId>
138+
<artifactId>jaxb-api</artifactId>
139+
<version>2.3.1</version>
140+
</dependency>
141+
142+
<!-- Testing -->
135143
<dependency>
136144
<groupId>junit</groupId>
137145
<artifactId>junit</artifactId>

src/main/java/net/b07z/sepia/server/core/tools/ClassBuilder.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ public class ClassBuilder {
2929
* @param classLoader - loader that has access to the class. Use null or 'ClassLoader.getSystemClassLoader()' for default.
3030
* @param canonicalClassName - canonical name of the class, e.g.: "java.lang.String"
3131
* @param arguments - arguments usually passed to the constructor (optional).
32-
* @return constructed class
32+
* @return constructed class or throw exception
3333
*/
3434
public static Object construct(ClassLoader classLoader, String canonicalClassName, Object... arguments){
3535
try{
@@ -77,7 +77,7 @@ public static Object construct(ClassLoader classLoader, String canonicalClassNam
7777
* Constructs a new instance of a class just by using the name of the class.<br>
7878
*
7979
* @param canonicalClassName - canonical name of the class, e.g.: "java.lang.String"
80-
* @return constructed class
80+
* @return constructed class or throw exception
8181
*/
8282
public static Object construct(String canonicalClassName){
8383
return construct(null, canonicalClassName);

src/main/java/net/b07z/sepia/server/core/tools/SandboxSecurityPolicy.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,12 @@
77
import java.security.Policy;
88
import java.security.ProtectionDomain;
99

10+
/**
11+
* TODO: add more info about the policy.
12+
*
13+
* @author Florian Quirin
14+
*
15+
*/
1016
public class SandboxSecurityPolicy extends Policy{
1117

1218
@Override

src/main/java/net/b07z/sepia/server/core/tools/Security.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ public static String bytearrayToHexString(byte[] hash){
3939
* @return - byte array
4040
*/
4141
public static byte[] hexToByteArray(String s) {
42-
return DatatypeConverter.parseHexBinary(s);
42+
return DatatypeConverter.parseHexBinary(s); //TODO: can we replace this and get rid of 'javax.xml.bind'?
4343
}
4444

4545
/**

src/test/java/tools/ToolsTest.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -92,6 +92,8 @@ public void testPrivateNetworkCheck() throws Exception{
9292
//isPrivate = Security.isPrivateNetwork("fd9e:21a7:a92c:2323::2"); assertTrue(isPrivate); //what are private IPv6 addresses??
9393
isPrivate = Security.isPrivateNetwork("http://example.com/index.html"); assertFalse(isPrivate);
9494
isPrivate = Security.isPrivateNetwork("example.com"); assertFalse(isPrivate);
95+
96+
//TODO: what about things like "raspberrypi.local" or "my-pc.localhost" ?
9597
}
9698

9799
}

0 commit comments

Comments
 (0)