auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static void main(String[] args) { final RestServer restServer; try { final InvocationOptions options = new InvocationOptions(args); PropertyConfigurator.configure(options.logPropsFile); final Properties properties = Utils.loadProps(options.serverPropsFilePath); final VerifiableProperties verifiableProperties = new VerifiableProperties(properties); final MetricRegistry metricRegistry = new MetricRegistry(); final ClusterMap clusterMap = new ClusterMapManager(options.hardwareLayoutFilePath, options.partitionLayoutFilePath, new ClusterMapConfig(verifiableProperties)); logger.info("Bootstrapping RestServer"); restServer = new RestServer(verifiableProperties, metricRegistry, clusterMap); Runtime.getRuntime().addShutdownHook(new Thread() { public void run() { logger.info("Received shutdown signal. Requesting RestServer shutdown"); restServer.shutdown(); } }); restServer.start(); restServer.awaitShutdown(); } catch (Exception e) { logger.error("Exception during bootstrap of RestServer", e); } finally { logger.info("Exiting"); System.exit(0); } }

Target:
public static void main(String[] args) { final RestServer restServer; try { final InvocationOptions options = new InvocationOptions(args); PropertyConfigurator.configure(options.logPropsFile); final Properties properties = Utils.loadProps(options.serverPropsFilePath); final VerifiableProperties verifiableProperties = new VerifiableProperties(properties); final MetricRegistry metricRegistry = new MetricRegistry(); final ClusterMap clusterMap = new ClusterMapManager(options.hardwareLayoutFilePath, options.partitionLayoutFilePath, new ClusterMapConfig(verifiableProperties)); logger.info("Bootstrapping RestServer"); restServer = new RestServer(verifiableProperties, metricRegistry, clusterMap); Runtime.getRuntime().addShutdownHook(new Thread() { public void run() { logger.info("Received shutdown signal. Requesting RestServer shutdown"); restServer.shutdown(); } }); restServer.start(); restServer.awaitShutdown(); } catch (Exception e) { logger.error("Exception during bootstrap of RestServer", e); } finally { logger.info("Exiting RestServerMain"); System.exit(0); } }
Source:
public void testChangeUserPasswordH2DB() throws Exception { String loginStatusString = authenticatorClient.login ("testu1", String.valueOf(userNewPassword), context.getInstance().getHosts().get("default")); assertTrue(loginStatusString.contains("JSESSIONID"), "Unsuccessful login"); }

Target:
public void testChangeUserPasswordH2DB() throws Exception { String loginStatusString = authenticatorClient.login (userName, String.valueOf(userNewPassword), automationContext.getInstance().getHosts().get("default")); assertTrue(loginStatusString.contains("JSESSIONID"), "Unsuccessful login"); }
Source:
private boolean isNotSpendingTxnsInConfidenceType(Transaction tx, ConfidenceType confidenceType) { boolean isNotSpendingTxnsInConfidenceType = true; for (TransactionInput txInput : tx.getInputs()) { Transaction connectedTx = this.getTransaction(txInput.getOutpoint().getHash()); if (connectedTx!=null && connectedTx.getConfidence().getConfidenceType().equals(confidenceType)) { isNotSpendingTxnsInConfidenceType = false; } } return isNotSpendingTxnsInConfidenceType; }

Target:
private boolean isNotSpendingTxnsInConfidenceType(Transaction tx, ConfidenceType confidenceType) { for (TransactionInput txInput : tx.getInputs()) { Transaction connectedTx = this.getTransaction(txInput.getOutpoint().getHash()); if (connectedTx != null && connectedTx.getConfidence().getConfidenceType().equals(confidenceType)) { return false; } } return true; }
Source:
public void writeToNBT(NBTTagCompound nbt) { nbt.setInteger("dimension", this.dimension); nbt.setTag("ForgeCaps", serializable.serializeNBT()); }

Target:
public void writeToNBT(NBTTagCompound nbt) { nbt.setTag("ForgeCaps", serializable.serializeNBT()); }
Source:
public TmfStatisticsTree getStatisticData() { return fModel.getStatisticData(); }

Target:
public TmfStatisticsTree getStatisticData() { if (fStatisticsData == null) { fStatisticsData = new TmfStatisticsTree(); } return fStatisticsData; }
Source:
public static Project parseProject(JSONObject content) throws JSONException { final Project result = new Project(); result.setId(JsonInput.getInt(content, "id")); result.setIdentifier(JsonInput.getStringOrNull(content, "identifier")); result.setName(JsonInput.getStringNotNull(content, "name")); result.setDescription(JsonInput .getStringOrEmpty(content, "description")); result.setHomepage(JsonInput.getStringOrEmpty(content, "homepage")); result.setCreatedOn(getDateOrNull(content, "created_on")); result.setUpdatedOn(getDateOrNull(content, "updated_on")); final JSONObject parentProject = JsonInput.getObjectOrNull(content, "parent"); if (parentProject != null) result.setParentId(JsonInput.getInt(parentProject, "id")); result.setTrackers(JsonInput.getListOrNull(content, "trackers", TRACKER_PARSER)); result.setCustomFields(JsonInput.getListOrNull(content, "custom_fields", CUSTOM_FIELD_PARSER)); return result; }

Target:
public static Project parseProject(JSONObject content) throws JSONException { final Project result = new Project(); result.setId(JsonInput.getInt(content, "id")); result.setIdentifier(JsonInput.getStringOrNull(content, "identifier")); result.setName(JsonInput.getStringNotNull(content, "name")); result.setDescription(JsonInput .getStringOrEmpty(content, "description")); result.setHomepage(JsonInput.getStringOrEmpty(content, "homepage")); result.setCreatedOn(getDateOrNull(content, "created_on")); result.setUpdatedOn(getDateOrNull(content, "updated_on")); final JSONObject parentProject = JsonInput.getObjectOrNull(content, "parent"); if (parentProject != null) result.setParentId(JsonInput.getInt(parentProject, "id")); result.setTrackers(JsonInput.getListOrNull(content, "trackers", TRACKER_PARSER)); result.setCustomFields(JsonInput.getListOrEmpty(content, "custom_fields", CUSTOM_FIELD_PARSER)); return result; }
Source:
public BlobIndexValue(long size, long offset) { this(size, offset, (byte)0, Utils.Infinite_TTL); }

Target:
public BlobIndexValue(long size, long offset) { this(size, offset, (byte)0, Utils.Infinite_Time); }
Source:
private void closeOpenEditorsForProject(IProject project) { final List<IEditorReference> editorsToBeClosed = new ArrayList<>(); Map<IFile, IEditorReference> fileEditors = findAllEditorReferences(); try { List<IFile> projectfiles = findAllProjectFiles(project); for (IResource resource : projectfiles) { if (fileEditors.containsKey(resource)) { editorsToBeClosed.add(fileEditors.get(resource)); } } } catch (CoreException e) { Activator.logError("Problems during auto-close of related editors", e); } if (!editorsToBeClosed.isEmpty()) { PlatformUI.getWorkbench().getDisplay() .syncExec(new Runnable() { @Override public void run() { IEditorReference[] editorToBeClosed = new IEditorReference[editorsToBeClosed .size()]; editorToBeClosed = editorsToBeClosed .toArray(editorToBeClosed); activePage.closeEditors(editorToBeClosed, true); } }); } }

Target:
private void closeOpenEditorsForProject(IProject project) { final List<IEditorReference> editorsToBeClosed = new ArrayList<>(); Map<IFile, IEditorReference> fileEditors = findAllEditorReferences(); Set<IFile> keySet = fileEditors.keySet(); for (IFile file : keySet) { if (file.getProject().equals(project)) { editorsToBeClosed.add(fileEditors.get(file)); } } if (!editorsToBeClosed.isEmpty()) { PlatformUI.getWorkbench().getDisplay() .syncExec(new Runnable() { @Override public void run() { IEditorReference[] editorToBeClosed = new IEditorReference[editorsToBeClosed .size()]; editorToBeClosed = editorsToBeClosed .toArray(editorToBeClosed); activePage.closeEditors(editorToBeClosed, true); } }); } }
Source:
public PerfMmapStateProvider(ITmfTrace trace) { super(trace, "perfMmap"); }

Target:
public PerfMmapStateProvider(ITmfTrace trace) { super(trace, "Perf MMap Symbol Resolution"); }
Source:
public StreamReadsRequest getStreamReadsRequest(String readGroupSetId) { return StreamReadsRequest.newBuilder() .setReadGroupSetId(readGroupSetId) .setReferenceName(referenceName) .setStart(start) .setEnd(end) .build(); }

Target:
StreamReadsRequest getStreamReadsRequest(String readGroupSetId) { return StreamReadsRequest.newBuilder() .setReadGroupSetId(readGroupSetId) .setReferenceName(referenceName) .setStart(start) .setEnd(end) .build(); }
Source:
public Slf4JLogger() { log = LoggerFactory.getLogger(Slf4JLogger.class); }

Target:
public Slf4JLogger() { log = LoggerFactory.getLogger("p6spy"); }
Source:
public Void bootstrapAllSchedules(HttpServletResponse resp, @RequestParam("source") String src, @RequestParam("from") String from, @RequestParam("to") String to) throws IOException { final Maybe<Publisher> source = Publisher.fromKey(src); if (!source.hasValue()) { return failure(resp, BAD_REQUEST, "Unknown source " + src); } final Iterable<Channel> channels = channelResvoler.all(); final LocalDate dateFrom; final LocalDate dateTo; try { dateFrom = dateParser.parseLocalDate(from); } catch (IllegalArgumentException iae) { return failure(resp, BAD_REQUEST, "Failed to parse "+ from +", expected yyyy-MM-dd"); } try { dateTo = dateParser.parseLocalDate(to); } catch (IllegalArgumentException iae) { return failure(resp, BAD_REQUEST, "Failed to parse "+ to +", expected yyyy-MM-dd"); } final Interval interval = interval(dateFrom, dateTo); executor.submit(new Runnable() { @Override public void run() { boolean bootstrapping = scheduleBootstrapper.bootstrapSchedules( channels, interval, source.requireValue() ); if (!bootstrapping) { log.warn("Bootstrapping failed because apparently busy bootstrapping something else."); } } }); return null; }

Target:
public void bootstrapAllSchedules(HttpServletResponse resp, @RequestParam("source") String src, @RequestParam("from") String from, @RequestParam("to") String to) throws IOException { final Maybe<Publisher> source = Publisher.fromKey(src); if (!source.hasValue()) { failure(resp, BAD_REQUEST, "Unknown source " + src); return; } final Iterable<Channel> channels = channelResvoler.all(); final LocalDate dateFrom; final LocalDate dateTo; try { dateFrom = dateParser.parseLocalDate(from); } catch (IllegalArgumentException iae) { failure(resp, BAD_REQUEST, "Failed to parse "+ from +", expected yyyy-MM-dd"); return; } try { dateTo = dateParser.parseLocalDate(to); } catch (IllegalArgumentException iae) { failure(resp, BAD_REQUEST, "Failed to parse "+ to +", expected yyyy-MM-dd"); return; } final Interval interval = interval(dateFrom, dateTo); executor.submit(new Runnable() { @Override public void run() { boolean bootstrapping = scheduleBootstrapper.bootstrapSchedules( channels, interval, source.requireValue() ); if (!bootstrapping) { log.warn("Bootstrapping failed because apparently busy bootstrapping something else."); } } }); }
Source:
public Map<ManagementLink.Category, List<ManagementLink>> getCategorizedManagementLinks() { Map<ManagementLink.Category, List<ManagementLink>> byCategory = new TreeMap<>(); for (ManagementLink link : ManagementLink.all()) { if (link.getIconFileName() == null) { continue; } if (!Jenkins.get().hasPermission(link.getRequiredPermission())) { continue; } String categoryName = link.getCategory(); ManagementLink.Category category; try { category = ManagementLink.Category.valueOf(categoryName); } catch (IllegalArgumentException ex) { category = ManagementLink.Category.UNCATEGORIZED; } byCategory.computeIfAbsent(category, c -> new ArrayList<>()).add(link); } return byCategory; }

Target:
public Map<ManagementLink.Category, List<ManagementLink>> getCategorizedManagementLinks() { Map<ManagementLink.Category, List<ManagementLink>> byCategory = new TreeMap<>(); for (ManagementLink link : ManagementLink.all()) { if (link.getIconFileName() == null) { continue; } if (!Jenkins.get().hasPermission(link.getRequiredPermission())) { continue; } byCategory.computeIfAbsent(link.getCategory(), c -> new ArrayList<>()).add(link); } return byCategory; }
Source:
private CompletableFuture<DetectorTask> handleSequencer(Layout layout) { log.trace("Handling sequencer failures"); if (localMonitoringService.getMetrics().join().getSequencerStatus() == SequencerStatus.READY) { log.trace("Primary sequencer is ready. Nothing to do"); return DETECTOR_TASK_SKIPPED; } if (sequencerNotReadyCounter.getEpoch() != layout.getEpoch()) { log.trace("Current epoch is different to layout epoch. Update current epoch to: {}", layout.getEpoch()); sequencerNotReadyCounter = new SequencerNotReadyCounter(layout.getEpoch(), 1); return DETECTOR_TASK_SKIPPED; } sequencerNotReadyCounter.increment(); if (sequencerNotReadyCounter.getCounter() < SEQUENCER_NOT_READY_THRESHOLD) { return DETECTOR_TASK_SKIPPED; } ClusterState clusterState = clusterContext.getClusterView(); if (clusterState.isPrimarySequencerReady()) { log.trace("Primary sequencer is already bootstrapped: {}", clusterState); return DETECTOR_TASK_SKIPPED; } log.info("Attempting to bootstrap the primary sequencer. ClusterState {}", clusterState); return getCorfuRuntime() .getLayoutManagementView() .asyncSequencerBootstrap(serverContext.copyManagementLayout(), failureDetectorWorker) .thenApply(DetectorTask::fromBool); }

Target:
private CompletableFuture<DetectorTask> handleSequencer(Layout layout) { log.trace("Handling sequencer failures"); ClusterState clusterState = clusterContext.getClusterView(); Optional<NodeState> primarySequencer = clusterState.getNode(layout.getPrimarySequencer()); if (primarySequencer.isPresent() && primarySequencer.get().getSequencerMetrics() == SequencerMetrics.READY) { log.trace("Primary sequencer is already ready at: in {}", primarySequencer.get(), clusterState); return DETECTOR_TASK_SKIPPED; } if (sequencerNotReadyCounter.getEpoch() != layout.getEpoch()) { log.trace("Current epoch is different to layout epoch. Update current epoch to: {}", layout.getEpoch()); sequencerNotReadyCounter = new SequencerNotReadyCounter(layout.getEpoch(), 1); return DETECTOR_TASK_SKIPPED; } sequencerNotReadyCounter.increment(); if (sequencerNotReadyCounter.getCounter() < SEQUENCER_NOT_READY_THRESHOLD) { return DETECTOR_TASK_SKIPPED; } log.info("Attempting to bootstrap the primary sequencer. ClusterState {}", clusterState); return getCorfuRuntime() .getLayoutManagementView() .asyncSequencerBootstrap(serverContext.copyManagementLayout(), failureDetectorWorker) .thenApply(DetectorTask::fromBool); }
Source:
public void start() { for (ClusterDescriptor remoteCluster : topologyDescriptor.getStandbyClusters().values()) { try { startLogReplicationRuntime(remoteCluster); } catch (Exception e) { log.error("Failed to start log replication runtime for remote cluster {}", remoteCluster.getClusterId()); topologyDescriptor.getStandbyClusters().remove(remoteCluster.getClusterId()); } } }

Target:
public void start() { for (ClusterDescriptor remoteCluster : topology.getStandbyClusters().values()) { try { startLogReplicationRuntime(remoteCluster); } catch (Exception e) { log.error("Failed to start log replication runtime for remote cluster {}", remoteCluster.getClusterId()); } } }
Source:
private List<Channel> getSourceChannels(Map<String, ChannelComponent> channelComponentMap, Source source, Collection<String> channelNames) { List<Channel> sourceChannels = new ArrayList<Channel>(); for (String chName : channelNames) { ChannelComponent channelComponent = channelComponentMap.get(chName); if (channelComponent != null) { try { checkSourceChannelCompatibility(source, channelComponent.channel); sourceChannels.add(channelComponent.channel); } catch (InstantiationException e) { LOGGER.error("Source - channel compatibility problem", e); } } } return sourceChannels; }

Target:
private List<Channel> getSourceChannels(Map<String, ChannelComponent> channelComponentMap, Source source, Collection<String> channelNames) throws InstantiationException { List<Channel> sourceChannels = new ArrayList<Channel>(); for (String chName : channelNames) { ChannelComponent channelComponent = channelComponentMap.get(chName); if (channelComponent != null) { checkSourceChannelCompatibility(source, channelComponent.channel); sourceChannels.add(channelComponent.channel); } } return sourceChannels; }
Source:
protected void executeCommand() { VDSReturnValue vdsReturnValue = extendUnderlyingVolumeSize(getImage()); setSucceeded(vdsReturnValue.getSucceeded()); if (vdsReturnValue.getSucceeded()) { Guid taskId = createTask(getAsyncTaskId(), vdsReturnValue.getCreationInfo(), getParameters().getParentCommand()); getTaskIdList().add(taskId); if (getParameters().getParentNotifiesCallback()) { getReturnValue().getInternalVdsmTaskIdList().add(taskId); List<Guid> vdsmTaskIds = new ArrayList<>(); vdsmTaskIds.add(taskId); getParameters().setVdsmTaskIds(vdsmTaskIds); getReturnValue().getVdsmTaskIdList().add(taskId); persistCommand(getParameters().getParentCommand(), true); getParameters().setVdsmTaskIds(new ArrayList<>(Collections.singletonList(taskId))); getReturnValue().getVdsmTaskIdList().add(taskId); persistCommand(getParameters().getParentCommand(), true); } } else { updateAuditLog(AuditLogType.USER_EXTEND_DISK_SIZE_FAILURE, getParameters().getNewSizeInGB()); } }

Target:
protected void executeCommand() { VDSReturnValue vdsReturnValue = extendUnderlyingVolumeSize(getImage()); setSucceeded(vdsReturnValue.getSucceeded()); if (vdsReturnValue.getSucceeded()) { Guid taskId = createTask(getAsyncTaskId(), vdsReturnValue.getCreationInfo(), getParameters().getParentCommand()); getTaskIdList().add(taskId); if (getParameters().getParentNotifiesCallback()) { getReturnValue().getVdsmTaskIdList().add(taskId); getReturnValue().getInternalVdsmTaskIdList().add(taskId); getParameters().setVdsmTaskIds(new ArrayList<>(Collections.singletonList(taskId))); persistCommand(getParameters().getParentCommand(), true); } } else { updateAuditLog(AuditLogType.USER_EXTEND_DISK_SIZE_FAILURE, getParameters().getNewSizeInGB()); } }
Source:
public void testResetPassword_shouldReturnResponseEntityWithCreatedStatus(){ String username = "superuser"; PasswordResetBackingForm form = aPasswordResetBackingForm().withUsername(username).build(); passwordResetController.resetPassword(form); verify(passwordResetControllerService).resetPassword(form); Assert.assertEquals("Response status should be CREATED", HttpStatus.CREATED, passwordResetController.resetPassword(form).getStatusCode()); }

Target:
public void testResetPassword_shouldReturnResponseEntityWithCreatedStatus() { String username = "superuser"; PasswordResetBackingForm form = aPasswordResetBackingForm().withUsername(username).build(); HttpStatus statusCode = passwordResetController.resetPassword(form).getStatusCode(); Assert.assertEquals("Response status should be CREATED", HttpStatus.CREATED, statusCode); }
Source:
public IPath computeFixedPath(IStorage storage) { final IPath fixedPath; final GitBlobStorage gitStorage = (GitBlobStorage)storage; if (storage instanceof WorkspaceGitBlobStorage) { fixedPath = ((WorkspaceGitBlobStorage)gitStorage).getWorkspacePath(); } else { final IPath absolutePath = gitStorage.getAbsolutePath(); final IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); IFile fileForLocation = root.getFileForLocation(absolutePath); if (fileForLocation != null) { fixedPath = fileForLocation.getFullPath(); } else { fixedPath = null; } } return fixedPath; }

Target:
public IPath computeFixedPath(IStorage storage) { final IPath fixedPath; if (storage instanceof WorkspaceGitBlobStorage) { fixedPath = ((WorkspaceGitBlobStorage)storage).getWorkspacePath(); } else if (storage instanceof GitBlobStorage) { final IPath absolutePath = ((GitBlobStorage)storage).getAbsolutePath(); final IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); IFile fileForLocation = root.getFileForLocation(absolutePath); if (fileForLocation != null) { fixedPath = fileForLocation.getFullPath(); } else { fixedPath = null; } } else { fixedPath = null; } return fixedPath; }
Source:
private static ServiceMethodAdpaterInfo parseServiceMethodAdapterInfo(Method method) { Type[] genericParameterTypes = method.getGenericParameterTypes(); if (genericParameterTypes.length != 0) { Type lastParameterType = genericParameterTypes[genericParameterTypes.length - 1]; if (lastParameterType instanceof ParameterizedType) { ParameterizedType parameterizedLastParameterType = (ParameterizedType) lastParameterType; try { if (parameterizedLastParameterType.getRawType() == Continuation.class) { Type resultType = parameterizedLastParameterType.getActualTypeArguments()[0]; if (resultType instanceof WildcardType) { resultType = ((WildcardType) resultType).getLowerBounds()[0]; } if (resultType instanceof ParameterizedType) { ParameterizedType parameterizedResultType = (ParameterizedType) resultType; if (parameterizedResultType.getRawType() == Response.class) { Type bodyType = parameterizedResultType.getActualTypeArguments()[0]; Type callType = new CallParameterizedTypeImpl(bodyType); return new ServiceMethodAdpaterInfo(true, true, callType); } } Type callType = new CallParameterizedTypeImpl(resultType); return new ServiceMethodAdpaterInfo(true, false, callType); } } catch (NoClassDefFoundError ignored) { } } } return new ServiceMethodAdpaterInfo(false, false, method.getGenericReturnType()); }

Target:
private static ServiceMethodAdapterInfo parseServiceMethodAdapterInfo(Method method) { Type[] genericParameterTypes = method.getGenericParameterTypes(); if (genericParameterTypes.length != 0) { Type lastParameterType = genericParameterTypes[genericParameterTypes.length - 1]; if (lastParameterType instanceof ParameterizedType) { ParameterizedType parameterizedLastParameterType = (ParameterizedType) lastParameterType; try { if (parameterizedLastParameterType.getRawType() == Continuation.class) { Type resultType = parameterizedLastParameterType.getActualTypeArguments()[0]; if (resultType instanceof WildcardType) { resultType = ((WildcardType) resultType).getLowerBounds()[0]; } if (resultType instanceof ParameterizedType) { ParameterizedType parameterizedResultType = (ParameterizedType) resultType; if (parameterizedResultType.getRawType() == Response.class) { Type bodyType = parameterizedResultType.getActualTypeArguments()[0]; Type callType = new CallParameterizedTypeImpl(bodyType); return new ServiceMethodAdapterInfo(true, true, callType); } } Type callType = new CallParameterizedTypeImpl(resultType); return new ServiceMethodAdapterInfo(true, false, callType); } } catch (NoClassDefFoundError ignored) { } } } return new ServiceMethodAdapterInfo(false, false, method.getGenericReturnType()); }
Source:
public static JSONObject getOrganisationUnitsByCode(String code) throws PullConversionException { String serverVersion = getServerVersion(PreferencesState.getInstance().getDhisURL()); if (serverVersion == null) { return null; } try { String urlOrgUnitData = getOrganisationUnitsCredentialsUrl(code); Response response = executeCall(null, urlOrgUnitData, "GET"); if (!response.isSuccessful()) { Log.e(TAG, "getOrgUnitData (" + response.code() + "): " + response.body().string()); throw new IOException(response.message()); } JSONObject jsonResponse = parseResponse(response.body().string()); JSONArray orgUnitsArray = (JSONArray) jsonResponse.get(TAG_ORGANISATIONUNITS); if (orgUnitsArray.length() == 0 || orgUnitsArray.length() > 1) { Log.e(TAG, String.format("getOrgUnitData(%s) -> Found %d matches", code, orgUnitsArray.length())); return null; } return (JSONObject) orgUnitsArray.get(0); } catch (Exception ex) { Log.e(TAG, String.format("getOrgUnitData(%s): %s", code, ex.toString())); ex.printStackTrace(); throw new PullConversionException(); } }

Target:
public static OrganisationUnit getOrganisationUnitsByCode( String code) throws PullConversionException, NetworkException, IOException, JSONException { String serverVersion = getServerVersion(PreferencesState.getInstance().getDhisURL()); if (serverVersion == null) { return null; } try { String urlOrgUnitData = getOrganisationUnitsCredentialsUrl(code); if (!isNetworkAvailable()) { throw new NetworkException(); } Response response = executeCall(null, urlOrgUnitData, "GET"); if (!response.isSuccessful()) { Log.e(TAG, "getOrgUnitData (" + response.code() + "): " + response.body().string()); throw new IOException(response.message()); } JSONObject jsonResponse = parseResponse(response.body().string()); JSONArray orgUnitsArray = (JSONArray) jsonResponse.get(TAG_ORGANISATIONUNITS); if (orgUnitsArray.length() == 0 || orgUnitsArray.length() > 1) { Log.e(TAG, String.format("getOrgUnitData(%s) -> Found %d matches", code, orgUnitsArray.length())); return null; } JSONObject orgUnitJO = (JSONObject) orgUnitsArray.get(0); return parseOrgUnit(orgUnitJO); } catch (NetworkException e) { throw e; } catch (Exception ex) { Log.e(TAG, String.format("getOrgUnitData(%s): %s", code, ex.toString())); ex.printStackTrace(); throw new PullConversionException(); } }
Source:
public void testStartScanner() { final ContainerSpecKey containerSpecKey = new ContainerSpecKey("id", "name", new ServerTemplateKey("serverTemplateId", "stname")); KieServerControllerDescriptorCommand command = new KieServerControllerDescriptorCommand(RuleCapabilitiesService.class.getName(), "startScanner", null, null, containerSpecKey, new Long(1)); final String content = WebSocketUtils.marshal(command); LOGGER.info("JSON content\n{}", content); KieServerControllerServiceResponse response = service.executeCommand(WebSocketUtils.unmarshal(content, KieServerControllerDescriptorCommand.class)); assertNotNull(response); assertEquals(FAILURE, response.getType()); assertEquals("No server template found for id serverTemplateId", response.getMsg()); assertNull(response.getResult()); }

Target:
public void testStartScanner() { final ContainerSpecKey containerSpecKey = new ContainerSpecKey("id", "name", new ServerTemplateKey("serverTemplateId", "stname")); KieServerControllerDescriptorCommand command = new KieServerControllerDescriptorCommand(RuleCapabilitiesService.class.getName(), "startScanner", null, null, containerSpecKey, new Long(1)); final String content = WebSocketUtils.marshal(command); LOGGER.debug("JSON content\n{}", content); KieServerControllerServiceResponse response = service.executeCommand(WebSocketUtils.unmarshal(content, KieServerControllerDescriptorCommand.class)); assertNotNull(response); assertEquals(FAILURE, response.getType()); assertEquals("No server template found for id serverTemplateId", response.getMsg()); assertNull(response.getResult()); }
Source:
void stateFlagsAdd(int flags) { final long tagCBoxPtr = OS.GetWindowLongPtr(handle, 0); if (tagCBoxPtr != 0) { final long stateFlagsPtr = tagCBoxPtr + stateFlagsOffset; int stateFlags[] = new int[1]; OS.MoveMemory(stateFlags, stateFlagsPtr, 4); stateFlags[0] |= flags; OS.MoveMemory(stateFlagsPtr, stateFlags, 4); } }

Target:
void stateFlagsAdd(int flags) { final long tagCBoxPtr = OS.GetWindowLongPtr(handle, 0); if (tagCBoxPtr == 0) return; final long stateFlagsPtr = tagCBoxPtr + stateFlagsOffset; int stateFlags[] = new int[1]; OS.MoveMemory(stateFlags, stateFlagsPtr, 4); stateFlags[0] |= flags; OS.MoveMemory(stateFlagsPtr, stateFlags, 4); }
Source:
private void setUpLook() { ImageIcon childIcon = new ImageIcon(this.getClass().getClassLoader().getResource(ICON_BACTERIA)); DefaultTreeCellRenderer renderer = new DefaultTreeCellRenderer(); renderer.setLeafIcon(childIcon); jTree.setCellRenderer(renderer); }

Target:
private void setUpLook() { ImageIcon childIcon = new ImageIcon(Resources.getResource(ICON_BACTERIA)); DefaultTreeCellRenderer renderer = new DefaultTreeCellRenderer(); renderer.setLeafIcon(childIcon); jTree.setCellRenderer(renderer); }
Source:
private boolean passesFilteringByParameter(final Run<?, ?> build, final String parameterName, final String parameterValue) { if (parameterName == null) { return true; } Map<String, String> variables; if (build instanceof AbstractBuild) { variables = ((AbstractBuild<?, ?>) build).getBuildVariables(); } else { variables = null; } if (variables == null) { return false; } return Objects.equal(variables.get(parameterName), parameterValue); }

Target:
private boolean passesFilteringByParameter(final Run<?, ?> build, final String parameterName, final String parameterValue) { if (parameterName == null) { return true; } Map<String, String> variables; if (build instanceof AbstractBuild) { variables = ((AbstractBuild<?, ?>) build).getBuildVariables(); } else { return true; } if (variables == null) { return false; } return Objects.equal(variables.get(parameterName), parameterValue); }
Source:
private static boolean isBasicType(Class<?> type) { return PrimitiveTypes.forType(type) != null || Number.class.isAssignableFrom(type); }

Target:
private static boolean isBasicType(Class<?> type) { return type.isPrimitive() || Number.class.isAssignableFrom(type) || Boolean.class.isAssignableFrom(type) || Character.class.isAssignableFrom(type); }
Source:
public Mono<CosmosAsyncContainerResponse> delete(CosmosContainerRequestOptions options) { if (options == null) { options = new CosmosContainerRequestOptions(); } if (!database.getClient().getTracerProvider().isEnabled()) { return deleteInternal(options); } final CosmosContainerRequestOptions requestOptions = options; return withContext(context -> deleteInternal(requestOptions, context)).subscriberContext(TracerProvider.callDepthAttributeFunc); }

Target:
public Mono<CosmosContainerResponse> delete(CosmosContainerRequestOptions options) { if (options == null) { options = new CosmosContainerRequestOptions(); } if (!database.getClient().getTracerProvider().isEnabled()) { return deleteInternal(options); } final CosmosContainerRequestOptions requestOptions = options; return withContext(context -> deleteInternal(requestOptions, context)); }
Source:
private void stopRemoveBricks() { if (getSelectedItems() == null || getSelectedItems().isEmpty()) { return; } if (getConfirmWindow() != null) { return; } ConfirmationModel model = new ConfirmationModel(); setConfirmWindow(model); model.setTitle(ConstantsManager.getInstance().getConstants().stopRemoveBricksTitle()); model.setMessage(ConstantsManager.getInstance().getConstants().stopRemoveBricksMessage()); model.setHashName("volume_remove_bricks_stop"); GlusterVolumeEntity volumeEntity = (GlusterVolumeEntity) getEntity(); ArrayList<String> list = new ArrayList<String>(); for (GlusterBrickEntity brick : volumeEntity.getBricks()) { if (brick.getAsyncTask() != null && brick.getAsyncTask().getStatus() == JobExecutionStatus.STARTED) { list.add(brick.getQualifiedName()); } } model.setItems(list); UICommand okCommand = new UICommand("OnStopRemoveBricks", this); okCommand.setTitle(ConstantsManager.getInstance().getConstants().ok()); okCommand.setIsDefault(true); model.getCommands().add(okCommand); UICommand cancelCommand = new UICommand("CancelConfirmation", this); cancelCommand.setTitle(ConstantsManager.getInstance().getConstants().close()); cancelCommand.setIsCancel(true); model.getCommands().add(cancelCommand); }

Target:
private void stopRemoveBricks() { if (getSelectedItems() == null || getSelectedItems().isEmpty()) { return; } if (getConfirmWindow() != null) { return; } ConfirmationModel model = new ConfirmationModel(); setConfirmWindow(model); model.setTitle(ConstantsManager.getInstance().getConstants().stopRemoveBricksTitle()); model.setMessage(ConstantsManager.getInstance().getConstants().stopRemoveBricksMessage()); model.setHashName("volume_remove_bricks_stop"); GlusterVolumeEntity volumeEntity = (GlusterVolumeEntity) getEntity(); GlusterAsyncTask volumeTask = volumeEntity.getAsyncTask(); ArrayList<String> list = new ArrayList<String>(); for (GlusterBrickEntity brick : volumeEntity.getBricks()) { if (brick.getAsyncTask() != null && brick.getAsyncTask().getTaskId() != null && volumeTask != null && volumeTask.getStatus() == JobExecutionStatus.STARTED) { list.add(brick.getQualifiedName()); } } model.setItems(list); UICommand okCommand = new UICommand("OnStopRemoveBricks", this); okCommand.setTitle(ConstantsManager.getInstance().getConstants().ok()); okCommand.setIsDefault(true); model.getCommands().add(okCommand); UICommand cancelCommand = new UICommand("CancelConfirmation", this); cancelCommand.setTitle(ConstantsManager.getInstance().getConstants().close()); cancelCommand.setIsCancel(true); model.getCommands().add(cancelCommand); }
Source:
private void failIfZipEntryPathContainsDirectoryTraversalCharacters(String filepath) { if (filepath.contains("/../") || filepath.startsWith("../") || filepath.endsWith("/..")) { throw new IllegalPathException(String.format("File %s is outside extraction target directory", filepath)); } }

Target:
private void failIfZipEntryPathContainsDirectoryTraversalCharacters(String filepath) { if (filepath.contains("/../") || filepath.startsWith("../") || filepath.endsWith("/..") || filepath.contains("\\..\\") || filepath.startsWith("..\\") || filepath.endsWith("\\..")) { throw new IllegalPathException(String.format("File %s is outside extraction target directory", filepath)); } }
Source:
private void proxyWmsRequest(HttpServletRequest request, HttpServletResponse response, String layerParameter) throws ServletException, IOException { LayerDescriptor layerDescriptor = new LayerDescriptor(request.getParameter(layerParameter)); String time = request.getParameter("TIME"); String wmsUrlStr = getWmsUrl(layerDescriptor, time); try { Map<String, String[]> wmsParameters = new HashMap(request.getParameterMap()); wmsParameters.remove("TIME"); wmsParameters.put("VERSION", new String[] { wmsVersion }); wmsParameters.put(layerParameter, new String[] { layerDescriptor.variable }); if (wmsParameters.containsKey("QUERY_LAYERS")) { wmsParameters.put("QUERY_LAYERS", new String[] { layerDescriptor.variable }); } String queryString = encodeMapForRequest(wmsParameters); URL wmsUrl = new URL(wmsUrlStr + "?" + queryString); IOUtils.copy(wmsUrl.openConnection().getInputStream(), response.getOutputStream()); } catch (Exception e) { LOGGER.log(Level.SEVERE, String.format("Problem proxying url '%s'", wmsUrlStr)); e.printStackTrace(); } }

Target:
private void proxyWmsRequest(HttpServletRequest request, HttpServletResponse response, String layerParameter) throws ServletException, IOException { LayerDescriptor layerDescriptor = new LayerDescriptor(request.getParameter(layerParameter)); String time = request.getParameter("TIME"); String wmsUrlStr = getWmsUrl(layerDescriptor, time); try { @SuppressWarnings("unchecked") Map<String, String[]> wmsParameters = new HashMap<String, String[]>(request.getParameterMap()); wmsParameters.remove("TIME"); wmsParameters.put("VERSION", new String[] { wmsVersion }); wmsParameters.put(layerParameter, new String[] { layerDescriptor.variable }); if (wmsParameters.containsKey("QUERY_LAYERS")) { wmsParameters.put("QUERY_LAYERS", new String[] { layerDescriptor.variable }); } String queryString = encodeMapForRequest(wmsParameters); URL wmsUrl = new URL(wmsUrlStr + "?" + queryString); IOUtils.copy(wmsUrl.openConnection().getInputStream(), response.getOutputStream()); } catch (Exception e) { LOGGER.log(Level.SEVERE, String.format("Problem proxying url '%s'", wmsUrlStr)); e.printStackTrace(); } }
Source:
static String ensureQueueExists(AmazonSQS amazonSQS, ARN queueARN, ARN topicARN, int sqsMessageRetentionPeriodSeconds) { String queueUrl = amazonSQS.createQueue(queueARN.getName()).getQueueUrl(); log.debug("Created queue " + queueUrl); HashMap<String, String> attributes = new HashMap<>(); attributes.put("Policy", buildSQSPolicy(queueARN, topicARN).toJson()); attributes.put("MessageRetentionPeriod", Integer.toString(sqsMessageRetentionPeriodSeconds)); amazonSQS.setQueueAttributes( queueUrl, attributes ); return queueUrl; }

Target:
public static String ensureQueueExists(AmazonSQS amazonSQS, ARN queueARN, ARN topicARN, int sqsMessageRetentionPeriodSeconds) { String queueUrl = amazonSQS.createQueue(queueARN.getName()).getQueueUrl(); log.debug("Created queue " + queueUrl); HashMap<String, String> attributes = new HashMap<>(); attributes.put("Policy", buildSQSPolicy(queueARN, topicARN).toJson()); attributes.put("MessageRetentionPeriod", Integer.toString(sqsMessageRetentionPeriodSeconds)); amazonSQS.setQueueAttributes( queueUrl, attributes ); return queueUrl; }
Source:
public void leaveCluster() { if (isInCluster()) { ScriptHelper leaveClusterScript = newScript("leaveCluster") .body.append(format("%s cluster leave")) .body.append(format("%s cluster plan", getRiakAdminCmd())) .body.append(format("%s cluster commit", getRiakAdminCmd())) .failOnNonZeroResultCode(); if (!isRiakOnPath) { Map<String, String> newPathVariable = ImmutableMap.of("PATH", sbinPath); log.warn("riak command not found on PATH. Altering future commands' environment variables from to {}", getShellEnvironment(), newPathVariable); leaveClusterScript.environmentVariablesReset(newPathVariable); } leaveClusterScript.execute(); entity.setAttribute(RiakNode.RIAK_NODE_IN_CLUSTER, Boolean.FALSE); } else { log.warn("entity {}: is not in the riak Cluster", entity.getId()); } }

Target:
public void leaveCluster() { if (isInCluster()) { ScriptHelper leaveClusterScript = newScript("leaveCluster") .body.append(format("%s cluster leave", getRiakAdminCmd())) .body.append(format("%s cluster plan", getRiakAdminCmd())) .body.append(format("%s cluster commit", getRiakAdminCmd())); if (!isRiakOnPath) { Map<String, String> newPathVariable = ImmutableMap.of("PATH", sbinPath); log.warn("riak command not found on PATH. Altering future commands' environment variables from to {}", getShellEnvironment(), newPathVariable); leaveClusterScript.environmentVariablesReset(newPathVariable); } leaveClusterScript.execute(); entity.setAttribute(RiakNode.RIAK_NODE_IN_CLUSTER, Boolean.FALSE); } else { log.warn("entity {}: is not in the riak cluster", entity.getId()); } }
Source:
public boolean isExternal() { boolean state = false; String cacheDirPath = null; File extStoragePath = Environment.getExternalStorageDirectory(); if(extStoragePath != null) { cacheDirPath = extStoragePath.toString(); try { String appCacheDirPath = mRootDirectory.getCanonicalPath(); if (appCacheDirPath.contains(cacheDirPath)) state = true; } catch (IOException e) { e.printStackTrace(); } }else{ state = false;} return state; }

Target:
public boolean isExternal() { return mIsExternal; }
Source:
public byte[] getData() { if (!isDataFlushedToDisk()) { byte[] buf = new byte[cacheStream.size()]; System.arraycopy(cacheStream.getBuffer(), 0, buf, 0, cacheStream.size()); return buf; } return null; }

Target:
public ByteBuffer getData() { if (!isDataFlushedToDisk()) { return ByteBuffer.wrap(cacheStream.getBuffer(), 0, cacheStream.size()); } return null; }
Source:
public ICVSResource[] members(int flags) throws CVSException { final List<ICVSResource> result = new ArrayList<>(); ICVSRemoteResource[] resources = getChildren(); if (children == null) { return new ICVSResource[0]; } if ((flags & EXISTING_MEMBERS) == 0 && (flags & PHANTOM_MEMBERS) == PHANTOM_MEMBERS) { return new ICVSResource[0]; } boolean includeFiles = (((flags & FILE_MEMBERS) != 0) || ((flags & (FILE_MEMBERS | FOLDER_MEMBERS)) == 0)); boolean includeFolders = (((flags & FOLDER_MEMBERS) != 0) || ((flags & (FILE_MEMBERS | FOLDER_MEMBERS)) == 0)); boolean includeManaged = (((flags & MANAGED_MEMBERS) != 0) || ((flags & (MANAGED_MEMBERS | UNMANAGED_MEMBERS | IGNORED_MEMBERS)) == 0)); boolean includeUnmanaged = (((flags & UNMANAGED_MEMBERS) != 0) || ((flags & (MANAGED_MEMBERS | UNMANAGED_MEMBERS | IGNORED_MEMBERS)) == 0)); boolean includeIgnored = ((flags & IGNORED_MEMBERS) != 0); for (ICVSRemoteResource resource : resources) { ICVSResource cvsResource = resource; if ((includeFiles && ( ! cvsResource.isFolder())) || (includeFolders && (cvsResource.isFolder()))) { boolean isManaged = cvsResource.isManaged(); boolean isIgnored = cvsResource.isIgnored(); if ((isManaged && includeManaged)|| (isIgnored && includeIgnored) || ( ! isManaged && ! isIgnored && includeUnmanaged)) { result.add(cvsResource); } } } return result.toArray(new ICVSResource[result.size()]); }

Target:
public ICVSResource[] members(int flags) throws CVSException { final List<ICVSResource> result = new ArrayList<>(); ICVSRemoteResource[] resources = getChildren(); if (children == null) { return new ICVSResource[0]; } if ((flags & EXISTING_MEMBERS) == 0 && (flags & PHANTOM_MEMBERS) == PHANTOM_MEMBERS) { return new ICVSResource[0]; } boolean includeFiles = (((flags & FILE_MEMBERS) != 0) || ((flags & (FILE_MEMBERS | FOLDER_MEMBERS)) == 0)); boolean includeFolders = (((flags & FOLDER_MEMBERS) != 0) || ((flags & (FILE_MEMBERS | FOLDER_MEMBERS)) == 0)); boolean includeManaged = (((flags & MANAGED_MEMBERS) != 0) || ((flags & (MANAGED_MEMBERS | UNMANAGED_MEMBERS | IGNORED_MEMBERS)) == 0)); boolean includeUnmanaged = (((flags & UNMANAGED_MEMBERS) != 0) || ((flags & (MANAGED_MEMBERS | UNMANAGED_MEMBERS | IGNORED_MEMBERS)) == 0)); boolean includeIgnored = ((flags & IGNORED_MEMBERS) != 0); for (ICVSRemoteResource cvsResource : resources) { if ((includeFiles && ( ! cvsResource.isFolder())) || (includeFolders && (cvsResource.isFolder()))) { boolean isManaged = cvsResource.isManaged(); boolean isIgnored = cvsResource.isIgnored(); if ((isManaged && includeManaged)|| (isIgnored && includeIgnored) || ( ! isManaged && ! isIgnored && includeUnmanaged)) { result.add(cvsResource); } } } return result.toArray(new ICVSResource[result.size()]); }
Source:
private void removeGlusterVolumesFromDb() { List<GlusterVolumeEntity> volumes = getGlusterVolumeDao().getByClusterId(getVdsGroupId()); if (volumes.size() > 0) { getGlusterVolumeDao().removeByClusterId(getVdsGroupId()); } }

Target:
private void removeGlusterVolumesFromDb() { getGlusterVolumeDao().removeByClusterId(getVdsGroupId()); }
Source:
public List<User> call(ApiCaller ac, Deserializer parms) throws PerunException { if (parms.contains("attributeName")) { if (parms.contains("attributeValue")) { String attributeName = parms.readString("attributeName"); Attribute attr = new Attribute(ac.getAttributesManager().getAttributeDefinition(ac.getSession(), attributeName)); if(attr.getType().equals(Integer.class.getName())) { attr.setValue(parms.readInt("attributeValue")); } else if(attr.getType().equals(String.class.getName()) || attr.getType().equals("java.lang.LargeString")) { attr.setValue(parms.readString("attributeValue")); } else if(attr.getType().equals(Boolean.class.getName())) { attr.setValue(parms.readBoolean("attributeValue")); } else if(attr.getType().equals(ArrayList.class.getName()) || attr.getType().equals("java.util.LargeArrayList")) { attr.setValue(parms.readList("attributeValue", String.class)); } else if(attr.getType().equals(LinkedHashMap.class.getName())) { attr.setValue(parms.read("attributeValue", LinkedHashMap.class)); } else { throw new RpcException(RpcException.Type.CANNOT_DESERIALIZE_VALUE, "attributeValue is not the same type like value of attribute with the attributeName."); } return ac.getUsersManager().getUsersByAttribute(ac.getSession(),attr); } else { throw new RpcException(RpcException.Type.MISSING_VALUE, "attributeValue"); } } else if (parms.contains("attribute")) { return ac.getUsersManager().getUsersByAttribute(ac.getSession(), parms.read("attribute", Attribute.class)); } else { throw new RpcException(RpcException.Type.MISSING_VALUE, "attribute or (attributeName and attributeValue)"); } }

Target:
public User call(ApiCaller ac, Deserializer parms) throws PerunException { return ac.getUsersManager().getUserByUserExtSource(ac.getSession(), parms.read("userExtSource", UserExtSource.class)); }
Source:
public int read() throws IOException { if (buf.position() < buf.limit()) return buf.get(); else return -1; }

Target:
public int read() throws IOException { if (buf.position() < buf.limit()) { return buf.get(); } else { return -1; } }
Source:
public void updateNotification() throws Exception { for (int i = 1; i <= NO_OF_DEVICES; i++) { DeviceIdentifier testDeviceIdentifier = new DeviceIdentifier(DEVICE_ID_PREFIX + i, DEVICE_TYPE); Notification notification = TestDataHolder.getNotification(i, Notification.Status.CHECKED.toString(), testDeviceIdentifier.toString(), TEST_NOTIFICATION_DESCRIPTION, DEVICE_ID_PREFIX + i, NOTIFICATION_OPERATION_ID, DEVICE_TYPE); Assert.assertTrue(notificationManagementService.updateNotification(notification)); } }

Target:
public void updateNotification() throws NotificationManagementException { for (int i = 1; i <= NO_OF_DEVICES; i++) { DeviceIdentifier testDeviceIdentifier = new DeviceIdentifier(DEVICE_ID_PREFIX + i, DEVICE_TYPE); Notification notification = TestDataHolder.getNotification(i, Notification.Status.CHECKED.toString(), testDeviceIdentifier.toString(), TEST_NOTIFICATION_DESCRIPTION, DEVICE_ID_PREFIX + i, NOTIFICATION_OPERATION_ID, DEVICE_TYPE); Assert.assertTrue(notificationManagementService.updateNotification(notification)); } }
Source:
public static void fireRTCPFeedbackMessageReceived( Object source, byte[] buffer, int offset, int length, List<RTCPFeedbackMessageListener> listeners) { if ((length >= 12) && !listeners.isEmpty()) { int pt = buffer[offset + 1] & 0xFFFF; if ((pt == RTCPFeedbackMessageEvent.PT_PS) || (pt == RTCPFeedbackMessageEvent.PT_TL)) { int fmt = buffer[offset] & 0x1F; RTCPFeedbackMessageEvent ev = new RTCPFeedbackMessageEvent(source, fmt, pt); for (RTCPFeedbackMessageListener l : listeners) l.rtcpFeedbackMessageReceived(ev); } } }

Target:
public static void fireRTCPFeedbackMessageReceived( Object source, byte[] buffer, int offset, int length, List<RTCPFeedbackMessageListener> listeners) { if ((length >= 12) && !listeners.isEmpty()) { int pt = buffer[offset + 1] & 0xFF; if ((pt == RTCPFeedbackMessageEvent.PT_PS) || (pt == RTCPFeedbackMessageEvent.PT_TL)) { int fmt = buffer[offset] & 0x1F; RTCPFeedbackMessageEvent ev = new RTCPFeedbackMessageEvent(source, fmt, pt); for (RTCPFeedbackMessageListener l : listeners) l.rtcpFeedbackMessageReceived(ev); } } }
Source:
public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException { OpenShiftServerBehaviour beh = OpenShiftServerUtils.getOpenShiftServerBehaviour(configuration); String currentMode = beh.getServer().getMode(); beh.setServerStarting(); launchServerProcess(beh, configuration, launch, monitor); try { if (waitForDeploymentConfigReady(beh.getServer(), monitor)) { DebugContext context = createDebugContext(beh, monitor); toggleDebugging(mode, beh, context, monitor); if (!isDebugMode(mode)) { enableDevMode(beh, context); } OpenShiftDebugMode.sendChanges(context, monitor); } } catch (Exception e) { mode = currentMode; throw new CoreException(StatusFactory.errorStatus(OpenShiftNodejsActivator.PLUGIN_ID, NLS.bind("Could not launch server {0}", beh.getServer().getName()), e)); } finally { setServerState(beh, mode, monitor); } }

Target:
public void launch(ILaunchConfiguration configuration, String mode, ILaunch launch, IProgressMonitor monitor) throws CoreException { OpenShiftServerBehaviour beh = OpenShiftServerUtils.getOpenShiftServerBehaviour(configuration); String currentMode = beh.getServer().getMode(); beh.setServerStarting(); launchServerProcess(beh, launch, monitor); try { if (waitForDeploymentConfigReady(beh.getServer(), monitor)) { DebugContext context = createDebugContext(beh, monitor); toggleDebugging(mode, beh, context, monitor); if (!isDebugMode(mode)) { enableDevMode(context); } OpenShiftDebugMode.sendChanges(context, monitor); } } catch (Exception e) { mode = currentMode; throw new CoreException(StatusFactory.errorStatus(OpenShiftNodejsActivator.PLUGIN_ID, NLS.bind("Could not launch server {0}", beh.getServer().getName()), e)); } finally { setServerState(beh, mode, monitor); } }