auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { assert (authProvider != null); if (authenticated) { super.channelRead(ctx, msg); } else if (msg instanceof BookkeeperProtocol.Response) { BookkeeperProtocol.Response resp = (BookkeeperProtocol.Response) msg; if (null == resp.getHeader().getOperation()) { LOG.info("dropping received malformed message from bookie {}", msg, ctx.channel()); } else switch (resp.getHeader().getOperation()) { case START_TLS: super.channelRead(ctx, msg); break; case AUTH: if (resp.getStatus() != BookkeeperProtocol.StatusCode.EOK) { authenticationError(ctx, resp.getStatus().getNumber()); } else { assert (resp.hasAuthResponse()); BookkeeperProtocol.AuthMessage am = resp.getAuthResponse(); if (AuthProviderFactoryFactory.authenticationDisabledPluginName.equals(am.getAuthPluginName())){ SocketAddress remote = ctx.channel().remoteAddress(); LOG.info("Authentication is not enabled." + "Considering this client {0} authenticated", remote); AuthHandshakeCompleteCallback authHandshakeCompleteCallback = new AuthHandshakeCompleteCallback(ctx); authHandshakeCompleteCallback.operationComplete(BKException.Code.OK, null); return; } byte[] payload = am.getPayload().toByteArray(); authProvider.process(AuthToken.wrap(payload), new AuthRequestCallback(ctx, authProviderFactory.getPluginName())); } break; default: LOG.warn("dropping received message from bookie {}", msg, ctx.channel()); break; } } }

Target:
public void channelRead(ChannelHandlerContext ctx, Object msg) throws Exception { assert (authProvider != null); if (authenticated) { super.channelRead(ctx, msg); } else if (msg instanceof BookkeeperProtocol.Response) { BookkeeperProtocol.Response resp = (BookkeeperProtocol.Response) msg; if (null == resp.getHeader().getOperation()) { LOG.info("dropping received malformed message from bookie {}", msg, ctx.channel()); } else { switch (resp.getHeader().getOperation()) { case START_TLS: super.channelRead(ctx, msg); break; case AUTH: if (resp.getStatus() != BookkeeperProtocol.StatusCode.EOK) { authenticationError(ctx, resp.getStatus().getNumber()); } else { assert (resp.hasAuthResponse()); BookkeeperProtocol.AuthMessage am = resp.getAuthResponse(); if (AuthProviderFactoryFactory.AUTHENTICATION_DISABLED_PLUGIN_NAME.equals(am.getAuthPluginName())){ SocketAddress remote = ctx.channel().remoteAddress(); LOG.info("Authentication is not enabled." + "Considering this client {0} authenticated", remote); AuthHandshakeCompleteCallback authHandshakeCompleteCallback = new AuthHandshakeCompleteCallback(ctx); authHandshakeCompleteCallback.operationComplete(BKException.Code.OK, null); return; } byte[] payload = am.getPayload().toByteArray(); authProvider.process(AuthToken.wrap(payload), new AuthRequestCallback(ctx, authProviderFactory.getPluginName())); } break; default: LOG.warn("dropping received message from bookie {}", msg, ctx.channel()); break; } } } }
Source:
public static void assertCompletesEventually(String message, ProgressCheckerTask task, long stallToleranceSeconds) { long taskStartTimestamp = System.currentTimeMillis(); int sleepMillis = 200; List<TaskProgress> progresses = new LinkedList<TaskProgress>(); long lastProgressTimestamp = System.currentTimeMillis(); float lastProgress = 0; while (true) { try { TaskProgress progress = task.checkProgress(); if (progress.isCompleted()) { return; } long lastProgressTimestampCompare = lastProgressTimestamp; boolean toleranceExceeded = progress.timestamp() > lastProgressTimestampCompare + SECONDS.toMillis(stallToleranceSeconds); if (progress.progress() > lastProgress || toleranceExceeded) { progresses.add(progress); lastProgressTimestamp = progress.timestamp(); lastProgress = progress.progress(); } if (toleranceExceeded) { StringBuilder sb = new StringBuilder("Stall tolerance " + stallToleranceSeconds + " seconds has been " + "exceeded without completing the task. Track of progress:\n"); for (TaskProgress historicProgress : progresses) { long elapsedMillis = historicProgress.timestamp() - taskStartTimestamp; String elapsedMillisPadded = String.format("%1$5s", elapsedMillis); sb.append("\t") .append(elapsedMillisPadded).append("ms: ") .append(progress.getProgressString()) .append("\n"); } LOGGER.severe(sb.toString()); fail("Stall tolerance " + stallToleranceSeconds + " seconds has been exceeded without completing the task. " + message); } sleepMillis(sleepMillis); } catch (Exception e) { throw rethrow(e); } } }

Target:
public static void assertCompletesEventually(String message, ProgressCheckerTask task, long stallToleranceSeconds) { long taskStartTimestamp = System.currentTimeMillis(); int sleepMillis = 200; List<TaskProgress> progresses = new LinkedList<TaskProgress>(); long lastProgressTimestamp = System.currentTimeMillis(); float lastProgress = 0; while (true) { try { TaskProgress progress = task.checkProgress(); if (progress.isCompleted()) { return; } boolean toleranceExceeded = progress.timestamp() > lastProgressTimestamp + SECONDS.toMillis(stallToleranceSeconds); if (progress.progress() > lastProgress || toleranceExceeded) { progresses.add(progress); lastProgressTimestamp = progress.timestamp(); lastProgress = progress.progress(); } if (toleranceExceeded) { StringBuilder sb = new StringBuilder("Stall tolerance " + stallToleranceSeconds + " seconds has been " + "exceeded without completing the task. Track of progress:\n"); for (TaskProgress historicProgress : progresses) { long elapsedMillis = historicProgress.timestamp() - taskStartTimestamp; String elapsedMillisPadded = String.format("%1$5s", elapsedMillis); sb.append("\t") .append(elapsedMillisPadded).append("ms: ") .append(historicProgress.getProgressString()) .append("\n"); } LOGGER.severe(sb.toString()); fail("Stall tolerance " + stallToleranceSeconds + " seconds has been exceeded without completing the task. " + message != null ? message : ""); } sleepMillis(sleepMillis); } catch (Exception e) { throw rethrow(e); } } }
Source:
public void save(Patient patient) { try { XWikiDocument doc = (XWikiDocument) this.documentAccessBridge.getDocument(patient.getDocument()); BaseObject xwikiDataObject = doc.getXObject(Patient.CLASS_REFERENCE); if (xwikiDataObject == null) { throw new NullPointerException(ERROR_MESSAGE_NO_PATIENT_CLASS); } PatientData<String> data = patient.<String>getData(this.getName()); if (!data.isNamed()) { return; } for (String property : this.getProperties()) { xwikiDataObject.setStringValue(property, data.get(property)); } XWikiContext context = (XWikiContext) this.execution.getContext().getProperty("xwikicontext"); String comment = String.format("Updated %s from JSON", this.getName()); context.getWiki().saveDocument(doc, comment, true, context); } catch (Exception e) { this.logger.error("Failed to save {}: [{}]", this.getName(), e.getMessage()); } }

Target:
public void save(Patient patient) { try { XWikiDocument doc = (XWikiDocument) this.documentAccessBridge.getDocument(patient.getDocument()); BaseObject xwikiDataObject = doc.getXObject(Patient.CLASS_REFERENCE); if (xwikiDataObject == null) { throw new IllegalArgumentException(ERROR_MESSAGE_NO_PATIENT_CLASS); } PatientData<String> data = patient.<String>getData(this.getName()); if (!data.isNamed()) { return; } for (String property : this.getProperties()) { xwikiDataObject.setStringValue(property, data.get(property)); } XWikiContext context = contextProvider.get(); String comment = String.format("Updated %s from JSON", this.getName()); context.getWiki().saveDocument(doc, comment, true, context); } catch (Exception e) { this.logger.error("Failed to save {}: [{}]", this.getName(), e.getMessage()); } }
Source:
public void processBindingConfiguration(String context, Item item, String bindingConfig) throws BindingConfigParseException { super.processBindingConfiguration(context, item, bindingConfig); if (bindingConfig == null || item == null) { logger.error( "invalid null input, item={}, bindingConfig={}", item, bindingConfig); return; } String strippedBindingConfig = bindingConfig.replace("[", "") .replace("]", "").trim(); String[] configpart = strippedBindingConfig.split(":"); SallegraBindingConfig config = null; SallegraCommand cmdId = null; try { cmdId = SallegraCommand.valueOf(configpart[1].toUpperCase()); } catch (IllegalArgumentException e) { throw new BindingConfigParseException("Unknown command: " + configpart[1]); } if (configpart.length == 3) { config = new SallegraBindingConfig(item, configpart[0], cmdId, configpart[2]); } else { throw new BindingConfigParseException( "Configuration must have at at least 2 or 3 configpart separated by ':'"); } logger.debug( "Found \"{}\" binding config for deviceId \"{}\". Command is \"{}\" and value is \"{}\"", configpart[0], configpart[1], configpart.length > 2 ? configpart[2] : "-"); addBindingConfig(item, config); }

Target:
public void processBindingConfiguration(String context, Item item, String bindingConfig) throws BindingConfigParseException { super.processBindingConfiguration(context, item, bindingConfig); if (bindingConfig == null || item == null) { logger.error( "invalid null input, item={}, bindingConfig={}", item, bindingConfig); return; } String strippedBindingConfig = bindingConfig.replace("[", "") .replace("]", "").trim(); String[] configpart = strippedBindingConfig.split(":"); SallegraBindingConfig config = null; if (configpart.length == 3) { SallegraCommand cmdId = null; try { cmdId = SallegraCommand.valueOf(configpart[1].toUpperCase()); } catch (IllegalArgumentException e) { throw new BindingConfigParseException("Unknown command: " + configpart[1]); } config = new SallegraBindingConfig(configpart[0], cmdId, configpart[2]); config.setItem(item.getName()); } else { throw new BindingConfigParseException( "Configuration must have at at least 2 or 3 configpart separated by ':'"); } logger.debug( "Found \"{}\" binding config for deviceId \"{}\". Command is \"{}\" and value is \"{}\"", configpart[0], configpart[1], configpart.length > 2 ? configpart[2] : "-"); addBindingConfig(item, config); }
Source:
static String printToString(Url url) { if (url.getValueCase() == Url.ValueCase.RAW) { return url.getRaw(); } final StringBuilder sb = new StringBuilder(); final Url.Record record = url.getRecord(); appendProtocol(record, sb); appendAuth(record, sb); appendHost(record, sb); appendPort(record, sb); appendPath(record, sb); appendQueries(record, sb); appendFragment(record, sb); return sb.toString(); }

Target:
static String printToString(Url url) { if (url.getValueCase() == Url.ValueCase.RAW) { return url.getRaw(); } @SuppressWarnings("StringBufferWithoutInitialCapacity") final StringBuilder sb = new StringBuilder(); final Url.Record record = url.getRecord(); appendProtocol(record, sb); appendAuth(record, sb); appendHost(record, sb); appendPort(record, sb); appendPath(record, sb); appendQueries(record, sb); appendFragment(record, sb); return sb.toString(); }
Source:
public final Response saveLanguage(@Context final HttpServletRequest request, @Context final HttpServletResponse response, final LanguageForm languageForm) { this.webResource.init(null, request, response, true, PortletID.LANGUAGES.toString()); try { DotPreconditions.notNull(languageForm,"Expected Request body was empty."); final Language language = saveOrUpdateLanguage(null, languageForm); return Response.ok(new ResponseEntityView(language)).build(); } catch (Exception e) { final String langCode = languageForm == null ? "" : languageForm.getLanguageCode(); Logger.error(this.getClass(), "Exception on save, Language code: " + langCode + ", exception message: " + e.getMessage(), e); return ResponseUtil.mapExceptionResponse(e); } }

Target:
public final Response saveLanguage(@Context final HttpServletRequest request, @Context final HttpServletResponse response, final LanguageForm languageForm) { this.webResource.init(null, request, response, true, PortletID.LANGUAGES.toString()); DotPreconditions.notNull(languageForm,"Expected Request body was empty."); final Language language = saveOrUpdateLanguage(null, languageForm); return Response.ok(new ResponseEntityView(language)).build(); }
Source:
public int getAndIncrementCounter() { int oldVal = counter; counter++; return oldVal; }

Target:
public int getAndIncrementCounter() { return counter++; }
Source:
private void populateReviews(List<ReviewContainer> reviewContainers) { for (String reviewUrl : reviewUrls) { AbstractRepositoryConnector connector = TasksUiPlugin.getRepositoryManager() .getConnectorForRepositoryTaskUrl(reviewUrl); if (connector == null) { continue; } String repositoryUrl = connector.getRepositoryUrlFromTaskUrl(reviewUrl); String reviewId = connector.getTaskIdFromTaskUrl(reviewUrl); if (repositoryUrl == null || reviewId == null) { continue; } ITask task = taskList.getTask(repositoryUrl, reviewId); TasksUiPlugin.getRepositoryManager() .getConnectorForRepositoryTaskUrl(reviewUrl) .getTaskIdFromTaskUrl(reviewUrl); reviewContainers.add(new ReviewContainer(task.getSummary(), task.getAttribute("CODE_REVIEW"), task.getAttribute("VERIFIED"), "")); } }

Target:
private void populateReviews(List<ReviewContainer> reviewContainers) { for (ITask review : reviews) { reviewContainers.add(new ReviewContainer(review.getSummary(), review.getAttribute("CODE_REVIEW"), review.getAttribute("VERIFIED"), "")); } }
Source:
public SavedStateRegistry<Bundle> getBundleSavedStateRegistry() { return mSavedStateRegistry; }

Target:
public final SavedStateRegistry<Bundle> getBundleSavedStateRegistry() { return mSavedStateRegistry; }
Source:
public void run() { try { while(true) { long nextCheck = System.nanoTime() + (interval * 1000L); ping(); long diff; while((diff = nextCheck - System.nanoTime()) > 0) { Thread.sleep(diff / 1000L); } } } catch (ChannelClosedException e) { LOGGER.fine(getName()+" is closed. Terminating"); } catch (IOException e) { onDead(e); } catch (InterruptedException e) { LOGGER.fine(getName()+" is interrupted. Terminating"); } }

Target:
public void run() { try { while(true) { long nextCheck = System.nanoTime() + TimeUnit.MILLISECONDS.toNanos(interval); ping(); long diff; while((diff = nextCheck - System.nanoTime()) > 0) { Thread.sleep(TimeUnit.NANOSECONDS.toMillis(diff)); } } } catch (ChannelClosedException e) { LOGGER.fine(getName()+" is closed. Terminating"); } catch (IOException e) { onDead(e); } catch (InterruptedException e) { LOGGER.fine(getName()+" is interrupted. Terminating"); } }
Source:
public void cleanup() { JavaCudnn.destroyTensorDesc(inputDesc); JavaCudnn.destroyFilterDesc(filterDesc); JavaCudnn.destroyConvDesc(convDesc); JavaCudnn.destroyTensorDesc(activationDesc); JavaCudnn.destroyTensorDesc(biasDesc); JavaCudnn.destroyAlgo(forwardAlgo); JavaCudnn.destroyAlgo(backwardDataAlgo); JavaCudnn.destroyAlgo(backwardDataAlgo); JavaCudnn.destroyWorkspace(workspace); }

Target:
public void cleanup() { JavaCudnn.destroyTensorDesc(inputDesc); JavaCudnn.destroyFilterDesc(filterDesc); JavaCudnn.destroyConvDesc(convDesc); JavaCudnn.destroyTensorDesc(activationDesc); JavaCudnn.destroyTensorDesc(biasDesc); JavaCudnn.destroyAlgo(forwardAlgo); JavaCudnn.destroyAlgo(backwardDataAlgo); JavaCudnn.destroyAlgo(backwardFilterAlgo); JavaCuda.deviceFree(workspace); }
Source:
private boolean doRequest(HttpRequestBase requestBase) { HttpClient client = new DefaultHttpClient(); HttpConnectionParams.setConnectionTimeout(client.getParams(), mTimeOut); HttpResponse response; if (mPiwik.isDryRun()) { Logy.d(LOGGER_TAG, "DryRun, stored HttpRequest, now " + mDryRunOutput.size()); mDryRunOutput.add(requestBase); } else { mDryRunOutput.clear(); try { response = client.execute(requestBase); int statusCode = response.getStatusLine().getStatusCode(); Logy.d(LOGGER_TAG, String.format("status code %s", statusCode)); return statusCode == HttpStatus.SC_NO_CONTENT || statusCode == HttpStatus.SC_OK; } catch (IOException e) { Logy.w(LOGGER_TAG, "Cannot send request", e); } } return false; }

Target:
private boolean doRequest(HttpRequestBase requestBase) { HttpClient client = new DefaultHttpClient(); HttpConnectionParams.setConnectionTimeout(client.getParams(), mTimeOut); HttpResponse response; if (mPiwik.isDryRun()) { Logy.d(LOGGER_TAG, "DryRun, stored HttpRequest, now " + mDryRunOutput.size()); mDryRunOutput.add(requestBase); } else { if (!mDryRunOutput.isEmpty()) mDryRunOutput.clear(); try { response = client.execute(requestBase); int statusCode = response.getStatusLine().getStatusCode(); Logy.d(LOGGER_TAG, String.format("status code %s", statusCode)); return statusCode == HttpStatus.SC_NO_CONTENT || statusCode == HttpStatus.SC_OK; } catch (IOException e) { Logy.w(LOGGER_TAG, "Cannot send request", e); } } return false; }
Source:
public void testDefaultModifier() throws Exception { MethodSource<JavaInterfaceSource> method = Roaster.create(JavaInterfaceSource.class).addMethod( "public void test()"); Assert.assertFalse(method.isDefault()); method.setDefault(true); Assert.assertTrue(method.isDefault()); Assert.assertThat(method.toString(), containsString("public default void test()")); Assert.assertThat(method.getBody(), equalTo("")); String body = "int a=2;"; method.setDefault(true).setBody(body); Assert.assertTrue(method.isDefault()); Assert.assertEquals(body, method.getBody()); }

Target:
public void testDefaultModifier() throws Exception { MethodSource<JavaInterfaceSource> method = Roaster.create(JavaInterfaceSource.class).addMethod( "public void test()"); Assert.assertFalse(method.isDefault()); method.setDefault(true); Assert.assertTrue(method.isDefault()); Assert.assertThat(method.toString(), containsString("public default void test()")); Assert.assertThat(method.getBody(), equalTo("")); String body = "int a=2;"; method.setDefault(false).setBody(body); }
Source:
public void testLaunchAppPackagePrecedenceWithConfigPackage() throws Exception { ApexCli.LaunchCommandLineInfo commandLineInfo = ApexCli .getLaunchCommandLineInfo(new String[]{"-D", "dt.test.1=launch-define", "-apconf", "my-app-conf1.xml", "-conf", configFile.getAbsolutePath()}); DTConfiguration props = cli.getLaunchAppPackageProperties(ap, cp, commandLineInfo, null); Assert.assertEquals("launch-define", props.get("dt.test.1")); Assert.assertEquals("config-package", props.get("dt.test.2")); Assert.assertEquals("app-package-config", props.get("dt.test.3")); Assert.assertEquals("user-home-config", props.get("dt.test.4")); Assert.assertEquals("package-default", props.get("dt.test.5")); Assert.assertEquals("fromConfigPackage", props.get("dt.test.7")); props = cli.getLaunchAppPackageProperties(ap, cp, commandLineInfo, "MyFirstApplication"); Assert.assertEquals("launch-define", props.get("dt.test.1")); Assert.assertEquals("config-package-appname", props.get("dt.test.2")); Assert.assertEquals("app-package-config", props.get("dt.test.3")); Assert.assertEquals("user-home-config", props.get("dt.test.4")); Assert.assertEquals("app-default", props.get("dt.test.5")); Assert.assertEquals("package-default", props.get("dt.test.6")); }

Target:
public void testLaunchAppPackagePrecedenceWithConfigPackage() throws Exception { ApexCli.LaunchCommandLineInfo commandLineInfo = ApexCli .getLaunchCommandLineInfo(new String[]{"-D", "dt.test.1=launch-define", "-apconf", "my-app-conf1.xml", "-conf", configFile.getAbsolutePath()}); DTConfiguration props = cli.getLaunchAppPackageProperties(ap, cp, commandLineInfo, null); Assert.assertEquals("launch-define", props.get("dt.test.1")); Assert.assertEquals("config-package", props.get("dt.test.2")); Assert.assertEquals("app-package-config", props.get("dt.test.3")); Assert.assertEquals("user-home-config", props.get("dt.test.4")); Assert.assertEquals("package-default", props.get("dt.test.5")); props = cli.getLaunchAppPackageProperties(ap, cp, commandLineInfo, "MyFirstApplication"); Assert.assertEquals("launch-define", props.get("dt.test.1")); Assert.assertEquals("config-package-appname", props.get("dt.test.2")); Assert.assertEquals("app-package-config", props.get("dt.test.3")); Assert.assertEquals("user-home-config", props.get("dt.test.4")); Assert.assertEquals("app-default", props.get("dt.test.5")); Assert.assertEquals("package-default", props.get("dt.test.6")); }
Source:
public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; ToStringFriendlyJsonNode that = (ToStringFriendlyJsonNode) o; return !(node != null ? !node.equals(that.node) : that.node != null); }

Target:
public boolean equals(Object o) { return this == o || !(o == null || getClass() != o.getClass()) && this.node.equals(((ToStringFriendlyJsonNode) o).node); }
Source:
public void testMembers() { EtcdMembersResponse members = etcd.getMembers(); assertNotNull(members); }

Target:
public void testMembers() { EtcdMembersResponse members = etcd.getMembers(); assertNotNull(members); assertTrue(members.getMembers().size() >= 1); }
Source:
public SerializableVoid runTask(CompactConfig config, ArrayList<CompactTask> tasks, RunTaskContext context) throws Exception { for (CompactTask task : tasks) { ArrayList<String> inputs = task.getInputs(); if (inputs.isEmpty()) { continue; } AlluxioURI output = new AlluxioURI(task.getOutput()); TableSchema schema; try (TableReader reader = TableReader.create(new AlluxioURI(inputs.get(0)), config.getPartitionInfo())) { schema = reader.getSchema(); } try (TableWriter writer = TableWriter.create(schema, output)) { for (String input : inputs) { try (TableReader reader = TableReader.create(new AlluxioURI(input), config.getPartitionInfo())) { for (TableRow row = reader.read(); row != null; row = reader.read()) { writer.write(row); } } } } finally { context.getFileSystem().delete(output); } } return null; }

Target:
public SerializableVoid runTask(CompactConfig config, ArrayList<CompactTask> tasks, RunTaskContext context) throws Exception { for (CompactTask task : tasks) { ArrayList<String> inputs = task.getInputs(); if (inputs.isEmpty()) { continue; } AlluxioURI output = new AlluxioURI(task.getOutput()); TableSchema schema; try (TableReader reader = TableReader.create(new AlluxioURI(inputs.get(0)), config.getPartitionInfo())) { schema = reader.getSchema(); } try (TableWriter writer = TableWriter.create(schema, output)) { for (String input : inputs) { try (TableReader reader = TableReader.create(new AlluxioURI(input), config.getPartitionInfo())) { for (TableRow row = reader.read(); row != null; row = reader.read()) { writer.write(row); } } } } catch (Throwable e) { try { context.getFileSystem().delete(output); } catch (Throwable t) { e.addSuppressed(t); } throw e; } } return null; }
Source:
protected boolean executeAnalysis(IProgressMonitor monitor) throws TmfAnalysisException { IAnalysisModule segmentStoreProviderModule = fSegmentStoreProviderModule; ITmfTrace trace = getTrace(); if ((segmentStoreProviderModule == null) || !(segmentStoreProviderModule instanceof ISegmentStoreProvider) || (trace == null)) { return false; } segmentStoreProviderModule.waitForCompletion(); ISegmentStore<ISegment> segStore = ((ISegmentStoreProvider) segmentStoreProviderModule).getSegmentStore(); if (segStore != null) { boolean result = calculateTotalManual(segStore, monitor); if (!result) { return false; } result = calculateTotalPerSyscall(segStore, monitor); if (!result) { return false; } } return true; }

Target:
protected boolean executeAnalysis(IProgressMonitor monitor) throws TmfAnalysisException { IAnalysisModule segmentStoreProviderModule = fSegmentStoreProviderModule; ITmfTrace trace = getTrace(); if (!(segmentStoreProviderModule instanceof ISegmentStoreProvider) || (trace == null)) { return false; } segmentStoreProviderModule.waitForCompletion(); ISegmentStore<ISegment> segStore = ((ISegmentStoreProvider) segmentStoreProviderModule).getSegmentStore(); if (segStore != null) { boolean result = calculateTotalManual(segStore, monitor); if (!result) { return false; } result = calculateTotalPerType(segStore, monitor); if (!result) { return false; } } return true; }
Source:
public V put(K key, ExpiringCache<V> item) { if (key == null) { throw new IllegalArgumentException("Item cannot be added as key is null."); } if (item == null) { throw new IllegalArgumentException("Item cannot be added as item is null."); } items.put(key, item); return item.getValue(); }

Target:
public void put(K key, ExpiringCache<V> item) { if (key == null) { throw new IllegalArgumentException("Item cannot be added as key is null."); } if (item == null) { throw new IllegalArgumentException("Item cannot be added as item is null."); } items.put(key, item); }
Source:
public void shouldSetDockerfileContentInsteadOfUrlIfUrlPointsToCheApiOnEnvironmentStart() throws Exception { EnvironmentImpl env = createEnv(); String machineName = "machineWithDockerfileFromApi"; String additionalServiceComposeFilePart = "\n " + machineName + ":\n build:\n context: /recipe/12345"; env.getRecipe().setContent(env.getRecipe().getContent() + additionalServiceComposeFilePart); String dockerfileContent = "this is dockerfile content"; when(recipeDownloader.getRecipe(anyString())).thenReturn(dockerfileContent); startEnv(env); ArgumentCaptor<CheServiceImpl> captor = ArgumentCaptor.forClass(CheServiceImpl.class); verify(machineProvider).startService(anyString(), anyString(), anyString(), eq(machineName), eq(false), anyString(), captor.capture(), any(LineConsumer.class)); CheServiceImpl actualService = captor.getValue(); assertNull(actualService.getBuild().getContext()); assertNull(actualService.getBuild().getDockerfilePath()); assertEquals(actualService.getBuild().getDockerfileContent(), dockerfileContent); }

Target:
public void shouldSetDockerfileContentInsteadOfUrlIfUrlPointsToCheApiOnEnvironmentStart() throws Exception { EnvironmentImpl env = createEnv(); String machineName = "machineWithDockerfileFromApi"; String additionalServiceComposeFilePart = "\n " + machineName + ":\n build:\n context: " + API_ENDPOINT + "/recipe/12345"; env.getRecipe().setContent(env.getRecipe().getContent() + additionalServiceComposeFilePart); String dockerfileContent = "this is dockerfile content"; when(recipeDownloader.getRecipe(anyString())).thenReturn(dockerfileContent); startEnv(env); ArgumentCaptor<CheServiceImpl> captor = ArgumentCaptor.forClass(CheServiceImpl.class); verify(machineProvider).startService(anyString(), anyString(), anyString(), eq(machineName), eq(false), anyString(), captor.capture(), any(LineConsumer.class)); CheServiceImpl actualService = captor.getValue(); assertNull(actualService.getBuild().getContext()); assertNull(actualService.getBuild().getDockerfilePath()); assertEquals(actualService.getBuild().getDockerfileContent(), dockerfileContent); }
Source:
public boolean valid(IConfigurationElement element, IPreferenceNode node) { return Boolean.valueOf(System.getProperty("runtime.lineage", Boolean.FALSE.toString())); }

Target:
public boolean valid(IConfigurationElement element, IPreferenceNode node) { return PluginChecker.isTIS() && Boolean.valueOf(System.getProperty("runtime.lineage", Boolean.FALSE.toString())); }
Source:
public static Collection<File> selectFilesByContainerId(int id) { fileLock.acquire(); try { Map<Integer, File> files = filesByContainer.get(id); if (files != null) { return files.values(); } return null; } finally { fileLock.release(); } }

Target:
public static Collection<File> selectFilesByContainerId(int id) { fileLock.acquire(); try { Map<Integer, File> files = filesByContainer.get(id); if (files != null) { return files.values(); } return Collections.emptyList(); } finally { fileLock.release(); } }
Source:
protected void drawBorder(GC gc) { Rectangle bounds = getBounds(); gc.drawRoundRectangle(bounds.x-1, bounds.y-1, bounds.width+2, bounds.height+2, fArc, fArc); }

Target:
protected void drawBorder(GC gc) { Rectangle bounds = getBounds(); gc.drawRoundRectangle(bounds.x, bounds.y, bounds.width, bounds.height, fArc, fArc); }
Source:
public void destroy() { if (this.roleController != null) { this.roleController.removeLifecycle(this); } }

Target:
public void destroy() throws Exception { if (this.roleController != null) { this.roleController.removeLifecycle(this); } }
Source:
public EarlyStartupJob(JobGroup group) { super("Workbench early stattup job"); setSystem(true); setJobGroup(group); }

Target:
public EarlyStartupJob(JobGroup group) { super("Workbench early startup job"); setSystem(true); setJobGroup(group); }
Source:
public void shouldFilterTransactionsByCardHolderName() { addChargeAndCardDetails(CREATED, ServicePaymentReference.of("ref-1"), now()); addChargeAndCardDetails(AUTHORISATION_READY, ServicePaymentReference.of("ref-2"), now()); addChargeAndCardDetails(CAPTURED, ServicePaymentReference.of("ref-3"), now().minusDays(2)); getChargeApi .withAccountId(accountId) .withQueryParam("cardholder_name", "McPayment") .withHeader(HttpHeaders.ACCEPT, APPLICATION_JSON) .getTransactionsAPI() .statusCode(OK.getStatusCode()) .contentType(JSON) .body("results.size()", is(3)) .body("results[0].card_details.cardholder_name", is("Mr. McPayment")); }

Target:
public void shouldFilterTransactionsByCardHolderName() { addChargeAndCardDetails(CREATED, ServicePaymentReference.of("ref-1"), now()); addChargeAndCardDetails(AUTHORISATION_READY, ServicePaymentReference.of("ref-2"), now()); addChargeAndCardDetails(CAPTURED, ServicePaymentReference.of("ref-3"), now().minusDays(2)); getChargeApi .withAccountId(accountId) .withQueryParam("cardholder_name", "McPayment") .withHeader(HttpHeaders.ACCEPT, APPLICATION_JSON) .getTransactionsAPI() .statusCode(OK.getStatusCode()) .contentType(JSON) .body("results.size()", is(3)) .body("results[0].card_details.cardholder_name", is("Mr. McPayment")) .body("results[0].card_details.last_digits_card_number", is("1234")); }
Source:
public Property getProperty(String propertyName) { if (propertyName.equals("row")) return new Property(cell.y); else if (propertyName.equals("column")) return new Property(cell.x); if (propertyName.equals("name")) return new Property(objectName); else if (propertyName.equals("class")) return new Property(wordsClass.getClassName()); Property property = getOwnProperty(propertyName); if (property != null) return property; else return wordsClass.getProperty(propertyName); }

Target:
public Property getProperty(String propertyName) { if (propertyName.equals("row")) return new Property(cell.y); else if (propertyName.equals("column")) return new Property(cell.x); else if (propertyName.equals("name")) return new Property(objectName); else if (propertyName.equals("class")) return new Property(wordsClass.getClassName()); Property property = getOwnProperty(propertyName); if (property != null) return property; else return wordsClass.getProperty(propertyName); }
Source:
private void initBreakpointOrganizers(IMemento memento) { if (memento != null) { IMemento node = memento.getChild(IDebugUIConstants.EXTENSION_POINT_BREAKPOINT_ORGANIZERS); if (node == null) { fOrganizers = null; } else { String value = node.getString(KEY_VALUE); if (value != null) { BreakpointOrganizerManager manager = BreakpointOrganizerManager.getDefault(); List<IBreakpointOrganizer> organziers = new ArrayList<>(); for (String id : value.split(",")) { IBreakpointOrganizer organizer = manager.getOrganizer(id); if (organizer != null) { organziers.add(organizer); } } fOrganizers = organziers.toArray(new IBreakpointOrganizer[organziers.size()]); for (IBreakpointOrganizer organizer : organziers) { organizer.addPropertyChangeListener(this); } } } } }

Target:
private void initBreakpointOrganizers(IMemento memento) { if (memento != null) { IMemento node = memento.getChild(IDebugUIConstants.EXTENSION_POINT_BREAKPOINT_ORGANIZERS); if (node == null) { fOrganizers = null; } else { String value = node.getString(KEY_VALUE); if (value != null) { BreakpointOrganizerManager manager = BreakpointOrganizerManager.getDefault(); List<IBreakpointOrganizer> organizers = new ArrayList<>(); for (String id : value.split(",")) { IBreakpointOrganizer organizer = manager.getOrganizer(id); if (organizer != null) { organizers.add(organizer); } } fOrganizers = organizers.toArray(new IBreakpointOrganizer[organizers.size()]); for (IBreakpointOrganizer organizer : fOrganizers) { organizer.addPropertyChangeListener(this); } } } } }
Source:
public void undeploySynapseArtifact(String artifactName) { if (log.isDebugEnabled()) { log.debug("ProxyService Undeployment of the proxy named : " + artifactName + " : Started"); } try { ProxyService proxy = getSynapseConfiguration().getProxyService(artifactName); if (proxy != null) { proxy.setLogSetterValue(); if (log.isDebugEnabled()) { log.debug("Stopping the ProxyService named : " + artifactName); } proxy.stop(getSynapseConfiguration()); getSynapseConfiguration().removeProxyService(artifactName); if (log.isDebugEnabled()) { log.debug("ProxyService Undeployment of the proxy named : " + artifactName + " : Completed"); } String unDeployTime = String.valueOf(System.currentTimeMillis()); log.info("ProxyService named '" + proxy.getName() + "' has been undeployed"); executeSynapseHandlerOnArtifactUnDeployment(proxy.getName(),"proxy_service", unDeployTime); } else if (log.isDebugEnabled()) { log.debug("Proxy service " + artifactName + " has already been undeployed"); } } catch (Exception e) { handleSynapseArtifactDeploymentError( "ProxyService Undeployement of proxy named : " + artifactName + " : Failed", e); } }

Target:
public void undeploySynapseArtifact(String artifactName) { if (log.isDebugEnabled()) { log.debug("ProxyService Undeployment of the proxy named : " + artifactName + " : Started"); } try { ProxyService proxy = getSynapseConfiguration().getProxyService(artifactName); if (proxy != null) { proxy.setLogSetterValue(); if (log.isDebugEnabled()) { log.debug("Stopping the ProxyService named : " + artifactName); } proxy.stop(getSynapseConfiguration()); getSynapseConfiguration().removeProxyService(artifactName); if (log.isDebugEnabled()) { log.debug("ProxyService Undeployment of the proxy named : " + artifactName + " : Completed"); } String unDeployTime = String.valueOf(System.currentTimeMillis()); executeSynapseHandlerOnArtifactUnDeployment(proxy.getName(), SynapseConstants.PROXY_SERVICE_TYPE, unDeployTime); log.info("ProxyService named '" + proxy.getName() + "' has been undeployed"); } else if (log.isDebugEnabled()) { log.debug("Proxy service " + artifactName + " has already been undeployed"); } } catch (Exception e) { handleSynapseArtifactDeploymentError( "ProxyService Undeployement of proxy named : " + artifactName + " : Failed", e); } }
Source:
public void editIssueLabel() { IssuesLabelService.editIssueLabel(IssueLabelListActivity.this, getRootLayout(), mRepoOwner, mRepoName, mLabel.getName(), mLabel.editedName, mLabel.editedColor) .doOnError(error -> { mAdapter.remove(mAddedLabel); mAddedLabel = null; }) .subscribe(result -> { forceLoaderReload(0); setResult(RESULT_OK); }, e -> {}); }

Target:
private void editIssueLabel() { IssuesLabelService.editIssueLabel( IssueLabelListActivity.this, mRepoOwner, mRepoName, mLabel.getName(), mLabel.editedName, mLabel.editedColor ).subscribe(result -> { forceLoaderReload(0); setResult(RESULT_OK); }, error -> { mAdapter.remove(mAddedLabel); mAddedLabel = null; }); }
Source:
public ClassSpecificObjectInputStream(ClassLoader classLoader, InputStream inputStream, Class classToAccept) throws IOException, StreamCorruptedException { super(classLoader, inputStream); this.classToAccept = classToAccept; this.firstClass = true; }

Target:
public ClassSpecificObjectInputStream(ClassLoader classLoader, InputStream inputStream, Class classToAccept) throws IOException, StreamCorruptedException { super(classLoader, inputStream); this.classToAccept = classToAccept; }
Source:
private boolean doLock() { try { boolean acquired = this.mutex.acquire(this.path); if (acquired) { this.lastUsed = System.currentTimeMillis(); } return acquired; } catch (Exception e) { throw new MessagingException("Failed to aquire mutex at " + this.path, e); } }

Target:
private boolean doLock() { try { boolean acquired = this.mutex.acquire(this.path); if (acquired) { this.lastUsed = System.currentTimeMillis(); } return acquired; } catch (Exception e) { throw new RuntimeException("Failed to acquire mutex at " + this.path, e); } }
Source:
protected SortedMap<Integer, Node> orderedCommentsAndDeclarations(ASTCompilationUnit cUnit) { SortedMap<Integer, Node> itemsByLineNumber = new TreeMap<>(); List<ASTClassOrInterfaceDeclaration> classDecl = new ArrayList<>(); cUnit.findDescendantsOfType(ASTClassOrInterfaceDeclaration.class, classDecl, true); addDeclarations(itemsByLineNumber, classDecl); addDeclarations(itemsByLineNumber, cUnit.getComments()); List<ASTFieldDeclaration> fields = new ArrayList<>(); cUnit.findDescendantsOfType(ASTFieldDeclaration.class, fields, true); addDeclarations(itemsByLineNumber, fields); List<ASTMethodDeclaration> methods = new ArrayList<>(); cUnit.findDescendantsOfType(ASTMethodDeclaration.class, methods, true); addDeclarations(itemsByLineNumber, methods); List<ASTConstructorDeclaration> constructors = new ArrayList<>(); cUnit.findDescendantsOfType(ASTConstructorDeclaration.class, constructors, true); addDeclarations(itemsByLineNumber, constructors); List<ASTEnumDeclaration> enumDecl = new ArrayList<>(); cUnit.findDescendantsOfType(ASTEnumDeclaration.class, enumDecl, true); addDeclarations(itemsByLineNumber, enumDecl); return itemsByLineNumber; }

Target:
protected SortedMap<Integer, Node> orderedCommentsAndDeclarations(ASTCompilationUnit cUnit) { SortedMap<Integer, Node> itemsByLineNumber = new TreeMap<>(); addDeclarations(itemsByLineNumber, cUnit.findDescendantsOfType(ASTClassOrInterfaceDeclaration.class, true)); addDeclarations(itemsByLineNumber, cUnit.getComments()); addDeclarations(itemsByLineNumber, cUnit.findDescendantsOfType(ASTFieldDeclaration.class, true)); addDeclarations(itemsByLineNumber, cUnit.findDescendantsOfType(ASTMethodDeclaration.class, true)); addDeclarations(itemsByLineNumber, cUnit.findDescendantsOfType(ASTConstructorDeclaration.class, true)); addDeclarations(itemsByLineNumber, cUnit.findDescendantsOfType(ASTEnumDeclaration.class, true)); return itemsByLineNumber; }
Source:
public List<BlockDevice> getBlockDeviceMapping() { return blockDeviceMapping; }

Target:
public Set<BlockDeviceMapping> getBlockDeviceMapping() { return blockDeviceMapping; }
Source:
private static Type findLeastSpecificType(Symbol parameter) { List<IdentifierTree> usages = parameter.usages(); InheritanceGraph inheritanceGraph = new InheritanceGraph(parameter.type()); for (IdentifierTree usage : usages) { Tree parent = usage.parent(); while (parent != null && !parent.is(Tree.Kind.ARGUMENTS, Tree.Kind.METHOD_INVOCATION, Tree.Kind.EXPRESSION_STATEMENT, Tree.Kind.FOR_EACH_STATEMENT)) { parent = parent.parent(); } if (parent == null || parent.is(Tree.Kind.EXPRESSION_STATEMENT, Tree.Kind.ARGUMENTS)) { return parameter.type(); } if (parent.is(Tree.Kind.FOR_EACH_STATEMENT)) { Collection<Symbol> symbols = parameter.type().symbol().lookupSymbols("iterator"); symbols.stream() .filter(Symbol::isMethodSymbol) .filter(s -> ((Symbol.MethodSymbol) s).parameterTypes().isEmpty()) .findFirst() .ifPresent(inheritanceGraph::update); } else if (parent.is(Tree.Kind.METHOD_INVOCATION)) { MethodInvocationTree mit = (MethodInvocationTree) parent; if (isMethodInvocationOnParameter(parameter, mit)) { inheritanceGraph.update(mit.symbol()); } } } return inheritanceGraph.leastSpecificType(); }

Target:
private static Type findLeastSpecificType(Symbol parameter) { InheritanceGraph inheritanceGraph = new InheritanceGraph(parameter.type()); for (IdentifierTree usage : parameter.usages()) { Tree parent = usage.parent(); while (parent != null && !parent.is(Tree.Kind.ARGUMENTS, Tree.Kind.METHOD_INVOCATION, Tree.Kind.EXPRESSION_STATEMENT, Tree.Kind.FOR_EACH_STATEMENT)) { parent = parent.parent(); } if (parent == null || parent.is(Tree.Kind.EXPRESSION_STATEMENT, Tree.Kind.ARGUMENTS)) { return parameter.type(); } if (parent.is(Tree.Kind.FOR_EACH_STATEMENT)) { findIteratorMethod(parameter).ifPresent(inheritanceGraph::update); } else if (parent.is(Tree.Kind.METHOD_INVOCATION)) { MethodInvocationTree mit = (MethodInvocationTree) parent; if (isMethodInvocationOnParameter(parameter, mit)) { inheritanceGraph.update(mit.symbol()); } } } return inheritanceGraph.leastSpecificType(); }
Source:
private TimeZone getServerTimeZone() throws SQLException { String query = "select TIME_TO_SEC(timediff(now(),utc_timestamp()));"; Statement stmt = connection.createStatement(); try { ResultSet rs = stmt.executeQuery(query); if (rs.next()) { int offsetSeconds = rs.getInt(1); return fromGMTOffsetSeconds(offsetSeconds); } else { return null; } } finally { stmt.close(); } }

Target:
private TimeZone getServerTimeZone() throws SQLException { String query = "select TIME_TO_SEC(timediff(now(),utc_timestamp()));"; Statement stmt = connection.createStatement(); try { ResultSet rs = stmt.executeQuery(query); if (rs.next()) { int offsetSeconds = rs.getInt(1); return fromGMTOffsetSeconds(offsetSeconds); } throw new SQLException(String.format(Locale.ENGLISH, "The timezone comparison query(%s) doesn't return the result.",query)); } finally { stmt.close(); } }
Source:
public TTLSet(Map<String,String> objectStrings) { super(); for (Entry<String,String> entry : objectStrings.entrySet()) { String column = entry.getKey(); String ttl = entry.getValue(); if (column.equals(NEGATE)) continue; Long l = Long.parseLong(ttl); Pair<Text,Text> colPair = ColumnSet.decodeColumns(column); if (colPair.getSecond() == null) { addObject(colPair.getFirst(), l); } else { addObject(colPair.getFirst(), colPair.getSecond(), l); } } }

Target:
public TTLSet(Map<String,String> objectStrings) { super(); for (Entry<String,String> entry : objectStrings.entrySet()) { String column = entry.getKey(); String ttl = entry.getValue(); if (column.equals(NEGATE) && (ttl.equalsIgnoreCase("true") || ttl.equalsIgnoreCase("false"))) continue; Long l = Long.parseLong(ttl); Pair<Text,Text> colPair = ColumnSet.decodeColumns(column); if (colPair.getSecond() == null) { addObject(colPair.getFirst(), l); } else { addObject(colPair.getFirst(), colPair.getSecond(), l); } } }
Source:
public void handleNotification(Notification notification) { if (acquireScanLock()) { switch (notification.getType()) { case DEPLOYMENT_DEPLOYED_NOTIFICATION: { String runtimeName = notification.getData().get(DEPLOYMENT).asString(); ROOT_LOGGER.warn(runtimeName + " has been deployed without the scanner but I have it referenced " + deployed.containsKey(runtimeName)); if (!deployed.containsKey(runtimeName)) { try { updateDeploymentStatusAfterNotification(deploymentDir.toPath(), runtimeName); } catch (IOException ioex) { ROOT_LOGGER.error("Error cleaning", ioex); } } break; } case DEPLOYMENT_UNDEPLOYED_NOTIFICATION: { String runtimeName = notification.getData().get(DEPLOYMENT).asString(); if (deployed.containsKey(runtimeName)) { clearMarkers(deployed.get(runtimeName).parentFolder.toPath(), runtimeName, DEPLOYED); deployed.remove(runtimeName); } break; } default: } } }

Target:
public void handleNotification(Notification notification) { if (acquireScanLock()) { switch (notification.getType()) { case DEPLOYMENT_DEPLOYED_NOTIFICATION: { String runtimeName = notification.getData().get(DEPLOYMENT).asString(); if (!deployed.containsKey(runtimeName)) { updateDeploymentStatusAfterNotification(deploymentDir.toPath(), runtimeName); } break; } case DEPLOYMENT_UNDEPLOYED_NOTIFICATION: { String runtimeName = notification.getData().get(DEPLOYMENT).asString(); if (deployed.containsKey(runtimeName)) { clearMarkers(deployed.get(runtimeName).parentFolder.toPath(), runtimeName); deployed.remove(runtimeName); } break; } default: } } }
Source:
public FileFormat getFileType() { if (this.getName() == null) { return FileFormat.UNKNOWN; } if (this.getIsSuperfile()) { return FileFormat.FLAT; } boolean hasxpath = hasEcl() && getEcl().toLowerCase().contains("xpath"); FileFormat fileFormatFromContent = FileFormat.getFileFormat(getContentType()); if (fileFormatFromContent == FileFormat.FLAT) { if (!hasEcl() && this.isSprayedCsv()) { return FileFormat.CSV; } return FileFormat.FLAT; } else if (fileFormatFromContent == FileFormat.CSV) { return FileFormat.CSV; } else if (fileFormatFromContent == FileFormat.XML) { return FileFormat.XML; } else if (fileFormatFromContent == FileFormat.KEYED) { return FileFormat.KEYED; } else if (fileFormatFromContent == FileFormat.UNKNOWN && (getContentType() == null || getContentType().equals(""))) { FileFormat fileFormat = FileFormat.getFileFormat(getFormat()); if (FileFormat.CSV == fileFormat) { return FileFormat.CSV; } else if (FileFormat.XML == fileFormat) { return FileFormat.XML; } if (getFormat().toLowerCase().startsWith("utf")) { if (hasxpath) { return FileFormat.XML; } else { return FileFormat.CSV; } } else if (fileFormat == FileFormat.UNKNOWN && (getFormat() == null || getFormat().equals("")) && hasxpath) { return FileFormat.XML; } else if (hasEcl()) { return FileFormat.FLAT; } else if (!this.isSprayedCsv()) { return FileFormat.FLAT; } else { return FileFormat.UNKNOWN; } } else { return FileFormat.UNKNOWN; } }

Target:
public FileFormat getFileType() { if (this.getName() == null) { return FileFormat.UNKNOWN; } boolean hasxpath = hasEcl() && getEcl().toLowerCase().contains("xpath"); FileFormat fileFormatFromContent = FileFormat.getFileFormat(getContentType()); if (fileFormatFromContent == FileFormat.FLAT) { if (!hasEcl() && this.isSprayedCsv()) { return FileFormat.CSV; } return FileFormat.FLAT; } else if (fileFormatFromContent == FileFormat.CSV) { return FileFormat.CSV; } else if (fileFormatFromContent == FileFormat.XML) { return FileFormat.XML; } else if (fileFormatFromContent == FileFormat.KEYED || isIndex()) { return FileFormat.KEYED; } else if (fileFormatFromContent == FileFormat.UNKNOWN && (getContentType() == null || getContentType().equals(""))) { FileFormat fileFormat = FileFormat.getFileFormat(getFormat()); if (this.getIsSuperfile() && fileFormat != FileFormat.KEYED && !isIndex()) { return FileFormat.FLAT; } if (FileFormat.CSV == fileFormat) { return FileFormat.CSV; } else if (FileFormat.XML == fileFormat) { return FileFormat.XML; } if (getFormat().toLowerCase().startsWith("utf")) { if (hasxpath) { return FileFormat.XML; } else { return FileFormat.CSV; } } else if (fileFormat == FileFormat.UNKNOWN && (getFormat() == null || getFormat().equals("")) && hasxpath) { return FileFormat.XML; } else if (hasEcl()) { return FileFormat.FLAT; } else if (!this.isSprayedCsv()) { return FileFormat.FLAT; } else { return FileFormat.UNKNOWN; } } else { return FileFormat.UNKNOWN; } }
Source:
protected void registerDefaultRecipes() { registerRecipe(3, new ItemStack[] { new ItemStack(Material.GOLD_INGOT) }, new ItemStack[] { new ItemStack(SlimefunItems.GOLD_DUST) }); }

Target:
protected void registerDefaultRecipes() { registerRecipe(3, new ItemStack(Material.GOLD_INGOT), SlimefunItems.GOLD_DUST); }
Source:
private void suspend(long millis) { try { Thread.sleep(millis); } catch (InterruptedException e) { System.out.println("Suspend interrupted: " + e.getMessage()); } }

Target:
private void suspend(long millis) { try { Thread.sleep(millis); } catch (InterruptedException e) { e.printStackTrace(); Thread.currentThread().interrupt(); } }
Source:
private void showThemeExistsDialog(String inputFileName, Operation continueOperation) { StringBuilder msg = new StringBuilder(); msg.append("A theme file with the same name, '") .append(inputFileName) .append("', already exists. Adding the theme will cause the existing file to be ") .append("overwritten. Would you like to add the theme anyways?"); globalDisplay_.showYesNoMessage( GlobalDisplay.MSG_WARNING, "Theme File Already Exists", msg.toString(), continueOperation, false); }

Target:
private void showThemeExistsDialog(String inputFileName, Operation continueOperation) { StringBuilder msg = new StringBuilder(); msg.append("A theme file with the same name, '") .append(inputFileName) .append("', already exists. Adding the theme will cause the existing file to be ") .append("overwritten. Would you like to add the theme anyway?"); globalDisplay_.showYesNoMessage( GlobalDisplay.MSG_WARNING, "Theme File Already Exists", msg.toString(), continueOperation, false); }