Bug 357913 - The JET editor in Eclipse generates duplicate Java classes in case of multiple source folders
Summary: The JET editor in Eclipse generates duplicate Java classes in case of multipl...
Status: NEW
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Jet (show other bugs)
Version: unspecified   Edit
Hardware: PC Windows 7
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-09-16 04:22 EDT by Martin Marchev CLA
Modified: 2020-05-01 16:10 EDT (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Martin Marchev CLA 2011-09-16 04:22:05 EDT
Build Identifier: 20110615-0604

Here is a problem I have found with the JET Editor plug-in in Eclipse: I have 2 source folders in my project:

 * src/main/java (contains all project classes etc.)
 * src/test/java (contains all JUnit tests)

In my .jetproperties file I have set src/main/java as a source container:

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<jet-settings>
	<template-container>templates</template-container>
        <source-container>src/main/java</source-container>
</jet-settings>

Now if I have src/test/java before src/main/java in my classpath file, like this:

...
	<classpathentry kind="src" path="src/test/java"/>
	<classpathentry kind="src" path="src/main/java"/>
...

When I create a new JET template using the JET Editor (the bug does not occur if I use the text editor), JET wrongly generates duplicate Java classes to both src/test/java and src/main/java, even though src/main/java is only specified as a source container in its settings.

Reproducible: Always

Steps to Reproduce:
1. Create a new Java project in Eclipse with the following source folders:

src/main/java
src/test/java

2. Make sure that src/test/java appears before src/main/java in the classpath file (either from the project properties -> Java Build Path -> Order and Export or the .classpath file itself).
3. Convert the newly created project to a JET project
4. In the JET settings, set src/main/java as a source container.
5. Create a new JET template using the JET Editor (if using the text editor, the bug is not reproducible) like this one here:

<%@ jet package="org.eclipse.bug.reproduce" class="Test" %>
JET Editor bug reproducing!

After you save the template, 2 template generators are wrongly generated: both in src/main/java and src/test/java.
Comment 1 Martin Marchev CLA 2011-09-16 04:23:16 EDT
WORKAROUND: In the .classpath file, set the folder specified as a source container in JET as a first classpath entry.