Examples of IClassFileReader


Examples of org.aspectj.org.eclipse.jdt.core.util.IClassFileReader

      if (org.aspectj.org.eclipse.jdt.internal.compiler.util.Util.isArchiveFileName(this.file)) {
        ZipFile jarFile = new ZipFile(this.file);
        for (Enumeration entries = jarFile.entries(); !hasDebugAttributes && entries.hasMoreElements(); ) {
          ZipEntry entry = (ZipEntry) entries.nextElement();
          if (org.aspectj.org.eclipse.jdt.internal.compiler.util.Util.isClassFileName(entry.getName())) {
            IClassFileReader classFileReader = ToolFactory.createDefaultClassFileReader(this.file, entry.getName(), IClassFileReader.ALL);
            hasDebugAttributes = checkClassFile(classFileReader);
          }
        }
      } else if (org.aspectj.org.eclipse.jdt.internal.compiler.util.Util.isClassFileName(this.file)) {
        IClassFileReader classFileReader = ToolFactory.createDefaultClassFileReader(this.file, IClassFileReader.ALL);
        hasDebugAttributes = checkClassFile(classFileReader);
      } else {
        throw new BuildException(AntAdapterMessages.getString("checkDebugAttributes.file.argument.must.be.a.classfile.or.a.jarfile")); //$NON-NLS-1$
      }
      if (hasDebugAttributes) {
View Full Code Here

Examples of org.aspectj.org.eclipse.jdt.core.util.IClassFileReader

    IBuffer classFileBuffer = this.classFile.getBuffer();
    if (classFileBuffer != null) {
      buffer.setContents(classFileBuffer.getCharacters());
    } else {
      // Disassemble
      IClassFileReader reader = ToolFactory.createDefaultClassFileReader(this.classFile, IClassFileReader.ALL);
      Disassembler disassembler = new Disassembler();
      String contents = disassembler.disassemble(reader, Util.getLineSeparator("", getJavaProject()), ClassFileBytesDisassembler.WORKING_COPY); //$NON-NLS-1$
      buffer.setContents(contents);
    }
  }
View Full Code Here

Examples of org.eclipse.jdt.core.util.IClassFileReader

    IBuffer classFileBuffer = this.classFile.getBuffer();
    if (classFileBuffer != null) {
      buffer.setContents(classFileBuffer.getCharacters());
    } else {
      // Disassemble
      IClassFileReader reader = ToolFactory.createDefaultClassFileReader(this.classFile, IClassFileReader.ALL);
      Disassembler disassembler = new Disassembler();
      String contents = disassembler.disassemble(reader, Util.getLineSeparator("", getJavaProject()), ClassFileBytesDisassembler.WORKING_COPY); //$NON-NLS-1$
      buffer.setContents(contents);
    }
  }
View Full Code Here

Examples of org.eclipse.jdt.core.util.IClassFileReader

  IBuffer classFileBuffer = this.classFile.getBuffer();
  if (classFileBuffer != null) {
    buffer.setContents(classFileBuffer.getCharacters());
  } else {
    // Disassemble
    IClassFileReader reader = ToolFactory.createDefaultClassFileReader(this.classFile, IClassFileReader.ALL);
    Disassembler disassembler = new Disassembler();
    String contents = disassembler.disassemble(reader, Util.getLineSeparator("", getJavaProject()), ClassFileBytesDisassembler.WORKING_COPY); //$NON-NLS-1$
    buffer.setContents(contents);
  }
View Full Code Here

Examples of org.eclipse.jdt.core.util.IClassFileReader

  private void readVersion() throws IOException {
    Map<String, byte[]> idoc3Contents = new HashMap<String, byte[]>();
    readJARFile(sapidoc3jar, idoc3Contents);
    byte[] jco3IdocContents = idoc3Contents.get(JCOIDOC_CLASSFILE_ENTRY);
    ByteArrayInputStream bais = new ByteArrayInputStream(jco3IdocContents);
    IClassFileReader classfileReader = ToolFactory.createDefaultClassFileReader(bais, IClassFileReader.ALL);
    IFieldInfo[] fieldInfos = classfileReader.getFieldInfos();
    for (int i = 0; i < fieldInfos.length; i++) {
      if (Arrays.equals(fieldInfos[i].getName(), VERSION_NAME)) {
        IConstantValueAttribute constantValueAttribute = fieldInfos[i].getConstantValueAttribute();
        if (constantValueAttribute != null) {
          IConstantPoolEntry constantPoolEntry = constantValueAttribute.getConstantValue();
View Full Code Here

Examples of org.eclipse.jdt.core.util.IClassFileReader

      throw new BuildException(AntAdapterMessages.getString("checkDebugAttributes.property.argument.cannot.be.null")); //$NON-NLS-1$
    }
    try {
      boolean hasDebugAttributes = false;
      if (org.eclipse.jdt.internal.compiler.util.Util.isClassFileName(this.file)) {
        IClassFileReader classFileReader = ToolFactory.createDefaultClassFileReader(this.file, IClassFileReader.ALL);
        hasDebugAttributes = checkClassFile(classFileReader);
      } else {
        ZipFile jarFile = null;
        try {
          jarFile = new ZipFile(this.file);
        } catch (ZipException e) {
          throw new BuildException(AntAdapterMessages.getString("checkDebugAttributes.file.argument.must.be.a.classfile.or.a.jarfile")); //$NON-NLS-1$
        }
        for (Enumeration entries = jarFile.entries(); !hasDebugAttributes && entries.hasMoreElements(); ) {
          ZipEntry entry = (ZipEntry) entries.nextElement();
          if (org.eclipse.jdt.internal.compiler.util.Util.isClassFileName(entry.getName())) {
            IClassFileReader classFileReader = ToolFactory.createDefaultClassFileReader(this.file, entry.getName(), IClassFileReader.ALL);
            hasDebugAttributes = checkClassFile(classFileReader);
          }
        }
      }
      if (hasDebugAttributes) {
View Full Code Here

Examples of org.eclipse.jdt.core.util.IClassFileReader

      throw new BuildException(AntAdapterMessages.getString("checkDebugAttributes.property.argument.cannot.be.null")); //$NON-NLS-1$
    }
    try {
      boolean hasDebugAttributes = false;
      if (org.eclipse.jdt.internal.compiler.util.Util.isClassFileName(this.file)) {
        IClassFileReader classFileReader = ToolFactory.createDefaultClassFileReader(this.file, IClassFileReader.ALL);
        hasDebugAttributes = checkClassFile(classFileReader);
      } else {
        ZipFile jarFile = null;
        try {
          jarFile = new ZipFile(this.file);
        } catch (ZipException e) {
          throw new BuildException(AntAdapterMessages.getString("checkDebugAttributes.file.argument.must.be.a.classfile.or.a.jarfile")); //$NON-NLS-1$
        }
        for (Enumeration entries = jarFile.entries(); !hasDebugAttributes && entries.hasMoreElements(); ) {
          ZipEntry entry = (ZipEntry) entries.nextElement();
          if (org.eclipse.jdt.internal.compiler.util.Util.isClassFileName(entry.getName())) {
            IClassFileReader classFileReader = ToolFactory.createDefaultClassFileReader(this.file, entry.getName(), IClassFileReader.ALL);
            hasDebugAttributes = checkClassFile(classFileReader);
          }
        }
      }
      if (hasDebugAttributes) {
View Full Code Here

Examples of org.eclipse.jdt.core.util.IClassFileReader

          if (CLASS_FILE_EXTENSION.equals(resource.getFullPath()
              .getFileExtension())) {
            IPath localLocation = resource.getLocation();
            if (localLocation != null) {
              String path = localLocation.toOSString();
              IClassFileReader reader = ToolFactory
                  .createDefaultClassFileReader(
                      path,
                      IClassFileReader.CLASSFILE_ATTRIBUTES);
              if (reader != null) {
                // this name is slash-delimited
                String qualifiedName = new String(
                    reader.getClassName());
                boolean hasBlockingErrors = false;
                try {
                  if (!Platform.getPreferencesService().getBoolean(
                      JDIDebugPlugin.getUniqueIdentifier(),
                      JDIDebugModel.PREF_HCR_WITH_COMPILATION_ERRORS,
                      true,
                      null)) {
                    // If the user doesn't want to replace
                    // classfiles containing
                    // compilation errors, get the source
                    // file associated with
                    // the class file and query it for
                    // compilation errors
                    IJavaProject pro = JavaCore
                        .create(resource.getProject());
                    ISourceAttribute sourceAttribute = reader
                        .getSourceFileAttribute();
                    String sourceName = null;
                    if (sourceAttribute != null) {
                      sourceName = new String(
                          sourceAttribute
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.