Download
Getting Started
Members
Projects
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
More
Community
Marketplace
Events
Planet Eclipse
Newsletter
Videos
Participate
Report a Bug
Forums
Mailing Lists
Wiki
IRC
How to Contribute
Working Groups
Automotive
Internet of Things
LocationTech
Long-Term Support
PolarSys
Science
OpenMDM
Toggle navigation
Bugzilla – Attachment 186798 Details for
Bug 186342
[compiler][null] Using annotations for null checking
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
Log In
[x]
|
Terms of Use
|
Copyright Agent
API doc
JavaCore.html (text/html), 16.42 KB, created by
Stephan Herrmann
on 2011-01-13 18:46:58 EST
(
hide
)
Description:
API doc
Filename:
MIME Type:
Creator:
Stephan Herrmann
Created:
2011-01-13 18:46:58 EST
Size:
16.42 KB
patch
obsolete
><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> ><!--NewPage--> ><HTML> ><HEAD> ><!-- Generated by javadoc (build 1.6.0_22) on Fri Jan 14 00:32:58 CET 2011 --> ><TITLE> >JavaCore ></TITLE> > ><META NAME="date" CONTENT="2011-01-14"> > ><LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style"> > ><SCRIPT type="text/javascript"> >function windowTitle() >{ > if (location.href.indexOf('is-external=true') == -1) { > parent.document.title="JavaCore"; > } >} ></SCRIPT> ><NOSCRIPT> ></NOSCRIPT> > ></HEAD> > ><BODY BGCOLOR="white" onload="windowTitle();"> ><HR> > > ><!-- ========= START OF TOP NAVBAR ======= --> ><A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> ><TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> ><TR> ><TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> ><A NAME="navbar_top_firstrow"><!-- --></A> ><TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> > <TR ALIGN="center" VALIGN="top"> > <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> > <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> > <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/JavaCore.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> > <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> > <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> > <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> > <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> > </TR> ></TABLE> ></TD> ><TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> ></EM> ></TD> ></TR> > ><TR> ><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> > PREV CLASS > NEXT CLASS</FONT></TD> ><TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> > <A HREF="../../../../index.html?org/eclipse/jdt/core/JavaCore.html" target="_top"><B>FRAMES</B></A> > <A HREF="JavaCore.html" target="_top"><B>NO FRAMES</B></A> > <SCRIPT type="text/javascript"> > <!-- > if(window==top) { > document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); > } > //--> ></SCRIPT> ><NOSCRIPT> > <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> ></NOSCRIPT> > > ></FONT></TD> ></TR> ><TR> ><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> > SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> ><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> >DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> ></TR> ></TABLE> ><A NAME="skip-navbar_top"></A> ><!-- ========= END OF TOP NAVBAR ========= --> > ><HR> ><!-- ======== START OF CLASS DATA ======== --> ><H2> ><FONT SIZE="-1"> >org.eclipse.jdt.core</FONT> ><BR> >Class JavaCore</H2> ><DL> ><DT><B>All Implemented Interfaces:</B> <DD>org.osgi.framework.BundleActivator</DD> ></DL> ><HR> ><DL> ><DT><PRE>public final class <B>JavaCore</B><DT>extends org.eclipse.core.runtime.Plugin</DL> ></PRE> > ><HR> > ><A NAME="COMPILER_NULLABLE_ANNOTATION_NAME"><!-- --></A><H3> >COMPILER_NULLABLE_ANNOTATION_NAME</H3> ><PRE> >public static final java.lang.String <B>COMPILER_NULLABLE_ANNOTATION_NAME</B></PRE> ><DL> ><DD>Compiler option ID: Name of Annotation Type for Nullable Types. > <p>This option defines a fully qualified Java type name that the compiler may use > to perform special null analysis.</p> > <p>If the annotation specified by this option is applied to a type in a method > signature or variable declaration this will be interpreted as a contract that > <code>null</code> is a legal value in that position. Currently supported > positions are: method parameters and method return type.</p> > <p>If a value whose type > is annotated with this annotation is dereferenced without checking for null > the compiler will trigger a diagnostic as further controlled by > <A HREF="JavaCore.html#COMPILER_PB_POTENTIAL_NULL_REFERENCE"><CODE>COMPILER_PB_POTENTIAL_NULL_REFERENCE</CODE></A>.</p> > <p>The compiler may furthermore check adherence to the null contract as further > controlled by <A HREF="JavaCore.html#COMPILER_PB_NULL_CONTRACT_VIOLATION"><CODE>COMPILER_PB_NULL_CONTRACT_VIOLATION</CODE></A>, > <A HREF="JavaCore.html#COMPILER_PB_POTENTIAL_NULL_CONTRACT_VIOLATION"><CODE>COMPILER_PB_POTENTIAL_NULL_CONTRACT_VIOLATION</CODE></A> and > <A HREF="JavaCore.html#COMPILER_PB_NULL_CONTRACT_INSUFFICIENT_INFO"><CODE>COMPILER_PB_NULL_CONTRACT_INSUFFICIENT_INFO</CODE></A>. > </p> > <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.annotation.nullable"</code></dd> > <dt>Possible values:</dt><dd>any legal Java type name</dd> > <dt>Default:</dt><dd><code>"org.eclipse.jdt.annotation.Nullable"</code></dd> ><P> ><DL> ><DT><B>Since:</B></DT> > <DD>3.7</DD> ><DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#org.eclipse.jdt.core.JavaCore.COMPILER_NULLABLE_ANNOTATION_NAME">Constant Field Values</A></DL> ></DL> ><HR> > ><A NAME="COMPILER_NONNULL_ANNOTATION_NAME"><!-- --></A><H3> >COMPILER_NONNULL_ANNOTATION_NAME</H3> ><PRE> >public static final java.lang.String <B>COMPILER_NONNULL_ANNOTATION_NAME</B></PRE> ><DL> ><DD>Compiler option ID: Name of Annotation Type for Non-Null Types. > <p>This option defines a fully qualified Java type name that the compiler may use > to perform special null analysis.</p> > <p>If the annotation specified by this option is applied to a type in a method > signature or variable declaration this will be interpreted as a contract that > <code>null</code> is <b>not</b> a legal value in that position. Currently > supported positions are: method parameters and method return type.</p> > <p>For values declared with this annotation the compiler will never trigger a null > reference diagnostic (as controlled by <A HREF="JavaCore.html#COMPILER_PB_POTENTIAL_NULL_REFERENCE"><CODE>COMPILER_PB_POTENTIAL_NULL_REFERENCE</CODE></A> > and <A HREF="JavaCore.html#COMPILER_PB_NULL_REFERENCE"><CODE>COMPILER_PB_NULL_REFERENCE</CODE></A>), because the assumption is made that null > will never occur at runtime in these positions.</p> > <p>The compiler may furthermore check adherence to the null contract as further > controlled by <A HREF="JavaCore.html#COMPILER_PB_NULL_CONTRACT_VIOLATION"><CODE>COMPILER_PB_NULL_CONTRACT_VIOLATION</CODE></A>, > <A HREF="JavaCore.html#COMPILER_PB_POTENTIAL_NULL_CONTRACT_VIOLATION"><CODE>COMPILER_PB_POTENTIAL_NULL_CONTRACT_VIOLATION</CODE></A> and > <A HREF="JavaCore.html#COMPILER_PB_NULL_CONTRACT_INSUFFICIENT_INFO"><CODE>COMPILER_PB_NULL_CONTRACT_INSUFFICIENT_INFO</CODE></A>. > </p> > <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.annotation.nonnull"</code></dd> > <dt>Possible values:</dt><dd>any legal Java type name</dd> > <dt>Default:</dt><dd><code>"org.eclipse.jdt.annotation.NonNull"</code></dd> ><P> ><DL> ><DT><B>Since:</B></DT> > <DD>3.7</DD> ><DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#org.eclipse.jdt.core.JavaCore.COMPILER_NONNULL_ANNOTATION_NAME">Constant Field Values</A></DL> ></DL> ><HR> > ><A NAME="COMPILER_EMULATE_NULL_ANNOTATION_TYPES"><!-- --></A><H3> >COMPILER_EMULATE_NULL_ANNOTATION_TYPES</H3> ><PRE> >public static final java.lang.String <B>COMPILER_EMULATE_NULL_ANNOTATION_TYPES</B></PRE> ><DL> ><DD>Compiler option ID: Emulate Null Annotation Types. > <p>When enabled, the compiler will use the annotation types specified in > <A HREF="JavaCore.html#COMPILER_NONNULL_ANNOTATION_NAME"><CODE>COMPILER_NONNULL_ANNOTATION_NAME</CODE></A> and <A HREF="JavaCore.html#COMPILER_NULLABLE_ANNOTATION_NAME"><CODE>COMPILER_NULLABLE_ANNOTATION_NAME</CODE></A> > without searching for a corresponding type definition, ie., these annotation > types don't have to actually exist.</p> > <p>This option is used to make null contract analysis independent of any additional > classes that would otherwise need to be supplied at compile time.</p> > <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.annotation.emulate"</code></dd> > <dt>Possible values:</dt><dd>{ "disabled", "enabled" }</dd> > <dt>Default:</dt><dd><code>"disabled"</code></dd> ><P> ><DL> ><DT><B>Since:</B></DT> > <DD>3.7</DD> ><DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#org.eclipse.jdt.core.JavaCore.COMPILER_EMULATE_NULL_ANNOTATION_TYPES">Constant Field Values</A></DL> ></DL> ><HR> > ><A NAME="COMPILER_DEFAULT_IMPORT_NULL_ANNOTATION_TYPES"><!-- --></A><H3> >COMPILER_DEFAULT_IMPORT_NULL_ANNOTATION_TYPES</H3> ><PRE> >public static final java.lang.String <B>COMPILER_DEFAULT_IMPORT_NULL_ANNOTATION_TYPES</B></PRE> ><DL> ><DD>Compiler option ID: Default Import of Null Annotation Types. > <p>When enabled, the compiler will be able to resolve the annotation types specified in > <A HREF="JavaCore.html#COMPILER_NONNULL_ANNOTATION_NAME"><CODE>COMPILER_NONNULL_ANNOTATION_NAME</CODE></A> and <A HREF="JavaCore.html#COMPILER_NULLABLE_ANNOTATION_NAME"><CODE>COMPILER_NULLABLE_ANNOTATION_NAME</CODE></A> > by their simple names without an explicit import statement.</p> > <p>This option is used to avoid mentioning the fully qualified annotation names > in any source files, as to facility the migration from one set of annotations > to another, e.g., when standard annotations for this purpose will be defined > in the future. > </p> > <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.annotation.defaultImport"</code></dd> > <dt>Possible values:</dt><dd>{ "disabled", "enabled" }</dd> > <dt>Default:</dt><dd><code>"disabled"</code></dd> ><P> ><DL> ><DT><B>Since:</B></DT> > <DD>3.7</DD> ><DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#org.eclipse.jdt.core.JavaCore.COMPILER_DEFAULT_IMPORT_NULL_ANNOTATION_TYPES">Constant Field Values</A></DL> ></DL> ><HR> > ><A NAME="COMPILER_PB_NULL_CONTRACT_VIOLATION"><!-- --></A><H3> >COMPILER_PB_NULL_CONTRACT_VIOLATION</H3> ><PRE> >public static final java.lang.String <B>COMPILER_PB_NULL_CONTRACT_VIOLATION</B></PRE> ><DL> ><DD>Compiler option ID: Reporting Violations of Null Contracts. > <p>When enabled, the compiler will issue an error or a warning whenever one of the > following situations is detected: > <ol> > <li>A method declared with a nonnull annotation returns an expression that is > statically known to evaluate to a null value.</li> > <li>An expression that is statically known to evaluate to a null value is passed > as an argument in a method call where the corresponding parameter of the called > method is declared with a nonnull annotation.</li> > <li>A method that overrides an inherited method declared with a nonnull annotation > tries to relax that contract by specifying a nullable annotation > (prohibition of contravariant return).</li> > <li>A method that overrides an inherited method which has a nullable declaration > for at least one of its parameters, tries to tighten that null contract by > specifying a nonnull annotation for its corresponding parameter > (prohibition of covariant parameters).</li> > </ol> > </p> > <p>The compiler options <A HREF="JavaCore.html#COMPILER_NONNULL_ANNOTATION_NAME"><CODE>COMPILER_NONNULL_ANNOTATION_NAME</CODE></A> and > <A HREF="JavaCore.html#COMPILER_NULLABLE_ANNOTATION_NAME"><CODE>COMPILER_NULLABLE_ANNOTATION_NAME</CODE></A> control which annotations the compiler > shall interpret as nonnull or nullable annotations, respectively. > </p> > <dl> > <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.nullContractViolation"</code></dd> > <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> > <dt>Default:</dt><dd><code>"error"</code></dd> > </dl> ><P> ><DL> ><DT><B>Since:</B></DT> > <DD>3.7</DD> ><DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#org.eclipse.jdt.core.JavaCore.COMPILER_PB_NULL_CONTRACT_VIOLATION">Constant Field Values</A></DL> ></DL> ><HR> > ><A NAME="COMPILER_PB_POTENTIAL_NULL_CONTRACT_VIOLATION"><!-- --></A><H3> >COMPILER_PB_POTENTIAL_NULL_CONTRACT_VIOLATION</H3> ><PRE> >public static final java.lang.String <B>COMPILER_PB_POTENTIAL_NULL_CONTRACT_VIOLATION</B></PRE> ><DL> ><DD>Compiler option ID: Reporting Violations of Null Contracts with Potential Null Value. > <p>When enabled, the compiler will issue an error or a warning whenever one of the > following situations is detected: > <ol> > <li>A method declared with a nonnull annotation returns an expression that is > statically known to evaluate to a null value on some flow.</li> > <li>An expression that is statically known to evaluate to a null value on some flow > is passed as an argument in a method call where the corresponding parameter of > the called method is declared with a nonnull annotation.</li> > </ol> > </p> > <p>The compiler options <A HREF="JavaCore.html#COMPILER_NONNULL_ANNOTATION_NAME"><CODE>COMPILER_NONNULL_ANNOTATION_NAME</CODE></A> and > <A HREF="JavaCore.html#COMPILER_NULLABLE_ANNOTATION_NAME"><CODE>COMPILER_NULLABLE_ANNOTATION_NAME</CODE></A> control which annotations the compiler > shall interpret as nonnull or nullable annotations, respectively. > </p> > <dl> > <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.potentialNullContractViolation"</code></dd> > <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> > <dt>Default:</dt><dd><code>"error"</code></dd> > </dl> ><P> ><DL> ><DT><B>Since:</B></DT> > <DD>3.7</DD> ><DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#org.eclipse.jdt.core.JavaCore.COMPILER_PB_POTENTIAL_NULL_CONTRACT_VIOLATION">Constant Field Values</A></DL> ></DL> ><HR> > ><A NAME="COMPILER_PB_NULL_CONTRACT_INSUFFICIENT_INFO"><!-- --></A><H3> >COMPILER_PB_NULL_CONTRACT_INSUFFICIENT_INFO</H3> ><PRE> >public static final java.lang.String <B>COMPILER_PB_NULL_CONTRACT_INSUFFICIENT_INFO</B></PRE> ><DL> ><DD>Compiler option ID: Reporting Insufficient Information for Analysing Adherence to Null Contracts. > <p>When enabled, the compiler will issue an error or a warning whenever one of the > following situations is detected: > <ol> > <li>A method declared with a nonnull annotation returns an expression for which > insufficient nullness information is available for statically proving that no > flow will pass a null value at runtime.</li> > <li>An expression for which insufficient nullness information is available for > statically proving that it will never evaluate to a null value at runtime > is passed as an argument in a method call where the corresponding parameter of > the called method is declared with a nonnull annotation.</li> > </ol> > Insufficient nullness information is usually a consequence of using other unannotated > variables or methods. > </p> > <p>The compiler options <A HREF="JavaCore.html#COMPILER_NONNULL_ANNOTATION_NAME"><CODE>COMPILER_NONNULL_ANNOTATION_NAME</CODE></A> and > <A HREF="JavaCore.html#COMPILER_NULLABLE_ANNOTATION_NAME"><CODE>COMPILER_NULLABLE_ANNOTATION_NAME</CODE></A> control which annotations the compiler > shall interpret as nonnull or nullable annotations, respectively. > </p> > <dl> > <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.nullContractInsufficientInfo"</code></dd> > <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> > <dt>Default:</dt><dd><code>"warning"</code></dd> > </dl> ><P> ><DL> ><DT><B>Since:</B></DT> > <DD>3.7</DD> ><DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#org.eclipse.jdt.core.JavaCore.COMPILER_PB_NULL_CONTRACT_INSUFFICIENT_INFO">Constant Field Values</A></DL> ></DL> ><HR> > ></FONT></TD> ></TR> ><TR> ><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> > SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> ><TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> >DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> ></TR> ></TABLE> ><A NAME="skip-navbar_bottom"></A> ><!-- ======== END OF BOTTOM NAVBAR ======= --> > ><HR> > ></BODY> ></HTML>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <!--NewPage--> <HTML> <HEAD> <!-- Generated by javadoc (build 1.6.0_22) on Fri Jan 14 00:32:58 CET 2011 --> <TITLE> JavaCore </TITLE> <META NAME="date" CONTENT="2011-01-14"> <LINK REL ="stylesheet" TYPE="text/css" HREF="../../../../stylesheet.css" TITLE="Style"> <SCRIPT type="text/javascript"> function windowTitle() { if (location.href.indexOf('is-external=true') == -1) { parent.document.title="JavaCore"; } } </SCRIPT> <NOSCRIPT> </NOSCRIPT> </HEAD> <BODY BGCOLOR="white" onload="windowTitle();"> <HR> <!-- ========= START OF TOP NAVBAR ======= --> <A NAME="navbar_top"><!-- --></A> <A HREF="#skip-navbar_top" title="Skip navigation links"></A> <TABLE BORDER="0" WIDTH="100%" CELLPADDING="1" CELLSPACING="0" SUMMARY=""> <TR> <TD COLSPAN=2 BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A NAME="navbar_top_firstrow"><!-- --></A> <TABLE BORDER="0" CELLPADDING="0" CELLSPACING="3" SUMMARY=""> <TR ALIGN="center" VALIGN="top"> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-summary.html"><FONT CLASS="NavBarFont1"><B>Package</B></FONT></A> </TD> <TD BGCOLOR="#FFFFFF" CLASS="NavBarCell1Rev"> <FONT CLASS="NavBarFont1Rev"><B>Class</B></FONT> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="class-use/JavaCore.html"><FONT CLASS="NavBarFont1"><B>Use</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="package-tree.html"><FONT CLASS="NavBarFont1"><B>Tree</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../deprecated-list.html"><FONT CLASS="NavBarFont1"><B>Deprecated</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../index-files/index-1.html"><FONT CLASS="NavBarFont1"><B>Index</B></FONT></A> </TD> <TD BGCOLOR="#EEEEFF" CLASS="NavBarCell1"> <A HREF="../../../../help-doc.html"><FONT CLASS="NavBarFont1"><B>Help</B></FONT></A> </TD> </TR> </TABLE> </TD> <TD ALIGN="right" VALIGN="top" ROWSPAN=3><EM> </EM> </TD> </TR> <TR> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> PREV CLASS NEXT CLASS</FONT></TD> <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2"> <A HREF="../../../../index.html?org/eclipse/jdt/core/JavaCore.html" target="_top"><B>FRAMES</B></A> <A HREF="JavaCore.html" target="_top"><B>NO FRAMES</B></A> <SCRIPT type="text/javascript"> <!-- if(window==top) { document.writeln('<A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A>'); } //--> </SCRIPT> <NOSCRIPT> <A HREF="../../../../allclasses-noframe.html"><B>All Classes</B></A> </NOSCRIPT> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_top"></A> <!-- ========= END OF TOP NAVBAR ========= --> <HR> <!-- ======== START OF CLASS DATA ======== --> <H2> <FONT SIZE="-1"> org.eclipse.jdt.core</FONT> <BR> Class JavaCore</H2> <DL> <DT><B>All Implemented Interfaces:</B> <DD>org.osgi.framework.BundleActivator</DD> </DL> <HR> <DL> <DT><PRE>public final class <B>JavaCore</B><DT>extends org.eclipse.core.runtime.Plugin</DL> </PRE> <HR> <A NAME="COMPILER_NULLABLE_ANNOTATION_NAME"><!-- --></A><H3> COMPILER_NULLABLE_ANNOTATION_NAME</H3> <PRE> public static final java.lang.String <B>COMPILER_NULLABLE_ANNOTATION_NAME</B></PRE> <DL> <DD>Compiler option ID: Name of Annotation Type for Nullable Types. <p>This option defines a fully qualified Java type name that the compiler may use to perform special null analysis.</p> <p>If the annotation specified by this option is applied to a type in a method signature or variable declaration this will be interpreted as a contract that <code>null</code> is a legal value in that position. Currently supported positions are: method parameters and method return type.</p> <p>If a value whose type is annotated with this annotation is dereferenced without checking for null the compiler will trigger a diagnostic as further controlled by <A HREF="JavaCore.html#COMPILER_PB_POTENTIAL_NULL_REFERENCE"><CODE>COMPILER_PB_POTENTIAL_NULL_REFERENCE</CODE></A>.</p> <p>The compiler may furthermore check adherence to the null contract as further controlled by <A HREF="JavaCore.html#COMPILER_PB_NULL_CONTRACT_VIOLATION"><CODE>COMPILER_PB_NULL_CONTRACT_VIOLATION</CODE></A>, <A HREF="JavaCore.html#COMPILER_PB_POTENTIAL_NULL_CONTRACT_VIOLATION"><CODE>COMPILER_PB_POTENTIAL_NULL_CONTRACT_VIOLATION</CODE></A> and <A HREF="JavaCore.html#COMPILER_PB_NULL_CONTRACT_INSUFFICIENT_INFO"><CODE>COMPILER_PB_NULL_CONTRACT_INSUFFICIENT_INFO</CODE></A>. </p> <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.annotation.nullable"</code></dd> <dt>Possible values:</dt><dd>any legal Java type name</dd> <dt>Default:</dt><dd><code>"org.eclipse.jdt.annotation.Nullable"</code></dd> <P> <DL> <DT><B>Since:</B></DT> <DD>3.7</DD> <DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#org.eclipse.jdt.core.JavaCore.COMPILER_NULLABLE_ANNOTATION_NAME">Constant Field Values</A></DL> </DL> <HR> <A NAME="COMPILER_NONNULL_ANNOTATION_NAME"><!-- --></A><H3> COMPILER_NONNULL_ANNOTATION_NAME</H3> <PRE> public static final java.lang.String <B>COMPILER_NONNULL_ANNOTATION_NAME</B></PRE> <DL> <DD>Compiler option ID: Name of Annotation Type for Non-Null Types. <p>This option defines a fully qualified Java type name that the compiler may use to perform special null analysis.</p> <p>If the annotation specified by this option is applied to a type in a method signature or variable declaration this will be interpreted as a contract that <code>null</code> is <b>not</b> a legal value in that position. Currently supported positions are: method parameters and method return type.</p> <p>For values declared with this annotation the compiler will never trigger a null reference diagnostic (as controlled by <A HREF="JavaCore.html#COMPILER_PB_POTENTIAL_NULL_REFERENCE"><CODE>COMPILER_PB_POTENTIAL_NULL_REFERENCE</CODE></A> and <A HREF="JavaCore.html#COMPILER_PB_NULL_REFERENCE"><CODE>COMPILER_PB_NULL_REFERENCE</CODE></A>), because the assumption is made that null will never occur at runtime in these positions.</p> <p>The compiler may furthermore check adherence to the null contract as further controlled by <A HREF="JavaCore.html#COMPILER_PB_NULL_CONTRACT_VIOLATION"><CODE>COMPILER_PB_NULL_CONTRACT_VIOLATION</CODE></A>, <A HREF="JavaCore.html#COMPILER_PB_POTENTIAL_NULL_CONTRACT_VIOLATION"><CODE>COMPILER_PB_POTENTIAL_NULL_CONTRACT_VIOLATION</CODE></A> and <A HREF="JavaCore.html#COMPILER_PB_NULL_CONTRACT_INSUFFICIENT_INFO"><CODE>COMPILER_PB_NULL_CONTRACT_INSUFFICIENT_INFO</CODE></A>. </p> <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.annotation.nonnull"</code></dd> <dt>Possible values:</dt><dd>any legal Java type name</dd> <dt>Default:</dt><dd><code>"org.eclipse.jdt.annotation.NonNull"</code></dd> <P> <DL> <DT><B>Since:</B></DT> <DD>3.7</DD> <DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#org.eclipse.jdt.core.JavaCore.COMPILER_NONNULL_ANNOTATION_NAME">Constant Field Values</A></DL> </DL> <HR> <A NAME="COMPILER_EMULATE_NULL_ANNOTATION_TYPES"><!-- --></A><H3> COMPILER_EMULATE_NULL_ANNOTATION_TYPES</H3> <PRE> public static final java.lang.String <B>COMPILER_EMULATE_NULL_ANNOTATION_TYPES</B></PRE> <DL> <DD>Compiler option ID: Emulate Null Annotation Types. <p>When enabled, the compiler will use the annotation types specified in <A HREF="JavaCore.html#COMPILER_NONNULL_ANNOTATION_NAME"><CODE>COMPILER_NONNULL_ANNOTATION_NAME</CODE></A> and <A HREF="JavaCore.html#COMPILER_NULLABLE_ANNOTATION_NAME"><CODE>COMPILER_NULLABLE_ANNOTATION_NAME</CODE></A> without searching for a corresponding type definition, ie., these annotation types don't have to actually exist.</p> <p>This option is used to make null contract analysis independent of any additional classes that would otherwise need to be supplied at compile time.</p> <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.annotation.emulate"</code></dd> <dt>Possible values:</dt><dd>{ "disabled", "enabled" }</dd> <dt>Default:</dt><dd><code>"disabled"</code></dd> <P> <DL> <DT><B>Since:</B></DT> <DD>3.7</DD> <DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#org.eclipse.jdt.core.JavaCore.COMPILER_EMULATE_NULL_ANNOTATION_TYPES">Constant Field Values</A></DL> </DL> <HR> <A NAME="COMPILER_DEFAULT_IMPORT_NULL_ANNOTATION_TYPES"><!-- --></A><H3> COMPILER_DEFAULT_IMPORT_NULL_ANNOTATION_TYPES</H3> <PRE> public static final java.lang.String <B>COMPILER_DEFAULT_IMPORT_NULL_ANNOTATION_TYPES</B></PRE> <DL> <DD>Compiler option ID: Default Import of Null Annotation Types. <p>When enabled, the compiler will be able to resolve the annotation types specified in <A HREF="JavaCore.html#COMPILER_NONNULL_ANNOTATION_NAME"><CODE>COMPILER_NONNULL_ANNOTATION_NAME</CODE></A> and <A HREF="JavaCore.html#COMPILER_NULLABLE_ANNOTATION_NAME"><CODE>COMPILER_NULLABLE_ANNOTATION_NAME</CODE></A> by their simple names without an explicit import statement.</p> <p>This option is used to avoid mentioning the fully qualified annotation names in any source files, as to facility the migration from one set of annotations to another, e.g., when standard annotations for this purpose will be defined in the future. </p> <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.annotation.defaultImport"</code></dd> <dt>Possible values:</dt><dd>{ "disabled", "enabled" }</dd> <dt>Default:</dt><dd><code>"disabled"</code></dd> <P> <DL> <DT><B>Since:</B></DT> <DD>3.7</DD> <DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#org.eclipse.jdt.core.JavaCore.COMPILER_DEFAULT_IMPORT_NULL_ANNOTATION_TYPES">Constant Field Values</A></DL> </DL> <HR> <A NAME="COMPILER_PB_NULL_CONTRACT_VIOLATION"><!-- --></A><H3> COMPILER_PB_NULL_CONTRACT_VIOLATION</H3> <PRE> public static final java.lang.String <B>COMPILER_PB_NULL_CONTRACT_VIOLATION</B></PRE> <DL> <DD>Compiler option ID: Reporting Violations of Null Contracts. <p>When enabled, the compiler will issue an error or a warning whenever one of the following situations is detected: <ol> <li>A method declared with a nonnull annotation returns an expression that is statically known to evaluate to a null value.</li> <li>An expression that is statically known to evaluate to a null value is passed as an argument in a method call where the corresponding parameter of the called method is declared with a nonnull annotation.</li> <li>A method that overrides an inherited method declared with a nonnull annotation tries to relax that contract by specifying a nullable annotation (prohibition of contravariant return).</li> <li>A method that overrides an inherited method which has a nullable declaration for at least one of its parameters, tries to tighten that null contract by specifying a nonnull annotation for its corresponding parameter (prohibition of covariant parameters).</li> </ol> </p> <p>The compiler options <A HREF="JavaCore.html#COMPILER_NONNULL_ANNOTATION_NAME"><CODE>COMPILER_NONNULL_ANNOTATION_NAME</CODE></A> and <A HREF="JavaCore.html#COMPILER_NULLABLE_ANNOTATION_NAME"><CODE>COMPILER_NULLABLE_ANNOTATION_NAME</CODE></A> control which annotations the compiler shall interpret as nonnull or nullable annotations, respectively. </p> <dl> <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.nullContractViolation"</code></dd> <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> <dt>Default:</dt><dd><code>"error"</code></dd> </dl> <P> <DL> <DT><B>Since:</B></DT> <DD>3.7</DD> <DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#org.eclipse.jdt.core.JavaCore.COMPILER_PB_NULL_CONTRACT_VIOLATION">Constant Field Values</A></DL> </DL> <HR> <A NAME="COMPILER_PB_POTENTIAL_NULL_CONTRACT_VIOLATION"><!-- --></A><H3> COMPILER_PB_POTENTIAL_NULL_CONTRACT_VIOLATION</H3> <PRE> public static final java.lang.String <B>COMPILER_PB_POTENTIAL_NULL_CONTRACT_VIOLATION</B></PRE> <DL> <DD>Compiler option ID: Reporting Violations of Null Contracts with Potential Null Value. <p>When enabled, the compiler will issue an error or a warning whenever one of the following situations is detected: <ol> <li>A method declared with a nonnull annotation returns an expression that is statically known to evaluate to a null value on some flow.</li> <li>An expression that is statically known to evaluate to a null value on some flow is passed as an argument in a method call where the corresponding parameter of the called method is declared with a nonnull annotation.</li> </ol> </p> <p>The compiler options <A HREF="JavaCore.html#COMPILER_NONNULL_ANNOTATION_NAME"><CODE>COMPILER_NONNULL_ANNOTATION_NAME</CODE></A> and <A HREF="JavaCore.html#COMPILER_NULLABLE_ANNOTATION_NAME"><CODE>COMPILER_NULLABLE_ANNOTATION_NAME</CODE></A> control which annotations the compiler shall interpret as nonnull or nullable annotations, respectively. </p> <dl> <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.potentialNullContractViolation"</code></dd> <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> <dt>Default:</dt><dd><code>"error"</code></dd> </dl> <P> <DL> <DT><B>Since:</B></DT> <DD>3.7</DD> <DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#org.eclipse.jdt.core.JavaCore.COMPILER_PB_POTENTIAL_NULL_CONTRACT_VIOLATION">Constant Field Values</A></DL> </DL> <HR> <A NAME="COMPILER_PB_NULL_CONTRACT_INSUFFICIENT_INFO"><!-- --></A><H3> COMPILER_PB_NULL_CONTRACT_INSUFFICIENT_INFO</H3> <PRE> public static final java.lang.String <B>COMPILER_PB_NULL_CONTRACT_INSUFFICIENT_INFO</B></PRE> <DL> <DD>Compiler option ID: Reporting Insufficient Information for Analysing Adherence to Null Contracts. <p>When enabled, the compiler will issue an error or a warning whenever one of the following situations is detected: <ol> <li>A method declared with a nonnull annotation returns an expression for which insufficient nullness information is available for statically proving that no flow will pass a null value at runtime.</li> <li>An expression for which insufficient nullness information is available for statically proving that it will never evaluate to a null value at runtime is passed as an argument in a method call where the corresponding parameter of the called method is declared with a nonnull annotation.</li> </ol> Insufficient nullness information is usually a consequence of using other unannotated variables or methods. </p> <p>The compiler options <A HREF="JavaCore.html#COMPILER_NONNULL_ANNOTATION_NAME"><CODE>COMPILER_NONNULL_ANNOTATION_NAME</CODE></A> and <A HREF="JavaCore.html#COMPILER_NULLABLE_ANNOTATION_NAME"><CODE>COMPILER_NULLABLE_ANNOTATION_NAME</CODE></A> control which annotations the compiler shall interpret as nonnull or nullable annotations, respectively. </p> <dl> <dt>Option id:</dt><dd><code>"org.eclipse.jdt.core.compiler.problem.nullContractInsufficientInfo"</code></dd> <dt>Possible values:</dt><dd><code>{ "error", "warning", "ignore" }</code></dd> <dt>Default:</dt><dd><code>"warning"</code></dd> </dl> <P> <DL> <DT><B>Since:</B></DT> <DD>3.7</DD> <DT><B>See Also:</B><DD><A HREF="../../../../constant-values.html#org.eclipse.jdt.core.JavaCore.COMPILER_PB_NULL_CONTRACT_INSUFFICIENT_INFO">Constant Field Values</A></DL> </DL> <HR> </FONT></TD> </TR> <TR> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> SUMMARY: NESTED | <A HREF="#field_summary">FIELD</A> | <A HREF="#constructor_summary">CONSTR</A> | <A HREF="#method_summary">METHOD</A></FONT></TD> <TD VALIGN="top" CLASS="NavBarCell3"><FONT SIZE="-2"> DETAIL: <A HREF="#field_detail">FIELD</A> | <A HREF="#constructor_detail">CONSTR</A> | <A HREF="#method_detail">METHOD</A></FONT></TD> </TR> </TABLE> <A NAME="skip-navbar_bottom"></A> <!-- ======== END OF BOTTOM NAVBAR ======= --> <HR> </BODY> </HTML>
View Attachment As Raw
Actions:
View
Attachments on
bug 186342
:
74851
|
86246
|
86247
|
89354
|
184335
|
185507
|
186796
| 186798 |
186872
|
186876
|
186889
|
186890
|
206525
|
206557
|
207270
|
207308
|
207478
|
207565
|
207567
|
207573
|
207592
|
207604
|
207635
|
207637
|
207639
|
207657
|
207659
|
207672
|
207677
|
207685