auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void updatePath() { mBorderPath.reset(); mRootBounds.inset(mBorderWidth / 2, mBorderWidth / 2); if (mIsCircle) { mBorderPath.addCircle( mRootBounds.centerX(), mRootBounds.centerY(), Math.min(mRootBounds.width(), mRootBounds.height())/2, Path.Direction.CW); } else { mBorderRadii[0] = mBorderRadii[1] = mCornerRadii[0] + mPadding - mBorderWidth/2; mBorderRadii[2] = mBorderRadii[3] = mCornerRadii[2] + mPadding - mBorderWidth/2; mBorderRadii[4] = mBorderRadii[5] = mCornerRadii[4] + mPadding - mBorderWidth/2; mBorderRadii[6] = mBorderRadii[7] = mCornerRadii[6] + mPadding - mBorderWidth/2; mBorderPath.addRoundRect(mRootBounds, mBorderRadii, Path.Direction.CW); } mRootBounds.inset(-mBorderWidth / 2, -mBorderWidth/2); if (mIsPathDirty) { mPath.reset(); mRootBounds.inset(mPadding, mPadding); if (mIsCircle) { mPath.addCircle( mRootBounds.centerX(), mRootBounds.centerY(), Math.min(mRootBounds.width(), mRootBounds.height())/2, Path.Direction.CW); } else { mPath.addRoundRect(mRootBounds, mCornerRadii, Path.Direction.CW); } mRootBounds.inset(-(mPadding), -(mPadding)); mPath.setFillType(Path.FillType.WINDING); mIsPathDirty = false; } }

Target:
private void updatePath() { if (mIsPathDirty) { mBorderPath.reset(); mRootBounds.inset(mBorderWidth/2, mBorderWidth/2); if (mIsCircle) { float radius = Math.min(mRootBounds.width(), mRootBounds.height())/2; mBorderPath.addCircle(mRootBounds.centerX(), mRootBounds.centerY(), radius, Path.Direction.CW); } else { for (int i = 0; i < mBorderRadii.length; i++) { mBorderRadii[i] = mCornerRadii[i] + mPadding - mBorderWidth/2; } mBorderPath.addRoundRect(mRootBounds, mBorderRadii, Path.Direction.CW); } mRootBounds.inset(-mBorderWidth/2, -mBorderWidth/2); mPath.reset(); mRootBounds.inset(mPadding, mPadding); if (mIsCircle) { mPath.addCircle( mRootBounds.centerX(), mRootBounds.centerY(), Math.min(mRootBounds.width(), mRootBounds.height())/2, Path.Direction.CW); } else { mPath.addRoundRect(mRootBounds, mCornerRadii, Path.Direction.CW); } mRootBounds.inset(-(mPadding), -(mPadding)); mPath.setFillType(Path.FillType.WINDING); mIsPathDirty = false; } }
Source:
private void setupSubformTest() { FormDefinition subform = getFormDefinition("Subform.frm"); FormDefinition creationForm = getFormDefinition("CreationForm.frm"); FormDefinition editionForm = getFormDefinition("EditionForm.frm"); Map<String, FormDefinition> availableForms = new HashMap<String, FormDefinition>() {{ put("f31d37ce-8155-4478-a464-456c013236c6", subform); put("6544f16e-c765-451e-882d-8202f6ea824c", creationForm); put("dd1451bf-4f38-495b-8f16-b74711246797", editionForm); }}; when(context.getRenderingContext()).thenReturn(mapModelRenderingContext); when(mapModelRenderingContext.getAvailableForms()).thenReturn(availableForms); when(context.getClassLoader()).thenReturn(this.getClass().getClassLoader()); }

Target:
private void setupSubformTest() throws IOException { final String SUBFORM_ID = "f31d37ce-8155-4478-a464-456c013236c6", CREATIONFORM_ID = "6544f16e-c765-451e-882d-8202f6ea824c", EDITIONFORM_ID = "dd1451bf-4f38-495b-8f16-b74711246797"; Map<String, FormDefinition> availableForms = new HashMap<String, FormDefinition>() {{ put(SUBFORM_ID, getFormDefinition("Subform.frm")); put(CREATIONFORM_ID, getFormDefinition("CreationForm.frm")); put(EDITIONFORM_ID, getFormDefinition("EditionForm.frm")); }}; when(context.getRenderingContext()).thenReturn(mapModelRenderingContext); when(mapModelRenderingContext.getAvailableForms()).thenReturn(availableForms); when(context.getClassLoader()).thenReturn(this.getClass().getClassLoader()); }
Source:
public void randomWrite(long pos, byte[] b, int off, int len) throws IOException { if (readonly) throw new IOException("Remote file is read only."); long oldPosition = remoteOffset; remoteOffset = pos; try { write(b, off, len); } finally { remoteOffset = oldPosition; } }

Target:
public synchronized void randomWrite(long pos, byte[] b, int off, int len) throws IOException { if (readonly) throw new IOException("Remote file is read only."); long oldPosition = remoteOffset; remoteOffset = pos; try { write(b, off, len); } finally { remoteOffset = oldPosition; } }
Source:
public void run(){ boolean matchR = false; try { synchronized(this){ while(true){ System.out.println("wait hit"); this.wait(); System.out.println("RESUMED"); if(!TaskBar.myTextArray.isEmpty()){ TaskBar.trayIcon.displayMessage("New Message", TaskBar.myTextArray.get(0).getSender().getFirstName() + " " + TaskBar.myTextArray.get(0).getSender().getLastName(), MessageType.INFO); matchR = false; for(int i=0; i < TaskBar.smallChatWindows.size(); i++){ if(TaskBar.myTextArray.get(0).getSender().getPhoneNumber().equals(TaskBar.smallChatWindows.get(i).getFromContact().getPhoneNumber())){ try { TaskBar.smallChatWindows.get(i).receivedText(TaskBar.myTextArray.get(0)); } catch (BadLocationException e) { e.printStackTrace(); } TaskBar.myTextArray.remove(0); matchR = true; break; } } if(!matchR){ TaskBar.smallChatWindows.add(new SmallChat(TaskBar.myTextArray.get(0).getReceiver(), TaskBar.myTextArray.get(0).getSender())); try { TaskBar.smallChatWindows.get(TaskBar.smallChatWindows.size()-1).receivedText(TaskBar.myTextArray.get(0)); System.out.println("small chat window created!"); } catch (BadLocationException e) { e.printStackTrace(); } TaskBar.myTextArray.remove(0); } } } } } catch (InterruptedException e) { e.printStackTrace(); } }

Target:
public void run(){ boolean matchR = false; try { synchronized(this){ while(true){ System.out.println("wait hit"); this.wait(); System.out.println("RESUMED"); if(!TaskBar.myTextArray.isEmpty()){ TaskBar.trayIcon.displayMessage("New Message", TaskBar.myTextArray.get(0).getSender().getFirstName() + " " + TaskBar.myTextArray.get(0).getSender().getLastName(), MessageType.INFO); matchR = false; for(int i=0; i < TaskBar.smallChatWindows.size(); i++){ if(TaskBar.myTextArray.get(0).getSender().getPhoneNumber().equals(TaskBar.smallChatWindows.get(i).getFromContact().getPhoneNumber())){ try { TaskBar.smallChatWindows.get(i).receivedText(TaskBar.myTextArray.get(0)); } catch (BadLocationException e) { e.printStackTrace(); System.out.println("Updating a small chat conversation -FAILED"); } TaskBar.myTextArray.remove(0); matchR = true; break; } } if(!matchR){ TaskBar.smallChatWindows.add(new SmallChat(TaskBar.myTextArray.get(0).getReceiver(), TaskBar.myTextArray.get(0).getSender())); try { TaskBar.smallChatWindows.get(TaskBar.smallChatWindows.size()-1).receivedText(TaskBar.myTextArray.get(0)); System.out.println("small chat window created!"); } catch (BadLocationException e) { e.printStackTrace(); System.out.println("Small chat window creation -FAILED"); } TaskBar.myTextArray.remove(0); } } } } } catch (InterruptedException e) { e.printStackTrace(); System.out.println("Synchronized method block -FAILED"); } }
Source:
public byte[] getCacheKey() { return new CacheKeyBuilder(AggregatorUtil.ARRAY_OF_DOUBLES_SKETCH_CACHE_TYPE_ID).appendString(name) .appendString(fieldName).appendInt(nominalEntries).appendStrings(metricColumns).appendInt(numberOfValues) .build(); }

Target:
public byte[] getCacheKey() { final CacheKeyBuilder builder = new CacheKeyBuilder(AggregatorUtil.ARRAY_OF_DOUBLES_SKETCH_CACHE_TYPE_ID) .appendString(name) .appendString(fieldName) .appendInt(nominalEntries) .appendInt(numberOfValues); if (metricColumns != null) { builder.appendStrings(metricColumns); } return builder.build(); }
Source:
private String[][] getAvailableMergeStrategies() { IConfigurationElement[] elements = Platform.getExtensionRegistry() .getConfigurationElementsFor( "org.eclipse.egit.core.modelMergeStrategy"); List<String[]> strategies = new ArrayList<>(); strategies.add(new String[] { UIText.GitPreferenceRoot_defaultMergeStrategyLabel, MergeStrategy.RECURSIVE.getName() }); for (IConfigurationElement element : elements) { try { Object ext = element.createExecutableExtension("class"); if (ext instanceof MergeStrategy) { strategies.add(new String[] { element.getAttribute("label"), ((MergeStrategy) ext).getName() }); } } catch (CoreException e) { Activator .logError( UIText.GitPreferenceRoot_modelMergeStrategyLoadError, e); } } return strategies.toArray(new String[strategies.size()][2]); }

Target:
private String[][] getAvailableMergeStrategies() { org.eclipse.egit.core.Activator coreActivator = org.eclipse.egit.core.Activator .getDefault(); List<String[]> strategies = new ArrayList<>(); strategies.add(new String[] { UIText.GitPreferenceRoot_defaultMergeStrategyLabel, "" }); for (MergeStrategyDescriptor strategy : coreActivator .getRegisteredMergeStrategies()) { strategies.add(new String[] { strategy.getLabel(), strategy.getName() }); } return strategies.toArray(new String[strategies.size()][2]); }
Source:
public void writeExternal(ObjectOutput out) throws IOException { out.writeBoolean(isNull); if (isNull) { if (precision >= 0 || scale >= 0) { out.writeBoolean(!isNull); out.writeByte(precision); out.writeByte(scale); } else { out.writeBoolean(isNull); } return; } int scale; byte[] byteArray; if (value != null) { scale = value.scale(); if (scale < 0) { scale = 0; setValue(value.setScale(0)); } BigInteger bi = value.unscaledValue(); byteArray = bi.toByteArray(); } else { scale = rawScale; byteArray = rawData; } if (SanityManager.DEBUG) { if (scale < 0) SanityManager.THROWASSERT("DECIMAL scale at writeExternal is negative " + scale + " value " + toString()); } out.writeByte(scale); out.writeByte(byteArray.length); out.write(byteArray); }

Target:
public void writeExternal(ObjectOutput out) throws IOException { out.writeBoolean(isNull); if (isNull) { out.writeByte(precision); out.writeByte(scale); return; } int scale; byte[] byteArray; if (value != null) { scale = value.scale(); if (scale < 0) { scale = 0; setValue(value.setScale(0)); } BigInteger bi = value.unscaledValue(); byteArray = bi.toByteArray(); } else { scale = rawScale; byteArray = rawData; } if (SanityManager.DEBUG) { if (scale < 0) SanityManager.THROWASSERT("DECIMAL scale at writeExternal is negative " + scale + " value " + toString()); } out.writeByte(scale); out.writeByte(byteArray.length); out.write(byteArray); }
Source:
private Configuration getConfiguration() throws Exception { System.out.println( "Starting " + getClass().getCanonicalName() + "#" + name.getMethodName() + "."); StateBackendEnum stateBackendEnum = getStateBackend(); if (ROCKSDB_INCREMENTAL_ZK.equals(stateBackendEnum)) { zkServer = new TestingServer(); zkServer.start(); } Configuration config = createClusterConfig(); switch (stateBackendEnum) { case MEM: this.stateBackend = new MemoryStateBackend(MAX_MEM_STATE_SIZE, false); break; case FILE: { String backups = tempFolder.newFolder().getAbsolutePath(); this.stateBackend = new FsStateBackend("file://" + backups, false); break; } case MEM_ASYNC: this.stateBackend = new MemoryStateBackend(MAX_MEM_STATE_SIZE, true); break; case FILE_ASYNC: { String backups = tempFolder.newFolder().getAbsolutePath(); this.stateBackend = new FsStateBackend("file://" + backups, true); break; } case ROCKSDB_FULLY_ASYNC: { setupRocksDB(config, -1, false); break; } case ROCKSDB_INCREMENTAL: config.setString( RocksDBOptions.TIMER_SERVICE_FACTORY.key(), RocksDBStateBackend.PriorityQueueStateType.ROCKSDB.toString()); setupRocksDB(config, 16, true); break; case ROCKSDB_INCREMENTAL_ZK: { setupRocksDB(config, 16, true); break; } default: throw new IllegalStateException("No backend selected."); } return config; }

Target:
private Configuration getConfiguration() throws Exception { System.out.println( "Starting " + getClass().getCanonicalName() + "#" + name.getMethodName() + "."); StateBackendEnum stateBackendEnum = getStateBackend(); if (ROCKSDB_INCREMENTAL_ZK.equals(stateBackendEnum)) { zkServer = new TestingServer(); zkServer.start(); } Configuration config = createClusterConfig(); switch (stateBackendEnum) { case MEM: this.stateBackend = new MemoryStateBackend(MAX_MEM_STATE_SIZE, false); break; case FILE: { String backups = tempFolder.newFolder().getAbsolutePath(); this.stateBackend = new FsStateBackend("file://" + backups, false); break; } case MEM_ASYNC: this.stateBackend = new MemoryStateBackend(MAX_MEM_STATE_SIZE, true); break; case FILE_ASYNC: { String backups = tempFolder.newFolder().getAbsolutePath(); this.stateBackend = new FsStateBackend("file://" + backups, true); break; } case ROCKSDB_FULLY_ASYNC: { setupRocksDB(config, -1, false); break; } case ROCKSDB_INCREMENTAL: config.set(RocksDBOptions.TIMER_SERVICE_FACTORY, RocksDBStateBackend.PriorityQueueStateType.ROCKSDB); setupRocksDB(config, 16, true); break; case ROCKSDB_INCREMENTAL_ZK: { setupRocksDB(config, 16, true); break; } default: throw new IllegalStateException("No backend selected."); } return config; }
Source:
public void testCorrectUser() throws Exception { try (CLIWrapper cli = new CLIWrapper(true)) { StringBuilder configuration = new StringBuilder("throwException").append("=").append(false); cli.sendLine( String.format( "/subsystem=elytron/custom-credential-security-factory=%s:write-attribute(name=configuration, value={%s})", CUSTOM_CRED_SEC_FACTORY_NAME, configuration)); cli.sendLine("reload"); } CoreUtils.makeCallWithBasicAuthn(createSimpleManagementOperationUrl(), USER, CORRECT_PASSWORD, SC_OK); }

Target:
public void testCorrectUser() throws Exception { try (CLIWrapper cli = new CLIWrapper(true)) { StringBuilder configuration = new StringBuilder("throwException").append("=").append(false); cli.sendLine(String.format( "/subsystem=elytron/custom-credential-security-factory=%s:write-attribute(name=configuration, value={%s})", CUSTOM_CRED_SEC_FACTORY_NAME, configuration)); ServerReload.executeReloadAndWaitForCompletion(CONTROLLER.getClient().getControllerClient()); } CoreUtils.makeCallWithBasicAuthn(createSimpleManagementOperationUrl(), USER, CORRECT_PASSWORD, SC_OK); }
Source:
public void tearDown() throws Exception { workspaceServiceClient.delete(PROJECT_WS_NAME, defaultTestUser.getName()); workspaceServiceClient.delete(NO_PROJECT_WS_NAME, defaultTestUser.getName()); List<String> listFactory = Arrays.asList( FACTORY_NAME_EXIST, MINIMAL_TEMPLATE_FACTORY_NAME, COMPLETE_TEMPLATE_FACTORY_NAME, FACTORY_CREATED_FROM_WORKSPACE_NAME, FACTORY_CREATED_FROM_CONFIG, FACTORY_CREATED_FROM_GIT, FACTORY_CREATED_FROM_USER_JSON); for (String factory : listFactory) { factoryServiceClient.deleteFactory(factory); } }

Target:
public void tearDown() throws Exception { workspaceServiceClient.delete(PROJECT_WS_NAME, defaultTestUser.getName()); workspaceServiceClient.delete(NO_PROJECT_WS_NAME, defaultTestUser.getName()); List<String> factoryList = Arrays.asList( FACTORY_NAME_EXIST, MINIMAL_TEMPLATE_FACTORY_NAME, COMPLETE_TEMPLATE_FACTORY_NAME, FACTORY_CREATED_FROM_WORKSPACE_NAME, FACTORY_CREATED_FROM_CONFIG_NAME, FACTORY_CREATED_FROM_GIT_NAME, FACTORY_CREATED_FROM_USER_JSON_NAME); for (String factory : factoryList) { factoryServiceClient.deleteFactory(factory); } }
Source:
public void soundFor105IsPlingPlangPlong() { assertEquals("PlingPlangPong", raindropConverter.convert(105)); }

Target:
public void soundFor105IsPlingPlangPlong() { assertEquals("PlingPlangPlong", raindropConverter.convert(105)); }
Source:
public void testCallsiteAnalysis() { TmfXmlKernelTraceStub trace = fTrace; assertNotNull(trace); TmfCpuAspect cpuAspect = null; for (ITmfEventAspect<?> oaspect : trace.getEventAspects()) { if (oaspect instanceof TmfCpuAspect) { cpuAspect = (TmfCpuAspect) oaspect; } } assertNotNull(cpuAspect); CallsiteAnalysis module = TmfTraceUtils.getAnalysisModuleOfClass(trace, CallsiteAnalysis.class, CallsiteAnalysis.ID); assertNotNull(module); assertTrue(module.schedule().isOK()); assertTrue(module.waitForCompletion()); String uuid = String.valueOf(fTrace.getUUID()); String cpu = cpuAspect.getDeviceType(); List<@NonNull ITmfCallsite> cs = module.getCallsites(uuid, cpu, "0", 42); assertEquals(EXPECTED, cs); assertEquals(Collections.emptyList(), module.getCallsites("Hello", cpu, "0", 42)); assertEquals(Collections.emptyList(), module.getCallsites(uuid, cpu, "1", 42)); assertEquals(Collections.emptyList(), module.getCallsites(uuid, cpu, "0", 12)); assertEquals(EXPECTED, module.getCallsites(uuid, cpu, "0", 55)); assertEquals(Collections.emptyList(), module.getCallsites(uuid, cpu, "..", 42)); assertEquals(Collections.emptyList(), module.getCallsites(uuid, cpu, "..", 42)); }

Target:
public void testCallsiteAnalysis() { TmfXmlKernelTraceStub trace = fTrace; assertNotNull(trace); CallsiteAnalysis module = TmfTraceUtils.getAnalysisModuleOfClass(trace, CallsiteAnalysis.class, CallsiteAnalysis.ID); assertNotNull(module); assertTrue(module.schedule().isOK()); assertTrue(module.waitForCompletion()); String uuid = String.valueOf(fTrace.getUUID()); String cpu = "cpu"; List<@NonNull ITmfCallsite> cs = module.getCallsites(uuid, cpu, "0", 42); assertEquals(EXPECTED, cs); assertEquals(Collections.emptyList(), module.getCallsites("Hello", cpu, "0", 42)); assertEquals(Collections.emptyList(), module.getCallsites(uuid, cpu, "1", 42)); assertEquals(Collections.emptyList(), module.getCallsites(uuid, cpu, "0", 12)); assertEquals(EXPECTED, module.getCallsites(uuid, cpu, "0", 55)); assertEquals(Collections.emptyList(), module.getCallsites(uuid, cpu, "..", 42)); assertEquals(Collections.emptyList(), module.getCallsites(uuid, cpu, "..", 42)); }
Source:
public String getName() { if (this == STRING) { return "String"; } else { return "List"; } }

Target:
public String getName() { return _name; }
Source:
public void progress() { if (this.firstTime) { if (this.bPlayer.isOnCooldown("JetBlaze") && !this.bPlayer.isAvatarState()) { this.remove(); return; } this.bPlayer.addCooldown("JetBlaze", this.cooldown); this.firstTime = false; } else if (System.currentTimeMillis() - this.time > this.duration) { this.remove(); return; } else if (hasAbility(this.player, FireJet.class)) { this.direction = this.player.getVelocity().clone().multiply(-1); final FireJet fj = getAbility(this.player, FireJet.class); fj.setSpeed(this.speed); fj.setDuration(this.duration); final FireComboStream fs = new FireComboStream(this.player, this, this.direction, this.player.getLocation(), 5, 1); fs.setDensity(8); fs.setSpread(1.0F); fs.setUseNewParticles(true); fs.setCollisionRadius(2); fs.setParticleEffect(ParticleEffect.SMOKE_LARGE); fs.setDamage(this.damage); fs.setFireTicks(this.fireTicks); fs.runTaskTimer(ProjectKorra.plugin, 0, 1L); this.tasks.add(fs); if (this.progressCounter % 4 == 0) { this.player.getWorld().playSound(this.player.getLocation(), Sound.ENTITY_CREEPER_PRIMED, 1, 0F); } } }

Target:
public void progress() { if (this.firstTime) { if (this.bPlayer.isOnCooldown("JetBlaze") && !this.bPlayer.isAvatarState()) { this.remove(); return; } this.firstTime = false; } else if (System.currentTimeMillis() - this.time > this.duration) { this.remove(); return; } else if (hasAbility(this.player, FireJet.class)) { this.direction = this.player.getVelocity().clone().multiply(-1); final FireJet fj = getAbility(this.player, FireJet.class); fj.setSpeed(this.speed); fj.setDuration(this.duration); final FireComboStream fs = new FireComboStream(this.player, this, this.direction, this.player.getLocation(), 5, 1); fs.setDensity(8); fs.setSpread(1.0F); fs.setUseNewParticles(true); fs.setCollisionRadius(2); fs.setParticleEffect(ParticleEffect.SMOKE_LARGE); fs.setDamage(this.damage); fs.setFireTicks(this.fireTicks); fs.runTaskTimer(ProjectKorra.plugin, 0, 1L); this.tasks.add(fs); if (this.progressCounter % 4 == 0) { this.player.getWorld().playSound(this.player.getLocation(), Sound.ENTITY_CREEPER_PRIMED, 1, 0F); } } }
Source:
public Emitter getEmitter( Supplier<ParametrizedUriEmitterConfig> config, @Nullable SSLContext sslContext, Lifecycle lifecycle, ObjectMapper jsonMapper ) { final DefaultAsyncHttpClientConfig.Builder builder = new DefaultAsyncHttpClientConfig.Builder(); if (sslContext != null) { builder.setSslContext(new JdkSslContext(sslContext, true, ClientAuth.NONE)); } builder.setThreadFactory(new DefaultThreadFactory("parametrized-emitter-http-client", true)); final AsyncHttpClient client = new DefaultAsyncHttpClient(builder.build()); lifecycle.addCloseableInstance(client); return new ParametrizedUriEmitter(config.get(), client, jsonMapper); }

Target:
public Emitter getEmitter( Supplier<ParametrizedUriEmitterConfig> config, @Nullable SSLContext sslContext, Lifecycle lifecycle, ObjectMapper jsonMapper ) { return new ParametrizedUriEmitter( config.get(), lifecycle.addCloseableInstance( HttpEmitterModule.createAsyncHttpClient("ParmetrizedUriEmitter-AsyncHttpClient-%d", sslContext) ), jsonMapper ); }
Source:
public static boolean delete(File file) { if (!file.exists()) return true; if (file.isDirectory()) { File[] children = file.listFiles(); for (File children1 : children) { delete(children1); } } return file.delete(); }

Target:
public static boolean delete(File file) { if (!file.exists()) return true; if (file.isDirectory()) { File[] children = file.listFiles(); for (File child : children) { delete(child); } } return file.delete(); }
Source:
private <T extends Trade> ValueWithFailures<List<T>> parseFile(CharSource charSource, Class<T> tradeType) { try (CsvIterator csv = CsvIterator.of(charSource, true)) { if (!csv.headers().contains(TYPE_FIELD)) { return ValueWithFailures.of(ImmutableList.of(), FailureItem.of(FailureReason.PARSING, "CSV file does not contain '" + TYPE_FIELD + "' header: {}", charSource)); } return parseFile(csv, tradeType); } catch (RuntimeException ex) { return ValueWithFailures.of(ImmutableList.of(), FailureItem.of(FailureReason.PARSING, ex, "CSV file could not be parsed: {}", charSource)); } }

Target:
private <T extends Trade> ValueWithFailures<List<T>> parseFile(CharSource charSource, Class<T> tradeType) { try (CsvIterator csv = CsvIterator.of(charSource, true)) { if (!csv.headers().contains(TYPE_FIELD)) { return ValueWithFailures.of(ImmutableList.of(), FailureItem.of(FailureReason.PARSING, "CSV file does not contain '{}' header: {}", TYPE_FIELD, charSource)); } return parseFile(csv, tradeType); } catch (RuntimeException ex) { return ValueWithFailures.of(ImmutableList.of(), FailureItem.of(FailureReason.PARSING, ex, "CSV file could not be parsed: {}", charSource)); } }
Source:
public void testReadJdbcDriver() throws Exception { String h2DriverName = "h2backup"; final ModelNode addrAddH2DriverAddr = new ModelNode(); addrAddH2DriverAddr.add("subsystem", "datasources").add("jdbc-driver", h2DriverName); final ModelNode addH2DriverOp = new ModelNode(); addH2DriverOp.get(OP).set("add"); addH2DriverOp.get(OP_ADDR).set(addrAddH2DriverAddr); addH2DriverOp.get("driver-name").set(h2DriverName); addH2DriverOp.get("driver-module-name").set("com.h2database.h2"); executeOperation(addH2DriverOp); try { final ModelNode address = new ModelNode(); address.add("subsystem", "datasources"); address.protect(); final ModelNode operation = new ModelNode(); operation.get(OP).set("get-installed-driver"); operation.get(OP_ADDR).set(address); operation.get("driver-name").set(h2DriverName); final ModelNode result = executeOperation(operation).get(0); Assert.assertEquals(h2DriverName, result.get("driver-name").asString()); Assert.assertEquals("com.h2database.h2", result.get("driver-module-name").asString()); } finally { remove(addrAddH2DriverAddr); } }

Target:
public void testReadJdbcDriver() throws Exception { String h2DriverName = "h2backup"; final ModelNode addrAddH2DriverAddr = new ModelNode(); addrAddH2DriverAddr.add("subsystem", "datasources").add("jdbc-driver", h2DriverName); final ModelNode addH2DriverOp = new ModelNode(); addH2DriverOp.get(OP).set("add"); addH2DriverOp.get(OP_ADDR).set(addrAddH2DriverAddr); addH2DriverOp.get("driver-name").set(h2DriverName); addH2DriverOp.get("driver-module-name").set("com.h2database.h2"); executeOperation(addH2DriverOp); try { final ModelNode address = new ModelNode(); address.add("subsystem", "datasources"); address.protect(); final ModelNode operation = new ModelNode(); operation.get(OP).set("get-installed-driver"); operation.get(OP_ADDR).set(address); operation.get("driver-name").set(h2DriverName); final ModelNode result = executeOperation(operation).get(0); Assert.assertEquals(h2DriverName, result.get("driver-name").asString()); Assert.assertEquals("com.h2database.h2", result.get("driver-module-name").asString()); Assert.assertEquals("", result.get("driver-xa-datasource-class-name").asString()); } finally { remove(addrAddH2DriverAddr); } }
Source:
public void testStarStarredTool() throws ApiException, IOException, TimeoutException { ApiClient client = getWebClient(); ContainersApi containersApi = new ContainersApi(client); DockstoreTool container = containersApi.getContainerByToolPath("quay.io/test_org/test2"); long containerId = container.getId(); assertEquals(2, containerId); StarRequest request = SwaggerUtility.createStarRequest(true); containersApi.starEntry(containerId, request); List<User> starredUsers = containersApi.getStarredUsers(container.getId()); Assert.assertEquals(1, starredUsers.size()); starredUsers.forEach(user -> Assert.assertNull("User profile is not lazy loaded in starred users", user.getUserProfile())); containersApi.starEntry(containerId, request); }

Target:
public void testStarStarredTool() throws ApiException, IOException, TimeoutException { ApiClient client = getWebClient(); ContainersApi containersApi = new ContainersApi(client); DockstoreTool container = containersApi.getContainerByToolPath("quay.io/test_org/test2"); Assert.assertTrue("There should be at least one user of the workflow", container.getUsers().size() > 0); Assert.assertNotNull("Upon checkUser(), a container with lazy loaded users should still get users", container.getUsers()); long containerId = container.getId(); assertEquals(2, containerId); StarRequest request = SwaggerUtility.createStarRequest(true); containersApi.starEntry(containerId, request); List<User> starredUsers = containersApi.getStarredUsers(container.getId()); Assert.assertEquals(1, starredUsers.size()); starredUsers.forEach(user -> Assert.assertNull("User profile is not lazy loaded in starred users", user.getUserProfiles())); containersApi.starEntry(containerId, request); }
Source:
private void assertRoutesAdded(int netId, RouteInfo... routes) throws Exception { for (int i = 0; i < routes.length; i++) { verify(mNetworkManagementService).addRoute(eq(netId), eq(routes[i])); } }

Target:
private void assertRoutesAdded(int netId, RouteInfo... routes) throws Exception { InOrder inOrder = inOrder(mNetworkManagementService); for (int i = 0; i < routes.length; i++) { inOrder.verify(mNetworkManagementService).addRoute(eq(netId), eq(routes[i])); } }
Source:
protected void doHealthCheck(Health.Builder builder) throws Exception { Collection<Node> nodes = this.session.getMetadata().getNodes().values(); boolean atLeastOneUp = nodes.stream().map(Node::getState).anyMatch((state) -> state == NodeState.UP); if (atLeastOneUp) { builder.up(); } else { builder.down(); } nodes.stream().map(Node::getCassandraVersion).filter(Objects::nonNull).findFirst() .ifPresent((version) -> builder.withDetail("version", version)); }

Target:
protected void doHealthCheck(Health.Builder builder) throws Exception { Collection<Node> nodes = this.session.getMetadata().getNodes().values(); Optional<Node> nodeUp = nodes.stream().filter((node) -> node.getState() == NodeState.UP).findAny(); builder.status(nodeUp.isPresent() ? Status.UP : Status.DOWN); nodeUp.map(Node::getCassandraVersion).ifPresent((version) -> builder.withDetail("version", version)); }
Source:
public void editFilenameTest() { when(binaryObj.getFilename()).thenReturn("Old file name"); String label = "a brand-new title!"; service.editLabel(agent, pid, label); verify(repoObjFactory).createExclusiveRelationship(eq(binaryObj), eq(Ebucore.filename), any(Resource.class)); verify(repoObjFactory).createExclusiveRelationship(eq(binaryObj), eq(Ebucore.filename), labelCaptor.capture()); verify(premisLogger).buildEvent(eq(Premis.FilenameChange)); verify(eventBuilder).addEventDetail(labelCaptor.capture()); assertEquals(labelCaptor.getValue(), "Object renamed from Old file name to " + label); verify(eventBuilder).writeAndClose(); verify(messageSender).sendUpdateDescriptionOperation(anyString(), pidCaptor.capture()); assertEquals(pid, pidCaptor.getValue().get(0)); }

Target:
public void editFilenameTest() { when(binaryObj.getFilename()).thenReturn("Old file name"); String label = "a brand-new title!"; service.editLabel(agent, pid, label); verify(repoObjFactory).createExclusiveRelationship(eq(binaryObj), eq(Ebucore.filename), eq(label)); verify(premisLogger).buildEvent(eq(Premis.FilenameChange)); verify(eventBuilder).addEventDetail(labelCaptor.capture()); assertEquals(labelCaptor.getValue(), "Object renamed from Old file name to " + label); verify(eventBuilder).writeAndClose(); verify(messageSender).sendUpdateDescriptionOperation(anyString(), pidCaptor.capture()); assertEquals(pid, pidCaptor.getValue().get(0)); }
Source:
protected void channelRead0(ChannelHandlerContext ctx, FullHttpRequest msg) { ByteBuf dup = msg.content().retainedDuplicate(); try { requestResponseChannel.sendRequest(new NettyServerRequest(ctx, dup)); } catch (InterruptedException e) { http2ServerMetrics.requestResponseChannelErrorCount.inc(); logger.warn("Can't send NettyServerRequest to requestResponseChannel. Cause: ", e); } }

Target:
protected void channelRead0(ChannelHandlerContext ctx, FullHttpRequest msg) { ByteBuf dup = msg.content().retainedDuplicate(); try { requestResponseChannel.sendRequest(new NettyServerRequest(ctx, dup)); } catch (InterruptedException e) { dup.release(); http2ServerMetrics.requestResponseChannelErrorCount.inc(); logger.warn("Can't send NettyServerRequest to requestResponseChannel. Cause: ", e); } }
Source:
static NBTTagCompound write(final Cube cube) { NBTTagCompound cubeNbt = new NBTTagCompound(); NBTTagCompound level = new NBTTagCompound(); cubeNbt.setTag("Level", level); cubeNbt.setInteger("DataVersion", MINECRAFT_CHUNK_DATA_VERSION); FMLCommonHandler.instance().getDataFixer().writeVersionData(cubeNbt); writeBaseCube(cube, level); writeBlocks(cube, level); writeEntities(cube, level); writeTileEntities(cube, level); writeScheduledTicks(cube, level); writeLightingInfo(cube, level); return cubeNbt; }

Target:
static NBTTagCompound write(final Cube cube) { NBTTagCompound cubeNbt = new NBTTagCompound(); NBTTagCompound level = new NBTTagCompound(); cubeNbt.setTag("Level", level); cubeNbt.setInteger("DataVersion", FMLCommonHandler.instance().getDataFixer().version); FMLCommonHandler.instance().getDataFixer().writeVersionData(cubeNbt); writeBaseCube(cube, level); writeBlocks(cube, level); writeEntities(cube, level); writeTileEntities(cube, level); writeScheduledTicks(cube, level); writeLightingInfo(cube, level); return cubeNbt; }
Source:
private static Version getApplicationVersion(final String part, final String appName) { try { return new RpmVersion(part, getAppName(part, appName), true); } catch (Exception e) { log.debug("Failed to create rpm version object, part '{}' appName '{}', error: {}", part, appName, e.getMessage()); log.debug("Exception", e); return null; } }

Target:
private static Version getApplicationVersion(final String part, final String appName) { try { return new RpmVersion(part, getAppName(part, appName), true); } catch (Exception e) { log.debug("Failed to create rpm version object, part '{}' appName '{}': {}", part, appName, e.getMessage()); log.debug("Exception", e); return null; } }
Source:
public MainTabVirtualMachinePresenter(EventBus eventBus, ViewDef view, ProxyDef proxy, PlaceManager placeManager, MainModelProvider<VM, VmListModel> modelProvider, ConsoleManager consoleManager, ConsoleUtils consoleUtils, ErrorPopupManager errorPopupManager) { super(eventBus, view, proxy, placeManager, modelProvider); this.consoleManager = consoleManager; this.errorPopupManager = errorPopupManager; getModel().getConsoleConnectEvent().addListener(new IEventListener() { @Override public void eventRaised(Event ev, Object sender, EventArgs args) { String errorMessage = MainTabVirtualMachinePresenter.this.consoleManager.connectToConsole(getModel()); if (errorMessage != null) { MainTabVirtualMachinePresenter.this.errorPopupManager.show(errorMessage); } } }); }

Target:
public MainTabVirtualMachinePresenter(EventBus eventBus, ViewDef view, ProxyDef proxy, PlaceManager placeManager, MainModelProvider<VM, VmListModel> modelProvider, ConsoleManager consoleManager, ConsoleUtils consoleUtils, ErrorPopupManager errorPopupManager) { super(eventBus, view, proxy, placeManager, modelProvider); this.consoleManager = consoleManager; this.errorPopupManager = errorPopupManager; }
Source:
public static String getResourceName(int category) { return CATEGORY_NAMES[category - 1]; }

Target:
public static String getResourceName(int category) { return (category > 0 && category < CATEGORY_NAMES_ID.length + 1) ? CATEGORY_NAMES[category - 1] : null; }
Source:
public ResponseEntity<?> delete(@PathVariable("id") Long id, HttpServletRequest request, HttpServletResponse response, UriComponentsBuilder uriBuilder) throws IOException { Study study = studyService.get(id); if (study == null) { return new ResponseEntity<>(HttpStatus.NOT_FOUND); } studyService.delete(study); return new ResponseEntity<>(HttpStatus.OK); }

Target:
public void delete(@PathVariable("id") Long id, HttpServletRequest request, HttpServletResponse response, UriComponentsBuilder uriBuilder) throws IOException { Study study = studyService.get(id); if (study == null) { throw new RestException("Study not found.", Status.NOT_FOUND); } studyService.delete(study); }
Source:
public FilterResource getSubResource(String id) { return inject(new BackendFilterResource(id, getPolicyUnit(id))); }

Target:
public FilterResource getSubResource(String id) { return inject(new BackendFilterResource(id)); }
Source:
public void validate(KubernetesEnvironment env) throws ValidationException { checkArgument(!env.getPodsData().isEmpty(), "Environment should contain at least 1 pod"); Set<String> missingMachines = new HashSet<>(env.getMachines().keySet()); for (PodData pod : env.getPodsData().values()) { if (pod.getSpec() != null && pod.getSpec().getContainers() != null) { for (Container container : pod.getSpec().getContainers()) { missingMachines.remove(Names.machineName(pod, container)); } } } checkArgument( missingMachines.isEmpty(), "Environment contains machines that are missing in recipe: %s", Joiner.on(", ").join(missingMachines)); }

Target:
public void validate(KubernetesEnvironment env) throws ValidationException { checkArgument( !env.getPodsData().isEmpty(), "Environment should contain at least 1 pod or deployment"); Set<String> missingMachines = new HashSet<>(env.getMachines().keySet()); for (PodData pod : env.getPodsData().values()) { if (pod.getSpec() != null && pod.getSpec().getContainers() != null) { for (Container container : pod.getSpec().getContainers()) { missingMachines.remove(Names.machineName(pod, container)); } } } checkArgument( missingMachines.isEmpty(), "Environment contains machines that are missing in recipe: %s", Joiner.on(", ").join(missingMachines)); }
Source:
public void initialize(Scene schemaObject) { for (SceneElement se : schemaObject.getChildren()) { addActor(se); } sceneElementTags.clear(); addChildrenTagsTo(this); }

Target:
public void initialize(Scene schemaObject) { for (SceneElement se : schemaObject.getChildren()) { addActor(se); } }
Source:
public void create(final EventTypeBase eventType) throws TopicCreationException, InternalNakadiException, NoSuchPartitionStrategyException, DuplicatedEventTypeNameException, InvalidEventTypeException { setDefaultEventTypeOptions(eventType); validateSchema(eventType); enrichment.validate(eventType); partitionResolver.validate(eventType); authorizationValidator.validateAuthorization(eventType.getAuthorization()); eventTypeRepository.saveEventType(eventType); try { timelineService.createDefaultTimeline(eventType.getName(), partitionsCalculator.getBestPartitionsCount(eventType.getDefaultStatistic()), eventType.getOptions().getRetentionTime()); } catch (final Exception e) { try { eventTypeRepository.removeEventType(eventType.getName()); } catch (final NoSuchEventTypeException e1) { LOG.error("Error creating event type {}", eventType, e1); } throw e; } try { nakadiKpiPublisher.publish(etLogEventType, () -> new JSONObject() .put("event_type", eventType.getName()) .put("status", "created") .put("category", eventType.getCategory().toString())); } catch (final Exception e) { LOG.error("Exception occurred when submitting KPI metrics event", e); } }

Target:
public void create(final EventTypeBase eventType) throws TopicCreationException, InternalNakadiException, NoSuchPartitionStrategyException, DuplicatedEventTypeNameException, InvalidEventTypeException { setDefaultEventTypeOptions(eventType); validateSchema(eventType); enrichment.validate(eventType); partitionResolver.validate(eventType); authorizationValidator.validateAuthorization(eventType.getAuthorization()); eventTypeRepository.saveEventType(eventType); try { timelineService.createDefaultTimeline(eventType.getName(), partitionsCalculator.getBestPartitionsCount(eventType.getDefaultStatistic()), eventType.getOptions().getRetentionTime()); } catch (final Exception e) { try { eventTypeRepository.removeEventType(eventType.getName()); } catch (final NoSuchEventTypeException e1) { LOG.error("Error creating event type {}", eventType, e1); } throw e; } nakadiKpiPublisher.publish(etLogEventType, () -> new JSONObject() .put("event_type", eventType.getName()) .put("status", "created") .put("category", eventType.getCategory())); }
Source:
private boolean isBufferFilled() { int available = fileBuffer.size(); return available > 0 && available >= Math.min(MIN_BYTES_READ_IN, this.fileBytesLeft); }

Target:
private boolean isBufferFilled() { int available = fileBuffer.size(); return available > 0 && available >= MIN_BYTES_READ_IN; }
Source:
private ObjectId locateBlobObjectId() throws CoreException { try { final GitIndex idx = db.getIndex(); final Entry e = idx.getEntry(path); if (e == null) throw new CoreException(new Status(IStatus.ERROR, path, CoreText.IndexFileRevision_indexEntryNotFound, null)); return e.getObjectId(); } catch (IOException e) { throw new CoreException(new Status(IStatus.ERROR, path, CoreText.IndexFileRevision_errorLookingUpPath, e)); } }

Target:
private ObjectId locateBlobObjectId() throws CoreException { try { final GitIndex idx = db.getIndex(); final Entry e = idx.getEntry(path); if (e == null) throw new CoreException(Activator.error(NLS.bind( CoreText.IndexFileRevision_indexEntryNotFound, path), null)); return e.getObjectId(); } catch (IOException e) { throw new CoreException(Activator.error(NLS.bind( CoreText.IndexFileRevision_errorLookingUpPath, path), e)); } }
Source:
private String getProcessName(String tid) { String execName = fProcessNameMap.get(tid); if (execName != null) { return execName; } ITmfTrace trace = checkNotNull(getTrace()); ITmfStateSystem kernelSs = checkNotNull(TmfStateSystemAnalysisModule.getStateSystem(trace, KernelAnalysisModule.ID)); try { int cpusNode = kernelSs.getQuarkAbsolute(Attributes.THREADS); List<Integer> cpuNodes = kernelSs.getSubAttributes(cpusNode, false); execName = getCurrentIntervalStateValue(tid, kernelSs, cpuNodes); if(!execName.equals("nonExecName")) { return execName; } } catch (AttributeNotFoundException e) { } return tid; }

Target:
private String getProcessName(String tid) { String execName = fProcessNameMap.get(tid); if (execName != null) { return execName; } ITmfTrace trace = checkNotNull(getTrace()); ITmfStateSystem kernelSs = checkNotNull(TmfStateSystemAnalysisModule.getStateSystem(trace, KernelAnalysisModule.ID)); try { int cpusNode = kernelSs.getQuarkAbsolute(Attributes.THREADS); List<Integer> cpuNodes = kernelSs.getSubAttributes(cpusNode, false); execName = getCurrentIntervalStateValue(tid, kernelSs, cpuNodes); if(execName != null) { return execName; } } catch (AttributeNotFoundException e) { } return tid; }
Source:
public V get(Object o) { K key = (K)o; long storeBucket = bucket; if (cache.getRemovedKeys().contains(key)) { return null; } V val = cache.get(key); if (val != null) { return val; } if (timeExtractor != null) { storeBucket = timeExtractor.getTime(key); } Slice valSlice = store.getSync(storeBucket, keyValueSerdeManager.serializeDataKey(key, false)); if (valSlice == null || valSlice == BucketedState.EXPIRED || valSlice.length == 0) { return null; } tmpInput.setBuffer(valSlice.buffer, valSlice.offset, valSlice.length); return keyValueSerdeManager.deserializeValue(tmpInput); }

Target:
public V get(Object o) { K key = (K)o; if (cache.getRemovedKeys().contains(key)) { return null; } V val = cache.get(key); if (val != null) { return val; } Slice valSlice = store.getSync(getBucket(key), keyValueSerdeManager.serializeDataKey(key, false)); if (valSlice == null || valSlice == BucketedState.EXPIRED || valSlice.length == 0) { return null; } tmpInput.setBuffer(valSlice.buffer, valSlice.offset, valSlice.length); return keyValueSerdeManager.deserializeValue(tmpInput); }
Source:
File getFile() { if(temp == null) { try { temp = File.createTempFile("jquery_preview", ".html"); url = temp.toURI().toURL().toString(); } catch (IOException e) { e.printStackTrace(); } } return temp; }

Target:
File getFile() { if(sourceFile == null) { try { sourceFile = File.createTempFile("jquery_preview", ".html"); sourceURL = sourceFile.toURI().toURL().toString(); } catch (IOException e) { WebUiPlugin.getDefault().logError(e); } } return sourceFile; }
Source:
protected boolean isDPValid() { this.counts.put("criteriaDpRequired", 1); boolean met = false; if (this.criteriaMet.containsKey("170.315 (h)(1)")) { this.counts.put("criteriaDpRequiredMet", 1); met = true; } if (this.criteriaMet.containsKey("170.315 (h)(2)")) { this.counts.put("criteriaDpRequiredMet", 1); met = true; } if(!met){ SortedSet<String> missing2 = new TreeSet<String>(); missing2.add("170.315 (h)(1)"); missing2.add("170.315 (h)(2)"); missingOr.add(missing2); } return (this.counts.get("criteriaDpRequiredMet") >= this.counts.get("criteriaDpRequired")); }

Target:
protected boolean isDPValid() { this.counts.put("criteriaDpRequired", 1); boolean met = false; if (this.criteriaMet.containsKey("170.315 (h)(1)")) { this.counts.put("criteriaDpRequiredMet", 1); met = true; } if (this.criteriaMet.containsKey("170.315 (h)(2)")) { this.counts.put("criteriaDpRequiredMet", 1); met = true; } if (!met) { ArrayList<String> missing = new ArrayList<String>(); missing.add("170.315 (h)(1)"); missing.add("170.315 (h)(2)"); missingOr.add(missing); } return (this.counts.get("criteriaDpRequiredMet") >= this.counts.get("criteriaDpRequired")); }
Source:
public static <E extends CosmosClientException> void setRequestHeaders(CosmosClientException cosmosClientException, Map<String, String> requestHeaders) { Map<String, String> requestHeadersMap = new HashMap<>(); requestHeaders.forEach((key, value) -> { if (!key.equals(HttpConstants.HttpHeaders.AUTHORIZATION)) { requestHeadersMap.put(key, value); } }); cosmosClientException.requestHeaders = requestHeadersMap; }

Target:
public static <E extends CosmosClientException> void setRequestHeaders(CosmosClientException cosmosClientException, Map<String, String> requestHeaders) { cosmosClientException.requestHeaders = requestHeaders; }
Source:
private void cleanStartServers(final ModelNode servers, final ModelNode domainModel, OperationContext context) throws OperationFailedException { Map<String, ProcessInfo> processInfos = serverInventory.determineRunningProcesses(); for(final Property serverProp : servers.asPropertyList()) { String serverName = serverProp.getName(); String serverGroupName = serverProp.getValue().get(GROUP).asString(); resolveExpressions(domainModel.require(SERVER_GROUP).require(serverGroupName), expressionResolver, true); if (ServerConfigResourceDefinition.AUTO_START.resolveModelAttribute(context, serverProp.getValue()).asBoolean(true)) { ProcessInfo info = processInfos.get(serverInventory.getServerProcessName(serverName)); if ( info != null ){ serverInventory.reconnectServer(serverName, domainModel, info.getAuthKey(), info.isRunning(), info.isStopping()); } else { try { serverInventory.startServer(serverName, domainModel, START_BLOCKING, false); } catch (Exception e) { ROOT_LOGGER.failedToStartServer(e, serverName); } } } } }

Target:
private void cleanStartServers(final ModelNode servers, final ModelNode domainModel, OperationContext context) throws OperationFailedException { Map<String, ProcessInfo> processInfos = serverInventory.determineRunningProcesses(); for(final Property serverProp : servers.asPropertyList()) { String serverName = serverProp.getName(); if (ServerConfigResourceDefinition.AUTO_START.resolveModelAttribute(context, serverProp.getValue()).asBoolean(true)) { ProcessInfo info = processInfos.get(serverInventory.getServerProcessName(serverName)); if ( info != null ){ serverInventory.reconnectServer(serverName, domainModel, info.getAuthKey(), info.isRunning(), info.isStopping()); } else { try { serverInventory.startServer(serverName, domainModel, START_BLOCKING, false); } catch (Exception e) { ROOT_LOGGER.failedToStartServer(e, serverName); } } } } }
Source:
public Response createFromWorkspace( @ApiParam( value = "Composite key", examples = @Example({ @ExampleProperty("workspace12345678"), @ExampleProperty("namespace/workspace_name"), @ExampleProperty("namespace_part_1/namespace_part_2/workspace_name") })) @PathParam("key") String key) throws NotFoundException, ServerException, BadRequestException, ConflictException, JsonProcessingException { throw new BadRequestException( "This is an outdated method please use /api/workspace/devfile to create a new workspace"); }

Target:
public Response createFromWorkspace( @ApiParam( value = "Composite key", examples = @Example({ @ExampleProperty("workspace12345678"), @ExampleProperty("namespace/workspace_name"), @ExampleProperty("namespace_part_1/namespace_part_2/workspace_name") })) @PathParam("key") String key) throws NotFoundException, ServerException, BadRequestException, ConflictException, JsonProcessingException { throw new BadRequestException( "This method is deprecated and may be removed at any time. Please use /api/workspace/devfile to create a new workspace"); }
Source:
private Optional<String> getClassName(TestIdentifier testIdentifier) { TestSource testSource = testIdentifier.getSource().orElse(null); if (testSource != null) { if (testSource instanceof ClassSource) { return Optional.of(((ClassSource) testSource).getJavaClass().getName()); } if (testSource instanceof MethodSource) { return Optional.of(((MethodSource) testSource).getClassName()); } } return testPlan.flatMap(plan -> plan.getParent(testIdentifier)) .flatMap(this::getClassName); }

Target:
private Optional<String> getClassName(TestIdentifier testIdentifier) { TestSource testSource = testIdentifier.getSource().orElse(null); if (testSource instanceof ClassSource) { return Optional.of(((ClassSource) testSource).getJavaClass().getName()); } if (testSource instanceof MethodSource) { return Optional.of(((MethodSource) testSource).getClassName()); } final TestIdentifier parent = testPlan.flatMap(plan -> plan.getParent(testIdentifier)).orElse(null); if (parent == null) { return Optional.of(testClass.getName()); } return getClassName(parent); }
Source:
protected void onDestroy() { super.onDestroy(); webView.setDownloadListener(null); }

Target:
protected void onDestroy() { webView.setDownloadListener(null); super.onDestroy(); }