View | Details | Raw Unified | Return to bug 38332 | Differences between
and this patch

Collapse All | Expand All

(-)org/eclipse/jdt/core/compiler/IProblem.java Thu Mar 27 09:08:02 2003 (+10 lines)
Lines 531-536 Link Here
531
  int NonExternalizedStringLiteral = Internal + 261;
531
  int NonExternalizedStringLiteral = Internal + 261;
532
  int CannotUseSuperInCodeSnippet = Internal + 422;
532
  int CannotUseSuperInCodeSnippet = Internal + 422;
533
  
533
  
534
  //JOE: SAS diagnostics
535
  int StringConcat = Internal + 423;
536
  int LocaleSensitiveMethod = Internal + 424;
537
  int EmbeddedString = Internal + 426;
538
  int EmbeddedCharacter = Internal + 427;
539
  //EOJ
540
  
534
  //constant pool
541
  //constant pool
535
  int TooManyConstantsInConstantPool = Internal + 430;
542
  int TooManyConstantsInConstantPool = Internal + 430;
536
  /** @since 2.1 */
543
  /** @since 2.1 */
Lines 549-552 Link Here
549
  // detected task
556
  // detected task
550
  /** @since 2.1 */
557
  /** @since 2.1 */
551
  int Task = Internal + 450;
558
  int Task = Internal + 450;
559
  
560
561
  
552
}
562
}
(-)org/eclipse/jdt/internal/compiler/Compiler.java Tue Mar 11 10:03:52 2003 (+7 lines)
Lines 27-32 Link Here
27
  public ICompilerRequestor requestor;
27
  public ICompilerRequestor requestor;
28
  public CompilerOptions options;
28
  public CompilerOptions options;
29
  public ProblemReporter problemReporter;
29
  public ProblemReporter problemReporter;
30
  
31
  //JOE
32
  public IAbstractSyntaxTreeVisitor hunter;
30
33
31
  // management of unit to be processed
34
  // management of unit to be processed
32
  //public CompilationUnitResult currentCompilationUnitResult;
35
  //public CompilationUnitResult currentCompilationUnitResult;
Lines 536-541 Link Here
536
539
537
     // type checking
540
     // type checking
538
     unit.resolve();
541
     unit.resolve();
542
     
543
     //JOE: I18N analysis
544
     if ( hunter != null)
545
        unit.traverse(hunter, unit.scope);
539
546
540
     // flow analysis
547
     // flow analysis
541
     unit.analyseCode();
548
     unit.analyseCode();
(-)org/eclipse/jdt/internal/compiler/batch/Main.java Tue Mar 11 10:03:56 2003 (-1 / +37 lines)
Lines 37-42 Link Here
37
import org.eclipse.jdt.internal.compiler.ICompilerRequestor;
37
import org.eclipse.jdt.internal.compiler.ICompilerRequestor;
38
import org.eclipse.jdt.internal.compiler.IErrorHandlingPolicy;
38
import org.eclipse.jdt.internal.compiler.IErrorHandlingPolicy;
39
import org.eclipse.jdt.internal.compiler.IProblemFactory;
39
import org.eclipse.jdt.internal.compiler.IProblemFactory;
40
import org.eclipse.jdt.internal.compiler.IAbstractSyntaxTreeVisitor; //JOE
40
import org.eclipse.jdt.internal.compiler.env.ICompilationUnit;
41
import org.eclipse.jdt.internal.compiler.env.ICompilationUnit;
41
import org.eclipse.jdt.internal.compiler.env.INameEnvironment;
42
import org.eclipse.jdt.internal.compiler.env.INameEnvironment;
42
import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
43
import org.eclipse.jdt.internal.compiler.impl.CompilerOptions;
Lines 69-74 Link Here
69
  public String[] classpaths;
70
  public String[] classpaths;
70
  public String destinationPath;
71
  public String destinationPath;
71
  public String log;
72
  public String log;
73
  public String checker; //JOE
72
  public int repetitions;
74
  public int repetitions;
73
  public int globalProblemsCount;
75
  public int globalProblemsCount;
74
  public int globalErrorsCount;
76
  public int globalErrorsCount;
Lines 311-316 Link Here
311
     final int InsideSource = 32;
313
     final int InsideSource = 32;
312
     final int InsideDefaultEncoding = 64;
314
     final int InsideDefaultEncoding = 64;
313
     final int InsideBootClasspath = 128;
315
     final int InsideBootClasspath = 128;
316
     final int InsideChecker = 256;      //JOE
314
     final int Default = 0;
317
     final int Default = 0;
315
     String[] bootclasspaths = null;
318
     String[] bootclasspaths = null;
316
     int DEFAULT_SIZE_CLASSPATH = 4;
319
     int DEFAULT_SIZE_CLASSPATH = 4;
Lines 789-794 Link Here
789
           mode = TargetSetting;
792
           mode = TargetSetting;
790
           continue;
793
           continue;
791
        }
794
        }
795
        //JOE
796
        if (currentArg.equals("-checker")) { //$NON-NLS-1$
797
           mode = InsideChecker;
798
           continue;
799
        }
800
        //EOJ
792
        if (currentArg.equals("-preserveAllLocals")) { //$NON-NLS-1$
801
        if (currentArg.equals("-preserveAllLocals")) { //$NON-NLS-1$
793
           options.put(
802
           options.put(
794
              CompilerOptions.OPTION_PreserveUnusedLocal,
803
              CompilerOptions.OPTION_PreserveUnusedLocal,
Lines 897-903 Link Here
897
           }
906
           }
898
           mode = Default;
907
           mode = Default;
899
           continue;
908
           continue;
900
        }        
909
        }
910
        //JOE
911
        if (mode == InsideChecker) {
912
           checker = currentArg;
913
           mode = Default;
914
           continue;
915
        }
916
        //EOJ    
901
        //default is input directory
917
        //default is input directory
902
        currentArg = currentArg.replace('/', File.separatorChar);
918
        currentArg = currentArg.replace('/', File.separatorChar);
903
        if (currentArg.endsWith(File.separator))
919
        if (currentArg.endsWith(File.separator))
Lines 1437-1442 Link Here
1437
     // set the non-externally configurable options.
1453
     // set the non-externally configurable options.
1438
     options.setVerboseMode(verbose);
1454
     options.setVerboseMode(verbose);
1439
     options.produceReferenceInfo(produceRefInfo);
1455
     options.produceReferenceInfo(produceRefInfo);
1456
     
1457
     
1458
     //JOE
1459
     // Set up the checker
1460
     try {
1461
        Class klass = Class.forName(checker);
1462
        batchCompiler.hunter = (IAbstractSyntaxTreeVisitor)klass.newInstance();
1463
     }
1464
     catch ( ClassNotFoundException e)
1465
     {
1466
        System.out.println("Cannot load I18nRules");
1467
     } catch (InstantiationException e) {
1468
        // TODO Auto-generated catch block
1469
        e.printStackTrace();
1470
     } catch (IllegalAccessException e) {
1471
        // TODO Auto-generated catch block
1472
        e.printStackTrace();
1473
     }
1474
     //EOJ
1475
     
1440
     batchCompiler.compile(getCompilationUnits());
1476
     batchCompiler.compile(getCompilationUnits());
1441
1477
1442
     // cleanup
1478
     // cleanup
(-)org/eclipse/jdt/internal/compiler/problem/ProblemReporter.java Tue Mar 11 10:03:50 2003 (-1 / +47 lines)
Lines 612-618 Link Here
612
        return Ignore;    
612
        return Ignore;    
613
     
613
     
614
     case IProblem.Task :
614
     case IProblem.Task :
615
        return Warning;         
615
        return Warning;
616
        
617
     //JOE
618
     case IProblem.StringConcat :
619
     case IProblem.LocaleSensitiveMethod :
620
     case IProblem.EmbeddedCharacter :
621
     case IProblem.EmbeddedString :
622
         return Warning;
623
     //EOJ
624
              
616
     default:
625
     default:
617
        return Error;
626
        return Error;
618
  }
627
  }
Lines 3147-3152 Link Here
3147
     location.sourceStart,
3156
     location.sourceStart,
3148
     location.sourceEnd);
3157
     location.sourceEnd);
3149
}
3158
}
3159
//JOE
3160
public void stringConcat(AstNode location) {
3161
  this.handle(
3162
     IProblem.StringConcat,
3163
     NoArgument,
3164
     NoArgument,
3165
     location.sourceStart,
3166
     location.sourceEnd);
3167
}
3168
3169
public void localeSensitiveMethod(MethodBinding method, AstNode location) {
3170
  this.handle(
3171
     IProblem.LocaleSensitiveMethod,
3172
     new String[] {new String(method.declaringClass.readableName()), new String(method.selector), parametersAsString(method)},
3173
     new String[] {new String(method.declaringClass.shortReadableName()), new String(method.selector), parametersAsShortString(method)},
3174
     location.sourceStart,
3175
     location.sourceEnd);
3176
}    
3177
3178
public void embeddedString(AstNode location) {
3179
  this.handle(
3180
     IProblem.EmbeddedString,
3181
     NoArgument,
3182
     NoArgument,
3183
     location.sourceStart,
3184
     location.sourceEnd);
3185
}
3186
           
3187
public void embeddedCharacter(AstNode location) {
3188
  this.handle(
3189
     IProblem.EmbeddedCharacter,
3190
     NoArgument,
3191
     NoArgument,
3192
     location.sourceStart,
3193
     location.sourceEnd);
3194
}
3195
//EOJ
3150
3196
3151
public void noMoreAvailableSpaceForConstant(TypeDeclaration typeDeclaration) {
3197
public void noMoreAvailableSpaceForConstant(TypeDeclaration typeDeclaration) {
3152
  this.handle(
3198
  this.handle(

Return to bug 38332