Changeset 12872 in josm for trunk/tools/japicc/modules/Internals
- Timestamp:
- 2017-09-17T15:47:18+02:00 (7 years ago)
- Location:
- trunk/tools/japicc/modules/Internals
- Files:
-
- 8 edited
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
Note:
See TracChangeset
for help on using the changeset viewer.