Package org.aspectj.org.eclipse.jdt.internal.core

Examples of org.aspectj.org.eclipse.jdt.internal.core.BinaryType


  }
  // Current type reference is not parameterized. So, it is the last type argument
  return (((long) depth) << 32) + lastTypeArgument.sourceEnd;
}
protected IBinaryType getBinaryInfo(ClassFile classFile, IResource resource) throws CoreException {
  BinaryType binaryType = (BinaryType) classFile.getType();
  if (classFile.isOpen())
    return (IBinaryType) binaryType.getElementInfo(); // reuse the info from the java model cache

  // create a temporary info
  IBinaryType info;
  try {
    PackageFragment pkg = (PackageFragment) classFile.getParent();
    PackageFragmentRoot root = (PackageFragmentRoot) pkg.getParent();
    if (root.isArchive()) {
      // class file in a jar
      String classFileName = classFile.getElementName();
      String classFilePath = Util.concatWith(pkg.names, classFileName, '/');
      ZipFile zipFile = null;
      try {
        zipFile = ((JarPackageFragmentRoot) root).getJar();
        info = ClassFileReader.read(zipFile, classFilePath);
      } finally {
        JavaModelManager.getJavaModelManager().closeZipFile(zipFile);
      }
    } else {
      // class file in a directory
      info = Util.newClassFileReader(resource);
    }
    if (info == null) throw binaryType.newNotPresentException();
    return info;
  } catch (ClassFormatException e) {
    //e.printStackTrace();
    return null;
  } catch (java.io.IOException e) {
View Full Code Here


}
protected void reportBinaryMemberDeclaration(IResource resource, IMember binaryMember, Binding binaryMemberBinding, IBinaryType info, int accuracy) throws CoreException {
  ClassFile classFile = (ClassFile) binaryMember.getClassFile();
  ISourceRange range = classFile.isOpen() ? binaryMember.getNameRange() : SourceMapper.UNKNOWN_RANGE;
  if (range.getOffset() == -1) {
    BinaryType type = (BinaryType) classFile.getType();
    String sourceFileName = type.sourceFileName(info);
    if (sourceFileName != null) {
      SourceMapper mapper = classFile.getSourceMapper();
      if (mapper != null) {
        char[] contents = mapper.findSource(type, sourceFileName);
        if (contents != null)
View Full Code Here

TOP

Related Classes of org.aspectj.org.eclipse.jdt.internal.core.BinaryType

Copyright © 2018 www.massapicom. 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.