< prev index next >

src/com/sun/javatest/junit/JUnitAnnotationTestFinder.java

Print this page
rev 145 : 7902237: Fixing raw use of parameterized class
Reviewed-by: jjg


 136                 int dot = name.indexOf('.');
 137                 if (dot == -1)
 138                     continue;
 139                 String extn = name.substring(dot);
 140                 if (extensionTable.containsKey(extn)) {
 141                     // extension has a comment reader, so add it to the
 142                     // list to be scanned
 143                     foundFile(file);
 144                 }
 145             }
 146         }
 147     }
 148 
 149     /**
 150      * Scan a file, looking for comments and in the comments, for test
 151      * description data.
 152      * @param file The file to scan
 153      */
 154     protected void scanFile(File file) {
 155         testMethods = new ArrayList<>();  // new every time we visit a new class
 156         tdValues = new HashMap();
 157 
 158         String name = file.getName();
 159         int dot = name.indexOf('.');
 160         if (dot == -1)
 161             return;
 162 
 163         String classFile="";
 164         if (scanClasses) {
 165             classFile = file.getPath();
 166         } else {
 167             String currentDir=new File("").getAbsolutePath();
 168             String sources = name;
 169             String filePath=file.getAbsolutePath().
 170                     substring(currentDir.length()+1, file.getAbsolutePath().length());
 171 
 172             if (filePath.startsWith("tests")){
 173                 classFile=currentDir+File.separator+"classes"+File.separator+filePath.substring(6,filePath.length());
 174             } else if (filePath.startsWith("test")){
 175                 classFile=currentDir+File.separator+"classes"+File.separator+filePath.substring(5,filePath.length());
 176             } else {




 136                 int dot = name.indexOf('.');
 137                 if (dot == -1)
 138                     continue;
 139                 String extn = name.substring(dot);
 140                 if (extensionTable.containsKey(extn)) {
 141                     // extension has a comment reader, so add it to the
 142                     // list to be scanned
 143                     foundFile(file);
 144                 }
 145             }
 146         }
 147     }
 148 
 149     /**
 150      * Scan a file, looking for comments and in the comments, for test
 151      * description data.
 152      * @param file The file to scan
 153      */
 154     protected void scanFile(File file) {
 155         testMethods = new ArrayList<>();  // new every time we visit a new class
 156         tdValues = new HashMap<>();
 157 
 158         String name = file.getName();
 159         int dot = name.indexOf('.');
 160         if (dot == -1)
 161             return;
 162 
 163         String classFile="";
 164         if (scanClasses) {
 165             classFile = file.getPath();
 166         } else {
 167             String currentDir=new File("").getAbsolutePath();
 168             String sources = name;
 169             String filePath=file.getAbsolutePath().
 170                     substring(currentDir.length()+1, file.getAbsolutePath().length());
 171 
 172             if (filePath.startsWith("tests")){
 173                 classFile=currentDir+File.separator+"classes"+File.separator+filePath.substring(6,filePath.length());
 174             } else if (filePath.startsWith("test")){
 175                 classFile=currentDir+File.separator+"classes"+File.separator+filePath.substring(5,filePath.length());
 176             } else {


< prev index next >