<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<font size="-1">Hi Phil,<br>
<br>
<font size="-1">Thank you for your g<font size="-1">o<font
size="-1">od comments. <font size="-1">Please see my answer<font
size="-1">s below</font>.<br>
<br>
</font></font></font></font></font>
<div class="moz-cite-prefix">On 04/02/2013 12:37 PM, Phil Race
wrote:<br>
</div>
<blockquote cite="mid:515B3361.6080503@oracle.com" type="cite">
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
<div class="moz-cite-prefix">The addition of @Native to various
lines in SunGraphics2D.java look to have pushed them >80
chars<br>
and it looks to me as if previously the author took some care to
limit it. Moreover the indentation<br>
of the comment block `on lines 127-130 is no longer aligned.<br>
<br>
Maybe it would be easier for that case to put the annotation on
the line above as in<br>
@Native<br>
static final int FOO ...<br>
<br>
</div>
</blockquote>
I use a program to automatically scan and modify files. And the
length program is not noticed. I will fix the format issue. <br>
<blockquote cite="mid:515B3361.6080503@oracle.com" type="cite">
<div class="moz-cite-prefix"> <br>
Otherwise looks OK, looks like you found files that had
@GenerateNativeHeaders that<br>
didn't need it and cleaned those up, and in native sources
removed unneeded header<br>
file imports too.<br>
<br>
I do have a background question about how it works.<br>
There is an implication here that only the constants with
@native might<br>
be included in generated header files. Is that true ? <br>
<br>
Whereas if a class has native method declarations, then it
doesn't need<br>
these annotations, but you get all constants in the header file.
Is that right ?<br>
<br>
</div>
</blockquote>
<br>
If a class has native method declarations, then we don't need add
anything. It will automatically generate the header file with all
constants.<br>
<br>
If a class contains no native methods but have constants interested
by native codes, then we need annotations. Previously, we use
@GenerateNativeHeader. But now we need replace them with @Native.
@Native works on the field level. Only constants annotated with
@native will be added as an entry in the generated native header
file. (But we currently have a bug on this. It generates a header
file with all constants no matter a constant has @Native or not. It
will be fixed soon.) <br>
<br>
In my change, I only add @Native annotation to constants interested
by native codes. And if no such kind of constants and native methods
declared, the fix does the clean-up and removes unnecessary header
imports. Thanks!<br>
<br>
-Dan<br>
<br>
<blockquote cite="mid:515B3361.6080503@oracle.com" type="cite">
<div class="moz-cite-prefix"> -phil.<br>
<br>
On 4/1/13 3:16 PM, Dan Xu wrote:<br>
</div>
<blockquote cite="mid:515A0759.5070602@oracle.com" type="cite">
<meta http-equiv="content-type" content="text/html;
charset=ISO-8859-1">
<font size="-1">Hi All,<br>
<br>
<font size="-1">In thi<font size="-1">s fix, I have</font> <font
size="-1"><font size="-1">updated</font> <font size="-1">files
in JDK libraries to use @Native <font size="-1">annotation
inst<font size="-1">ead of @GenerateNativeHeader to <font
size="-1">mark classes that contain no native m<font
size="-1">ethods bu<font size="-1">t </font></font>constan<font
size="-1">ts used by native codes<font size="-1">.<br>
<br>
@Generate<font size="-1">NativeHeader was
added earlier in the dev<font size="-1">elopment
for JDK<font size="-1">8.<font size="-1">
"This has proved problematic for some
core classes with respect to Jigsaw,
since the use of such an annotation
creates a compile-time dependency from
the base module to the module
containing javax.tools, and the base
module should not have any
dependencies." After sw<font size="-1">itching</font>
to @Native annot<font size="-1">ation,
<font size="-1">the dependency <font
size="-1">problem will be solved
as java.lang.annotation.Native
is in the <font size="-1">proposed
base module. <font size="-1">In
addition, the anno<font
size="-1">tation has been
refined not to be on the <font
size="-1">class level <font
size="-1">but</font></font>
on the <font size="-1">constants
thems<font size="-1">elves<font
size="-1">, which
also makes the
generated header
files m<font
size="-1">uch
cleaner.<br>
<br>
<font size="-1">This
effort is part
of JDK-8000404.
After <font
size="-1">j<font
size="-1">dk
libraries
uptaking the <font
size="-1">annotation
changes,
@Generate<font
size="-1">NativeHeader
annotation
will be
removed
completely.</font></font></font></font></font><br>
<br>
<font size="-1">CCC:
<a
moz-do-not-send="true"
class="moz-txt-link-freetext" href="http://ccc.us.oracle.com/8000404">http://ccc.us.oracle.com/8000404</a></font><br>
<font size="-1">webrev:
<a
moz-do-not-send="true"
class="moz-txt-link-freetext"
href="http://cr.openjdk.java.net/%7Edxu/8000406/webrev/">http://cr.openjdk.java.net/~dxu/8000406/webrev/</a><br>
<br>
<font size="-1">Thanks
for your
feedback<font
size="-1">!</font><br>
<br>
<font
size="-1">-Dan</font><br>
</font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font></font>
</blockquote>
<br>
</blockquote>
<br>
</body>
</html>