eclipse-xtext / eclipse-xtext/xtext
xtext clean output - not removing all output folders, if previous does not exists
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 831
- Forks
- 330
- Avg merge
- 3d 7h
- Merged PRs (30d)
- 12
Description
Hi,
I would like to report a possible bug. Please take a look at line 490 in org.eclipse.xtext.builder.BuilderParticipant -> cleanOutput(IBuildContext, OutputConfiguration, EclipseResourceFileSystemAccess2, IProgressMonitor)
This method removes output folders based on configuration: the general logic is:
for (IContainer container : getOutputs(project, config)) {
delete the output
}
The problem is with the following lines:
for (IContainer container : getOutputs(project, config)) {
if (!container.exists()) {
return;
}
It stops deleting on the first non-existing resource to be deleted. So, if getOuputs returns two folders, and both exists - both will be deleted. If the first one does not exists, but the second does - it will not be deleted.
I propose to change "return" into "continue" - this should fix the issue.
Kind regards
Marcin
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start at line 490 in org.eclipse.xtext.builder/src/org/eclipse/xtext/builder/BuilderParticipant.java, within cleanOutput(IBuildContext, OutputConfiguration, EclipseResourceFileSystemAccess2, IProgressMonitor), and inspect how the getOutputs(project, config) loop handles missing containers. Done means cleanup continues past a missing first output and removes later existing output folders.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 52/100