auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testInvalidApikeyValidate() throws BugzillaRestException { RepositoryLocation location = new RepositoryLocation(); location.setUrl(actualFixture.getRepositoryUrl()); location.setProxy(null); location.setCredentialsStore(new InMemoryCredentialsStore()); location.setCredentials(AuthenticationType.REPOSITORY, new UserCredentials("tests@mylyn.eclipse.org", "")); location.setProperty(IBugzillaRestConstants.REPOSITORY_USE_API_KEY, Boolean.toString(true)); location.setProperty(IBugzillaRestConstants.REPOSITORY_API_KEY, "wvkz2SoBMBQEKv6ishp1j7NY1R9l711g5w2afXc8"); BugzillaRestClient client; thrown.expect(BugzillaRestException.class); thrown.expectMessage("The API key you specified is invalid"); client = new BugzillaRestClient(location, connector); assertNotNull(client.getClient()); client.validate(new NullOperationMonitor()); }

Target:
public void testInvalidApikeyValidate() throws BugzillaRestException { RepositoryLocation location = new RepositoryLocation(); location.setUrl(actualFixture.getRepositoryUrl()); location.setProxy(null); location.setCredentialsStore(new InMemoryCredentialsStore()); location.setCredentials(AuthenticationType.REPOSITORY, new UserCredentials("tests@mylyn.eclipse.org", "")); location.setProperty(IBugzillaRestConstants.REPOSITORY_USE_API_KEY, Boolean.toString(true)); location.setProperty(IBugzillaRestConstants.REPOSITORY_API_KEY, "wvkz2SoBMBQEKv6ishp1j7NY1R9l711g5w2afXc8"); BugzillaRestClient client; client = new BugzillaRestClient(location, connector); assertNotNull(client.getClient()); thrown.expect(BugzillaRestException.class); thrown.expectMessage("The API key you specified is invalid"); client.validate(new NullOperationMonitor()); }
Source:
private boolean canScheduleVm(VM vm) { return SchedulingManager.getInstance().canSchedule( getVdsGroup(), vm, new ArrayList<Guid>(), new ArrayList<Guid>(), vm.getDedicatedVmForVds(), new ArrayList<String>() ); }

Target:
private boolean canScheduleVm(VM vm) { List<Guid> blacklist = new ArrayList<Guid>(); if (getVdsId() != null) { blacklist.add(getVdsId()); } return SchedulingManager.getInstance().canSchedule( getVdsGroup(), vm, blacklist, Collections.<Guid> emptyList(), vm.getDedicatedVmForVds(), new ArrayList<String>() ); }
Source:
public Health health() { final int usedMemory = this.jobMetricsService.getUsedMemory(); final JobsMemoryProperties memoryProperties = this.jobsProperties.getMemory(); final int availableMemory = memoryProperties.getMaxSystemMemory() - usedMemory; final int maxJobMemory = memoryProperties.getMaxJobMemory(); final int defaultJobMemory = memoryProperties.getDefaultJobMemory(); final Health.Builder builder; if (availableMemory >= maxJobMemory) { builder = Health.up(); } else { builder = Health.outOfService(); } return builder .withDetail(NUMBER_RUNNING_JOBS_KEY, this.jobMetricsService.getNumActiveJobs()) .withDetail(USED_MEMORY_KEY, usedMemory) .withDetail(AVAILABLE_MEMORY, availableMemory) .withDetail(AVAILABLE_DEFAULT_JOB_CAPACITY, availableMemory / defaultJobMemory) .withDetail(AVAILABLE_MAX_JOB_CAPACITY, availableMemory / maxJobMemory) .build(); }

Target:
public Health health() { final int usedMemory = this.jobMetricsService.getUsedMemory(); final JobsMemoryProperties memoryProperties = this.jobsProperties.getMemory(); final int availableMemory = memoryProperties.getMaxSystemMemory() - usedMemory; final int maxJobMemory = memoryProperties.getMaxJobMemory(); final int defaultJobMemory = memoryProperties.getDefaultJobMemory(); final Health.Builder builder; if (availableMemory >= maxJobMemory) { builder = Health.up(); } else { builder = Health.outOfService(); } return builder .withDetail(NUMBER_RUNNING_JOBS_KEY, this.jobMetricsService.getNumActiveJobs()) .withDetail(USED_MEMORY_KEY, usedMemory) .withDetail(AVAILABLE_MEMORY, availableMemory) .withDetail( AVAILABLE_DEFAULT_JOB_CAPACITY, (availableMemory >= 0 && defaultJobMemory > 0) ? (availableMemory / defaultJobMemory) : 0) .withDetail( AVAILABLE_MAX_JOB_CAPACITY, (availableMemory >= 0 && maxJobMemory > 0) ? (availableMemory / maxJobMemory) : 0) .build(); }
Source:
public void addSearchBox(HTMLNode contentNode) { HTMLNode searchBox = contentNode.addChild("div", "class", "infobox infobox-normal"); searchBox.addAttribute("id", "search-freenet"); searchBox.addChild("div", "class", "infobox-header").addChild("span", "class", "search-title-label", NodeL10n.getBase().getString("WelcomeToadlet.searchBoxLabel")); HTMLNode searchBoxContent = searchBox.addChild("div", "class", "infobox-content"); if(node.pluginManager != null && node.pluginManager.isPluginLoaded("plugins.Library.Main")) { searchBoxContent.addChild("span", "class", "search-warning-text", l10n("searchBoxWarningSlow")); HTMLNode searchForm = container.addFormChild(searchBoxContent, "/library/", "searchform"); searchForm.addChild("input", new String[] { "type", "size", "name" }, new String[] { "text", "80", "search" }); searchForm.addChild("input", new String[] { "type", "name", "value" }, new String[] { "submit", "find", l10n("searchFreenet") }); searchForm.addAttribute("target", "_blank"); } else if(node.pluginManager == null || node.pluginManager.isPluginLoadedOrLoadingOrWantLoad("Library")) { HTMLNode textSpan = searchBoxContent.addChild("span", "class", "search-not-availible-warning"); NodeL10n.getBase().addL10nSubstitution(textSpan, "WelcomeToadlet.searchPluginLoading", new String[] { "link" }, new HTMLNode[] { HTMLNode.link("/plugins/") }); } else { HTMLNode textSpan = searchBoxContent.addChild("span", "class", "search-not-availible-warning"); NodeL10n.getBase().addL10nSubstitution(textSpan, "WelcomeToadlet.searchPluginNotLoaded", new String[] { "link" }, new HTMLNode[] { HTMLNode.link("/plugins/") }); } }

Target:
public void addSearchBox(HTMLNode contentNode) { HTMLNode searchBox = contentNode.addChild("div", "class", "infobox infobox-normal"); searchBox.addAttribute("id", "search-freenet"); searchBox.addChild("div", "class", "infobox-header").addChild("span", "class", "search-title-label", NodeL10n.getBase().getString("WelcomeToadlet.searchBoxLabel")); HTMLNode searchBoxContent = searchBox.addChild("div", "class", "infobox-content"); if (showSearchBox()) { searchBoxContent.addChild("span", "class", "search-warning-text", l10n("searchBoxWarningSlow")); HTMLNode searchForm = container.addFormChild(searchBoxContent, "/library/", "searchform"); searchForm.addChild("input", new String[] { "type", "size", "name" }, new String[] { "text", "80", "search" }); searchForm.addChild("input", new String[] { "type", "name", "value" }, new String[] { "submit", "find", l10n("searchFreenet") }); searchForm.addAttribute("target", "_blank"); } else if (showSearchBoxLoading()) { HTMLNode textSpan = searchBoxContent.addChild("span", "class", "search-not-availible-warning"); NodeL10n.getBase().addL10nSubstitution(textSpan, "WelcomeToadlet.searchPluginLoading", new String[] { "link" }, new HTMLNode[] { HTMLNode.link("/plugins/") }); } else { HTMLNode textSpan = searchBoxContent.addChild("span", "class", "search-not-availible-warning"); NodeL10n.getBase().addL10nSubstitution(textSpan, "WelcomeToadlet.searchPluginNotLoaded", new String[] { "link" }, new HTMLNode[] { HTMLNode.link("/plugins/") }); } }
Source:
public IsWidget getProcessDiagramView() { processDefinitionDiagramView.setDiagram(processDiagramPresenter.getView()); return processDefinitionDiagramView; }

Target:
public IsWidget getProcessDiagramView() { processDiagramPresenter.expandDiagramContainer(); return processDiagramPresenter.getView(); }
Source:
public void testSetLookByIndex() { ScreenValues.SCREEN_HEIGHT = 200; ScreenValues.SCREEN_WIDTH = 200; Sprite sprite = new SingleSprite("new sprite"); project.getDefaultScene().addSprite(sprite); LookData firstLookData = new LookData(); LookData secondLookData = new LookData(); firstLookData.setLookFilename(testImage.getName()); secondLookData.setLookFilename(testImage.getName()); firstLookData.setLookName("firstTestLook"); secondLookData.setLookName("secondTestLook"); sprite.getLookDataList().add(firstLookData); sprite.getLookDataList().add(secondLookData); Formula formula = new Formula(1); ActionFactory factory = sprite.getActionFactory(); Action action = factory.createSetLookByIndexAction(sprite, formula); action.act(1.0f); assertEquals("Action didn't set the first LookData", firstLookData, sprite.look.getLookData()); formula = new Formula(2); action = factory.createSetLookByIndexAction(sprite, formula); action.act(1.0f); assertEquals("Action didn't set the second LookData", secondLookData, sprite.look.getLookData()); }

Target:
public void testSetLookByIndex() { Formula formula = new Formula(1); ActionFactory factory = sprite.getActionFactory(); Action action = factory.createSetLookByIndexAction(sprite, formula); action.act(1.0f); assertEquals("Action didn't set the first LookData", firstLookData, sprite.look.getLookData()); formula = new Formula(2); action = factory.createSetLookByIndexAction(sprite, formula); action.act(1.0f); assertEquals("Action didn't set the second LookData", secondLookData, sprite.look.getLookData()); }
Source:
public void testJoinToFilter() throws Exception { Query query = Query.builder() .table(playerStatsTable) .metric(invoke(playerStatsTable.getMetric("highScore"))) .groupByDimension(toProjection(playerStatsTable.getDimension("overallRating"))) .whereFilter(filterParser.parseFilterExpression("subCountryIsoCode==USA", PlayerStats.class, false)) .build(); FutureTask<QueryResult> queryResult = engine.executeQuery(query); queryResult.run(); QueryResult result = queryResult.get(); List<Object> results = StreamSupport.stream(result.getData().spliterator(), false) .collect(Collectors.toList()); PlayerStats stats1 = new PlayerStats(); stats1.setId("0"); stats1.setOverallRating("Good"); stats1.setHighScore(1234); PlayerStats stats2 = new PlayerStats(); stats2.setId("1"); stats2.setOverallRating("Great"); stats2.setHighScore(2412); assertEquals(2, results.size()); assertEquals(stats1, results.get(0)); assertEquals(stats2, results.get(1)); }

Target:
public void testJoinToFilter() throws Exception { Query query = Query.builder() .table(playerStatsTable) .metric(invoke(playerStatsTable.getMetric("highScore"))) .groupByDimension(toProjection(playerStatsTable.getDimension("overallRating"))) .whereFilter(filterParser.parseFilterExpression("subCountryIsoCode==USA", PlayerStats.class, false)) .build(); List<Object> results = toList(engine.executeQuery(query, transaction).getData()); PlayerStats stats1 = new PlayerStats(); stats1.setId("0"); stats1.setOverallRating("Good"); stats1.setHighScore(1234); PlayerStats stats2 = new PlayerStats(); stats2.setId("1"); stats2.setOverallRating("Great"); stats2.setHighScore(2412); assertEquals(2, results.size()); assertEquals(stats1, results.get(0)); assertEquals(stats2, results.get(1)); }
Source:
private void setParamsTableColumnSizes() { paramsTable.getColumnModel().getColumn(0).setMinWidth(60); paramsTable.getColumnModel().getColumn(0).setPreferredWidth(60); paramsTable.getColumnModel().getColumn(1).setMinWidth(100); paramsTable.getColumnModel().getColumn(1).setPreferredWidth(100); paramsTable.getColumnModel().getColumn(2).setMinWidth(40); paramsTable.getColumnModel().getColumn(2).setPreferredWidth(40); paramsTable.getColumnModel().getColumn(3).setMinWidth(40); paramsTable.getColumnModel().getColumn(3).setPreferredWidth(40); paramsTable.getColumnModel().getColumn(4).setMinWidth(40); paramsTable.getColumnModel().getColumn(4).setPreferredWidth(40); paramsTable.getColumnModel().getColumn(5).setMinWidth(50); paramsTable.getColumnModel().getColumn(5).setPreferredWidth(100); paramsTable.getColumnModel().getColumn(6).setMinWidth(100); paramsTable.getColumnModel().getColumn(6).setPreferredWidth(999); }

Target:
private void setParamsTableColumnSizes() { for (int i = 0; i < paramsTable.getColumnCount(); i++) { DefaultTableColumnModel colModel = (DefaultTableColumnModel) paramsTable.getColumnModel(); TableColumn col = colModel.getColumn(i); int width = 0; TableCellRenderer renderer = col.getHeaderRenderer(); if (renderer == null) { renderer = paramsTable.getTableHeader().getDefaultRenderer(); } Component comp = renderer.getTableCellRendererComponent(paramsTable, col.getHeaderValue(), false, false, 0, 0); width = comp.getPreferredSize().width; col.setPreferredWidth(width + 2); } paramsTable.getColumnModel().getColumn(6).setPreferredWidth(999); }
Source:
public static SSLSocketFactory createSocketFactory(KeyStore keystore, String keystorePassword, Collection<KeyStore> extraStores) throws KeyStoreException, KeyManagementException { final Collection<X509TrustManager> managers = new ArrayList<>(); for (KeyStore ks : extraStores) { addX509Managers(managers, ks); } addX509Managers(managers, null); final TrustManager tm = new CompositeTrustManager(managers); try { final KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm()); kmf.init(keystore, keystorePassword.toCharArray()); final SSLContext ctx = SSLContext.getInstance("TLSv1.2"); ctx.init(kmf.getKeyManagers(), new TrustManager[] {tm}, new SecureRandom()); return new SSLSocketFactory(ctx); } catch (NoSuchAlgorithmException e) { throw new Error("No SSL protocols supported :(", e); } catch (UnrecoverableKeyException e) { throw new Error("Could not load RSA Key!", e); } }

Target:
public static SSLSocketFactory createSocketFactory(KeyStore keystore, String keystorePassword, Collection<KeyStore> extraStores) throws KeyStoreException, KeyManagementException { final Collection<X509TrustManager> managers = new ArrayList<>(); for (KeyStore ks : extraStores) { addX509Managers(managers, ks); } addX509Managers(managers, null); final TrustManager tm = new CompositeTrustManager(managers); try { final KeyManagerFactory kmf = KeyManagerFactory.getInstance(KeyManagerFactory.getDefaultAlgorithm()); kmf.init(keystore, keystorePassword.toCharArray()); final SSLContext ctx = SSLContext.getInstance("TLS"); ctx.init(kmf.getKeyManagers(), new TrustManager[] {tm}, new SecureRandom()); return new SSLSocketFactory(ctx); } catch (NoSuchAlgorithmException e) { throw new Error("No SSL protocols supported :(", e); } catch (UnrecoverableKeyException e) { throw new Error("Could not load RSA Key!", e); } }
Source:
public void goToLastEvent() throws CTFException { long endTime = Long.MIN_VALUE; for (CTFStreamInputReader sir : fPrio) { sir.goToLastEvent(); IEventDefinition currentEvent = sir.getCurrentEvent(); if (currentEvent != null) { endTime = Math.max(currentEvent.getTimestamp(), endTime); } } setEndTime(fTrace.timestampCyclesToNanos(endTime)); seek(fTrace.timestampNanoToCycles(getEndTime())); }

Target:
public void goToLastEvent() throws CTFException { long endTime = Long.MIN_VALUE; for (CTFStreamInputReader sir : fPrio) { sir.goToLastEvent(); IEventDefinition currentEvent = sir.getCurrentEvent(); if (currentEvent != null) { endTime = Math.max(currentEvent.getTimestamp(), endTime); } } setEndTime(fTrace.timestampCyclesToNanos(endTime)); seek(endTime); }
Source:
private Terminal createWindowsTerminal() throws IOException { try { Class<?> nativeImplementation = Class.forName("com.googlecode.lanterna.terminal.WindowsTerminal"); Constructor<?> constructor = nativeImplementation.getConstructor(InputStream.class, OutputStream.class, Charset.class, UnixLikeTTYTerminal.CtrlCBehaviour.class); return (Terminal)constructor.newInstance(inputStream, outputStream, charset, UnixLikeTTYTerminal.CtrlCBehaviour.CTRL_C_KILLS_APPLICATION); } catch(Exception ignore) { try { return createCygwinTerminal(outputStream, inputStream, charset); } catch(IOException e) { throw new IOException("To start java on Windows, use javaw!\n" + "(see <LINK_0> )", e); } } }

Target:
private Terminal createWindowsTerminal() throws IOException { try { Class<?> nativeImplementation = Class.forName("com.googlecode.lanterna.terminal.WindowsTerminal"); Constructor<?> constructor = nativeImplementation.getConstructor(InputStream.class, OutputStream.class, Charset.class, UnixLikeTTYTerminal.CtrlCBehaviour.class); return (Terminal)constructor.newInstance(inputStream, outputStream, charset, UnixLikeTTYTerminal.CtrlCBehaviour.CTRL_C_KILLS_APPLICATION); } catch(Exception ignore) { try { return createCygwinTerminal(outputStream, inputStream, charset); } catch(IOException e) { throw new IOException("To start java on Windows, use javaw!" + System.lineSeparator() + "(see <LINK_0> )", e); } } }
Source:
public void recycle(MemorySegment segment) { int numAddedBuffers = 0; synchronized (bufferQueue) { try { if (inputChannel.isReleased()) { globalPool.recycleMemorySegments(Collections.singletonList(segment)); } else { numAddedBuffers = bufferQueue.addExclusiveBuffer(new NetworkBuffer(segment, this), numRequiredBuffers); } } catch (Throwable t) { ExceptionUtils.rethrow(t); } } inputChannel.notifyBufferAvailable(numAddedBuffers); }

Target:
public void recycle(MemorySegment segment) { int numAddedBuffers = 0; synchronized (bufferQueue) { try { if (inputChannel.isReleased()) { globalPool.recycleMemorySegments(Collections.singletonList(segment)); } else { numAddedBuffers = bufferQueue.addExclusiveBuffer(new NetworkBuffer(segment, this), numRequiredBuffers); } } catch (Throwable t) { ExceptionUtils.rethrow(t); } finally { bufferQueue.notifyAll(); } } inputChannel.notifyBufferAvailable(numAddedBuffers); }
Source:
public CodeCoverageMetrics convertCobertura(CoverageResult result) { if (result == null) { return null; } float packagesCoverage = getCoveragePercentage(result, CoverageMetric.PACKAGES); float filesCoverage = getCoveragePercentage(result, CoverageMetric.FILES); float classesCoverage = getCoveragePercentage(result, CoverageMetric.CLASSES); float methodCoverage = getCoveragePercentage(result, CoverageMetric.METHOD); float lineCoverage = getCoveragePercentage(result, CoverageMetric.LINE); float conditionalCoverage = getCoveragePercentage(result, CoverageMetric.CONDITIONAL); return new CodeCoverageMetrics( packagesCoverage, filesCoverage, classesCoverage, methodCoverage, lineCoverage, conditionalCoverage ); }

Target:
public static CodeCoverageMetrics convertCobertura(CoverageResult result) { if (result == null) { return null; } float packagesCoverage = getCoveragePercentage(result, CoverageMetric.PACKAGES); float filesCoverage = getCoveragePercentage(result, CoverageMetric.FILES); float classesCoverage = getCoveragePercentage(result, CoverageMetric.CLASSES); float methodCoverage = getCoveragePercentage(result, CoverageMetric.METHOD); float lineCoverage = getCoveragePercentage(result, CoverageMetric.LINE); float conditionalCoverage = getCoveragePercentage(result, CoverageMetric.CONDITIONAL); return new CodeCoverageMetrics( packagesCoverage, filesCoverage, classesCoverage, methodCoverage, lineCoverage, conditionalCoverage ); }
Source:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_new_sensor_location); button = (Button)findViewById(R.id.saveSensorLocation); buttonCancel = (Button)findViewById(R.id.saveSensorLocationCancel); sensor_location_other = (EditText) findViewById(R.id.edit_sensor_location); sensor_location_other.setEnabled(false); DontAskAgain = (CheckBox)findViewById(R.id.sensorLocationDontAskAgain); radioGroup = (RadioGroup) findViewById(R.id.myRadioGroup); addListenerOnButton(); locations = new LinkedList<Location>(); locations.add(new Location("I dont wish to share", PRIVATE_ID)); locations.add(new Location("Upper arm", 1)); locations.add(new Location("Thigh", 2)); locations.add(new Location("Belly (abdomen)", 3)); locations.add(new Location("Lower back", 4)); locations.add(new Location("buttocks", 5)); locations.add(new Location("other", OTHER_ID)); for(Location location : locations) { AddButton(location.location, location.location_id); } radioGroup.check(PRIVATE_ID); }

Target:
protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_new_sensor_location); button = (Button)findViewById(R.id.saveSensorLocation); buttonCancel = (Button)findViewById(R.id.saveSensorLocationCancel); sensor_location_other = (EditText) findViewById(R.id.edit_sensor_location); sensor_location_other.setEnabled(false); DontAskAgain = (CheckBox)findViewById(R.id.sensorLocationDontAskAgain); radioGroup = (RadioGroup) findViewById(R.id.myRadioGroup); addListenerOnButton(); locations = new LinkedList<Location>(); locations.add(new Location("I don't wish to share", PRIVATE_ID)); locations.add(new Location("Upper arm", 1)); locations.add(new Location("Thigh", 2)); locations.add(new Location("Belly (abdomen)", 3)); locations.add(new Location("Lower back", 4)); locations.add(new Location("Buttocks", 5)); locations.add(new Location("Other", OTHER_ID)); for(Location location : locations) { AddButton(location.location, location.location_id); } radioGroup.check(PRIVATE_ID); }
Source:
public void testApplication() throws Exception { try { LocalMode lma = LocalMode.newInstance(); Configuration conf = new Configuration(false); conf.addResource(this.getClass().getResourceAsStream("/META-INF/properties.xml")); lma.prepareDAG(new Application(), conf); LocalMode.Controller lc = lma.getController(); lc.runAsync(); Thread.sleep(5000); String[] extensions = {"dat.0", "tmp"}; Collection<File> list = FileUtils.listFiles(new File(FILE_NAME), extensions, false); for (File file : list) { for (String line : FileUtils.readLines(file)) { Assert.assertEquals("Delimiter in record", true, line.contains("|")); } } } catch (ConstraintViolationException e) { Assert.fail("constraint violations: " + e.getConstraintViolations()); } }

Target:
public void testApplication() throws Exception { try { LocalMode lma = LocalMode.newInstance(); Configuration conf = new Configuration(false); conf.addResource(this.getClass().getResourceAsStream("/META-INF/properties.xml")); lma.prepareDAG(new Application(), conf); LocalMode.Controller lc = lma.getController(); lc.runAsync(); Thread.sleep(5000); String[] extensions = {"dat.0", "tmp"}; Collection<File> list = FileUtils.listFiles(new File(FILE_NAME), extensions, false); for (File file : list) { for (String line : FileUtils.readLines(file)) { Assert.assertEquals("Delimiter in record", true, (line.equals("1234|SimpleCsvFormatterExample|10000.0|false|APEX"))); } } } catch (ConstraintViolationException e) { Assert.fail("constraint violations: " + e.getConstraintViolations()); } }
Source:
public TraceStatusDMData() { this(false, false, false, 0, 0, 0, "", "", ""); fTracingSupported = false; }

Target:
public TraceStatusDMData() { fTracingSupported = false; }
Source:
public void testWrongTypeOfArguments() throws URISyntaxException, HiveException { ObjectInspector value1 = PrimitiveObjectInspectorFactory.javaIntObjectInspector; ObjectInspector[] initArguments = new ObjectInspector[]{value1}; GeocodedCountryUDF geocodedCountryUDF = new GeocodedCountryUDF( TestGeocodedCountryUDF.class.getResource(defaultDatabaseFile).getFile()); try { geocodedCountryUDF.initialize(initArguments); fail("UDFArgumentTypeException was not thrown for invalid argument type"); } catch (UDFArgumentTypeException typeEx) { } }

Target:
public void testWrongTypeOfArguments() throws HiveException { ObjectInspector value1 = PrimitiveObjectInspectorFactory.javaIntObjectInspector; ObjectInspector[] initArguments = new ObjectInspector[]{value1}; GeocodedCountryUDF geocodedCountryUDF = new GeocodedCountryUDF(); geocodedCountryUDF.initialize(initArguments); }
Source:
ExecutionPlan getExecutionPlan(String runId) { Map<String, String> generatedConfig = getGeneratedConfig(runId); Map<String, String> allowedUserConfig = new HashMap<>(userConfig); if (!LegacyTaskApplication.class.isAssignableFrom(appDesc.getAppClass())) { allowedUserConfig.remove(TaskConfig.INPUT_STREAMS()); } Config mergedConfig = JobNodeConfigurationGenerator.mergeConfig(allowedUserConfig, generatedConfig); StreamManager streamManager = buildAndStartStreamManager(mergedConfig); try { ExecutionPlanner planner = new ExecutionPlanner(mergedConfig, streamManager); return planner.plan(appDesc); } finally { streamManager.stop(); } }

Target:
ExecutionPlan getExecutionPlan(String runId) { Map<String, String> generatedConfig = getGeneratedConfig(runId); Map<String, String> allowedUserConfig = new HashMap<>(userConfig); if (!LegacyTaskApplication.class.isAssignableFrom(appDesc.getAppClass())) { LOG.warn("SamzaApplications should not specify task.inputs in configuration. " + "Ignoring configured value of " + userConfig.get(TaskConfig.INPUT_STREAMS())); allowedUserConfig.remove(TaskConfig.INPUT_STREAMS()); } Config mergedConfig = JobNodeConfigurationGenerator.mergeConfig(allowedUserConfig, generatedConfig); StreamManager streamManager = buildAndStartStreamManager(mergedConfig); try { ExecutionPlanner planner = new ExecutionPlanner(mergedConfig, streamManager); return planner.plan(appDesc); } finally { streamManager.stop(); } }
Source:
private Duration getCurrentDelay() { final PollResponse<T> current = pollResponse.get(); return (current != null && current.getRetryAfter() != null && current.getRetryAfter().toNanos() > 0) ? current.getRetryAfter() : pollInterval; }

Target:
private Duration getCurrentDelay() { final PollResponse<T> current = pollResponse; return (current != null && current.getRetryAfter() != null && current.getRetryAfter().compareTo(Duration.ZERO) > 0) ? current.getRetryAfter() : pollInterval; }
Source:
public ListenableFuture<LabelId> renameLabel(final String newName, final LabelId id, final LabelType type) { final ListenableFuture<List<Row>> oldNameFuture = getLabelRows(id, type); return transform(oldNameFuture, new Function<List<Row>, LabelId>() { @Override public LabelId apply(final List<Row> rows) { Date oldestDate = rows.get(0).getDate("timestamp"); String oldName = rows.get(0).getString("name"); for (Row row : rows) { Date date = row.getDate("timestamp"); if (date.before(oldestDate)) { oldestDate = date; oldName = row.getString("name"); } } session.executeAsync(updateUidNameStatement.bind(newName, toLong(id), type.toValue())); session.executeAsync( updateNameUidStatement.bind(oldName, type.toValue(), newName, type.toValue(), toLong(id))); return id; } }); }

Target:
public ListenableFuture<Boolean> renameLabel(final String newName, final LabelId id, final LabelType type) { final ListenableFuture<List<Row>> oldNameFuture = getNameRows(id, type); return transform(oldNameFuture, new AsyncFunction<List<Row>, Boolean>() { @Override public ListenableFuture<Boolean> apply(final List<Row> rows) { Row row = rows.get(0); String oldName = row.getString("name"); Date creationTime = row.getDate("creation_time"); final ResultSetFuture nameIdFuture = session.executeAsync( updateNameUidStatement.bind(newName, toLong(id), type.toValue(), creationTime, oldName, type.toValue(), creationTime, newName, type.toValue(), creationTime, toLong(id))); return transform(nameIdFuture, new Function<ResultSet, Boolean>() { @Nullable @Override public Boolean apply(final ResultSet input) { if (!input.wasApplied()) { LOG.warn("A rename of a label was requested but could not be completed."); return false; } return true; } }); } }); }
Source:
protected InternalCacheEntry<WrappedBytes, WrappedBytes> performGet(long address, Object k, boolean peek) { WrappedBytes wrappedKey = toWrapper(k); while (address != 0) { long nextAddress = offHeapEntryFactory.getNext(address); InternalCacheEntry<WrappedBytes, WrappedBytes> ice = offHeapEntryFactory.fromMemory(address); if (wrappedKey.equalsWrappedBytes(ice.getKey()) && !ice.isExpired(timeService.wallClockTime())) { if (!peek) { entryRetrieved(address); } return ice; } else { address = nextAddress; } } return null; }

Target:
protected InternalCacheEntry<WrappedBytes, WrappedBytes> performGet(long address, Object k, boolean peek) { WrappedBytes wrappedKey = toWrapper(k); long now = timeService.wallClockTime(); while (address != 0) { long nextAddress = offHeapEntryFactory.getNext(address); InternalCacheEntry<WrappedBytes, WrappedBytes> ice = offHeapEntryFactory.fromMemory(address); if (wrappedKey.equalsWrappedBytes(ice.getKey()) && !ice.isExpired(now)) { if (!peek) { entryRetrieved(address); } return ice; } else { address = nextAddress; } } return null; }
Source:
public int draw() { while (true) { final int n = (int) (N * Math.random()); count++; if (Math.random() < probabilities.get(n)) { count = 0; return n; } else if(count>=600){ count = 0; return 0; } } }

Target:
public int draw() { while (true) { final int n = (int) (N * Math.random()); count++; if (Math.random() < probabilities.get(n)) { count = 0; return n; } else if(count>=SAMPLING_MAX){ count = 0; return 0; } } }
Source:
private void dispose(boolean releaseState) { synchronized (lock) { try { numAcknowledgedTasks = -1; if (!discarded && releaseState) { checkpointsCleaner.asyncDiscardPrivateStatesAndCountCheckpoints(operatorStates, targetLocation, checkpointId, jobId); } } finally { discarded = true; notYetAcknowledgedTasks.clear(); acknowledgedTasks.clear(); cancelCanceller(); } } }

Target:
private void dispose(boolean releaseState) { synchronized (lock) { try { numAcknowledgedTasks = -1; if (!discarded && releaseState) { Runnable cleanAction = () -> { try { StateUtil.bestEffortDiscardAllStateObjects(operatorStates.values()); targetLocation.disposeOnFailure(); } catch (Throwable t) { LOG.warn( "Could not properly dispose the private states in the pending checkpoint of job {}.", checkpointId, jobId, t); } finally { operatorStates.clear(); } }; checkpointsCleaner.cleanCheckpoint(cleanAction, cleanupFinishedCallback, executor); } } finally { discarded = true; notYetAcknowledgedTasks.clear(); acknowledgedTasks.clear(); cancelCanceller(); } } }
Source:
public SavedRequest getRequest(HttpServletRequest request, HttpServletResponse response) { Cookie savedRequestCookie = WebUtils.getCookie(request, COOKIE_NAME); if (savedRequestCookie != null) { final String originalURI = decodeCookie(savedRequestCookie.getValue()); UriComponents uriComponents = UriComponentsBuilder.fromUriString(originalURI).build(); DefaultSavedRequest.Builder builder = new DefaultSavedRequest.Builder(); int port = uriComponents.getPort(); if (port == -1) { if ("https".equalsIgnoreCase(uriComponents.getScheme())) { port = 443; } else { port = 80; } } final MultiValueMap<String, String> queryParams = uriComponents.getQueryParams(); if (!queryParams.isEmpty()) { final HashMap<String, String[]> parameters = new HashMap<>(queryParams.size()); queryParams.forEach((key, value) -> parameters.put(key, value.toArray(new String[]{}))); builder.setParameters(parameters); } return builder.setScheme(uriComponents.getScheme()) .setServerName(uriComponents.getHost()) .setRequestURI(uriComponents.getPath()) .setQueryString(uriComponents.getQuery()) .setServerPort(port) .setMethod(request.getMethod()) .setRequestURL(getRequestURL(originalURI, uriComponents)) .setContextPath(request.getContextPath()) .setServletPath(getServletPath(uriComponents, request.getContextPath())) .build(); } return null; }

Target:
public SavedRequest getRequest(HttpServletRequest request, HttpServletResponse response) { Cookie savedRequestCookie = WebUtils.getCookie(request, COOKIE_NAME); if (savedRequestCookie != null) { final String originalURI = decodeCookie(savedRequestCookie.getValue()); UriComponents uriComponents = UriComponentsBuilder.fromUriString(originalURI).build(); DefaultSavedRequest.Builder builder = new DefaultSavedRequest.Builder(); int port = uriComponents.getPort(); if (port == -1) { if ("https".equalsIgnoreCase(uriComponents.getScheme())) { port = 443; } else { port = 80; } } final MultiValueMap<String, String> queryParams = uriComponents.getQueryParams(); if (!queryParams.isEmpty()) { final HashMap<String, String[]> parameters = new HashMap<>(queryParams.size()); queryParams.forEach((key, value) -> parameters.put(key, value.toArray(new String[]{}))); builder.setParameters(parameters); } return builder.setScheme(uriComponents.getScheme()) .setServerName(uriComponents.getHost()) .setRequestURI(uriComponents.getPath()) .setQueryString(uriComponents.getQuery()) .setServerPort(port) .setMethod(request.getMethod()) .build(); } return null; }
Source:
public void shouldRemoveRelationshipFromExplicitIndex() throws Exception { long relId = addRelationshipToExplicitIndex(); try ( Transaction tx = session.beginTransaction() ) { ExplicitIndexWrite indexWrite = tx.indexWrite(); indexWrite.relationshipRemoveFromExplicitIndex( INDEX_NAME, relId ); tx.success(); } try ( org.neo4j.graphdb.Transaction ctx = graphDb.beginTx() ) { IndexHits<Node> hits = graphDb.index().forNodes( INDEX_NAME ).get( KEY, "this is it" ); assertFalse( hits.hasNext() ); hits.close(); ctx.success(); } }

Target:
public void shouldRemoveRelationshipFromExplicitIndex() throws Exception { long relId = addRelationshipToExplicitIndex(); try ( Transaction tx = session.beginTransaction() ) { ExplicitIndexWrite indexWrite = tx.indexWrite(); indexWrite.relationshipRemoveFromExplicitIndex( INDEX_NAME, relId ); tx.success(); } try ( org.neo4j.graphdb.Transaction ctx = graphDb.beginTx() ) { IndexHits<Node> hits = graphDb.index().forNodes( INDEX_NAME ).get( KEY, VALUE ); assertFalse( hits.hasNext() ); hits.close(); ctx.success(); } }
Source:
public void addHeaderParam_string_addsParam() { action.addHeaderParam(PARAM_NAME_1, PARAM_VALUE_1); action.addHeaderParam(PARAM_NAME_2, PARAM_VALUE_2); verifyOnlyExpextedParamsArePresent(action.getHeaderParams()); }

Target:
public void addHeaderParam_string_addsParam() { action.addHeaderParam(PARAM_NAME_1, PARAM_VALUE_1); action.addHeaderParam(PARAM_NAME_2, PARAM_VALUE_2); verifyOnlyExpectedParamsArePresent(action.getHeaderParams()); }
Source:
private Metadata initializeMetadata(Data key, Data value) { try { Object keyMetadata = metadataInitializer.createFromData(key); Object valueMetadata = metadataInitializer.createFromData(value); if (keyMetadata != null || valueMetadata != null) { Metadata metadata = new Metadata(); metadata.set(true, keyMetadata); metadata.set(false, valueMetadata); return metadata; } } catch (Exception e) { rethrow(e); } return null; }

Target:
private Metadata initializeMetadata(Data key, Data value) { try { Object keyMetadata = metadataInitializer.createFromData(key); Object valueMetadata = metadataInitializer.createFromData(value); if (keyMetadata != null || valueMetadata != null) { Metadata metadata = new Metadata(); metadata.setKeyMetadata(keyMetadata); metadata.setValueMetadata(valueMetadata); return metadata; } } catch (Exception e) { rethrow(e); } return null; }
Source:
private void display(ChangeInfo info) { Map<Integer, AccountInfo> r = new HashMap<>(); Map<Integer, AccountInfo> cc = new HashMap<>(); for (LabelInfo label : Natives.asList(info.all_labels().values())) { if (label.all() != null) { for (ApprovalInfo ai : Natives.asList(label.all())) { (ai.value() != 0 ? r : cc).put(ai._account_id(), ai); } } } for (Integer i : r.keySet()) { cc.remove(i); } r.remove(info.owner()._account_id()); cc.remove(info.owner()._account_id()); Set<Integer> removable = new HashSet<>(); if (info.removable_reviewers() != null) { for (AccountInfo a : Natives.asList(info.removable_reviewers())) { removable.add(a._account_id()); } } Map<Integer, VotableInfo> votable = votable(info); SafeHtml rHtml = Labels.formatUserList(style, r.values(), removable, votable); SafeHtml ccHtml = Labels.formatUserList(style, cc.values(), removable, votable); reviewersText.setInnerSafeHtml(rHtml); ccText.setInnerSafeHtml(ccHtml); if (Gerrit.isSignedIn()) { int currentUser = Gerrit.getUserAccountInfo()._account_id(); boolean showAddmeButton = info.owner()._account_id() != currentUser && !cc.containsKey(currentUser) && !r.containsKey(currentUser); addMe.setVisible(showAddmeButton); } }

Target:
private void display(ChangeInfo info) { Map<Integer, AccountInfo> r = new HashMap<>(); Map<Integer, AccountInfo> cc = new HashMap<>(); for (LabelInfo label : Natives.asList(info.all_labels().values())) { if (label.all() != null) { for (ApprovalInfo ai : Natives.asList(label.all())) { (ai.value() != 0 ? r : cc).put(ai._account_id(), ai); } } } for (Integer i : r.keySet()) { cc.remove(i); } r.remove(info.owner()._account_id()); cc.remove(info.owner()._account_id()); Set<Integer> removable = new HashSet<>(); if (info.removable_reviewers() != null) { for (AccountInfo a : Natives.asList(info.removable_reviewers())) { removable.add(a._account_id()); } } Map<Integer, VotableInfo> votable = votable(info); SafeHtml rHtml = Labels.formatUserList(style, r.values(), removable, votable); SafeHtml ccHtml = Labels.formatUserList(style, cc.values(), removable, votable); reviewersText.setInnerSafeHtml(rHtml); ccText.setInnerSafeHtml(ccHtml); if (Gerrit.isSignedIn()) { int currentUser = Gerrit.getUserAccountInfo()._account_id(); boolean showAddMeButton = info.owner()._account_id() != currentUser && !cc.containsKey(currentUser) && !r.containsKey(currentUser); addMe.setVisible(showAddMeButton); } }
Source:
public ReferenceElement parse(XmlPullParser parser, int initialDepth) throws Exception { Integer begin = ParserUtils.getIntegerAttribute(parser, ReferenceElement.ATTR_BEGIN); Integer end = ParserUtils.getIntegerAttribute(parser, ReferenceElement.ATTR_END); String typeString = parser.getAttributeValue(null, ReferenceElement.ATTR_TYPE); ReferenceElement.Type type = ReferenceElement.Type.valueOf(typeString); String anchor = parser.getAttributeValue(null, ReferenceElement.ATTR_ANCHOR); String uri = parser.getAttributeValue(null, ReferenceElement.ATTR_URI); ExtensionElement child = null; while (true) { int eventType = parser.next(); if (eventType == XmlPullParser.START_TAG) { String elementName = parser.getName(); String namespace = parser.getNamespace(); ExtensionElementProvider<?> provider = ProviderManager.getExtensionProvider(elementName, namespace); if (provider != null) { child = provider.parse(parser); } } if (eventType == XmlPullParser.END_TAG) { return new ReferenceElement(begin, end, type, anchor, uri, child); } } }

Target:
public ReferenceElement parse(XmlPullParser parser, int initialDepth) throws Exception { Integer begin = ParserUtils.getIntegerAttribute(parser, ReferenceElement.ATTR_BEGIN); Integer end = ParserUtils.getIntegerAttribute(parser, ReferenceElement.ATTR_END); String typeString = parser.getAttributeValue(null, ReferenceElement.ATTR_TYPE); ReferenceElement.Type type = ReferenceElement.Type.valueOf(typeString); String anchor = parser.getAttributeValue(null, ReferenceElement.ATTR_ANCHOR); String uriString = parser.getAttributeValue(null, ReferenceElement.ATTR_URI); URI uri = uriString != null ? new URI(uriString) : null; ExtensionElement child = null; outerloop: while (true) { int eventType = parser.next(); if (eventType == XmlPullParser.START_TAG) { String elementName = parser.getName(); String namespace = parser.getNamespace(); ExtensionElementProvider<?> provider = ProviderManager.getExtensionProvider(elementName, namespace); if (provider != null) { child = provider.parse(parser); } } if (eventType == XmlPullParser.END_TAG) { break outerloop; } } return new ReferenceElement(begin, end, type, anchor, uri, child); }
Source:
public void test_equals() throws Exception { assertThat(symbolicValue("42")).isNotEqualTo(null); assertThat(symbolicValue("42")).isNotEqualTo(""); assertThat(symbolicValue("42")).isEqualTo(symbolicValue("42")); assertThat(symbolicValue("42")).isNotEqualTo(symbolicValue("null")); assertThat(symbolicValue("x")).isNotEqualTo(symbolicValue("x").constrain(Truthiness.FALSY)); assertThat(symbolicValue("x").constrain(Truthiness.FALSY)).isEqualTo(symbolicValue("x").constrain(Truthiness.FALSY)); }

Target:
public void test_equals() throws Exception { assertThat(symbolicValue("42")).isNotEqualTo(null); assertThat(symbolicValue("42")).isNotEqualTo(""); assertThat(symbolicValue("42")).isEqualTo(symbolicValue("42")); assertThat(symbolicValue("42")).isEqualTo(symbolicValue("45")); assertThat(symbolicValue("42")).isNotEqualTo(symbolicValue("null")); assertThat(symbolicValue("x")).isNotEqualTo(symbolicValue("x").constrain(Truthiness.FALSY)); assertThat(symbolicValue("x").constrain(FALSY)).isEqualTo(symbolicValue("x").constrain(FALSY)); }
Source:
public void addColumn(ConnectorSession session, ConnectorTableHandle tableHandle, ColumnMetadata column) { RaptorTableHandle table = (RaptorTableHandle) tableHandle; List<TableColumn> existingColumns = dao.listTableColumns(table.getSchemaName(), table.getTableName()); TableColumn lastColumn = existingColumns.get(existingColumns.size() - 1); long columnId = lastColumn.getColumnId() + 1; int ordinalPosition = lastColumn.getOrdinalPosition() + 1; StorageTypeConverter storageTypeConverter = new StorageTypeConverter(typeManager); requireNonNull(storageTypeConverter.toStorageType(column.getType()), "storage type cannot be null"); String type = column.getType().getTypeSignature().toString(); daoTransaction(dbi, MetadataDao.class, dao -> { dao.insertColumn(table.getTableId(), columnId, column.getName(), ordinalPosition, type, null, null); dao.updateTableVersion(table.getTableId(), session.getStartTime()); }); shardManager.addColumn(table.getTableId(), new ColumnInfo(columnId, column.getType())); }

Target:
public void addColumn(ConnectorSession session, ConnectorTableHandle tableHandle, ColumnMetadata column) { RaptorTableHandle table = (RaptorTableHandle) tableHandle; List<TableColumn> existingColumns = dao.listTableColumns(table.getSchemaName(), table.getTableName()); TableColumn lastColumn = existingColumns.get(existingColumns.size() - 1); long columnId = lastColumn.getColumnId() + 1; int ordinalPosition = lastColumn.getOrdinalPosition() + 1; StorageTypeConverter storageTypeConverter = new StorageTypeConverter(typeManager); checkState(storageTypeConverter.toStorageType(column.getType()) != null, "storage type cannot be null"); String type = column.getType().getTypeSignature().toString(); daoTransaction(dbi, MetadataDao.class, dao -> { dao.insertColumn(table.getTableId(), columnId, column.getName(), ordinalPosition, type, null, null); dao.updateTableVersion(table.getTableId(), session.getStartTime()); }); shardManager.addColumn(table.getTableId(), new ColumnInfo(columnId, column.getType())); }
Source:
public static VersionNumber getMinJavaLevel() { try { Method method = Jenkins.class.getMethod("getJavaMinLevel"); Object res = method.invoke(null); if (res instanceof VersionNumber) { return (VersionNumber) res; } } catch(SecurityException | NoSuchMethodException | IllegalAccessException | InvocationTargetException ex) { } final VersionNumber version = Jenkins.getVersion(); if (version == null) { return JAVA_LEVEL_7; } return version.isNewerThan(JAVA_8_MINIMAL_SINCE) ? JAVA_LEVEL_7 : JAVA_LEVEL_8; }

Target:
public static VersionNumber getMinJavaLevel() { final VersionNumber version = Jenkins.getVersion(); if (version == null) { return JAVA_LEVEL_7; } return version.isOlderThan(JAVA_8_MINIMAL_SINCE) ? JAVA_LEVEL_7 : JAVA_LEVEL_8; }
Source:
private void wasCreated() throws Exception { refreshData(); refreshChildren(); }

Target:
void wasCreated() throws Exception { refresh(); }
Source:
public void testReadFileJournaltype() throws IOException { if (!container.isStarted(DEFAULT_FULL_JBOSSAS)) { container.start(DEFAULT_FULL_JBOSSAS); } ManagementClient managementClient = createManagementClient(); assertEquals("ASYNCIO", readJournalType(managementClient)); assertNotNull(readRuntimeJournalType(managementClient)); ModelNode op = Operations.createAddOperation(Operations.createAddress("system-property", "org.apache.activemq.artemis.core.io.aio.AIOSequentialFileFactory.DISABLED")); op.get(VALUE).set(true); execute(managementClient, op, true); managementClient.close(); container.stop(DEFAULT_FULL_JBOSSAS); container.start(DEFAULT_FULL_JBOSSAS); managementClient = createManagementClient(); assertEquals("ASYNCIO", readJournalType(managementClient)); assertEquals("NIO", readRuntimeJournalType(managementClient)); container.stop(DEFAULT_FULL_JBOSSAS); }

Target:
public void testReadFileJournaltype() throws IOException { if (!container.isStarted(DEFAULT_FULL_JBOSSAS)) { container.start(DEFAULT_FULL_JBOSSAS); } ManagementClient managementClient = createManagementClient(); assertEquals("ASYNCIO", readJournalType(managementClient)); assertNotNull(readRuntimeJournalType(managementClient)); ModelNode op = Operations.createAddOperation(AIO_DISABLED_ADDRESS); op.get(VALUE).set(true); execute(managementClient, op, true); managementClient.close(); container.stop(DEFAULT_FULL_JBOSSAS); container.start(DEFAULT_FULL_JBOSSAS); managementClient = createManagementClient(); assertEquals("ASYNCIO", readJournalType(managementClient)); assertEquals("NIO", readRuntimeJournalType(managementClient)); op = Operations.createRemoveOperation(AIO_DISABLED_ADDRESS); execute(managementClient, op, true); container.stop(DEFAULT_FULL_JBOSSAS); }
Source:
private MethodBehavior get(String signature, @Nullable Symbol.MethodSymbol symbol) { MethodBehavior mb = behaviors.get(signature); if(mb != null) { return mb; } if (symbol != null) { MethodTree declaration = symbol.declaration(); if (SymbolicExecutionVisitor.methodCanNotBeOverriden(symbol) && declaration != null) { sev.execute(declaration); return behaviors.get(signature); } } if (!crossFileEnabled && !isknownSignature(WHITELIST, signature)) { return null; } if (!bytecodeBehaviors.containsKey(signature)) { new BytecodeEGWalker(this, semanticModel).getMethodBehavior(signature, classLoader); } return bytecodeBehaviors.get(signature); }

Target:
private MethodBehavior get(String signature, @Nullable Symbol.MethodSymbol symbol) { MethodBehavior mb = behaviors.get(signature); if(mb != null) { return mb; } if (symbol != null) { MethodTree declaration = symbol.declaration(); if (SymbolicExecutionVisitor.methodCanNotBeOverriden(symbol) && declaration != null) { sev.execute(declaration); return behaviors.get(signature); } } if (!crossFileEnabled && !isKnownSignature(signature)) { return null; } if (!bytecodeBehaviors.containsKey(signature)) { new BytecodeEGWalker(this, semanticModel).getMethodBehavior(signature, classLoader); } return bytecodeBehaviors.get(signature); }
Source:
public TemplateClassification resetTemplateType() { this.changeTemplateType("Unknown"); return this; }

Target:
public TemplateClassification resetTemplateType() { this.changeTemplateType(TemplateTypes.UNKNOWN); return this; }
Source:
public final byte[] getByteArray(final Message message) { DatagramWriter optionsAndPayloadWriter = new DatagramWriter(); serializeOptionsAndPayload(optionsAndPayloadWriter, message.getOptions(), message.getPayload()); optionsAndPayloadWriter.writeCurrentByte(); MessageHeader header = new MessageHeader(CoAP.VERSION, message.getType(), message.getToken(), message.getRawCode(), message.getMID(), optionsAndPayloadWriter.size()); DatagramWriter messageWriter = new DatagramWriter(); serializeHeader(messageWriter, header); messageWriter.writeCurrentByte(); messageWriter.write(optionsAndPayloadWriter); return messageWriter.toByteArray(); }

Target:
public final byte[] getByteArray(final Message message) { if (message == null) { throw new NullPointerException("message must not be null!"); } DatagramWriter optionsAndPayloadWriter = new DatagramWriter(); serializeOptionsAndPayload(optionsAndPayloadWriter, message.getOptions(), message.getPayload()); optionsAndPayloadWriter.writeCurrentByte(); MessageHeader header = new MessageHeader(CoAP.VERSION, message.getType(), message.getToken(), message.getRawCode(), message.getMID(), optionsAndPayloadWriter.size()); DatagramWriter messageWriter = new DatagramWriter(); serializeHeader(messageWriter, header); messageWriter.writeCurrentByte(); messageWriter.write(optionsAndPayloadWriter); return messageWriter.toByteArray(); }
Source:
protected void switchToNewWindow() { Wait<WebDriver> wait = Locator.getFluentWait(); wait.until((new Function<WebDriver, Boolean>() { @Override public Boolean apply(WebDriver driver) { try { return driver.getWindowHandles().size() > 1; } catch (StaleElementReferenceException e) { return null; } } })); String handle = null; Iterator<String> handleIt = driver.getWindowHandles().iterator(); while (handleIt.hasNext()) { handle = handleIt.next(); } System.err.println(driver.getWindowHandles()); driver.switchTo().window(handle); }

Target:
protected void switchToNewWindow() { Wait<WebDriver> wait = Locator.getFluentWait(); wait.until((new Function<WebDriver, Boolean>() { @Override public Boolean apply(WebDriver driver) { try { return driver.getWindowHandles().size() > 1; } catch (StaleElementReferenceException e) { return null; } } })); String handle = null; for (String h : driver.getWindowHandles()) { handle = h; } driver.switchTo().window(handle); }