Author: woonsan
Date: Fri Nov 13 15:01:34 2009
New Revision: 835870

URL: http://svn.apache.org/viewvc?rev=835870&view=rev
Log:
JS2-979: Code clean up

Modified:
    
portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/security/mfa/impl/DefaultJPEGImgDecoder.java

Modified: 
portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/security/mfa/impl/DefaultJPEGImgDecoder.java
URL: 
http://svn.apache.org/viewvc/portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/security/mfa/impl/DefaultJPEGImgDecoder.java?rev=835870&r1=835869&r2=835870&view=diff
==============================================================================
--- 
portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/security/mfa/impl/DefaultJPEGImgDecoder.java
 (original)
+++ 
portals/jetspeed-2/applications/j2-admin/trunk/src/main/java/org/apache/jetspeed/security/mfa/impl/DefaultJPEGImgDecoder.java
 Fri Nov 13 15:01:34 2009
@@ -8,11 +8,17 @@
 
 public class DefaultJPEGImgDecoder implements JPEGImgDecoder
 {
-
+    private static Class jpegCodecClazz;
+    
     public BufferedImage decodeAsBufferedImage(InputStream input) throws 
Exception
     {
-        Class codecClazz = Class.forName("com.sun.image.codec.jpeg.JPEGCodec");
-        Object decoder = MethodUtils.invokeStaticMethod(codecClazz, 
"createJPEGDecoder", input);
+        if (jpegCodecClazz == null)
+        {
+            jpegCodecClazz = 
Class.forName("com.sun.image.codec.jpeg.JPEGCodec");
+        }
+        
+        Object decoder = MethodUtils.invokeStaticMethod(jpegCodecClazz, 
"createJPEGDecoder", input);
+        
         return (BufferedImage) MethodUtils.invokeMethod(decoder, 
"decodeAsBufferedImage", null);
     }
     



---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to