aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/com/jogamp/common/util/VersionUtil.java
diff options
context:
space:
mode:
authorSven Gothel <[email protected]>2014-07-03 16:06:47 +0200
committerSven Gothel <[email protected]>2014-07-03 16:06:47 +0200
commitdf9ff7f340a5ab4e07efc613f5f264eeae63d4c7 (patch)
tree239ae276b82024b140428e6c0fe5d739fdd686a4 /src/java/com/jogamp/common/util/VersionUtil.java
parenteb47aaba63e3b1bf55f274a0f338f1010a017ae4 (diff)
Code Clean-Up based on our Recommended Settings (jogamp-scripting c47bc86ae2ee268a1f38c5580d11f93d7f8d6e74)
Code Clean-Up based on our Recommended Settings (jogamp-scripting c47bc86ae2ee268a1f38c5580d11f93d7f8d6e74) - Change non static accesses to static members using declaring type - Change indirect accesses to static members to direct accesses (accesses through subtypes) - Add final modifier to private fields - Add final modifier to method parameters - Add final modifier to local variables - Remove unnecessary casts - Remove unnecessary '$NON-NLS$' tags - Remove trailing white spaces on all lines
Diffstat (limited to 'src/java/com/jogamp/common/util/VersionUtil.java')
-rw-r--r--src/java/com/jogamp/common/util/VersionUtil.java26
1 files changed, 14 insertions, 12 deletions
diff --git a/src/java/com/jogamp/common/util/VersionUtil.java b/src/java/com/jogamp/common/util/VersionUtil.java
index c4451ac..6949d62 100644
--- a/src/java/com/jogamp/common/util/VersionUtil.java
+++ b/src/java/com/jogamp/common/util/VersionUtil.java
@@ -40,6 +40,8 @@ import java.util.Set;
import java.util.jar.Attributes;
import java.util.jar.Manifest;
+import jogamp.common.os.PlatformPropsImpl;
+
public class VersionUtil {
public static final String SEPERATOR = "-----------------------------------------------------------------------------------------------------";
@@ -68,7 +70,7 @@ public class VersionUtil {
Platform.getMachineDescription().toString(sb).append(Platform.getNewline());
// JVM/JRE
- sb.append("Platform: Java Version: ").append(Platform.getJavaVersion()).append(" (").append(Platform.getJavaVersionNumber()).append("u").append(Platform.JAVA_VERSION_UPDATE).append("), VM: ").append(Platform.getJavaVMName());
+ sb.append("Platform: Java Version: ").append(Platform.getJavaVersion()).append(" (").append(Platform.getJavaVersionNumber()).append("u").append(PlatformPropsImpl.JAVA_VERSION_UPDATE).append("), VM: ").append(Platform.getJavaVMName());
sb.append(", Runtime: ").append(Platform.getJavaRuntimeName()).append(Platform.getNewline());
sb.append("Platform: Java Vendor: ").append(Platform.getJavaVendor()).append(", ").append(Platform.getJavaVendorURL());
sb.append(", JavaSE: ").append(Platform.isJavaSE());
@@ -94,7 +96,7 @@ public class VersionUtil {
* @param extension The value of the 'Extension-Name' jar-manifest attribute; used to identify the manifest.
* @return the requested manifest or null when not found.
*/
- public static Manifest getManifest(ClassLoader cl, String extension) {
+ public static Manifest getManifest(final ClassLoader cl, final String extension) {
return getManifest(cl, new String[] { extension } );
}
@@ -106,10 +108,10 @@ public class VersionUtil {
* Matching is applied in decreasing order, i.e. first element is favored over the second, etc.
* @return the requested manifest or null when not found.
*/
- public static Manifest getManifest(ClassLoader cl, String[] extensions) {
+ public static Manifest getManifest(final ClassLoader cl, final String[] extensions) {
final Manifest[] extManifests = new Manifest[extensions.length];
try {
- Enumeration<URL> resources = cl.getResources("META-INF/MANIFEST.MF");
+ final Enumeration<URL> resources = cl.getResources("META-INF/MANIFEST.MF");
while (resources.hasMoreElements()) {
final InputStream is = resources.nextElement().openStream();
final Manifest manifest;
@@ -118,7 +120,7 @@ public class VersionUtil {
} finally {
IOUtil.close(is, false);
}
- Attributes attributes = manifest.getMainAttributes();
+ final Attributes attributes = manifest.getMainAttributes();
if(attributes != null) {
for(int i=0; i < extensions.length && null == extManifests[i]; i++) {
final String extension = extensions[i];
@@ -131,7 +133,7 @@ public class VersionUtil {
}
}
}
- } catch (IOException ex) {
+ } catch (final IOException ex) {
throw new RuntimeException("Unable to read manifest.", ex);
}
for(int i=1; i<extManifests.length; i++) {
@@ -142,7 +144,7 @@ public class VersionUtil {
return null;
}
- public static StringBuilder getFullManifestInfo(Manifest mf, StringBuilder sb) {
+ public static StringBuilder getFullManifestInfo(final Manifest mf, StringBuilder sb) {
if(null==mf) {
return sb;
}
@@ -151,11 +153,11 @@ public class VersionUtil {
sb = new StringBuilder();
}
- Attributes attr = mf.getMainAttributes();
- Set<Object> keys = attr.keySet();
- for(Iterator<Object> iter=keys.iterator(); iter.hasNext(); ) {
- Attributes.Name key = (Attributes.Name) iter.next();
- String val = attr.getValue(key);
+ final Attributes attr = mf.getMainAttributes();
+ final Set<Object> keys = attr.keySet();
+ for(final Iterator<Object> iter=keys.iterator(); iter.hasNext(); ) {
+ final Attributes.Name key = (Attributes.Name) iter.next();
+ final String val = attr.getValue(key);
sb.append(" ");
sb.append(key);
sb.append(" = ");