hg: lambda/lambda/langtools: 8009391: Synthetic name of serializable lambda methods should not contain negative numbers
Maurizio Cimadamore
maurizio.cimadamore at oracle.com
Tue Mar 5 08:31:11 PST 2013
On 05/03/13 16:22, Paul Benedict wrote:
> Since names are case-sensitive, I imagine the hexadecimal output must
> be strictly uppercase or lowercase. For example, 0xCAFE and 0xcafe
> would be different names, right? I am curious if the rules should
> specify the case-sensitivity of the output.
lower case is mandated by the spec:
These are the
characters|'\u0030'|through|'\u0039'|and|'\u0061'|through|'\u0066'|. If
uppercase letters are desired, the|String.toUpperCase()|
<http://docs.oracle.com/javase/6/docs/api/java/lang/String.html#toUpperCase%28%29>method
may be called on the result:
Integer.toHexString(n).toUpperCase()
So, yes, we are generating lower case names, and the rules ought to
reflect that (even though, practically, everybody will be using similar
logic to generate the name).
Maurizio
>
> Paul
>
> On Tue, Mar 5, 2013 at 10:15 AM, Maurizio Cimadamore
> <maurizio.cimadamore at oracle.com
> <mailto:maurizio.cimadamore at oracle.com>> wrote:
>
> On 05/03/13 15:52, Gernot Neppert wrote:
> > Hi Maurizio,
> >
> > maybe it's nitpicking, but seeing
> >
> > String.format("%x", methTypeHash)
> >
> > instead of the simple
> >
> > Integer.toHexString(methTypeHash)
> >
> > made me cringe inwardly. The latter is just so much more efficient!
> Sorry - compiler-writer bias - the former doesn't look harder to
> 'compile' than the latter ;-)
>
> I will fix it.
>
> Maurizio
>
> >
> >
> >
> > 2013/3/4 <maurizio.cimadamore at oracle.com
> <mailto:maurizio.cimadamore at oracle.com>
> > <mailto:maurizio.cimadamore at oracle.com
> <mailto:maurizio.cimadamore at oracle.com>>>
> > >
> > > Changeset: 7043ecf1110b
> > > Author: mcimadamore
> > > Date: 2013-03-04 15:48 +0000
> > > URL:
> http://hg.openjdk.java.net/lambda/lambda/langtools/rev/7043ecf1110b
> > >
> > > 8009391: Synthetic name of serializable lambda methods should not
> > contain negative numbers
> > >
> > > ! src/share/classes/com/sun/tools/javac/comp/LambdaToMethod.java
> > >
> > >
>
>
>
More information about the lambda-dev
mailing list