Details
-
Type:
Bug
-
Status:
Closed
-
Priority:
Major
-
Resolution: Fixed
-
Affects Version/s: 1.4.1
-
Fix Version/s: 1.6
-
Component/s: modello-plugin-stax
-
Labels:None
-
Complexity:Intermediate
-
Number of attachments :
Description
I have a model class called 'File'
<class xsd.compositor="sequence"> <name>File</name> <description>Represents a file. We had to call it FileItem for modello bug </description> <fields> <!-- Fields go here --> </fields> </class>
The generated _ModelName_StaxReader has two imports:
import com.example.repomap.v0_1_0.File; // Other imports import java.io.File; // Other imports
The second import of course is not used, but then it generates the following piece of code:
/**
* Method read.
*
* @param filePath
* @param strict
* @throws IOException
* @throws XMLStreamException
* @return RepositoryMap
*/
public RepositoryMap read( String filePath, boolean strict )
throws IOException, XMLStreamException
{
File file = new File( filePath );
XMLStreamReader xmlStreamReader = XMLInputFactory.newInstance().createXMLStreamReader( file.toURL().toExternalForm(), new FileInputStream( file ) );
return read( xmlStreamReader, strict );
} //-- RepositoryMap read( String, boolean )
The piece of code above fails compilation as the compiler correctly interprets the File class in the method as com.example.repomap.v0_1_0.File rather than java.io.File as intended.
Activity
Herve Boutemy
made changes -
| Field | Original Value | New Value |
|---|---|---|
| Resolution | Fixed [ 1 ] | |
| Fix Version/s | 1.5.1 [ 18746 ] | |
| Assignee | Herve Boutemy [ hboutemy ] | |
| Status | Open [ 1 ] | Closed [ 6 ] |