Skip to content

Commit 87e1417

Browse files
Volodjamlaeubi
authored andcommitted
Delegate getValue/setValue in DefaultBuildContext to legacy build API
This prevents objects from being stored in the singleton DefaultBuildContext instead of the thread-local build context (ThreadBuildContext) in Eclipse, avoiding unintended cross-project state sharing.
1 parent 40ad0bf commit 87e1417

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/main/java/org/codehaus/plexus/build/DefaultBuildContext.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -153,12 +153,18 @@ public boolean isIncremental() {
153153

154154
/** {@inheritDoc} */
155155
public Object getValue(String key) {
156-
return contextMap.get(key);
156+
if (isDefaultImplementation()) {
157+
return contextMap.get(key);
158+
}
159+
return legacy.getValue(key);
157160
}
158161

159162
/** {@inheritDoc} */
160163
public void setValue(String key, Object value) {
161-
contextMap.put(key, value);
164+
if (isDefaultImplementation()) {
165+
contextMap.put(key, value);
166+
}
167+
legacy.setValue(key, value);
162168
}
163169

164170
/** {@inheritDoc} */

0 commit comments

Comments
 (0)