Skip to content
This repository was archived by the owner on Jun 16, 2026. It is now read-only.
This repository was archived by the owner on Jun 16, 2026. It is now read-only.

Semantic differences in Taint-Aware Properties class compared to original #29

Description

@leeN

The Properties class is some weird custom code/inherited HashMap amalgamation. It mostly behaves the same, but during debugging crashing dacapo benchmarks, I found the following incompatibility:

In the eclipse benchmark we have a class that inherits from Properties and overrides the put method, which is inherited from Hashmap. It then fills the Properties object with the built-in loading (i.e., calling load()) functionality.

class MyProperties extends Properties {

    public synchronized Object put(Object var1, Object var2) {
        System.out.printf("Putting: %s -> %s\n", var1, var2);
        return null;
    }
}

class Main {
    public static void main(String[] args) throws Exception {
        FileInputStream fis = new FileInputStream("./msgs.properties");
        MyProperties props = new MyProperties();
        props.load(fis);
    }
}

Without tainting, this will print all key-value pairs from msgs.properties. With tainting, it does not print anything. This is because we are wrapping a Properties object and delegating the load call to said object. Consequently, the overridden put method is not called during loading, as the overridden put method is for the wrapper class.

Generally, this is quite nasty code, but the Eclipse people think it's reasonable, so we have to support it, I suppose.

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions