Starting from a vanilla Spoofax project, you get Duplicate definition errors for entities and properties after doing a rename-entity (or any other) refactor.
It may be the index library that has changed quite a bit lately.

Not sure if this is related, but I’m also getting the following error with each refactor:

Internal error: strategy does not exist or is defined in a module that is not imported: Definition 'parenthesize-EntityLang' not found

And sometimes:

[ EntityLang | error ] Unable to open file:
    "D:/workspace4/EntityLang"
EntityLang: rewriting failed, trace:
	editor_parallel_analyze_0_0
	index_parallel_analyze_files_1_0
	index_parallel_analyze_1_0
	map_1_0
	parse_file_0_0
	parse_entitylang_file_0_0
	parse_file_2_1
	parse_file_2_3
[ EntityLang | critical ] Internal error: with clause failed unexpectedly in rule 'index-parse-file'
           "D:/workspace4/EntityLang"
Submitted by Oskar van Rest on 16 May 2012 at 03:39

On 16 May 2012 at 04:39 Oskar van Rest tagged @maartje

On 16 May 2012 at 04:39 Oskar van Rest tagged @oskarvanrest

On 16 May 2012 at 06:34 Gabriël Konat tagged @gohla

On 16 May 2012 at 06:42 Gabriël Konat commented:

Hmm, I haven’t thoroughly tested the index with refactoring. Does refactoring just change text and queue a re-analysis of the file or does it some stuff internally?

The last error you show might indicate that the index is being used from multiple threads without thread-safeness. You need to wrap strategies that access or change the index from multiple threads with an index-transaction(s) strategy.


On 17 May 2012 at 06:30 Oskar van Rest commented:

I believe it just changes the actual file and then triggers a re-analysis as follows:

    	//Queue analysis for affected asts, 
	//dyn rules may be out of sync after re-analysis asts + abort refactoring)
	private static void queueAnalysisAffectedFiles(IRefactoring refactoring, EditorState editor) {		
		IProject project = editor.getProject().getRawProject();
		for (IPath projectRelativePath : refactoring.getRelativePathsOfAffectedFiles())     {
			    StrategoAnalysisQueueFactory.getInstance().queueAnalysis(projectRelativePath, project, true);			
		}
	}

see https://svn.strategoxt.org/repos/StrategoXT/spoofax-imp/trunk/org.strategoxt.imp.runtime/src/org/strategoxt/imp/runtime/dynamicloading/RefactoringFactory.java

Not sure what goes wrong there. My example.ent does get queued in that for-loop.


On 22 May 2012 at 14:37 Gabriël Konat commented:

What is happening is that the refactor code is invoking editor-analyze with both the path and project-path set to the empty string. This messes up the index since it relies on the path to be a correct path.


On 17 October 2012 at 09:41 Maartje closed this issue.

On 17 October 2012 at 09:42 Maartje commented:

Is fixed now.


On 17 October 2012 at 12:03 Maartje tagged 1.1

On 24 May 2013 at 19:12 Oskar van Rest reopened this issue.

On 24 May 2013 at 19:13 Oskar van Rest commented:

this bug is back


On 24 May 2013 at 19:20 Oskar van Rest commented:

(in the nightly)


On 30 May 2013 at 21:33 Oskar van Rest commented:

Never mind. http://spoofax.org/update/nightly redirects to an old build. Bug is fixed in the newest build.


On 30 May 2013 at 21:33 Oskar van Rest closed this issue.

Log in to post comments