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

Ivan Prisiazhnyy (JIRA) jira-events at lists.jboss.org
Thu Jun 10 08:06:38 EDT 2010


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

Ivan Prisiazhnyy updated JASSIST-123:
-------------------------------------

    Description: 
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);
+                     }
                  }
              }
          }



  was:
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-06-10 14:38:03.000000000 +0300
***************
*** 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);
-                     }
                  }
              }
          }
--- 429,434 ----




> 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
>
> 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