Changeset 12872 in josm for trunk/tools
- Timestamp:
- 2017-09-17T15:47:18+02:00 (7 years ago)
- Location:
- trunk/tools/japicc
- Files:
-
- 11 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/tools/japicc/japi-compliance-checker.pl
r11682 r12872 1 1 #!/usr/bin/perl 2 2 ########################################################################### 3 # Java API Compliance Checker (JAPICC) 2. 13 # Java API Compliance Checker (JAPICC) 2.3 4 4 # A tool for checking backward compatibility of a Java library API 5 5 # … … 43 43 use Data::Dumper; 44 44 45 my $TOOL_VERSION = "2. 1";46 my $API_DUMP_VERSION = "2. 1";47 my $API_DUMP_VERSION_MIN = "2. 0";45 my $TOOL_VERSION = "2.3"; 46 my $API_DUMP_VERSION = "2.2"; 47 my $API_DUMP_VERSION_MIN = "2.2"; 48 48 49 49 # Internal modules … … 110 110 "skip-internal-types=s" => \$In::Opt{"SkipInternalTypes"}, 111 111 "dump|dump-api=s" => \$In::Opt{"DumpAPI"}, 112 "check-packages=s" => \$In::Opt{"CheckPackages"}, 112 113 "classes-list=s" => \$In::Opt{"ClassListPath"}, 113 114 "annotations-list=s" => \$In::Opt{"AnnotationsListPath"}, … … 291 292 292 293 -skip-internal-packages PATTERN 293 Do not check packages matched by the pattern.294 Do not check packages matched by the regular expression. 294 295 295 296 -skip-internal-types PATTERN 296 Do not check types (classes and interfaces) matched by the pattern. 297 Do not check types (classes and interfaces) matched by the regular 298 expression. It's matched against full qualified type names (e.g. 299 'org.xyz.Name<T>'). It has to match any part of type name. 297 300 298 301 -dump|-dump-api PATH 299 302 Dump library API to gzipped TXT format file. You can transfer it 300 303 anywhere and pass instead of the descriptor. Also it may be used 301 for debugging the tool. 302 304 for debugging the tool. PATH is the path to the Java archive or 305 XML descriptor of the library. 306 307 -check-packages PATTERN 308 Check packages matched by the regular expression. Other packages 309 will not be checked. 310 303 311 -classes-list PATH 304 312 This option allows to specify a file with a list … … 441 449 #Aliases 442 450 my (%MethodInfo, %TypeInfo, %TName_Tid) = (); 451 452 my %TName_Tid_Generic = (); 443 453 444 454 #Separate checked and unchecked exceptions … … 522 532 my %LibArchives; 523 533 my %Class_Methods; 534 my %Class_Methods_Generic; 524 535 my %Class_AbstractMethods; 525 536 my %Class_Fields; … … 530 541 my %CheckedMethods; 531 542 my %MethodUsed; 543 my %OldMethodSignature; 532 544 533 545 #Merging … … 537 549 my %CompatRules; 538 550 my %IncompleteRules; 551 my %UnknownRules; 539 552 540 553 #Report … … 623 636 { 624 637 next if(not $ClassName); 625 my $Type1 = getType($TName_Tid{1}{$ClassName}, 1); 638 my $Type1_Id = $TName_Tid{1}{$ClassName}; 639 my $Type1 = getType($Type1_Id, 1); 626 640 627 641 if($Type1->{"Type"}!~/class|interface/) { … … 634 648 } 635 649 636 if(not classFilter($Type1, 1, 0)) {650 if(not classFilter($Type1, 1, 1)) { 637 651 next; 638 652 } 639 653 640 my $Type2_Id = $TName_Tid{2}{$ClassName}; 641 if(not $Type2_Id) 654 my $GenericName = getGeneric($ClassName); 655 my $Type2_Id = undef; 656 657 if(defined $TName_Tid{2}{$ClassName}) { 658 $Type2_Id = $TName_Tid{2}{$ClassName}; 659 } 660 elsif(defined $TName_Tid_Generic{2}{$GenericName}) { 661 $Type2_Id = $TName_Tid_Generic{2}{$GenericName}; 662 } 663 664 if($Type2_Id) 665 { 666 my $TName1 = $Type1->{"Name"}; 667 my $TName2 = getTypeName($Type2_Id, 2); 668 669 my $Generic1 = (index($TName1, "<")!=-1); 670 my $Generic2 = (index($TName2, "<")!=-1); 671 672 if($Generic1 ne $Generic2) 673 { # removed generic parameters 674 foreach my $Method (keys(%{$Class_Methods{1}{$ClassName}})) 675 { 676 if(not methodFilter($Method, 1)) { 677 next; 678 } 679 680 $CheckedTypes{$ClassName} = 1; 681 $CheckedMethods{$Method} = 1; 682 683 if($Type1->{"Type"} eq "class") 684 { 685 if($Generic1) 686 { 687 %{$CompatProblems{$Method}{"Class_Became_Raw"}{"this"}} = ( 688 "Type_Name"=>$ClassName, 689 "New_Value"=>$TName2, 690 "Target"=>$ClassName); 691 } 692 else 693 { 694 %{$CompatProblems{$Method}{"Class_Became_Generic"}{"this"}} = ( 695 "Type_Name"=>$ClassName, 696 "New_Value"=>$TName2, 697 "Target"=>$ClassName); 698 } 699 } 700 else 701 { 702 if($Generic1) 703 { 704 %{$CompatProblems{$Method}{"Interface_Became_Raw"}{"this"}} = ( 705 "Type_Name"=>$ClassName, 706 "New_Value"=>$TName2, 707 "Target"=>$ClassName); 708 } 709 else 710 { 711 %{$CompatProblems{$Method}{"Interface_Became_Generic"}{"this"}} = ( 712 "Type_Name"=>$ClassName, 713 "New_Value"=>$TName2, 714 "Target"=>$ClassName); 715 } 716 } 717 } 718 } 719 } 720 else 642 721 { # classes and interfaces with public methods 643 722 foreach my $Method (keys(%{$Class_Methods{1}{$ClassName}})) … … 686 765 687 766 my $ClassName = $Class1->{"Name"}; 688 689 if(my $Class2_Id = $TName_Tid{2}{$ClassName}) 767 my $GenericName = getGeneric($ClassName); 768 my $Class2_Id = undef; 769 770 if(defined $TName_Tid{2}{$ClassName}) { 771 $Class2_Id = $TName_Tid{2}{$ClassName}; 772 } 773 elsif(defined $TName_Tid_Generic{2}{$GenericName}) { 774 $Class2_Id = $TName_Tid_Generic{2}{$GenericName}; 775 } 776 777 if($Class2_Id) 690 778 { # classes and interfaces with public static fields 691 779 if(not defined $Class_Methods{1}{$ClassName}) … … 869 957 return {} if(not $Type1{"Name"} or not $Type2{"Name"}); 870 958 return {} if(not $Type1{"Archive"} or not $Type2{"Archive"}); 871 return {} if($Type1{"Name"} ne $Type2{"Name"}); 872 873 if(not classFilter(\%Type1, 1, 0)) { 959 if($Type1{"Name"} ne $Type2{"Name"}) 960 { 961 if(getGeneric($Type1{"Name"}) ne getGeneric($Type2{"Name"})) 962 { # compare type declarations if became generic or raw 963 return {}; 964 } 965 } 966 967 if(not classFilter(\%Type1, 1, 1)) { 874 968 return {}; 875 969 } … … 925 1019 pushType($Type1_Id, $Type2_Id); 926 1020 927 foreach my $AddedMethod (keys(%{$AddedMethod_Abstract{$Type 1{"Name"}}}))1021 foreach my $AddedMethod (keys(%{$AddedMethod_Abstract{$Type2{"Name"}}})) 928 1022 { 929 1023 if($Type1{"Type"} eq "class") … … 1000 1094 my $SuperClassName2 = $SuperClass2->{"Name"}; 1001 1095 1096 # Java 6: java.lang.Object 1097 # Java 7: none 1098 if(not $SuperClassName1) { 1099 $SuperClassName1 = "java.lang.Object"; 1100 } 1101 1102 if(not $SuperClassName2) { 1103 $SuperClassName2 = "java.lang.Object"; 1104 } 1105 1002 1106 if($SuperClassName2 ne $SuperClassName1) 1003 1107 { 1004 if($SuperClassName1 eq "java.lang.Object" 1005 or not $SuperClassName1) 1006 { 1007 # Java 6: java.lang.Object 1008 # Java 7: none 1009 if($SuperClassName2 ne "java.lang.Object") 1108 if($SuperClassName1 eq "java.lang.Object") 1109 { 1110 if($SuperClass2->{"Abstract"} 1111 and $Type1{"Abstract"} and $Type2{"Abstract"} 1112 and keys(%{$Class_AbstractMethods{2}{$SuperClassName2}})) 1010 1113 { 1011 if($SuperClass2->{"Abstract"} 1012 and $Type1{"Abstract"} and $Type2{"Abstract"} 1013 and keys(%{$Class_AbstractMethods{2}{$SuperClassName2}})) 1114 if(my ($Invoked, $InvokedBy) = getInvoked($Type1{"Name"})) 1014 1115 { 1015 if(my ($Invoked, $InvokedBy) = getInvoked($Type1{"Name"})) 1016 { 1017 %{$SubProblems{"Abstract_Class_Added_Super_Abstract_Class_Invoked_By_Others"}{""}} = ( 1018 "Type_Name"=>$Type1{"Name"}, 1019 "Target"=>$SuperClassName2, 1020 "Invoked"=>$Invoked, 1021 "Invoked_By"=>$InvokedBy); 1022 } 1023 else 1024 { 1025 %{$SubProblems{"Abstract_Class_Added_Super_Abstract_Class"}{""}} = ( 1026 "Type_Name"=>$Type1{"Name"}, 1027 "Target"=>$SuperClassName2); 1028 } 1116 %{$SubProblems{"Abstract_Class_Added_Super_Abstract_Class_Invoked_By_Others"}{""}} = ( 1117 "Type_Name"=>$Type1{"Name"}, 1118 "Target"=>$SuperClassName2, 1119 "Invoked"=>$Invoked, 1120 "Invoked_By"=>$InvokedBy); 1029 1121 } 1030 1122 else 1031 1123 { 1032 %{$SubProblems{"A dded_Super_Class"}{""}} = (1124 %{$SubProblems{"Abstract_Class_Added_Super_Abstract_Class"}{""}} = ( 1033 1125 "Type_Name"=>$Type1{"Name"}, 1034 1126 "Target"=>$SuperClassName2); 1035 1127 } 1036 1128 } 1037 } 1038 elsif($SuperClassName2 eq "java.lang.Object" 1039 or not $SuperClassName2) 1040 { 1041 # Java 6: java.lang.Object 1042 # Java 7: none 1043 if($SuperClassName1 ne "java.lang.Object") 1129 else 1044 1130 { 1045 %{$SubProblems{" Removed_Super_Class"}{""}} = (1131 %{$SubProblems{"Added_Super_Class"}{""}} = ( 1046 1132 "Type_Name"=>$Type1{"Name"}, 1047 "Target"=>$SuperClassName1); 1048 } 1133 "Target"=>$SuperClassName2); 1134 } 1135 } 1136 elsif($SuperClassName2 eq "java.lang.Object") 1137 { 1138 %{$SubProblems{"Removed_Super_Class"}{""}} = ( 1139 "Type_Name"=>$Type1{"Name"}, 1140 "Target"=>$SuperClassName1); 1049 1141 } 1050 1142 else … … 1337 1429 } 1338 1430 1339 my %Sub_SubChanges = detectTypeChange( $FieldType1_Id, $FieldType2_Id, "Field");1431 my %Sub_SubChanges = detectTypeChange(\%Type1, \%Type2, $FieldType1_Id, $FieldType2_Id, "Field"); 1340 1432 foreach my $Sub_SubProblemType (keys(%Sub_SubChanges)) 1341 1433 { … … 1460 1552 { 1461 1553 my ($Method, $MethodVersion, $ClassName, $ClassVersion) = @_; 1462 my $ClassId = $TName_Tid{$ClassVersion}{$ClassName}; 1554 1555 my $GenericName = getGeneric($ClassName); 1556 my $ClassId = undef; 1557 1558 if(defined $TName_Tid{$ClassVersion}{$ClassName}) { 1559 $ClassId = $TName_Tid{$ClassVersion}{$ClassName}; 1560 } 1561 elsif(defined $TName_Tid_Generic{$ClassVersion}{$GenericName}) { 1562 $ClassId = $TName_Tid_Generic{$ClassVersion}{$GenericName}; 1563 } 1463 1564 1464 1565 if($ClassId) … … 1517 1618 { 1518 1619 my ($Method, $ClassName, $ClassVersion) = @_; 1620 1519 1621 my $TargetSuffix = getMSuffix($Method); 1520 1622 my $TargetShortName = getMShort($Method); 1521 1522 if(not defined $Class_Methods{$ClassVersion}{$ClassName}) { 1623 my $GenericName = getGeneric($ClassName); 1624 1625 my @Candidates = (); 1626 1627 if(defined $Class_Methods{$ClassVersion}{$ClassName}) { 1628 @Candidates = keys(%{$Class_Methods{$ClassVersion}{$ClassName}}); 1629 } 1630 elsif(defined $Class_Methods_Generic{$ClassVersion}{$GenericName}) { 1631 @Candidates = keys(%{$Class_Methods_Generic{$ClassVersion}{$GenericName}}); 1632 } 1633 else { 1523 1634 return undef; 1524 1635 } 1525 1636 1526 foreach my $Candidate (sort keys(%{$Class_Methods{$ClassVersion}{$ClassName}}))1637 foreach my $Candidate (sort @Candidates) 1527 1638 { # search for method with the same parameters suffix 1528 1639 next if($MethodInfo{$ClassVersion}{$Candidate}{"Constructor"}); 1640 1529 1641 if($TargetSuffix eq getMSuffix($Candidate)) 1530 1642 { … … 1538 1650 } 1539 1651 1652 sub getBaseSignature($) 1653 { 1654 my $Method = $_[0]; 1655 $Method=~s/\)(.+)\Z/\)/g; 1656 return $Method; 1657 } 1658 1540 1659 sub prepareData($) 1541 1660 { … … 1558 1677 $TName_Tid{$LVer}{$TName} = $TypeId; 1559 1678 1679 if(defined $TypeAttr->{"Archive"}) 1680 { # declaration 1681 $TName_Tid_Generic{$LVer}{getGeneric($TName)} = $TypeId; 1682 } 1683 1560 1684 if(not $TypeAttr->{"Dep"}) 1561 1685 { … … 1590 1714 my $CName = getTypeName($ClassId, $LVer); 1591 1715 $Class_Methods{$LVer}{$CName}{$Method} = 1; 1716 $Class_Methods_Generic{$LVer}{getGeneric($CName)}{$Method} = 1; 1717 1592 1718 if($MAttr->{"Abstract"}) { 1593 1719 $Class_AbstractMethods{$LVer}{$CName}{$Method} = 1; … … 1603 1729 registerUsage($MAttr->{"Return"}, $LVer); 1604 1730 } 1731 } 1732 1733 if($LVer==1 and not $MAttr->{"Constructor"} 1734 and my $BaseSign = getBaseSignature($Method)) { 1735 $OldMethodSignature{$BaseSign} = $Method; 1605 1736 } 1606 1737 } … … 1857 1988 # checking type declaration changes 1858 1989 my $SubProblems = mergeTypes($ParamType1_Id, $ParamType2_Id); 1990 1991 my $Type1 = getType($ParamType1_Id, 1); 1992 my $Type2 = getType($ParamType2_Id, 2); 1993 1994 if($Type1->{"Name"} ne $Type2->{"Name"}) 1995 { 1996 if(index($Type1->{"Name"}, "...")!=-1 and index($Type2->{"Name"}, "[]")!=-1) 1997 { 1998 %{$CompatProblems{$Method}{"Variable_Arity_To_Array"}{$Parameter_Name}} = ( 1999 "Type_Name"=>getTypeName($MethodInfo{1}{$Method}{"Class"}, 1), 2000 "Param_Name"=>$Parameter_Name, 2001 "Old_Value"=>$Type1->{"Name"}, 2002 "New_Value"=>$Type2->{"Name"}); 2003 } 2004 elsif(index($Type1->{"Name"}, "[]")!=-1 and index($Type2->{"Name"}, "...")!=-1) 2005 { 2006 %{$CompatProblems{$Method}{"Array_To_Variable_Arity"}{$Parameter_Name}} = ( 2007 "Type_Name"=>getTypeName($MethodInfo{1}{$Method}{"Class"}, 1), 2008 "Param_Name"=>$Parameter_Name, 2009 "Old_Value"=>$Type1->{"Name"}, 2010 "New_Value"=>$Type2->{"Name"}); 2011 } 2012 } 2013 1859 2014 foreach my $SubProblemType (keys(%{$SubProblems})) 1860 2015 { … … 1867 2022 } 1868 2023 1869 sub detectTypeChange($$$ )1870 { 1871 my ($ Type1_Id, $Type2_Id, $Prefix) = @_;2024 sub detectTypeChange($$$$$) 2025 { 2026 my ($Ct1, $Ct2, $Type1_Id, $Type2_Id, $Prefix) = @_; 1872 2027 my %LocalProblems = (); 1873 2028 … … 1878 2033 my $Type2_Name = $Type2->{"Name"}; 1879 2034 2035 my $Type1_Show = $Type1_Name; 2036 my $Type2_Show = $Type2_Name; 2037 2038 if(defined $Ct1->{"GenericParam"} 2039 and defined $Ct1->{"GenericParam"}{$Type1_Name}) 2040 { 2041 $Type1_Name = getTypeName($Ct1->{"GenericParam"}{$Type1_Name}, 1); 2042 $Type1_Show .= " extends ".$Type1_Name; 2043 } 2044 2045 if(defined $Ct2->{"GenericParam"} 2046 and defined $Ct2->{"GenericParam"}{$Type2_Name}) 2047 { 2048 $Type2_Name = getTypeName($Ct2->{"GenericParam"}{$Type2_Name}, 2); 2049 $Type2_Show .= " extends ".$Type2_Name; 2050 } 2051 1880 2052 my $Type1_Base = undef; 1881 2053 my $Type2_Base = undef; … … 1897 2069 return () if(not $Type1_Name or not $Type2_Name); 1898 2070 return () if(not $Type1_Base->{"Name"} or not $Type2_Base->{"Name"}); 2071 1899 2072 if($Type1_Base->{"Name"} ne $Type2_Base->{"Name"} and $Type1_Name eq $Type2_Name) 1900 2073 {# base type change … … 1906 2079 {# type change 1907 2080 %{$LocalProblems{"Changed_".$Prefix."_Type"}}=( 1908 "Old_Value"=>$Type1_ Name,1909 "New_Value"=>$Type2_ Name);2081 "Old_Value"=>$Type1_Show, 2082 "New_Value"=>$Type2_Show); 1910 2083 } 1911 2084 return %LocalProblems; … … 1953 2126 # settings 1954 2127 my ($Full, $Html, $Simple, $Italic, $Color, 1955 $ShowParams, $ShowClass, $ShowAttr, $Desc, $Target) = (0, 0, 0, 0, 0, 0, 0, 0, 0, undef); 2128 $ShowParams, $ShowClass, $ShowAttr, $Desc, 2129 $ShowReturn, $Target) = (0, 0, 0, 0, 0, 0, 0, 0, 0, 0, undef); 1956 2130 1957 2131 if($Kind=~/Full/) { … … 1985 2159 $Desc = 1; 1986 2160 } 2161 if($Kind=~/Return/) { 2162 $ShowReturn = 1; 2163 } 1987 2164 1988 2165 if(not defined $MethodInfo{$LVer}{$Method}{"ShortName"}) 1989 2166 { # from java.lang.Object 1990 if($Html or $Simple) {2167 if($Html) { 1991 2168 return specChars($Method); 1992 2169 } … … 1996 2173 } 1997 2174 1998 my $Signature = $MethodInfo{$LVer}{$Method}{"ShortName"}; 2175 my $Signature = ""; 2176 2177 my $ShortName = $MethodInfo{$LVer}{$Method}{"ShortName"}; 2178 2179 if($Html) { 2180 $ShortName = specChars($ShortName); 2181 } 2182 2183 $Signature .= $ShortName; 2184 1999 2185 if($Full or $ShowClass) 2000 2186 { … … 2138 2324 } 2139 2325 } 2140 2326 } 2327 2328 if($Full or $ShowReturn) 2329 { 2141 2330 if(my $ReturnId = $MethodInfo{$LVer}{$Method}{"Return"}) 2142 2331 { … … 2151 2340 } 2152 2341 2153 if($Simple) { 2342 if($Desc) { 2343 $Signature = "<b>".specChars($RName)."</b> ".$Signature; 2344 } 2345 elsif($Simple) { 2154 2346 $Signature .= " <b>:</b> ".specChars($RName); 2155 2347 } … … 2161 2353 } 2162 2354 } 2163 2355 } 2356 2357 if($Full) 2358 { 2164 2359 if(not $In::Opt{"SkipDeprecated"}) 2165 2360 { … … 2321 2516 "Warnings"=>0, 2322 2517 "Affected"=>0); 2518 2519 # check rules 2520 foreach my $Method (sort keys(%CompatProblems)) 2521 { 2522 foreach my $Kind (keys(%{$CompatProblems{$Method}})) 2523 { 2524 if(not defined $CompatRules{"Binary"}{$Kind} and not defined $CompatRules{"Source"}{$Kind}) 2525 { # unknown rule 2526 if(not $UnknownRules{$Level}{$Kind}) 2527 { # only one warning 2528 printMsg("WARNING", "unknown rule \"$Kind\" (\"$Level\")"); 2529 $UnknownRules{$Level}{$Kind}=1; 2530 } 2531 } 2532 } 2533 } 2323 2534 2324 2535 foreach my $Method (sort keys(%CompatProblems)) … … 2614 2825 $META_DATA .= "tool_version:$TOOL_VERSION"; 2615 2826 $Problem_Summary .= "</table>\n"; 2616 return ($TestInfo.$TestResults.$Problem_Summary, $META_DATA); 2827 2828 my $AnyChanged = ($Added or $Removed or $M_Problems_High or $M_Problems_Medium or $M_Problems_Low or 2829 $T_Problems_High or $T_Problems_Medium or $T_Problems_Low or $M_Other or $T_Other); 2830 2831 return ($TestInfo.$TestResults.$Problem_Summary, $META_DATA, $AnyChanged); 2617 2832 } 2618 2833 … … 2710 2925 } 2711 2926 2712 my @SortedMethods = sort {lc($MethodInfo{2}{$a}{"Signature"}) cmp lc($MethodInfo{2}{$b}{"Signature"})} keys(%{$NameSpace_Method{$NameSpace}});2927 my @SortedMethods = sort {lc($MethodInfo{2}{$a}{"Signature"}) cmp lc($MethodInfo{2}{$b}{"Signature"})} sort keys(%{$NameSpace_Method{$NameSpace}}); 2713 2928 foreach my $Method (@SortedMethods) 2714 2929 { … … 2814 3029 } 2815 3030 2816 my @SortedMethods = sort {lc($MethodInfo{1}{$a}{"Signature"}) cmp lc($MethodInfo{1}{$b}{"Signature"})} keys(%{$NameSpace_Method{$NameSpace}});3031 my @SortedMethods = sort {lc($MethodInfo{1}{$a}{"Signature"}) cmp lc($MethodInfo{1}{$b}{"Signature"})} sort keys(%{$NameSpace_Method{$NameSpace}}); 2817 3032 foreach my $Method (@SortedMethods) 2818 3033 { … … 2929 3144 } 2930 3145 2931 sub applyMacroses($$$$$ )2932 { 2933 my ($Level, $ Kind, $Content, $Problem, $AddAttr) = @_;3146 sub applyMacroses($$$$$$) 3147 { 3148 my ($Level, $Subj, $Kind, $Content, $Problem, $AddAttr) = @_; 2934 3149 2935 3150 $Content = addMarkup($Content); … … 2977 3192 $Fmt = "HTML|Desc"; 2978 3193 } 3194 } 3195 3196 if($Subj eq "Change") { 3197 $Fmt .= "|Return"; 2979 3198 } 2980 3199 … … 3062 3281 } 3063 3282 3064 my @SortedMethods = sort {lc($MethodInfo{1}{$a}{"Signature"}) cmp lc($MethodInfo{1}{$b}{"Signature"})} keys(%{$NameSpace_Method{$NameSpace}});3283 my @SortedMethods = sort {lc($MethodInfo{1}{$a}{"Signature"}) cmp lc($MethodInfo{1}{$b}{"Signature"})} sort keys(%{$NameSpace_Method{$NameSpace}}); 3065 3284 foreach my $Method (@SortedMethods) 3066 3285 { … … 3078 3297 my $ProblemAttr = $MethodChanges{$Method}{$Kind}{$Loc}; 3079 3298 3080 if(my $Change = applyMacroses($Level, $Kind, $CompatRules{$Level}{$Kind}{"Change"}, $ProblemAttr, \%AddAttr))3299 if(my $Change = applyMacroses($Level, "Change", $Kind, $CompatRules{$Level}{$Kind}{"Change"}, $ProblemAttr, \%AddAttr)) 3081 3300 { 3082 my $Effect = applyMacroses($Level, $Kind, $CompatRules{$Level}{$Kind}{"Effect"}, $ProblemAttr, \%AddAttr);3301 my $Effect = applyMacroses($Level, "Effect", $Kind, $CompatRules{$Level}{$Kind}{"Effect"}, $ProblemAttr, \%AddAttr); 3083 3302 $METHOD_REPORT .= "<tr>\n<th>$ProblemNum</th>\n<td>".$Change."</td>\n<td>".$Effect."</td>\n</tr>\n"; 3084 3303 $ProblemNum += 1; … … 3233 3452 my $ProblemAttr = $TypeChanges_Sev{$TypeName}{$Kind}{$Location}; 3234 3453 3235 if(my $Change = applyMacroses($Level, $Kind, $CompatRules{$Level}{$Kind}{"Change"}, $ProblemAttr, \%AddAttr))3454 if(my $Change = applyMacroses($Level, "Change", $Kind, $CompatRules{$Level}{$Kind}{"Change"}, $ProblemAttr, \%AddAttr)) 3236 3455 { 3237 my $Effect = applyMacroses($Level, $Kind, $CompatRules{$Level}{$Kind}{"Effect"}, $ProblemAttr, \%AddAttr);3456 my $Effect = applyMacroses($Level, "Effect", $Kind, $CompatRules{$Level}{$Kind}{"Effect"}, $ProblemAttr, \%AddAttr); 3238 3457 3239 3458 $TYPE_REPORT .= "<tr>\n<th>$ProblemNum</th>\n<td>".$Change."</td>\n<td>".$Effect."</td>\n</tr>\n"; … … 3587 3806 my $Description = "Compatibility report for the ".$In::Opt{"TargetTitle"}." library between ".$In::Desc{1}{"Version"}." and ".$In::Desc{2}{"Version"}." versions"; 3588 3807 3589 my ($BSummary, $BMetaData ) = getSummary("Binary");3590 my ($SSummary, $SMetaData ) = getSummary("Source");3591 3592 my $Report = "<!-\- $BMetaData -\->\n<!-\- $SMetaData -\->\n".composeHTML_Head($Level, $Title, $Keywords, $Description, $CssStyles, $JScripts )."<body><a name='Source'></a><a name='Binary'></a><a name='Top'></a>";3808 my ($BSummary, $BMetaData, $BAnyChanged) = getSummary("Binary"); 3809 my ($SSummary, $SMetaData, $SAnyChanged) = getSummary("Source"); 3810 3811 my $Report = "<!-\- $BMetaData -\->\n<!-\- $SMetaData -\->\n".composeHTML_Head($Level, $Title, $Keywords, $Description, $CssStyles, $JScripts, ($BAnyChanged or $SAnyChanged))."<body><a name='Source'></a><a name='Binary'></a><a name='Top'></a>"; 3593 3812 3594 3813 $Report .= getReportHeader("Join"); … … 3608 3827 else 3609 3828 { 3610 my ($Summary, $MetaData ) = getSummary($Level);3829 my ($Summary, $MetaData, $AnyChanged) = getSummary($Level); 3611 3830 3612 3831 my $Title = $In::Opt{"TargetTitle"}.": ".$In::Desc{1}{"Version"}." to ".$In::Desc{2}{"Version"}." ".lc($Level)." compatibility report"; … … 3614 3833 my $Description = "$Level compatibility report for the ".$In::Opt{"TargetTitle"}." library between ".$In::Desc{1}{"Version"}." and ".$In::Desc{2}{"Version"}." versions"; 3615 3834 3616 my $Report = "<!-\- $MetaData -\->\n".composeHTML_Head($Level, $Title, $Keywords, $Description, $CssStyles, $JScripts )."<body><a name='Top'></a>";3835 my $Report = "<!-\- $MetaData -\->\n".composeHTML_Head($Level, $Title, $Keywords, $Description, $CssStyles, $JScripts, $AnyChanged)."<body><a name='Top'></a>"; 3617 3836 $Report .= getReportHeader($Level)."\n".$Summary."\n"; 3618 3837 $Report .= getReportAdded($Level).getReportRemoved($Level); … … 3667 3886 } 3668 3887 3669 sub composeHTML_Head($$$$$$ )3670 { 3671 my ($Level, $Title, $Keywords, $Description, $Styles, $Scripts ) = @_;3888 sub composeHTML_Head($$$$$$$) 3889 { 3890 my ($Level, $Title, $Keywords, $Description, $Styles, $Scripts, $AnyChanged) = @_; 3672 3891 3673 3892 my $Head = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n"; … … 3678 3897 $Head .= "<meta name=\"description\" content=\"$Description\" />\n"; 3679 3898 3899 if(not $AnyChanged) { 3900 $Head .= "<meta name=\"robots\" content=\"noindex\" />\n"; 3901 } 3902 3680 3903 my $RPath = getReportPath($Level); 3681 3904 … … 3749 3972 } 3750 3973 3751 my $ClassId = $MethodInfo{2}{$Method}{"Class"}; 3752 my $CName = getTypeName($ClassId, 2); 3974 my $Class = getType($MethodInfo{2}{$Method}{"Class"}, 2); 3753 3975 3754 $CheckedTypes{$C Name} = 1;3976 $CheckedTypes{$Class->{"Name"}} = 1; 3755 3977 $CheckedMethods{$Method} = 1; 3756 3978 3757 3979 if(not $MethodInfo{2}{$Method}{"Constructor"} 3758 and my $Overridden = findMethod($Method, 2, $C Name, 2))3980 and my $Overridden = findMethod($Method, 2, $Class->{"Name"}, 2)) 3759 3981 { 3760 3982 if(defined $MethodInfo{1}{$Overridden} 3761 and getTypeType($ClassId, 2) eq "class" and $TName_Tid{1}{$CName}) 3983 and $Class->{"Type"} eq "class" 3984 and ($TName_Tid{1}{$Class->{"Name"}} or $TName_Tid_Generic{1}{getGeneric($Class->{"Name"})})) 3762 3985 { # class should exist in previous version 3763 3986 %{$CompatProblems{$Overridden}{"Class_Overridden_Method"}{"this.".getSFormat($Method)}}=( 3764 "Type_Name"=>$C Name,3987 "Type_Name"=>$Class->{"Name"}, 3765 3988 "Target"=>$MethodInfo{2}{$Method}{"Signature"}, 3766 3989 "Old_Value"=>$Overridden, … … 3769 3992 } 3770 3993 if($MethodInfo{2}{$Method}{"Abstract"}) { 3771 $AddedMethod_Abstract{$C Name}{$Method} = 1;3994 $AddedMethod_Abstract{$Class->{"Name"}}{$Method} = 1; 3772 3995 } 3773 3996 3774 %{$CompatProblems{$Method}{"Added_Method"}{""}}=(); 3997 if(not ($MethodInfo{2}{$Method}{"Access"} eq "protected" and $Class->{"Final"})) { 3998 %{$CompatProblems{$Method}{"Added_Method"}{""}} = (); 3999 } 3775 4000 3776 4001 if(not $MethodInfo{2}{$Method}{"Constructor"}) 3777 4002 { 3778 if(getTypeName($MethodInfo{2}{$Method}{"Return"}, 2) ne "void" 3779 and my $VoidMethod = checkVoidMethod($Method)) 4003 my $VoidMethod = checkVoidMethod($Method); 4004 my $ReturnType = getTypeName($MethodInfo{2}{$Method}{"Return"}, 2); 4005 4006 if(defined $Class->{"GenericParam"} 4007 and defined $Class->{"GenericParam"}{$ReturnType}) { 4008 $ReturnType = getTypeName($Class->{"GenericParam"}{$ReturnType}, 2); 4009 } 4010 4011 if(defined $MethodInfo{1}{$VoidMethod} 4012 and $ReturnType ne "void") 4013 { # return value type changed from void 4014 $ChangedReturnFromVoid{$VoidMethod} = 1; 4015 $ChangedReturnFromVoid{$Method} = 1; 4016 4017 %{$CompatProblems{$VoidMethod}{"Changed_Method_Return_From_Void"}{""}}=( 4018 "New_Value"=>getTypeName($MethodInfo{2}{$Method}{"Return"}, 2) 4019 ); 4020 } 4021 elsif(my $OldMethod = $OldMethodSignature{getBaseSignature($Method)}) 3780 4022 { 3781 if(defined $MethodInfo{1}{$VoidMethod}) 3782 { # return value type changed from "void" to 3783 $ChangedReturnFromVoid{$VoidMethod} = 1; 3784 $ChangedReturnFromVoid{$Method} = 1; 4023 if($OldMethod ne $Method) 4024 { 4025 my $OldReturnType = getTypeName($MethodInfo{1}{$OldMethod}{"Return"}, 1); 3785 4026 3786 %{$CompatProblems{$VoidMethod}{"Changed_Method_Return_From_Void"}{""}}=( 3787 "New_Value"=>getTypeName($MethodInfo{2}{$Method}{"Return"}, 2) 4027 %{$CompatProblems{$OldMethod}{"Changed_Method_Return"}{""}}=( 4028 "Old_Value"=>$OldReturnType, 4029 "New_Value"=>$ReturnType 3788 4030 ); 3789 4031 } … … 3804 4046 } 3805 4047 3806 my $ClassId = $MethodInfo{1}{$Method}{"Class"}; 3807 my $CName = getTypeName($ClassId, 1); 4048 my $Class = getType($MethodInfo{1}{$Method}{"Class"}, 1); 3808 4049 3809 $CheckedTypes{$C Name} = 1;4050 $CheckedTypes{$Class->{"Name"}} = 1; 3810 4051 $CheckedMethods{$Method} = 1; 3811 4052 3812 4053 if(not $MethodInfo{1}{$Method}{"Constructor"} 3813 and my $MovedUp = findMethod($Method, 1, $CName, 2)) 3814 { 3815 if(getTypeType($ClassId, 1) eq "class" 3816 and not $MethodInfo{1}{$Method}{"Abstract"} and $TName_Tid{2}{$CName}) 4054 and my $MovedUp = findMethod($Method, 1, $Class->{"Name"}, 2)) 4055 { 4056 if($Class->{"Type"} eq "class" 4057 and not $MethodInfo{1}{$Method}{"Abstract"} 4058 and ($TName_Tid{2}{$Class->{"Name"}} or $TName_Tid_Generic{2}{getGeneric($Class->{"Name"})})) 3817 4059 {# class should exist in newer version 3818 4060 %{$CompatProblems{$Method}{"Class_Method_Moved_Up_Hierarchy"}{"this.".getSFormat($MovedUp)}}=( 3819 "Type_Name"=>$C Name,4061 "Type_Name"=>$Class->{"Name"}, 3820 4062 "Target"=>$MethodInfo{2}{$MovedUp}{"Signature"}, 3821 4063 "Old_Value"=>$Method, … … 3826 4068 { 3827 4069 if($MethodInfo{1}{$Method}{"Abstract"}) { 3828 $RemovedMethod_Abstract{$CName}{$Method} = 1; 3829 } 3830 %{$CompatProblems{$Method}{"Removed_Method"}{""}}=(); 4070 $RemovedMethod_Abstract{$Class->{"Name"}}{$Method} = 1; 4071 } 4072 4073 if(not ($MethodInfo{1}{$Method}{"Access"} eq "protected" and $Class->{"Final"})) { 4074 %{$CompatProblems{$Method}{"Removed_Method"}{""}} = (); 4075 } 3831 4076 } 3832 4077 } … … 3930 4175 if(cmpVersions($APIVer, $API_DUMP_VERSION)>0) 3931 4176 { # future formats 3932 exitStatus("Dump_Version", "the versions of the API dump is newer than version of the tool"); 3933 } 3934 } 3935 3936 if(cmpVersions($APIVer, $API_DUMP_VERSION_MIN)<0) { 3937 exitStatus("Dump_Version", "the version of the API dump is too old and unsupported anymore, please regenerate it"); 4177 exitStatus("Dump_Version", "version of the API dump is newer than version of the tool"); 4178 } 4179 4180 if(cmpVersions($APIVer, $API_DUMP_VERSION)<0) 4181 { # old formats 4182 printMsg("WARNING", "version of the API dump is older than version of the tool"); 4183 } 4184 } 4185 4186 if(cmpVersions($APIVer, $API_DUMP_VERSION_MIN)<0) 4187 { # obsolete formats 4188 exitStatus("Dump_Version", "version of the API dump is too old and unsupported anymore, please regenerate it"); 3938 4189 } 3939 4190 … … 4224 4475 chdir($UnpackDir); 4225 4476 system("$UnzipCmd \"$Path\" >contents.txt"); 4477 chdir($In::Opt{"OrigDir"}); 4226 4478 if($?) { 4227 4479 exitStatus("Error", "can't extract \'$Path\'"); 4228 4480 } 4229 chdir($In::Opt{"OrigDir"});4481 4230 4482 my @Contents = (); 4231 4483 foreach (split("\n", readFile("$UnpackDir/contents.txt"))) … … 4259 4511 } 4260 4512 my @Contents = qx/$TarCmd -xvf "$Dir\\$FileName.tar"/; 4513 chdir($In::Opt{"OrigDir"}); 4261 4514 if($? or not @Contents) { 4262 4515 exitStatus("Error", "can't extract \'$Path\'"); 4263 4516 } 4264 chdir($In::Opt{"OrigDir"});4265 4517 unlink($Dir."/".$FileName.".tar"); 4266 4518 chomp $Contents[0]; … … 4275 4527 chdir($UnpackDir); 4276 4528 my @Contents = qx/$TarCmd -xvzf "$Path" 2>&1/; 4529 chdir($In::Opt{"OrigDir"}); 4277 4530 if($? or not @Contents) { 4278 4531 exitStatus("Error", "can't extract \'$Path\'"); 4279 4532 } 4280 chdir($In::Opt{"OrigDir"});4281 4533 $Contents[0]=~s/^x //; # OS X 4282 4534 chomp $Contents[0]; … … 4308 4560 if($?) 4309 4561 { # cannot allocate memory (or other problems with "zip") 4310 unlink($Path);4562 chdir($In::Opt{"OrigDir"}); 4311 4563 exitStatus("Error", "can't pack the API dump: ".$!); 4312 4564 } … … 4326 4578 } 4327 4579 my $Pkg = abs_path($To)."/".$Name.".tar.gz"; 4328 unlink($Pkg); 4329 chdir($From); 4330 system($TarCmd, "-czf", $Pkg, $Name); 4580 if(-e $Pkg) { 4581 unlink($Pkg); 4582 } 4583 system($TarCmd, "-C", $From, "-czf", $Pkg, $Name); 4331 4584 if($?) 4332 4585 { # cannot allocate memory (or other problems with "tar") 4333 unlink($Path);4334 4586 exitStatus("Error", "can't pack the API dump: ".$!); 4335 4587 } 4336 chdir($In::Opt{"OrigDir"});4337 4588 unlink($Path); 4338 4589 return $To."/".$Name.".tar.gz"; … … 4768 5019 { 4769 5020 detectDefaultPaths("bin", undef); 5021 loadModule("APIDump"); 5022 4770 5023 readArchive(0, $ClientPath) 4771 5024 } … … 4785 5038 4786 5039 my $Count = 0; 4787 foreach my $Method (keys(%{$MethodInfo{1}})) { 5040 foreach my $Method (keys(%{$MethodInfo{1}})) 5041 { 4788 5042 $Count += methodFilter($Method, 1); 4789 5043 } -
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.