Re: [RFR] 8205525 : Improve exception messages during manifest parsing of jar archives

2018-09-08 Thread Wang Weijun
Thinking about this again. Looks like the absolute path is not necessary. Even if there are multiple files using the same name, they will be in different directories, no matter absolute or relative. Suppose the jarPath info is used for debugging purpose mostly like the developer can find out wha

Re: RFR JDK-8066709 Make some JDK system properties read only

2018-06-04 Thread Wang Weijun
Not a native English speaker, so my feeling might be incorrect. Will someone interpret this as that System.getProperty() will return a cached value? I would say “Although getProperty() always returns the last value set by setProperty() (I assume this is the current behavior), it is not uncommon

On 8175846: Provide javadoc descriptions for jdk.policytool and jdk.crypto.ec modules

2017-02-26 Thread Wang Weijun
Hi All I'm looking at this bug and have several questions: 1. jdk.jartool is newly introduced in jdk9 (well, all modules are new) but the main class inside it -- sun.security.tools.policytool.PolicyTool -- is already deprecated. Can I also add @deprecated/@Deprecated to the module-info.java o

Re: RFR 8170900: Issue with FilePermission::implies for wildcard flag(-)

2017-01-02 Thread Wang Weijun
Ping again. > On Dec 22, 2016, at 8:23 AM, Wang Weijun wrote: > > Hi Roger > >> On Dec 20, 2016, at 11:49 PM, Roger Riggs wrote: >> >> Hi Max, >> >> Comments: >> >> - Is there a better term/phrase to use other than "foo"; it

Re: RFR 8170900: Issue with FilePermission::implies for wildcard flag(-)

2016-12-21 Thread Wang Weijun
7;ll use take Xuelei's advice to expand this line to This means "/-" implies "/foo" but not "foo". > > - To make the source version more readable, I would keep each statement on > its own line. OK. Thanks Max > >Note that this

Re: RFR 8170900: Issue with FilePermission::implies for wildcard flag(-)

2016-12-21 Thread Wang Weijun
s "/foo" but not "foo".". Good advice. Thanks Max > > Use the one you like, I'm OK with the either. > > Xuelei > > On 12/21/2016 3:58 PM, Wang Weijun wrote: >> >>> On Dec 22, 2016, at 4:39 AM, Xuelei Fan wrote: >>> >&

Re: RFR 8170900: Issue with FilePermission::implies for wildcard flag(-)

2016-12-21 Thread Wang Weijun
;-", the simple pathname's path > * must be recursively inside the wildcard pathname's path. Yes. But the precise meaning of "recursively inside" is different between the pre-jdk9 and jdk9 behaviors. The @implNote explains more. --Max > > Xuelei > > On

Re: JDK 9 RFR of JDK-8156595: java/io/pathNames/GeneralWin32.java fail intermittently on windows-x64

2016-12-20 Thread Wang Weijun
> For the failing case, the first time it calls checkNames, the "ans" (the 3rd > arg) is "current working dir" (/path/scratch/1). Is it possible to use ./tmp as "ans"? --Max

Re: RFR 8170900: Issue with FilePermission::implies for wildcard flag(-)

2016-12-19 Thread Wang Weijun
Ping again. > On Dec 14, 2016, at 1:53 PM, Wang Weijun wrote: > > An clarification is added to FilePermission::implies: > > * @implNote > > * a simple {@code npath} is recursively inside a wildcard {@code npath} > * if and only if {@code

RFR 8171340: HttpNegotiateServer/java test should not use system proxy on Mac

2016-12-15 Thread Wang Weijun
Please take a review at http://cr.openjdk.java.net/~weijun/8171340/webrev.00/ All "openConnection()" modified to "openConnection(Proxy.NO_PROXY)". Everything else is whitespace change. Thanks Max

RFR 8170900: Issue with FilePermission::implies for wildcard flag(-)

2016-12-13 Thread Wang Weijun
An clarification is added to FilePermission::implies: * @implNote * a simple {@code npath} is recursively inside a wildcard {@code npath} * if and only if {@code simple_npath.relativize(wildcard_npath)} - * is a series of one or more "..". An invalid {@code FileP

Re: RFR 8168979: @implNote for invalid FilePermission

2016-12-13 Thread Wang Weijun
> On Dec 14, 2016, at 10:11 AM, Xuelei Fan wrote: > > On 12/13/2016 5:45 PM, Wang Weijun wrote: >> A major behavior change is that <> now implies an invalid >> permission, I hope this is good to minimize incompatibility. > Looks like two sides of the same

Re: RFR 8168979: @implNote for invalid FilePermission

2016-12-13 Thread Wang Weijun
} are created with the same >invalid path, one does *not* imply the other. > > best regards, > > -- daniel > > On 12/12/16 09:01, Wang Weijun wrote: >> Please take a review at >> >> http://cr.openjdk.java.net/~weijun/8168979/webrev.00/ >>

Re: RFR 8168979: @implNote for invalid FilePermission

2016-12-12 Thread Wang Weijun
* are created with the same invalid path, one does imply the other. > > should this be: > >Even if two {@code FilePermission} are created with the same >invalid path, one does *not* imply the other. Ah, yes. Thanks Max > > best regards, > > -- daniel

RFR 8168979: @implNote for invalid FilePermission

2016-12-12 Thread Wang Weijun
Please take a review at http://cr.openjdk.java.net/~weijun/8168979/webrev.00/ This further clarifies what an invalid FilePermission behaves. A major behavior change is that <> now implies an invalid permission, I hope this is good to minimize incompatibility. Thanks Max

Re: RFR 8170408: LogGeneratedClassesTest.java fails with recent changes

2016-11-29 Thread Wang Weijun
http://cr.openjdk.java.net/~weijun/8170408/webrev.01 jdk_lang passes on all JPRT platforms. Thanks Max > On Nov 29, 2016, at 9:26 PM, Daniel Fuchs wrote: > > Hi Max, > > On 29/11/16 12:30, Wang Weijun wrote: >> Maybe I should use >> >> (p, a) -> p.st

Re: RFR 8170408: LogGeneratedClassesTest.java fails with recent changes

2016-11-29 Thread Wang Weijun
Maybe I should use (p, a) -> p.startsWith(Paths.get("dump/com/example")) && a.isRegularFile()).count(), On Windows it's \. I'll run some test now. Thanks Max > On Nov 29, 2016, at 8:25 PM, Wang Weijun wrote: > > Like this? > > (p, a

Re: RFR 8170408: LogGeneratedClassesTest.java fails with recent changes

2016-11-29 Thread Wang Weijun
Like this? (p, a) -> p.toString().startsWith("dump/com/example") && a.isRegularFile()).count(), Thanks Max > On Nov 29, 2016, at 7:22 PM, Daniel Fuchs wrote: > > Hi Max, > > On 29/11/16 06:46, Wang Weijun wrote: >> http://cr.openjdk.ja

RFR 8170408: LogGeneratedClassesTest.java fails with recent changes

2016-11-28 Thread Wang Weijun
http://cr.openjdk.java.net/~weijun/8170408/webrev.00/ A lambda inside JDK is dumped, we should not count it in this test. Thanks Max

Re: RFR 8170364: FilePermission path modified during merge

2016-11-28 Thread Wang Weijun
Hi Alan Updated webrev at http://cr.openjdk.java.net/~weijun/8170364/webrev.01 Changes since webrev.00: - a private constructor that can clones 4 fields and modifies 5 others - using lambda - test enhancement Thanks Max

Re: RFR 8170364: FilePermission path modified during merge

2016-11-27 Thread Wang Weijun
> On Nov 27, 2016, at 7:13 PM, Wang Weijun wrote: > >> >> On Nov 27, 2016, at 6:12 PM, Alan Bateman wrote: >> >> On 26/11/2016 08:54, Wang Weijun wrote: >> >>> Please take a review at >>> >>> http://cr.openjdk.java.

Re: RFR 8170364: FilePermission path modified during merge

2016-11-27 Thread Wang Weijun
> On Nov 27, 2016, at 6:12 PM, Alan Bateman wrote: > > On 26/11/2016 08:54, Wang Weijun wrote: > >> Please take a review at >> >>http://cr.openjdk.java.net/~weijun/8170364/webrev.00/ >> >> The compatibility layer introduced in the new File

RFR 8170364: FilePermission path modified during merge

2016-11-26 Thread Wang Weijun
Please take a review at http://cr.openjdk.java.net/~weijun/8170364/webrev.00/ The compatibility layer introduced in the new FilePermission implementation requires one FilePermission to imply another with either a relative path or an absolute path. This is solved with a private field npath2 i

Re: RFR 8167646: Better invalid FilePermission

2016-10-25 Thread Wang Weijun
would be good too. > > Roger > > > On 10/20/2016 4:51 AM, Wang Weijun wrote: >> Please review the code change at >> >>http://cr.openjdk.java.net/~weijun/8167646/webrev.00/ >> >> A new flag invalid is added so invalid FilePermissions (invalid Path) do n

RFR 8167646: Better invalid FilePermission

2016-10-20 Thread Wang Weijun
Please review the code change at http://cr.openjdk.java.net/~weijun/8167646/webrev.00/ A new flag invalid is added so invalid FilePermissions (invalid Path) do not equal or imply or is implied by anything else except for itself. Thanks Max

RFR 8168127: FilePermissionCollection merges incorrectly

2016-10-19 Thread Wang Weijun
Please review the code change at http://cr.openjdk.java.net/~weijun/8168127/webrev.00/ Two changes: 1. npath2 is considered in equals and hashCode of FilePermission, so 2 objects with different npath2 can be added to a map and different entries. 2. special name for newPermUsingAltPath and n

Re: RFR (JAXP) JDK-8167478 javax/xml/jaxp/unittest/parsers/Bug6341770.java failed with "java.security.AccessControlException: access denied ("java.io.FilePermission" "sko?ice")"

2016-10-16 Thread Wang Weijun
http://hg.openjdk.java.net/jdk9/dev/jaxp/rev/037c095ba0c345edbeaaab52fda913a76c3930c0 My understanding is that if the changeset already has your name as the author then there is no need to add your name again into Contributed-by. --Max > On Oct 17, 2016, at 10:13 AM, Frank Yuan wrote: > > Alr

Re: RFR 9: JEP 290: Filter Incoming Serialization Data

2016-07-19 Thread Wang Weijun
The ObjectInputFilter interface has only one method. Are we expecting more methods to be added later and maybe some people will only be interested in a new method? If yes, I suggest we provide a default implementation of the current method to return ALLOWED. --Max > On Jul 19, 2016, at 10:02 P

os.name will be "macOS"? (was Re: RFR 9 : 8160370 : System.getProperty("os.version") returns "Unknown" on Mac)

2016-06-30 Thread Wang Weijun
I have an off-topic question: Will os.name be macOS for 10.12? I have several places checking "if (!osname.contains("OS X"))", is there a helper method I can check for this in the future no matter if it's running on pre- or post-10.12? Thanks Max > On Jul 1, 2016, at 2:23 AM, Brent Christian

Get user.dir as a symlink not resolved

2016-06-21 Thread Wang Weijun
I'm on a Mac inside /tmp, which is a symlink to /private/tmp. System.getProperty("user.dir") shows me "/private/tmp". Is there a way to get "/tmp" which is exactly what `pwd` return? I only like "/private/tmp" if I called "cd /private/tmp". Thanks Max

Re: JDK 9 RFR of JDK-8159330: Improve deprecation text for Class.newInstance

2016-06-12 Thread Wang Weijun
Why not just clazz.getConstructor().newInstance()? > + * can be replaced by > + * > + * {@code > + * clazz.getConstructor(new Class[0]).newInstance((Object[])null); > + * }

Re: RFR: regex changes -- sun.security.util.Debug issue

2016-05-09 Thread Wang Weijun
Security-dev, If we can live with "engine=keystore" happily, why not just make the whole string lowercase and search for "permission=java.io.filepermission"? I don't think there are permission types or URL names that are only different in cases. Although file names are case-sensitive in Unix, I

Re: RFR: 8154231: Simplify access to System properties from JDK code

2016-04-20 Thread Wang Weijun
This is quite convenient. We not cover the other modules? exports sun.security.action to java.desktop, java.security.jgss, jdk.crypto.pkcs11; Thanks Max > On Apr 20, 2016, at 10:44 PM, Claes Redestad > wrote: > > Hello, > > now that the sun.security.action package

Fwd: How do I import a sun.* class in jshell

2016-04-14 Thread Wang Weijun
Does anyone here know the answer? It will be quite useful for me if I am either authoring an internal class or using it when implementing a public API. Thanks Max > Begin forwarded message: > > From: Wang Weijun > Subject: How do I import a sun.* class in jshell > Date: Apri

Re: Code Review Request, 8152237 Support BigInteger.TWO

2016-03-23 Thread Wang Weijun
> On Mar 23, 2016, at 7:23 PM, Xuelei Fan wrote: > > On 3/23/2016 5:44 PM, Wang Weijun wrote: >> Then why not fix the 2 bugs in a single changeset? >> > Both need spec update approval. As they are completely different spec > update, better to update in 2 enh

Re: Code Review Request, 8152237 Support BigInteger.TWO

2016-03-23 Thread Wang Weijun
Then why not fix the 2 bugs in a single changeset? --Max > 在 2016年3月23日,17:06,Xuelei Fan 写道: > >> On 3/23/2016 3:34 PM, Wang Weijun wrote: >> >>> On Mar 23, 2016, at 12:48 PM, Xuelei Fan wrote: >>> >>> On 3/23/2016 12:10 PM, Wang Weijun wrote

Re: Code Review Request, 8152237 Support BigInteger.TWO

2016-03-23 Thread Wang Weijun
> On Mar 23, 2016, at 12:48 PM, Xuelei Fan wrote: > > On 3/23/2016 12:10 PM, Wang Weijun wrote: >> Only 3 files touched. Are you going to make the >> s/BigInteger.valueOf(2)/BigInteger.TWO/ changes in other files with another >> bug fix? >> > There are

Re: Code Review Request, 8152237 Support BigInteger.TWO

2016-03-22 Thread Wang Weijun
Only 3 files touched. Are you going to make the s/BigInteger.valueOf(2)/BigInteger.TWO/ changes in other files with another bug fix? Thanks Max > On Mar 23, 2016, at 11:26 AM, Xuelei Fan wrote: > > Hi, > > Please review the update for the supporting of BigInteger.TWO: > > http://cr.openjd

Re: RFR: 8147607: Remove test library dependency on sun.security.tools.jarsigner.Main

2016-01-28 Thread Wang Weijun
Shouldn't you also include the FileOuputStream in try-with-resources? --Max > On Jan 28, 2016, at 5:32 PM, Chris Hegarty wrote: > > > On 28 Jan 2016, at 00:35, Steve Drach wrote: > >> Please review a small change to the zipfs test library. >> >> Issue: https://bugs.openjdk.java.net/browse/J

Re: RFR: JDK-8145549 Add support for Visual Studio 2015 Community edition

2016-01-14 Thread Wang Weijun
> On Jan 14, 2016, at 11:00 PM, Magnus Ihse Bursie > wrote: > > On 2015-12-18 15:11, Wang Weijun wrote: >> Hi Vinnie >> >> I take a look and it includes a change for >> src/jdk.crypto.mscapi/windows/native/libsunmscapi/security.cpp in the >> Java

Re: RFR [9] 8145544: Move sun.misc.VM to jdk.internal.misc

2016-01-04 Thread Wang Weijun
I am OK with the change for krb5 in both src and test. Thanks Max > On Jan 4, 2016, at 10:02 PM, Chris Hegarty wrote: > > sun.misc.VM provides a low-level interface for a small number > of specific operations with the VM. In preparation for JEP 260, > this class should be moved out of sun.misc

Re: RFR: JDK-8145549 Add support for Visual Studio 2015 Community edition

2015-12-18 Thread Wang Weijun
Hi Vinnie I take a look and it includes a change for src/jdk.crypto.mscapi/windows/native/libsunmscapi/security.cpp in the Java_sun_security_mscapi_KeyStore_getKeyLength() function. It seems there is no sun.security.mscapi.KeyStore#getKeyLength on the java side. Is the function useless now? T

Re: RFR [9] 8144480: Remove test dependencies on sun.misc.BASE64Encoder and BASE64Decoder

2015-12-02 Thread Wang Weijun
> On Dec 2, 2015, at 11:26 PM, Chris Hegarty wrote: > > Thanks Max, > > I'm ok with this version, if you are. I'll include it in the final push. Please. --Max > > -Chris. > > On 02/12/15 15:13, Wang Weijun wrote: >> >>> On Dec 2, 2015

Re: RFR [9] 8144480: Remove test dependencies on sun.misc.BASE64Encoder and BASE64Decoder

2015-12-02 Thread Wang Weijun
> On Dec 2, 2015, at 10:52 PM, Wang Weijun wrote: > > My fault to use an internal class. I should have simply used the hex > encoding. Please wait a while and I'll send you a fix. > > Thanks > Max

Re: RFR [9] 8144480: Remove test dependencies on sun.misc.BASE64Encoder and BASE64Decoder

2015-12-02 Thread Wang Weijun
My fault to use an internal class. I should have simply used the hex encoding. Please wait a while and I'll send you a fix. Thanks Max > On Dec 2, 2015, at 10:15 PM, Chris Hegarty wrote: > > On 02/12/15 14:03, Alan Bateman wrote: >> >> On 02/12/2015 12:08, Chris Hegarty wrote: >>> The regress

Re: RFR 8142927: Feed some text to STDIN in ProcessTools.executeProcess()

2015-11-16 Thread Wang Weijun
/~weijun/8142927/webrev.01/ > Please also document that the exit status of the process is ignored. It is not really ignored. Process remembers it and OutputAnalyzer can retrieve it later. Thanks Max > > Roger > > > On 11/13/15 3:21 AM, Wang Weijun wrote: >>

Re: RFR 8143015/9: 5 tests fail with error "Can't find source for class: java.util.stream.OpTestCase"

2015-11-15 Thread Wang Weijun
Hi Felix The fix looks fine. Do you want me pushing the changeset? If yes, please tell me what the full comment should be. Thanks Max > On Nov 16, 2015, at 11:44 AM, Felix Yang wrote: > > Hi, >please review the following fix for 5 broken test cases, which was > introduced by JDK-8142996

RFR 8142926: OutputAnalyzer's shouldXXX() calls return this

2015-11-13 Thread Wang Weijun
Hi All 8142926: OutputAnalyzer's shouldXXX() calls return this http://cr.openjdk.java.net/~weijun/8142926/webrev.00/ With this change, you can write output.shouldA().shouldB().shouldC(). Do I need to write a test for testlibrary? Thanks Max

RFR 8142927: Feed some text to STDIN in ProcessTools.executeProcess()

2015-11-13 Thread Wang Weijun
Hi All 8142927: Feed some text to STDIN in ProcessTools.executeProcess() http://cr.openjdk.java.net/~weijun/8142927/webrev.00/ With this change, you can call ProcessTools.executeProcess(new ProcessBuilder("keytool -printcert", certInAscii) which means "echo $certInAscii | keytool -printcert"

Re: dlsym(RTLD_DEFAULT, "getentropy") return non-NULL on Mac

2015-11-08 Thread Wang Weijun
> On Nov 8, 2015, at 7:18 PM, Dmitry Samersoff > wrote: > > Wang Weijun, > >> The function is rather new in the latest Solaris beta [1] and it's >> preferred to reading from /dev/random. There are already people >> suggest adding it to Linux. If

Re: dlsym(RTLD_DEFAULT, "getentropy") return non-NULL on Mac

2015-11-07 Thread Wang Weijun
> On Nov 8, 2015, at 4:29 AM, Dmitry Samersoff > wrote: > > Wang Weijun, > > 1. RTLD_DEFAUL call is expensive and dangerous because it cause symbol > search across all loaded images. So it can pick up something absolutely > irrelevant to your expectations at any tim

dlsym(RTLD_DEFAULT, "getentropy") return non-NULL on Mac

2015-11-06 Thread Wang Weijun
I find something strange. Background: a new method getentropy() is available on OpenBSD [1] and Solaris and people are also proposing it on other OSes. Therefore inside JDK I write a piece of native code to detect it, something like typedef int (*GETENTROPY_FN)(char* buffer, int len);

Re: RFR - 8132734: java.util.jar.* changes to support multi-release jar files

2015-11-03 Thread Wang Weijun
Curious that you added a new method called jarFile.getRuntimeVersionedEntry(entryName). Is this the *only* method you would call for a multi-release jar? If so, is it still necessary to modify the old getEntry() method? Thanks Max > On Nov 4, 2015, at 1:11 AM, Steve Drach wrote: > > Webrev:

Re: RFR - 8132734: java.util.jar.* changes to support multi-release jar files

2015-10-21 Thread Wang Weijun
> On Oct 21, 2015, at 3:17 PM, Xueming Shen wrote: > > We might want to bring in Max to take a look if what I said is really a > supported use scenario. I haven't read Steve's latest code change. I will read if you think it's necessary. First, I think we agree that the multi-release jar file

Re: Optional used as method argument?

2015-10-02 Thread Wang Weijun
> 在 2015年10月2日,下午9:51,Sean Mullan 写道: > > > > On 10/2/15 9:27 AM, Wang Weijun wrote: >> >>> 在 2015年10月2日,下午8:49,Roger Riggs 写道: >>> >>> +1 >>> >>> The "no such value" makes me curious about the context. >>

Re: Optional used as method argument?

2015-10-02 Thread Wang Weijun
> 在 2015年10月2日,下午8:49,Roger Riggs 写道: > > +1 > > The "no such value" makes me curious about the context. > The @param tag really should be saying something about the parameter. In fact, I'm working on a method which is similar to /* * Generates some random bytes. * * @param n reque

Optional used as method argument?

2015-10-01 Thread Wang Weijun
I hear people saying Optional is usually used as return values. Can I use it as an argument, like this? void consume(Optional value) This way, I don't need to add spec like "@param value can be null if there is no such value". Thanks Max

Re: RFR - 8132734: java.util.jar.* changes to support multi-release jar files

2015-10-01 Thread Wang Weijun
> 在 2015年10月2日,上午12:15,Steve Drach 写道: > > I think I’m getting distracted here, not focusing on getting tests created. > Is it okay to move on? Please move on. If you think anything is strange, just send me all related files. One last request about the SSLException, can you still generate t

Re: RFR - 8132734: java.util.jar.* changes to support multi-release jar files

2015-10-01 Thread Wang Weijun
> 在 2015年10月1日,下午7:36,Sean Mullan 写道: > > > > On 10/1/15 5:10 AM, Wang Weijun wrote: >> >>> 在 2015年10月1日,上午7:53,Steve Drach 写道: >>> >>> - JDK 8 jar signer does not work with a JDK 9 created keystore >>> - JDK 8 signed jar with

Re: RFR - 8132734: java.util.jar.* changes to support multi-release jar files

2015-10-01 Thread Wang Weijun
> 在 2015年10月1日,上午7:53,Steve Drach 写道: > > - JDK 8 jar signer does not work with a JDK 9 created keystore > - JDK 8 signed jar with JDK 8 created keystore is not the same size as JDK 9 > signed jar with JDK 9 keystore > - JDK 8 signed jar with JDK 8 created keystore is not the same size as JDK 9

Re: RFR - 8132734: java.util.jar.* changes to support multi-release jar files

2015-09-30 Thread Wang Weijun
> 在 2015年10月1日,上午8:21,Steve Drach 写道: > >> Can you add a -debug option to show the full exception stack info? I even >> could not see how SSL is involved here. > > Would you still like me to do this? Yes, please. I cannot reproduce the problem in my jdk9 repo using a public cacerts file. If

Re: RFR - 8132734: java.util.jar.* changes to support multi-release jar files

2015-09-30 Thread Wang Weijun
> 在 2015年10月1日,上午2:51,Sean Mullan 写道: > >> The jarsigner from jdk9/dev can not, giving me the error >> >> jarsigner: unable to sign jar: javax.net.ssl.SSLException: >> java.lang.RuntimeException: Unexpected error: >> java.security.InvalidAlgorithmParameterException: the trustAnchors parameter

Re: RFR - 8132734: java.util.jar.* changes to support multi-release jar files

2015-09-29 Thread Wang Weijun
Can you describe if there is any effect on signed jars? Including: 1. Will jarsigner be able to sign such a jar? Are all items inside signed? If you sign a jar using jarsigner from different versions of JDK, will there be any difference? 2. Will jarsigner be able to verify such a jar? Will it o

Re: A PEM base64 decoder?

2015-03-23 Thread Wang Weijun
In jdk8, we use Base64.getMimeDecoder() to parse PEM-encoded certs and it ignores every character not in the base-64 alphabet. PEM is more restricted and as I know openssl rejects PEM with illegal chars (Ex, "!" as in bug report and test). This fix will also reject them

A PEM base64 decoder? (was: RFR 8074935: jdk8 keytool doesn't validate pem files for RFC 1421 correctness, as jdk7 did)

2015-03-23 Thread Wang Weijun
> Begin forwarded message: > > Date: March 23, 2015 at 16:33:18 GMT+8 > From: Florian Weimer > To: Wang Weijun , OpenJDK Dev list > > Subject: Re: RFR 8074935: jdk8 keytool doesn't validate pem files for RFC > 1421 correctness, as jdk7 did > > On 03/

Re: FilePermission Canonical path optimization

2015-02-08 Thread Wang Weijun
> On Feb 9, 2015, at 14:42, Peter Levart wrote: > > Hi Max, > > Of course you are aware that by trusting the symlinks, you potentially give > much more permission than you would hope to. Suppose that some code has > permission to read and write into a particular directory (for temporary > fi

Re: FilePermission Canonical path optimization

2015-02-08 Thread Wang Weijun
Actually, since this makes FilePermission simpler, there won't be a long doc. Thanks Max > > Thanks a lot! > > 2015-02-09 11:51 GMT+08:00 Wang Weijun : > > > On Feb 9, 2015, at 11:22, deven you wrote: > > > > Hi Weijun, > > > > I see JD

Re: FilePermission Canonical path optimization

2015-02-08 Thread Wang Weijun
> On Feb 9, 2015, at 11:22, deven you wrote: > > Hi Weijun, > > I see JDK-4141872 marked as Not an Issue, is there any further task continue, > or there is any link else to track this problem to remove the canonical path? It was marked as Not an Issue, but we are reconsidering about it. > >

Re: FilePermission Canonical path optimization

2015-02-06 Thread Wang Weijun
Hi Deven Sorry for the noise, but in fact we are looking into removing the canonicalization step because of 4141872: FilePermission makes symlinks useless https://bugs.openjdk.java.net/browse/JDK-4141872 This will be a very big incompatible change and we are still doing a feasibility study.

Re: [9] request for review: 8049171: Additional tests for jarsigner's warnings

2015-01-26 Thread Wang Weijun
JarUtils: You can break after line 83. Otherwise very good. Thanks Max > On Jan 26, 2015, at 15:55, Artem Smotrakov wrote: > > Hi Max, > > Here is an updated webrev, please take a look. > > http://cr.openjdk.java.net/~asmotrak/8049171/webrev.02/ > > Artem > > On 01/26/2015 05:03 AM, Weiju

Re: [9] request for review: 8049171: Additional tests for jarsigner's warnings

2015-01-22 Thread Wang Weijun
> On Jan 22, 2015, at 19:40, Artem Smotrakov wrote: > >> I am not sure if I understand updateJar correctly. It looks like srcJarFile >> is opened multiple times so its entries are duplicated a lot in the >> destination. Or is there a secret break? > There is no any secret, just a bug. It is no

Re: [9] request for review: 8049171: Additional tests for jarsigner's warnings

2015-01-21 Thread Wang Weijun
Thanks for adding so many tests. Some suggestions: - JarUtils.java You can use the new InputStream.transferTo() method. I am not sure if I understand updateJar correctly. It looks like srcJarFile is opened multiple times so its entries are duplicated a lot in the destination. Or is there a sec

Re: RFR: 8067951: System.loadLibrary cannot find library when path contains quoted entry

2014-12-23 Thread Wang Weijun
> On Dec 23, 2014, at 21:31, Ivan Gerasimov wrote: > > BUGURL: https://bugs.openjdk.java.net/browse/JDK-8067951 > WEBREV: http://cr.openjdk.java.net/~igerasim/8067951/0/webrev/ I am not sure why you want to rewrite the loop entirely. Isn't it OK to just add that long if check before the old li

Copy a ZipEntry into another zip file

2014-12-14 Thread Wang Weijun
Hi Sherman The jarsigner tool contains these 2 methods to copy a ZipEntry into the signer jar: private void writeEntry(ZipFile zf, ZipOutputStream os, ZipEntry ze) throws IOException { ZipEntry ze2 = new ZipEntry(ze.getName()); ze2.setMethod(ze.getMethod()); ze2.setTime(ze.getTime())

Re: Should some JDK system properties be read only ?

2014-12-04 Thread Wang Weijun
A System.setFinalProperty() method that creates a new property with a final value? Maybe also a System.isFinalProperty() method allowing people to detect if a property is final. --Max

Re: FilePermission Canonical path optimization

2014-12-01 Thread Wang Weijun
Do you need some kind of synchronization on the get_dir_rec() method? --Max > On Dec 1, 2014, at 16:06, deven you wrote: > > Hi All, > File.getCanonicalPath() is a very time-consuming method, we observed > significant performance degradation from some application's startup stage > with java.io.

Re: Review request: JDK-8055723 Replace concat String to append in StringBuilder parameters

2014-11-12 Thread Wang Weijun
I hope we can restrict the code change to what the bug description is about. IMHO this bug should only include cleanup and introduce no obvious behavior change. Any other fix can go to another bug. --Max > On Nov 13, 2014, at 08:57, Otávio Gonçalves de Santana > wrote: > > But this class is

Re: How to extract matches from (\d+[hms])+ ?

2014-09-24 Thread Wang Weijun
+)s)?" and then the whole problem caused by the > outer "+" iteration disappear (but you may need to check whether the original > string was empty). Yes, this is much better. > > But maybe that takes all the fun out of it. Let someone else enjoy it then. :-) Thanks Ma

How to extract matches from (\d+[hms])+ ?

2014-09-24 Thread Wang Weijun
Hi Sherman I want to match a time duration like "1h20m30s" and "2h". It looks like if I directly use the pattern "((\\d+)([hms]))+", group(2) and group (3) only return the last match (i.e. 30 and s for 1h20m30s). So I tried multiple matching with "(\\d)([hms])" only, but find() does not always

Re: Replace concat String to append in StringBuilder parameters

2014-08-29 Thread Wang Weijun
So it's not that the optimization fails but there is no optimization on them yet. I do see the .append("x") case will be easy to deal with, but it looks like historically javac has not been a place to do many optimizations. It mostly converts the java source to byte codes in a 1-to-1 mapping an

Re: Replace concat String to append in StringBuilder parameters

2014-08-27 Thread Wang Weijun
OK, I'll remember that. So you will include the StringBuilder changes into your fix? --Max On Aug 28, 2014, at 2:10, Ivan Gerasimov wrote: > Hi Max! > >> The core part is updated again at >> >> http://cr.openjdk.java.net/~weijun/8055723/core/webrev.03/ > > Can you please revert changes to

Re: Replace concat String to append in StringBuilder parameters

2014-08-27 Thread Wang Weijun
On Aug 27, 2014, at 10:07, Wang Weijun wrote: > Webrev updated again, this time include more changes. > > http://cr.openjdk.java.net/~weijun/8055723/client/webrev.02/ > http://cr.openjdk.java.net/~weijun/8055723/core/webrev.02/ The core part is updated again at http://cr.open

Re: Replace concat String to append in StringBuilder parameters

2014-08-26 Thread Wang Weijun
quot;).append((int)c).append(';'); } else { sb.append(ch); } In the 2nd change, it should be "append(c)" instead of "append((int)c)". Here c is already an integer and this redundant cast will be tre

Re: Replace concat String to append in StringBuilder parameters

2014-08-26 Thread Wang Weijun
Webrev updated again, this time include more changes. http://cr.openjdk.java.net/~weijun/8055723/client/webrev.02/ http://cr.openjdk.java.net/~weijun/8055723/core/webrev.02/ The change to a demo file is removed because that file itself is already removed. *Otávio*: I believe Andrej's follow

Re: Replace concat String to append in StringBuilder parameters

2014-08-26 Thread Wang Weijun
end("Extension unknown: " + "DER encoded OCTET string =\n") StringBuilder sb = new StringBuilder("\"" + ti.getThreadName() + "\"" + tagBuffer.append(""); ... Thanks Max On Aug 26, 2014, at 11:28, Wang Weijun wrote: &

Re: Replace concat String to append in StringBuilder parameters

2014-08-25 Thread Wang Weijun
New webrevs available at http://cr.openjdk.java.net/~weijun/8055723/client/webrev.01/ http://cr.openjdk.java.net/~weijun/8055723/core/webrev.01/ There are only 2 now. Everything non-client is in core. Everyone, please do code review quickly because the patch touches too many files and any

Re: Replace concat String to append in StringBuilder parameters

2014-08-24 Thread Wang Weijun
New webrevs updated http://cr.openjdk.java.net/~weijun/8055723/core/webrev.00/ Includes modules java.base and security-related modules and the jarsigner tool http://cr.openjdk.java.net/~weijun/8055723/client/webrev.00 Includes the java.desktop module http://cr.openjdk.java.net/~weijun/8055

Re: Trusted service?

2014-08-22 Thread Wang Weijun
On Aug 13, 2014, at 23:31, mark.reinh...@oracle.com wrote: > 2014/8/13 7:20 -0700, alan.bate...@oracle.com: >> The usual thing is to just have a default implementation that is used >> when ServiceLoader doesn't locate a useful provider. You'll find many >> examples of this in the JDK. In those

Re: Replace concat String to append in StringBuilder parameters

2014-08-21 Thread Wang Weijun
I also see a lot of .toString() and String.valueOf() calls. $ cat string_concat_updated.patch | perl -ne 'print if /^\+ .*append.*(String\.valueOf|\.toString\(\))/' | wc 62 2104626 Wrapped lines not indented correctly in src/java.xml.crypto/share/classes/com/sun/org/apache/xml/int

Re: Replace concat String to append in StringBuilder parameters

2014-08-21 Thread Wang Weijun
On Aug 21, 2014, at 21:18, Andrej Golovnin wrote: >https://bugs.openjdk.java.net/browse/JDK-8038277 > > This is not the right bug report. The subject of this bug report is "Improve > the bootstrap performance of carets keystore". Oh, my mistake, it should be https://bugs.openjdk.java.net/

Re: Replace concat String to append in StringBuilder parameters

2014-08-21 Thread Wang Weijun
Tue, Aug 19, 2014 at 10:55 PM, Wang Weijun wrote: > Hi Otávio > > I see TABs in the first page of sun_security.diff, too long line in > javax_security.diff. > > Also, it's unfortunate that you will need to rename the file names to the new > style with mod

Re: Replace concat String to append in StringBuilder parameters

2014-08-19 Thread Wang Weijun
Hi Otávio I see TABs in the first page of sun_security.diff, too long line in javax_security.diff. Also, it's unfortunate that you will need to rename the file names to the new style with modules. See http://cr.openjdk.java.net/~chegar/docs/portingScript.html for how to do this. I can create

Re: Trusted service?

2014-08-14 Thread Wang Weijun
On Aug 14, 2014, at 16:03, Alan Bateman wrote: > >> Or writing the class name in a services file automatically exports it as a >> service? >> >> Now my preferred order will be >> >>if (loadProviderFromProperty()) >>return provider; >>if (loadProviderAsInstalledService()) >>

How to use jvisualvm to find memory leaks?

2014-08-14 Thread Wang Weijun
I am looking at "8054896: Loading a KeyStore prevents GC of Classloader" and am now able to reproduce it on my system. I do see the webapp-related classes present in a heapdump created by VisualVM but not sure what the next steps should be to tell why they are not GC'ed. Is there a good tutorial

Re: Trusted service?

2014-08-13 Thread Wang Weijun
Yes, I see a lot of places using if (loadProviderFromProperty()) return provider; if (loadProviderAsService()) return provider; The 1st using Class.forName() and 2nd ServiceLoader.load(). I was thinking that the 1st method will not work because Class.forName() on an internal

Trusted service?

2014-08-13 Thread Wang Weijun
Hi All I'm working on "8038089: TLS optional support for Kerberos cipher suites needs to be re-examine" which will separate the implementation of Kerberos-related TLS ciphersuites from the other TLS codes. I am thinking of defining a ServiceLoader interface called ExternalCipherSuiteProvider in

Re: Replace concat String to append in StringBuilder parameters

2014-08-12 Thread Wang Weijun
No TAB, no \r, and no trailing space are hard requirements enforced by jcheck. Otherwise it's only styles, including 4-space-indentation. "{" at the end of a line, 8-space wrap indentation... --Max (an Oracle dev) On Aug 12, 2014, at 15:48, Andrej Golovnin wrote: > As far as I know we should

Re: Replace concat String to append in StringBuilder parameters

2014-08-11 Thread Wang Weijun
'\"' can be written as '"': com_sun.diff:209:+sb.append(' ').append(nodeName).append("=\"").append(att.getNodeValue()).append('\"'); java_lang.diff:31:+ sb.append('\"').append(getThreadName()).append('\"') java_security.diff:78:+.append('\"'); s

Re: RFR 8054095: No space allowed in platforms string in ProblemList.txt

2014-08-01 Thread Wang Weijun
The change looks good. So does the closed side. I read jtharness and it seems a line is broken into 3 parts separated by space(s). Either the 2nd or the 3rd part will be used by jtreg as platforms, but not both. I'm not sure if jtharness or jtreg should also be updated. Thanks Max On Aug 1, 2

Re: JEP 198: Light-Weight JSON API

2014-07-30 Thread Wang Weijun
On Jul 31, 2014, at 8:35, Remi Forax wrote: > > On 07/25/2014 04:45 PM, mark.reinh...@oracle.com wrote: >> New JEP Candidate: http://openjdk.java.net/jeps/198 >> >> - Mark > > Hi Mark, Hi Mike, > Implementing a json API was one of the use case I've used during the > development of the lambda

  1   2   >