Changeset 12872 in josm


Ignore:
Timestamp:
2017-09-17T15:47:18+02:00 (7 years ago)
Author:
Don-vip
Message:

update to JAPICC 2.3

Location:
trunk/tools/japicc
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • trunk/tools/japicc/japi-compliance-checker.pl

    r11682 r12872  
    11#!/usr/bin/perl
    22###########################################################################
    3 # Java API Compliance Checker (JAPICC) 2.1
     3# Java API Compliance Checker (JAPICC) 2.3
    44# A tool for checking backward compatibility of a Java library API
    55#
     
    4343use Data::Dumper;
    4444
    45 my $TOOL_VERSION = "2.1";
    46 my $API_DUMP_VERSION = "2.1";
    47 my $API_DUMP_VERSION_MIN = "2.0";
     45my $TOOL_VERSION = "2.3";
     46my $API_DUMP_VERSION = "2.2";
     47my $API_DUMP_VERSION_MIN = "2.2";
    4848
    4949# Internal modules
     
    110110  "skip-internal-types=s" => \$In::Opt{"SkipInternalTypes"},
    111111  "dump|dump-api=s" => \$In::Opt{"DumpAPI"},
     112  "check-packages=s" => \$In::Opt{"CheckPackages"},
    112113  "classes-list=s" => \$In::Opt{"ClassListPath"},
    113114  "annotations-list=s" => \$In::Opt{"AnnotationsListPath"},
     
    291292 
    292293  -skip-internal-packages PATTERN
    293       Do not check packages matched by the pattern.
     294      Do not check packages matched by the regular expression.
    294295 
    295296  -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.
    297300 
    298301  -dump|-dump-api PATH
    299302      Dump library API to gzipped TXT format file. You can transfer it
    300303      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 
    303311  -classes-list PATH
    304312      This option allows to specify a file with a list
     
    441449#Aliases
    442450my (%MethodInfo, %TypeInfo, %TName_Tid) = ();
     451
     452my %TName_Tid_Generic = ();
    443453
    444454#Separate checked and unchecked exceptions
     
    522532my %LibArchives;
    523533my %Class_Methods;
     534my %Class_Methods_Generic;
    524535my %Class_AbstractMethods;
    525536my %Class_Fields;
     
    530541my %CheckedMethods;
    531542my %MethodUsed;
     543my %OldMethodSignature;
    532544
    533545#Merging
     
    537549my %CompatRules;
    538550my %IncompleteRules;
     551my %UnknownRules;
    539552
    540553#Report
     
    623636    {
    624637        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);
    626640       
    627641        if($Type1->{"Type"}!~/class|interface/) {
     
    634648        }
    635649       
    636         if(not classFilter($Type1, 1, 0)) {
     650        if(not classFilter($Type1, 1, 1)) {
    637651            next;
    638652        }
    639653       
    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
    642721        { # classes and interfaces with public methods
    643722            foreach my $Method (keys(%{$Class_Methods{1}{$ClassName}}))
     
    686765       
    687766        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)
    690778        { # classes and interfaces with public static fields
    691779            if(not defined $Class_Methods{1}{$ClassName})
     
    869957    return {} if(not $Type1{"Name"} or not $Type2{"Name"});
    870958    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)) {
    874968        return {};
    875969    }
     
    9251019    pushType($Type1_Id, $Type2_Id);
    9261020   
    927     foreach my $AddedMethod (keys(%{$AddedMethod_Abstract{$Type1{"Name"}}}))
     1021    foreach my $AddedMethod (keys(%{$AddedMethod_Abstract{$Type2{"Name"}}}))
    9281022    {
    9291023        if($Type1{"Type"} eq "class")
     
    10001094        my $SuperClassName2 = $SuperClass2->{"Name"};
    10011095       
     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       
    10021106        if($SuperClassName2 ne $SuperClassName1)
    10031107        {
    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}}))
    10101113                {
    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"}))
    10141115                    {
    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);
    10291121                    }
    10301122                    else
    10311123                    {
    1032                         %{$SubProblems{"Added_Super_Class"}{""}} = (
     1124                        %{$SubProblems{"Abstract_Class_Added_Super_Abstract_Class"}{""}} = (
    10331125                            "Type_Name"=>$Type1{"Name"},
    10341126                            "Target"=>$SuperClassName2);
    10351127                    }
    10361128                }
    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
    10441130                {
    1045                     %{$SubProblems{"Removed_Super_Class"}{""}} = (
     1131                    %{$SubProblems{"Added_Super_Class"}{""}} = (
    10461132                        "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);
    10491141            }
    10501142            else
     
    13371429        }
    13381430       
    1339         my %Sub_SubChanges = detectTypeChange($FieldType1_Id, $FieldType2_Id, "Field");
     1431        my %Sub_SubChanges = detectTypeChange(\%Type1, \%Type2, $FieldType1_Id, $FieldType2_Id, "Field");
    13401432        foreach my $Sub_SubProblemType (keys(%Sub_SubChanges))
    13411433        {
     
    14601552{
    14611553    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    }
    14631564   
    14641565    if($ClassId)
     
    15171618{
    15181619    my ($Method, $ClassName, $ClassVersion) = @_;
     1620   
    15191621    my $TargetSuffix = getMSuffix($Method);
    15201622    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 {
    15231634        return undef;
    15241635    }
    15251636   
    1526     foreach my $Candidate (sort keys(%{$Class_Methods{$ClassVersion}{$ClassName}}))
     1637    foreach my $Candidate (sort @Candidates)
    15271638    { # search for method with the same parameters suffix
    15281639        next if($MethodInfo{$ClassVersion}{$Candidate}{"Constructor"});
     1640       
    15291641        if($TargetSuffix eq getMSuffix($Candidate))
    15301642        {
     
    15381650}
    15391651
     1652sub getBaseSignature($)
     1653{
     1654    my $Method = $_[0];
     1655    $Method=~s/\)(.+)\Z/\)/g;
     1656    return $Method;
     1657}
     1658
    15401659sub prepareData($)
    15411660{
     
    15581677        $TName_Tid{$LVer}{$TName} = $TypeId;
    15591678       
     1679        if(defined $TypeAttr->{"Archive"})
     1680        { # declaration
     1681            $TName_Tid_Generic{$LVer}{getGeneric($TName)} = $TypeId;
     1682        }
     1683       
    15601684        if(not $TypeAttr->{"Dep"})
    15611685        {
     
    15901714            my $CName = getTypeName($ClassId, $LVer);
    15911715            $Class_Methods{$LVer}{$CName}{$Method} = 1;
     1716            $Class_Methods_Generic{$LVer}{getGeneric($CName)}{$Method} = 1;
     1717           
    15921718            if($MAttr->{"Abstract"}) {
    15931719                $Class_AbstractMethods{$LVer}{$CName}{$Method} = 1;
     
    16031729                registerUsage($MAttr->{"Return"}, $LVer);
    16041730            }
     1731        }
     1732       
     1733        if($LVer==1 and not $MAttr->{"Constructor"}
     1734        and my $BaseSign = getBaseSignature($Method)) {
     1735            $OldMethodSignature{$BaseSign} = $Method;
    16051736        }
    16061737    }
     
    18571988    # checking type declaration changes
    18581989    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   
    18592014    foreach my $SubProblemType (keys(%{$SubProblems}))
    18602015    {
     
    18672022}
    18682023
    1869 sub detectTypeChange($$$)
    1870 {
    1871     my ($Type1_Id, $Type2_Id, $Prefix) = @_;
     2024sub detectTypeChange($$$$$)
     2025{
     2026    my ($Ct1, $Ct2, $Type1_Id, $Type2_Id, $Prefix) = @_;
    18722027    my %LocalProblems = ();
    18732028   
     
    18782033    my $Type2_Name = $Type2->{"Name"};
    18792034   
     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   
    18802052    my $Type1_Base = undef;
    18812053    my $Type2_Base = undef;
     
    18972069    return () if(not $Type1_Name or not $Type2_Name);
    18982070    return () if(not $Type1_Base->{"Name"} or not $Type2_Base->{"Name"});
     2071   
    18992072    if($Type1_Base->{"Name"} ne $Type2_Base->{"Name"} and $Type1_Name eq $Type2_Name)
    19002073    {# base type change
     
    19062079    {# type change
    19072080        %{$LocalProblems{"Changed_".$Prefix."_Type"}}=(
    1908             "Old_Value"=>$Type1_Name,
    1909             "New_Value"=>$Type2_Name);
     2081            "Old_Value"=>$Type1_Show,
     2082            "New_Value"=>$Type2_Show);
    19102083    }
    19112084    return %LocalProblems;
     
    19532126    # settings
    19542127    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);
    19562130   
    19572131    if($Kind=~/Full/) {
     
    19852159        $Desc = 1;
    19862160    }
     2161    if($Kind=~/Return/) {
     2162        $ShowReturn = 1;
     2163    }
    19872164   
    19882165    if(not defined $MethodInfo{$LVer}{$Method}{"ShortName"})
    19892166    { # from java.lang.Object
    1990         if($Html or $Simple) {
     2167        if($Html) {
    19912168            return specChars($Method);
    19922169        }
     
    19962173    }
    19972174   
    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   
    19992185    if($Full or $ShowClass)
    20002186    {
     
    21382324            }
    21392325        }
    2140        
     2326    }
     2327   
     2328    if($Full or $ShowReturn)
     2329    {
    21412330        if(my $ReturnId = $MethodInfo{$LVer}{$Method}{"Return"})
    21422331        {
     
    21512340            }
    21522341           
    2153             if($Simple) {
     2342            if($Desc) {
     2343                $Signature = "<b>".specChars($RName)."</b> ".$Signature;
     2344            }
     2345            elsif($Simple) {
    21542346                $Signature .= " <b>:</b> ".specChars($RName);
    21552347            }
     
    21612353            }
    21622354        }
    2163        
     2355    }
     2356   
     2357    if($Full)
     2358    {
    21642359        if(not $In::Opt{"SkipDeprecated"})
    21652360        {
     
    23212516        "Warnings"=>0,
    23222517        "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    }
    23232534   
    23242535    foreach my $Method (sort keys(%CompatProblems))
     
    26142825    $META_DATA .= "tool_version:$TOOL_VERSION";
    26152826    $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);
    26172832}
    26182833
     
    27102925                }
    27112926               
    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}});
    27132928                foreach my $Method (@SortedMethods)
    27142929                {
     
    28143029                }
    28153030               
    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}});
    28173032                foreach my $Method (@SortedMethods)
    28183033                {
     
    29293144}
    29303145
    2931 sub applyMacroses($$$$$)
    2932 {
    2933     my ($Level, $Kind, $Content, $Problem, $AddAttr) = @_;
     3146sub applyMacroses($$$$$$)
     3147{
     3148    my ($Level, $Subj, $Kind, $Content, $Problem, $AddAttr) = @_;
    29343149   
    29353150    $Content = addMarkup($Content);
     
    29773192                    $Fmt = "HTML|Desc";
    29783193                }
     3194            }
     3195           
     3196            if($Subj eq "Change") {
     3197                $Fmt .= "|Return";
    29793198            }
    29803199           
     
    30623281                }
    30633282               
    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}});
    30653284                foreach my $Method (@SortedMethods)
    30663285                {
     
    30783297                            my $ProblemAttr = $MethodChanges{$Method}{$Kind}{$Loc};
    30793298                           
    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))
    30813300                            {
    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);
    30833302                                $METHOD_REPORT .= "<tr>\n<th>$ProblemNum</th>\n<td>".$Change."</td>\n<td>".$Effect."</td>\n</tr>\n";
    30843303                                $ProblemNum += 1;
     
    32333452                        my $ProblemAttr = $TypeChanges_Sev{$TypeName}{$Kind}{$Location};
    32343453                       
    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))
    32363455                        {
    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);
    32383457                           
    32393458                            $TYPE_REPORT .= "<tr>\n<th>$ProblemNum</th>\n<td>".$Change."</td>\n<td>".$Effect."</td>\n</tr>\n";
     
    35873806        my $Description = "Compatibility report for the ".$In::Opt{"TargetTitle"}." library between ".$In::Desc{1}{"Version"}." and ".$In::Desc{2}{"Version"}." versions";
    35883807       
    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>";
    35933812       
    35943813        $Report .= getReportHeader("Join");
     
    36083827    else
    36093828    {
    3610         my ($Summary, $MetaData) = getSummary($Level);
     3829        my ($Summary, $MetaData, $AnyChanged) = getSummary($Level);
    36113830       
    36123831        my $Title = $In::Opt{"TargetTitle"}.": ".$In::Desc{1}{"Version"}." to ".$In::Desc{2}{"Version"}." ".lc($Level)." compatibility report";
     
    36143833        my $Description = "$Level compatibility report for the ".$In::Opt{"TargetTitle"}." library between ".$In::Desc{1}{"Version"}." and ".$In::Desc{2}{"Version"}." versions";
    36153834       
    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>";
    36173836        $Report .= getReportHeader($Level)."\n".$Summary."\n";
    36183837        $Report .= getReportAdded($Level).getReportRemoved($Level);
     
    36673886}
    36683887
    3669 sub composeHTML_Head($$$$$$)
    3670 {
    3671     my ($Level, $Title, $Keywords, $Description, $Styles, $Scripts) = @_;
     3888sub composeHTML_Head($$$$$$$)
     3889{
     3890    my ($Level, $Title, $Keywords, $Description, $Styles, $Scripts, $AnyChanged) = @_;
    36723891   
    36733892    my $Head = "<!DOCTYPE html PUBLIC \"-//W3C//DTD XHTML 1.0 Transitional//EN\" \"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">\n";
     
    36783897    $Head .= "<meta name=\"description\" content=\"$Description\" />\n";
    36793898   
     3899    if(not $AnyChanged) {
     3900        $Head .= "<meta name=\"robots\" content=\"noindex\" />\n";
     3901    }
     3902   
    36803903    my $RPath = getReportPath($Level);
    36813904   
     
    37493972            }
    37503973           
    3751             my $ClassId = $MethodInfo{2}{$Method}{"Class"};
    3752             my $CName = getTypeName($ClassId, 2);
     3974            my $Class = getType($MethodInfo{2}{$Method}{"Class"}, 2);
    37533975           
    3754             $CheckedTypes{$CName} = 1;
     3976            $CheckedTypes{$Class->{"Name"}} = 1;
    37553977            $CheckedMethods{$Method} = 1;
    37563978           
    37573979            if(not $MethodInfo{2}{$Method}{"Constructor"}
    3758             and my $Overridden = findMethod($Method, 2, $CName, 2))
     3980            and my $Overridden = findMethod($Method, 2, $Class->{"Name"}, 2))
    37593981            {
    37603982                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"})}))
    37623985                { # class should exist in previous version
    37633986                    %{$CompatProblems{$Overridden}{"Class_Overridden_Method"}{"this.".getSFormat($Method)}}=(
    3764                         "Type_Name"=>$CName,
     3987                        "Type_Name"=>$Class->{"Name"},
    37653988                        "Target"=>$MethodInfo{2}{$Method}{"Signature"},
    37663989                        "Old_Value"=>$Overridden,
     
    37693992            }
    37703993            if($MethodInfo{2}{$Method}{"Abstract"}) {
    3771                 $AddedMethod_Abstract{$CName}{$Method} = 1;
     3994                $AddedMethod_Abstract{$Class->{"Name"}}{$Method} = 1;
    37723995            }
    37733996           
    3774             %{$CompatProblems{$Method}{"Added_Method"}{""}}=();
     3997            if(not ($MethodInfo{2}{$Method}{"Access"} eq "protected" and $Class->{"Final"})) {
     3998                %{$CompatProblems{$Method}{"Added_Method"}{""}} = ();
     3999            }
    37754000           
    37764001            if(not $MethodInfo{2}{$Method}{"Constructor"})
    37774002            {
    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)})
    37804022                {
    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);
    37854026                       
    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
    37884030                        );
    37894031                    }
     
    38044046            }
    38054047           
    3806             my $ClassId = $MethodInfo{1}{$Method}{"Class"};
    3807             my $CName = getTypeName($ClassId, 1);
     4048            my $Class = getType($MethodInfo{1}{$Method}{"Class"}, 1);
    38084049           
    3809             $CheckedTypes{$CName} = 1;
     4050            $CheckedTypes{$Class->{"Name"}} = 1;
    38104051            $CheckedMethods{$Method} = 1;
    38114052           
    38124053            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"})}))
    38174059                {# class should exist in newer version
    38184060                    %{$CompatProblems{$Method}{"Class_Method_Moved_Up_Hierarchy"}{"this.".getSFormat($MovedUp)}}=(
    3819                         "Type_Name"=>$CName,
     4061                        "Type_Name"=>$Class->{"Name"},
    38204062                        "Target"=>$MethodInfo{2}{$MovedUp}{"Signature"},
    38214063                        "Old_Value"=>$Method,
     
    38264068            {
    38274069                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                }
    38314076            }
    38324077        }
     
    39304175        if(cmpVersions($APIVer, $API_DUMP_VERSION)>0)
    39314176        { # 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");
    39384189    }
    39394190   
     
    42244475        chdir($UnpackDir);
    42254476        system("$UnzipCmd \"$Path\" >contents.txt");
     4477        chdir($In::Opt{"OrigDir"});
    42264478        if($?) {
    42274479            exitStatus("Error", "can't extract \'$Path\'");
    42284480        }
    4229         chdir($In::Opt{"OrigDir"});
     4481       
    42304482        my @Contents = ();
    42314483        foreach (split("\n", readFile("$UnpackDir/contents.txt")))
     
    42594511            }
    42604512            my @Contents = qx/$TarCmd -xvf "$Dir\\$FileName.tar"/;
     4513            chdir($In::Opt{"OrigDir"});
    42614514            if($? or not @Contents) {
    42624515                exitStatus("Error", "can't extract \'$Path\'");
    42634516            }
    4264             chdir($In::Opt{"OrigDir"});
    42654517            unlink($Dir."/".$FileName.".tar");
    42664518            chomp $Contents[0];
     
    42754527            chdir($UnpackDir);
    42764528            my @Contents = qx/$TarCmd -xvzf "$Path" 2>&1/;
     4529            chdir($In::Opt{"OrigDir"});
    42774530            if($? or not @Contents) {
    42784531                exitStatus("Error", "can't extract \'$Path\'");
    42794532            }
    4280             chdir($In::Opt{"OrigDir"});
    42814533            $Contents[0]=~s/^x //; # OS X
    42824534            chomp $Contents[0];
     
    43084560        if($?)
    43094561        { # cannot allocate memory (or other problems with "zip")
    4310             unlink($Path);
     4562            chdir($In::Opt{"OrigDir"});
    43114563            exitStatus("Error", "can't pack the API dump: ".$!);
    43124564        }
     
    43264578        }
    43274579        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);
    43314584        if($?)
    43324585        { # cannot allocate memory (or other problems with "tar")
    4333             unlink($Path);
    43344586            exitStatus("Error", "can't pack the API dump: ".$!);
    43354587        }
    4336         chdir($In::Opt{"OrigDir"});
    43374588        unlink($Path);
    43384589        return $To."/".$Name.".tar.gz";
     
    47685019        {
    47695020            detectDefaultPaths("bin", undef);
     5021            loadModule("APIDump");
     5022           
    47705023            readArchive(0, $ClientPath)
    47715024        }
     
    47855038       
    47865039        my $Count = 0;
    4787         foreach my $Method (keys(%{$MethodInfo{1}})) {
     5040        foreach my $Method (keys(%{$MethodInfo{1}}))
     5041        {
    47885042            $Count += methodFilter($Method, 1);
    47895043        }
  • trunk/tools/japicc/modules/Internals/APIDump.pm

    r11682 r12872  
    135135       
    136136        my $ClassName = getFilename($ClassPath);
    137         if($ClassName=~/\$\d/) {
     137        if($ClassName=~/\$\d/ or $ClassName eq "module-info") {
    138138            next;
    139139        }
     140       
    140141        $ClassPath = cutPrefix($ClassPath, $ExtractPath); # javap decompiler accepts relative paths only
    141142       
     
    220221}
    221222
    222 sub simpleDecl($)
     223sub simpleDecl($$)
    223224{
    224     my $Line = $_[0];
     225    my ($Line, $LVer) = @_;
    225226   
    226227    my %B = ( "<"=>0, ">"=>0 );
     
    287288    {
    288289        if($Line=~s/([A-Za-z\d\?]+) extends \Q$R\E/$1/) {
    289             $Tmpl{$1} = $R;
     290            $Tmpl{$1} = registerType($R, $LVer);
    290291        }
    291292    }
     
    317318    close(IN);
    318319   
    319     my (%TypeAttr, $CurrentMethod, $CurrentPackage, $CurrentClass) = ();
     320    my (%TypeAttr, $CurrentMethod, $CurrentPackage, $CurrentClass, $CurrentClass_Short) = ();
    320321    my ($InParamTable, $InVarTypeTable, $InExceptionTable, $InCode) = (0, 0, 0, 0);
    321322   
     
    488489          # <KEYIN extends java.lang.Object ...
    489490            if($LINE=~/<[A-Z\d\?]+ /i) {
    490                 ($LINE, $TmplP) = simpleDecl($LINE);
     491                ($LINE, $TmplP) = simpleDecl($LINE, $LVer);
    491492            }
    492493        }
     
    628629            }
    629630            $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/)
    631632            {
    632633                if($2)
     
    688689            and $LINE_N=~/(Signature|descriptor):\s*(.+?)\s*\Z/i)
    689690            { # 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               
    690697                if($MethodAttr{"Constructor"}) {
    691                     $CurrentMethod = $CurrentClass.".\"<init>\":".$2;
     698                    $CurrentMethod = $ShortClass.".\"<init>\":".$SignParams;
    692699                }
    693700                else {
    694                     $CurrentMethod = $CurrentClass.".".$MethodAttr{"ShortName"}.":".$2;
     701                    $CurrentMethod = $ShortClass.".".$MethodAttr{"ShortName"}.":".$SignParams;
    695702                }
    696703                if(my $PackageName = getSFormat($CurrentPackage)) {
     
    832839                $CurrentPackage = "";
    833840            }
     841           
    834842            if($CurrentClass=~s/#/./g)
    835843            { # javax.swing.text.GlyphView.GlyphPainter <=> GlyphView$GlyphPainter
    836844                $TypeAttr{"Name"}=~s/#/./g;
    837845            }
     846           
     847            $CurrentClass_Short = $CurrentClass;
     848            if(index($CurrentClass_Short, "<")!=-1) {
     849                $CurrentClass_Short=~s/<.+>//g;
     850            }
     851           
    838852            if($LINE=~/(\A|\s+)(public|protected|private)\s+/) {
    839853                $TypeAttr{"Access"} = $2;
     
    885899                $TypeAttr{"Static"} = 1;
    886900            }
     901           
     902            if($TmplP) {
     903                $TypeAttr{"GenericParam"} = $TmplP;
     904            }
    887905        }
    888906        elsif(index($LINE, "Deprecated: true")!=-1
     
    919937    chdir($In::Opt{"OrigDir"});
    920938   
     939    if(my $Err = $?>>8) {
     940        exitStatus("Error", "failed to run javap");
     941    }
     942   
    921943    if(not $NonEmpty) {
    922944        exitStatus("Error", "internal error in parser");
     
    961983            $TypeInfo{$LVer}{$Tid}{"BaseType"} = $BaseTypeId;
    962984            $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";
    963993        }
    964994    }
  • trunk/tools/japicc/modules/Internals/Basic.pm

    r11682 r12872  
    2626my %Cache;
    2727
    28 my $MD5_LEN = 8;
     28my $MD5_LEN = 12;
    2929
    3030sub getOSgroup()
  • trunk/tools/japicc/modules/Internals/Css/Report.css

    r11682 r12872  
    4444}
    4545span.ext {
    46     font-weight:100;
     46    font-weight:normal;
    4747}
    4848span.jar {
     
    8989span.attr {
    9090    color:Black;
    91     font-weight:100;
     91    font-weight:normal;
    9292}
    9393span.deprecated {
     
    142142table.summary th {
    143143    background-color:#eeeeee;
    144     font-weight:100;
     144    font-weight:normal;
    145145    text-align:left;
    146146    font-size:0.94em;
     
    177177}
    178178span.ttype {
    179     font-weight:100;
     179    font-weight:normal;
    180180}
    181181span.nowrap {
     
    188188.passed {
    189189    background-color:#CCFFCC;
    190     font-weight:100;
     190    font-weight:normal;
    191191}
    192192.warning {
    193193    background-color:#F4F4AF;
    194     font-weight:100;
     194    font-weight:normal;
    195195}
    196196.failed {
    197197    background-color:#FFCCCC;
    198     font-weight:100;
     198    font-weight:normal;
    199199}
    200200.new {
    201201    background-color:#C6DEFF;
    202     font-weight:100;
     202    font-weight:normal;
    203203}
    204204
    205205.compatible {
    206206    background-color:#CCFFCC;
    207     font-weight:100;
     207    font-weight:normal;
    208208}
    209209.almost_compatible {
    210210    background-color:#FFDAA3;
    211     font-weight:100;
     211    font-weight:normal;
    212212}
    213213.incompatible {
    214214    background-color:#FFCCCC;
    215     font-weight:100;
     215    font-weight:normal;
    216216}
    217217.gray {
    218218    background-color:#DCDCDC;
    219     font-weight:100;
     219    font-weight:normal;
    220220}
    221221
  • trunk/tools/japicc/modules/Internals/Filter.pm

    r11682 r12872  
    286286    }
    287287   
     288    if(my $Check = $In::Opt{"CheckPackages"})
     289    {
     290        if($Package!~/$Check/) {
     291            return 1;
     292        }
     293    }
     294   
    288295    return 0;
    289296}
  • trunk/tools/japicc/modules/Internals/RegTests.pm

    r11682 r12872  
    8080    writeFile($Path_v2."/BaseAbstractClass.java", $BaseAbstractClass);
    8181   
    82     # Removed_Annotation
    83     writeFile($Path_v1."/RemovedAnnotation.java",
    84     "package $PackageName;
    85     public \@interface RemovedAnnotation {
    86     }");
    87    
    88     # Beta Annotation
    89     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    
    9982    # BaseClass
    10083    my $BaseClass = "package $PackageName;
     
    142125    writeFile($Path_v2."/BaseConstantInterface.java", $BaseConstantInterface);
    143126   
    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;
    149433        \@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    }
    185457   
    186458    # Abstract_Method_Added_Checked_Exception
     
    276548    "package $PackageName;
    277549    public class ChangedMethodReturnFromVoid {
    278         public void changedMethod(Integer param1, String[] param2) { }
     550        public void changedMethod(Integer param1) { }
    279551    }");
    280552    writeFile($Path_v2."/ChangedMethodReturnFromVoid.java",
    281553    "package $PackageName;
    282554    public class ChangedMethodReturnFromVoid {
    283         public Integer changedMethod(Integer param1, String[] param2){
     555        public Integer changedMethod(Integer param1){
    284556            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);
    285587        }
    286588    }");
     
    362664    }");
    363665   
    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         \@RemovedAnnotation
    372         static void testMethod() {
    373         }
    374     }");
    375    
    376666    # Removed_Constant_Field (Interface)
    377667    writeFile($Path_v1."/InterfaceRemovedConstantField.java",
     
    437727    }");
    438728   
     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   
    439738    # Changed_Field_Access
    440739    writeFile($Path_v1."/ChangedFieldAccess.java",
     
    473772    public class NonConstantFieldBecameStatic {
    474773        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        }
    475783    }");
    476784   
     
    535843    public class RemovedMethod {
    536844        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 {
    537856    }");
    538857   
     
    586905    }");
    587906   
     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   
    588935    # Interface_Added_Abstract_Method
    589936    writeFile($Path_v1."/InterfaceAddedAbstractMethod.java",
     
    627974    "import $PackageName.*;
    628975    class Class_MethodBecameNonDefault implements MethodBecameNonDefault {
     976        public static void main(String[] args) { }
    629977    };
    630978   
     
    638986    }");
    639987   
    640     # Variable_Arity_To_Array
    641     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    
    652988    # Class_Became_Interface
    653989    writeFile($Path_v1."/ClassBecameInterface.java",
     
    8791215    writeFile($TestsPath."/Test_RemovedFieldClass.java",
    8801216    "import $PackageName.*;
    881     public class Test_RemovedFieldClass extends RemovedFieldClass
     1217    public class Test_RemovedFieldClass
    8821218    {
    8831219        public static void main(String[] args)
     
    10471383            return param1;
    10481384        };
    1049         public abstract Integer removedMethod(Integer param);
     1385        public abstract void removedMethod(Integer param);
    10501386    }");
    10511387    writeFile($Path_v2."/ClassRemovedAbstractMethod.java",
     
    10571393    }");
    10581394   
     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   
    10591412    # Class_Method_Became_Abstract
    10601413    writeFile($Path_v1."/ClassMethodBecameAbstract.java",
     
    11301483   
    11311484    # Static_Method_Became_Final
    1132     writeFile($Path_v1."/StaticMethodBecameFinal.java",
     1485    writeFile($Path_v2."/StaticMethodBecameFinal.java",
    11331486    "package $PackageName;
    11341487    public class StaticMethodBecameFinal {
     
    11371490        };
    11381491    }");
    1139     writeFile($Path_v2."/StaticMethodBecameFinal.java",
     1492    writeFile($Path_v1."/StaticMethodBecameFinal.java",
    11401493    "package $PackageName;
    11411494    public class StaticMethodBecameFinal {
     
    11431496            return param;
    11441497        };
     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        }
    11451508    }");
    11461509   
     
    13151678            return 0;
    13161679        }
     1680        public Integer someMethod(InterfaceRemovedLastAbstractMethod param) {
     1681            return 0;
     1682        }
     1683       
    13171684    }");
    13181685    writeFile($Path_v2."/Use.java",
     
    13401707        public Integer someMethod(AbstractClassAddedSuperInterfaceWithImplementedMethods param) {
    13411708            return param.method2(100);
     1709        }
     1710        public Integer someMethod(InterfaceRemovedLastAbstractMethod param) {
     1711            return 0;
    13421712        }
    13431713    }");
     
    14031773    my ($TestsPath, $PackageName, $Path_v1, $Path_v2) = @_;
    14041774   
     1775    printMsg("INFO", "Running tests ...");
     1776   
    14051777    # compile with old version of package
    14061778    my $JavacCmd = getCmdPath("javac");
     
    14471819    }
    14481820   
    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");
    14501824}
    14511825
  • trunk/tools/japicc/modules/Internals/SysFiles.pm

    r11682 r12872  
    195195            if(my $Ver = `$JavacCmd -version 2>&1`)
    196196            {
    197                 if($Ver=~/javac\s+(.+)/) {
     197                if($Ver=~/javac\s+(.+)/)
     198                {
    198199                    printMsg("INFO", "Using Java ".$1);
     200                    $In::Opt{"CompilerVer"} = $1;
    199201                }
    200202            }
  • trunk/tools/japicc/modules/Internals/TypeAttr.pm

    r11682 r12872  
    9595}
    9696
     97sub getGeneric($)
     98{
     99    my $Name = $_[0];
     100    $Name=~s/<.*>//g;
     101    return $Name;
     102}
     103
    97104return 1;
  • trunk/tools/japicc/modules/Internals/Utils.pm

    r11682 r12872  
    6464   
    6565    # 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;
    6769}
    6870
  • trunk/tools/japicc/modules/RulesBin.xml

    r11682 r12872  
    5252    </change>
    5353    <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.
    5591    </effect>
    5692</rule>
     
    301337    </id>
    302338    <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>
    308368</rule>
    309369
     
    803863    </id>
    804864    <severity>
    805         Medium
     865        Low
    806866    </severity>
    807867    <kind>
     
    11611221<rule>
    11621222    <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>
    11631295        Class_Became_Final
    11641296    </id>
  • trunk/tools/japicc/modules/RulesSrc.xml

    r11682 r12872  
    4040<rule>
    4141    <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>
    4260        Static_Method_Became_Final
    4361    </id>
     
    262280<rule>
    263281    <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>
    264318        NonAbstract_Class_Added_Abstract_Method
    265319    </id>
     
    715769    </id>
    716770    <severity>
    717         Medium
     771        Low
    718772    </severity>
    719773    <kind>
     
    9471001<rule>
    9481002    <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>
    9491039        NonConstant_Field_Became_NonStatic
    9501040    </id>
     
    10191109<rule>
    10201110    <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>
    10211183        Class_Became_Final
    10221184    </id>
Note: See TracChangeset for help on using the changeset viewer.