Share

RECODER

Tracker: Feature Requests

5 sub-package duplicate compilation units - ID: 2816906
Last Update: Comment added ( tgutzmann )

Hello,

Consider the folder hierarchy :

Folder/
- file1.java
-SubFolder/
- file2.java ---- must contain at least a method with one or
more parameters

step 1 : Set the files to be analyzed to be Folder
step 2 : As expected we get two compilation units file1.java and
file2.java
step 3 : Set the files to be analyzed to be SubFolder - without
restarting the application
step 4 : We get two compilation units - file2.java twice...

The way I fixed this (but I'm not sure that this is the right way) was to
use a HashSet in the method recoder.io.PathList.findAll(FilenameFilter) for
the res variable:

// the filter must be able to accept null parent directories
// (e.g. for ZipEntries)
public DataLocation[] findAll(FilenameFilter filter) {
Set<DataLocation> res = new HashSet<DataLocation>();

I've attached the modified PathList file.

Ioana


ioana ( ioanaverebi ) - 2009-07-05 14:39

5

Closed

None

Tobias Gutzmann

None

None

Public


Comments ( 4 )

Date: 2009-08-07 10:33
Sender: tgutzmannProject Admin

Added in SVN/next release. A warning is reported to the error handler if a
data location is found twice. Such a warning does not cause the error
handler to abort analysis - the default behaviour is to write a messge to
System.err


Date: 2009-07-28 12:37
Sender: tgutzmannProject Admin

I move this to Feature Requests. I will consider this issue before the next
release.

My suggestion (please give me your opinion on this):
- report a warning each time a DataLocation is added twice. This way, the
user is informed that something is wrong, but RECODER will continue
working.




Date: 2009-07-22 16:21
Sender: ioanaverebi

Hello,
You were right.
We were concatenating to the old classpath.
So I guess this is not really a RECODER bug. Unless RECODER is supposed to
take care of duplicate files if they are specified in the classpath...
Please accept my apologies for jumping to conclusions and for answering so
late,
Ioana


Date: 2009-07-08 08:57
Sender: tgutzmannProject Admin

Hej,

I have some questions:
1) how do you set the "files to be analyzed" - using
setProperty(INPUT_PATH, ...)?
2) when you set the input path, could it be that the old path from step 1
is "left", i.e., the input path in step 3 becomes
"Folder/;Folder/SubFolder/" ? In that case, the bug could be explained.
Otherwise, I probably need to do some more digging.

In order to get a better feeling for the problem, could you provide a
complete source code example that causes the bug?

Best regards,
Tobias



Attached File ( 1 )

Filename Description Download
PathList.java patched PathList Download

Changes ( 10 )

Field Old Value Date By
close_date - 2009-08-07 10:33 tgutzmann
status_id Open 2009-08-07 10:33 tgutzmann
allow_comments 1 2009-08-07 10:33 tgutzmann
resolution_id Accepted 2009-08-07 10:33 tgutzmann
category_id Parser 2009-07-28 12:37 tgutzmann
resolution_id None 2009-07-28 12:37 tgutzmann
data_type 392688 2009-07-28 12:37 tgutzmann
assigned_to nobody 2009-07-08 08:57 tgutzmann
summary sub-package duplicate comp. units 2009-07-05 14:40 ioanaverebi
File Added 333513: PathList.java 2009-07-05 14:39 ioanaverebi