auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected String[] customCommandLineValidation() { List<String> errors = new ArrayList<>(); if (INPUT.equals(OUTPUT)) errors.add("INPUT file and OUTPUT file must differ!"); checkInputs(Arrays.asList(Filter.includeReadList, Filter.excludeReadList), READ_LIST_FILE, "READ_LIST_FILE").ifPresent(errors::add); checkInputs(Collections.singletonList(Filter.includePairedIntervals), INTERVAL_LIST, "INTERVAL_LIST").ifPresent(errors::add); checkInputs(Collections.singletonList(Filter.includeJavascript), JAVASCRIPT_FILE, "JAVASCRIPT_FILE").ifPresent(errors::add); checkInputs(Arrays.asList(Filter.includeTagValues, Filter.excludeTagValues), TAG, "TAG").ifPresent(errors::add); if (!errors.isEmpty()) return errors.toArray(new String[errors.size()]); return super.customCommandLineValidation(); }

Target:
protected String[] customCommandLineValidation() { List<String> errors = new ArrayList<>(); if (INPUT.equals(OUTPUT)) errors.add("INPUT file and OUTPUT file must differ!"); List<Filter> tagFilters = Arrays.asList(Filter.includeTagValues, Filter.excludeTagValues); checkInputs(Arrays.asList(Filter.includeReadList, Filter.excludeReadList), READ_LIST_FILE, "READ_LIST_FILE").ifPresent(errors::add); checkInputs(Collections.singletonList(Filter.includePairedIntervals), INTERVAL_LIST, "INTERVAL_LIST").ifPresent(errors::add); checkInputs(Collections.singletonList(Filter.includeJavascript), JAVASCRIPT_FILE, "JAVASCRIPT_FILE").ifPresent(errors::add); checkInputs(tagFilters, TAG, "TAG").ifPresent(errors::add); if (tagFilters.contains(FILTER) && TAG_VALUE.isEmpty()) { log.warn("Running FilterSamReads with a Tag Filter but no TAG_VALUE argument provided. This " + "will recreate the original input file i.e. not filter anything"); } if (!errors.isEmpty()) return errors.toArray(new String[errors.size()]); return super.customCommandLineValidation(); }
Source:
public ActionResponseDto execute(final ClientConnection conn, final DlmsDevice device, final GetConfigurationRequestDataDto getConfigurationRequestDataDto) { String resultString = null; try { resultString = this.retrieveConfigurationObjectsCommandExecutor.execute(conn, device, null); } catch (final ProtocolAdapterException e) { LOGGER.error("Error retrieving configuration objects for device: " + device.getDeviceIdentification(), e); return new ActionResponseDto(e, "Error retrieving configuration objects for device: " + device.getDeviceIdentification()); } return new GetConfigurationResponseDataDto(resultString); }

Target:
public ActionResponseDto execute(final ClientConnection conn, final DlmsDevice device, final GetConfigurationRequestDataDto getConfigurationRequestDataDto) { try { return new GetConfigurationResponseDataDto(this.retrieveConfigurationObjectsCommandExecutor.execute(conn, device, null)); } catch (final ProtocolAdapterException e) { LOGGER.error("Error retrieving configuration objects for device: " + device.getDeviceIdentification(), e); return new ActionResponseDto(e, "Error retrieving configuration objects for device: " + device.getDeviceIdentification()); } }
Source:
public Result setSystemProperty( @Option(value = "named", description = "The property name", required = true) final String propertyName, @Option(value = "value", description = "The property value", required = true) final String propertyValue) { System.setProperty(propertyName, propertyValue); return Results.success("System property '" + propertyName + "' successfully set."); }

Target:
public String setSystemProperty( @Option(value = "named", description = "The property name", required = true) final String propertyName, @Option(value = "value", description = "The property value", required = true) final String propertyValue) { return System.setProperty(propertyName, propertyValue); }
Source:
public void testShouldFetchTeam() throws Exception { GHOrganization organization = gitHub.getOrganization(GITHUB_API_TEST_ORG); GHTeam teamByName = organization.getTeams().get("Core Developers"); GHTeam teamById = organization.getTeam(teamByName.getId()); assertNotNull(teamById); assertEquals(teamByName.getId(), teamById.getId()); assertEquals(teamByName.getDescription(), teamById.getDescription()); }

Target:
public void testShouldFetchTeam() throws Exception { GHOrganization organization = gitHub.getOrganization(GITHUB_API_TEST_ORG); GHTeam teamByName = organization.getTeams().get("Core Developers"); GHTeam teamById = gitHub.getTeam(teamByName.getId()); assertNotNull(teamById); assertEquals(teamByName.getId(), teamById.getId()); assertEquals(teamByName.getDescription(), teamById.getDescription()); }
Source:
public String toString() { String dataHost = options.getDataHost(); String tableAdminHost = options.getTableAdminHost(); return MoreObjects.toStringHelper(AbstractBigtableConnection.class) .add("zone", options.getZone()) .add("project", options.getProjectId()) .add("cluster", options.getCluster()) .add("dataHost", dataHost) .add("tableAdminHost", tableAdminHost) .toString(); }

Target:
public String toString() { return MoreObjects.toStringHelper(AbstractBigtableConnection.class) .add("zone", options.getZone()) .add("project", options.getProjectId()) .add("cluster", options.getCluster()) .add("dataHost", options.getDataHost()) .add("tableAdminHost", options.getTableAdminHost()) .toString(); }
Source:
public HandlerResult handle(ProcessState state, ProcessInstance process) { Instance instance = (Instance)state.getResource(); if (!InstanceConstants.CONTAINER_LIKE.contains(instance.getKind())) { return null; } Map<String, Object> labels = DataAccessor.fieldMap(instance, InstanceConstants.FIELD_LABELS); Map<Object, Object> data = new HashMap<>(); setAgentVolumes(instance, labels, data); setName(instance, labels, data); setDns(instance, labels, data); setLogConfig(instance, data); setSecrets(instance, data); setSystemLabel(instance, data); if (!data.isEmpty()) { return new HandlerResult(data); } return null; }

Target:
public HandlerResult handle(ProcessState state, ProcessInstance process) { Instance instance = (Instance)state.getResource(); if (!InstanceConstants.CONTAINER_LIKE.contains(instance.getKind())) { return null; } Map<String, Object> labels = DataAccessor.fieldMap(instance, InstanceConstants.FIELD_LABELS); Map<Object, Object> data = new HashMap<>(); setAgentVolumes(instance, labels, data); setName(instance, labels, data); setDns(instance, labels, data); setLogConfig(instance, data); setSecrets(instance, data); setSystemLabel(instance, labels); if (!data.isEmpty()) { return new HandlerResult(data); } return null; }
Source:
public Optional<TimelineAlgorithm> get(final AlgorithmType alg) { final TimelineAlgorithm algorithm = algorithmMap.get(alg); if (algorithm == null) { return Optional.absent(); } return Optional.of(algorithm); }

Target:
public Optional<TimelineAlgorithm> get(final AlgorithmType alg) { return Optional.fromNullable(algorithmMap.get(alg)); }
Source:
TestFunctionTranslator(FunctionManager functionManager, FunctionTranslator<String> functionTranslator) { this.functionTranslator = functionTranslator; this.functionManager = functionManager; }

Target:
TestFunctionTranslator(FunctionManager functionManager, FunctionTranslator<String> functionTranslator) { this.functionTranslator = requireNonNull(functionTranslator); this.functionManager = requireNonNull(functionManager); }
Source:
private void onTopologyChanged(ClientChannel ch) { if (affinityCtx.updateLastTopologyVersion(ch.serverTopologyVersion(), ch.serverNodeId())) channelsInit(true); }

Target:
private void onTopologyChanged(ClientChannel ch) { if (affinityCtx.updateLastTopologyVersion(ch.serverTopologyVersion(), ch.serverNodeId())) { if (scheduledChannelsReinit.compareAndSet(false, true)) { if (partitionAwarenessEnabled) asyncRunner.submit(this::channelsInit); } } }
Source:
protected DocumentBlobHolder getDocumentBlob(String path, String srcMT) throws IOException { DocumentModel documentModel = session.createDocumentModel("/", "src", "File"); documentModel = session.createDocument(documentModel); session.save(); DocumentBlobHolder documentBlobHolder = new DocumentBlobHolder(documentModel, "file:content"); Blob blob = buildBlob(path, srcMT); documentBlobHolder.setBlob(blob); return documentBlobHolder; }

Target:
protected DocumentBlobHolder getDocumentBlob(String path, String srcMT) throws IOException { Blob blob = buildBlob(path, srcMT); return createDocumentBlob(blob); }
Source:
private SpanBuilder startSpanWithExplicitParent(String spanName, Context context) { Optional<Object> optionalSpanKey = context.getData(OPENCENSUS_SPAN_KEY); Optional<Object> optionalSpanNameKey = context.getData(OPENCENSUS_SPAN_NAME_KEY); Span parentSpan = null; String spanNameKey = null; if (!optionalSpanNameKey.isPresent()) { spanNameKey = spanName; } else if (optionalSpanKey.isPresent() && optionalSpanNameKey.get() instanceof String) { spanNameKey = (String) optionalSpanNameKey.get(); } else { logger.warning(String.format(Locale.US, "Span name type is not of type String, but type: %s. Failed to add span links.", optionalSpanNameKey.get() != null ? optionalSpanNameKey.get().getClass() : "null")); } if (optionalSpanKey.get() instanceof Span) { parentSpan = (Span) context.getData(OPENCENSUS_SPAN_KEY).orElse(TRACER.getCurrentSpan()); } else { logger.warning(String.format(Locale.US, "Parent span type is not of type Span, but type: %s. Failed to add span links.", optionalSpanKey.get() != null ? optionalSpanKey.get().getClass() : "null")); } SpanBuilder spanBuilder = TRACER.spanBuilderWithExplicitParent(spanNameKey, parentSpan); return spanBuilder; }

Target:
private SpanBuilder startSpanWithExplicitParent(String spanName, Context context) { Optional<Object> optionalSpanKey = context.getData(OPENCENSUS_SPAN_KEY); Optional<Object> optionalSpanNameKey = context.getData(OPENCENSUS_SPAN_NAME_KEY); Span parentSpan = null; String spanNameKey = null; if (!optionalSpanNameKey.isPresent()) { spanNameKey = spanName; } else if (optionalSpanKey.isPresent() && optionalSpanNameKey.get() instanceof String) { spanNameKey = (String) optionalSpanNameKey.get(); } else { logger.warning("Span name type is not of type String, but type: {}. Failed to add span links.", optionalSpanNameKey.get() != null ? optionalSpanNameKey.get().getClass() : "null"); } if (optionalSpanKey.get() instanceof Span) { parentSpan = (Span) context.getData(OPENCENSUS_SPAN_KEY).orElse(TRACER.getCurrentSpan()); } else { logger.warning("Parent span type is not of type Span, but type: {}. Failed to add span links.", optionalSpanKey.get() != null ? optionalSpanKey.get().getClass() : "null"); } SpanBuilder spanBuilder = TRACER.spanBuilderWithExplicitParent(spanNameKey, parentSpan); return spanBuilder; }
Source:
public List<ChooserTarget> onGetChooserTargets(ComponentName targetActivityName, IntentFilter matchedFilter) { try { Context context = getApplicationContext(); ShortcutInfoCompatSaver shortcutSaver = ShortcutInfoCompatSaver.getInstance(context); List<ShortcutInfoCompat> shortcuts = shortcutSaver.getShortcuts(); List<ShareTargetCompat> targets = ShareTargetXmlParser.getShareTargets(context); ArrayList<ChooserTarget> chooserTargets = new ArrayList<>(); for (ShareTargetCompat target : targets) { boolean matchedDataType = false; for (ShareTargetCompat.TargetData data : target.mTargetData) { if (matchedFilter.hasDataType(data.mMimeType)) { matchedDataType = true; break; } } if (!matchedDataType) { continue; } for (ShortcutInfoCompat shortcut : shortcuts) { if (!shortcut.getCategories().containsAll(Arrays.asList(target.mCategories))) { continue; } IconCompat icon = shortcutSaver.getShortcutIcon(shortcut.getId()); Bundle extras = new Bundle(); extras.putCharSequence("EXTRA_SHORTCUT_ID", shortcut.getId()); chooserTargets.add(new ChooserTarget( shortcut.getShortLabel(), icon != null ? icon.toIcon() : null, 0.5f, new ComponentName(context.getPackageName(), target.mTargetClass), extras)); } } return chooserTargets; } catch (Exception e) { throw new RuntimeException("Failed to get chooser targets", e); } }

Target:
public List<ChooserTarget> onGetChooserTargets(ComponentName targetActivityName, IntentFilter matchedFilter) { Context context = getApplicationContext(); ArrayList<ChooserTarget> chooserTargets = new ArrayList<>(); List<ShareTargetCompat> targets = ShareTargetXmlParser.getShareTargets(context); List<ShareTargetCompat> matchedTargets = new ArrayList<>(); for (ShareTargetCompat target : targets) { for (ShareTargetCompat.TargetData data : target.mTargetData) { if (matchedFilter.hasDataType(data.mMimeType)) { matchedTargets.add(target); break; } } } if (matchedTargets.isEmpty()) { return chooserTargets; } ShortcutInfoCompatSaver shortcutSaver = ShortcutInfoCompatSaver.getInstance(context); List<ShortcutInfoCompat> shortcuts; try { shortcuts = shortcutSaver.getShortcuts(); } catch (Exception e) { Log.e(TAG, "Failed to retrieve shortcuts: ", e); return chooserTargets; } if (shortcuts == null || shortcuts.isEmpty()) { return chooserTargets; } for (ShortcutInfoCompat shortcut : shortcuts) { ShareTargetCompat target = null; for (ShareTargetCompat item : matchedTargets) { if (shortcut.getCategories().containsAll(Arrays.asList(item.mCategories))) { target = item; break; } } if (target == null) { continue; } IconCompat icon; try { icon = shortcutSaver.getShortcutIcon(shortcut.getId()); } catch (Exception e) { Log.e(TAG, "Failed to retrieve shortcut icon: ", e); continue; } Bundle extras = new Bundle(); extras.putCharSequence(ShortcutManagerCompat.EXTRA_SHORTCUT_ID, shortcut.getId()); chooserTargets.add(new ChooserTarget( shortcut.getShortLabel(), icon != null ? icon.toIcon() : null, 0.5f, new ComponentName(context.getPackageName(), target.mTargetClass), extras)); } return chooserTargets; }
Source:
public Object get(int index) { if (row.isNull(index)) { return null; } DataType type = columns.getType(index); if (type.isCollection()) { return getCollection(index, type); } if (ObjectUtils.nullSafeEquals(type.getName(), Name.TUPLE)) { return row.getTupleValue(index); } if (ObjectUtils.nullSafeEquals(type.getName(), Name.UDT)) { return row.getUDTValue(index); } return row.getObject(index); }

Target:
public Object get(int index) { if (row.isNull(index)) { return null; } DataType type = columns.getType(index); if (type.isCollection()) { return getCollection(index, type); } if (Name.TUPLE.equals(type.getName())) { return row.getTupleValue(index); } if (Name.UDT.equals(type.getName())) { return row.getUDTValue(index); } return row.getObject(index); }
Source:
private static CommandExecutor toExecutor(EdgeOptions options) { Objects.requireNonNull(options, "No options to construct executor from"); EdgeDriverService.Builder<?, ?> builder = StreamSupport.stream(ServiceLoader.load(DriverService.Builder.class).spliterator(), false) .filter(b -> b instanceof EdgeDriverService.Builder) .map(b -> (EdgeDriverService.Builder) b) .filter(b -> b.isEdgeHTML() == !Boolean.getBoolean(DRIVER_USE_EDGE_CHROMIUM)) .findFirst().orElseThrow(WebDriverException::new); if (!Boolean.getBoolean(DRIVER_USE_EDGE_CHROMIUM)) return new DriverCommandExecutor(builder.build()); return new ChromeDriverCommandExecutor(builder.build()); }

Target:
private static CommandExecutor toExecutor(EdgeOptions options) { Objects.requireNonNull(options, "No options to construct executor from"); boolean isLegacy = System.getProperty(DRIVER_USE_EDGE_EDGEHTML) == null || Boolean.getBoolean(DRIVER_USE_EDGE_EDGEHTML); EdgeDriverService.Builder<?, ?> builder = StreamSupport.stream(ServiceLoader.load(DriverService.Builder.class).spliterator(), false) .filter(b -> b instanceof EdgeDriverService.Builder) .map(b -> (EdgeDriverService.Builder) b) .filter(b -> b.isLegacy() == isLegacy) .findFirst().orElseThrow(WebDriverException::new); if (isLegacy) return new DriverCommandExecutor(builder.build()); return new ChromiumDriverCommandExecutor(builder.build()); }
Source:
public void verifyAllPinTypesIsCheck() { waitForElementByElement(allPinTypes); waitForElementByElement(enabledPinTypesCollection.get(InteractiveMapsContent.pinTypeIndex)); if(allPinTypes.getAttribute("class").contains("enabled")) { PageObjectLogging.log("verifyAllPointTypesIsCheck", "All pin types was checked", true); }else { PageObjectLogging.log("verifyAllPointTypesIsCheck", "All pin types was unchecked", false); } }

Target:
public void verifyAllPinTypesIsCheck() { try { waitForElementByElement(allPinTypes); waitForElementByElement(enabledPinTypesCollection.get(InteractiveMapsContent.pinTypeIndex)); if (allPinTypes.getAttribute("class").contains("enabled")) { PageObjectLogging.log("verifyAllPointTypesIsCheck", "All pin types were checked", true); } }catch (Exception e) { PageObjectLogging.log("verifyAllPointTypesIsCheck", e.toString(), false); } }
Source:
public Router getRouter() throws InstantiationException { try { return new NonBlockingRouter(routerConfig, routerMetrics, networkClientFactory, notificationSystem, clusterMap, kms, cryptoService, cryptoJobHandler, time); } catch (IOException e) { throw new InstantiationException("Error instantiating NonBlocking Router" + e.getMessage()); } }

Target:
public Router getRouter() { try { return new NonBlockingRouter(routerConfig, routerMetrics, networkClientFactory, notificationSystem, clusterMap, kms, cryptoService, cryptoJobHandler, time); } catch (IOException e) { throw new IllegalStateException("Error instantiating NonBlocking Router ", e); } }
Source:
private void handleCtrlC(Key[] keys) { if (doKeysMatch(keys, Key.CONTROL, Key.C)) { this.execute(newDefaultCallback("Error while trying to copy selected items. Message=")); } }

Target:
private void handleCtrlC(Key[] keys) { if (doKeysMatch(keys, Key.CONTROL, Key.C)) { this.execute(newDefaultCallback("Error while trying to copy selected items.")); } }
Source:
public void setJetpackSettings(long siteId, Map<String, Object> bodyData, Listener listener, ErrorListener errorListener) { String path = String.format(Locale.US, "jetpack-blogs/%d/rest-api/", siteId); JSONObject params = new JSONObject(); JSONObject body = new JSONObject(); try { for (String key : bodyData.keySet()) { body.putOpt(key, bodyData.get(key)); } params.put("path", "/jetpack/v4/settings/"); params.put("body", body.toString()); post(path, params, null, listener, errorListener); } catch (JSONException e) { e.printStackTrace(); } }

Target:
public void setJetpackSettings(long siteId, Map<String, Object> bodyData, Listener listener, ErrorListener errorListener) { String path = String.format(Locale.US, "jetpack-blogs/%d/rest-api/", siteId); JSONObject params = new JSONObject(); JSONObject body = new JSONObject(); try { for (String key : bodyData.keySet()) { body.putOpt(key, bodyData.get(key)); } params.put("path", "/jetpack/v4/settings/"); params.put("body", body.toString()); post(path, params, null, listener, errorListener); } catch (JSONException e) { AppLog.e(AppLog.T.API, "Error updating Jetpack settings: " + e); if (errorListener != null) { errorListener.onErrorResponse( new VolleyError("Error: Attempted to update Jetpack settings with malformed body data", e)); } } }
Source:
private ChronicleMapMessageRepository(File file, int entries, int averageMessageSize) { logger.info("Creating backup storage in path: {}", file.getAbsolutePath()); try { map = ChronicleMapBuilder.of(String.class, ChronicleMapEntryValue.class) .constantKeySizeBySample(MessageIdGenerator.generate()) .averageValueSize(averageMessageSize) .entries(entries) .createPersistedTo(file); if (map == null) { logger.error("Backup file could not be read - check if it was not corrupted."); } } catch (IOException e) { logger.error("Failed to load backup storage file from path {}", file.getAbsoluteFile(), e); throw new ChronicleMapCreationException(e); } }

Target:
public ChronicleMapMessageRepository(File file, int entries, int averageMessageSize) { logger.info("Creating backup storage in path: {}", file.getAbsolutePath()); try { map = ChronicleMapBuilder.of(String.class, ChronicleMapEntryValue.class) .constantKeySizeBySample(MessageIdGenerator.generate()) .averageValueSize(averageMessageSize) .entries(entries) .createOrRecoverPersistedTo(file, SAME_BUILDER_CONFIG); } catch (IOException e) { logger.error("Failed to load backup storage file from path {}", file.getAbsoluteFile(), e); throw new ChronicleMapCreationException(e); } }
Source:
private static String getCustomClassName(Class<? extends ObjCObject> type) { CustomClass customClassAnno = type.getAnnotation(CustomClass.class); String name = type.getName(); if (customClassAnno != null && customClassAnno.value().length() > 0) { name = customClassAnno.value(); } name = CUSTOM_CLASS_NAME_PREFIX + name.replace('.', '_'); return name; }

Target:
private static String getCustomClassName(Class<? extends ObjCObject> type) { CustomClass customClassAnno = type.getAnnotation(CustomClass.class); String name = type.getName(); if (customClassAnno != null && customClassAnno.value().length() > 0) { name = customClassAnno.value(); } else { name = CUSTOM_CLASS_NAME_PREFIX + name; } name = name.replace('.', '_'); return name; }
Source:
public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext) throws IOException { String remoteAddress = context.channel().remoteAddress().toString(); long startNano = Long.parseLong(requestContext.getHeaderString(NANO_TIME)); String requestMethod = requestContext.getMethod(); String uri = requestContext.getUriInfo().getPath(); int status = responseContext.getStatus(); int requestSize = requestContext.getLength(); int responseSize = responseContext.getLength(); if (responseSize == -1 && responseContext.hasEntity()) { Object entity = responseContext.getEntity(); if (entity instanceof byte[]) { responseSize = ((byte[]) entity).length; responseContext.getHeaders().addFirst(HttpHeaders.CONTENT_LENGTH, responseSize); } } long responseTime = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - startNano); log.fatalf("%s [%s] \"%s %s\" %s %d %d %d ms", remoteAddress, responseTime, requestMethod, uri, status, requestSize, responseSize, responseTime); }

Target:
public void filter(ContainerRequestContext requestContext, ContainerResponseContext responseContext) throws IOException { String remoteAddress = context.channel().remoteAddress().toString(); long startNano = Long.parseLong(requestContext.getHeaderString(NANO_TIME)); String requestMethod = requestContext.getMethod(); String uri = requestContext.getUriInfo().getPath(); int status = responseContext.getStatus(); int requestSize = requestContext.getLength(); int responseSize = responseContext.getLength(); if (responseSize == -1 && responseContext.hasEntity()) { Object entity = responseContext.getEntity(); if (entity instanceof byte[]) { responseSize = ((byte[]) entity).length; responseContext.getHeaders().addFirst(HttpHeaders.CONTENT_LENGTH, responseSize); } } long responseTime = TimeUnit.NANOSECONDS.toMillis(System.nanoTime() - startNano); log.tracef("%s [%s] \"%s %s\" %s %d %d %d ms", remoteAddress, responseTime, requestMethod, uri, status, requestSize, responseSize, responseTime); }
Source:
private void updateDefaultNameSpaces(final Node<Definition<DMNDiagram>, ?> diagramNode) { final DMNDiagram dmnDiagram = diagramNode.getContent().getDefinition(); final Definitions dmnDefinitions = dmnDiagram.getDefinitions(); Stream.of(DMNModelInstrumentedBase.Namespace.values()) .filter(namespace -> !dmnDefinitions.getNsContext().containsValue(namespace.getUri())) .forEach(namespace -> dmnDefinitions.getNsContext().put(namespace.getPrefix(), namespace.getUri())); String defaultNamespace = (dmnDefinitions.getNamespace() != null) ? dmnDefinitions.getNamespace() : DMNModelInstrumentedBase.Namespace.DEFAULT.getUri() + UUID.uuid(); dmnDefinitions.setNamespace(defaultNamespace); dmnDefinitions.getNsContext().put(DMNModelInstrumentedBase.Namespace.DEFAULT.getPrefix(), defaultNamespace); }

Target:
private void updateDefaultNameSpaces(final Node<Definition<DMNDiagram>, ?> diagramNode) { final DMNDiagram dmnDiagram = diagramNode.getContent().getDefinition(); final Definitions dmnDefinitions = dmnDiagram.getDefinitions(); Stream.of(DMNModelInstrumentedBase.Namespace.values()) .filter(namespace -> !dmnDefinitions.getNsContext().containsValue(namespace.getUri())) .forEach(namespace -> dmnDefinitions.getNsContext().put(namespace.getPrefix(), namespace.getUri())); String defaultNamespace = !StringUtils.isEmpty(dmnDefinitions.getNamespace()) ? dmnDefinitions.getNamespace() : DMNModelInstrumentedBase.Namespace.DEFAULT.getUri() + UUID.uuid(); dmnDefinitions.setNamespace(defaultNamespace); dmnDefinitions.getNsContext().put(DMNModelInstrumentedBase.Namespace.DEFAULT.getPrefix(), defaultNamespace); }
Source:
protected int insertHeaderCellInSec(final HSSFRow headerRow, final int columnIndex, final String value) { int newColumnIndex = columnIndex; HSSFCell cell = headerRow.createCell(newColumnIndex++); cell.setCellStyle(headerCellStyle); if ("false".equals( pluginSettings.get(GlobalSettingsKey.JTTP_PLUGIN_REPORTING_SETTINGS_WORKLOG_IN_SEC))) { cell.setCellValue(value); } else { cell.setCellValue(value + " (s)"); } return newColumnIndex; }

Target:
protected int insertHeaderCellInSec(final HSSFRow headerRow, final int columnIndex, final String value) { int newColumnIndex = columnIndex; HSSFCell cell = headerRow.createCell(newColumnIndex++); cell.setCellStyle(headerCellStyle); if (userReportingSettingsHelper.getWorklogTimeInSeconds()) { cell.setCellValue(value + " (s)"); } else { cell.setCellValue(value); } return newColumnIndex; }
Source:
public List<ConstraintViolation> validate(Command command) { final ImmutableList.Builder<ConstraintViolation> result = ImmutableList.builder(); if (!command.hasMessage()) { result.add(ConstraintViolation.newBuilder().setMsgFormat(COMMAND_MESSAGE_MUST_BE_SET).build()); } if (!command.hasContext()) { result.add(ConstraintViolation.newBuilder().setMsgFormat(COMMAND_CONTEXT_MUST_BE_SET).build()); } final Message commandMessage = Commands.getMessage(command); final Object targetId = GetTargetIdFromCommand.asNullableObject(commandMessage); if (targetId != null) { final String targetIdString = idToString(targetId).trim(); if (targetIdString.isEmpty()) { result.add(ConstraintViolation.newBuilder().setMsgFormat( COMMAND_TARGET_ENTITY_ID_CANNOT_BE_EMPTY_OR_BLANK).build()); } } final List<ConstraintViolation> messageViolations = new MessageValidator().validate(commandMessage); result.addAll(messageViolations); final CommandContext context = command.getContext(); final String commandId = idToString(context.getCommandId()); if (commandId.isEmpty()) { result.add(ConstraintViolation.newBuilder().setMsgFormat(COMMAND_ID_CANNOT_BE_EMPTY_OR_BLANK).build()); } return result.build(); }

Target:
public List<ConstraintViolation> validate(Command command) { final ImmutableList.Builder<ConstraintViolation> result = ImmutableList.builder(); if (!command.hasMessage()) { result.add(newConstraintViolation(COMMAND_MESSAGE_MUST_BE_SET)); } if (!command.hasContext()) { result.add(newConstraintViolation(COMMAND_CONTEXT_MUST_BE_SET)); } final Message commandMessage = Commands.getMessage(command); final Object targetId = GetTargetIdFromCommand.asNullableObject(commandMessage); if (targetId != null) { final String targetIdString = idToString(targetId); if (targetIdString.equals(EMPTY_ID)) { result.add(newConstraintViolation(COMMAND_TARGET_ENTITY_ID_CANNOT_BE_EMPTY_OR_BLANK)); } } final List<ConstraintViolation> messageViolations = new MessageValidator().validate(commandMessage); result.addAll(messageViolations); final CommandContext context = command.getContext(); final String commandId = idToString(context.getCommandId()); if (commandId.equals(EMPTY_ID)) { result.add(newConstraintViolation(COMMAND_ID_CANNOT_BE_EMPTY_OR_BLANK)); } return result.build(); }
Source:
protected void endStepJob() { GlusterAsyncTask asyncTask = getGlusterVolume().getAsyncTask(); Step step = DbFacade.getInstance().getStepDao().getStepsByExternalId(asyncTask.getTaskId()).get(0); step.markStepEnded(JobExecutionStatus.ABORTED); step.setDescription(ExecutionMessageDirector.resolveStepMessage(getStepType(), getStepMessageMap(JobExecutionStatus.ABORTED))); JobRepositoryFactory.getJobRepository().updateStep(step); ExecutionContext finalContext = ExecutionHandler.createFinalizingContext(step.getId()); ExecutionHandler.endTaskJob(finalContext, false); }

Target:
protected void endStepJob() { GlusterAsyncTask asyncTask = getGlusterVolume().getAsyncTask(); Step step = getStepDao().getStepsByExternalId(asyncTask.getTaskId()).get(0); step.markStepEnded(JobExecutionStatus.ABORTED); step.setDescription(ExecutionMessageDirector.resolveStepMessage(getStepType(), getStepMessageMap(JobExecutionStatus.ABORTED))); JobRepositoryFactory.getJobRepository().updateStep(step); ExecutionContext finalContext = ExecutionHandler.createFinalizingContext(step.getId()); ExecutionHandler.endTaskJob(finalContext, false); }
Source:
private void updateProgramRecord(final SAMRecord record, final Map<String, String> chainedPgIds) { if (PROGRAM_RECORD_ID != null) { final String pgId = record.getStringAttribute(SAMTag.PG.name()); if (null == pgId) { if (!warnedNullProgramRecords) { warnedNullProgramRecords = true; log.warn("Encountered a record with no program record, program group chaining will not occur for this read: " + record); } } else if (!chainedPgIds.containsKey(pgId)) { if (!warnedMissingProgramRecords) { warnedMissingProgramRecords = true; log.warn("Encountered a record with a intermediate program record, program group chaining will not occur for this read: " + record); } } else { record.setAttribute(SAMTag.PG.name(), chainedPgIds.get(pgId)); } } }

Target:
private void updateProgramRecord(final SAMRecord record, final Map<String, String> chainedPgIds) { if (PROGRAM_RECORD_ID != null) { final String pgId = record.getStringAttribute(SAMTag.PG.name()); if (null == pgId) { if (!warnedNullProgramRecords) { warnedNullProgramRecords = true; log.warn("Encountered a record with no program record, program group chaining will not occur for this read: " + record); } } else if (!chainedPgIds.containsKey(pgId)) { if (!warnedMissingProgramRecords) { warnedMissingProgramRecords = true; log.warn("Encountered a record with an intermediate program record, program group chaining will not occur for this read: " + record); } } else { record.setAttribute(SAMTag.PG.name(), chainedPgIds.get(pgId)); } } }
Source:
private GraphDatabaseAPI deleteLogFilesAndRestart() throws IOException { final Predicate<Path> logFileFilter = p -> p.getFileName().toString().contains( "logical" ); return dbRule.restartDatabase( ( fs, storeDirectory ) -> { Iterable<Path> logFiles = Files.list( storeDir ).filter( logFileFilter )::iterator; for ( Path logFile : logFiles ) { Files.delete( logFile ); } } ); }

Target:
private GraphDatabaseAPI deleteLogFilesAndRestart() throws IOException { List<File> logFiles = new ArrayList<>(); NeoStoreDataSource dataSource = dbRule.resolveDependency( NeoStoreDataSource.class ); try ( ResourceIterator<StoreFileMetadata> files = dataSource.listStoreFiles( true ) ) { files.stream().filter( StoreFileMetadata::isLogFile ) .map( StoreFileMetadata::file ) .forEach( logFiles::add ); } return dbRule.restartDatabase( ( fs, storeDirectory ) -> { for ( File logFile : logFiles ) { fs.deleteFile( logFile ); } } ); }
Source:
public static String toJson(Date date) { dateFormat.setTimeZone(TimeZone.getTimeZone(DEFAULT_TIMEZONE)); return toJson(date, dateFormat); }

Target:
public static String toJson(Date date) { if (date == null) { return NULL_VALUE; } CharBuf buffer = CharBuf.create(26); writeDate(date, buffer); return buffer.toString(); }
Source:
public InternalResourceGroup getLatest() { InternalResourceGroup latest = this; while (latest.getNext().isPresent()) { latest = latest.getNext().get(); } return latest; }

Target:
public InternalResourceGroup getLatest() { synchronized (root) { InternalResourceGroup latest = this; while (latest.next.isPresent()) { latest = latest.next.get(); } return latest; } }
Source:
public void init() { initMocks(this); parentPid = PIDs.get(UUID.randomUUID().toString()); memberPid = PIDs.get(UUID.randomUUID().toString()); memberUuid = memberPid.getId(); parentUuid = parentPid.getId(); testDate = new Date(System.currentTimeMillis() + ONE_DAY); objPrincRoles = new HashMap<>(); addPrincipalRoles(objPrincRoles, MANAGE_PRINC, canManage); addPrincipalRoles(objPrincRoles, PATRON_PRINC, canViewMetadata); aclRetrievalService = new AccessControlRetrievalService(); aclRetrievalService.setAclFactory(aclFactory); aclRetrievalService.setAclService(aclService); aclRetrievalService.setRepoObjLoader(repoObjLoader); }

Target:
public void init() { initMocks(this); parentPid = PIDs.get(UUID.randomUUID().toString()); memberPid = PIDs.get(UUID.randomUUID().toString()); memberUuid = memberPid.getId(); parentUuid = parentPid.getId(); testDate = new Date(System.currentTimeMillis() + ONE_DAY); objPrincRoles = new HashMap<>(); addPrincipalRoles(objPrincRoles, MANAGE_PRINC, canManage); addPrincipalRoles(objPrincRoles, PATRON_PRINC, canViewMetadata); aclRetrievalService = new AccessControlRetrievalService(); aclRetrievalService.setObjectAclFactory(objAclFactory); aclRetrievalService.setInheritedAclFactory(inheritedAclFactory); aclRetrievalService.setAclService(aclService); aclRetrievalService.setRepoObjLoader(repoObjLoader); when(objAclFactory.isMarkedForDeletion(any(PID.class))).thenReturn(false); when(objAclFactory.getPrincipalRoles(any(PID.class))).thenReturn(objPrincRoles); when(objAclFactory.getEmbargoUntil(any(PID.class))).thenReturn(testDate); when(objAclFactory.getPatronAccess(any(PID.class))).thenReturn(PatronAccess.authenticated); when(inheritedAclFactory.isMarkedForDeletion(any(PID.class))).thenReturn(false); when(inheritedAclFactory.getPrincipalRoles(any(PID.class))).thenReturn(objPrincRoles); when(inheritedAclFactory.getEmbargoUntil(any(PID.class))).thenReturn(testDate); when(inheritedAclFactory.getPatronAccess(any(PID.class))).thenReturn(PatronAccess.authenticated); }
Source:
private void loadChildEntities(LibraryDilution dilution) throws IOException { if (dilution.getLibrary() != null) { dilution.setLibrary(libraryDao.get(dilution.getLibrary().getId())); } if (dilution.getTargetedSequencing() != null) { dilution.setTargetedSequencing(targetedSequencingDao.get(dilution.getTargetedSequencing().getId())); } dilution.setDilutionCreator(authorizationManager.getCurrentUsername()); }

Target:
private void loadChildEntities(LibraryDilution dilution) throws IOException { if (dilution.getLibrary() != null) { dilution.setLibrary(libraryDao.get(dilution.getLibrary().getId())); } if (dilution.getTargetedSequencing() != null) { dilution.setTargetedSequencing(targetedSequencingDao.get(dilution.getTargetedSequencing().getId())); } }
Source:
private void evaluateGeoRepSessionStatus(CommandBase<?> rootCommand) { GlusterStorageSyncCommandParameters parameters = (GlusterStorageSyncCommandParameters) rootCommand.getParameters(); GlusterGeoRepSession session = geoRepDao.getById(parameters.getGeoRepSessionId()); if (session == null) { rootCommand.setCommandStatus(CommandStatus.FAILED); return; } session.setSessionDetails( (ArrayList<GlusterGeoRepSessionDetails>) geoRepDao.getGeoRepSessionDetails(session.getId())); switch (session.getStatus()) { case ACTIVE: if (session.isCheckPointCompleted()) { stopGeoRepSessionCommand(rootCommand, session); rootCommand.setCommandStatus(CommandStatus.SUCCEEDED); } case FAULTY: rootCommand.setCommandStatus(CommandStatus.FAILED); default: break; } }

Target:
private void evaluateGeoRepSessionStatus(CommandBase<?> rootCommand) { GlusterStorageSyncCommandParameters parameters = (GlusterStorageSyncCommandParameters) rootCommand.getParameters(); GlusterGeoRepSession session = geoRepDao.getById(parameters.getGeoRepSessionId()); if (session == null) { rootCommand.setCommandStatus(CommandStatus.FAILED); return; } session.setSessionDetails( (ArrayList<GlusterGeoRepSessionDetails>) geoRepDao.getGeoRepSessionDetails(session.getId())); switch (session.getStatus()) { case ACTIVE: if (session.isCheckPointCompleted()) { stopGeoRepSessionCommand(rootCommand, session); rootCommand.setCommandStatus(CommandStatus.SUCCEEDED); } break; case FAULTY: rootCommand.setCommandStatus(CommandStatus.FAILED); default: break; } }
Source:
public static WanPublisherState getByType(final byte id) { for (WanPublisherState state : values()) { if (state.id == id) { return state; } } return null; }

Target:
public static WanPublisherState getByType(final byte id) { for (WanPublisherState state : STATE_VALUES) { if (state.id == id) { return state; } } return null; }
Source:
public void handle(Request request, Response response) { userSession.checkLoggedIn(); try (DbSession dbSession = dbClient.openSession(false)) { QualityProfileDto qualityProfile = qProfileWsSupport.getProfile(dbSession, QProfileReference.from(request)); userSession.checkPermission(ADMINISTER_QUALITY_PROFILES, qualityProfile.getOrganizationUuid()); setDefault(dbSession, qualityProfile); dbSession.commit(); } response.noContent(); }

Target:
public void handle(Request request, Response response) { userSession.checkLoggedIn(); QProfileReference reference = QProfileReference.from(request); try (DbSession dbSession = dbClient.openSession(false)) { QualityProfileDto qualityProfile = qProfileWsSupport.getProfile(dbSession, reference); userSession.checkPermission(ADMINISTER_QUALITY_PROFILES, qualityProfile.getOrganizationUuid()); setDefault(dbSession, qualityProfile); dbSession.commit(); } response.noContent(); }
Source:
private void handleUncommittedChanges(final RebaseOperation rebase, final Repository repository, final List<String> files) { PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() { public void run() { Shell shell = PlatformUI.getWorkbench() .getActiveWorkbenchWindow().getShell(); CleanupUncomittedChangesDialog cleanupUncomittedChangesDialog = new CleanupUncomittedChangesDialog( shell, UIText.AbstractRebaseCommandHandler_cleanupDialog_title, UIText.AbstractRebaseCommandHandler_cleanupDialog_text, repository, files); cleanupUncomittedChangesDialog.open(); if (cleanupUncomittedChangesDialog.shouldContinue()) { startRebaseJob(rebase, repository, rebase.getOperation()); } } }); }

Target:
private void handleUncommittedChanges(final RebaseOperation rebase, final Repository repository, final List<String> files) { PlatformUI.getWorkbench().getDisplay().asyncExec(new Runnable() { public void run() { Shell shell = PlatformUI.getWorkbench() .getActiveWorkbenchWindow().getShell(); CleanupUncomittedChangesDialog cleanupUncomittedChangesDialog = new CleanupUncomittedChangesDialog( shell, UIText.AbstractRebaseCommandHandler_cleanupDialog_title, UIText.AbstractRebaseCommandHandler_cleanupDialog_text, repository, files); cleanupUncomittedChangesDialog.open(); if (cleanupUncomittedChangesDialog.shouldContinue()) { try { execute(repository); } catch (ExecutionException e) { Activator.logError(e.getMessage(), e); } } } }); }
Source:
public PartitionBoundaries(String... partitions) { if (partitions.length == 0) { delegate = Collections.emptyList(); return; } List<String> partitionBoundaries = Arrays.stream(partitions) .distinct() .collect(Collectors.toCollection(ArrayList::new)); partitionBoundaries.set(0, null); partitionBoundaries.add(null); delegate = Collections.unmodifiableList(partitionBoundaries); }

Target:
public PartitionBoundaries(String... partitions) { if (partitions.length == 0) { delegate = Collections.emptyList(); return; } List<String> partitionBoundaries = Arrays.stream(partitions) .distinct() .collect(Collectors.toCollection(ArrayList::new)); partitionBoundaries.set(0, null); if (partitionBoundaries.size() == 1) { partitionBoundaries.add(null); } else { partitionBoundaries.set(partitionBoundaries.size() - 1, null); } delegate = Collections.unmodifiableList(partitionBoundaries); }
Source:
static ConfigurableApplicationContext createApplicationContext(final Properties properties) { String transport = properties.getProperty("XD_TRANSPORT"); if (properties.getProperty(RABBIT_ACKMODE_PROPERTY) != null) { properties.setProperty(RABBIT_ACKMODE_PROPERTY, "MANUAL"); } properties.setProperty("isKafkaAutoCommitEnabled", "false"); SpringApplicationBuilder application = new SpringApplicationBuilder() .sources(MessageBusConfiguration.class) .listeners(new ApplicationListener<ApplicationEnvironmentPreparedEvent>() { @Override public void onApplicationEvent(ApplicationEnvironmentPreparedEvent event) { event.getEnvironment().getPropertySources().addFirst( new PropertiesPropertySource("executorEnvironment", properties)); } }) .web(false) .showBanner(false); if (transport.equals("rabbit")) { application.sources(RabbitAutoConfiguration.class); } else if (transport.equals("redis")) { application.sources(RedisAutoConfiguration.class); } application.run(); return application.context(); }

Target:
static ConfigurableApplicationContext createApplicationContext(final Properties properties) { String transport = properties.getProperty("XD_TRANSPORT"); properties.setProperty(RABBIT_ACKMODE_PROPERTY, "MANUAL"); properties.setProperty(KAFKA_AUTOCOMMIT_PROPERTY, "false"); SpringApplicationBuilder application = new SpringApplicationBuilder() .sources(MessageBusConfiguration.class) .listeners(new ApplicationListener<ApplicationEnvironmentPreparedEvent>() { @Override public void onApplicationEvent(ApplicationEnvironmentPreparedEvent event) { event.getEnvironment().getPropertySources().addFirst( new PropertiesPropertySource("executorEnvironment", properties)); } }) .web(false) .showBanner(false); if (transport.equals("rabbit")) { application.sources(RabbitAutoConfiguration.class); } else if (transport.equals("redis")) { application.sources(RedisAutoConfiguration.class); } application.run(); return application.context(); }
Source:
protected List<BusLine> doInBackground(Void... params) { try { String jsonStr = BusTimetableLoader.downloadFromAvrisApi(HTTPLinks.BUS + "linie"); JSONArray categories = new JSONObject(jsonStr).getJSONArray("categories"); List<BusLine> result = new ArrayList<>(); for (int i = 0; i < categories.length(); i++) { JSONObject category = categories.getJSONObject(i); String categoryName = category.getString("name"); if (!( "tram".equals(categoryName) || "bus".equals(categoryName) || "busp".equals(categoryName) )) { continue; } JSONArray lines = category.getJSONArray("lines"); for (int j = 0; j < lines.length(); j++) { JSONObject lineJson = lines.getJSONObject(j); result.add(new BusLine(lineJson.getInt("id"), lineJson.getString("line"))); } } return result; } catch (Exception e) { e.printStackTrace(); return null; } }

Target:
protected List<BusLine> doInBackground(Void... params) { try { String jsonStr = BusTimetableLoader.downloadFromAvrisApi(HTTPLinks.BUS_LINES); JSONArray categories = new JSONObject(jsonStr).getJSONArray("categories"); List<BusLine> result = new ArrayList<>(); for (int i = 0; i < categories.length(); i++) { JSONObject category = categories.getJSONObject(i); String categoryName = category.getString("name"); if (!( "tram".equals(categoryName) || "bus".equals(categoryName) || "busp".equals(categoryName) )) { continue; } JSONArray lines = category.getJSONArray("lines"); for (int j = 0; j < lines.length(); j++) { JSONObject lineJson = lines.getJSONObject(j); result.add(new BusLine(lineJson.getInt("id"), lineJson.getString("line"))); } } return result; } catch (Exception e) { e.printStackTrace(); return null; } }
Source:
public void deserialize(MarshallerReaderContext inCtx, Timer timer) throws ClassNotFoundException { JBPMMessages.ProcessTimer ptimer = timer.getExtension(JBPMMessages.procTimer); TimerService ts = inCtx.wm.getTimerService(); long processInstanceId = ptimer.getTimer().getProcessInstanceId(); Trigger trigger = ProtobufInputMarshaller.readTrigger(inCtx, ptimer.getTrigger()); TimerInstance timerInstance = ProtobufProcessMarshaller.readTimer(inCtx, ptimer.getTimer()); TimerManager tm = ((InternalProcessRuntime) inCtx.wm.getProcessRuntime()).getTimerManager(); if (!tm.getTimerMap().containsKey(timerInstance.getId())) { ProcessJobContext pctx = new ProcessJobContext(timerInstance, trigger, processInstanceId, inCtx.wm.getKnowledgeRuntime(), false); Date date = trigger.hasNextFireTime(); if (date != null) { long then = date.getTime(); long now = pctx.getKnowledgeRuntime().getSessionClock().getCurrentTime(); if (then < now) { trigger = new OverdueTrigger(trigger); } } trigger.initialize(pctx.getWorkingMemory().getKnowledgeRuntime()); JobHandle jobHandle = ts.scheduleJob(processJob, pctx, trigger); timerInstance.setJobHandle(jobHandle); pctx.setJobHandle(jobHandle); tm.getTimerMap().put(timerInstance.getId(), timerInstance); } }

Target:
public void deserialize(MarshallerReaderContext inCtx, Timer timer) throws ClassNotFoundException { JBPMMessages.ProcessTimer ptimer = timer.getExtension(JBPMMessages.procTimer); TimerService ts = inCtx.wm.getTimerService(); long processInstanceId = ptimer.getTimer().getProcessInstanceId(); Trigger trigger = ProtobufInputMarshaller.readTrigger(inCtx, ptimer.getTrigger()); TimerInstance timerInstance = ProtobufProcessMarshaller.readTimer(inCtx, ptimer.getTimer()); TimerManager tm = ((InternalProcessRuntime) inCtx.wm.getProcessRuntime()).getTimerManager(); if (!tm.getTimerMap().containsKey(timerInstance.getId())) { ProcessJobContext pctx = new ProcessJobContext(timerInstance, trigger, processInstanceId, inCtx.wm.getKnowledgeRuntime(), false); Date date = trigger.hasNextFireTime(); if (date != null) { long then = date.getTime(); long now = pctx.getKnowledgeRuntime().getSessionClock().getCurrentTime(); if (then < now) { trigger = new OverdueTrigger(trigger); } } trigger.initialize(pctx.getKnowledgeRuntime()); JobHandle jobHandle = ts.scheduleJob(processJob, pctx, trigger); timerInstance.setJobHandle(jobHandle); pctx.setJobHandle(jobHandle); tm.getTimerMap().put(timerInstance.getId(), timerInstance); } }
Source:
public static List<String> split(String path) { PathUtils.validatePath(path); if (path.length() == 1) { return Collections.emptyList(); } int lastPos = 1; List<String> parts = new ArrayList<String>(); while (true) { int nextPos = path.indexOf('/', lastPos); if (nextPos < 0) { parts.add(path.substring(lastPos)); break; } parts.add(path.substring(lastPos, nextPos)); lastPos = nextPos + 1; } return parts; }

Target:
public static List<String> split(String path) { PathUtils.validatePath(path); return PATH_SPLITTER.splitToList(path); }
Source:
void setWaiting(int value) { WAITING_UPDATER.lazySet(this, value); }

Target:
void setWaiting(int value) { waiting = value; }
Source:
public String getRegistryURL(IConnection connection) { IServer s = findServer(connection); if( s != null ) { ServiceManagerEnvironmentLoader type = ServiceManagerEnvironmentLoader.type(s); ServiceManagerEnvironment env = type.getOrLoadServiceManagerEnvironment(s, true); String dockerReg = env.getDockerRegistry(); return dockerReg; } return null; }

Target:
public String getRegistryURL(IConnection connection) { IServer s = findServer(connection); if( s != null ) { ServiceManagerEnvironment env = getServiceManagerEnvironment(s); return env.getDockerRegistry(); } return null; }