hg: jdk8/tl/jdk: 7111548: unexpected debug log message

2011-11-14 Thread xuelei . fan
Changeset: 5c7c83a6ee24
Author:xuelei
Date:  2011-11-14 01:21 -0800
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/5c7c83a6ee24

7111548: unexpected debug log message
Reviewed-by: wetmore

! src/share/classes/sun/security/ssl/SSLSocketImpl.java



Re: Code Review Request: 7107020: java.net.PlainSocketImpl.socketSetOption() calls itself

2011-11-14 Thread Chris Hegarty

On 11/11/2011 18:57, Kurchi Hazra wrote:

Hi,

As specified in the CR description, this is a bug in
src/windows/java/net/PlainSocketImpl.java and impl.socketSetOption()
should be called instead of socketSetOption().

This bug did not create a problem yet since setOption() is usually
called for setting socket options.

Submitting hg diff:

diff --git a/src/windows/classes/java/net/PlainSocketImpl.java
b/src/windows/classes/java/net/PlainSocketImpl.java
--- a/src/windows/classes/java/net/PlainSocketImpl.java
+++ b/src/windows/classes/java/net/PlainSocketImpl.java
@@ -314,7 +314,7 @@ class PlainSocketImpl extends AbstractPl

void socketSetOption(int cmd, boolean on, Object value)
throws SocketException {
- socketSetOption(cmd, on, value);
+ impl.socketSetOption(cmd, on, value);
}

int socketGetOption(int opt, Object iaContainerObj) throws
SocketException {


Looks fine. Thanks for taking care of this.

-Chris.



Thanks,



hg: jdk8/tl/jdk: 7107020: java.net.PlainSocketImpl.socketSetOption() calls itself

2011-11-14 Thread chris . hegarty
Changeset: 68fc55d12ae6
Author:chegar
Date:  2011-11-14 10:06 +
URL:   http://hg.openjdk.java.net/jdk8/tl/jdk/rev/68fc55d12ae6

7107020: java.net.PlainSocketImpl.socketSetOption() calls itself
Reviewed-by: alanb, chegar
Contributed-by: kurchi.subhra.ha...@oracle.com

! src/windows/classes/java/net/PlainSocketImpl.java



Re: Question about getaddrinfo in Inet4AddressImpl.c

2011-11-14 Thread Chris Hegarty

I agree with Mikes comments, and here are a few of trivial ones of my own.

 - 'struct sockaddr_in6 him6' here is unused in getHostByAddr
 - caddr[16] - > caddr[4] in getHostByAddr

Thanks for making this change. It really cleans up this old code.

It is not your fault as the same is in Inet6AddressImpl, but I do see 
warnings building this:


"../../../src/solaris/native/java/net/Inet4AddressImpl.c", line 70: 
warning: declaration can not follow a statement
"../../../src/solaris/native/java/net/Inet4AddressImpl.c", line 71: 
warning: declaration can not follow a statement


If you have the time maybe you could resolve these?

Thanks,
-Chris.

On 14/11/2011 05:41, Charles Lee wrote:

On 11/12/2011 04:07 AM, Mike Duigou wrote:

Some comments:

Inet4AddressImpl.c:

- why use bzero rather than posix memset?
- MAXHOSTNAMELEN is used. Shouldn't this be NI_MAXHOST as in the Inet6
version?

Mike


On Nov 11 2011, at 06:53 , Neil Richards wrote:


On Wed, 2011-11-09 at 12:19 +0800, Charles Lee wrote:

On 11/09/2011 03:25 AM, Chris Hegarty wrote:

Charles,

Is it possible to fix up the style issues, etc that Neil pointed out,
and have the webrev updated?




Hi Chris,

Here it is. (attached)


And here it is, in webrev form [1].

Regards, Neil

[1] http://cr.openjdk.java.net/~ngmr/ojdk-229/webrev.01/

--
Unless stated above:
IBM email: neil_richards at uk.ibm.com
IBM United Kingdom Limited - Registered in England and Wales with
number 741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire
PO6 3AU


I will change the patch:
1. bzero(&hints, sizeof(hints)) ---> memset(&hints, 0, sizeof(hints)) (2
in Inet4AddressImpl, 2 in Inet6AddressImpl)
2. MAXHOSTNAMELEN in getaddrinfo in Inet4AddressImpl to NI_MAXHOST.

Thanks for the review, Mike.



hg: jdk8/tl/langtools: 7110974: (javac) add coding conventions and style checkers for langtools

2011-11-14 Thread kumar . x . srinivasan
Changeset: c1238fcc9515
Author:ksrini
Date:  2011-11-14 08:09 -0800
URL:   http://hg.openjdk.java.net/jdk8/tl/langtools/rev/c1238fcc9515

7110974: (javac) add coding conventions and style checkers for langtools
Reviewed-by: jjg

! make/build.properties
! make/build.xml
+ make/conf/checkstyle-emacs.xsl
+ make/conf/checkstyle-langtools.xml



hg: jdk8/tl/langtools: 7106166: (javac) re-factor EndPos parser

2011-11-14 Thread kumar . x . srinivasan
Changeset: 7375d4979bd3
Author:ksrini
Date:  2011-11-14 15:11 -0800
URL:   http://hg.openjdk.java.net/jdk8/tl/langtools/rev/7375d4979bd3

7106166: (javac) re-factor EndPos parser
Reviewed-by: jjg

! src/share/classes/com/sun/tools/javac/api/JavacTrees.java
! src/share/classes/com/sun/tools/javac/comp/Lower.java
! src/share/classes/com/sun/tools/javac/jvm/CRTable.java
! src/share/classes/com/sun/tools/javac/jvm/Gen.java
- src/share/classes/com/sun/tools/javac/parser/EndPosParser.java
+ src/share/classes/com/sun/tools/javac/parser/EndPosTable.java
! src/share/classes/com/sun/tools/javac/parser/JavacParser.java
! src/share/classes/com/sun/tools/javac/parser/ParserFactory.java
! src/share/classes/com/sun/tools/javac/tree/JCTree.java
! src/share/classes/com/sun/tools/javac/tree/TreeInfo.java
! src/share/classes/com/sun/tools/javac/util/DiagnosticSource.java
! src/share/classes/com/sun/tools/javac/util/JCDiagnostic.java
! src/share/classes/com/sun/tools/javac/util/Log.java
! test/tools/javac/6304921/TestLog.java
! test/tools/javac/failover/CheckAttributedTree.java
! test/tools/javac/tree/TreePosTest.java



Re: Question about getaddrinfo in Inet4AddressImpl.c

2011-11-14 Thread Charles Lee

On 11/14/2011 10:15 PM, Chris Hegarty wrote:
I agree with Mikes comments, and here are a few of trivial ones of my 
own.


 - 'struct sockaddr_in6 him6' here is unused in getHostByAddr
 - caddr[16] - > caddr[4] in getHostByAddr

Thanks for making this change. It really cleans up this old code.

It is not your fault as the same is in Inet6AddressImpl, but I do see 
warnings building this:


"../../../src/solaris/native/java/net/Inet4AddressImpl.c", line 70: 
warning: declaration can not follow a statement
"../../../src/solaris/native/java/net/Inet4AddressImpl.c", line 71: 
warning: declaration can not follow a statement


If you have the time maybe you could resolve these?

Thanks,
-Chris.

On 14/11/2011 05:41, Charles Lee wrote:

On 11/12/2011 04:07 AM, Mike Duigou wrote:

Some comments:

Inet4AddressImpl.c:

- why use bzero rather than posix memset?
- MAXHOSTNAMELEN is used. Shouldn't this be NI_MAXHOST as in the Inet6
version?

Mike


On Nov 11 2011, at 06:53 , Neil Richards wrote:


On Wed, 2011-11-09 at 12:19 +0800, Charles Lee wrote:

On 11/09/2011 03:25 AM, Chris Hegarty wrote:

Charles,

Is it possible to fix up the style issues, etc that Neil pointed 
out,

and have the webrev updated?




Hi Chris,

Here it is. (attached)


And here it is, in webrev form [1].

Regards, Neil

[1] http://cr.openjdk.java.net/~ngmr/ojdk-229/webrev.01/

--
Unless stated above:
IBM email: neil_richards at uk.ibm.com
IBM United Kingdom Limited - Registered in England and Wales with
number 741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire
PO6 3AU


I will change the patch:
1. bzero(&hints, sizeof(hints)) ---> memset(&hints, 0, sizeof(hints)) (2
in Inet4AddressImpl, 2 in Inet6AddressImpl)
2. MAXHOSTNAMELEN in getaddrinfo in Inet4AddressImpl to NI_MAXHOST.

Thanks for the review, Mike.




Interesting. I do not see those warnings. I will double check it.
Thanks Chris.

--
Yours Charles



Re: Question about getaddrinfo in Inet4AddressImpl.c

2011-11-14 Thread Charles Lee

On 11/14/2011 10:15 PM, Chris Hegarty wrote:
I agree with Mikes comments, and here are a few of trivial ones of my 
own.


 - 'struct sockaddr_in6 him6' here is unused in getHostByAddr
 - caddr[16] - > caddr[4] in getHostByAddr

Thanks for making this change. It really cleans up this old code.

It is not your fault as the same is in Inet6AddressImpl, but I do see 
warnings building this:


"../../../src/solaris/native/java/net/Inet4AddressImpl.c", line 70: 
warning: declaration can not follow a statement
"../../../src/solaris/native/java/net/Inet4AddressImpl.c", line 71: 
warning: declaration can not follow a statement


If you have the time maybe you could resolve these?

Thanks,
-Chris.

On 14/11/2011 05:41, Charles Lee wrote:

On 11/12/2011 04:07 AM, Mike Duigou wrote:

Some comments:

Inet4AddressImpl.c:

- why use bzero rather than posix memset?
- MAXHOSTNAMELEN is used. Shouldn't this be NI_MAXHOST as in the Inet6
version?

Mike


On Nov 11 2011, at 06:53 , Neil Richards wrote:


On Wed, 2011-11-09 at 12:19 +0800, Charles Lee wrote:

On 11/09/2011 03:25 AM, Chris Hegarty wrote:

Charles,

Is it possible to fix up the style issues, etc that Neil pointed 
out,

and have the webrev updated?




Hi Chris,

Here it is. (attached)


And here it is, in webrev form [1].

Regards, Neil

[1] http://cr.openjdk.java.net/~ngmr/ojdk-229/webrev.01/

--
Unless stated above:
IBM email: neil_richards at uk.ibm.com
IBM United Kingdom Limited - Registered in England and Wales with
number 741598.
Registered office: PO Box 41, North Harbour, Portsmouth, Hampshire
PO6 3AU


I will change the patch:
1. bzero(&hints, sizeof(hints)) ---> memset(&hints, 0, sizeof(hints)) (2
in Inet4AddressImpl, 2 in Inet6AddressImpl)
2. MAXHOSTNAMELEN in getaddrinfo in Inet4AddressImpl to NI_MAXHOST.

Thanks for the review, Mike.



Sigh. Chris, I still fail to see those warnings, even if I do a very 
clean remove of my build directory and rebuild the whole jdk 


Here is the new (big) patch(attached) according to the comments from you 
and Mike. Thank you guys :-)


--
Yours Charles

diff --git src/solaris/native/java/net/Inet4AddressImpl.c 
src/solaris/native/java/net/Inet4AddressImpl.c
index 9a5b78e..ea68408 100644
--- src/solaris/native/java/net/Inet4AddressImpl.c
+++ src/solaris/native/java/net/Inet4AddressImpl.c
@@ -43,8 +43,9 @@
 #include "java_net_Inet4AddressImpl.h"
 
 /* the initial size of our hostent buffers */
-#define HENT_BUF_SIZE 1024
-#define BIG_HENT_BUF_SIZE 10240  /* a jumbo-sized one */
+#ifndef NI_MAXHOST
+#define NI_MAXHOST 1025
+#endif
 
 /
  * Inet4AddressImpl
@@ -57,60 +58,36 @@
  */
 JNIEXPORT jstring JNICALL
 Java_java_net_Inet4AddressImpl_getLocalHostName(JNIEnv *env, jobject this) {
-char hostname[MAXHOSTNAMELEN+1];
+char hostname[NI_MAXHOST+1];
 
 hostname[0] = '\0';
 if (JVM_GetHostName(hostname, sizeof(hostname))) {
 /* Something went wrong, maybe networking is not setup? */
 strcpy(hostname, "localhost");
 } else {
-#ifdef __linux__
-/* On Linux gethostname() says "host.domain.sun.com".  On
- * Solaris gethostname() says "host", so extra work is needed.
- */
-#else
-/* Solaris doesn't want to give us a fully qualified domain name.
- * We do a reverse lookup to try and get one.  This works
- * if DNS occurs before NIS in /etc/resolv.conf, but fails
- * if NIS comes first (it still gets only a partial name).
- * We use thread-safe system calls.
- */
-#endif /* __linux__ */
-struct hostent res, res2, *hp;
-// these buffers must be pointer-aligned so they are declared
-// with pointer type
-char *buf[HENT_BUF_SIZE/(sizeof (char *))];
-char *buf2[HENT_BUF_SIZE/(sizeof (char *))];
-int h_error=0;
-
-// ensure null-terminated
-hostname[MAXHOSTNAMELEN] = '\0';
-
-#ifdef __GLIBC__
-gethostbyname_r(hostname, &res, (char*)buf, sizeof(buf), &hp, 
&h_error);
-#else
-hp = gethostbyname_r(hostname, &res, (char*)buf, sizeof(buf), 
&h_error);
-#endif
-if (hp) {
-#ifdef __GLIBC__
-gethostbyaddr_r(hp->h_addr, hp->h_length, AF_INET,
-&res2, (char*)buf2, sizeof(buf2), &hp, &h_error);
-#else
-hp = gethostbyaddr_r(hp->h_addr, hp->h_length, AF_INET,
- &res2, (char*)buf2, sizeof(buf2), &h_error);
-#endif
-if (hp) {
-/*
- * If gethostbyaddr_r() found a fully qualified host name,
- * returns that name. Otherwise, returns the hostname
- * found by gethostname().
- */
-char *p = hp->h_name;
-if ((strlen(hp->h_name) > strlen(hostname))
-&& (strncmp(hostname, hp->h_name, strlen(hostname)) == 0)
-&& (*(p + strlen(hostname)) == '.'