コード例 #1
0
 private void AddClassFile(ZipEntry zipEntry, string filename, byte[] buf, bool addResourceFallback, string jar)
 {
     try
     {
         string name = ClassFile.GetClassName(buf, 0, buf.Length);
         if (classes.ContainsKey(name))
         {
             StaticCompiler.IssueMessage(Message.DuplicateClassName, name);
         }
         else
         {
             classes.Add(name, buf);
         }
     }
     catch (ClassFormatError x)
     {
         if (addResourceFallback)
         {
             // not a class file, so we include it as a resource
             // (IBM's db2os390/sqlj jars apparantly contain such files)
             StaticCompiler.IssueMessage(Message.NotAClassFile, filename, x.Message);
             AddResource(zipEntry, filename, buf, jar);
         }
         else
         {
             StaticCompiler.IssueMessage(Message.ClassFormatError, filename, x.Message);
         }
     }
 }