Need reviewer - @GenerateNativeHeader
Kelly Ohair
kelly.ohair at oracle.com
Thu Jun 28 23:59:29 UTC 2012
so bottom line ... if you can determine that the GenerateNativeHeader is not needed you can delete it
but please be sure
Sent from my iPhone
On Jun 28, 2012, at 15:35, Erik Joelsson <erik.joelsson at oracle.com> wrote:
> Hello,
>
> It's quite possible that the constants aren't needed. However, those files are currently on the list of files in the old build system that gets headers generated for them, and those headers are in turn included by native source files. The new annotation for automatically generating native headers is used by the new build (build-infra). We added the annotation to all java files that used to have headers generated for them.
>
> It would be even better to check each of those java files and verify that the headers are actually needed in the native code, and remove the includes for those that aren't. We felt that was beyond the scope of the build-infra project.
>
> /Erik
>
> On 2012-06-28 14:53, Sergey Bylokhov wrote:
>> Hi, Kelly.
>> Because there is no constants that "are needed in the supporting JNI code".
>> For example in *LWLabelPeer.java:*
>> private static final int TEXT_XPAD = 5;
>> private static final int TEXT_YPAD = 1;
>> These constants are really used in a nativ? code?
>>
>>
>> 29.06.2012 01:38, Kelly O'Hair wrote:
>>> Why do you say they are unnecessary?
>>>
>>> -kto
>>>
>>> On Jun 28, 2012, at 7:03 AM, Sergey Bylokhov wrote:
>>>
>>>> Hi, Kelly.
>>>> Looks like changes in these files are unnecessary.
>>>>
>>>> |Cdiffs <http://cr.openjdk.java.net/%7Eohair/openjdk8/generateHeaders1/webrev/src/macosx/classes/sun/lwawt/LWLabelPeer.java.cdiff.html> Udiffs <http://cr.openjdk.java.net/%7Eohair/openjdk8/generateHeaders1/webrev/src/macosx/classes/sun/lwawt/LWLabelPeer.java.udiff.html> Sdiffs <http://cr.openjdk.java.net/%7Eohair/openjdk8/generateHeaders1/webrev/src/macosx/classes/sun/lwawt/LWLabelPeer.java.sdiff.html> Frames <http://cr.openjdk.java.net/%7Eohair/openjdk8/generateHeaders1/webrev/src/macosx/classes/sun/lwawt/LWLabelPeer.java.frames.html> Old <http://cr.openjdk.java.net/%7Eohair/openjdk8/generateHeaders1/webrev/src/macosx/classes/sun/lwawt/LWLabelPeer.java-.html> New <http://cr.openjdk.java.net/%7Eohair/openjdk8/generateHeaders1/webrev/src/macosx/classes/sun/lwawt/LWLabelPeer.java.html> Patch <http://cr.openjdk.java.net/%7Eohair/openjdk8/generateHeaders1/webrev/src/macosx/classes/sun/lwawt/LWLabelPeer.java.patch> Raw <http://cr.openjdk.java.net/%7Eohair/openjdk8/generateHeaders1/webrev/raw_files/new/src/macosx/classes/sun/lwawt/LWLabelPeer.java> | *src/macosx/classes/sun/lwawt/LWLabelPeer.java*
>>>>
>>>> 4 lines changed: 4 ins; 0 del; 0 mod; 115 unchg
>>>> |Cdiffs <http://cr.openjdk.java.net/%7Eohair/openjdk8/generateHeaders1/webrev/src/macosx/classes/sun/lwawt/LWTextFieldPeer.java.cdiff.html> Udiffs <http://cr.openjdk.java.net/%7Eohair/openjdk8/generateHeaders1/webrev/src/macosx/classes/sun/lwawt/LWTextFieldPeer.java.udiff.html> Sdiffs <http://cr.openjdk.java.net/%7Eohair/openjdk8/generateHeaders1/webrev/src/macosx/classes/sun/lwawt/LWTextFieldPeer.java.sdiff.html> Frames <http://cr.openjdk.java.net/%7Eohair/openjdk8/generateHeaders1/webrev/src/macosx/classes/sun/lwawt/LWTextFieldPeer.java.frames.html> Old <http://cr.openjdk.java.net/%7Eohair/openjdk8/generateHeaders1/webrev/src/macosx/classes/sun/lwawt/LWTextFieldPeer.java-.html> New <http://cr.openjdk.java.net/%7Eohair/openjdk8/generateHeaders1/webrev/src/macosx/classes/sun/lwawt/LWTextFieldPeer.java.html> Patch <http://cr.openjdk.java.net/%7Eohair/openjdk8/generateHeaders1/webrev/src/macosx/classes/sun/lwawt/LWTextFieldPeer.java.patch> Raw <http://cr.openjdk.java.net/%7Eohair/openjdk8/generateHeaders1/webrev/raw_files/new/src/macosx/classes/sun/lwawt/LWTextFieldPeer.java> | *src/macosx/classes/sun/lwawt/LWTextFieldPeer.java*
>>>>
>>>> 4 lines changed: 4 ins; 0 del; 0 mod; 134 unchg
>>>>
>>>> 23.05.2012 05:14, Kelly O'Hair wrote:
>>>>> 7170969: Add @GenerateNativeHeader to classes whose fields need to be exported for JNI
>>>>> http://cr.openjdk.java.net/~ohair/openjdk8/generateHeaders1/webrev/
>>>>>
>>>>> The new build infrastructure wants to fully automate the generation of the JNI header files (running javah).
>>>>> On classes that have "native" methods this is obvious, but class that only export constants, and whose constants
>>>>> are needed in the JNI native code, we need to mark these classes as needing their native header file generated.
>>>>>
>>>>> This change is adding:
>>>>>
>>>>> import javax.tools.annotation.GenerateNativeHeader;
>>>>> /* No native methods here, but the constants are needed in the supporting JNI code */
>>>>> @GenerateNativeHeader
>>>>>
>>>>> To any class without a native method, but needing to expose it's constants to the native code.
>>>>>
>>>>> -kto
>>>>>
>>>>
>>>>
>>>> --
>>>> Best regards, Sergey.
>>>
>>
>>
>
More information about the build-dev
mailing list