Examples of ClassFileReader


Examples of com.cuubez.visualizer.scanner.reader.ClassFileReader

                throw new IOException("Unable to understand protocol: " + url.getProtocol());
            }

            File f = new File(url.getPath());
            if (f.isDirectory()) {
                return new ClassFileReader(f, filter);
            } else {
                return new JarFileReader(url.openStream(), filter);
            }
        }
    }
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader

          fullSourcePath, this.encoding, destinationPath),
          fetchAccessRestriction(qualifiedBinaryFileName));
  }
  if (binaryExists) {
    try {
      ClassFileReader reader = ClassFileReader.read(this.path + qualifiedBinaryFileName);
      if (reader != null)
        return new NameEnvironmentAnswer(
            reader,
            fetchAccessRestriction(qualifiedBinaryFileName));
    } catch (Exception e) {
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader

  VariablesInfo installedVars = this.context.installedVars;
  ClassFile[] classFiles = installedVars.classFiles;
  for (int i = 0; i < classFiles.length; i++) {
    ClassFile classFile = classFiles[i];
    if (CharOperation.equals(compoundTypeName, classFile.getCompoundName())) {
      ClassFileReader binary = null;
      try {
        binary = new ClassFileReader(classFile.getBytes(), null);
      } catch (ClassFormatException e) {
        e.printStackTrace()// Should never happen since we compiled this type
        return null;
      }
      return new NameEnvironmentAnswer(binary, null /*no access restriction*/);
 
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader

  if (!isPackage(qualifiedPackageName))
    return null; // most common case

  try {
      ensureOpen(); // AspectJ Extension
    ClassFileReader reader = ClassFileReader.read(this.zipFile, qualifiedBinaryFileName);
    if (reader != null)
      return new NameEnvironmentAnswer(reader, fetchAccessRestriction(qualifiedBinaryFileName));
  } catch(ClassFormatException e) {
    // treat as if class file is missing
  } catch (IOException e) {
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader

    ClassFile[] classFiles = installedVars.classFiles;
    for (int i = 0; i < classFiles.length; i++) {
      ClassFile classFile = classFiles[i];
      IBinaryType binary = null;
      try {
        binary = new ClassFileReader(classFile.getBytes(), null);
      } catch (ClassFormatException e) {
        e.printStackTrace(); // Should never happen since we compiled this type
      }
      engine.lookupEnvironment.cacheBinaryType(binary, null /*no access restriction*/);
    }
 
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader

        return null;

      try {
        // System.out.println("from cache: " + name);
        byte[] bytes = FileUtil.readAsByteArray(fileOnDisk);
        NameEnvironmentAnswer ret = new NameEnvironmentAnswer(new ClassFileReader(bytes, fileOnDisk.getAbsolutePath()
            .toCharArray()), null /* no access restriction */);
        this.inflatedClassFilesCache.put(name, ret);
        return ret;
      } catch (ClassFormatException e) {
        return null; // !!! seems to match FileSystem behavior
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader

      return null;
    } else {
      IBinaryType binType = answer.getBinaryType();
      // XXX - but better than the alternative hacks
      if (binType instanceof ClassFileReader) {
        ClassFileReader cfr = (ClassFileReader) binType;
        cf = new ClassFileReaderBackedClassFile(cfr);
      } else {
        throw new IllegalArgumentException(
            "I'm only geared up to handle ClassFileReaders, and you gave me a " +
            binType.getClass().getName());
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader

    ClassFile[] classFiles = installedVars.classFiles;
    for (int i = 0; i < classFiles.length; i++) {
      ClassFile classFile = classFiles[i];
      IBinaryType binary = null;
      try {
        binary = new ClassFileReader(classFile.getBytes(), null);
      } catch (ClassFormatException e) {
        e.printStackTrace(); // Should never happen since we compiled this type
      }
      compiler.lookupEnvironment.cacheBinaryType(binary, null /*no access restriction*/);
    }
 
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader

    char[] className = (char[]) classNames.get(theFile);
    if (className == null) {
      // if (listenerDefined())
      // getListener().recordDecision("Cache miss, looking up classname for : " + fpath);

      ClassFileReader cfr;
      try {
        cfr = ClassFileReader.read(file);
      } catch (ClassFormatException e) {
        return true;
      } catch (IOException e) {
        return true;
      }
      className = cfr.getName();
      classNames.put(theFile, className);
      // } else {
      // if (listenerDefined())
      // getListener().recordDecision("Cache hit, looking up classname for : " + fpath);
    }
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.internal.compiler.classfmt.ClassFileReader

      // this records a second reference to a structure already held in memory
      // by the world.
      ResolvedType rType = world.resolve(thisTime.getClassName());
      if (!rType.isMissing()) {
        try {
          ClassFileReader reader = new ClassFileReader(thisTime.getBytes(), null);
          this.resolvedTypeStructuresFromLastBuild.put(thisTime.getClassName(), new CompactTypeStructureRepresentation(
              reader));
        } catch (ClassFormatException cfe) {
          throw new BCException("Unexpected problem processing class", cfe);
        }
      }
      return;
    }

    CompactTypeStructureRepresentation existingStructure = this.resolvedTypeStructuresFromLastBuild
        .get(thisTime.getClassName());
    ResolvedType newResolvedType = world.resolve(thisTime.getClassName());
    if (!newResolvedType.isMissing()) {
      try {
        ClassFileReader reader = new ClassFileReader(thisTime.getBytes(), null);
        this.resolvedTypeStructuresFromLastBuild.put(thisTime.getClassName(),
            new CompactTypeStructureRepresentation(reader));
      } catch (ClassFormatException cfe) {
        throw new BCException("Unexpected problem processing class", cfe);
      }
    }

    if (lastTime == null) {
      recordTypeChanged(thisTime.getClassName());
      return;
    }

    if (newResolvedType.isMissing()) {
      return;
    }
    world.ensureAdvancedConfigurationProcessed();
    byte[] newBytes = thisTime.getBytes();
    try {
      ClassFileReader reader = new ClassFileReader(newBytes, lastTime.getAbsolutePath().toCharArray());
      // ignore local types since they're only visible inside a single method
      if (!(reader.isLocal() || reader.isAnonymous())) {
        if (hasStructuralChanges(reader, existingStructure)) {
          if (world.forDEBUG_structuralChangesCode) {
            System.err.println("Detected a structural change in " + thisTime.getFilename());
          }
          structuralChangesSinceLastFullBuild.put(thisTime.getFilename(), new Long(currentBuildTime));
          recordTypeChanged(new String(reader.getName()).replace('/', '.'));
        }
      }
    } catch (ClassFormatException e) {
      recordTypeChanged(thisTime.getClassName());
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.