You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@beehive.apache.org by "C Brett Bennett (JIRA)" <be...@incubator.apache.org> on 2005/04/09 03:34:16 UTC

[jira] Created: (BEEHIVE-511) Apt hangs when processing sources with errors

Apt hangs when processing sources with errors
---------------------------------------------

         Key: BEEHIVE-511
         URL: http://issues.apache.org/jira/browse/BEEHIVE-511
     Project: Beehive
        Type: Bug
  Components: Build  
    Versions: V1    
    Reporter: C Brett Bennett
    Priority: Critical


 Apt'hangs' under the following circumstance. 

When processing a @Control field, if it is a control-bean reference, e.g.
	@Control SomeBean _bean;
field where SomeBean is generated from a Some.jcx file, but at the time the _bean field is being processed the SomeBean class has not been generated or more specifically in the javac class table, then the loop in the ControlClientAnnotationProcessor:
------------------------------------------

	ClassType classType = (ClassType)fieldType;

	outer: while ( classType != null )
	{
		Collection<InterfaceType> intfs =classType.getSuperinterfaces();
		for ( InterfaceType intfType : intfs )
		{
			if ( intfType.getDeclaration().getQualifiedName().equals( "org.apache.beehive.controls.api.bean.ControlBean" ) )
                     {
                         foundControlBean = true;
                         break outer;
                     }
		}
                 classType = classType.getSuperclass();
	}

--------------------------------------------
Will never end because the original fieldType (SomeBean) is an error-type that returns an error-type when getSuperClass() is called.

The following suffices to break the loop:
--------------------------------------------
             ClassType classType = (ClassType)fieldType;

             outer: while ( classType != null )
             {
                 Collection<InterfaceType> intfs = classType.getSuperinterfaces();
                 for ( InterfaceType intfType : intfs )
                 {
                     if ( intfType.getDeclaration().getQualifiedName().equals( "org.apache.beehive.controls.api.bean.ControlBean" ) )
                     {
                         foundControlBean = true;
                         break outer;
                     }
                 }
                 ClassType superType = classType.getSuperclass();
                 if(superType != null && superType.equals(classType))
                 {
                     break;
                 }
                 classType = superType;
             }



-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Closed: (BEEHIVE-511) Apt hangs when processing sources with errors

Posted by "Julie Zhuo (JIRA)" <be...@incubator.apache.org>.
     [ http://issues.apache.org/jira/browse/BEEHIVE-511?page=all ]
     
Julie Zhuo closed BEEHIVE-511:
------------------------------


Verified fixed with the m1rc2 distribution. It now compiles 
@control HelloControlBean _hello successfully when the control type is defined by HelloControl.jcx rather HelloControl.java.

> Apt hangs when processing sources with errors
> ---------------------------------------------
>
>          Key: BEEHIVE-511
>          URL: http://issues.apache.org/jira/browse/BEEHIVE-511
>      Project: Beehive
>         Type: Bug
>   Components: Build
>     Versions: V1
>     Reporter: C Brett Bennett
>     Assignee: Julie Zhuo
>     Priority: Critical
>      Fix For: V1

>
>  Apt'hangs' under the following circumstance. 
> When processing a @Control field, if it is a control-bean reference, e.g.
> 	@Control SomeBean _bean;
> field where SomeBean is generated from a Some.jcx file, but at the time the _bean field is being processed the SomeBean class has not been generated or more specifically in the javac class table, then the loop in the ControlClientAnnotationProcessor:
> ------------------------------------------
> 	ClassType classType = (ClassType)fieldType;
> 	outer: while ( classType != null )
> 	{
> 		Collection<InterfaceType> intfs =classType.getSuperinterfaces();
> 		for ( InterfaceType intfType : intfs )
> 		{
> 			if ( intfType.getDeclaration().getQualifiedName().equals( "org.apache.beehive.controls.api.bean.ControlBean" ) )
>                      {
>                          foundControlBean = true;
>                          break outer;
>                      }
> 		}
>                  classType = classType.getSuperclass();
> 	}
> --------------------------------------------
> Will never end because the original fieldType (SomeBean) is an error-type that returns an error-type when getSuperClass() is called.
> The following suffices to break the loop:
> --------------------------------------------
>              ClassType classType = (ClassType)fieldType;
>              outer: while ( classType != null )
>              {
>                  Collection<InterfaceType> intfs = classType.getSuperinterfaces();
>                  for ( InterfaceType intfType : intfs )
>                  {
>                      if ( intfType.getDeclaration().getQualifiedName().equals( "org.apache.beehive.controls.api.bean.ControlBean" ) )
>                      {
>                          foundControlBean = true;
>                          break outer;
>                      }
>                  }
>                  ClassType superType = classType.getSuperclass();
>                  if(superType != null && superType.equals(classType))
>                  {
>                      break;
>                  }
>                  classType = superType;
>              }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Assigned: (BEEHIVE-511) Apt hangs when processing sources with errors

Posted by "Alejandro Ramirez (JIRA)" <be...@incubator.apache.org>.
     [ http://issues.apache.org/jira/browse/BEEHIVE-511?page=all ]

Alejandro Ramirez reassigned BEEHIVE-511:
-----------------------------------------

    Assign To: Julie Zhuo  (was: Kyle Marvin)

> Apt hangs when processing sources with errors
> ---------------------------------------------
>
>          Key: BEEHIVE-511
>          URL: http://issues.apache.org/jira/browse/BEEHIVE-511
>      Project: Beehive
>         Type: Bug
>   Components: Build
>     Versions: V1
>     Reporter: C Brett Bennett
>     Assignee: Julie Zhuo
>     Priority: Critical
>      Fix For: V1

>
>  Apt'hangs' under the following circumstance. 
> When processing a @Control field, if it is a control-bean reference, e.g.
> 	@Control SomeBean _bean;
> field where SomeBean is generated from a Some.jcx file, but at the time the _bean field is being processed the SomeBean class has not been generated or more specifically in the javac class table, then the loop in the ControlClientAnnotationProcessor:
> ------------------------------------------
> 	ClassType classType = (ClassType)fieldType;
> 	outer: while ( classType != null )
> 	{
> 		Collection<InterfaceType> intfs =classType.getSuperinterfaces();
> 		for ( InterfaceType intfType : intfs )
> 		{
> 			if ( intfType.getDeclaration().getQualifiedName().equals( "org.apache.beehive.controls.api.bean.ControlBean" ) )
>                      {
>                          foundControlBean = true;
>                          break outer;
>                      }
> 		}
>                  classType = classType.getSuperclass();
> 	}
> --------------------------------------------
> Will never end because the original fieldType (SomeBean) is an error-type that returns an error-type when getSuperClass() is called.
> The following suffices to break the loop:
> --------------------------------------------
>              ClassType classType = (ClassType)fieldType;
>              outer: while ( classType != null )
>              {
>                  Collection<InterfaceType> intfs = classType.getSuperinterfaces();
>                  for ( InterfaceType intfType : intfs )
>                  {
>                      if ( intfType.getDeclaration().getQualifiedName().equals( "org.apache.beehive.controls.api.bean.ControlBean" ) )
>                      {
>                          foundControlBean = true;
>                          break outer;
>                      }
>                  }
>                  ClassType superType = classType.getSuperclass();
>                  if(superType != null && superType.equals(classType))
>                  {
>                      break;
>                  }
>                  classType = superType;
>              }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
   http://www.atlassian.com/software/jira


[jira] Resolved: (BEEHIVE-511) Apt hangs when processing sources with errors

Posted by "Kyle Marvin (JIRA)" <be...@incubator.apache.org>.
     [ http://issues.apache.org/jira/browse/BEEHIVE-511?page=history ]
     
Kyle Marvin resolved BEEHIVE-511:
---------------------------------

     Resolution: Fixed
    Fix Version: V1

This is resolved by svn revision 161051.   There is actually a more specific test that can be used to detect (in APT) a type reference to an unresolved type (such as a to-be-generated class).   What APT does is create a com.sun.mirror.type.ClassType instance to represent the type reference, but if you call getDeclaration() on this type reference you'll get back null.  Effectively, APT is telling you 'I can't find the declaration of this type'.

> Apt hangs when processing sources with errors
> ---------------------------------------------
>
>          Key: BEEHIVE-511
>          URL: http://issues.apache.org/jira/browse/BEEHIVE-511
>      Project: Beehive
>         Type: Bug
>   Components: Build
>     Versions: V1
>     Reporter: C Brett Bennett
>     Assignee: Kyle Marvin
>     Priority: Critical
>      Fix For: V1

>
>  Apt'hangs' under the following circumstance. 
> When processing a @Control field, if it is a control-bean reference, e.g.
> 	@Control SomeBean _bean;
> field where SomeBean is generated from a Some.jcx file, but at the time the _bean field is being processed the SomeBean class has not been generated or more specifically in the javac class table, then the loop in the ControlClientAnnotationProcessor:
> ------------------------------------------
> 	ClassType classType = (ClassType)fieldType;
> 	outer: while ( classType != null )
> 	{
> 		Collection<InterfaceType> intfs =classType.getSuperinterfaces();
> 		for ( InterfaceType intfType : intfs )
> 		{
> 			if ( intfType.getDeclaration().getQualifiedName().equals( "org.apache.beehive.controls.api.bean.ControlBean" ) )
>                      {
>                          foundControlBean = true;
>                          break outer;
>                      }
> 		}
>                  classType = classType.getSuperclass();
> 	}
> --------------------------------------------
> Will never end because the original fieldType (SomeBean) is an error-type that returns an error-type when getSuperClass() is called.
> The following suffices to break the loop:
> --------------------------------------------
>              ClassType classType = (ClassType)fieldType;
>              outer: while ( classType != null )
>              {
>                  Collection<InterfaceType> intfs = classType.getSuperinterfaces();
>                  for ( InterfaceType intfType : intfs )
>                  {
>                      if ( intfType.getDeclaration().getQualifiedName().equals( "org.apache.beehive.controls.api.bean.ControlBean" ) )
>                      {
>                          foundControlBean = true;
>                          break outer;
>                      }
>                  }
>                  ClassType superType = classType.getSuperclass();
>                  if(superType != null && superType.equals(classType))
>                  {
>                      break;
>                  }
>                  classType = superType;
>              }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira


[jira] Assigned: (BEEHIVE-511) Apt hangs when processing sources with errors

Posted by "Kyle Marvin (JIRA)" <be...@incubator.apache.org>.
     [ http://issues.apache.org/jira/browse/BEEHIVE-511?page=history ]

Kyle Marvin reassigned BEEHIVE-511:
-----------------------------------

    Assign To: Kyle Marvin

> Apt hangs when processing sources with errors
> ---------------------------------------------
>
>          Key: BEEHIVE-511
>          URL: http://issues.apache.org/jira/browse/BEEHIVE-511
>      Project: Beehive
>         Type: Bug
>   Components: Build
>     Versions: V1
>     Reporter: C Brett Bennett
>     Assignee: Kyle Marvin
>     Priority: Critical

>
>  Apt'hangs' under the following circumstance. 
> When processing a @Control field, if it is a control-bean reference, e.g.
> 	@Control SomeBean _bean;
> field where SomeBean is generated from a Some.jcx file, but at the time the _bean field is being processed the SomeBean class has not been generated or more specifically in the javac class table, then the loop in the ControlClientAnnotationProcessor:
> ------------------------------------------
> 	ClassType classType = (ClassType)fieldType;
> 	outer: while ( classType != null )
> 	{
> 		Collection<InterfaceType> intfs =classType.getSuperinterfaces();
> 		for ( InterfaceType intfType : intfs )
> 		{
> 			if ( intfType.getDeclaration().getQualifiedName().equals( "org.apache.beehive.controls.api.bean.ControlBean" ) )
>                      {
>                          foundControlBean = true;
>                          break outer;
>                      }
> 		}
>                  classType = classType.getSuperclass();
> 	}
> --------------------------------------------
> Will never end because the original fieldType (SomeBean) is an error-type that returns an error-type when getSuperClass() is called.
> The following suffices to break the loop:
> --------------------------------------------
>              ClassType classType = (ClassType)fieldType;
>              outer: while ( classType != null )
>              {
>                  Collection<InterfaceType> intfs = classType.getSuperinterfaces();
>                  for ( InterfaceType intfType : intfs )
>                  {
>                      if ( intfType.getDeclaration().getQualifiedName().equals( "org.apache.beehive.controls.api.bean.ControlBean" ) )
>                      {
>                          foundControlBean = true;
>                          break outer;
>                      }
>                  }
>                  ClassType superType = classType.getSuperclass();
>                  if(superType != null && superType.equals(classType))
>                  {
>                      break;
>                  }
>                  classType = superType;
>              }

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://issues.apache.org/jira/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira