Skip to content

Commit 8ee81bb

Browse files
author
Christoph Läubrich
committed
Store Objects in the DefaultContext in a map
Fix #48
1 parent f28ab02 commit 8ee81bb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@
2121
import java.io.OutputStream;
2222
import java.nio.file.Files;
2323
import java.util.List;
24+
import java.util.Map;
25+
import java.util.concurrent.ConcurrentHashMap;
2426

2527
import org.codehaus.plexus.util.DirectoryScanner;
2628
import org.codehaus.plexus.util.Scanner;
@@ -41,6 +43,7 @@
4143
@Singleton
4244
public class DefaultBuildContext implements BuildContext {
4345

46+
private final Map<String, Object> contextMap = new ConcurrentHashMap<>();
4447
private final Logger logger = LoggerFactory.getLogger(DefaultBuildContext.class);
4548
/** {@inheritDoc} */
4649
public boolean hasDelta(String relpath) {
@@ -105,11 +108,12 @@ public boolean isIncremental() {
105108

106109
/** {@inheritDoc} */
107110
public Object getValue(String key) {
108-
return null;
111+
return contextMap.get(key);
109112
}
110113

111114
/** {@inheritDoc} */
112115
public void setValue(String key, Object value) {
116+
contextMap.put(key, value);
113117
}
114118

115119
private String getMessage(File file, int line, int column, String message) {

0 commit comments

Comments
 (0)