auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
static URL substitute(URL input, String variable, String substitution) throws IOException { File output = File.createTempFile(input.getFile(), ".substituted", new File("build")); try (BufferedWriter writer = new BufferedWriter(new FileWriter(output))) { try (BufferedReader reader = new BufferedReader(new InputStreamReader(input.openStream(), "UTF-8"))) { while (true) { String line = reader.readLine(); if (line == null) { break; } else { writer.write(line.replace("${" + variable + "}", substitution)); writer.newLine(); } } } } return output.toURI().toURL(); }

Target:
static URL substitute(URL input, String variable, String substitution) throws IOException { File output = File.createTempFile(input.getFile(), ".substituted", new File("build")); try (BufferedWriter writer = new BufferedWriter(new FileWriter(output)); BufferedReader reader = new BufferedReader(new InputStreamReader(input.openStream(), "UTF-8"))) { while (true) { String line = reader.readLine(); if (line == null) { break; } else { writer.write(line.replace("${" + variable + "}", substitution)); writer.newLine(); } } } return output.toURI().toURL(); }
Source:
public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: onBackPressed(); return true; case R.id.search_posts_list: mSearchMenuItem = item; mSearchView = (SearchView) item.getActionView(); mSearchView.setOnQueryTextListener(this); if (!NetworkUtils.checkConnection(this)) { mSearchView.clearFocus(); MenuItemCompat.collapseActionView(mSearchMenuItem); } else { MenuItemCompat.setOnActionExpandListener(mSearchMenuItem, this); MenuItemCompat.expandActionView(mSearchMenuItem); if (!TextUtils.isEmpty(mQuery)) { onQueryTextSubmit(mQuery); mSearchView.setQuery(mQuery, true); } } return true; default: return super.onOptionsItemSelected(item); } }

Target:
public boolean onOptionsItemSelected(MenuItem item) { switch (item.getItemId()) { case android.R.id.home: onBackPressed(); return true; case R.id.search_posts_list: onSearchPostsListSelected(); return true; default: return super.onOptionsItemSelected(item); } }
Source:
public boolean onActionItemClicked(ActionMode mode, MenuItem item) { switch (item.getItemId()) { case Menu.FIRST: if (mLabel == mAddedLabel) { addIssue(); } else { editIssueLabel(); } break; case Menu.FIRST + 1: new AlertDialog.Builder(IssueLabelListActivity.this) .setMessage(getString(R.string.issue_dialog_delete_message, mLabel.getName())) .setPositiveButton(R.string.delete, (dialog, whichButton) -> { IssuesLabelService .deleteIssueLabel(IssueLabelListActivity.this, getRootLayout(), mRepoOwner, mRepoName, mLabel.getName()) .subscribe(result -> { forceLoaderReload(0); setResult(RESULT_OK); }, e -> {}); }) .setNegativeButton(R.string.cancel, null) .show(); break; default: break; } mode.finish(); return true; }

Target:
public boolean onActionItemClicked(ActionMode mode, MenuItem item) { switch (item.getItemId()) { case Menu.FIRST: if (mLabel == mAddedLabel) { addIssue(); } else { editIssueLabel(); } break; case Menu.FIRST + 1: new AlertDialog.Builder(IssueLabelListActivity.this) .setMessage(getString(R.string.issue_dialog_delete_message, mLabel.getName())) .setPositiveButton(R.string.delete, (dialog, whichButton) -> { IssuesLabelService .deleteIssueLabel( IssueLabelListActivity.this, mRepoOwner, mRepoName, mLabel.getName() ).subscribe(result -> { forceLoaderReload(0); setResult(RESULT_OK); }, error -> {}); }) .setNegativeButton(R.string.cancel, null) .show(); break; default: break; } mode.finish(); return true; }
Source:
static void validExposedSubsystems(Set<String> subsystems, List<String> exposedSubsystems) throws OperationFailedException { List<String> unkownSubsystems = new LinkedList<>(); for (String esub : exposedSubsystems) { if (!"*".equals(esub) && !subsystems.contains(esub)) { unkownSubsystems.add(esub); } } if (!unkownSubsystems.isEmpty()) { throw MicroProfileMetricsLogger.LOGGER.unknownSubsystems(unkownSubsystems); } }

Target:
static void validExposedSubsystems(Set<String> subsystems, List<String> exposedSubsystems) throws OperationFailedException { List<String> unknownSubsystems = new LinkedList<>(); for (String esub : exposedSubsystems) { if (!"*".equals(esub) && !subsystems.contains(esub)) { unknownSubsystems.add(esub); } } if (!unknownSubsystems.isEmpty()) { throw MicroProfileMetricsLogger.LOGGER.unknownSubsystems(unknownSubsystems); } }
Source:
public void testTimeoutViaSystemProperty() throws Exception { System.setProperty("org.jbpm.cxf.client.connectionTimeout", "10"); System.setProperty("org.jbpm.cxf.client.receiveTimeout", "10"); try { KieBase kbase = readKnowledgeBase(); KieSession ksession = createSession(kbase); ksession.getWorkItemManager().registerWorkItemHandler("Service Task", new WebServiceWorkItemHandler(ksession)); Map<String, Object> params = new HashMap<String, Object>(); params.put("s", "john"); params.put("mode", "sync"); WorkflowProcessInstance processInstance = (WorkflowProcessInstance) ksession.startProcess("org.jboss.qa.jbpm.CallWS", params); fail("should throw Read Timeout error"); } catch (Exception e) { assertTrue(true); } finally { System.clearProperty("org.jbpm.cxf.client.connectionTimeout"); System.clearProperty("org.jbpm.cxf.client.receiveTimeout"); } }

Target:
public void testTimeoutViaSystemProperty() throws Exception { System.setProperty("org.jbpm.cxf.client.connectionTimeout", "10"); System.setProperty("org.jbpm.cxf.client.receiveTimeout", "10"); try { KieBase kbase = readKnowledgeBase(); KieSession ksession = createSession(kbase); ksession.getWorkItemManager().registerWorkItemHandler("Service Task", new WebServiceWorkItemHandler(ksession)); Map<String, Object> params = new HashMap<String, Object>(); params.put("s", "john"); params.put("mode", "sync"); WorkflowProcessInstance processInstance = (WorkflowProcessInstance) ksession.startProcess("org.jboss.qa.jbpm.CallWS", params); fail("should throw Read Timeout error"); } catch (Exception e) { assertTrue(isCausedBySocketTimeoutException(e)); } finally { System.clearProperty("org.jbpm.cxf.client.connectionTimeout"); System.clearProperty("org.jbpm.cxf.client.receiveTimeout"); } }
Source:
public static File newTempFile(String prefix, String ext) { String sanitizedPrefix = (prefix!=null ? prefix + "-" : ""); String sanitizedExt = (ext!=null ? ext.startsWith(".") || ext.length()>4 ? ext : "."+ext : ""); try { File tempFile = File.createTempFile(sanitizedPrefix, sanitizedExt, new File(tmp())); tempFile.deleteOnExit(); return tempFile; } catch (IOException e) { Exceptions.propagate(e); return null; } }

Target:
public static File newTempFile(String prefix, String ext) { String sanitizedPrefix = (prefix!=null ? prefix + "-" : ""); String sanitizedExt = (ext!=null ? ext.startsWith(".") || ext.length()>4 ? ext : "."+ext : ""); try { File tempFile = File.createTempFile(sanitizedPrefix, sanitizedExt, new File(tmp())); tempFile.deleteOnExit(); return tempFile; } catch (IOException e) { throw Exceptions.propagate(e); } }
Source:
public List<Element> previousElementSiblings() { if (parentNode == null) { return null; } List<Element> siblings = parent().childElementsList(); int index = indexInList(this, siblings); Validate.notNull(index); if (index > 0 && index < siblings.size()) { return siblings.subList(0, index); } return null; }

Target:
public List<Element> previousElementSiblings() { if (parentNode == null) { return Collections.emptyList(); } List<Element> siblings = parent().childElementsList(); int index = indexInList(this, siblings); Validate.notNull(index); if (index > 0 && index < siblings.size()) { return siblings.subList(0, index); } return Collections.emptyList(); }
Source:
public void calculateMip(double scale, double mapScale, double screenScale) { int size = (int) (16 * scale * viewSize()); if (isTile) { size *= mapScale; } if (icons.length > 1) { int smallestSide = (int) (size * screenScale); int closestValue = Integer.MAX_VALUE; int closestIndex = -1; if(iconSizes != null) { for (int i = 0; i < iconSizes.length; i++) { if (iconSizes[i] < closestValue && iconSizes[i] >= smallestSide) { closestValue = iconSizes[i]; closestIndex = i; } } } if (closestIndex > 0) { iconIndex = closestIndex; } } }

Target:
public void calculateMip(double scale, double mapScale, double screenScale) { int size = (int) (16 * scale * viewSize()); if (isTile) { size *= mapScale; } if (icons.length > 1) { int smallestSide = (int) (size * screenScale); int closestValue = Integer.MAX_VALUE; int closestIndex = -1; for (int i = 0; i < iconSizes.length; i++) { if (iconSizes[i] < closestValue && iconSizes[i] >= smallestSide) { closestValue = iconSizes[i]; closestIndex = i; } } if (closestIndex > 0) { iconIndex = closestIndex; } } }
Source:
public static PushConfiguration read(String location) throws IOException { BufferedReader bufferedReader = null; PushConfiguration pushConfiguration = null; try { bufferedReader = new BufferedReader( new InputStreamReader(Thread.currentThread().getContextClassLoader().getResourceAsStream(location))); Gson gson = new Gson(); pushConfiguration = gson.fromJson(bufferedReader, PushConfiguration.class); pushConfiguration.setServerUrl(!pushConfiguration.getServerUrl().endsWith("/") ? pushConfiguration.getServerUrl() + '/' : pushConfiguration.getServerUrl()); } finally { if (bufferedReader != null) { bufferedReader.close(); } } return pushConfiguration; }

Target:
public static PushConfiguration read(String location) throws IOException { BufferedReader bufferedReader = null; PushConfiguration pushConfiguration = null; try { bufferedReader = new BufferedReader( new InputStreamReader(Thread.currentThread().getContextClassLoader().getResourceAsStream(location))); Gson gson = new Gson(); pushConfiguration = gson.fromJson(bufferedReader, PushConfiguration.class); if (!pushConfiguration.getServerUrl().endsWith("/")) { pushConfiguration.setServerUrl(pushConfiguration.getServerUrl() + '/'); } } finally { if (bufferedReader != null) { bufferedReader.close(); } } return pushConfiguration; }
Source:
public void testRebuildIndexesInRepository(@MavenRepository(repositoryId = REPOSITORY_RELEASES_1, setup = MavenIndexedRepositorySetup.class) Repository repository, @MavenTestArtifact(repositoryId = REPOSITORY_RELEASES_1, id = GROUP_ID + ":" + ARTIFACT_ID1, versions = { VERSION }) Path artifact1, @MavenTestArtifact(repositoryId = REPOSITORY_RELEASES_1, id = GROUP_ID + ":" + ARTIFACT_ID2, versions = { VERSION }) Path artifact2) throws Exception { final UUID jobKey = expectedJobKey; final String jobName = expectedJobName; jobManager.registerExecutionListener(jobKey.toString(), (jobKey1, statusExecuted) -> { if (StringUtils.equals(jobKey1, jobKey.toString()) && statusExecuted) { try { RepositoryPath indexPath = repositoryIndexDirectoryPathResolver.resolve(repository); RepositoryPath packedIndexPath = indexPath.resolve(IndexingContext.INDEX_FILE_PREFIX + ".gz"); Assertions.assertThat(packedIndexPath).matches(Files::exists); } catch (Exception e) { throw new UndeclaredThrowableException(e); } } }); addCronJobConfig(jobKey, jobName, RebuildMavenIndexesCronJob.class, STORAGE0, repository.getId()); await().atMost(EVENT_TIMEOUT_SECONDS, TimeUnit.SECONDS).untilTrue(receivedExpectedEvent()); }

Target:
public void testRebuildIndexesInRepository(@MavenRepository(repositoryId = REPOSITORY_RELEASES_1, setup = MavenIndexedRepositorySetup.class) Repository repository, @MavenTestArtifact(repositoryId = REPOSITORY_RELEASES_1, id = GROUP_ID + ":" + ARTIFACT_ID1, versions = { VERSION }) Path artifact1, @MavenTestArtifact(repositoryId = REPOSITORY_RELEASES_1, id = GROUP_ID + ":" + ARTIFACT_ID2, versions = { VERSION }) Path artifact2) throws Exception { final UUID jobKey = expectedJobKey; final String jobName = expectedJobName; jobManager.registerExecutionListener(jobKey.toString(), (jobKey1, statusExecuted) -> { if (StringUtils.equals(jobKey1, jobKey.toString()) && statusExecuted) { try { RepositoryPath indexPath = repositoryIndexDirectoryPathResolver.resolve(repository); RepositoryPath packedIndexPath = indexPath.resolve(IndexingContext.INDEX_FILE_PREFIX + ".gz"); assertThat(packedIndexPath).matches(Files::exists); } catch (Exception e) { throw new UndeclaredThrowableException(e); } } }); addCronJobConfig(jobKey, jobName, RebuildMavenIndexesCronJob.class, STORAGE0, repository.getId()); await().atMost(EVENT_TIMEOUT_SECONDS, TimeUnit.SECONDS).untilTrue(receivedExpectedEvent()); }
Source:
public void collect(RowData physicalValueRow) { if (keyProjection.length == 0) { emitRow(null, (GenericRowData) physicalValueRow); return; } for (RowData physicalKeyRow : physicalKeyRows) { if (physicalValueRow == null) { physicalKeyRow.setRowKind(RowKind.DELETE); } emitRow((GenericRowData) physicalKeyRow, (GenericRowData) physicalValueRow); } }

Target:
public void collect(RowData physicalValueRow) { if (keyProjection.length == 0) { emitRow(null, (GenericRowData) physicalValueRow); return; } for (RowData physicalKeyRow : physicalKeyRows) { emitRow((GenericRowData) physicalKeyRow, (GenericRowData) physicalValueRow); } }
Source:
public Cache<ImmutableBytesPtr,PTable> getMetaDataCache() { Cache<ImmutableBytesPtr,PTable> result = metaDataCache; if (result == null) { synchronized(this) { result = metaDataCache; if(result == null) { long maxSize = config.getLong(QueryServices.MAX_SERVER_METADATA_CACHE_SIZE_ATTRIB, QueryServicesOptions.DEFAULT_MAX_SERVER_METADATA_CACHE_SIZE); long maxTTL = config.getLong(QueryServices.STATS_UPDATE_FREQ_MS_ATTRIB, QueryServicesOptions.DEFAULT_STATS_UPDATE_FREQ_MS); metaDataCache = result = CacheBuilder.newBuilder() .maximumWeight(maxSize) .expireAfterAccess(maxTTL, TimeUnit.MILLISECONDS) .weigher(new Weigher<ImmutableBytesPtr, PTable>() { @Override public int weigh(ImmutableBytesPtr key, PTable table) { return SizedUtil.IMMUTABLE_BYTES_PTR_SIZE + key.getLength() + table.getEstimatedSize(); } }) .build(); } } } return result; }

Target:
public Cache<ImmutableBytesPtr,PTable> getMetaDataCache() { Cache<ImmutableBytesPtr,PTable> result = metaDataCache; if (result == null) { synchronized(this) { result = metaDataCache; if(result == null) { long maxTTL = Math.min(config.getLong( QueryServices.MAX_SERVER_METADATA_CACHE_TIME_TO_LIVE_MS_ATTRIB, QueryServicesOptions.DEFAULT_MAX_SERVER_METADATA_CACHE_TIME_TO_LIVE_MS), config.getLong( QueryServices.STATS_UPDATE_FREQ_MS_ATTRIB, QueryServicesOptions.DEFAULT_STATS_UPDATE_FREQ_MS)); long maxSize = config.getLong(QueryServices.MAX_SERVER_METADATA_CACHE_SIZE_ATTRIB, QueryServicesOptions.DEFAULT_MAX_SERVER_METADATA_CACHE_SIZE); metaDataCache = result = CacheBuilder.newBuilder() .maximumWeight(maxSize) .expireAfterAccess(maxTTL, TimeUnit.MILLISECONDS) .weigher(new Weigher<ImmutableBytesPtr, PTable>() { @Override public int weigh(ImmutableBytesPtr key, PTable table) { return SizedUtil.IMMUTABLE_BYTES_PTR_SIZE + key.getLength() + table.getEstimatedSize(); } }) .build(); } } } return result; }
Source:
public Set<Diagnostic> validate(Iterator<EObject> eObjectsIterator) throws ValidationCanceledException { final Set<Diagnostic> diagnostics = new LinkedHashSet<Diagnostic>(); if (validationRunning) { return diagnostics; } validationRunning = true; try { final boolean isTreeIterator = eObjectsIterator instanceof TreeIterator<?>; while (!cancelationRequested && eObjectsIterator.hasNext()) { boolean isSubtreePruned = false; final EObject eObject = eObjectsIterator.next(); if (isTreeIterator && isSkipSubtree(eObject, null)) { ((TreeIterator<?>) eObjectsIterator).prune(); isSubtreePruned = true; } if (isFiltered(eObject)) { continue; } final Diagnostic diagnostic = doValidate(eObject); if (isTreeIterator && !isSubtreePruned && isSkipSubtree(eObject, diagnostic)) { ((TreeIterator<?>) eObjectsIterator).prune(); } if (isIgnored(eObject, diagnostic)) { continue; } diagnostics.add(diagnostic); invokeValidationResultListeners(eObject, diagnostic, true); } } finally { validationRunning = false; } if (cancelationRequested) { throw new ValidationCanceledException(); } return diagnostics; }

Target:
public Set<Diagnostic> validate(Iterator<EObject> eObjectsIterator) throws ValidationCanceledException { final Set<Diagnostic> diagnostics = new LinkedHashSet<Diagnostic>(); if (validationRunning) { return diagnostics; } validationRunning = true; try { final boolean isTreeIterator = eObjectsIterator instanceof TreeIterator<?>; while (!cancelationRequested && eObjectsIterator.hasNext()) { final EObject eObject = eObjectsIterator.next(); Diagnostic diagnostic = null; boolean isSubtreePruned = false; if (isTreeIterator && isSkipSubtree(eObject, Optional.ofNullable(diagnostic))) { ((TreeIterator<?>) eObjectsIterator).prune(); isSubtreePruned = true; } if (isFiltered(eObject)) { continue; } diagnostic = doValidate(eObject); if (isTreeIterator && !isSubtreePruned && isSkipSubtree(eObject, Optional.of(diagnostic))) { ((TreeIterator<?>) eObjectsIterator).prune(); } if (isIgnored(eObject, diagnostic)) { continue; } diagnostics.add(diagnostic); invokeValidationResultListeners(eObject, diagnostic, true); } } finally { validationRunning = false; } if (cancelationRequested) { throw new ValidationCanceledException(); } return diagnostics; }
Source:
private void configureButtons(AlertDialog.Builder builder) { builder.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dismiss(); } }); builder.setPositiveButton(R.string.delete, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { Fragment target = getTargetFragment(); if (target != null) { target.onActivityResult(getTargetRequestCode(), Activity.RESULT_OK, new Intent()); } dismiss(); } }); }

Target:
private void configureButtons(AlertDialog.Builder builder) { builder.setNegativeButton(R.string.cancel, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { dismiss(); } }); builder.setPositiveButton(R.string.delete, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { Fragment target = getTargetFragment(); if (target != null) { target.onActivityResult(getTargetRequestCode(), Activity.RESULT_OK, null); } dismiss(); } }); }
Source:
public URL addParameters(Map<String, String> parameters) { if (CollectionUtils.isEmptyMap(parameters)) { return this; } boolean hasAndEqual = true; for (Map.Entry<String, String> entry : parameters.entrySet()) { String value = getParameters().get(entry.getKey()); if (value == null) { if (entry.getValue() != null) { hasAndEqual = false; break; } } else { if (!value.equals(entry.getValue())) { hasAndEqual = false; break; } } } if (hasAndEqual) { return this; } if (frozen) { Map<String, String> map = new HashMap<>(getParameters()); map.putAll(parameters); return new URL(protocol, username, password, host, port, path, map); } else { getParameters().putAll(parameters); resetMethodParameters(); return this; } }

Target:
public URL addParameters(Map<String, String> parameters) { if (CollectionUtils.isEmptyMap(parameters)) { return this; } boolean hasAndEqual = true; for (Map.Entry<String, String> entry : parameters.entrySet()) { String value = getParameters().get(entry.getKey()); if (value == null) { if (entry.getValue() != null) { hasAndEqual = false; break; } } else { if (!value.equals(entry.getValue())) { hasAndEqual = false; break; } } } if (hasAndEqual) { return this; } Map<String, String> srcParams = getParameters(); Map<String, String> newMap = new HashMap<>((int) ((srcParams.size() + parameters.size()) / 0.75 + 1)); newMap.putAll(srcParams); newMap.putAll(parameters); return new URL(protocol, username, password, host, port, path, newMap); }
Source:
private void checkSymbolUsage(ImportTree importTree, String importName) { IdentifierTree id = null; if (importTree.qualifiedIdentifier().is(Tree.Kind.IDENTIFIER)) { id = (IdentifierTree) importTree.qualifiedIdentifier(); } else if (importTree.qualifiedIdentifier().is(Tree.Kind.MEMBER_SELECT)) { id = ((MemberSelectExpressionTree) importTree.qualifiedIdentifier()).identifier(); } if (id != null) { SemanticModel semanticModel = (SemanticModel) context.getSemanticModel(); Symbol symbol = semanticModel.getSymbol(importTree); Symbol owner = symbol.owner(); if (symbol.isVariableSymbol() && symbol.usages().stream().allMatch(identifierTree -> semanticModel.getEnclosingClass(identifierTree) == owner)) { context.reportIssue(this, importTree, "Remove this unused import '" + importName + "'."); } } }

Target:
private void checkSymbolUsage(ImportTree importTree, String importName) { IdentifierTree id = null; if (importTree.qualifiedIdentifier().is(Tree.Kind.IDENTIFIER)) { id = (IdentifierTree) importTree.qualifiedIdentifier(); } else if (importTree.qualifiedIdentifier().is(Tree.Kind.MEMBER_SELECT)) { id = ((MemberSelectExpressionTree) importTree.qualifiedIdentifier()).identifier(); } if (id != null) { SemanticModel semanticModel = (SemanticModel) context.getSemanticModel(); if (semanticModel != null) { Symbol symbol = semanticModel.getSymbol(importTree); if (symbol != null) { Symbol owner = symbol.owner(); if (symbol.isVariableSymbol() && symbol.usages().stream().allMatch(identifierTree -> semanticModel.getEnclosingClass(identifierTree) == owner)) { context.reportIssue(this, importTree, "Remove this unused import '" + importName + "'."); } } } } }
Source:
public CohortDefinition getEncounterSearchAdvanced() { EncounterCohortDefinition cd = new EncounterCohortDefinition(); cd.addParameter(new Parameter("onOrAfter", "reporting.parameter.startDate", Date.class)); cd.addParameter(new Parameter("onOrBefore", "reporting.parameter.endDate", Date.class)); cd.addParameter(new Parameter("atLeastCount", "reporting.parameter.atleast", Integer.class)); cd.addParameter(new Parameter("atMostCount", "reporting.parameter.atMost", Integer.class)); cd.addParameter(new Parameter("encounterTypeList", "reporting.parameter.encounterTypeList", EncounterType.class, List.class, null)); cd.addParameter(new Parameter("formList", "reporting.parameter.formList", Form.class, List.class, null)); cd.addParameter(new Parameter("locationList", "reporting.parameter.location", Location.class, List.class, null)); cd.addParameter(new Parameter("timeQualifier", "reporting.parameter.timeQualifier", TimeQualifier.class)); return cd; }

Target:
public CohortDefinition getEncounterSearchAdvanced() { EncounterCohortDefinition cd = new EncounterCohortDefinition(); cd.addParameter(new Parameter("onOrAfter", "reporting.parameter.onOrAfter", Date.class)); cd.addParameter(new Parameter("onOrBefore", "reporting.parameter.onOrBefore", Date.class)); cd.addParameter(new Parameter("atLeastCount", "reporting.parameter.atLeastCount", Integer.class)); cd.addParameter(new Parameter("atMostCount", "reporting.parameter.atMostCount", Integer.class)); cd.addParameter(new Parameter("encounterTypeList", "reporting.parameter.encounterTypeList", EncounterType.class, List.class, null)); cd.addParameter(new Parameter("formList", "reporting.parameter.formList", Form.class, List.class, null)); cd.addParameter(new Parameter("locationList", "reporting.parameter.locationList", Location.class, List.class, null)); cd.addParameter(new Parameter("timeQualifier", "reporting.parameter.timeQualifier", TimeQualifier.class)); return cd; }
Source:
public SshAuthRequest(String username, SocketAddress clientAddress) { this(username, null, clientAddress); }

Target:
public SshAuthRequest(String username, SocketAddress clientAddress) { this(username, null, null, clientAddress); }
Source:
private void connect() throws IOException { if (socket != null) return; Socket newSocket = new Socket(); newSocket.connect(new InetSocketAddress(hostname, 7818)); newSocket.setSoTimeout(30000); newSocket.setTcpNoDelay(true); socket = newSocket; outStream = new DataOutputStream(new BufferedOutputStream(socket.getOutputStream())); inStream = new DataInputStream(new BufferedInputStream(socket.getInputStream())); if (transcodeMode != null && transcodeMode.length() > 0) { outStream.write(("XCODE_SETUP " + transcodeMode + "\r\n").getBytes(Sage.BYTE_CHARSET)); outStream.flush(); String response = Sage.readLineBytes(inStream); if (!"OK".equals(response)) throw new java.io.IOException("Error with remote transcode setup for " + transcodeMode + " of: " + response); } outStream.write("OPENW ".getBytes(Sage.BYTE_CHARSET)); outStream.write(remoteFilename.getBytes(StandardCharsets.UTF_16BE)); outStream.write("\r\n".getBytes(Sage.BYTE_CHARSET)); outStream.flush(); String response = Sage.readLineBytes(inStream); if (!"OK".equals(response)) { disconnect(); throw new IOException("Error opening remote file of:" + response); } }

Target:
private void connect() throws IOException { if (socket != null) return; Socket newSocket = new Socket(); newSocket.connect(new InetSocketAddress(hostname, 7818)); newSocket.setSoTimeout(30000); newSocket.setTcpNoDelay(true); socket = newSocket; outStream = new DataOutputStream(new BufferedOutputStream(socket.getOutputStream())); inStream = new DataInputStream(new BufferedInputStream(socket.getInputStream())); if (transcodeMode != null && transcodeMode.length() > 0) { outStream.write(("XCODE_SETUP " + transcodeMode + "\r\n").getBytes(Sage.BYTE_CHARSET)); outStream.flush(); String response = Sage.readLineBytes(inStream); if (!"OK".equals(response)) throw new java.io.IOException("Error with remote transcode setup for " + transcodeMode + " of: " + response); } if (readonly) { outStream.write("OPENW ".getBytes(Sage.BYTE_CHARSET)); outStream.write(remoteFilename.getBytes(StandardCharsets.UTF_16BE)); } else { outStream.write("WRITEOPENW ".getBytes(Sage.BYTE_CHARSET)); outStream.write(remoteFilename.getBytes(StandardCharsets.UTF_16BE)); outStream.write((" " + Integer.toString(uploadId)).getBytes(Sage.BYTE_CHARSET)); } outStream.write("\r\n".getBytes(Sage.BYTE_CHARSET)); outStream.flush(); String response = Sage.readLineBytes(inStream); if (!"OK".equals(response)) { disconnect(); throw new IOException("Error opening remote file of:" + response); } }
Source:
public void onProcessComplete(int exitValue) { LOGGER.info("Model run complete."); }

Target:
public void onProcessComplete(int exitValue) { LOGGER.info(LOG_MODEL_RUN_COMPLETE); }
Source:
private VdsDynamic createVdsDynamic(V1Node node) { Map<String, String> labels = node.getMetadata().getLabels(); VdsDynamic dynamic = new VdsDynamic(); dynamic.setId(vdsManager.getVdsId()); dynamic.setStatus("true".equals(labels.get("kubevirt.io/schedulable")) ? VDSStatus.Up : VDSStatus.NonOperational); dynamic.setCpuThreads(node.getStatus().getCapacity().getOrDefault("cpu", new Quantity("0")).getNumber().intValue()); dynamic.setPhysicalMemMb(4809); dynamic.setKernelVersion(node.getStatus().getNodeInfo().getKernelVersion()); return dynamic; }

Target:
private VdsDynamic createVdsDynamic(V1Node node) { Map<String, String> labels = node.getMetadata().getLabels(); VdsDynamic dynamic = new VdsDynamic(); dynamic.setId(vdsManager.getVdsId()); if ("true".equals(labels.get("kubevirt.io/schedulable"))) { dynamic.setStatus(VDSStatus.Up); } else { dynamic.setStatus(VDSStatus.NonOperational); dynamic.setNonOperationalReason(NonOperationalReason.KUBEVIRT_NOT_SCHEDULABLE); } dynamic.setCpuThreads(node.getStatus().getCapacity().getOrDefault("cpu", new Quantity("0")).getNumber().intValue()); dynamic.setPhysicalMemMb(4809); dynamic.setKernelVersion(node.getStatus().getNodeInfo().getKernelVersion()); return dynamic; }
Source:
public static ImmutableMap<String, Ds3Type> removeDollarSignFromTypeMap( final ImmutableMap<String, Ds3Type> map) throws TypeRenamingConflictException { if (isEmpty(map)) { return ImmutableMap.of(); } final ImmutableMap.Builder<String, Ds3Type> builder = ImmutableMap.builder(); for (Map.Entry<String, Ds3Type> entry : map.entrySet()) { final String typeName = removeDollarSignFromName(entry.getKey()); final Ds3Type type = removeDollarSignFromType(entry.getValue()); if (!containsType(typeName, entry.getValue(), builder.build())) { builder.put(typeName, type); } } return builder.build(); }

Target:
public static ImmutableMap<String, Ds3Type> removeDollarSignFromTypeMap( final ImmutableMap<String, Ds3Type> map) throws TypeRenamingConflictException { if (isEmpty(map)) { return ImmutableMap.of(); } final ImmutableMap.Builder<String, Ds3Type> builder = ImmutableMap.builder(); for (final Map.Entry<String, Ds3Type> entry : map.entrySet()) { final String typeName = removeDollarSignFromName(entry.getKey()); final Ds3Type type = removeDollarSignFromType(entry.getValue()); if (!containsType(typeName, entry.getValue(), builder.build())) { builder.put(typeName, type); } } return builder.build(); }
Source:
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { Integer applicationMode = getApplicationMode(getEngineSessionId(request)); request.setAttribute(ATTR_APPLICATION_MODE, getApplicationModeObject(applicationMode)); List<PluginData> pluginData = getPluginData(); request.setAttribute(ATTR_PLUGIN_DEFS, getPluginDefinitionsArray(pluginData)); request.setAttribute(ATTR_ENGINE_REPORTS_BASE_URL, getReportInit(reportRedirectUrl.substring(reportBaseUrl.length()), reportRightClickRedirectUrl.substring(reportBaseUrl.length()))); request.setAttribute(ATTR_DISPLAY_SUPPORTED_BROWSER_WARNING, getValueObject(String.valueOf(getDisplaySupportedBrowserWarning()))); super.doGet(request, response); }

Target:
protected void doGet(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { Integer applicationMode = getApplicationMode(getEngineSessionId(request)); request.setAttribute(ATTR_APPLICATION_MODE, getApplicationModeObject(applicationMode)); List<PluginData> pluginData = getPluginData(); request.setAttribute(ATTR_PLUGIN_DEFS, getPluginDefinitionsArray(pluginData)); request.setAttribute(ATTR_ENGINE_REPORTS_BASE_URL, getReportInit(reportRedirectUrl.substring(reportBaseUrl.length()), reportRightClickRedirectUrl.substring(reportBaseUrl.length()))); request.setAttribute(ATTR_DISPLAY_SUPPORTED_BROWSER_WARNING, getDisplaySupportedBrowserWarning() ? BooleanNode.TRUE : BooleanNode.FALSE); super.doGet(request, response); }
Source:
public void recreateMediaStreamTracks() { final ArrayList<SourceGroupPacketExtension> sourceGroups = new ArrayList<>(); final ArrayList<SourcePacketExtension> sources = new ArrayList<>(); for (ChannelShim channelShim : channelShims) { if (MediaType.VIDEO.equals(channelShim.getMediaType())) { final Collection<SourceGroupPacketExtension> channelSourceGroups = channelShim.getSourceGroups(); if (channelSourceGroups != null) { sourceGroups.addAll(channelSourceGroups); } final Collection<SourcePacketExtension> channelSources = channelShim.getSources(); if (channelSources != null) { sources.addAll(channelSources); } } } if (!sources.isEmpty() || !sourceGroups.isEmpty()) { MediaStreamTrackDesc[] tracks = MediaStreamTrackFactory.createMediaStreamTracks( sources, sourceGroups); setMediaStreamTracks(tracks); } }

Target:
public void recreateMediaStreamTracks() { final Supplier<Stream<ChannelShim>> videoChannels = () -> channelShims .stream() .filter(c -> MediaType.VIDEO.equals(c.getMediaType())); final List<SourcePacketExtension> sources = videoChannels .get() .map(ChannelShim::getSources) .filter(Objects::nonNull) .flatMap(Collection::stream) .collect(Collectors.toList()); final List<SourceGroupPacketExtension> sourceGroups = videoChannels .get() .map(ChannelShim::getSourceGroups) .filter(Objects::nonNull) .flatMap(Collection::stream) .collect(Collectors.toList()); if (!sources.isEmpty() || !sourceGroups.isEmpty()) { MediaStreamTrackDesc[] tracks = MediaStreamTrackFactory.createMediaStreamTracks( sources, sourceGroups); setMediaStreamTracks(tracks); } }
Source:
boolean verifySignatureFor(String algorithm, byte[] secretBytes, String header, String payload, byte[] signatureBytes) throws NoSuchAlgorithmException, InvalidKeyException { return verifySignatureFor(algorithm, secretBytes, header.getBytes(Charsets.UTF_8), payload.getBytes(Charsets.UTF_8), signatureBytes); }

Target:
boolean verifySignatureFor(String algorithm, byte[] secretBytes, String header, String payload, byte[] signatureBytes) throws NoSuchAlgorithmException, InvalidKeyException { return verifySignatureFor(algorithm, secretBytes, header.getBytes(StandardCharsets.UTF_8), payload.getBytes(StandardCharsets.UTF_8), signatureBytes); }
Source:
public void close() { boolean success = false; writeLockAll(); try { clear(); success = true; } finally { writeUnlockAll(); if (success) { segments.clear(); } } }

Target:
public void close() { writeLockAll(); try { clear(); } finally { writeUnlockAll(); } segments.clear(); }
Source:
public T setUrl(String url) { if (!url.contains("://")){ url = "<LINK_0>" + url; } return setUri(Uri.create(url)); }

Target:
public T setUrl(String url) { return setUri(Uri.create(url)); }
Source:
private void highlightActiveMenuItem() { int highlightItem = -1; if (page.getTopFragment() instanceof HistoryFragment) { highlightItem = R.id.nav_item_history; } else if (page.getTopFragment() instanceof SavedPagesFragment) { highlightItem = R.id.nav_item_saved_pages; } else if (page.getTopFragment() instanceof NearbyFragment) { highlightItem = R.id.nav_item_nearby; } else if (page.getTopFragment() instanceof PageViewFragmentInternal) { PageViewFragmentInternal fragment = (PageViewFragmentInternal) page.getTopFragment(); if (fragment.getHistoryEntry() != null) { if (fragment.getHistoryEntry().getSource() == HistoryEntry.SOURCE_MAIN_PAGE) { highlightItem = R.id.nav_item_today; } else if (fragment.getHistoryEntry().getSource() == HistoryEntry.SOURCE_RANDOM) { highlightItem = R.id.nav_item_random; } } } if (highlightItem != -1) { page.getNavDrawer().getMenu().findItem(highlightItem).setChecked(true); } }

Target:
private void highlightActiveMenuItem() { for (int id : ACTION_ITEMS_ALL) { page.getNavDrawer().getMenu().findItem(id).setCheckable(true) .setChecked(false); } int highlightItem = -1; if (page.getTopFragment() instanceof HistoryFragment) { highlightItem = R.id.nav_item_history; } else if (page.getTopFragment() instanceof SavedPagesFragment) { highlightItem = R.id.nav_item_saved_pages; } else if (page.getTopFragment() instanceof NearbyFragment) { highlightItem = R.id.nav_item_nearby; } else if (page.getTopFragment() instanceof PageViewFragmentInternal) { PageViewFragmentInternal fragment = (PageViewFragmentInternal) page.getTopFragment(); if (fragment.getHistoryEntry() != null) { if (fragment.getHistoryEntry().getSource() == HistoryEntry.SOURCE_MAIN_PAGE) { highlightItem = R.id.nav_item_today; } else if (fragment.getHistoryEntry().getSource() == HistoryEntry.SOURCE_RANDOM) { highlightItem = R.id.nav_item_random; } } } if (highlightItem != -1) { page.getNavDrawer().getMenu().findItem(highlightItem).setChecked(true); } }
Source:
public boolean matches(ITmfEvent event) { if (event == null || fEventAspect == null) { return false; } Object value = fEventAspect.resolve(event); if (value == null) { return false; } if (fType == Type.NUM) { if (fValueNumber != null) { if (value instanceof Number) { double valueDouble = ((Number) value).doubleValue(); return (Double.compare(valueDouble, fValueNumber.doubleValue()) == fResult) ^ fNot; } try { double valueDouble = Long.decode(value.toString()).doubleValue(); return (Double.compare(valueDouble, fValueNumber.doubleValue()) == fResult) ^ fNot; } catch (NumberFormatException e) { } try { double valueDouble = NumberFormat.getInstance().parse(value.toString()).doubleValue(); return (Double.compare(valueDouble, fValueNumber.doubleValue()) == fResult) ^ fNot; } catch (ParseException e) { } } } else if (fType == Type.ALPHA) { String valueString = value.toString(); int comp = (int) Math.signum(valueString.compareTo(fValue.toString())); return (comp == fResult) ^ fNot; } else if (fType == Type.TIMESTAMP) { if (fValueTimestamp != null) { if (value instanceof ITmfTimestamp) { ITmfTimestamp valueTimestamp = (ITmfTimestamp) value; return (valueTimestamp.compareTo(fValueTimestamp) == fResult) ^ fNot; } try { ITmfTimestamp valueTimestamp = new TmfNanoTimestamp((long) (1E9 * NumberFormat .getInstance().parse(value.toString()).doubleValue())); return (valueTimestamp.compareTo(fValueTimestamp) == fResult) ^ fNot; } catch (ParseException e) { } } } return false; }

Target:
public boolean matches(ITmfEvent event) { if (event == null || fEventAspect == null) { return false; } Object value = fEventAspect.resolve(event); if (value == null) { return false; } if (fType == Type.NUM) { if (fValueNumber instanceof Double) { Number valueNumber = toNumber(value); if (valueNumber != null) { return (Double.compare(valueNumber.doubleValue(), fValueNumber.doubleValue()) == fResult) ^ fNot; } } else if (fValueNumber != null) { Number valueNumber = toNumber(value); if (valueNumber instanceof Double || valueNumber instanceof Float) { return (Double.compare(valueNumber.doubleValue(), fValueNumber.doubleValue()) == fResult) ^ fNot; } else if (valueNumber != null) { return (Long.compare(valueNumber.longValue(), fValueNumber.longValue()) == fResult) ^ fNot; } } } else if (fType == Type.ALPHA) { String valueString = value.toString(); int comp = (int) Math.signum(valueString.compareTo(fValue.toString())); return (comp == fResult) ^ fNot; } else if (fType == Type.TIMESTAMP) { if (fValueTimestamp != null) { ITmfTimestamp valueTimestamp = toTimestamp(value); if (valueTimestamp != null) { int comp = (int) Math.signum(valueTimestamp.compareTo(fValueTimestamp)); return (comp == fResult) ^ fNot; } } } return false; }
Source:
public void onFileChange(File file) { try { if (isXmlTypeDescriptorFile(file.getAbsolutePath())) { XmlDescriptorParser.parse(file.getAbsolutePath()).forEach(simpleDescriptor -> { topologyService.deployDescriptor(simpleDescriptor.getName() + ".json", JsonUtils.renderAsJsonString(simpleDescriptor)); }); } else { Map<String, File> result = SimpleDescriptorHandler.handle(gatewayConfig, file, topologiesDir, GatewayServer.getGatewayServices(), aliasService); log.generatedTopologyForDescriptorChange(result.get(SimpleDescriptorHandler.RESULT_TOPOLOGY).getName(), file.getName()); String providerConfig = FilenameUtils.normalize(result.get(SimpleDescriptorHandler.RESULT_REFERENCE).getAbsolutePath()); if (!providerConfigReferences.containsKey(providerConfig)) { providerConfigReferences.put(providerConfig, new ArrayList<>()); } List<String> refs = providerConfigReferences.get(providerConfig); String descriptorName = FilenameUtils.normalize(file.getAbsolutePath()); if (!refs.contains(descriptorName)) { for (List<String> descs : providerConfigReferences.values()) { descs.remove(descriptorName); } refs.add(descriptorName); log.addedProviderConfigurationReference(descriptorName, providerConfig); } } } catch (IllegalArgumentException e) { log.simpleDescriptorHandlingError(file.getName(), e); String descriptorName = FilenameUtils.normalize(file.getAbsolutePath()); for (List<String> descs : providerConfigReferences.values()) { descs.remove(descriptorName); } } catch (Exception e) { log.simpleDescriptorHandlingError(file.getName(), e); } }

Target:
public void onFileChange(File file) { try { Map<String, File> result = SimpleDescriptorHandler.handle(gatewayConfig, file, topologiesDir, aliasService); log.generatedTopologyForDescriptorChange(result.get(SimpleDescriptorHandler.RESULT_TOPOLOGY).getName(), file.getName()); String providerConfig = FilenameUtils.normalize(result.get(SimpleDescriptorHandler.RESULT_REFERENCE).getAbsolutePath()); if (!providerConfigReferences.containsKey(providerConfig)) { providerConfigReferences.put(providerConfig, new ArrayList<>()); } List<String> refs = providerConfigReferences.get(providerConfig); String descriptorName = FilenameUtils.normalize(file.getAbsolutePath()); if (!refs.contains(descriptorName)) { for (List<String> descs : providerConfigReferences.values()) { descs.remove(descriptorName); } refs.add(descriptorName); log.addedProviderConfigurationReference(descriptorName, providerConfig); } } catch (IllegalArgumentException e) { log.simpleDescriptorHandlingError(file.getName(), e); String descriptorName = FilenameUtils.normalize(file.getAbsolutePath()); for (List<String> descs : providerConfigReferences.values()) { descs.remove(descriptorName); } } catch (Exception e) { log.simpleDescriptorHandlingError(file.getName(), e); } }
Source:
private void saveToStorage(final Location coordinates) { Schedulers.io().scheduleDirect(() -> { DataStore.saveTrailpoint(coordinates); }); }

Target:
private void saveToStorage(final Location coordinates) { Schedulers.io().scheduleDirect(new Runnable() { @Override public void run() { DataStore.saveTrailpoint(coordinates); } }); }
Source:
private static Version readWorkspaceVersion(URL workspace) { File versionFile = getVersionFile(workspace, false); if (versionFile == null || !versionFile.exists()) { return null; } try { Properties props = new Properties(); FileInputStream is = new FileInputStream(versionFile); try { props.load(is); } finally { is.close(); } String versionString = props.getProperty(WORKSPACE_CHECK_REFERENCE_BUNDLE_NAME); if (versionString != null) { return Version.parseVersion(versionString); } versionString= props.getProperty(WORKSPACE_CHECK_REFERENCE_BUNDLE_NAME_LEGACY); if (versionString != null) { return Version.parseVersion(versionString); } return null; } catch (IOException e) { IDEWorkbenchPlugin.log("Could not read version file " + versionFile, new Status( IStatus.ERROR, IDEWorkbenchPlugin.IDE_WORKBENCH, IStatus.ERROR, e.getMessage() == null ? "" : e.getMessage(), e)); return null; } catch (IllegalArgumentException e) { IDEWorkbenchPlugin.log("Could not parse version in " + versionFile, new Status( IStatus.ERROR, IDEWorkbenchPlugin.IDE_WORKBENCH, IStatus.ERROR, e.getMessage() == null ? "" : e.getMessage(), e)); return null; } }

Target:
protected static Version readWorkspaceVersion(URL workspace) { File versionFile = getVersionFile(workspace, false); if (versionFile == null || !versionFile.exists()) { return null; } try { Properties props = new Properties(); FileInputStream is = new FileInputStream(versionFile); try { props.load(is); } finally { is.close(); } String versionString = props.getProperty(WORKSPACE_CHECK_REFERENCE_BUNDLE_NAME); if (versionString != null) { return Version.parseVersion(versionString); } versionString= props.getProperty(WORKSPACE_CHECK_REFERENCE_BUNDLE_NAME_LEGACY); if (versionString != null) { return Version.parseVersion(versionString); } return null; } catch (IOException e) { IDEWorkbenchPlugin.log("Could not read version file " + versionFile, new Status( IStatus.ERROR, IDEWorkbenchPlugin.IDE_WORKBENCH, IStatus.ERROR, e.getMessage() == null ? "" : e.getMessage(), e)); return null; } catch (IllegalArgumentException e) { IDEWorkbenchPlugin.log("Could not parse version in " + versionFile, new Status( IStatus.ERROR, IDEWorkbenchPlugin.IDE_WORKBENCH, IStatus.ERROR, e.getMessage() == null ? "" : e.getMessage(), e)); return null; } }
Source:
public int prepare(Xid externalXid) throws XAException { return joinAndRethrowXAException(CompletableFuture.supplyAsync(() -> txTable.prepare(externalXid), executor)); }

Target:
public int prepare(Xid externalXid) throws XAException { return runAsyncAndJoinRethrowingXAException(ignore -> txTable.prepare(externalXid)); }
Source:
public void sendOffsetsToTransaction(Map<TopicPartition, OffsetAndMetadata> offsets, ConsumerGroupMetadata groupMetadata) throws ProducerFencedException, CommitFailedException, FencedInstanceIdException { sendOffsetsToTransactionInternal(offsets, groupMetadata); }

Target:
public void sendOffsetsToTransaction(Map<TopicPartition, OffsetAndMetadata> offsets, ConsumerGroupMetadata groupMetadata) throws ProducerFencedException { throwIfInvalidGroupMetadata(groupMetadata); throwIfNoTransactionManager(); throwIfProducerClosed(); TransactionalRequestResult result = transactionManager.sendOffsetsToTransaction(offsets, groupMetadata); sender.wakeup(); result.await(); }
Source:
public Transceiver readSyndications(String journalKey, List<String> statuses) throws IOException { return new Transceiver() { @Override protected Object getData() throws IOException { List<Syndication> syndications = getSyndications(journalKey, statuses); return syndications.stream() .map(new SyndicationOutputView.Factory()::createSyndicationView) .collect(Collectors.toList()); } @Override protected Calendar getLastModifiedDate() throws IOException { return null; } }; }

Target:
public Transceiver readSyndications(String journalKey, List<String> statuses) throws IOException { return new EntityCollectionTransceiver<Syndication>() { @Override protected Object getView(Collection<? extends Syndication> syndications) { return syndications.stream() .map(SyndicationOutputView::createSyndicationView) .collect(Collectors.toList()); } @Override protected Collection<? extends Syndication> fetchEntities() { return getSyndications(journalKey, statuses); } @Override protected Calendar getLastModifiedDate() throws IOException { return null; } }; }
Source:
public CommitOrgAction(Project project, boolean isDeveloperAction) { super(DEFAULT_ID, "Commit Org" + (isDeveloperAction ? " [DEVELOPER]" : ""), null, null); this.project = project; }

Target:
public CommitOrgAction(Project project, boolean isDeveloperAction) { super(DEFAULT_ID, (isDeveloperAction ? "[DEVELOPER] " : "") + "Commit Org", null, null); this.project = project; }
Source:
private void fireEventsFor(OLogSequenceNumber lsn) { final ConcurrentNavigableMap<OLogSequenceNumber, Runnable> eventsToFire = events.headMap(lsn, true); for (Runnable runnable : eventsToFire.values()) runnable.run(); eventsToFire.clear(); }

Target:
private void fireEventsFor(OLogSequenceNumber lsn) { final Iterator<Runnable> eventsToFire = events.headMap(lsn, true).values().iterator(); while (eventsToFire.hasNext()) { eventsToFire.next().run(); eventsToFire.remove(); } }
Source:
protected void setCustomFields(Map<String, Object> fields) { }

Target:
protected void setCustomFields(Map<String, Object> fields) { if (!fields.isEmpty()) { throw new UnsupportedOperationException("Cannot set custom fields on " + this + ". " + "Fields=" + Joiner.on(", ").join(fields.keySet())); } }
Source:
public static LeaderInformation known(UUID leaderSessionID, String leaderAddress) { return new LeaderInformation(leaderSessionID, leaderAddress); }

Target:
public static LeaderInformation known(UUID leaderSessionID, String leaderAddress) { return new LeaderInformation(checkNotNull(leaderSessionID), checkNotNull(leaderAddress)); }