Index: trunk/tools/japicc/japi-compliance-checker.pl
===================================================================
--- trunk/tools/japicc/japi-compliance-checker.pl	(revision 13567)
+++ trunk/tools/japicc/japi-compliance-checker.pl	(revision 13595)
@@ -1,10 +1,10 @@
 #!/usr/bin/perl
-###########################################################################
-# Java API Compliance Checker (JAPICC) 2.3
+#########################################################################
+# Java API Compliance Checker (JAPICC) 2.4
 # A tool for checking backward compatibility of a Java library API
 #
 # Written by Andrey Ponomarenko
 #
-# Copyright (C) 2011-2017 Andrey Ponomarenko's ABI Laboratory
+# Copyright (C) 2011-2018 Andrey Ponomarenko's ABI Laboratory
 #
 # PLATFORMS
@@ -15,24 +15,26 @@
 # ============
 #  Linux, FreeBSD, Mac OS X
-#    - JDK or OpenJDK - development files (javap, javac)
+#    - JDK or OpenJDK - development files (javap, javac, jar, jmod)
 #    - Perl 5 (5.8 or newer)
 #
 #  MS Windows
-#    - JDK or OpenJDK (javap, javac)
+#    - JDK or OpenJDK (javap, javac, jar, jmod)
 #    - Active Perl 5 (5.8 or newer)
 #
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License or the GNU Lesser
-# General Public License as published by the Free Software Foundation.
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
 #
-# This program is distributed in the hope that it will be useful,
+# This library is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
 #
-# You should have received a copy of the GNU General Public License
-# and the GNU Lesser General Public License along with this program.
-# If not, see <http://www.gnu.org/licenses/>.
-###########################################################################
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+# MA  02110-1301  USA.
+#########################################################################
 use Getopt::Long;
 Getopt::Long::Configure ("posix_default", "no_ignore_case", "permute");
@@ -43,6 +45,6 @@
 use Data::Dumper;
 
-my $TOOL_VERSION = "2.3";
-my $API_DUMP_VERSION = "2.2";
+my $TOOL_VERSION = "2.4";
+my $API_DUMP_VERSION = "2.4";
 my $API_DUMP_VERSION_MIN = "2.2";
 
@@ -78,9 +80,11 @@
 my $ShortUsage = "Java API Compliance Checker (JAPICC) $TOOL_VERSION
 A tool for checking backward compatibility of a Java library API
-Copyright (C) 2017 Andrey Ponomarenko's ABI Laboratory
-License: GNU LGPL or GNU GPL
+Copyright (C) 2018 Andrey Ponomarenko's ABI Laboratory
+License: LGPLv2.1+
 
 Usage: $CmdName [options]
-Example: $CmdName OLD.jar NEW.jar
+Example:
+ $CmdName OLD.jar NEW.jar
+ $CmdName OLD.jmod NEW.jmod
 
 More info: $CmdName --help";
@@ -110,4 +114,5 @@
   "skip-internal-types=s" => \$In::Opt{"SkipInternalTypes"},
   "dump|dump-api=s" => \$In::Opt{"DumpAPI"},
+  "check-annotations!" => \$In::Opt{"CheckAnnotations"},
   "check-packages=s" => \$In::Opt{"CheckPackages"},
   "classes-list=s" => \$In::Opt{"ClassListPath"},
@@ -117,4 +122,6 @@
   "skip-classes=s" => \$In::Opt{"SkipClassesList"},
   "skip-packages=s" => \$In::Opt{"SkipPackagesList"},
+  "non-impl=s" => \$In::Opt{"NonImplClassesList"},
+  "non-impl-all!" => \$In::Opt{"NonImplAll"},
   "short" => \$In::Opt{"ShortMode"},
   "dump-path=s" => \$In::Opt{"OutputDumpPath"},
@@ -189,13 +196,16 @@
 
   This tool is free software: you can redistribute it and/or modify it
-  under the terms of the GNU LGPL or GNU GPL.
+  under the terms of the GNU LGPL.
 
 USAGE:
   $CmdName [options]
 
-EXAMPLE 1:
+EXAMPLE (1):
   $CmdName OLD.jar NEW.jar
 
-EXAMPLE 2:
+EXAMPLE (2):
+  $CmdName OLD.jmod NEW.jmod
+
+EXAMPLE (3):
   $CmdName -lib NAME -old OLD.xml -new NEW.xml
   OLD.xml and NEW.xml are XML-descriptors:
@@ -206,6 +216,6 @@
     
     <archives>
-        /path1/to/JAR(s)/
-        /path2/to/JAR(s)/
+        /path1/to/JAR(s) OR JMOD(s)/
+        /path2/to/JAR(s) OR JMOD(s)/
         ...
     </archives>
@@ -229,5 +239,5 @@
       It may be one of the following:
       
-         1. Java archive (*.jar)
+         1. Java archive (*.jar or *.jmod)
          2. XML-descriptor (VERSION.xml file):
 
@@ -237,6 +247,6 @@
               
               <archives>
-                  /path1/to/JAR(s)/
-                  /path2/to/JAR(s)/
+                  /path1/to/JAR(s) OR JMOD(s)/
+                  /path2/to/JAR(s) OR JMOD(s)/
                    ...
               </archives>
@@ -246,8 +256,8 @@
          3. API dump generated by -dump option
 
-      If you are using *.jar as a descriptor then you should
-      specify version numbers with -v1 and -v2 options too.
-      If version numbers are not specified then the tool will
-      try to detect them automatically.
+      If you are using *.jar or *.jmod as a descriptor then
+      you should specify version numbers with -v1 and -v2
+      options too. If version numbers are not specified then
+      the tool will try to detect them automatically.
 
   -new|-d2 PATH
@@ -304,4 +314,7 @@
       for debugging the tool. PATH is the path to the Java archive or
       XML descriptor of the library.
+  
+  -check-annotations
+      Check for changes in annotations like in any other interfaces.
   
   -check-packages PATTERN
@@ -325,11 +338,15 @@
       
   -skip-classes PATH
-      This option allows to specify a file with a list
-      of classes that should not be checked.
-      
+      List of classes that should not be checked.
+  
   -skip-packages PATH
-      This option allows to specify a file with a list
-      of packages that should not be checked.
-      
+      List of packages that should not be checked.
+  
+  -non-impl PATH
+      List of interfaces that should not be implemented by users.
+  
+  -non-impl-all
+      All interfaces should not be implemented by users.
+  
   -short
       Do not list added/removed methods.
@@ -805,4 +822,114 @@
                 }
             }
+            
+            if(defined $Class1->{"Annotation"})
+            {
+                my %AnnParam = ();
+                foreach my $VN (1, 2)
+                {
+                    foreach my $Method (keys(%{$Class_Methods{$VN}{$ClassName}}))
+                    {
+                        my $MInfo = $MethodInfo{$VN}{$Method};
+                        $AnnParam{$VN}{$MInfo->{"ShortName"}} = {"Default"=>$MInfo->{"Default"}, "Return"=>getTypeName($MInfo->{"Return"}, $VN)};
+                    }
+                }
+                foreach my $AParam (sort keys(%{$AnnParam{1}}))
+                {
+                    my $R1 = $AnnParam{1}{$AParam}{"Return"};
+                    my $D1 = $AnnParam{1}{$AParam}{"Default"};
+                    
+                    if(defined $AnnParam{2}{$AParam})
+                    {
+                        my $R2 = $AnnParam{2}{$AParam}{"Return"};
+                        my $D2 = $AnnParam{2}{$AParam}{"Default"};
+                        
+                        if($R1 ne $R2)
+                        {
+                            if($R1 eq "java.lang.String" and $R2 eq "java.lang.String[]")
+                            {
+                                %{$CompatProblems{".client_method"}{"Annotation_Element_Changed_Type_Safe"}{$AParam}} = (
+                                    "Type_Name"=>$ClassName,
+                                    "Old_Value"=>$R1,
+                                    "New_Value"=>$R2,
+                                    "Target"=>$AParam);
+                            }
+                            else
+                            {
+                                %{$CompatProblems{".client_method"}{"Annotation_Element_Changed_Type"}{$AParam}} = (
+                                    "Type_Name"=>$ClassName,
+                                    "Old_Value"=>$R1,
+                                    "New_Value"=>$R2,
+                                    "Target"=>$AParam);
+                            }
+                        }
+                        
+                        if(defined $D1 and not defined $D2)
+                        {
+                            %{$CompatProblems{".client_method"}{"Annotation_Element_Removed_Default_Value"}{$AParam}} = (
+                                "Type_Name"=>$ClassName,
+                                "Old_Value"=>$D1,
+                                "Target"=>$AParam);
+                        }
+                        elsif(not defined $D1 and defined $D2)
+                        {
+                            %{$CompatProblems{".client_method"}{"Annotation_Element_Added_Default_Value"}{$AParam}} = (
+                                "Type_Name"=>$ClassName,
+                                "New_Value"=>$D2,
+                                "Target"=>$AParam);
+                        }
+                        elsif($D1 ne $D2)
+                        {
+                            %{$CompatProblems{".client_method"}{"Annotation_Element_Changed_Default_Value"}{$AParam}} = (
+                                "Type_Name"=>$ClassName,
+                                "Old_Value"=>$D1,
+                                "New_Value"=>$D2,
+                                "Target"=>$AParam);
+                        }
+                    }
+                    else
+                    {
+                        if(defined $D1)
+                        {
+                            %{$CompatProblems{".client_method"}{"Removed_Annotation_Default_Element"}{$AParam}} = (
+                                "Type_Name"=>$ClassName,
+                                "Elem_Type"=>$R1,
+                                "Old_Value"=>$D1,
+                                "Target"=>$AParam);
+                        }
+                        else
+                        {
+                            %{$CompatProblems{".client_method"}{"Removed_Annotation_NonDefault_Element"}{$AParam}} = (
+                                "Type_Name"=>$ClassName,
+                                "Elem_Type"=>$R1,
+                                "Target"=>$AParam);
+                        }
+                    }
+                }
+                
+                foreach my $AParam (sort keys(%{$AnnParam{2}}))
+                {
+                    if(not defined $AnnParam{1}{$AParam})
+                    {
+                        my $R2 = $AnnParam{2}{$AParam}{"Return"};
+                        
+                        if(defined $AnnParam{2}{$AParam}{"Default"})
+                        {
+                            my $D2 = $AnnParam{2}{$AParam}{"Default"};
+                            %{$CompatProblems{".client_method"}{"Added_Annotation_Default_Element"}{$AParam}} = (
+                                "Type_Name"=>$ClassName,
+                                "Elem_Type"=>$R2,
+                                "New_Value"=>$D2,
+                                "Target"=>$AParam);
+                        }
+                        else
+                        {
+                            %{$CompatProblems{".client_method"}{"Added_Annotation_NonDefault_Element"}{$AParam}} = (
+                                "Type_Name"=>$ClassName,
+                                "Elem_Type"=>$R2,
+                                "Target"=>$AParam);
+                        }
+                    }
+                }
+            }
         }
         else
@@ -1051,5 +1178,12 @@
         else
         {
-            if(my @InvokedBy = sort keys(%{$MethodUsed{2}{$AddedMethod}}))
+            if(nonImplClass(\%Type1))
+            {
+                %{$SubProblems{"NonImpl_Interface_Added_Abstract_Method"}{getSFormat($AddedMethod)}} = (
+                    "Type_Name"=>$Type1{"Name"},
+                    "Type_Type"=>$Type1{"Type"},
+                    "Target"=>$AddedMethod);
+            }
+            elsif(my @InvokedBy = sort keys(%{$MethodUsed{2}{$AddedMethod}}))
             {
                 %{$SubProblems{"Interface_Added_Abstract_Method_Invoked_By_Others"}{getSFormat($AddedMethod)}} = (
@@ -1754,6 +1888,12 @@
         
         my $ClassId1 = $MethodInfo{1}{$Method}{"Class"};
-        my $Class1_Name = getTypeName($ClassId1, 1);
-        my $Class1_Type = getTypeType($ClassId1, 1);
+        my $Class1 = getType($ClassId1, 1);
+        
+        if(not defined $In::Opt{"CheckAnnotations"} and $Class1->{"Annotation"}) {
+            next;
+        }
+        
+        my $Class1_Name = $Class1->{"Name"};
+        my $Class1_Type = $Class1->{"Type"};
         
         $CheckedTypes{$Class1_Name} = 1;
@@ -2520,5 +2660,5 @@
     foreach my $Method (sort keys(%CompatProblems))
     {
-        foreach my $Kind (keys(%{$CompatProblems{$Method}}))
+        foreach my $Kind (sort keys(%{$CompatProblems{$Method}}))
         {
             if(not defined $CompatRules{"Binary"}{$Kind} and not defined $CompatRules{"Source"}{$Kind})
@@ -2527,5 +2667,5 @@
                 { # only one warning
                     printMsg("WARNING", "unknown rule \"$Kind\" (\"$Level\")");
-                    $UnknownRules{$Level}{$Kind}=1;
+                    $UnknownRules{$Level}{$Kind} = 1;
                 }
             }
@@ -2694,5 +2834,5 @@
     $Checked_Archives_Link = "<a href='#Checked_Archives' style='color:Blue;'>".keys(%{$LibArchives{1}})."</a>" if(keys(%{$LibArchives{1}})>0);
     
-    $TestResults .= "<tr><th>Total JARs</th><td>$Checked_Archives_Link</td></tr>\n";
+    $TestResults .= "<tr><th>Total Java Modules</th><td>$Checked_Archives_Link</td></tr>\n";
     $TestResults .= "<tr><th>Total Methods / Classes</th><td>".keys(%CheckedMethods)." / ".keys(%CheckedTypes)."</td></tr>\n";
     
@@ -3363,5 +3503,11 @@
 {
     my ($Name, $Html, $LVer) = @_;
-    my $TType = $TypeInfo{$LVer}{$TName_Tid{$LVer}{$Name}}{"Type"};
+    my $TInfo = $TypeInfo{$LVer}{$TName_Tid{$LVer}{$Name}};
+    my $TType = $TInfo->{"Type"};
+    
+    if($TInfo->{"Annotation"}) {
+        $TType = '@'.$TType;
+    }
+    
     if($Html) {
         $Name = "<span class='ttype'>".$TType."</span> ".specChars($Name);
@@ -3894,4 +4040,5 @@
     $Head .= "<head>\n";
     $Head .= "<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\" />\n";
+    $Head .= "<meta name=\"viewport\" content=\"width=device-width,initial-scale=1\" />\n";
     $Head .= "<meta name=\"keywords\" content=\"$Keywords\" />\n";
     $Head .= "<meta name=\"description\" content=\"$Description\" />\n";
@@ -3973,4 +4120,8 @@
             
             my $Class = getType($MethodInfo{2}{$Method}{"Class"}, 2);
+            
+            if(not defined $In::Opt{"CheckAnnotations"} and $Class->{"Annotation"}) {
+                next;
+            }
             
             $CheckedTypes{$Class->{"Name"}} = 1;
@@ -4048,4 +4199,8 @@
             my $Class = getType($MethodInfo{1}{$Method}{"Class"}, 1);
             
+            if(not defined $In::Opt{"CheckAnnotations"} and $Class->{"Annotation"}) {
+                next;
+            }
+            
             $CheckedTypes{$Class->{"Name"}} = 1;
             $CheckedMethods{$Method} = 1;
@@ -4079,26 +4234,4 @@
 }
 
-sub getArchivePaths($$)
-{
-    my ($Dest, $LVer) = @_;
-    if(-f $Dest) {
-        return ($Dest);
-    }
-    elsif(-d $Dest)
-    {
-        $Dest=~s/[\/\\]+\Z//g;
-        next if(not $Dest);
-        
-        my @Archives = ();
-        foreach my $Path (cmdFind($Dest, "", "*\\.jar"))
-        {
-            next if(ignorePath($Path, $Dest));
-            push(@Archives, realpath_F($Path));
-        }
-        return @Archives;
-    }
-    return ();
-}
-
 sub isCyclical($$) {
     return (grep {$_ eq $_[1]} @{$_[0]});
@@ -4206,5 +4339,5 @@
     }
     
-    if($Path!~/\.jar\Z/i) {
+    if($Path!~/\.(jar|jmod)\Z/i) {
         return;
     }
@@ -4212,6 +4345,9 @@
     my $Ver = undef;
     
-    if(not defined $Ver) {
-        $Ver = getManifestVersion(getAbsPath($Path));
+    if($Path=~/\.jar\Z/i)
+    {
+        if(not defined $Ver) {
+            $Ver = getManifestVersion(getAbsPath($Path));
+        }
     }
     
@@ -4875,5 +5011,5 @@
     if(defined $In::Opt{"ShowVersion"})
     {
-        printMsg("INFO", "Java API Compliance Checker (JAPICC) $TOOL_VERSION\nCopyright (C) 2017 Andrey Ponomarenko's ABI Laboratory\nLicense: LGPL or GPL <http://www.gnu.org/licenses/>\nThis program is free software: you can redistribute it and/or modify it.\n\nWritten by Andrey Ponomarenko.");
+        printMsg("INFO", "Java API Compliance Checker (JAPICC) $TOOL_VERSION\nCopyright (C) 2018 Andrey Ponomarenko's ABI Laboratory\nLicense: LGPLv2.1+ <http://www.gnu.org/licenses/>\nThis program is free software: you can redistribute it and/or modify it.\n\nWritten by Andrey Ponomarenko.");
         exit(0);
     }
@@ -4911,5 +5047,5 @@
         if($In::Opt{"DumpAPI"})
         {
-            if($In::Opt{"DumpAPI"}=~/\.jar\Z/)
+            if($In::Opt{"DumpAPI"}=~/\.(jar|jmod)\Z/)
             { # short usage
                 my ($Name, $Version) = getPkgVersion(getFilename($In::Opt{"DumpAPI"}));
@@ -4925,5 +5061,5 @@
         else
         {
-            if($In::Desc{1}{"Path"}=~/\.jar\Z/ and $In::Desc{2}{"Path"}=~/\.jar\Z/)
+            if($In::Desc{1}{"Path"}=~/\.(jar|jmod)\Z/ and $In::Desc{2}{"Path"}=~/\.(jar|jmod)\Z/)
             { # short usage
                 my ($Name1, $Version1) = getPkgVersion(getFilename($In::Desc{1}{"Path"}));
@@ -4999,4 +5135,15 @@
         }
     }
+    if(my $NonImplClassesList = $In::Opt{"NonImplClassesList"})
+    {
+        if(not -f $NonImplClassesList) {
+            exitStatus("Access_Error", "can't access file \'$NonImplClassesList\'");
+        }
+        foreach my $Class (split(/\n/, readFile($NonImplClassesList)))
+        {
+            $Class=~s/\//./g;
+            $In::Opt{"NonImplClasses"}{$Class} = 1;
+        }
+    }
     if(my $SkipPackagesList = $In::Opt{"SkipPackagesList"})
     {
Index: trunk/tools/japicc/modules/Internals/APIDump.pm
===================================================================
--- trunk/tools/japicc/modules/Internals/APIDump.pm	(revision 13567)
+++ trunk/tools/japicc/modules/Internals/APIDump.pm	(revision 13595)
@@ -2,20 +2,22 @@
 # A module to create API dump from disassembled code
 #
-# Copyright (C) 2016-2017 Andrey Ponomarenko's ABI Laboratory
+# Copyright (C) 2016-2018 Andrey Ponomarenko's ABI Laboratory
 #
 # Written by Andrey Ponomarenko
 #
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License or the GNU Lesser
-# General Public License as published by the Free Software Foundation.
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
 #
-# This program is distributed in the hope that it will be useful,
+# This library is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
 #
-# You should have received a copy of the GNU General Public License
-# and the GNU Lesser General Public License along with this program.
-# If not, see <http://www.gnu.org/licenses/>.
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+# MA  02110-1301  USA.
 ###########################################################################
 use strict;
@@ -110,10 +112,28 @@
 { # 1, 2 - library, 0 - client
     my ($LVer, $Path) = @_;
-    
     $Path = getAbsPath($Path);
-    my $JarCmd = getCmdPath("jar");
-    if(not $JarCmd) {
-        exitStatus("Not_Found", "can't find \"jar\" command");
-    }
+    
+    my $ExtractCmd = undef;
+    
+    if($Path=~/\.jar\Z/)
+    {
+        $ExtractCmd = getCmdPath("jar");
+        if(not $ExtractCmd) {
+            exitStatus("Not_Found", "can't find \"jar\" command");
+        }
+        $ExtractCmd .= " -xf \"$Path\"";
+    }
+    elsif($Path=~/\.jmod\Z/)
+    {
+        $ExtractCmd = getCmdPath("jmod");
+        if(not $ExtractCmd) {
+            exitStatus("Not_Found", "can't find \"jmod\" command");
+        }
+        $ExtractCmd .= " extract \"$Path\"";
+    }
+    else {
+        exitStatus("Error", "unknown format of \'$Path\'");
+    }
+    
     my $ExtractPath = join_P($In::Opt{"Tmp"}, $ExtractCounter);
     if(-d $ExtractPath) {
@@ -121,10 +141,12 @@
     }
     mkpath($ExtractPath);
+    
     chdir($ExtractPath);
-    system($JarCmd." -xf \"$Path\"");
+    system($ExtractCmd);
     if($?) {
         exitStatus("Error", "can't extract \'$Path\'");
     }
     chdir($In::Opt{"OrigDir"});
+    
     my @Classes = ();
     foreach my $ClassPath (cmdFind($ExtractPath, "", "*\\.class"))
@@ -177,4 +199,9 @@
     {
         foreach my $SubArchive (cmdFind($ExtractPath, "", "*\\.jar"))
+        { # recursive step
+            readArchive($LVer, $SubArchive);
+        }
+        
+        foreach my $SubArchive (cmdFind($ExtractPath, "", "*\\.jmod"))
         { # recursive step
             readArchive($LVer, $SubArchive);
@@ -305,4 +332,14 @@
     
     my $TmpDir = $In::Opt{"Tmp"};
+    my $DumpFile = undef;
+    
+    if(defined $In::Opt{"Debug"})
+    {
+        if(my $DebugDir = getDebugDir($LVer))
+        {
+            mkpath($DebugDir);
+            $DumpFile = $DebugDir."/class-dump.txt";
+        }
+    }
     
     # ! private info should be processed
@@ -315,6 +352,18 @@
     
     chdir($TmpDir."/".$ExtractCounter);
+    
+    my ($Err, $ErrMsg) = ();
+    
     my $Pid = open3(*IN, *OUT, *ERR, @Cmd);
+    ($Err, $ErrMsg) = ($?, $!);
+    
     close(IN);
+    close(ERR);
+    
+    chdir($In::Opt{"OrigDir"});
+    
+    if($Err==-1 and $Err>>8 and $ErrMsg) {
+        exitStatus("Error", "failed to run javap (".$ErrMsg.")");
+    }
     
     my (%TypeAttr, $CurrentMethod, $CurrentPackage, $CurrentClass, $CurrentClass_Short) = ();
@@ -324,6 +373,7 @@
     my $InAnnotations_Class = undef;
     my $InAnnotations_Method = undef;
-    my %AnnotationName = ();
+    my %ConstantTypeName = ();
     my %AnnotationNum = (); # support for Java 7
+    my %ConstantName = ();
     
     my ($ParamPos, $FieldPos) = (0, 0);
@@ -331,5 +381,4 @@
     
     my $DContent = "";
-    my $Debug = (defined $In::Opt{"Debug"});
     
     while($Run)
@@ -343,5 +392,5 @@
             }
             
-            if($Debug) {
+            if(defined $In::Opt{"Debug"}) {
                 $DContent .= $LINE;
             }
@@ -463,5 +512,5 @@
                     $AName=~s/\//./g;
                     
-                    $AnnotationName{$CNum} = $AName;
+                    $ConstantTypeName{$CNum} = $AName;
                     
                     if(defined $AnnotationNum{$CNum})
@@ -471,4 +520,13 @@
                         }
                         delete($AnnotationNum{$CNum});
+                    }
+                }
+                elsif($LINE=~/=\s*(Utf8|Integer|Long|Float|Double)\s+(.*?)\Z/)
+                {
+                    if($1 eq "Utf8") {
+                        $ConstantName{$CNum} = "\"".$2."\"";
+                    }
+                    else {
+                        $ConstantName{$CNum} = $2;
                     }
                 }
@@ -557,5 +615,5 @@
                 if($LINE=~/\A\s*\d+\:\s*#(\d+)/)
                 {
-                    if(my $AName = $AnnotationName{$1})
+                    if(my $AName = $ConstantTypeName{$1})
                     {
                         if($InAnnotations_Class) {
@@ -678,5 +736,5 @@
             my $LINE_N = <OUT>;
             
-            if($Debug) {
+            if(defined $In::Opt{"Debug"}) {
                 $DContent .= $LINE_N;
             }
@@ -758,5 +816,5 @@
             
             my $LINE_NP = <OUT>;
-            if($Debug) {
+            if(defined $In::Opt{"Debug"}) {
                 $DContent .= $LINE_NP;
             }
@@ -773,5 +831,5 @@
             
             $LINE_NP = <OUT>;
-            if($Debug) {
+            if(defined $In::Opt{"Debug"}) {
                 $DContent .= $LINE_NP;
             }
@@ -780,5 +838,5 @@
             { # flags: ACC_PUBLIC, ACC_STATIC, ACC_FINAL, ACC_ANNOTATION
                 $LINE_NP = <OUT>;
-                if($Debug) {
+                if(defined $In::Opt{"Debug"}) {
                     $DContent .= $LINE_NP;
                 }
@@ -821,6 +879,7 @@
             
             %TypeAttr = ("Type"=>$2, "Name"=>$3); # reset previous class
-            %AnnotationName = (); # reset annotations of the class
+            %ConstantTypeName = (); # reset annotations of the class
             %AnnotationNum = (); # support for Java 7
+            %ConstantName = ();
             $InAnnotations_Class = 1;
             
@@ -923,4 +982,42 @@
             $InAnnotations = undef;
         }
+        elsif($CurrentMethod and index($LINE, "default_value")!=-1)
+        {
+            if($LINE=~/default_value:\s*[sISJBFDCZ]#(\d+)/)
+            {
+                if(defined $ConstantName{$1}) {
+                    $MethodInfo{$LVer}{$MName_Mid{$CurrentMethod}}{"Default"} = $ConstantName{$1};
+                }
+            }
+            elsif($LINE=~/default_value:\s*e#(\d+)\.#(\d+)/)
+            {
+                my ($ET, $EV) = ($1, $2);
+                if(defined $ConstantTypeName{$ET} and defined $ConstantName{$EV})
+                {
+                    $ET = $ConstantTypeName{$ET};
+                    $EV = $ConstantName{$EV};
+                    $EV=~s/\"//g;
+                    $MethodInfo{$LVer}{$MName_Mid{$CurrentMethod}}{"Default"} = $ET.".".$EV;
+                }
+            }
+            elsif($LINE=~/default_value:\s*\[(.*)\]/)
+            {
+                my $Arr = $1;
+                if($Arr)
+                {
+                    my @ArrU = ();
+                    foreach my $ArrP (split(/\s*,\s*/, $Arr))
+                    {
+                        if($ArrP=~/[sISJBFDCZ]#(\d+)/) {
+                            push(@ArrU, $ConstantName{$1});
+                        }
+                    }
+                    $MethodInfo{$LVer}{$MName_Mid{$CurrentMethod}}{"Default"} = "{".join(",", @ArrU)."}";
+                }
+                else {
+                    $MethodInfo{$LVer}{$MName_Mid{$CurrentMethod}}{"Default"} = "{}";
+                }
+            }
+        }
         else
         {
@@ -935,9 +1032,5 @@
     
     waitpid($Pid, 0);
-    chdir($In::Opt{"OrigDir"});
-    
-    if(my $Err = $?>>8) {
-        exitStatus("Error", "failed to run javap");
-    }
+    close(OUT);
     
     if(not $NonEmpty) {
@@ -945,6 +1038,6 @@
     }
     
-    if($Debug) {
-        appendFile(getDebugDir($LVer)."/class-dump.txt", $DContent);
+    if(defined $In::Opt{"Debug"}) {
+        appendFile($DumpFile, $DContent);
     }
 }
Index: trunk/tools/japicc/modules/Internals/Basic.pm
===================================================================
--- trunk/tools/japicc/modules/Internals/Basic.pm	(revision 13567)
+++ trunk/tools/japicc/modules/Internals/Basic.pm	(revision 13595)
@@ -2,20 +2,22 @@
 # A module with simple functions
 #
-# Copyright (C) 2016-2017 Andrey Ponomarenko's ABI Laboratory
+# Copyright (C) 2016-2018 Andrey Ponomarenko's ABI Laboratory
 #
 # Written by Andrey Ponomarenko
 #
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License or the GNU Lesser
-# General Public License as published by the Free Software Foundation.
-#
-# This program is distributed in the hope that it will be useful,
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# and the GNU Lesser General Public License along with this program.
-# If not, see <http://www.gnu.org/licenses/>.
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+# MA  02110-1301  USA.
 ###########################################################################
 use strict;
Index: trunk/tools/japicc/modules/Internals/Descriptor.pm
===================================================================
--- trunk/tools/japicc/modules/Internals/Descriptor.pm	(revision 13567)
+++ trunk/tools/japicc/modules/Internals/Descriptor.pm	(revision 13595)
@@ -2,20 +2,22 @@
 # A module to handle XML descriptors
 #
-# Copyright (C) 2016 Andrey Ponomarenko's ABI Laboratory
+# Copyright (C) 2016-2018 Andrey Ponomarenko's ABI Laboratory
 #
 # Written by Andrey Ponomarenko
 #
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License or the GNU Lesser
-# General Public License as published by the Free Software Foundation.
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
 #
-# This program is distributed in the hope that it will be useful,
+# This library is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
 #
-# You should have received a copy of the GNU General Public License
-# and the GNU Lesser General Public License along with this program.
-# If not, see <http://www.gnu.org/licenses/>.
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+# MA  02110-1301  USA.
 ###########################################################################
 use strict;
@@ -29,5 +31,5 @@
     }
     
-    if(-d $Path or $Path=~/\.jar\Z/)
+    if(-d $Path or $Path=~/\.(jar|jmod)\Z/)
     {
         return "
Index: trunk/tools/japicc/modules/Internals/Filter.pm
===================================================================
--- trunk/tools/japicc/modules/Internals/Filter.pm	(revision 13567)
+++ trunk/tools/japicc/modules/Internals/Filter.pm	(revision 13595)
@@ -2,20 +2,22 @@
 # A module to filter API symbols
 #
-# Copyright (C) 2016-2017 Andrey Ponomarenko's ABI Laboratory
+# Copyright (C) 2016-2018 Andrey Ponomarenko's ABI Laboratory
 #
 # Written by Andrey Ponomarenko
 #
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License or the GNU Lesser
-# General Public License as published by the Free Software Foundation.
-#
-# This program is distributed in the hope that it will be useful,
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# and the GNU Lesser General Public License along with this program.
-# If not, see <http://www.gnu.org/licenses/>.
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+# MA  02110-1301  USA.
 ###########################################################################
 use strict;
@@ -89,4 +91,22 @@
     
     return 1;
+}
+
+sub nonImplClass($)
+{
+    my $Class = $_[0];
+    
+    if(defined $In::Opt{"NonImplAll"}) {
+        return 1;
+    }
+    
+    if(defined $In::Opt{"NonImplClassesList"})
+    { # user defined classes
+        if(defined $In::Opt{"NonImplClasses"}{$Class->{"Name"}}) {
+            return 1;
+        }
+    }
+    
+    return 0;
 }
 
Index: trunk/tools/japicc/modules/Internals/Input.pm
===================================================================
--- trunk/tools/japicc/modules/Internals/Input.pm	(revision 13567)
+++ trunk/tools/japicc/modules/Internals/Input.pm	(revision 13595)
@@ -2,20 +2,22 @@
 # A module to handle input data
 #
-# Copyright (C) 2016 Andrey Ponomarenko's ABI Laboratory
+# Copyright (C) 2016-2018 Andrey Ponomarenko's ABI Laboratory
 #
 # Written by Andrey Ponomarenko
 #
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License or the GNU Lesser
-# General Public License as published by the Free Software Foundation.
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
 #
-# This program is distributed in the hope that it will be useful,
+# This library is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
 #
-# You should have received a copy of the GNU General Public License
-# and the GNU Lesser General Public License along with this program.
-# If not, see <http://www.gnu.org/licenses/>.
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+# MA  02110-1301  USA.
 ###########################################################################
 package In;
Index: trunk/tools/japicc/modules/Internals/Logging.pm
===================================================================
--- trunk/tools/japicc/modules/Internals/Logging.pm	(revision 13567)
+++ trunk/tools/japicc/modules/Internals/Logging.pm	(revision 13595)
@@ -2,20 +2,22 @@
 # A module for logging
 #
-# Copyright (C) 2016-2017 Andrey Ponomarenko's ABI Laboratory
+# Copyright (C) 2016-2018 Andrey Ponomarenko's ABI Laboratory
 #
 # Written by Andrey Ponomarenko
 #
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License or the GNU Lesser
-# General Public License as published by the Free Software Foundation.
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
 #
-# This program is distributed in the hope that it will be useful,
+# This library is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
 #
-# You should have received a copy of the GNU General Public License
-# and the GNU Lesser General Public License along with this program.
-# If not, see <http://www.gnu.org/licenses/>.
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+# MA  02110-1301  USA.
 ###########################################################################
 use strict;
@@ -47,4 +49,7 @@
     my ($Code, $Msg) = @_;
     print STDERR "ERROR: ". $Msg."\n";
+    if(my $Orig = $In::Opt{"OrigDir"}) {
+        chdir($Orig);
+    }
     exit($ERROR_CODE{$Code});
 }
Index: trunk/tools/japicc/modules/Internals/Mangling.pm
===================================================================
--- trunk/tools/japicc/modules/Internals/Mangling.pm	(revision 13567)
+++ trunk/tools/japicc/modules/Internals/Mangling.pm	(revision 13595)
@@ -2,20 +2,22 @@
 # A module to unmangle symbols
 #
-# Copyright (C) 2016 Andrey Ponomarenko's ABI Laboratory
+# Copyright (C) 2016-2018 Andrey Ponomarenko's ABI Laboratory
 #
 # Written by Andrey Ponomarenko
 #
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License or the GNU Lesser
-# General Public License as published by the Free Software Foundation.
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
 #
-# This program is distributed in the hope that it will be useful,
+# This library is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
 #
-# You should have received a copy of the GNU General Public License
-# and the GNU Lesser General Public License along with this program.
-# If not, see <http://www.gnu.org/licenses/>.
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+# MA  02110-1301  USA.
 ###########################################################################
 use strict;
@@ -66,7 +68,4 @@
                     $CurParam = "short";
                 }
-                elsif($Symbol eq "S") {
-                    $CurParam = "short";
-                }
                 elsif($Symbol eq "I") {
                     $CurParam = "int";
@@ -80,4 +79,7 @@
                 elsif($Symbol eq "D") {
                     $CurParam = "double";
+                }
+                elsif($Symbol eq "Z") {
+                    $CurParam = "boolean";
                 }
                 else {
Index: trunk/tools/japicc/modules/Internals/Path.pm
===================================================================
--- trunk/tools/japicc/modules/Internals/Path.pm	(revision 13567)
+++ trunk/tools/japicc/modules/Internals/Path.pm	(revision 13595)
@@ -2,20 +2,22 @@
 # A module with functions to handle paths
 #
-# Copyright (C) 2017 Andrey Ponomarenko's ABI Laboratory
+# Copyright (C) 2017-2018 Andrey Ponomarenko's ABI Laboratory
 #
 # Written by Andrey Ponomarenko
 #
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License or the GNU Lesser
-# General Public License as published by the Free Software Foundation.
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
 #
-# This program is distributed in the hope that it will be useful,
+# This library is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
 #
-# You should have received a copy of the GNU General Public License
-# and the GNU Lesser General Public License along with this program.
-# If not, see <http://www.gnu.org/licenses/>.
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+# MA  02110-1301  USA.
 ###########################################################################
 use strict;
Index: trunk/tools/japicc/modules/Internals/RegTests.pm
===================================================================
--- trunk/tools/japicc/modules/Internals/RegTests.pm	(revision 13567)
+++ trunk/tools/japicc/modules/Internals/RegTests.pm	(revision 13595)
@@ -2,20 +2,22 @@
 # A module with regression test suite
 #
-# Copyright (C) 2016-2017 Andrey Ponomarenko's ABI Laboratory
+# Copyright (C) 2016-2018 Andrey Ponomarenko's ABI Laboratory
 #
 # Written by Andrey Ponomarenko
 #
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License or the GNU Lesser
-# General Public License as published by the Free Software Foundation.
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
 #
-# This program is distributed in the hope that it will be useful,
+# This library is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
 #
-# You should have received a copy of the GNU General Public License
-# and the GNU Lesser General Public License along with this program.
-# If not, see <http://www.gnu.org/licenses/>.
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+# MA  02110-1301  USA.
 ###########################################################################
 use strict;
@@ -384,4 +386,26 @@
         }");
         
+        # Added vararg parameter
+        writeFile($Path_v1."/AddedVarargParam.java",
+        "package $PackageName;
+        public class AddedVarargParam {
+            public void method(Integer x, String... y) { }
+        }");
+        writeFile($Path_v2."/AddedVarargParam.java",
+        "package $PackageName;
+        public class AddedVarargParam {
+            public void method(Integer x, String... y) { }
+        }");
+        
+        writeFile($TestsPath."/Test_AddedVarargParam.java",
+        "import $PackageName.*;
+        public class Test_AddedVarargParam
+        {
+            public static void main(String[] args) {
+                AddedVarargParam X = new AddedVarargParam();
+                X.method(0);
+            }
+        }");
+        
         # Removed_Annotation
         writeFile($Path_v1."/RemovedAnnotation.java",
@@ -402,4 +426,59 @@
         }");
         
+        # Changed Annotation
+        writeFile($Path_v1."/ChangedAnnotation.java",
+        "package $PackageName;
+        
+        enum MyEnum {
+            SUNDAY, MONDAY
+        }
+        
+        public \@interface ChangedAnnotation {
+            String value();
+            String datatype() default \"Str\";
+            int num1() default 1;
+            String[] values() default {\"Alice\", \"Bob\", \"Cindy\"};
+            int[] nums() default {1, 2, 3};
+            String safe_change() default \"Str\";
+            MyEnum day() default MyEnum.SUNDAY;
+            short num2() default 1;
+            long num3() default 1;
+            byte num4() default 1;
+            float num5() default 1.5f;
+            double num6() default 1.5;
+            boolean bit() default true;
+            char ch() default 'A';
+        }");
+        
+        writeFile($Path_v2."/ChangedAnnotation.java",
+        "package $PackageName;
+        
+        enum MyEnum {
+            SUNDAY, MONDAY
+        }
+        
+        public \@interface ChangedAnnotation {
+            String value() default \"Str\";
+            String datatype();
+            int[] values();
+            int[] nums() default {1, 2};
+            int[] new_default_param() default {1, 2};
+            int[] new_param();
+            String[] safe_change() default {\"Str\"};
+            MyEnum day() default MyEnum.MONDAY;
+        }");
+        
+        writeFile($TestsPath."/Test_ChangedAnnotation.java",
+        "import $PackageName.*;
+        public class Test_ChangedAnnotation {
+            public static void main(String[] args) {
+                testMethod();
+            }
+            
+            \@ChangedAnnotation(value=\"Val\")
+            static void testMethod() {
+            }
+        }");
+        
         # Beta Annotation
         writeFile($Path_v1."/Beta.java",
@@ -752,12 +831,20 @@
     "package $PackageName;
     public class ChangedFinalFieldValue {
-        public final int field = 1;
+        enum MyEnum {
+            ONE, TWO
+        }
+        public final int    field1 = 1;
         public final String field2 = \" \";
+        public final MyEnum field3 = MyEnum.ONE;
     }");
     writeFile($Path_v2."/ChangedFinalFieldValue.java",
     "package $PackageName;
     public class ChangedFinalFieldValue {
-        public final int field = 2;
+        enum MyEnum {
+            ONE, TWO
+        }
+        public final int    field1 = 2;
         public final String field2 = \"newValue\";
+        public final MyEnum field3 = MyEnum.TWO;
     }");
     
@@ -1920,4 +2007,7 @@
         $Cmd .= " -old-style";
     }
+    if(my $JdkPath = $In::Opt{"JdkPath"}) {
+        $Cmd .= " -jdk-path \"$JdkPath\"";
+    }
     
     my $TmpDir = $In::Opt{"Tmp"};
Index: trunk/tools/japicc/modules/Internals/SysFiles.pm
===================================================================
--- trunk/tools/japicc/modules/Internals/SysFiles.pm	(revision 13567)
+++ trunk/tools/japicc/modules/Internals/SysFiles.pm	(revision 13595)
@@ -2,20 +2,22 @@
 # A module to find system files
 #
-# Copyright (C) 2016-2017 Andrey Ponomarenko's ABI Laboratory
+# Copyright (C) 2016-2018 Andrey Ponomarenko's ABI Laboratory
 #
 # Written by Andrey Ponomarenko
 #
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License or the GNU Lesser
-# General Public License as published by the Free Software Foundation.
-#
-# This program is distributed in the hope that it will be useful,
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# and the GNU Lesser General Public License along with this program.
-# If not, see <http://www.gnu.org/licenses/>.
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+# MA  02110-1301  USA.
 ###########################################################################
 use strict;
@@ -225,3 +227,30 @@
 }
 
+sub getArchivePaths($$)
+{
+    my ($Dest, $LVer) = @_;
+    if(-f $Dest) {
+        return ($Dest);
+    }
+    elsif(-d $Dest)
+    {
+        $Dest=~s/[\/\\]+\Z//g;
+        next if(not $Dest);
+        
+        my @Archives = ();
+        foreach my $Path (cmdFind($Dest, "", "*\\.jar"))
+        {
+            next if(ignorePath($Path, $Dest));
+            push(@Archives, realpath_F($Path));
+        }
+        foreach my $Path (cmdFind($Dest, "", "*\\.jmod"))
+        {
+            next if(ignorePath($Path, $Dest));
+            push(@Archives, realpath_F($Path));
+        }
+        return @Archives;
+    }
+    return ();
+}
+
 return 1;
Index: trunk/tools/japicc/modules/Internals/TypeAttr.pm
===================================================================
--- trunk/tools/japicc/modules/Internals/TypeAttr.pm	(revision 13567)
+++ trunk/tools/japicc/modules/Internals/TypeAttr.pm	(revision 13595)
@@ -2,20 +2,22 @@
 # A module to handle type attributes
 #
-# Copyright (C) 2016 Andrey Ponomarenko's ABI Laboratory
+# Copyright (C) 2016-2018 Andrey Ponomarenko's ABI Laboratory
 #
 # Written by Andrey Ponomarenko
 #
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License or the GNU Lesser
-# General Public License as published by the Free Software Foundation.
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
 #
-# This program is distributed in the hope that it will be useful,
+# This library is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
 #
-# You should have received a copy of the GNU General Public License
-# and the GNU Lesser General Public License along with this program.
-# If not, see <http://www.gnu.org/licenses/>.
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+# MA  02110-1301  USA.
 ###########################################################################
 use strict;
Index: trunk/tools/japicc/modules/Internals/Utils.pm
===================================================================
--- trunk/tools/japicc/modules/Internals/Utils.pm	(revision 13567)
+++ trunk/tools/japicc/modules/Internals/Utils.pm	(revision 13595)
@@ -2,20 +2,22 @@
 # A module with basic functions
 #
-# Copyright (C) 2016-2017 Andrey Ponomarenko's ABI Laboratory
+# Copyright (C) 2016-2018 Andrey Ponomarenko's ABI Laboratory
 #
 # Written by Andrey Ponomarenko
 #
-# This program is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License or the GNU Lesser
-# General Public License as published by the Free Software Foundation.
-#
-# This program is distributed in the hope that it will be useful,
+# This library is free software; you can redistribute it and/or
+# modify it under the terms of the GNU Lesser General Public
+# License as published by the Free Software Foundation; either
+# version 2.1 of the License, or (at your option) any later version.
+#
+# This library is distributed in the hope that it will be useful,
 # but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# and the GNU Lesser General Public License along with this program.
-# If not, see <http://www.gnu.org/licenses/>.
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+# Lesser General Public License for more details.
+#
+# You should have received a copy of the GNU Lesser General Public
+# License along with this library; if not, write to the Free Software
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+# MA  02110-1301  USA.
 ###########################################################################
 use strict;
@@ -189,4 +191,7 @@
             push(@AbsPaths, $Path);
         }
+        
+        @AbsPaths = sort(@AbsPaths);
+        
         return @AbsPaths;
     }
@@ -223,4 +228,7 @@
             @Files = grep { /$Name/ } @Files;
         }
+        
+        @Files = sort(@Files);
+        
         return @Files;
     }
Index: trunk/tools/japicc/modules/RulesBin.xml
===================================================================
--- trunk/tools/japicc/modules/RulesBin.xml	(revision 13567)
+++ trunk/tools/japicc/modules/RulesBin.xml	(revision 13595)
@@ -491,4 +491,22 @@
     <effect>
         A client program may be interrupted by **AbstractMethodError** exception. Added abstract method is called in 2nd library version by the method @invoked_by and may not be implemented by old clients.
+    </effect>
+</rule>
+
+<rule>
+    <id>
+        NonImpl_Interface_Added_Abstract_Method
+    </id>
+    <severity>
+        Safe
+    </severity>
+    <kind>
+        Types
+    </kind>
+    <change>
+        Abstract method @target has been added to this interface.
+    </change>
+    <effect>
+        No effect.
     </effect>
 </rule>
@@ -1363,3 +1381,165 @@
 </rule>
 
+<rule>
+    <id>
+        Added_Annotation_Default_Element
+    </id>
+    <severity>
+        Safe
+    </severity>
+    <kind>
+        Types
+    </kind>
+    <change>
+        Element @target of type @elem_type with default value @new_value has been added to this annotation type.
+    </change>
+    <effect>
+        No effect.
+    </effect>
+</rule>
+
+<rule>
+    <id>
+        Added_Annotation_NonDefault_Element
+    </id>
+    <severity>
+        Safe
+    </severity>
+    <kind>
+        Types
+    </kind>
+    <change>
+        Element @target of type @elem_type without a default value has been added to this annotation type.
+    </change>
+    <effect>
+        No effect.
+    </effect>
+</rule>
+
+<rule>
+    <id>
+        Removed_Annotation_Default_Element
+    </id>
+    <severity>
+        Safe
+    </severity>
+    <kind>
+        Types
+    </kind>
+    <change>
+        Element @target of type @elem_type with default value @old_value has been removed from this annotation type.
+    </change>
+    <effect>
+        No effect.
+    </effect>
+</rule>
+
+<rule>
+    <id>
+        Removed_Annotation_NonDefault_Element
+    </id>
+    <severity>
+        Safe
+    </severity>
+    <kind>
+        Types
+    </kind>
+    <change>
+        Element @target of type @elem_type without a default value has been removed from this annotation type.
+    </change>
+    <effect>
+        No effect.
+    </effect>
+</rule>
+
+<rule>
+    <id>
+        Annotation_Element_Changed_Default_Value
+    </id>
+    <severity>
+        Safe
+    </severity>
+    <kind>
+        Types
+    </kind>
+    <change>
+        Changed default value of the element @target from @old_value to @new_value in this annotation type.
+    </change>
+    <effect>
+        No effect.
+    </effect>
+</rule>
+
+<rule>
+    <id>
+        Annotation_Element_Removed_Default_Value
+    </id>
+    <severity>
+        Safe
+    </severity>
+    <kind>
+        Types
+    </kind>
+    <change>
+        Removed default value @old_value from the element @target of this annotation type.
+    </change>
+    <effect>
+        No effect.
+    </effect>
+</rule>
+
+<rule>
+    <id>
+        Annotation_Element_Added_Default_Value
+    </id>
+    <severity>
+        Safe
+    </severity>
+    <kind>
+        Types
+    </kind>
+    <change>
+        Added default value @new_value for the element @target of this annotation type.
+    </change>
+    <effect>
+        No effect.
+    </effect>
+</rule>
+
+<rule>
+    <id>
+        Annotation_Element_Changed_Type
+    </id>
+    <severity>
+        Safe
+    </severity>
+    <kind>
+        Types
+    </kind>
+    <change>
+        Changed type of the element @target from @old_value to @new_value in this annotation type.
+    </change>
+    <effect>
+        No effect.
+    </effect>
+</rule>
+
+<rule>
+    <id>
+        Annotation_Element_Changed_Type_Safe
+    </id>
+    <severity>
+        Safe
+    </severity>
+    <kind>
+        Types
+    </kind>
+    <change>
+        Changed type of the element @target from @old_value to @new_value in this annotation type.
+    </change>
+    <effect>
+        No effect.
+    </effect>
+</rule>
+
 </rules>
Index: trunk/tools/japicc/modules/RulesSrc.xml
===================================================================
--- trunk/tools/japicc/modules/RulesSrc.xml	(revision 13567)
+++ trunk/tools/japicc/modules/RulesSrc.xml	(revision 13595)
@@ -442,4 +442,22 @@
 <rule>
     <id>
+        NonImpl_Interface_Added_Abstract_Method
+    </id>
+    <severity>
+        Safe
+    </severity>
+    <kind>
+        Types
+    </kind>
+    <change>
+        Abstract method @target has been added to this interface.
+    </change>
+    <effect>
+        No effect. This interface is not meant to be implemented by users.
+    </effect>
+</rule>
+
+<rule>
+    <id>
         Class_Method_Became_Abstract
     </id>
@@ -1269,3 +1287,165 @@
 </rule>
 
+<rule>
+    <id>
+        Added_Annotation_Default_Element
+    </id>
+    <severity>
+        Safe
+    </severity>
+    <kind>
+        Types
+    </kind>
+    <change>
+        Element @target of type @elem_type with default value @new_value has been added to this annotation type.
+    </change>
+    <effect>
+        No effect.
+    </effect>
+</rule>
+
+<rule>
+    <id>
+        Added_Annotation_NonDefault_Element
+    </id>
+    <severity>
+        High
+    </severity>
+    <kind>
+        Types
+    </kind>
+    <change>
+        Element @target of type @elem_type without a default value has been added to this annotation type.
+    </change>
+    <effect>
+        Recompilation of a client program may be terminated with the error message: annotation **@**@type_name is missing a default value for the element '@target'
+    </effect>
+</rule>
+
+<rule>
+    <id>
+        Removed_Annotation_Default_Element
+    </id>
+    <severity>
+        Medium
+    </severity>
+    <kind>
+        Types
+    </kind>
+    <change>
+        Element @target of type @elem_type with default value @old_value has been removed from this annotation type.
+    </change>
+    <effect>
+        Recompilation of a client program may be terminated with the error message: cannot find symbol **@**@type_name(@target=VAL)
+    </effect>
+</rule>
+
+<rule>
+    <id>
+        Removed_Annotation_NonDefault_Element
+    </id>
+    <severity>
+        High
+    </severity>
+    <kind>
+        Types
+    </kind>
+    <change>
+        Element @target of type @elem_type without a default value has been removed from this annotation type.
+    </change>
+    <effect>
+        Recompilation of a client program may be terminated with the error message: cannot find symbol **@**@type_name(@target=VAL)
+    </effect>
+</rule>
+
+<rule>
+    <id>
+        Annotation_Element_Changed_Default_Value
+    </id>
+    <severity>
+        Safe
+    </severity>
+    <kind>
+        Types
+    </kind>
+    <change>
+        Changed default value of the element @target from @old_value to @new_value in this annotation type.
+    </change>
+    <effect>
+        No effect.
+    </effect>
+</rule>
+
+<rule>
+    <id>
+        Annotation_Element_Removed_Default_Value
+    </id>
+    <severity>
+        Medium
+    </severity>
+    <kind>
+        Types
+    </kind>
+    <change>
+        Removed default value @old_value from the element @target of this annotation type.
+    </change>
+    <effect>
+        Recompilation of a client program may be terminated with the error message: annotation **@**@type_name is missing a default value for the element '@target'
+    </effect>
+</rule>
+
+<rule>
+    <id>
+        Annotation_Element_Added_Default_Value
+    </id>
+    <severity>
+        Safe
+    </severity>
+    <kind>
+        Types
+    </kind>
+    <change>
+        Added default value @new_value for the element @target of this annotation type.
+    </change>
+    <effect>
+        No effect.
+    </effect>
+</rule>
+
+<rule>
+    <id>
+        Annotation_Element_Changed_Type
+    </id>
+    <severity>
+        Medium
+    </severity>
+    <kind>
+        Types
+    </kind>
+    <change>
+        Changed type of the element @target from @old_value to @new_value in this annotation type.
+    </change>
+    <effect>
+        Recompilation of a client program may be terminated with the error message: incompatible types: @old_value cannot be converted to @new_value or annotation value not of an allowable type
+    </effect>
+</rule>
+
+<rule>
+    <id>
+        Annotation_Element_Changed_Type_Safe
+    </id>
+    <severity>
+        Safe
+    </severity>
+    <kind>
+        Types
+    </kind>
+    <change>
+        Changed type of the element @target from @old_value to @new_value in this annotation type.
+    </change>
+    <effect>
+        No effect.
+    </effect>
+</rule>
+
 </rules>
Index: trunk/tools/pmd/josm-ruleset.xml
===================================================================
--- trunk/tools/pmd/josm-ruleset.xml	(revision 13567)
+++ trunk/tools/pmd/josm-ruleset.xml	(revision 13595)
@@ -50,4 +50,5 @@
     <exclude name="CommentDefaultAccessModifier"/>
     <exclude name="ConfusingTernary"/>
+    <exclude name="ControlStatementBraces"/>
     <exclude name="DefaultPackage"/>
     <exclude name="EmptyMethodInAbstractClassShouldBeAbstract"/>
