Explicit class import support for compiler (not whole packages)
---------------------------------------------------------------
Key: JASSIST-123
URL:
https://issues.jboss.org/browse/JASSIST-123
Project: Javassist
Issue Type: Patch
Reporter: Ivan Prisiazhnyy
Assignee: Shigeru Chiba
Labels: compiler, import
Fix For: 3.14.0.GA
This is patch for MemberResolver class for Javassist 3.12.GA
It adds support for compiler to understand importing of certain classes in packages, not
the whole packages.
With this patch the following code will do its job:
ClassPool x = ClassPool.getDefault();
x.importPackage("java.io.File");
Patch it self:
*** MemberResolver.java 2010-04-04 02:21:30.000000000 +0300
--- MemberResolver.java 2010-06-10 14:38:03.000000000 +0300
***************
*** 429,434 ****
--- 429,445 ----
}
catch (NotFoundException e) {
classPool.recordInvalidClassName(fqName);
+
+ try {
+ if (pac.endsWith(orgName)) {
+ CtClass cc = classPool.get(pac);
+ // if the class is found,
+ classPool.recordInvalidClassName(orgName);
+ return cc;
+ }
+ } catch (NotFoundException ee) {
+ classPool.recordInvalidClassName(pac);
+ }
}
}
}
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: