harmony-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hinde...@apache.org
Subject svn commit: r776097 - /harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Toolkit.java
Date Mon, 18 May 2009 21:19:17 GMT
Author: hindessm
Date: Mon May 18 21:19:15 2009
New Revision: 776097

URL: http://svn.apache.org/viewvc?rev=776097&view=rev
Log:
Oops.  Reverting inadvertant change that was present in my workspace when
I committed the copyright changes in r776088.

Modified:
    harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Toolkit.java

Modified: harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Toolkit.java
URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Toolkit.java?rev=776097&r1=776096&r2=776097&view=diff
==============================================================================
--- harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Toolkit.java
(original)
+++ harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Toolkit.java
Mon May 18 21:19:15 2009
@@ -468,13 +468,6 @@
             }
             staticLockAWT();
             try {
-                String className = org.apache.harmony.awt.Utils.getSystemProperty("awt.toolkit");
//$NON-NLS-1$
-            	if (null != className) {
-                    try {
-                        defToolkit = (Toolkit) Class.forName(className).newInstance();
-                    } catch (Exception e) {}
-            	}
-            	if (null == defToolkit)
                 defToolkit = GraphicsEnvironment.isHeadless() ?
                         new HeadlessToolkit() : new ToolkitImpl();
                 ContextStorage.setDefaultToolkit(defToolkit);
@@ -482,6 +475,9 @@
             } finally {
                 staticUnlockAWT();
             }
+            //TODO: read system property named awt.toolkit
+            //and create an instance of the specified class,
+            //by default use ToolkitImpl
         }
     }
 
@@ -500,16 +496,13 @@
     private static String getWTKClassName() {
         String osName = System.getProperty("os.name").toLowerCase(); //$NON-NLS-1$
         String packageBase = "org.apache.harmony.awt.wtk", win = "windows", lin = "linux";
//$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
-        String className = org.apache.harmony.awt.Utils.getSystemProperty("awt.wtk"); //$NON-NLS-1$
-
-        if (className == null) {
         if (osName.startsWith(lin)) {
-                className = packageBase + "." + lin + ".LinuxWTK"; //$NON-NLS-1$ //$NON-NLS-2$
-            } else if (osName.startsWith(win)) {
-                className = packageBase + "." + win + ".WinWTK"; //$NON-NLS-1$ //$NON-NLS-2$
+            return packageBase + "." + lin + ".LinuxWTK"; //$NON-NLS-1$ //$NON-NLS-2$
         }
+        if (osName.startsWith(win)) {
+            return packageBase + "." + win + ".WinWTK"; //$NON-NLS-1$ //$NON-NLS-2$
         }
-        return className;
+        return null;
     }
 
     Component getComponentById(long id) {



Mime
View raw message