Bug 27375 - "AddImport" creates syntactically incorrect code [code manipulation]
Summary: "AddImport" creates syntactically incorrect code [code manipulation]
Status: RESOLVED FIXED
Alias: None
Product: JDT
Classification: Eclipse Project
Component: UI (show other bugs)
Version: 2.0.2   Edit
Hardware: PC Windows 2000
: P3 minor (vote)
Target Milestone: ---   Edit
Assignee: Martin Aeschlimann CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2002-11-29 03:53 EST by Juergen Kremp CLA
Modified: 2002-11-29 05:37 EST (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Juergen Kremp CLA 2002-11-29 03:53:30 EST
Version: 2.0.2
Build id: 200211071448


Dear experts,

I have a situation where automatical adding of an import statement creates 
syntactically incorrect code. 

My code initially has these import statements:

import java.io.File;

import com.sap.engine.frame.ApplicationFrameAdaptor;
import com.sap.engine.frame.ApplicationServiceContext;
import com.sap.engine.frame.ServiceException;
import com.sap.engine.frame.ServiceRuntimeException;
import com.sap.engine.frame.core.configuration.ConfigurationHandler;
import com.sap.security.api.saml.service.LoggingCategories;
import com.sap.security.api.saml.service.exception.SAMLServiceException;
import com
    .sap
    .security
    .core
    .server
    .saml
    .service
    .configuration
    .SAMLConfiguration;
import com.sap.tc.logging.Location;
import com.sap.tc.logging.PropertiesConfigurator;

Note that I use the code formatter and have a line width of 80 maximum. The 
code above is the result of automatic code formatiing.

Now I let the system add an import for the following class:

  com.sap.security.core.server.util0.LogUtil


The result is this:

import java.io.File;

import com.sap.engine.frame.ApplicationFrameAdaptor;
import com.sap.engine.frame.ApplicationServiceContext;
import com.sap.engine.frame.ServiceException;
import com.sap.engine.frame.ServiceRuntimeException;
import com.sap.engine.frame.core.configuration.ConfigurationHandler;
import com.sap.security.api.saml.service.LoggingCategories;
import com.sap.security.api.saml.service.exception.SAMLServiceException;
import com
import com.sap.security.core.server.util0.LogUtil;
    .sap
    .security
    .core
    .server
    .saml
    .service
    .configuration
    .SAMLConfiguration;
import com.sap.tc.logging.Location;
import com.sap.tc.logging.PropertiesConfigurator;



It seems that the algorithm that creates the order of imports by alphabet has 
problems with the import statements altered by the code formatter.


Juergen
Comment 1 Adam Kiezun CLA 2002-11-29 04:41:08 EST
this is jdt
Comment 2 Martin Aeschlimann CLA 2002-11-29 05:37:18 EST
this is fixed in the latest.