JDK-8002215 : RFE top update compiler combo tests for repeating annotations
  • Type: Enhancement
  • Component: tools
  • Sub-Component: javac
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • Submitted: 2012-11-02
  • Updated: 2013-02-14
  • Resolved: 2013-02-14
Related Reports
Relates :  
Relates :  
Relates :  
Description
Webrev: http://sa.sfbay.sun.com/projects/langtools_data/8/8001457.0/

Above webrev was approved with some comments/suggestions by Jon and Joe. This RFE will track the changes made to the combo tests based on the following comments:

Helper.java
1. enum constants like "IMPORTCONTAINERSTMTS" would be easier to read as "IMPORT_CONTAINER_STMTS." 
2. The code

 130         boolean ok = task.call();
 131         return ok;

could be replaced by just

 130         return task.call(); 
3. Have a few paragraphs of comments explaining the general framework of this set of tests. 
4. Move EXIT_ON_FAIL static initializer code from combo tests to Helper.java
5. static import to reduce code from  annoData.append(Helper.ContentVars.IMPORTCONTAINERSTMTS.getVal())  -> annoData.append(IMPORTCONTAINERSTMTS.getVal())  
6. Add overloaded "error" methods to have the code look like:
error("TestCase =%s did not give correct warnings."+
             "Expected Warning keys errorKey1 = %s errorKey2 = %s actualErrorKey %s",
             clName, errorKey1, errorKey2, d.getCode(), contents); 
7. getFile() - Can skip the initialization of JavaFileObject
8. StringJavaFileObject - URI.create() instead of new URI to skip the URI syntax exception. 


DeprecatedAnnoCombo.java
1. Update TestCases enum to follow enum constant coding conventions
2. DeprecatedonBoth -> DeprecatedOnBoth

Add discussion in each combo test for the space of variables it is exploring, how the expected answer is computed etc. 
Can use package.* for test development or maintain the order of imports by alphabetical order. 
Can skip @compile for combo tests as @run-main will provide @build for these tests.