List of usage examples for org.apache.commons.lang SystemUtils IS_JAVA_1_5
boolean IS_JAVA_1_5
To view the source code for org.apache.commons.lang SystemUtils IS_JAVA_1_5.
Click Source Link
Is true
if this is Java version 1.5 (also 1.5.x versions).
The field will return false
if #JAVA_VERSION is null
.
From source file:org.springmodules.validation.bean.conf.namespace.ValidatorNamespaceHandler.java
/** * @see org.springframework.beans.factory.xml.NamespaceHandlerSupport#init() *///from ww w .ja va 2 s .c om public void init() { registerBeanDefinitionParser("xml-based-validator", new XmlBasedValidatorBeanDefinitionParser()); if (SystemUtils.IS_JAVA_1_5) { registerBeanDefinitionParser("annotation-based-validator", new AnnotationBasedValidatorBeanDefinitionParser()); } }
From source file:VASSAL.tools.BrowserSupport.java
public static void openURL(String url) { ///*from ww w . j av a 2s . c o m*/ // This method is irritatingly complex, because: // * There is no java.awt.Desktop in Java 1.5. // * java.awt.Desktop seems not to work sometimes on Windows. // * BrowserLauncher failes sometimes on Linux, and isn't supported // anymore. // if (!SystemUtils.IS_JAVA_1_5) { if (Desktop.isDesktopSupported()) { final Desktop desktop = Desktop.getDesktop(); if (desktop.isSupported(Desktop.Action.BROWSE)) { try { desktop.browse(new URI(url)); return; } catch (IOException e) { // We ignore this on Windows, because Desktop seems flaky if (!SystemUtils.IS_OS_WINDOWS) { ReadErrorDialog.error(e, url); return; } } catch (IllegalArgumentException e) { ErrorDialog.bug(e); return; } catch (URISyntaxException e) { ErrorDialog.bug(e); return; } } } } if (browserLauncher != null) { browserLauncher.openURLinBrowser(url); } else { ErrorDialog.show("BrowserSupport.unable_to_launch", url); } }
From source file:VASSAL.tools.image.FallbackImageTypeConverter.java
private boolean tryConvertingInMemory(Reference<BufferedImage> ref) { /*//from w ww .ja v a 2s . c om * Having an OutOfMemoryException while converting in memory is * apparently catastrophic on Apple's Java 6 JVM (and possibly also * on their Java 5 JVM as well). In-memory tiling also uses far more * memory than it should on Apple's Java 6 JVM due to * Graphics2D.drawImage making an intermediate copy of the image data. * Hence, we ensure that when using Java 5 or 6 on Mac OS X, we never * try in-memory conversion for images which can't comfortably have * three copies existing simultaneously in memory. */ return !SystemUtils.IS_OS_MAC_OSX || (!SystemUtils.IS_JAVA_1_6 && !SystemUtils.IS_JAVA_1_5) || 4 * ref.obj.getHeight() * ref.obj.getWidth() <= Runtime.getRuntime().maxMemory() / 4; }