Re: [Jastadd] Problem with package-name clashes

From: Jesper qvist <jesper.oqvist_at_cs.lth.se>
Date: Fri, 11 Jan 2013 11:34:22 +0100

Thank you, this is very helpfull!

The system I tested on is a Linux system (case-sensitive). I will try to
reproduce it on another system and fix it!

/Jesper

On 01/11/2013 10:57 AM, Eric Bodden wrote:
> Hello.
>
> I think the problem is in JastAdd but it only occurs on operating
> systems that are case-insensitive in their file system, such as
> Windows and OS X.
>
> In ClassPath.jrag we have this code:
>
> private Collection filesInPackage(String packageName) {
> if(!map.containsKey(packageName)) {
> File f = new File(folder, packageName.replace('.', File.separatorChar));
> Collection c = Collections.EMPTY_LIST;
> if(f.exists() && f.isDirectory()) {
> String[] files = f.list();
> if(files.length > 0) {
> c = new HashSet();
> for(int i = 0; i < files.length; i++)
> c.add(files[i]);
> }
> }
> else
> c = null;
> map.put(packageName, c);
> }
> return (Collection)map.get(packageName);
> }
>
> Crucially, on those OS's the calls to f.exists() && f.isDirectory()
> return true also if the names don't match exactly.
>
> I think ideally one should not at all look into the file system but
> instead just look into the package declarations that exist.
>
> Eric
>
> On 10 January 2013 15:54, Jesper qvist <jesper.oqvist_at_cs.lth.se> wrote:
>> Hi,
>> I think that Soot might be using an older version of JastAddJ and that this
>> bug has been fixed already.
>>
>> The bug sounds familiar though I have not found it yet in the bug tracker.
>>
>> I compiled the code you sent using the Java 5 and Java 7 backends. I did not
>> try to run only semantic analysis, so I will try that.
>>
>> /Jesper
>>
>>
>> On 01/10/2013 03:36 PM, Eric Bodden wrote:
>>> Hello.
>>>
>>>> The example project compiles fine with JastAddJ. I tried with the latest
>>>> version and the Java 5 and 7 backends.
>>> I guess you mean "Java 5 and 7 frontends"?
>>> Hmm this is odd.
>>>
>>>> Do you know what version of JastAddJ your soot uses?
>>> I am pretty sure it uses Java 5. Let me check again...
>>>
>>> Eric
>>
>> _______________________________________________
>> JastAdd mailing list
>> JastAdd_at_cs.lth.se
>> https://mail1.cs.lth.se/cgi-bin/mailman/listinfo/jastadd
>
>
Received on Fri Jan 11 2013 - 11:33:57 CET

This archive was generated by hypermail 2.3.0 : Wed Apr 16 2014 - 17:19:06 CEST