[jboss-jira] [JBoss JIRA] Resolved: (JASSIST-123) Explicit class import support for compiler (not whole packages)

Shigeru Chiba (JIRA) jira-events at lists.jboss.org
Tue Oct 5 06:21:39 EDT 2010


     [ https://jira.jboss.org/browse/JASSIST-123?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Shigeru Chiba resolved JASSIST-123.
-----------------------------------

    Fix Version/s: 3.14.0.GA
       Resolution: Done


The submitted patch has a minor bug.

> Explicit class import support for compiler (not whole packages)
> ---------------------------------------------------------------
>
>                 Key: JASSIST-123
>                 URL: https://jira.jboss.org/browse/JASSIST-123
>             Project: Javassist
>          Issue Type: Patch
>            Reporter: Ivan Prisiazhnyy
>            Assignee: Shigeru Chiba
>             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 contact one of the administrators: https://jira.jboss.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        


More information about the jboss-jira mailing list