IDEMPIERE-367 Java 7 support

This commit is contained in:
Carlos Ruiz 2012-08-12 20:51:11 -05:00
parent f28f327cbe
commit 8c5c4ff1d7
4 changed files with 13 additions and 38 deletions

View File

@ -52,6 +52,8 @@ syntax: regexp
^org\.adempiere\.ui\.zk/dist$ ^org\.adempiere\.ui\.zk/dist$
^org\.adempiere\.ui\.zk/WEB-INF/classes/.*\.class$ ^org\.adempiere\.ui\.zk/WEB-INF/classes/.*\.class$
^org\.adempiere\.ui\.zk/WEB-INF/classes/.*\.xml$ ^org\.adempiere\.ui\.zk/WEB-INF/classes/.*\.xml$
^org\.adempiere\.ui\.zk/WEB-INF/classes/.*\.js$
^org\.adempiere\.ui\.zk/WEB-INF/classes/.*\.wpd$
syntax: regexp syntax: regexp
^lib/plugins$ ^lib/plugins$

View File

@ -16,8 +16,6 @@
*****************************************************************************/ *****************************************************************************/
package org.compiere.util; package org.compiere.util;
import java.io.UnsupportedEncodingException;
import java.security.NoSuchAlgorithmException;
import java.security.Principal; import java.security.Principal;
import java.sql.Connection; import java.sql.Connection;
import java.sql.PreparedStatement; import java.sql.PreparedStatement;
@ -106,32 +104,25 @@ public class Login
{ {
// Java System version check // Java System version check
String jVersion = System.getProperty("java.version"); String jVersion = System.getProperty("java.version");
if (jVersion.startsWith("1.5.0")) //vpj-cd e-evolution support to java 6
if (jVersion.startsWith("1.6.0"))
return true; return true;
//vpj-cd e-evolution support to java 6 //end
if (jVersion.startsWith("1.6.0")) if (jVersion.startsWith("1.7.0"))
return true; return true;
//end
// Warning
boolean ok = false;
// if (jVersion.startsWith("1.4")
// || jVersion.startsWith("1.5.1")) // later/earlier release
// ok = true;
// Error Message // Error Message
StringBuffer msg = new StringBuffer(); StringBuffer msg = new StringBuffer();
msg.append(System.getProperty("java.vm.name")).append(" - ").append(jVersion); msg.append(System.getProperty("java.vm.name")).append(" - ").append(jVersion);
if (ok) msg.append(" <> 1.6.0 | 1.7.0");
msg.append("(untested)");
msg.append(" <> 1.5.0");
// //
if (isClient) if (isClient)
JOptionPane.showMessageDialog(null, msg.toString(), JOptionPane.showMessageDialog(null, msg.toString(),
org.compiere.Adempiere.getName() + " - Java Version Check", org.compiere.Adempiere.getName() + " - Java Version Check",
ok ? JOptionPane.WARNING_MESSAGE : JOptionPane.ERROR_MESSAGE); JOptionPane.ERROR_MESSAGE);
else else
log.severe(msg.toString()); log.severe(msg.toString());
return ok; return false;
} // isJavaOK } // isJavaOK

View File

@ -30,16 +30,13 @@ import java.awt.geom.RectangularShape;
import java.awt.geom.RoundRectangle2D; import java.awt.geom.RoundRectangle2D;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
import java.io.File; import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException; import java.net.MalformedURLException;
import java.net.URL; import java.net.URL;
import java.util.logging.Logger; import java.util.logging.Logger;
import javax.imageio.ImageIO;
import javax.swing.JComponent; import javax.swing.JComponent;
import com.sun.image.codec.jpeg.JPEGCodec;
import com.sun.image.codec.jpeg.JPEGImageDecoder;
/** /**
* UI utilities * UI utilities
@ -420,30 +417,15 @@ public class CompiereUtils
BufferedImage image = null; BufferedImage image = null;
if (url != null) if (url != null)
{ {
InputStream in = null;
try try
{ {
in = url.openStream(); image = ImageIO.read(url);
JPEGImageDecoder decoder = JPEGCodec.createJPEGDecoder(in);
image = decoder.decodeAsBufferedImage();
} }
catch (Exception e) catch (Exception e)
{ {
log.severe("URL: " + url + " - " + e.getMessage()); log.severe("URL: " + url + " - " + e.getMessage());
image = null; image = null;
} }
finally
{
try
{
if (in != null)
in.close();
}
catch (IOException ioe)
{
log.severe("URL: " + url + " - " + ioe.getMessage());
}
}
if (image != null) if (image != null)
{ {
log.config("Image type : " + image.getType()); log.config("Image type : " + image.getType());

View File

@ -130,7 +130,7 @@ public class Viewer extends CFrame
/** /**
* *
*/ */
private static final long serialVersionUID = 3453340777183200393L; private static final long serialVersionUID = 3766771249690413641L;
/** /**
* @deprecated * @deprecated
@ -467,7 +467,7 @@ public class Viewer extends CFrame
/** /**
* Revalidate settings after change of environment * Revalidate settings after change of environment
*/ */
private void revalidate() public void revalidate()
{ {
m_pageMax = m_viewPanel.getPageCount(); m_pageMax = m_viewPanel.getPageCount();
spinnerModel.setMaximum(new Integer(m_pageMax)); spinnerModel.setMaximum(new Integer(m_pageMax));