Re: [cp-patches] RFC: @file support for gjavah & gjar
Il giorno mer, 04/06/2008 alle 09.08 -0600, Tom Tromey ha scritto: > Some of the indentation seems wrong to me, though I always find it a > bit hard to tell due to diffs making tabs look weird. I don't know if I say a popular thing or not, but please, expand your tabs into spaces, it makes the whole code readable when I look at it using cat and less, sometime is quite hard to understand, especially when we have no brace code like: if (true) doWhatever(); else someThingSeriouslyScrewedIfImHere(); It becomes sometime, for example like: if (true) doWhatever(); else someThingSeriouslyScrewedIfImHere(); due to werid mix of tabs and spaces Thanks, Mario
Re: [cp-patches] RFC: @file support for gjavah & gjar
> "Robert" == Robert Schuster <[EMAIL PROTECTED]> writes: Robert> The other tools are not affected by this change nor does this modify the Robert> core getopt functionality (except that I made the 'programName' field Robert> protected - was private). I don't think we need this to be protected. Instead I think parseFileList and notifyFile can throw an OptionException. Parser will emit the proper error message in this case. At least, I think that should work, since that was the idea behind the OptionException design -- clients can throw an exception and only the parser framework needs to know how to format an error message. If that does not work perhaps we can add a new method to Parser -- I'd rather avoid exposing a field. Some of the indentation seems wrong to me, though I always find it a bit hard to tell due to diffs making tabs look weird. Aside from those things this looks good to me. Robert> + // While not reached end of line ... Robert> +while (start < length) E.g., this comment seems indented improperly. Robert> + public void notifyFile(String fileArgument) Robert> + throws OptionException In context this looks like it should be further to the right. Robert> + { Robert> + if (fileArgument.codePointAt(0) == '@') Robert> + { Likewise this brace. Tom
Re: [cp-patches] RFC: move from gnu.java.security.action.GetPropertyAction to sun.security.action.GetPropertyAction
Hi Robert, On Wed, 2008-06-04 at 10:33 +0100, Andrew John Hughes wrote: > Can we also document each sun.* specific change somewhere? I still > regard these as bugs, but not against either > GNU Classpath or OpenJDK -- against the specification itself. If code > is being relied upon by both class library and external > code, it should be part of the public API. > > Have you checked for or filed a bug with Sun? Or against PhoneME? The problem with using such internal classes for your security checks is that you cannot be sure about the actual security domain they will run in. What is it really that the PhoneME code does? Doesn't it come with its own core class library? Are you trying to replace parts of that? Really the PhoneME code should come with its own convenience class to do this. Cheers, Mark
Re: [cp-patches] RFC: move from gnu.java.security.action.GetPropertyAction to sun.security.action.GetPropertyAction
2008/6/4 Robert Schuster <[EMAIL PROTECTED]>: > Hi, > the attached patch refactors all of Classpath' code to use > sun.security.action.GetPropertyAction instead of > gnu.java.security.action.GetPropertyAction. > > Additionally the class in question is moved to its new package. > > While I don't like the usage of a non-standard API as much as you I also > think that with OpenJDK being available under the GPL it is equally bad > to have > > gnu.java.security.action.GetPropertyAction > > or > > sun.security.action.GetPropertyAction > > But what I think what is even worse is having both. :) > > 2008-06-04 Robert Schuster <[EMAIL PROTECTED]> > > * gnu/java/security/action/GetPropertyAction.java: Removed. > * sun/security/action/GetPropertyAction.java: Copied content > from gnu/java/security/action/GetPropertyAction.java. > * gnu/classpath/debug/Simple1LineFormatter.java: Changed import > of gnu.java.security.action.GetPropertyAction to > sun.security.action.GetPropertyAction > * gnu/classpath/debug/SystemLogger.java: Dito. > * gnu/java/security/PolicyFile.java: Dito. > * gnu/java/security/key/dss/DSSKey.java: Dito. > * gnu/java/security/key/dss/DSSPrivateKey.java: Dito. > * gnu/java/security/key/dss/DSSPublicKey.java: Dito. > * gnu/java/security/key/rsa/GnuRSAKey.java: Dito. > * gnu/java/security/key/rsa/GnuRSAPrivateKey.java: Dito. > * gnu/java/security/key/rsa/GnuRSAPublicKey.java: Dito. > * gnu/javax/crypto/key/dh/GnuDHKey.java: Dito. > * gnu/javax/crypto/key/dh/GnuDHPrivateKey.java: Dito. > * gnu/javax/crypto/key/dh/GnuDHPublicKey.java: Dito. > * gnu/javax/crypto/sasl/plain/PasswordFile.java: Dito. > * gnu/javax/net/ssl/provider/X509TrustManagerFactory.java: Dito. > * gnu/xml/aelfred2/XmlParser.java: Dito. > > Regards > Robert > Can we also document each sun.* specific change somewhere? I still regard these as bugs, but not against either GNU Classpath or OpenJDK -- against the specification itself. If code is being relied upon by both class library and external code, it should be part of the public API. Have you checked for or filed a bug with Sun? -- Andrew :-) Support Free Java! Contribute to GNU Classpath and the OpenJDK http://www.gnu.org/software/classpath http://openjdk.java.net PGP Key: 94EFD9D8 (http://subkeys.pgp.net) Fingerprint: F8EF F1EA 401E 2E60 15FA 7927 142C 2591 94EF D9D8
Re: [cp-patches] RFC: add a copy of gnu/java/security/action/GetPropertyAction into sun/security/action
Robert Schuster wrote: > Hi. > > Andrew Haley schrieb: >>> What is the public equivalent for GetPropertyAction? >> There isn't any need, is there? > That depends. :) > >> It's just a wrapper for >> (String) AccessController.doPrivileged(new PrivilegedAction() { >> public java.lang.Object run() { >> return System.getProperty(prop); } >> }); > That is certainly true but has the nasty side effect of creating an > anonymous class per code location. In the PhoneME code I found ~20 > occurrences of GetPropertyAction. Even in Classpath we avoided that by > introducing our own wrapper class. Sure, but it's an *internal* class for use within Classpath. Basic modularity concerns indicate that modules don't use each other's internal convenience classes. Your proposed patch is a regression IMO. Andrew.
Re: [cp-patches] RFC: add a copy of gnu/java/security/action/GetPropertyAction into sun/security/action
Hi. Andrew Haley schrieb: >> What is the public equivalent for GetPropertyAction? > > There isn't any need, is there? That depends. :) > It's just a wrapper for > (String) AccessController.doPrivileged(new PrivilegedAction() { > public java.lang.Object run() { > return System.getProperty(prop); } > }); That is certainly true but has the nasty side effect of creating an anonymous class per code location. In the PhoneME code I found ~20 occurrences of GetPropertyAction. Even in Classpath we avoided that by introducing our own wrapper class. Regards Robert signature.asc Description: OpenPGP digital signature
[cp-patches] RFC: move from gnu.java.security.action.GetPropertyAction to sun.security.action.GetPropertyAction
Hi, the attached patch refactors all of Classpath' code to use sun.security.action.GetPropertyAction instead of gnu.java.security.action.GetPropertyAction. Additionally the class in question is moved to its new package. While I don't like the usage of a non-standard API as much as you I also think that with OpenJDK being available under the GPL it is equally bad to have gnu.java.security.action.GetPropertyAction or sun.security.action.GetPropertyAction But what I think what is even worse is having both. :) 2008-06-04 Robert Schuster <[EMAIL PROTECTED]> * gnu/java/security/action/GetPropertyAction.java: Removed. * sun/security/action/GetPropertyAction.java: Copied content from gnu/java/security/action/GetPropertyAction.java. * gnu/classpath/debug/Simple1LineFormatter.java: Changed import of gnu.java.security.action.GetPropertyAction to sun.security.action.GetPropertyAction * gnu/classpath/debug/SystemLogger.java: Dito. * gnu/java/security/PolicyFile.java: Dito. * gnu/java/security/key/dss/DSSKey.java: Dito. * gnu/java/security/key/dss/DSSPrivateKey.java: Dito. * gnu/java/security/key/dss/DSSPublicKey.java: Dito. * gnu/java/security/key/rsa/GnuRSAKey.java: Dito. * gnu/java/security/key/rsa/GnuRSAPrivateKey.java: Dito. * gnu/java/security/key/rsa/GnuRSAPublicKey.java: Dito. * gnu/javax/crypto/key/dh/GnuDHKey.java: Dito. * gnu/javax/crypto/key/dh/GnuDHPrivateKey.java: Dito. * gnu/javax/crypto/key/dh/GnuDHPublicKey.java: Dito. * gnu/javax/crypto/sasl/plain/PasswordFile.java: Dito. * gnu/javax/net/ssl/provider/X509TrustManagerFactory.java: Dito. * gnu/xml/aelfred2/XmlParser.java: Dito. Regards Robert Index: gnu/classpath/debug/Simple1LineFormatter.java === RCS file: /sources/classpath/classpath/gnu/classpath/debug/Simple1LineFormatter.java,v retrieving revision 1.3 diff -u -r1.3 Simple1LineFormatter.java --- gnu/classpath/debug/Simple1LineFormatter.java 11 Jul 2006 16:03:59 - 1.3 +++ gnu/classpath/debug/Simple1LineFormatter.java 4 Jun 2008 08:51:55 - @@ -38,8 +38,6 @@ package gnu.classpath.debug; -import gnu.java.security.action.GetPropertyAction; - import java.io.PrintWriter; import java.io.StringWriter; import java.security.AccessController; @@ -51,6 +49,8 @@ import java.util.logging.Formatter; import java.util.logging.LogRecord; +import sun.security.action.GetPropertyAction; + /** * A simple 1-line formatter to use instead of the 2-line SimpleFormatter used * by default in the JDK logging handlers. Index: gnu/classpath/debug/SystemLogger.java === RCS file: /sources/classpath/classpath/gnu/classpath/debug/SystemLogger.java,v retrieving revision 1.3 diff -u -r1.3 SystemLogger.java --- gnu/classpath/debug/SystemLogger.java 10 Dec 2006 20:25:41 - 1.3 +++ gnu/classpath/debug/SystemLogger.java 4 Jun 2008 08:51:55 - @@ -38,13 +38,13 @@ package gnu.classpath.debug; -import gnu.java.security.action.GetPropertyAction; - import java.security.AccessController; import java.util.StringTokenizer; import java.util.logging.Level; import java.util.logging.Logger; +import sun.security.action.GetPropertyAction; + public final class SystemLogger extends Logger { public static final SystemLogger SYSTEM = new SystemLogger(); Index: gnu/java/security/PolicyFile.java === RCS file: /sources/classpath/classpath/gnu/java/security/PolicyFile.java,v retrieving revision 1.10 diff -u -r1.10 PolicyFile.java --- gnu/java/security/PolicyFile.java 5 May 2008 17:12:40 - 1.10 +++ gnu/java/security/PolicyFile.java 4 Jun 2008 08:51:55 - @@ -41,7 +41,6 @@ import gnu.classpath.debug.SystemLogger; import gnu.java.lang.CPStringBuilder; -import gnu.java.security.action.GetPropertyAction; import java.io.File; import java.io.IOException; @@ -74,6 +73,8 @@ import java.util.StringTokenizer; import java.util.logging.Logger; +import sun.security.action.GetPropertyAction; + /** * An implementation of a [EMAIL PROTECTED] java.security.Policy} object whose * permissions are specified by a policy file. Index: gnu/java/security/action/GetPropertyAction.java === RCS file: gnu/java/security/action/GetPropertyAction.java diff -N gnu/java/security/action/GetPropertyAction.java --- gnu/java/security/action/GetPropertyAction.java 10 Dec 2006 20:25:42 - 1.4 +++ /dev/null 1 Jan 1970 00:00:00 - @@ -1,89 +0,0 @@ -/* GetPropertyAction.java - Copyright (C) 2004 Free Software Foundation, Inc. - -This file is part of GNU Classpath. - -GNU Classpath is free software; you can redistribute it and/or modify -it under the terms of the GNU General Public License as published by -the Free Software Foundation; either version 2, or (at your option) -any later version. - -GNU Classpath is distributed in
Re: [cp-patches] RFC: add a copy of gnu/java/security/action/GetPropertyAction into sun/security/action
Robert Schuster wrote: > Hi, > > Andrew John Hughes schrieb: >>> 2008-06-03 Robert Schuster <[EMAIL PROTECTED]> >>> >>> * sun/security/action/GetPropertyAction.java: Functional copy >>> of gnu/java/security/action/GetPropertyAction.java. >>> >>> Regards >>> Robert >>> >> >> Er... fix the binary which is clearly broken by relying on internal >> unspecified classes. > What is the public equivalent for GetPropertyAction? There isn't any need, is there? It's just a wrapper for (String) AccessController.doPrivileged(new PrivilegedAction() { public java.lang.Object run() { return System.getProperty(prop); } }); Andrew.
Re: [cp-patches] RFC: add a copy of gnu/java/security/action/GetPropertyAction into sun/security/action
Hi, Andrew John Hughes schrieb: >> 2008-06-03 Robert Schuster <[EMAIL PROTECTED]> >> >> * sun/security/action/GetPropertyAction.java: Functional copy >> of gnu/java/security/action/GetPropertyAction.java. >> >> Regards >> Robert >> > > > Er... fix the binary which is clearly broken by relying on internal > unspecified classes. What is the public equivalent for GetPropertyAction? Regards Robert signature.asc Description: OpenPGP digital signature