Return-Path: Delivered-To: apmail-harmony-commits-archive@www.apache.org Received: (qmail 79239 invoked from network); 11 Mar 2008 17:46:42 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 11 Mar 2008 17:46:42 -0000 Received: (qmail 77102 invoked by uid 500); 11 Mar 2008 17:46:39 -0000 Delivered-To: apmail-harmony-commits-archive@harmony.apache.org Received: (qmail 77009 invoked by uid 500); 11 Mar 2008 17:46:38 -0000 Mailing-List: contact commits-help@harmony.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@harmony.apache.org Delivered-To: mailing list commits@harmony.apache.org Received: (qmail 77000 invoked by uid 99); 11 Mar 2008 17:46:38 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Mar 2008 10:46:38 -0700 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 11 Mar 2008 17:46:08 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 90D661A9832; Tue, 11 Mar 2008 10:46:18 -0700 (PDT) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r636031 - in /harmony/enhanced/classlib/trunk/modules/awt/src/main/java: common/java/awt/ common/java/awt/color/ common/java/awt/print/ common/org/apache/harmony/awt/ common/org/apache/harmony/awt/gl/font/fontlib/ common/org/apache/harmony/... Date: Tue, 11 Mar 2008 17:46:02 -0000 To: commits@harmony.apache.org From: apavlenko@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080311174618.90D661A9832@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: apavlenko Date: Tue Mar 11 10:45:57 2008 New Revision: 636031 URL: http://svn.apache.org/viewvc?rev=636031&view=rev Log: Secured actions wrapped in PrivilegedAction objects Modified: harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Component.java harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Cursor.java harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Font.java harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/GraphicsEnvironment.java harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Toolkit.java harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Window.java harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/color/ICC_Profile.java harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/print/PrinterJob.java harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/Utils.java harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/gl/font/fontlib/FLFontManager.java harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/im/IMManager.java harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/theme/DefaultFileDialog.java harmony/enhanced/classlib/trunk/modules/awt/src/main/java/unix/org/apache/harmony/awt/gl/linux/LinuxGraphics2DFactory.java harmony/enhanced/classlib/trunk/modules/awt/src/main/java/unix/org/apache/harmony/awt/gl/linux/XGraphicsDevice.java harmony/enhanced/classlib/trunk/modules/awt/src/main/java/unix/org/apache/harmony/awt/wtk/linux/XServerConnection.java harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/gl/windows/GDIPTextRenderer.java harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/gl/windows/WinGraphicsDevice.java harmony/enhanced/classlib/trunk/modules/awt/src/main/java/windows/org/apache/harmony/awt/theme/windows/WinFileDialog.java Modified: harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Component.java URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Component.java?rev=636031&r1=636030&r2=636031&view=diff ============================================================================== --- harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Component.java (original) +++ harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Component.java Tue Mar 11 10:45:57 2008 @@ -947,8 +947,8 @@ PrivilegedAction action = new PrivilegedAction() { public String[] run() { String properties[] = new String[2]; - properties[0] = System.getProperty("awt.image.redrawrate", "100"); //$NON-NLS-1$ //$NON-NLS-2$ - properties[1] = System.getProperty("awt.image.incrementaldraw", "true"); //$NON-NLS-1$ //$NON-NLS-2$ + properties[0] = org.apache.harmony.awt.Utils.getSystemProperty("awt.image.redrawrate", "100"); //$NON-NLS-1$ //$NON-NLS-2$ + properties[1] = org.apache.harmony.awt.Utils.getSystemProperty("awt.image.incrementaldraw", "true"); //$NON-NLS-1$ //$NON-NLS-2$ return properties; } }; Modified: harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Cursor.java URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Cursor.java?rev=636031&r1=636030&r2=636031&view=diff ============================================================================== --- harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Cursor.java (original) +++ harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Cursor.java Tue Mar 11 10:45:57 2008 @@ -195,7 +195,7 @@ } String sep = File.separator; String cursorsDir = "lib" + sep + "images" + sep + "cursors"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - String cursorsAbsDir = System.getProperty("java.home") + sep + //$NON-NLS-1$ + String cursorsAbsDir = org.apache.harmony.awt.Utils.getSystemProperty("java.home") + sep + //$NON-NLS-1$ cursorsDir; String cursorPropsFileName = "cursors.properties"; //$NON-NLS-1$ String cursorPropsFullFileName = (cursorsAbsDir + sep + Modified: harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Font.java URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Font.java?rev=636031&r1=636030&r2=636031&view=diff ============================================================================== --- harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Font.java (original) +++ harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Font.java Tue Mar 11 10:45:57 2008 @@ -593,7 +593,7 @@ } public static Font getFont(String sp, Font f) { - String pr = System.getProperty(sp); + String pr = org.apache.harmony.awt.Utils.getSystemProperty(sp); if (pr == null) { return f; } Modified: harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/GraphicsEnvironment.java URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/GraphicsEnvironment.java?rev=636031&r1=636030&r2=636031&view=diff ============================================================================== --- harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/GraphicsEnvironment.java (original) +++ harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/GraphicsEnvironment.java Tue Mar 11 10:45:57 2008 @@ -61,11 +61,7 @@ public static boolean isHeadless() { if (isHeadless == null) { - isHeadless = AccessController.doPrivileged(new PrivilegedAction() { - public Boolean run() { - return "true".equals(System.getProperty("java.awt.headless")); //$NON-NLS-1$ //$NON-NLS-2$ - } - }); + isHeadless = "true".equals(org.apache.harmony.awt.Utils.getSystemProperty("java.awt.headless")); //$NON-NLS-1$ //$NON-NLS-2$ } return isHeadless.booleanValue(); 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=636031&r1=636030&r2=636031&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 Tue Mar 11 10:45:57 2008 @@ -1276,12 +1276,8 @@ private static Theme createTheme() { String osName = System.getProperty("os.name").toLowerCase(); //$NON-NLS-1$ String packageBase = "org.apache.harmony.awt.theme", win = "windows", lin = "linux"; //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ - PrivilegedAction action = new PrivilegedAction() { - public String run() { - return System.getProperty("awt.theme"); //$NON-NLS-1$ - } - }; - String className = AccessController.doPrivileged(action); + String className = org.apache.harmony.awt.Utils.getSystemProperty("awt.theme"); //$NON-NLS-1$ + if (className == null) { if (osName.startsWith(lin)) { className = packageBase + "." + lin + ".LinuxTheme"; //$NON-NLS-1$ //$NON-NLS-2$ Modified: harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Window.java URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Window.java?rev=636031&r1=636030&r2=636031&view=diff ============================================================================== --- harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Window.java (original) +++ harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/Window.java Tue Mar 11 10:45:57 2008 @@ -662,12 +662,9 @@ if (sm.checkTopLevelWindow(this)) { return null; } - PrivilegedAction action = new PrivilegedAction() { - public String run() { - return System.getProperty("awt.appletWarning", "Warning: Java window"); //$NON-NLS-1$ //$NON-NLS-2$ - } - }; - return AccessController.doPrivileged(action); + + return org.apache.harmony.awt.Utils.getSystemProperty( + "awt.appletWarning", "Warning: Java window"); //$NON-NLS-1$ //$NON-NLS-2$ } public boolean isActive() { Modified: harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/color/ICC_Profile.java URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/color/ICC_Profile.java?rev=636031&r1=636030&r2=636031&view=diff ============================================================================== --- harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/color/ICC_Profile.java (original) +++ harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/color/ICC_Profile.java Tue Mar 11 10:45:57 2008 @@ -586,19 +586,19 @@ } catch (FileNotFoundException e) {} // Check java.iccprofile.path entries - fiStream = tryPath(System.getProperty("java.iccprofile.path"), fName); //$NON-NLS-1$ + fiStream = tryPath(org.apache.harmony.awt.Utils.getSystemProperty("java.iccprofile.path"), fName); //$NON-NLS-1$ if (fiStream != null) { return fiStream; } // Check java.class.path entries - fiStream = tryPath(System.getProperty("java.class.path"), fName); //$NON-NLS-1$ + fiStream = tryPath(org.apache.harmony.awt.Utils.getSystemProperty("java.class.path"), fName); //$NON-NLS-1$ if (fiStream != null) { return fiStream; } // Check directory with java sample profiles - String home = System.getProperty("java.home"); //$NON-NLS-1$ + String home = org.apache.harmony.awt.Utils.getSystemProperty("java.home"); //$NON-NLS-1$ if (home != null) { fiStream = tryPath( home + File.separatorChar + Modified: harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/print/PrinterJob.java URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/print/PrinterJob.java?rev=636031&r1=636030&r2=636031&view=diff ============================================================================== --- harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/print/PrinterJob.java (original) +++ harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/java/awt/print/PrinterJob.java Tue Mar 11 10:45:57 2008 @@ -77,7 +77,7 @@ return AccessController.doPrivileged( new PrivilegedAction() { public PrinterJob run() { - String s = System.getProperty("java.awt.printerjob"); //$NON-NLS-1$ + String s = org.apache.harmony.awt.Utils.getSystemProperty("java.awt.printerjob"); //$NON-NLS-1$ if (s == null || s.equals("")){ //$NON-NLS-1$ s = "java.awt.print.PrinterJobImpl"; //$NON-NLS-1$ Modified: harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/Utils.java URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/Utils.java?rev=636031&r1=636030&r2=636031&view=diff ============================================================================== --- harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/Utils.java (original) +++ harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/Utils.java Tue Mar 11 10:45:57 2008 @@ -25,9 +25,13 @@ public final class Utils { public static String getSystemProperty(final String name) { + return getSystemProperty(name, null); + } + + public static String getSystemProperty(final String name, final String value) { return AccessController.doPrivileged(new PrivilegedAction() { public String run() { - return System.getProperty(name); + return System.getProperty(name, value); } }); } Modified: harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/gl/font/fontlib/FLFontManager.java URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/gl/font/fontlib/FLFontManager.java?rev=636031&r1=636030&r2=636031&view=diff ============================================================================== --- harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/gl/font/fontlib/FLFontManager.java (original) +++ harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/gl/font/fontlib/FLFontManager.java Tue Mar 11 10:45:57 2008 @@ -52,7 +52,7 @@ initManager(); - addPath(new File(System.getProperty("java.home") + "/lib/fonts/")); + addPath(new File(org.apache.harmony.awt.Utils.getSystemProperty("java.home") + "/lib/fonts/")); addPath(new File("C:\\WINNT\\Fonts")); addPath(new File("/usr/X11R6/lib/X11/fonts/Type1/")); addPath(new File("/usr/X11R6/lib/X11/fonts/truetype/")); Modified: harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/im/IMManager.java URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/im/IMManager.java?rev=636031&r1=636030&r2=636031&view=diff ============================================================================== --- harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/im/IMManager.java (original) +++ harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/im/IMManager.java Tue Mar 11 10:45:57 2008 @@ -316,7 +316,7 @@ private static String getInputStyle() { String propName = INPUT_STYLE_PROP; - String inputStyle = System.getProperty(propName); + String inputStyle = org.apache.harmony.awt.Utils.getSystemProperty(propName); if (inputStyle != null) { return inputStyle; } Modified: harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/theme/DefaultFileDialog.java URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/theme/DefaultFileDialog.java?rev=636031&r1=636030&r2=636031&view=diff ============================================================================== --- harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/theme/DefaultFileDialog.java (original) +++ harmony/enhanced/classlib/trunk/modules/awt/src/main/java/common/org/apache/harmony/awt/theme/DefaultFileDialog.java Tue Mar 11 10:45:57 2008 @@ -229,7 +229,7 @@ } private File getDefaultFolder() { - return new File(System.getProperty("user.dir")); //$NON-NLS-1$ + return new File(org.apache.harmony.awt.Utils.getSystemProperty("user.dir")); //$NON-NLS-1$ } private void addListeners() { Modified: harmony/enhanced/classlib/trunk/modules/awt/src/main/java/unix/org/apache/harmony/awt/gl/linux/LinuxGraphics2DFactory.java URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/unix/org/apache/harmony/awt/gl/linux/LinuxGraphics2DFactory.java?rev=636031&r1=636030&r2=636031&view=diff ============================================================================== --- harmony/enhanced/classlib/trunk/modules/awt/src/main/java/unix/org/apache/harmony/awt/gl/linux/LinuxGraphics2DFactory.java (original) +++ harmony/enhanced/classlib/trunk/modules/awt/src/main/java/unix/org/apache/harmony/awt/gl/linux/LinuxGraphics2DFactory.java Tue Mar 11 10:45:57 2008 @@ -45,7 +45,7 @@ inst = new LinuxGraphics2DFactory(); } public Graphics2D getGraphics2D(NativeWindow nw, int tx, int ty, MultiRectArea clip) { - String opengl = System.getProperty("java2d.opengl"); //$NON-NLS-1$ + String opengl = org.apache.harmony.awt.Utils.getSystemProperty("java2d.opengl"); //$NON-NLS-1$ boolean useOpenGL = opengl != null && opengl.equals("true"); //$NON-NLS-1$ return useOpenGL ? (Graphics2D) new OGLGraphics2D(nw, tx, ty, clip) : @@ -53,7 +53,7 @@ } public Graphics2D getGraphics2D(NativeWindow nw, int tx, int ty, int width, int height) { - String opengl = System.getProperty("java2d.opengl"); //$NON-NLS-1$ + String opengl = org.apache.harmony.awt.Utils.getSystemProperty("java2d.opengl"); //$NON-NLS-1$ boolean useOpenGL = opengl != null && opengl.equals("true"); //$NON-NLS-1$ return useOpenGL ? (Graphics2D) new OGLGraphics2D(nw, tx, ty, width, height) : Modified: harmony/enhanced/classlib/trunk/modules/awt/src/main/java/unix/org/apache/harmony/awt/gl/linux/XGraphicsDevice.java URL: http://svn.apache.org/viewvc/harmony/enhanced/classlib/trunk/modules/awt/src/main/java/unix/org/apache/harmony/awt/gl/linux/XGraphicsDevice.java?rev=636031&r1=636030&r2=636031&view=diff ============================================================================== --- harmony/enhanced/classlib/trunk/modules/awt/src/main/java/unix/org/apache/harmony/awt/gl/linux/XGraphicsDevice.java (original) +++ harmony/enhanced/classlib/trunk/modules/awt/src/main/java/unix/org/apache/harmony/awt/gl/linux/XGraphicsDevice.java Tue Mar 11 10:45:57 2008 @@ -131,7 +131,7 @@ // Allocate array for configurations configs = new XGraphicsConfiguration[numVisualInfos]; - String opengl = System.getProperty("java2d.opengl"); //$NON-NLS-1$ + String opengl = org.apache.harmony.awt.Utils.getSystemProperty("java2d.opengl"); //$NON-NLS-1$ boolean useOpenGL = opengl != null && opengl.equals("true"); //$NON-NLS-1$ for (int i=0; i