Bugs item #506291, was opened at 2002-01-20 21:29
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=402704&aid=506291&group_id=31602

Category: ejbdoclet
Group: v1.1
Status: Open
Resolution: None
Priority: 5
Submitted By: Ismael Matos (iam01)
Assigned to: Vincent Harcq (vharcq)
Summary: Redundant import, same as class name

Initial Comment:
Sample build from Xdoclet-1.1 fails with compilation 
error because a redundant import statement is 
generated for the current class.

Environment:
  JSDK 1.4.0 Beta 3
  Ant 1.4.1

See resulting messages below.  Sample generated code 
attached.

compile-ejbs:
    [javac] Compiling 74 source files to 
C:\Java\xdoclet-1.1\samples\build\ejb\c
lasses
    [javac] C:\Java\xdoclet-1.1\samples\gen-
src\java\test\interfaces\CustomerData.java:11: 
test.interfaces.CustomerData is already defined in 
this compilation unit
    [javac] import test.interfaces.CustomerData;
    [javac] ^
    [javac] C:\Java\xdoclet-1.1\samples\gen-
src\java\test\interfaces\PersonData.java:11: 
test.interfaces.PersonData is already defined in this 
compilation unit
    [javac] import test.interfaces.PersonData;
    [javac] ^
    [javac] C:\Java\xdoclet-1.1\samples\gen-
src\java\test\interfaces\CustomerPK.java:12: 
test.interfaces.CustomerPK is already defined in this 
compilation unit
    [javac] import test.interfaces.CustomerPK;
    [javac] ^
    [javac] C:\Java\xdoclet-1.1\samples\gen-
src\java\test\interfaces\Customer.java:10: 
test.interfaces.Customer is already defined in this 
compilation unit
    [javac] import test.interfaces.Customer;
    [javac] ^
    [javac] C:\Java\xdoclet-1.1\samples\gen-
src\java\test\interfaces\Person.java:10: 
test.interfaces.Person is already defined in this 
compilation unit
    [javac] import test.interfaces.Person;
    [javac] ^
    [javac] C:\Java\xdoclet-1.1\samples\gen-
src\java\test\interfaces\AccountData.java:10: 
test.interfaces.AccountData is already defined in this 
compilation unit
    [javac] import test.interfaces.AccountData;
    [javac] ^
    [javac] C:\Java\xdoclet-1.1\samples\gen-
src\java\test\interfaces\Account.java:9: 
test.interfaces.Account is already defined in this 
compilation unit
    [javac] import test.interfaces.Account;
    [javac] ^
    [javac] 7 errors

BUILD FAILED

----------------------------------------------------------------------

>Comment By: Ismael Matos (iam01)
Date: 2002-01-28 19:05

Message:
Logged In: YES 
user_id=189690

I haven't tried JDK1.3. - I don't think it would work 
anyway.

It seems that the importedList() method in 
xdoclet.tags.ClassTagsHandler is the culprit... There is no 
filter to avoid generating the import for the "current" 
class in the second "for" block of the method.

I'm including the code here from the source of xdoclet1.1.  
Not sure if this matches with your version.

        public String importedList() throws XDocletException
        {
...
                for( int i = 0; i < classes.length; i++ )
                        st.append( "import " ).append( 
classes[i].toString() ).append( ";" ).append( 
PrettyPrintWriter.LINE_SEPARATOR );

                return st.toString();
        }


----------------------------------------------------------------------

Comment By: Vincent Harcq (vharcq)
Date: 2002-01-25 10:20

Message:
Logged In: YES 
user_id=125677

Did this work for you now ?
Else please provide the ant task that you have too see if I 
can help further

----------------------------------------------------------------------

Comment By: Vincent Harcq (vharcq)
Date: 2002-01-21 11:28

Message:
Logged In: YES 
user_id=125677

Have you tried on JDK 1.3 ?

I already come to this but can not remember how...

As a quick solution you should add
  import test.interfaces.*; 
instead of 
  import test.interfaces.CustomerData;

----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=402704&aid=506291&group_id=31602

_______________________________________________
Xdoclet-devel mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-devel

Reply via email to