Skip to content

Commit ab96460

Browse files
authored
Fix small things (jMonkeyEngine#1287)
* JmeVersion: Don't throw a NullPointerException when version.properties can't be found. * ImplHandler: Reduce Code-Duplication by using a multi-catch statement
1 parent f268d00 commit ab96460

File tree

2 files changed

+5
-10
lines changed

2 files changed

+5
-10
lines changed

jme3-core/src/main/java/com/jme3/asset/ImplHandler.java

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2009-2012 jMonkeyEngine
2+
* Copyright (c) 2009-2020 jMonkeyEngine
33
* All rights reserved.
44
*
55
* Redistribution and use in source and binary forms, with or without
@@ -120,16 +120,11 @@ protected T initialValue(){
120120
((AssetLocator)obj).setRootPath(path);
121121
}
122122
return obj;
123-
} catch (InstantiationException ex) {
123+
} catch (InstantiationException | IllegalAccessException ex) {
124124
logger.log(Level.SEVERE,"Cannot create locator of type {0}, does"
125-
+ " the class have an empty and publically accessible"+
125+
+ " the class have an empty and publicly accessible"+
126126
" constructor?", type.getName());
127127
logger.throwing(type.getName(), "<init>", ex);
128-
} catch (IllegalAccessException ex) {
129-
logger.log(Level.SEVERE,"Cannot create locator of type {0}, "
130-
+ "does the class have an empty and publically "
131-
+ "accessible constructor?", type.getName());
132-
logger.throwing(type.getName(), "<init>", ex);
133128
}
134129
return null;
135130
}

jme3-core/src/main/java/com/jme3/system/JmeVersion.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright (c) 2009-2015 jMonkeyEngine
2+
* Copyright (c) 2009-2020 jMonkeyEngine
33
* All rights reserved.
44
*
55
* Redistribution and use in source and binary forms, with or without
@@ -49,7 +49,7 @@ public class JmeVersion {
4949
static {
5050
try {
5151
props.load(JmeVersion.class.getResourceAsStream("version.properties"));
52-
} catch (IOException ex) {
52+
} catch (IOException | NullPointerException ex) {
5353
logger.log(Level.WARNING, "Unable to read version info!", ex);
5454
}
5555
}

0 commit comments

Comments
 (0)