RFR [JDK8]: 7153951: -Xlint:auxiliaryclass

Fredrik Öhrström fredrik.ohrstrom at oracle.com
Thu Oct 25 07:17:55 PDT 2012


2012-10-23 21:08, Jonathan Gibbons skrev:
> The primary purpose of the diags/examples tests are to provide a 
> simple example of each of the diagnostics in context, for the benefit 
> of reviewers, and the localization team, to see the sort of program 
> that can trigger the diagnostic.  While there is some self-consistency 
> checking to ensure that the declared keys are generated, there is no 
> check on the overall diagnostic, such as the file being reported, the 
> position within the file, any arguments for the diagnostic, and so on. 
> It is also a non-goal of the diags/examples area to provide exhaustive 
> coverage of the different ways that the diagnostic may be generated.
>
> The standard way of providing more complete test coverage for 
> diagnostics is to make sure that every test that uses "@compile/fail" 
> also specifies a golden file for the diagnostics. Since the golden 
> file can potentially depend on external or somewhat unrelated factors 
> like the absolute path of the source file, or the exact text of the 
> error message, we use the -XDrawDiagnostics option to print out the 
> salient details of the diagnostic, in a way that is independent of 
> those external factors.
>
> Thus, any test containing @compile/fail should use a line like
>     @compile/fail/ref=Test.out -XDrawDiagnostics Test.java
>
> adding in additional options, or changing the file names as needed.
>

Comment split and out files added for verification using /ref=, please 
verify:

http://cr.openjdk.java.net/~ohrstrom/webrev-7153951-auxiliaryclass-v7/

//Fredrik




More information about the compiler-dev mailing list