private void addScript(String name) { if (!name.isEmpty()) { scriptNames.add(name); } if (debugInformationMap.containsKey(name)) { updateBreakpoints(); return; } DebugInformation debugInfo = debugInformationProvider.getDebugInformation(name); if (debugInfo == null) { return; } debugInformationMap.put(name, debugInfo); for (String sourceFile : debugInfo.getFilesNames()) { Set<DebugInformation> list = debugInformationFileMap.get(sourceFile); if (list == null) { list = new HashSet<>(); debugInformationFileMap.put(sourceFile, list); } list.add(debugInfo); } scriptMap.put(debugInfo, name); updateBreakpoints(); }
private void addScript(String name) { if (debugInformationMap.containsKey(name)) { updateBreakpoints(); return; } DebugInformation debugInfo = debugInformationProvider.getDebugInformation(name); if (debugInfo == null) { updateBreakpoints(); return; } if (debugInformationMap.putIfAbsent(name, debugInfo) != null) { updateBreakpoints(); return; } for (String sourceFile : debugInfo.getFilesNames()) { ConcurrentMap<DebugInformation, Object> list = debugInformationFileMap.get(sourceFile); if (list == null) { list = new ConcurrentHashMap<>(); ConcurrentMap<DebugInformation, Object> existing = debugInformationFileMap.putIfAbsent( sourceFile, list); if (existing != null) { list = existing; } } list.put(debugInfo, dummyObject); } scriptMap.put(debugInfo, name); updateBreakpoints(); }