Changeset 12872 in josm for trunk/tools/japicc/modules
- Timestamp:
- 2017-09-17T15:47:18+02:00 (8 years ago)
- Location:
- trunk/tools/japicc/modules
- Files:
-
- 10 edited
-
Internals/APIDump.pm (modified) (11 diffs)
-
Internals/Basic.pm (modified) (1 diff)
-
Internals/Css/Report.css (modified) (5 diffs)
-
Internals/Filter.pm (modified) (1 diff)
-
Internals/RegTests.pm (modified) (20 diffs)
-
Internals/SysFiles.pm (modified) (1 diff)
-
Internals/TypeAttr.pm (modified) (1 diff)
-
Internals/Utils.pm (modified) (1 diff)
-
RulesBin.xml (modified) (4 diffs)
-
RulesSrc.xml (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/japicc/modules/Internals/APIDump.pm
r11682 r12872 135 135 136 136 my $ClassName = getFilename($ClassPath); 137 if($ClassName=~/\$\d/) { 137 if($ClassName=~/\$\d/ or $ClassName eq "module-info") { 138 138 next; 139 139 } 140 140 141 $ClassPath = cutPrefix($ClassPath, $ExtractPath); # javap decompiler accepts relative paths only 141 142 … … 220 221 } 221 222 222 sub simpleDecl($) 223 sub simpleDecl($$) 223 224 { 224 my $Line = $_[0];225 my ($Line, $LVer) = @_; 225 226 226 227 my %B = ( "<"=>0, ">"=>0 ); … … 287 288 { 288 289 if($Line=~s/([A-Za-z\d\?]+) extends \Q$R\E/$1/) { 289 $Tmpl{$1} = $R;290 $Tmpl{$1} = registerType($R, $LVer); 290 291 } 291 292 } … … 317 318 close(IN); 318 319 319 my (%TypeAttr, $CurrentMethod, $CurrentPackage, $CurrentClass) = (); 320 my (%TypeAttr, $CurrentMethod, $CurrentPackage, $CurrentClass, $CurrentClass_Short) = (); 320 321 my ($InParamTable, $InVarTypeTable, $InExceptionTable, $InCode) = (0, 0, 0, 0); 321 322 … … 488 489 # <KEYIN extends java.lang.Object ... 489 490 if($LINE=~/<[A-Z\d\?]+ /i) { 490 ($LINE, $TmplP) = simpleDecl($LINE); 491 ($LINE, $TmplP) = simpleDecl($LINE, $LVer); 491 492 } 492 493 } … … 628 629 } 629 630 $MethodAttr{"Class"} = registerType($TypeAttr{"Name"}, $LVer); 630 if($MethodAttr{"ShortName"}=~/\A(|(.+)\.)\Q$CurrentClass\E\Z/) 631 if($MethodAttr{"ShortName"}=~/\A(|(.+)\.)(\Q$CurrentClass\E|\Q$CurrentClass_Short\E)\Z/) 631 632 { 632 633 if($2) … … 688 689 and $LINE_N=~/(Signature|descriptor):\s*(.+?)\s*\Z/i) 689 690 { # create run-time unique name ( java/io/PrintStream.println (Ljava/lang/String;)V ) 691 my $SignParams = $2; 692 693 # Generic classes 694 my $ShortClass = $CurrentClass; 695 $ShortClass=~s/<.*>//g; 696 690 697 if($MethodAttr{"Constructor"}) { 691 $CurrentMethod = $ CurrentClass.".\"<init>\":".$2;698 $CurrentMethod = $ShortClass.".\"<init>\":".$SignParams; 692 699 } 693 700 else { 694 $CurrentMethod = $ CurrentClass.".".$MethodAttr{"ShortName"}.":".$2;701 $CurrentMethod = $ShortClass.".".$MethodAttr{"ShortName"}.":".$SignParams; 695 702 } 696 703 if(my $PackageName = getSFormat($CurrentPackage)) { … … 832 839 $CurrentPackage = ""; 833 840 } 841 834 842 if($CurrentClass=~s/#/./g) 835 843 { # javax.swing.text.GlyphView.GlyphPainter <=> GlyphView$GlyphPainter 836 844 $TypeAttr{"Name"}=~s/#/./g; 837 845 } 846 847 $CurrentClass_Short = $CurrentClass; 848 if(index($CurrentClass_Short, "<")!=-1) { 849 $CurrentClass_Short=~s/<.+>//g; 850 } 851 838 852 if($LINE=~/(\A|\s+)(public|protected|private)\s+/) { 839 853 $TypeAttr{"Access"} = $2; … … 885 899 $TypeAttr{"Static"} = 1; 886 900 } 901 902 if($TmplP) { 903 $TypeAttr{"GenericParam"} = $TmplP; 904 } 887 905 } 888 906 elsif(index($LINE, "Deprecated: true")!=-1 … … 919 937 chdir($In::Opt{"OrigDir"}); 920 938 939 if(my $Err = $?>>8) { 940 exitStatus("Error", "failed to run javap"); 941 } 942 921 943 if(not $NonEmpty) { 922 944 exitStatus("Error", "internal error in parser"); … … 961 983 $TypeInfo{$LVer}{$Tid}{"BaseType"} = $BaseTypeId; 962 984 $TypeInfo{$LVer}{$Tid}{"Type"} = "array"; 985 } 986 } 987 elsif($TName=~/(.+)\.\.\.\Z/) 988 { 989 if(my $BaseTypeId = registerType($1, $LVer)) 990 { 991 $TypeInfo{$LVer}{$Tid}{"BaseType"} = $BaseTypeId; 992 $TypeInfo{$LVer}{$Tid}{"Type"} = "variable-arity"; 963 993 } 964 994 } -
trunk/tools/japicc/modules/Internals/Basic.pm
r11682 r12872 26 26 my %Cache; 27 27 28 my $MD5_LEN = 8;28 my $MD5_LEN = 12; 29 29 30 30 sub getOSgroup() -
trunk/tools/japicc/modules/Internals/Css/Report.css
r11682 r12872 44 44 } 45 45 span.ext { 46 font-weight: 100;46 font-weight:normal; 47 47 } 48 48 span.jar { … … 89 89 span.attr { 90 90 color:Black; 91 font-weight: 100;91 font-weight:normal; 92 92 } 93 93 span.deprecated { … … 142 142 table.summary th { 143 143 background-color:#eeeeee; 144 font-weight: 100;144 font-weight:normal; 145 145 text-align:left; 146 146 font-size:0.94em; … … 177 177 } 178 178 span.ttype { 179 font-weight: 100;179 font-weight:normal; 180 180 } 181 181 span.nowrap { … … 188 188 .passed { 189 189 background-color:#CCFFCC; 190 font-weight: 100;190 font-weight:normal; 191 191 } 192 192 .warning { 193 193 background-color:#F4F4AF; 194 font-weight: 100;194 font-weight:normal; 195 195 } 196 196 .failed { 197 197 background-color:#FFCCCC; 198 font-weight: 100;198 font-weight:normal; 199 199 } 200 200 .new { 201 201 background-color:#C6DEFF; 202 font-weight: 100;202 font-weight:normal; 203 203 } 204 204 205 205 .compatible { 206 206 background-color:#CCFFCC; 207 font-weight: 100;207 font-weight:normal; 208 208 } 209 209 .almost_compatible { 210 210 background-color:#FFDAA3; 211 font-weight: 100;211 font-weight:normal; 212 212 } 213 213 .incompatible { 214 214 background-color:#FFCCCC; 215 font-weight: 100;215 font-weight:normal; 216 216 } 217 217 .gray { 218 218 background-color:#DCDCDC; 219 font-weight: 100;219 font-weight:normal; 220 220 } 221 221 -
trunk/tools/japicc/modules/Internals/Filter.pm
r11682 r12872 286 286 } 287 287 288 if(my $Check = $In::Opt{"CheckPackages"}) 289 { 290 if($Package!~/$Check/) { 291 return 1; 292 } 293 } 294 288 295 return 0; 289 296 } -
trunk/tools/japicc/modules/Internals/RegTests.pm
r11682 r12872 80 80 writeFile($Path_v2."/BaseAbstractClass.java", $BaseAbstractClass); 81 81 82 # Removed_Annotation83 writeFile($Path_v1."/RemovedAnnotation.java",84 "package $PackageName;85 public \@interface RemovedAnnotation {86 }");87 88 # Beta Annotation89 writeFile($Path_v1."/Beta.java",90 "package $PackageName;91 public \@interface Beta {92 }");93 94 writeFile($Path_v2."/Beta.java",95 "package $PackageName;96 public \@interface Beta {97 }");98 99 82 # BaseClass 100 83 my $BaseClass = "package $PackageName; … … 142 125 writeFile($Path_v2."/BaseConstantInterface.java", $BaseConstantInterface); 143 126 144 # Removed_Method (Beta method) 145 writeFile($Path_v1."/RemovedBetaMethod.java", 146 "package $PackageName; 147 public class RemovedBetaMethod 148 { 127 if(cmpVersions($In::Opt{"CompilerVer"}, "1.5")>=0) 128 { 129 # GenericClass1 130 writeFile($Path_v1."/GenericClass1.java", 131 "package $PackageName; 132 public class GenericClass1<T> { 133 public Integer method(T param) { return 0; } 134 }"); 135 writeFile($Path_v2."/GenericClass1.java", 136 "package $PackageName; 137 public class GenericClass1<T> { 138 public Integer method(T param) { return 0; } 139 }"); 140 141 # GenericClass2 142 writeFile($Path_v1."/GenericClass2.java", 143 "package $PackageName; 144 public class GenericClass2<T> { 145 public void method() { } 146 }"); 147 writeFile($Path_v2."/GenericClass2.java", 148 "package $PackageName; 149 public class GenericClass2<T> { 150 public void method() { } 151 }"); 152 153 # Class became generic 154 writeFile($Path_v1."/ClassBecameGeneric.java", 155 "package $PackageName; 156 public abstract class ClassBecameGeneric { 157 public ClassBecameGeneric() {} 158 public abstract ClassBecameGeneric doSomething(); 159 }"); 160 writeFile($Path_v2."/ClassBecameGeneric.java", 161 "package $PackageName; 162 public abstract class ClassBecameGeneric<T> { 163 public ClassBecameGeneric() {} 164 public abstract T doSomething(); 165 }"); 166 167 writeFile($TestsPath."/Test_ClassBecameGeneric.java", 168 "import $PackageName.*; 169 class GenerifyingClassDerived extends ClassBecameGeneric { 170 public ClassBecameGeneric doSomething() { return new GenerifyingClassDerived(); } 171 public static void main(String[] args) { } 172 } 173 public class Test_ClassBecameGeneric 174 { 175 public static void main(String[] args) { 176 GenerifyingClassDerived X = new GenerifyingClassDerived(); 177 ClassBecameGeneric Res = X.doSomething(); 178 } 179 }"); 180 181 # Class became raw 182 writeFile($Path_v1."/ClassBecameRaw.java", 183 "package $PackageName; 184 public class ClassBecameRaw<T extends String> { 185 public void method(T param) { } 186 }"); 187 writeFile($Path_v2."/ClassBecameRaw.java", 188 "package $PackageName; 189 public class ClassBecameRaw { 190 public void method(String param) { } 191 }"); 192 193 writeFile($TestsPath."/Test_ClassBecameRaw.java", 194 "import $PackageName.*; 195 public class Test_ClassBecameRaw 196 { 197 public static void main(String[] args) { 198 ClassBecameRaw<String> X = new ClassBecameRaw<String>(); 199 X.method(\"XXX\"); 200 } 201 }"); 202 203 # Interface became generic 204 writeFile($Path_v1."/InterfaceBecameGeneric.java", 205 "package $PackageName; 206 public interface InterfaceBecameGeneric { 207 public void method(); 208 }"); 209 writeFile($Path_v2."/InterfaceBecameGeneric.java", 210 "package $PackageName; 211 public interface InterfaceBecameGeneric<T> { 212 public void method(); 213 }"); 214 215 # Interface became raw 216 writeFile($Path_v1."/InterfaceBecameRaw.java", 217 "package $PackageName; 218 public interface InterfaceBecameRaw<T> { 219 public void method(); 220 }"); 221 writeFile($Path_v2."/InterfaceBecameRaw.java", 222 "package $PackageName; 223 public interface InterfaceBecameRaw { 224 public void method(); 225 }"); 226 227 writeFile($TestsPath."/Test_InterfaceBecameRaw.java", 228 "import $PackageName.*; 229 class InterfaceBecameRawDerived implements InterfaceBecameRaw<String> { 230 public void method() { } 231 public static void main(String[] args) { } 232 } 233 public class Test_InterfaceBecameRaw 234 { 235 public static void main(String[] args) { 236 InterfaceBecameRawDerived X = new InterfaceBecameRawDerived(); 237 X.method(); 238 } 239 }"); 240 241 # Changed generic super-class 242 writeFile($Path_v1."/GenericSuperClassChanged.java", 243 "package $PackageName; 244 public class GenericSuperClassChanged extends GenericClass1<String> { 245 public Integer method() { return 0; } 246 }"); 247 writeFile($Path_v2."/GenericSuperClassChanged.java", 248 "package $PackageName; 249 public class GenericSuperClassChanged extends GenericClass1<Integer> { 250 public Integer method() { return 0; } 251 }"); 252 253 # Extending class with generic parameters 254 writeFile($Path_v1."/ExtendingClassWithGeneric.java", 255 "package $PackageName; 256 public class ExtendingClassWithGeneric { 257 public void method() { } 258 }"); 259 writeFile($Path_v2."/ExtendingClassWithGeneric.java", 260 "package $PackageName; 261 public class ExtendingClassWithGeneric extends GenericClass2<String> 262 { 263 }"); 264 265 # Renamed generic parameter 266 writeFile($Path_v1."/RenamedGenericParameter.java", 267 "package $PackageName; 268 public class RenamedGenericParameter<A extends String> { 269 public void method(A param) { } 270 }"); 271 writeFile($Path_v2."/RenamedGenericParameter.java", 272 "package $PackageName; 273 public class RenamedGenericParameter<B extends String> { 274 public void method(B param) { } 275 }"); 276 277 # Changed field type by introducing of a generic parameter 278 writeFile($Path_v1."/ChangedFieldTypeByGenericParam.java", 279 "package $PackageName; 280 public class ChangedFieldTypeByGenericParam { 281 public ChangedFieldTypeByGenericParam(String param) { f=param; } 282 public void method() { } 283 public String f; 284 }"); 285 writeFile($Path_v2."/ChangedFieldTypeByGenericParam.java", 286 "package $PackageName; 287 public class ChangedFieldTypeByGenericParam<T> { 288 public ChangedFieldTypeByGenericParam(T param) { f=param; } 289 public void method() { } 290 public T f; 291 }"); 292 293 writeFile($Path_v1."/TestGeneric.java", 294 "package $PackageName; 295 public class TestGeneric { 296 public ChangedFieldTypeByGenericParam get1() { return new ChangedFieldTypeByGenericParam(\"XXX\"); } 297 public ChangedFieldTypeByGenericParam get2() { return new ChangedFieldTypeByGenericParam(\"XXX\"); } 298 }"); 299 writeFile($Path_v2."/TestGeneric.java", 300 "package $PackageName; 301 public class TestGeneric { 302 public ChangedFieldTypeByGenericParam<String> get1() { return new ChangedFieldTypeByGenericParam<String>(\"XXX\"); } 303 public ChangedFieldTypeByGenericParam<Integer> get2() { return new ChangedFieldTypeByGenericParam<Integer>(0); } 304 }"); 305 306 writeFile($TestsPath."/Test_ChangedFieldTypeByGenericParam.java", 307 "import $PackageName.*; 308 public class Test_ChangedFieldTypeByGenericParam 309 { 310 public static void main(String[] args) 311 { 312 TestGeneric X = new TestGeneric(); 313 ChangedFieldTypeByGenericParam Res1 = X.get1(); 314 ChangedFieldTypeByGenericParam Res2 = X.get2(); 315 Res1.f = Res2.f; 316 } 317 }"); 318 319 # Changed constructor after generifying 320 writeFile($Path_v1."/ChangedCtorAfterGenerifying.java", 321 "package $PackageName; 322 public class ChangedCtorAfterGenerifying { 323 public ChangedCtorAfterGenerifying(String param) { } 324 public String f; 325 }"); 326 writeFile($Path_v2."/ChangedCtorAfterGenerifying.java", 327 "package $PackageName; 328 public class ChangedCtorAfterGenerifying<T> { 329 public ChangedCtorAfterGenerifying(T param) { } 330 public T f; 331 }"); 332 333 writeFile($TestsPath."/Test_ChangedCtorAfterGenerifying.java", 334 "import $PackageName.*; 335 public class Test_ChangedCtorAfterGenerifying 336 { 337 public static void main(String[] args) { 338 ChangedCtorAfterGenerifying X = new ChangedCtorAfterGenerifying(\"XXX\"); 339 } 340 }"); 341 342 # Array to variable arity 343 writeFile($Path_v1."/ArrayToVariableArity.java", 344 "package $PackageName; 345 public class ArrayToVariableArity { 346 public void method(Integer x, String[] y) { } 347 }"); 348 writeFile($Path_v2."/ArrayToVariableArity.java", 349 "package $PackageName; 350 public class ArrayToVariableArity { 351 public void method(Integer x, String... y) { } 352 }"); 353 354 writeFile($TestsPath."/Test_ArrayToVariableArity.java", 355 "import $PackageName.*; 356 public class Test_ArrayToVariableArity 357 { 358 public static void main(String[] args) { 359 ArrayToVariableArity X = new ArrayToVariableArity(); 360 X.method(0, new String[]{\"a\", \"b\"}); 361 } 362 }"); 363 364 # Variable arity to array 365 writeFile($Path_v1."/VariableArityToArray.java", 366 "package $PackageName; 367 public class VariableArityToArray { 368 public void method(Integer x, String... y) { } 369 }"); 370 writeFile($Path_v2."/VariableArityToArray.java", 371 "package $PackageName; 372 public class VariableArityToArray { 373 public void method(Integer x, String[] y) { } 374 }"); 375 376 writeFile($TestsPath."/Test_VariableArityToArray.java", 377 "import $PackageName.*; 378 public class Test_VariableArityToArray 379 { 380 public static void main(String[] args) { 381 VariableArityToArray X = new VariableArityToArray(); 382 X.method(0, \"a\", \"b\"); 383 } 384 }"); 385 386 # Removed_Annotation 387 writeFile($Path_v1."/RemovedAnnotation.java", 388 "package $PackageName; 389 public \@interface RemovedAnnotation { 390 }"); 391 392 writeFile($TestsPath."/Test_RemovedAnnotation.java", 393 "import $PackageName.*; 394 public class Test_RemovedAnnotation { 395 public static void main(String[] args) { 396 testMethod(); 397 } 398 399 \@RemovedAnnotation 400 static void testMethod() { 401 } 402 }"); 403 404 # Beta Annotation 405 writeFile($Path_v1."/Beta.java", 406 "package $PackageName; 407 public \@interface Beta { 408 }"); 409 410 writeFile($Path_v2."/Beta.java", 411 "package $PackageName; 412 public \@interface Beta { 413 }"); 414 415 # Removed_Method (Beta method) 416 writeFile($Path_v1."/RemovedBetaMethod.java", 417 "package $PackageName; 418 public class RemovedBetaMethod 419 { 420 \@Beta 421 public Integer someMethod() { 422 return 0; 423 } 424 }"); 425 writeFile($Path_v2."/RemovedBetaMethod.java", 426 "package $PackageName; 427 public class RemovedBetaMethod { 428 }"); 429 430 # Removed_Method (from Beta class) 431 writeFile($Path_v1."/RemovedMethodFromBetaClass.java", 432 "package $PackageName; 149 433 \@Beta 150 public Integer someMethod() { 151 return 0; 152 } 153 }"); 154 writeFile($Path_v2."/RemovedBetaMethod.java", 155 "package $PackageName; 156 public class RemovedBetaMethod { 157 }"); 158 159 # Removed_Method (from Beta class) 160 writeFile($Path_v1."/RemovedMethodFromBetaClass.java", 161 "package $PackageName; 162 \@Beta 163 public class RemovedMethodFromBetaClass 164 { 165 public Integer someMethod() { 166 return 0; 167 } 168 }"); 169 writeFile($Path_v2."/RemovedMethodFromBetaClass.java", 170 "package $PackageName; 171 \@Beta 172 public class RemovedMethodFromBetaClass { 173 }"); 174 175 # Removed_Class (Beta) 176 writeFile($Path_v1."/RemovedBetaClass.java", 177 "package $PackageName; 178 \@Beta 179 public class RemovedBetaClass 180 { 181 public Integer someMethod() { 182 return 0; 183 } 184 }"); 434 public class RemovedMethodFromBetaClass 435 { 436 public Integer someMethod() { 437 return 0; 438 } 439 }"); 440 writeFile($Path_v2."/RemovedMethodFromBetaClass.java", 441 "package $PackageName; 442 \@Beta 443 public class RemovedMethodFromBetaClass { 444 }"); 445 446 # Removed_Class (Beta) 447 writeFile($Path_v1."/RemovedBetaClass.java", 448 "package $PackageName; 449 \@Beta 450 public class RemovedBetaClass 451 { 452 public Integer someMethod() { 453 return 0; 454 } 455 }"); 456 } 185 457 186 458 # Abstract_Method_Added_Checked_Exception … … 276 548 "package $PackageName; 277 549 public class ChangedMethodReturnFromVoid { 278 public void changedMethod(Integer param1 , String[] param2) { }550 public void changedMethod(Integer param1) { } 279 551 }"); 280 552 writeFile($Path_v2."/ChangedMethodReturnFromVoid.java", 281 553 "package $PackageName; 282 554 public class ChangedMethodReturnFromVoid { 283 public Integer changedMethod(Integer param1 , String[] param2){555 public Integer changedMethod(Integer param1){ 284 556 return param1; 557 } 558 }"); 559 560 writeFile($TestsPath."/Test_ChangedMethodReturnFromVoid.java", 561 "import $PackageName.*; 562 public class Test_ChangedMethodReturnFromVoid { 563 public static void main(String[] args) { 564 ChangedMethodReturnFromVoid X = new ChangedMethodReturnFromVoid(); 565 X.changedMethod(1); 566 } 567 }"); 568 569 # Changed_Method_Return 570 writeFile($Path_v1."/ChangedMethodReturn.java", 571 "package $PackageName; 572 public class ChangedMethodReturn { 573 public Integer changedMethod(Integer param) { return 0; } 574 }"); 575 writeFile($Path_v2."/ChangedMethodReturn.java", 576 "package $PackageName; 577 public class ChangedMethodReturn { 578 public String changedMethod(Integer param) { return \"XXX\"; } 579 }"); 580 581 writeFile($TestsPath."/Test_ChangedMethodReturn.java", 582 "import $PackageName.*; 583 public class Test_ChangedMethodReturn { 584 public static void main(String[] args) { 585 ChangedMethodReturn X = new ChangedMethodReturn(); 586 Integer Res = X.changedMethod(0); 285 587 } 286 588 }"); … … 362 664 }"); 363 665 364 writeFile($TestsPath."/Test_RemovedAnnotation.java",365 "import $PackageName.*;366 public class Test_RemovedAnnotation {367 public static void main(String[] args) {368 testMethod();369 }370 371 \@RemovedAnnotation372 static void testMethod() {373 }374 }");375 376 666 # Removed_Constant_Field (Interface) 377 667 writeFile($Path_v1."/InterfaceRemovedConstantField.java", … … 437 727 }"); 438 728 729 writeFile($TestsPath."/Test_ChangedFieldType.java", 730 "import $PackageName.*; 731 public class Test_ChangedFieldType { 732 public static void main(String[] args) { 733 ChangedFieldType X = new ChangedFieldType(); 734 String R = X.fieldName; 735 } 736 }"); 737 439 738 # Changed_Field_Access 440 739 writeFile($Path_v1."/ChangedFieldAccess.java", … … 473 772 public class NonConstantFieldBecameStatic { 474 773 public static String fieldName; 774 }"); 775 776 writeFile($TestsPath."/Test_NonConstantFieldBecameStatic.java", 777 "import $PackageName.*; 778 public class Test_NonConstantFieldBecameStatic { 779 public static void main(String[] args) { 780 NonConstantFieldBecameStatic X = new NonConstantFieldBecameStatic(); 781 String R = X.fieldName; 782 } 475 783 }"); 476 784 … … 535 843 public class RemovedMethod { 536 844 public Integer field = 100; 845 }"); 846 847 # Removed protected method from final class 848 writeFile($Path_v1."/RemovedProtectedMethodFromFinalClass.java", 849 "package $PackageName; 850 public final class RemovedProtectedMethodFromFinalClass { 851 protected void removedMethod(Integer param) { } 852 }"); 853 writeFile($Path_v2."/RemovedProtectedMethodFromFinalClass.java", 854 "package $PackageName; 855 public final class RemovedProtectedMethodFromFinalClass { 537 856 }"); 538 857 … … 586 905 }"); 587 906 907 # Interface_Removed_Abstract_Method (Last) 908 writeFile($Path_v1."/InterfaceRemovedLastAbstractMethod.java", 909 "package $PackageName; 910 public interface InterfaceRemovedLastAbstractMethod { 911 public void removedMethod(Integer param); 912 }"); 913 writeFile($Path_v2."/InterfaceRemovedLastAbstractMethod.java", 914 "package $PackageName; 915 public interface InterfaceRemovedLastAbstractMethod { 916 }"); 917 918 writeFile($TestsPath."/Test_InterfaceRemovedLastAbstractMethod.java", 919 "import $PackageName.*; 920 class InterfaceRemovedLastAbstractMethodDerived implements InterfaceRemovedLastAbstractMethod 921 { 922 public void removedMethod(Integer param) { } 923 public static void main(String[] args) { } 924 }; 925 926 public class Test_InterfaceRemovedLastAbstractMethod 927 { 928 public static void main(String[] args) 929 { 930 InterfaceRemovedLastAbstractMethod Obj = new InterfaceRemovedLastAbstractMethodDerived(); 931 Obj.removedMethod(0); 932 } 933 }"); 934 588 935 # Interface_Added_Abstract_Method 589 936 writeFile($Path_v1."/InterfaceAddedAbstractMethod.java", … … 627 974 "import $PackageName.*; 628 975 class Class_MethodBecameNonDefault implements MethodBecameNonDefault { 976 public static void main(String[] args) { } 629 977 }; 630 978 … … 638 986 }"); 639 987 640 # Variable_Arity_To_Array641 writeFile($Path_v1."/VariableArityToArray.java",642 "package $PackageName;643 public class VariableArityToArray {644 public void someMethod(Integer x, String... y) { };645 }");646 writeFile($Path_v2."/VariableArityToArray.java",647 "package $PackageName;648 public class VariableArityToArray {649 public void someMethod(Integer x, String[] y) { };650 }");651 652 988 # Class_Became_Interface 653 989 writeFile($Path_v1."/ClassBecameInterface.java", … … 879 1215 writeFile($TestsPath."/Test_RemovedFieldClass.java", 880 1216 "import $PackageName.*; 881 public class Test_RemovedFieldClass extends RemovedFieldClass1217 public class Test_RemovedFieldClass 882 1218 { 883 1219 public static void main(String[] args) … … 1047 1383 return param1; 1048 1384 }; 1049 public abstract IntegerremovedMethod(Integer param);1385 public abstract void removedMethod(Integer param); 1050 1386 }"); 1051 1387 writeFile($Path_v2."/ClassRemovedAbstractMethod.java", … … 1057 1393 }"); 1058 1394 1395 writeFile($TestsPath."/Test_ClassRemovedAbstractMethod.java", 1396 "import $PackageName.*; 1397 class ClassRemovedAbstractMethodDerived extends ClassRemovedAbstractMethod 1398 { 1399 public void removedMethod(Integer param) { } 1400 public static void main(String[] args) { } 1401 }; 1402 1403 public class Test_ClassRemovedAbstractMethod 1404 { 1405 public static void main(String[] args) 1406 { 1407 ClassRemovedAbstractMethod Obj = new ClassRemovedAbstractMethodDerived(); 1408 Obj.removedMethod(0); 1409 } 1410 }"); 1411 1059 1412 # Class_Method_Became_Abstract 1060 1413 writeFile($Path_v1."/ClassMethodBecameAbstract.java", … … 1130 1483 1131 1484 # Static_Method_Became_Final 1132 writeFile($Path_v 1."/StaticMethodBecameFinal.java",1485 writeFile($Path_v2."/StaticMethodBecameFinal.java", 1133 1486 "package $PackageName; 1134 1487 public class StaticMethodBecameFinal { … … 1137 1490 }; 1138 1491 }"); 1139 writeFile($Path_v 2."/StaticMethodBecameFinal.java",1492 writeFile($Path_v1."/StaticMethodBecameFinal.java", 1140 1493 "package $PackageName; 1141 1494 public class StaticMethodBecameFinal { … … 1143 1496 return param; 1144 1497 }; 1498 }"); 1499 1500 writeFile($TestsPath."/Test_StaticMethodBecameFinal.java", 1501 "import $PackageName.*; 1502 public class Test_StaticMethodBecameFinal 1503 { 1504 public static void main(String[] args) 1505 { 1506 Integer R = StaticMethodBecameFinal.someMethod(0); 1507 } 1145 1508 }"); 1146 1509 … … 1315 1678 return 0; 1316 1679 } 1680 public Integer someMethod(InterfaceRemovedLastAbstractMethod param) { 1681 return 0; 1682 } 1683 1317 1684 }"); 1318 1685 writeFile($Path_v2."/Use.java", … … 1340 1707 public Integer someMethod(AbstractClassAddedSuperInterfaceWithImplementedMethods param) { 1341 1708 return param.method2(100); 1709 } 1710 public Integer someMethod(InterfaceRemovedLastAbstractMethod param) { 1711 return 0; 1342 1712 } 1343 1713 }"); … … 1403 1773 my ($TestsPath, $PackageName, $Path_v1, $Path_v2) = @_; 1404 1774 1775 printMsg("INFO", "Running tests ..."); 1776 1405 1777 # compile with old version of package 1406 1778 my $JavacCmd = getCmdPath("javac"); … … 1447 1819 } 1448 1820 1449 writeFile("$TestsPath/Journal.txt", $TEST_REPORT); 1821 my $Journal = $TestsPath."/Journal.txt"; 1822 writeFile($Journal, $TEST_REPORT); 1823 printMsg("INFO", "See journal with test results: $Journal"); 1450 1824 } 1451 1825 -
trunk/tools/japicc/modules/Internals/SysFiles.pm
r11682 r12872 195 195 if(my $Ver = `$JavacCmd -version 2>&1`) 196 196 { 197 if($Ver=~/javac\s+(.+)/) { 197 if($Ver=~/javac\s+(.+)/) 198 { 198 199 printMsg("INFO", "Using Java ".$1); 200 $In::Opt{"CompilerVer"} = $1; 199 201 } 200 202 } -
trunk/tools/japicc/modules/Internals/TypeAttr.pm
r11682 r12872 95 95 } 96 96 97 sub getGeneric($) 98 { 99 my $Name = $_[0]; 100 $Name=~s/<.*>//g; 101 return $Name; 102 } 103 97 104 return 1; -
trunk/tools/japicc/modules/Internals/Utils.pm
r11682 r12872 64 64 65 65 # Linux 66 return POSIX::sysconf(POSIX::_SC_ARG_MAX); 66 # return POSIX::sysconf(POSIX::_SC_ARG_MAX); 67 # javap failed on rt.jar (GC triggered before VM initialization completed) 68 return 10000; 67 69 } 68 70 -
trunk/tools/japicc/modules/RulesBin.xml
r11682 r12872 52 52 </change> 53 53 <effect> 54 This method has been removed because the return type is part of the method signature. 54 This method has been removed because the return type is part of the method signature. A client program may be interrupted by **NoSuchMethodError** exception. 55 </effect> 56 </rule> 57 58 <rule> 59 <id> 60 Changed_Method_Return 61 </id> 62 <severity> 63 High 64 </severity> 65 <kind> 66 Methods 67 </kind> 68 <change> 69 Return value type has been changed from @old_value to @new_value. 70 </change> 71 <effect> 72 This method has been removed because the return type is part of the method signature. A client program may be interrupted by **NoSuchMethodError** exception. 73 </effect> 74 </rule> 75 76 <rule> 77 <id> 78 Static_Method_Became_Final 79 </id> 80 <severity> 81 Safe 82 </severity> 83 <kind> 84 Methods 85 </kind> 86 <change> 87 Method became final. 88 </change> 89 <effect> 90 No effect. 55 91 </effect> 56 92 </rule> … … 301 337 </id> 302 338 <severity> 303 Low 304 </severity> 305 <kind> 306 Methods 307 </kind> 339 Safe 340 </severity> 341 <kind> 342 Methods 343 </kind> 344 <change> 345 Type of parameter @param_name has been changed from @old_value to @new_value. 346 </change> 347 <effect> 348 No effect. 349 </effect> 350 </rule> 351 352 <rule> 353 <id> 354 Array_To_Variable_Arity 355 </id> 356 <severity> 357 Safe 358 </severity> 359 <kind> 360 Methods 361 </kind> 362 <change> 363 Type of parameter @param_name has been changed from @old_value to @new_value. 364 </change> 365 <effect> 366 No effect. 367 </effect> 308 368 </rule> 309 369 … … 803 863 </id> 804 864 <severity> 805 Medium865 Low 806 866 </severity> 807 867 <kind> … … 1161 1221 <rule> 1162 1222 <id> 1223 Interface_Became_Generic 1224 </id> 1225 <severity> 1226 Safe 1227 </severity> 1228 <kind> 1229 Types 1230 </kind> 1231 <change> 1232 This interface became **generic** (@new_value). 1233 </change> 1234 <effect> 1235 No effect. 1236 </effect> 1237 </rule> 1238 1239 <rule> 1240 <id> 1241 Interface_Became_Raw 1242 </id> 1243 <severity> 1244 Low 1245 </severity> 1246 <kind> 1247 Types 1248 </kind> 1249 <change> 1250 This interface became **raw**. 1251 </change> 1252 <effect> 1253 No effect. 1254 </effect> 1255 </rule> 1256 1257 <rule> 1258 <id> 1259 Class_Became_Generic 1260 </id> 1261 <severity> 1262 Safe 1263 </severity> 1264 <kind> 1265 Types 1266 </kind> 1267 <change> 1268 This class became **generic** (@new_value). 1269 </change> 1270 <effect> 1271 No effect. 1272 </effect> 1273 </rule> 1274 1275 <rule> 1276 <id> 1277 Class_Became_Raw 1278 </id> 1279 <severity> 1280 Low 1281 </severity> 1282 <kind> 1283 Types 1284 </kind> 1285 <change> 1286 This class became **raw**. 1287 </change> 1288 <effect> 1289 No effect. 1290 </effect> 1291 </rule> 1292 1293 <rule> 1294 <id> 1163 1295 Class_Became_Final 1164 1296 </id> -
trunk/tools/japicc/modules/RulesSrc.xml
r11682 r12872 40 40 <rule> 41 41 <id> 42 Changed_Method_Return 43 </id> 44 <severity> 45 Medium 46 </severity> 47 <kind> 48 Methods 49 </kind> 50 <change> 51 Return value type has been changed from @old_value to @new_value. 52 </change> 53 <effect> 54 Recompilation of a client program may be terminated with the message: incompatible types: @new_value cannot be converted to @old_value. 55 </effect> 56 </rule> 57 58 <rule> 59 <id> 42 60 Static_Method_Became_Final 43 61 </id> … … 262 280 <rule> 263 281 <id> 282 Variable_Arity_To_Array 283 </id> 284 <severity> 285 Medium 286 </severity> 287 <kind> 288 Methods 289 </kind> 290 <change> 291 Type of parameter @param_name has been changed from @old_value to @new_value. 292 </change> 293 <effect> 294 Recompilation of a client program may be terminated with the message: method @method_short in class @type_name cannot be applied to given types. 295 </effect> 296 </rule> 297 298 <rule> 299 <id> 300 Array_To_Variable_Arity 301 </id> 302 <severity> 303 Safe 304 </severity> 305 <kind> 306 Methods 307 </kind> 308 <change> 309 Type of parameter @param_name has been changed from @old_value to @new_value. 310 </change> 311 <effect> 312 No effect. 313 </effect> 314 </rule> 315 316 <rule> 317 <id> 264 318 NonAbstract_Class_Added_Abstract_Method 265 319 </id> … … 715 769 </id> 716 770 <severity> 717 Medium771 Low 718 772 </severity> 719 773 <kind> … … 947 1001 <rule> 948 1002 <id> 1003 Field_Became_NonFinal 1004 </id> 1005 <severity> 1006 Safe 1007 </severity> 1008 <kind> 1009 Fields 1010 </kind> 1011 <change> 1012 Field @target became non-final. 1013 </change> 1014 <effect> 1015 No effect. 1016 </effect> 1017 </rule> 1018 1019 <rule> 1020 <id> 1021 NonConstant_Field_Became_Static 1022 </id> 1023 <severity> 1024 Safe 1025 </severity> 1026 <kind> 1027 Fields 1028 </kind> 1029 <change> 1030 Field @target became static. 1031 </change> 1032 <effect> 1033 No effect. 1034 </effect> 1035 </rule> 1036 1037 <rule> 1038 <id> 949 1039 NonConstant_Field_Became_NonStatic 950 1040 </id> … … 1019 1109 <rule> 1020 1110 <id> 1111 Interface_Became_Generic 1112 </id> 1113 <severity> 1114 Safe 1115 </severity> 1116 <kind> 1117 Types 1118 </kind> 1119 <change> 1120 This interface became **generic** (@new_value). 1121 </change> 1122 <effect> 1123 No effect. 1124 </effect> 1125 </rule> 1126 1127 <rule> 1128 <id> 1129 Interface_Became_Raw 1130 </id> 1131 <severity> 1132 Medium 1133 </severity> 1134 <kind> 1135 Types 1136 </kind> 1137 <change> 1138 This interface became **raw**. 1139 </change> 1140 <effect> 1141 Recompilation of a client program may be terminated with the message: type @new_value does not take parameters. 1142 </effect> 1143 </rule> 1144 1145 <rule> 1146 <id> 1147 Class_Became_Generic 1148 </id> 1149 <severity> 1150 Safe 1151 </severity> 1152 <kind> 1153 Types 1154 </kind> 1155 <change> 1156 This class became **generic** (@new_value). 1157 </change> 1158 <effect> 1159 No effect. 1160 </effect> 1161 </rule> 1162 1163 <rule> 1164 <id> 1165 Class_Became_Raw 1166 </id> 1167 <severity> 1168 Medium 1169 </severity> 1170 <kind> 1171 Types 1172 </kind> 1173 <change> 1174 This class became **raw**. 1175 </change> 1176 <effect> 1177 Recompilation of a client program may be terminated with the message: type @new_value does not take parameters. 1178 </effect> 1179 </rule> 1180 1181 <rule> 1182 <id> 1021 1183 Class_Became_Final 1022 1184 </id>
Note:
See TracChangeset
for help on using the changeset viewer.
