auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void write() throws IOException { Splitter splitter = Splitter.on('.'); Iterable<String> folders = splitter.split(mPackageName); File file = new File(mOutFolder); for (String folder : folders) { file = new File(file, folder); } file.mkdirs(); file = new File(file, "R.java"); BufferedWriter writer = null; try { writer = Files.newWriter(file, Charsets.UTF_8); writer.write(" \n"); writer.write("package "); writer.write(mPackageName); writer.write(";\n\npublic final class R {\n"); Table<String, String, SymbolEntry> symbols = mSymbols.getSymbols(); Table<String, String, SymbolEntry> values = mValues.getSymbols(); for (String row : symbols.rowKeySet()) { writer.write("\tpublic static final class "); writer.write(row); writer.write(" {\n"); for (Map.Entry<String, SymbolEntry> symbol : symbols.row(row).entrySet()) { SymbolEntry value = values.get(row, symbol.getKey()); if (value != null) { writer.write("\t\tpublic static final "); writer.write(value.getType()); writer.write(" "); writer.write(value.getName()); writer.write(" = "); writer.write(value.getValue()); writer.write(";\n"); } } writer.write("\t}\n"); } writer.write("}\n"); } finally { if (writer != null) { writer.close(); } } }

Target:
public void write() throws IOException { Splitter splitter = Splitter.on('.'); Iterable<String> folders = splitter.split(mPackageName); File file = new File(mOutFolder); for (String folder : folders) { file = new File(file, folder); } file.mkdirs(); file = new File(file, SdkConstants.FN_RESOURCE_CLASS); BufferedWriter writer = null; try { writer = Files.newWriter(file, Charsets.UTF_8); writer.write(" \n"); writer.write("package "); writer.write(mPackageName); writer.write(";\n\npublic final class R {\n"); Table<String, String, SymbolEntry> symbols = mSymbols.getSymbols(); Table<String, String, SymbolEntry> values = mValues.getSymbols(); for (String row : symbols.rowKeySet()) { writer.write("\tpublic static final class "); writer.write(row); writer.write(" {\n"); for (Map.Entry<String, SymbolEntry> symbol : symbols.row(row).entrySet()) { SymbolEntry value = values.get(row, symbol.getKey()); if (value != null) { writer.write("\t\tpublic static final "); writer.write(value.getType()); writer.write(" "); writer.write(value.getName()); writer.write(" = "); writer.write(value.getValue()); writer.write(";\n"); } } writer.write("\t}\n"); } writer.write("}\n"); } finally { Closeables.closeQuietly(writer); } }
Source:
private RetryStatus getRetryStatus(ChangeMessage msg) { try { ChangeMessage last = Iterables.getLast(db.changeMessages().byChange( msg.getPatchSetId().getParentKey()), null); if (last != null) { long lastMs = last.getWrittenOn().getTime(); long msgMs = msg.getWrittenOn().getTime(); if (Objects.equal(last.getAuthor(), msg.getAuthor()) && Objects.equal(last.getMessage(), msg.getMessage())) { return msgMs - lastMs > DUPLICATE_MESSAGE_INTERVAL ? RetryStatus.UNSUBMIT : RetryStatus.RETRY_NO_MESSAGE; } } } catch (OrmException err) { log.warn("Cannot check previous merge failure message", err); } return RetryStatus.RETRY_ADD_MESSAGE; }

Target:
private RetryStatus getRetryStatus(ChangeMessage msg) { try { ChangeMessage last = Iterables.getLast(db.changeMessages().byChange( msg.getPatchSetId().getParentKey()), null); if (last != null) { if (Objects.equal(last.getAuthor(), msg.getAuthor()) && Objects.equal(last.getMessage(), msg.getMessage())) { long lastMs = last.getWrittenOn().getTime(); long msgMs = msg.getWrittenOn().getTime(); return msgMs - lastMs > DUPLICATE_MESSAGE_INTERVAL ? RetryStatus.UNSUBMIT : RetryStatus.RETRY_NO_MESSAGE; } } return RetryStatus.RETRY_ADD_MESSAGE; } catch (OrmException err) { log.warn("Cannot check previous merge failure, unsubmitting", err); return RetryStatus.UNSUBMIT; } }
Source:
public Ample.TabletMutator putFlushId(long flushId) { Preconditions.checkState(updatesEnabled, "Cannot make updates after calling mutate."); TabletsSection.ServerColumnFamily.FLUSH_COLUMN.put(mutation, new Value(("" + flushId).getBytes())); return this; }

Target:
public Ample.TabletMutator putFlushId(long flushId) { Preconditions.checkState(updatesEnabled, "Cannot make updates after calling mutate."); TabletsSection.ServerColumnFamily.FLUSH_COLUMN.put(mutation, new Value(Long.toString(flushId))); return this; }
Source:
private void sendRequest(final String message) { String ticket; JsonObject jMessage; try { jMessage = (JsonObject) Json.parse(message); ticket = jMessage.getString("ticket", null); } catch (Throwable t) { LOG.error(String.format("Unexpected exception pending request message handling.\n", message), t); return; } try { String endpoint = jMessage.getString("ep", null); if (!isResponsibleFor(endpoint)) return; Client destination = clientRegistry.get(endpoint); if (destination == null) { sendError(ticket, String.format("No registration for this endpoint %s.", endpoint)); } DownlinkRequest<?> request = DownlinkRequestSerDes.deserialize((JsonObject) jMessage.get("req")); sendAck(ticket); server.send(destination, ticket, request); } catch (Throwable t) { String errorMessage = String.format("Unexpected exception pending request message handling.(%s:%s)", t.toString(), t.getMessage()); LOG.error(errorMessage, t); sendError(ticket, errorMessage); } }

Target:
private void sendRequest(final String message) { String ticket; JsonObject jMessage; try { jMessage = (JsonObject) Json.parse(message); ticket = jMessage.getString("ticket", null); } catch (RuntimeException t) { LOG.error(String.format("Unexpected exception pending request message handling.\n", message), t); return; } try { String endpoint = jMessage.getString("ep", null); if (!isResponsibleFor(endpoint)) return; Client destination = clientRegistry.get(endpoint); if (destination == null) { sendError(ticket, String.format("No registration for this endpoint %s.", endpoint)); } DownlinkRequest<?> request = DownlinkRequestSerDes.deserialize((JsonObject) jMessage.get("req")); sendAck(ticket); server.send(destination, ticket, request); } catch (RuntimeException t) { String errorMessage = String.format("Unexpected exception pending request message handling.(%s:%s)", t.toString(), t.getMessage()); LOG.error(errorMessage, t); sendError(ticket, errorMessage); } }
Source:
protected Constraint twoExamsInADay(ConstraintFactory constraintFactory) { return constraintFactory.from(TopicConflict.class) .join(Exam.class, equal(TopicConflict::getLeftTopic, Exam::getTopic), filtering((topicConflict, leftExam) -> leftExam.getPeriod() != null)) .ifExists(Exam.class, equal((topicConflict, leftExam) -> topicConflict.getRightTopic(), Exam::getTopic), equal((topicConflict, leftExam) -> leftExam.getDayIndex(), Exam::getDayIndex), filtering((topicConflict, leftExam, rightExam) -> getPeriodIndexDifferenceBetweenExams(leftExam, rightExam) > 1)) .join(ExaminationConstraintConfiguration.class) .penalize("Two exams in a day", HardSoftScore.ONE_SOFT, (topicConflict, leftExam, config) -> topicConflict.getStudentSize() * config.getTwoInADayPenalty()); }

Target:
protected Constraint twoExamsInADay(ConstraintFactory constraintFactory) { return constraintFactory.from(TopicConflict.class) .join(Exam.class, equal(TopicConflict::getLeftTopic, Exam::getTopic), filtering((topicConflict, leftExam) -> leftExam.getPeriod() != null)) .ifExists(Exam.class, equal((topicConflict, leftExam) -> topicConflict.getRightTopic(), Exam::getTopic), equal((topicConflict, leftExam) -> leftExam.getDayIndex(), Exam::getDayIndex), filtering((topicConflict, leftExam, rightExam) -> getPeriodIndexDifferenceBetweenExams(leftExam, rightExam) > 1)) .penalizeConfigurable("twoExamsInADay", (topicConflict, leftExam) -> topicConflict.getStudentSize()); }
Source:
public static int compareAnnotationMirrors(AnnotationMirror a1, AnnotationMirror a2) { if (!AnnotationUtils.areSameByName(a1, a2)) { return annotationName(a1).compareTo(annotationName(a2)); } if (AnnotationUtils.sameElementValues(a1, a2)) { return 0; } Map<? extends ExecutableElement, ? extends AnnotationValue> vals1 = a1.getElementValues(); Map<? extends ExecutableElement, ? extends AnnotationValue> vals2 = a2.getElementValues(); Set<ExecutableElement> sortedElements = new TreeSet<>(Comparator.comparing(ElementUtils::getSimpleName)); sortedElements.addAll( ElementFilter.methodsIn(a1.getAnnotationType().asElement().getEnclosedElements())); for (ExecutableElement method : sortedElements) { AnnotationValue value1 = vals1.get(method); AnnotationValue value2 = vals2.get(method); if (value1 == null) { value1 = method.getDefaultValue(); } if (value2 == null) { value2 = method.getDefaultValue(); } if (value1 == value2) { continue; } else if (value1 == null) { return -1; } else if (value2 == null) { return 1; } int result = value1.getValue().toString().compareTo(value2.getValue().toString()); if (result != 0) { return result; } } return 0; }

Target:
public static int compareAnnotationMirrors(AnnotationMirror a1, AnnotationMirror a2) { if (!AnnotationUtils.areSameByName(a1, a2)) { return annotationName(a1).compareTo(annotationName(a2)); } Map<? extends ExecutableElement, ? extends AnnotationValue> vals1 = a1.getElementValues(); Map<? extends ExecutableElement, ? extends AnnotationValue> vals2 = a2.getElementValues(); Set<ExecutableElement> sortedElements = new TreeSet<>(Comparator.comparing(ElementUtils::getSimpleName)); sortedElements.addAll( ElementFilter.methodsIn(a1.getAnnotationType().asElement().getEnclosedElements())); for (ExecutableElement meth : sortedElements) { AnnotationValue aval1 = vals1.get(meth); AnnotationValue aval2 = vals2.get(meth); if (aval1 == null) { aval1 = meth.getDefaultValue(); } if (aval2 == null) { aval2 = meth.getDefaultValue(); } int result = compareAnnotationValue(aval1, aval2); if (result != 0) { return result; } } return 0; }
Source:
public void testSubscriptionWithManyEventTypesIsNotCreated() { final List<String> eventTypes = IntStream.range(0, 31).mapToObj(i -> createEventType()) .map(et -> et.getName()) .collect(Collectors.toList()); final String subscription = "{\"owning_application\":\"app\",\"event_types\":" + "[" + eventTypes.stream().map(et -> "\"" + et + "\"").collect(Collectors.joining(",")) + "]}"; final Response response = given() .body(subscription) .contentType(JSON) .post(SUBSCRIPTIONS_URL); response .then() .statusCode(HttpStatus.SC_UNPROCESSABLE_ENTITY) .contentType(JSON) .body("title", equalTo("Unprocessable Entity")) .body("detail", equalTo("total partition count for subscription is 31 while only 30 allowed")); }

Target:
public void testSubscriptionWithManyEventTypesIsNotCreated() { final List<String> eventTypes = IntStream.range(0, 31).mapToObj(i -> createEventType()) .map(et -> et.getName()) .collect(Collectors.toList()); final String subscription = "{\"owning_application\":\"app\",\"event_types\":" + "[" + eventTypes.stream().map(et -> "\"" + et + "\"").collect(Collectors.joining(",")) + "]}"; final Response response = given() .body(subscription) .contentType(JSON) .post(SUBSCRIPTIONS_URL); response .then() .statusCode(HttpStatus.SC_UNPROCESSABLE_ENTITY) .contentType(JSON) .body("title", equalTo("Unprocessable Entity")) .body("detail", equalTo( "total partition count for subscription is 31, but the maximum partition count is 30")); }
Source:
private void deleteMapFamily(EntityId entityId, FamilyLayout familyLayout, long upToTimestamp) throws IOException { final State state = mState.get(); Preconditions.checkState(state == State.OPEN, "Cannot delete map family while KijiTableWriter %s is in state %s.", this, state); final String familyName = familyLayout.getName(); final HBaseColumnName hbaseColumnName = mWriterLayoutCapsule.getColumnNameTranslator() .toHBaseColumnName(new KijiColumnName(familyName)); final byte[] hbaseRow = entityId.getHBaseRowKey(); final Scanner scanner = mHBClient.newScanner(mTable.getName()); scanner.setFilter(new ColumnPrefixFilter(hbaseColumnName.getQualifier())); scanner.setStartKey(hbaseRow); final ArrayList<KeyValue> results; try { results = scanner.nextRows(1).join().get(0); } catch (Exception e) { ZooKeeperUtils.wrapAndRethrow(e); throw new InternalKijiError(e); } scanner.close(); if (results.isEmpty()) { LOG.debug("No qualifiers to delete in map family: " + familyName); } else { for (KeyValue keyValue : results) { final DeleteRequest delete = new DeleteRequest( Bytes.toBytes(mTable.getName()), hbaseRow, keyValue.family(), keyValue.qualifier(), upToTimestamp); try { mHBClient.delete(delete).join(); } catch (Exception e) { ZooKeeperUtils.wrapAndRethrow(e); } } } }

Target:
private void deleteMapFamily(EntityId entityId, FamilyLayout familyLayout, long upToTimestamp) throws IOException { final State state = mState.get(); Preconditions.checkState(state == State.OPEN, "Cannot delete map family while KijiTableWriter %s is in state %s.", this, state); final String familyName = familyLayout.getName(); final HBaseColumnName hbaseColumnName = mWriterLayoutCapsule.getColumnNameTranslator() .toHBaseColumnName(new KijiColumnName(familyName)); final byte[] hbaseRow = entityId.getHBaseRowKey(); final Scanner scanner = mHBClient.newScanner(mTable.getName()); scanner.setFilter(new ColumnPrefixFilter(hbaseColumnName.getQualifier())); scanner.setStartKey(hbaseRow); scanner.setStopKey(hbaseRow); final ArrayList<KeyValue> results; try { results = scanner.nextRows(1).join().get(0); } catch (Exception e) { ZooKeeperUtils.wrapAndRethrow(e); throw new InternalKijiError(e); } scanner.close(); if (results.isEmpty()) { LOG.debug("No qualifiers to delete in map family: " + familyName); } else { for (KeyValue keyValue : results) { final DeleteRequest delete = new DeleteRequest( mTableName, hbaseRow, keyValue.family(), keyValue.qualifier(), upToTimestamp); try { mHBClient.delete(delete).join(); } catch (Exception e) { ZooKeeperUtils.wrapAndRethrow(e); } } } }
Source:
public List<TaskDescriptor> getTasksToSchedule() throws NotConnectedException, PermissionException { Policy policy = null; List<TaskDescriptor> eligibleTasks = new ArrayList<>(); Map<JobId, JobDescriptor> jobMap = schedulingService.lockJobsToSchedule(); try { policy = (Policy) Class.forName(getCurrentPolicy()).newInstance(); if (jobMap.isEmpty()) { return eligibleTasks; } List<JobDescriptor> descriptors = new ArrayList<>(jobMap.values()); LinkedList<EligibleTaskDescriptor> taskRetrievedFromPolicy = policy.getOrderedTasks(descriptors); if (taskRetrievedFromPolicy.isEmpty()) { return eligibleTasks; } eligibleTasks = (List) taskRetrievedFromPolicy; } catch (Exception e) { logger.error("Error Loading Current Policy:", e); } finally { schedulingService.unlockJobsToSchedule(jobMap.values()); } return eligibleTasks; }

Target:
public List<TaskDescriptor> getTasksToSchedule() throws NotConnectedException, PermissionException { Policy policy = null; List<TaskDescriptor> eligibleTasks = new ArrayList<>(); Map<JobId, JobDescriptor> jobMap = null; try { jobMap = schedulingService.lockJobsToSchedule(); policy = (Policy) Class.forName(getCurrentPolicy()).newInstance(); if (jobMap.isEmpty()) { return eligibleTasks; } List<JobDescriptor> descriptors = new ArrayList<>(jobMap.values()); LinkedList<EligibleTaskDescriptor> taskRetrievedFromPolicy = policy.getOrderedTasks(descriptors); if (taskRetrievedFromPolicy.isEmpty()) { return eligibleTasks; } eligibleTasks = (List) taskRetrievedFromPolicy; } catch (Exception e) { logger.error("Error Loading Current Policy:", e); } finally { schedulingService.unlockJobsToSchedule(jobMap.values()); } return eligibleTasks; }
Source:
public static Ownership getLockOwnership(Object key, ClusteringDependentLogic clusteringDependentLogic) { Object keyToCheck = key instanceof DeltaCompositeKey ? ((DeltaCompositeKey) key).getDeltaAwareValueKey() : key; DistributionInfo distributionInfo = clusteringDependentLogic.getCacheTopology().getDistribution(keyToCheck); return distributionInfo.isPrimary() ? Ownership.PRIMARY : (distributionInfo.isWriteBackup() ? Ownership.BACKUP : Ownership.NON_OWNER); }

Target:
public static Ownership getLockOwnership(Object key, ClusteringDependentLogic clusteringDependentLogic) { Object keyToCheck = key instanceof DeltaCompositeKey ? ((DeltaCompositeKey) key).getDeltaAwareValueKey() : key; DistributionInfo distributionInfo = clusteringDependentLogic.getCacheTopology().getDistribution(keyToCheck); return distributionInfo.writeOwnership(); }
Source:
public String getObjectIdentifier(JobProperty<?> obj){ if (JobPropertyImpl.class.getName().equals(obj.getClass().getName())){ return "JobPropertyImpl"; } return null; }

Target:
public String getObjectIdentifier(JobProperty<?> obj){ if ( obj!=null && JobPropertyImpl.class.getName().equals(obj.getClass().getName())){ return JobPropertyImplSelector.class.getName(); } return null; }
Source:
private void authenticate() throws MessagingException, IOException { switch (settings.getAuthType()) { case XOAUTH2: if (hasCapability(Capabilities.AUTH_XOAUTH2) && hasCapability(Capabilities.SASL_IR) && oauthTokenProvider != null) { authXoauth2withSASLIR(); } else { throw new MessagingException("Server doesn't support SASL XOAUTH2."); } break; case CRAM_MD5: { if (hasCapability(Capabilities.AUTH_CRAM_MD5)) { authCramMD5(); } else { throw new MessagingException("Server doesn't support encrypted passwords using CRAM-MD5."); } break; } case PLAIN: { if (hasCapability(Capabilities.AUTH_PLAIN)) { saslAuthPlainWithLoginFallback(); } else if (!hasCapability(Capabilities.LOGINDISABLED)) { login(); } else { throw new MessagingException("Server doesn't support unencrypted passwords using AUTH=PLAIN " + "and LOGIN is disabled."); } break; } case EXTERNAL: { if (hasCapability(Capabilities.AUTH_EXTERNAL)) { saslAuthExternal(); } else { throw new CertificateValidationException(CertificateValidationException.Reason.MissingCapability); } break; } default: { throw new MessagingException("Unhandled authentication method found in the server settings (bug)."); } } }

Target:
private void authenticate() throws MessagingException, IOException { switch (settings.getAuthType()) { case XOAUTH2: if (oauthTokenProvider == null) { throw new MessagingException("No OAuthToken Provider available."); } else if (hasCapability(Capabilities.AUTH_XOAUTH2) && hasCapability(Capabilities.SASL_IR)) { authXoauth2withSASLIR(); } else { throw new MessagingException("Server doesn't support SASL XOAUTH2."); } break; case CRAM_MD5: { if (hasCapability(Capabilities.AUTH_CRAM_MD5)) { authCramMD5(); } else { throw new MessagingException("Server doesn't support encrypted passwords using CRAM-MD5."); } break; } case PLAIN: { if (hasCapability(Capabilities.AUTH_PLAIN)) { saslAuthPlainWithLoginFallback(); } else if (!hasCapability(Capabilities.LOGINDISABLED)) { login(); } else { throw new MessagingException("Server doesn't support unencrypted passwords using AUTH=PLAIN " + "and LOGIN is disabled."); } break; } case EXTERNAL: { if (hasCapability(Capabilities.AUTH_EXTERNAL)) { saslAuthExternal(); } else { throw new CertificateValidationException(CertificateValidationException.Reason.MissingCapability); } break; } default: { throw new MessagingException("Unhandled authentication method found in the server settings (bug)."); } } }
Source:
private boolean deleteDownload(Download download) { boolean deleted = false; try { File stagingFolder = download.fetchZipFile().getParentFile(); deleted = FileUtils.deleteQuietly(stagingFolder); manager.delete(download); } catch (URISyntaxException ex) { log.error("Invalid file pointer", ex); } return deleted; }

Target:
private boolean deleteDownload(Download download) { boolean deleted = false; try { manager.delete(download); File stagingFolder = download.fetchZipFile().getParentFile(); deleted = FileUtils.deleteQuietly(stagingFolder); } catch (URISyntaxException ex) { log.error("Invalid file pointer", ex); } return deleted; }
Source:
public Set<IFolder> getFoldersToIgnore(IProject project, IProgressMonitor monitor) { Set<IFolder> res = new HashSet<>(); res.addAll(new ProjectWithJavaResourcesImportConfigurator().getFoldersToIgnore(project, monitor)); try { IFile buildPropertiesFile = PDEProject.getBuildProperties(project); Properties buildProperties = new Properties(); if (buildPropertiesFile.exists()) { InputStream stream = buildPropertiesFile.getContents(); buildProperties.load(stream); stream.close(); } for (Entry<?, ?> entry : buildProperties.entrySet()) { String entryKey = (String)entry.getKey(); if (entryKey.startsWith("src.") || entryKey.startsWith("source.") || entryKey.startsWith("bin.") || entryKey.startsWith("output.")) { for (String token : ((String) entry.getValue()).split(",")) { token = token.trim(); if (token.endsWith("/")) { token = token.substring(0, token.length() - 1); } if (token != null && token.length() > 0 && !token.equals(".")) { IFolder folder = project.getFolder(token); if (folder.exists()) { res.add(folder); } } } } } } catch (Exception ex) { PDEPlugin.log(ex); } return res; }

Target:
public Set<IFolder> getFoldersToIgnore(IProject project, IProgressMonitor monitor) { Set<IFolder> res = new HashSet<>(); res.addAll(new ProjectWithJavaResourcesImportConfigurator().getFoldersToIgnore(project, monitor)); IFile buildPropertiesFile = PDEProject.getBuildProperties(project); Properties buildProperties = new Properties(); if (!buildPropertiesFile.exists()) { return Collections.emptySet(); } try (InputStream stream = buildPropertiesFile.getContents()) { buildProperties.load(stream); for (Entry<?, ?> entry : buildProperties.entrySet()) { String entryKey = (String) entry.getKey(); if (entryKey.startsWith("src.") || entryKey.startsWith(IBuildEntry.JAR_PREFIX) || entryKey.startsWith("bin.") || entryKey.startsWith(IBuildEntry.OUTPUT_PREFIX)) { for (String token : ((String) entry.getValue()).split(",")) { token = token.trim(); if (token.endsWith("/")) { token = token.substring(0, token.length() - 1); } if (token != null && token.length() > 0 && !token.equals(".")) { IFolder folder = project.getFolder(token); if (folder.exists()) { res.add(folder); } } } } } return res; } catch (CoreException | IOException ex) { PDEPlugin.log(ex); return Collections.emptySet(); } }
Source:
public LoginCredentials apply(Template template, LoginCredentials fromNode) { LoginCredentials creds = fromNode; LoginCredentials credsFromParameters = credentialsFromImageOrTemplateOptions.apply(template); if (credsFromParameters != null) { Builder builder = LoginCredentials.builder(creds); if (credsFromParameters.getUser() != null) builder.user(credsFromParameters.getUser()); if (credsFromParameters.getOptionalPassword().isPresent()) if (credsFromParameters.getOptionalPassword().get().isEmpty()) builder.noPassword(); else builder.password(credsFromParameters.getOptionalPassword().get()); if (credsFromParameters.getOptionalPrivateKey().isPresent()) if (credsFromParameters.getOptionalPassword().get().isEmpty()) builder.noPassword(); else builder.privateKey(credsFromParameters.getOptionalPrivateKey().get()); if (credsFromParameters.shouldAuthenticateSudo()) builder.authenticateSudo(true); creds = builder.build(); } return creds; }

Target:
public LoginCredentials apply(Template template, LoginCredentials fromNode) { LoginCredentials creds = fromNode; LoginCredentials credsFromParameters = credentialsFromImageOrTemplateOptions.apply(template); if (credsFromParameters != null) { Builder builder = LoginCredentials.builder(creds); if (credsFromParameters.getUser() != null) builder.user(credsFromParameters.getUser()); if (credsFromParameters.getOptionalPassword().isPresent()) if (credsFromParameters.getOptionalPassword().get().isEmpty()) builder.noPassword(); else builder.password(credsFromParameters.getOptionalPassword().get()); if (credsFromParameters.getOptionalPrivateKey().isPresent()) if (credsFromParameters.getOptionalPrivateKey().get().isEmpty()) builder.noPrivateKey(); else builder.privateKey(credsFromParameters.getOptionalPrivateKey().get()); if (credsFromParameters.shouldAuthenticateSudo()) builder.authenticateSudo(true); creds = builder.build(); } return creds; }
Source:
public List<EnvironmentPipelineModel> getAllRemotePipelinesForUserInEnvironment(Username user,EnvironmentConfig environment) { List<EnvironmentPipelineModel> pipelines = new ArrayList<EnvironmentPipelineModel>(); for (EnvironmentPipelineConfig pipelineConfig : environment.getRemotePipelines()) { String pipelineName = CaseInsensitiveString.str(pipelineConfig.getName()); if (securityService.hasViewPermissionForPipeline(user, pipelineName)) { if (environment != null) { pipelines.add(new EnvironmentPipelineModel(pipelineName, CaseInsensitiveString.str(environment.name()))); } else { pipelines.add(new EnvironmentPipelineModel(pipelineName)); } } } Collections.sort(pipelines); return pipelines; }

Target:
public List<EnvironmentPipelineModel> getAllRemotePipelinesForUserInEnvironment(Username user,EnvironmentConfig environment) { List<EnvironmentPipelineModel> pipelines = new ArrayList<EnvironmentPipelineModel>(); for (EnvironmentPipelineConfig pipelineConfig : environment.getRemotePipelines()) { String pipelineName = CaseInsensitiveString.str(pipelineConfig.getName()); if (securityService.hasViewPermissionForPipeline(user, pipelineName)) { pipelines.add(new EnvironmentPipelineModel(pipelineName, CaseInsensitiveString.str(environment.name()))); } } Collections.sort(pipelines); return pipelines; }
Source:
public Span nextSpan(ConsumerRecord record) { TraceContext context = tracing.propagation() .extractor(extractor) .extract(record).context(); if (context != null) { return tracing.tracer().toSpan(context); } else { return tracing.tracer().newTrace(); } }

Target:
public Span nextSpan(ConsumerRecord record) { TraceContextOrSamplingFlags contextOrSamplingFlags = extractor.extract(record); if (contextOrSamplingFlags.context() != null) { return tracing.tracer().toSpan(contextOrSamplingFlags.context()); } else { return tracing.tracer().newTrace(contextOrSamplingFlags.samplingFlags()); } }
Source:
InetUtils zipkinInetUtils(){ return new InetUtils(new InetUtilsProperties()); }

Target:
public InetUtils zipkinInetUtils(){ return new InetUtils(new InetUtilsProperties()); }
Source:
public void showFormList(String[] forms) { if(forms.length == 0) { snackbar = Snackbar.make(root, ApplicationConstants.EMPTY_STRING, Snackbar.LENGTH_INDEFINITE); View customSnackBarView = getLayoutInflater().inflate(R.layout.snackbar, null); Snackbar.SnackbarLayout snackBarLayout = (Snackbar.SnackbarLayout) snackbar.getView(); snackBarLayout.setPadding(0, 0, 0, 0); TextView noticeField = customSnackBarView.findViewById(R.id.snackbar_text); noticeField.setText(R.string.snackbar_no_forms_found); TextView dismiss_button = customSnackBarView.findViewById(R.id.snackbar_action_button); Typeface typeface = Typeface.createFromAsset(getActivity().getAssets(), ApplicationConstants.TypeFacePathConstants.ROBOTO_MEDIUM); dismiss_button.setTypeface(typeface); dismiss_button.setOnClickListener(v -> snackbar.dismiss()); snackBarLayout.addView(customSnackBarView, 0); snackbar.show(); } formList.setAdapter(new ArrayAdapter<>(getContext(), android.R.layout.simple_list_item_1, android.R.id.text1, forms)); }

Target:
public void showFormList(String[] forms) { if(forms.length == 0) { snackbar = Snackbar.make(root, ApplicationConstants.EMPTY_STRING, Snackbar.LENGTH_INDEFINITE); View customSnackBarView = getLayoutInflater().inflate(R.layout.snackbar, null); Snackbar.SnackbarLayout snackBarLayout = (Snackbar.SnackbarLayout) snackbar.getView(); snackBarLayout.setPadding(0, 0, 0, 0); TextView noticeField = customSnackBarView.findViewById(R.id.snackbar_text); noticeField.setText(R.string.snackbar_no_forms_found); TextView dismissButton = customSnackBarView.findViewById(R.id.snackbar_action_button); Typeface typeface = Typeface.createFromAsset(getActivity().getAssets(), ApplicationConstants.TypeFacePathConstants.ROBOTO_MEDIUM); dismissButton.setTypeface(typeface); dismissButton.setOnClickListener(v -> snackbar.dismiss()); snackBarLayout.addView(customSnackBarView, 0); snackbar.show(); } formList.setAdapter(new ArrayAdapter<>(getContext(), android.R.layout.simple_list_item_1, android.R.id.text1, forms)); }
Source:
private String sendMessage(final JmsTemplate template, final String msg) { String resultString = template.execute(new SessionCallback<String>() { @Override public String doInJms(Session session) throws JMSException { Queue queue = session.createQueue("receive"); MessageProducer producer = session.createProducer(queue); TemporaryQueue tempQueue = session.createTemporaryQueue(); MessageConsumer consumer = session.createConsumer(tempQueue); TextMessage message = session.createTextMessage(msg); message.setJMSReplyTo(tempQueue); message.setJMSCorrelationID(UUID.randomUUID().toString()); producer.send(message); TextMessage response = (TextMessage) consumer.receive(1000); JmsUtils.closeMessageProducer(producer); JmsUtils.closeMessageConsumer(consumer); return response.getText(); } }, true); return resultString; }

Target:
private String sendMessage(final JmsTemplate template, final String msg) { String resultString = template.execute(new SessionCallback<String>() { @Override public String doInJms(Session session) throws JMSException { Queue queue = session.createQueue("receive"); MessageProducer producer = session.createProducer(queue); TemporaryQueue tempQueue = session.createTemporaryQueue(); MessageConsumer consumer = session.createConsumer(tempQueue); TextMessage message = session.createTextMessage(msg); message.setJMSReplyTo(tempQueue); producer.send(message); TextMessage response = (TextMessage) consumer.receive(1000); assertThat("server should set the value of the correltion ID to the value of the received message id", response.getJMSCorrelationID(), is(message.getJMSMessageID())); JmsUtils.closeMessageProducer(producer); JmsUtils.closeMessageConsumer(consumer); return response.getText(); } }, true); return resultString; }
Source:
@Override public void registerWorldGen(ICubicWorldServer world, GeneratorPipeline pipeline) { ServerCubeCache cubeCache = world.getCubeCache(); ChunkProviderOverworld vanillaGen = new ChunkProviderOverworld((World) world, world.getSeed(), true, ""); GeneratorStage terrain = new GeneratorStage("terrain"); GeneratorStage surface = new GeneratorStage("surface"); GeneratorStage testStage = new TestStage("testStage"); GeneratorStage population = new GeneratorStage("population"); pipeline.addStage(terrain, new VanillaTerrainProcessor(surface, world, vanillaGen, 5)); pipeline.addStage(GeneratorStage.LIGHTING, new FirstLightProcessor(GeneratorStage.LIGHTING, "Lighting", cubeCache, 5)); pipeline.addStage(testStage, new NullProcessor("Testing", cubeCache)); pipeline.addStage(population, new VanillaPopulationProcessor(population, world, vanillaGen, 5)); }

Target:
@Override public void registerWorldGen(ICubicWorldServer world, GeneratorPipeline pipeline) { ServerCubeCache cubeCache = world.getCubeCache(); ChunkProviderOverworld vanillaGen = new ChunkProviderOverworld((World) world, world.getSeed(), true, ""); GeneratorStage terrain = new IndependentGeneratorStage("terrain"); GeneratorStage surface = new IndependentGeneratorStage("surface"); GeneratorStage population = new IndependentGeneratorStage("population"); pipeline.addStage(terrain, new VanillaTerrainProcessor(surface, world, vanillaGen, 5)); pipeline.addStage(GeneratorStage.LIGHTING, new FirstLightProcessor(GeneratorStage.LIGHTING, "Lighting", cubeCache, 5)); pipeline.addStage(population, new VanillaPopulationProcessor(population, world, vanillaGen, 5)); }
Source:
private <R extends Row, T> ListenableFuture<Result> issueAsyncRowRequest(Row row, Batch.Callback<T> callback, Object[] results, int index) throws InterruptedException { LOG.trace("issueRowRequest(Row, Batch.Callback, Object[], index"); SettableFuture<Result> resultFuture = SettableFuture.create(); RpcResultFutureCallback<T> futureCallback = new RpcResultFutureCallback<T>(row, callback, index, results, resultFuture); results[index] = null; if (service.isShutdown()) { ListenableFuture<? extends GeneratedMessage> failFuture = Futures.immediateFailedFuture(new ConnectionClosedException( "Cannot perform batch operations when a connection is closed")); Futures.addCallback(failFuture, futureCallback); } else { ListenableFuture<? extends GeneratedMessage> future = issueAsyncRequest(row); Futures.addCallback(future, futureCallback, service); } return resultFuture; }

Target:
private <R extends Row, T> ListenableFuture<Result> issueAsyncRowRequest(Row row, Batch.Callback<T> callback, Object[] results, int index) { LOG.trace("issueRowRequest(Row, Batch.Callback, Object[], index"); SettableFuture<Result> resultFuture = SettableFuture.create(); RpcResultFutureCallback<T> futureCallback = new RpcResultFutureCallback<T>(row, callback, index, results, resultFuture); results[index] = null; if (service.isShutdown()) { ListenableFuture<? extends GeneratedMessage> failFuture = Futures.immediateFailedFuture(new IOException( "Cannot perform batch operations when a connection is closed")); Futures.addCallback(failFuture, futureCallback); } else { ListenableFuture<? extends GeneratedMessage> future = issueAsyncRequest(row); Futures.addCallback(future, futureCallback, service); } return resultFuture; }
Source:
public static PointValue parse( CharSequence text, AnyValue[] fieldsFromHeader ) { AnyValue[] fieldsFromData = parseIntoArray( text ); if ( fieldsFromHeader != null ) { for ( int i = 0; i < fieldsFromData.length; i++ ) { if ( fieldsFromData[i] == null ) { fieldsFromData[i] = fieldsFromHeader[i]; } } } return fromInputFields( fieldsFromData ); }

Target:
public static PointValue parse( CharSequence text, AnyValue[] fieldsFromHeader ) { AnyValue[] fieldsFromData = parseIntoArray( text ); if ( fieldsFromHeader != null ) { assert fieldsFromData.length == fieldsFromHeader.length; for ( int i = 0; i < fieldsFromData.length; i++ ) { if ( fieldsFromData[i] == null ) { fieldsFromData[i] = fieldsFromHeader[i]; } } } return fromInputFields( fieldsFromData ); }
Source:
private void start() throws IOException { zookeeper = new EmbeddedZookeeper(); brokerConfig.put(KafkaConfig$.MODULE$.ZkConnectProp(), zKConnectString()); brokerConfig.put(KafkaConfig$.MODULE$.PortProp(), 0); putIfAbsent(brokerConfig, KafkaConfig$.MODULE$.HostNameProp(), "localhost"); putIfAbsent(brokerConfig, KafkaConfig$.MODULE$.DeleteTopicEnableProp(), true); putIfAbsent(brokerConfig, KafkaConfig$.MODULE$.GroupInitialRebalanceDelayMsProp(), 0); putIfAbsent(brokerConfig, KafkaConfig$.MODULE$.OffsetsTopicReplicationFactorProp(), (short) brokers.length); putIfAbsent(brokerConfig, KafkaConfig$.MODULE$.AutoCreateTopicsEnableProp(), false); Object listenerConfig = brokerConfig.get(KafkaConfig$.MODULE$.InterBrokerListenerNameProp()); if (listenerConfig != null) { listenerName = new ListenerName(listenerConfig.toString()); } for (int i = 0; i < brokers.length; i++) { brokerConfig.put(KafkaConfig$.MODULE$.BrokerIdProp(), i); brokerConfig.put(KafkaConfig$.MODULE$.LogDirProp(), createLogDir()); brokers[i] = TestUtils.createServer(new KafkaConfig(brokerConfig, true), time, null); } Map<String, Object> producerProps = new HashMap<>(); producerProps.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, bootstrapServers()); producerProps.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, "org.apache.kafka.common.serialization.ByteArraySerializer"); producerProps.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, "org.apache.kafka.common.serialization.ByteArraySerializer"); producer = new KafkaProducer<>(producerProps); }

Target:
private void start() throws IOException { zookeeper = new EmbeddedZookeeper(); brokerConfig.put(KafkaConfig$.MODULE$.ZkConnectProp(), zKConnectString()); brokerConfig.put(KafkaConfig$.MODULE$.PortProp(), 0); putIfAbsent(brokerConfig, KafkaConfig$.MODULE$.HostNameProp(), "localhost"); putIfAbsent(brokerConfig, KafkaConfig$.MODULE$.DeleteTopicEnableProp(), true); putIfAbsent(brokerConfig, KafkaConfig$.MODULE$.GroupInitialRebalanceDelayMsProp(), 0); putIfAbsent(brokerConfig, KafkaConfig$.MODULE$.OffsetsTopicReplicationFactorProp(), (short) brokers.length); putIfAbsent(brokerConfig, KafkaConfig$.MODULE$.AutoCreateTopicsEnableProp(), false); Object listenerConfig = brokerConfig.get(KafkaConfig$.MODULE$.InterBrokerListenerNameProp()); if (listenerConfig != null) { listenerName = new ListenerName(listenerConfig.toString()); } for (int i = 0; i < brokers.length; i++) { brokerConfig.put(KafkaConfig$.MODULE$.BrokerIdProp(), i); brokerConfig.put(KafkaConfig$.MODULE$.LogDirProp(), createLogDir()); brokers[i] = TestUtils.createServer(new KafkaConfig(brokerConfig, true), time); } Map<String, Object> producerProps = new HashMap<>(); producerProps.put(ProducerConfig.BOOTSTRAP_SERVERS_CONFIG, bootstrapServers()); producerProps.put(ProducerConfig.KEY_SERIALIZER_CLASS_CONFIG, "org.apache.kafka.common.serialization.ByteArraySerializer"); producerProps.put(ProducerConfig.VALUE_SERIALIZER_CLASS_CONFIG, "org.apache.kafka.common.serialization.ByteArraySerializer"); producer = new KafkaProducer<>(producerProps); }
Source:
public Set<LanguageServerLauncher> getAll(Workspace workspace) { for (Map.Entry<String, ? extends Machine> machineEntry : workspace.getRuntime().getMachines().entrySet()) { String machineName = machineEntry.getKey(); Machine machine = machineEntry.getValue(); Map<String, ? extends Server> servers = machine.getServers(); for (Map.Entry<String, ? extends Server> serverEntry : servers.entrySet()) { String serverName = serverEntry.getKey(); Server server = serverEntry.getValue(); String serverUrl = server.getUrl(); Map<String, String> serverAttributes = server.getAttributes(); if (lslRegistry.keySet().contains(machineName + serverName)) { continue; } if (!lsConfigurationDetector.isDetected(serverAttributes)) { continue; } LanguageServerDescription description = lsConfigurationExtractor.extract(serverAttributes); try { URI uri = new URI(serverUrl); String host = uri.getHost(); int port = uri.getPort(); SocketLanguageServerLauncher launcher = new SocketLanguageServerLauncher(description, host, port); lslRegistry.put(machineName + serverName, launcher); } catch (URISyntaxException e) { LOG.error("Can't parse server url: {}", serverUrl, e); } } } return unmodifiableSet(new HashSet<>(lslRegistry.values())); }

Target:
public Set<LanguageServerLauncher> getAll(Workspace workspace) { Runtime runtime = workspace.getRuntime(); if (runtime == null) { return emptySet(); } for (Map.Entry<String, ? extends Machine> machineEntry : runtime.getMachines().entrySet()) { String machineName = machineEntry.getKey(); Machine machine = machineEntry.getValue(); Map<String, ? extends Server> servers = machine.getServers(); for (Map.Entry<String, ? extends Server> serverEntry : servers.entrySet()) { String serverName = serverEntry.getKey(); Server server = serverEntry.getValue(); String serverUrl = server.getUrl(); Map<String, String> serverAttributes = server.getAttributes(); if (lslRegistry.keySet().contains(machineName + serverName)) { continue; } if (!lsConfigurationDetector.isDetected(serverAttributes)) { continue; } LanguageServerDescription description = lsConfigurationExtractor.extract(serverAttributes); try { URI uri = new URI(serverUrl); String host = uri.getHost(); int port = uri.getPort(); SocketLanguageServerLauncher launcher = new SocketLanguageServerLauncher(description, host, port); lslRegistry.put(machineName + serverName, launcher); } catch (URISyntaxException e) { LOG.error("Can't parse server url: {}", serverUrl, e); } } } return unmodifiableSet(new HashSet<>(lslRegistry.values())); }
Source:
public Container iand(final ArrayContainer b2) { if (-1 == cardinality) { Util.intersect(bitmap, b2.content, b2.cardinality); return this; } else { return b2.and(this); } }

Target:
public Container iand(final ArrayContainer b2) { if (-1 == cardinality) { Util.intersectArrayIntoBitmap(bitmap, b2.content, b2.cardinality); return this; } else { return b2.and(this); } }
Source:
public Model getGETModel(Representation rep) { ModelImpl modelImpl = (ModelImpl) super.getGETModel(rep); if (rep instanceof DefaultRepresentation || rep instanceof FullRepresentation) { modelImpl .property("uuid", new StringProperty()) .property("display", new StringProperty()) .property("voided", new BooleanProperty()) .property("patient", new RefProperty("#/definitions/PatientGetRef")) .property("encounter", new RefProperty("#/definitions/EncounterGetRef")) .property("orders", new RefProperty("#/definitions/OrderGetRef")) .property("orderSet", new RefProperty("#/definitions/OrdersetGetRef")); } if (rep instanceof DefaultRepresentation) { modelImpl .property("uuid", new StringProperty()) .property("display", new StringProperty()) .property("voided", new BooleanProperty()) .property("patient", new RefProperty("#/definitions/PatientGetRef")) .property("encounter", new RefProperty("#/definitions/EncounterGetRef")) .property("orders", new RefProperty("#/definitions/OrderGetRef")) .property("orderSet", new RefProperty("#/definitions/OrdersetGetRef")); } else if (rep instanceof FullRepresentation) { modelImpl .property("uuid", new StringProperty()) .property("display", new StringProperty()) .property("voided", new BooleanProperty()) .property("auditInfo", new BooleanProperty()) .property("patient", new RefProperty("#/definitions/PatientGetRef")) .property("encounter", new RefProperty("#/definitions/EncounterGetRef")) .property("orders", new ArrayProperty(new RefProperty("#/definitions/OrderGetRef"))) .property("orderSet", new RefProperty("#/definitions/OrdersetGetRef")); } else if (rep instanceof RefRepresentation) { modelImpl .property("display", new StringProperty()) .property("uuid", new StringProperty()); } return modelImpl; }

Target:
public Model getGETModel(Representation rep) { ModelImpl modelImpl = (ModelImpl) super.getGETModel(rep); if (rep instanceof DefaultRepresentation) { modelImpl.property("uuid", new StringProperty()).property("display", new StringProperty()) .property("voided", new BooleanProperty()) .property("patient", new RefProperty("#/definitions/PatientGetRef")) .property("encounter", new RefProperty("#/definitions/EncounterGetRef")) .property("orders", new RefProperty("#/definitions/OrderGetRef")) .property("orderSet", new RefProperty("#/definitions/OrdersetGetRef")); } else if (rep instanceof FullRepresentation) { modelImpl.property("uuid", new StringProperty()).property("display", new StringProperty()) .property("voided", new BooleanProperty()).property("auditInfo", new BooleanProperty()) .property("patient", new RefProperty("#/definitions/PatientGetRef")) .property("encounter", new RefProperty("#/definitions/EncounterGetRef")) .property("orders", new ArrayProperty(new RefProperty("#/definitions/OrderGetRef"))) .property("orderSet", new RefProperty("#/definitions/OrdersetGetRef")); } else if (rep instanceof RefRepresentation) { modelImpl.property("display", new StringProperty()).property("uuid", new StringProperty()); } return modelImpl; }
Source:
public void onNext(T t) { if (!isDisposed()) { try { if (internalBuffer.getAndIncrement() < bufferSize) { onNext.accept(t); } if (internalBuffer.get() == bufferSize) { onComplete.run(); get().cancel(); } } catch (Throwable e) { Exceptions.throwIfFatal(e); get().cancel(); onError(e); } } }

Target:
public void onNext(T t) { if (!isDisposed()) { try { onNext.accept(t); int c = consumed + 1; if (c == limit) { consumed = 0; get().request(limit); } else { consumed = c; } } catch (Throwable e) { Exceptions.throwIfFatal(e); get().cancel(); onError(e); } } }
Source:
public void testSetCustomDimensions() throws Exception { CustomDimensions customDimensions = new CustomDimensions(); customDimensions.set(1, "foo"); customDimensions.set(2, "bar"); customDimensions.set(3, "empty").set(3, null); QueryHashMap<String, String> queryParams = parseEventUrl(customDimensions.build()); assertEquals(queryParams.get("dimension1"), "foo"); assertEquals(queryParams.get("dimension2"), "bar"); assertFalse(queryParams.containsKey("dimension3")); }

Target:
public void testSetCustomDimensions() throws Exception { CustomDimensions customDimensions = new CustomDimensions(); customDimensions.set(0, "foo"); customDimensions.set(1, "foo"); customDimensions.set(2, "bar"); customDimensions.set(3, "empty").set(3, null); customDimensions.set(4, ""); QueryHashMap<String, String> queryParams = parseEventUrl(customDimensions.build()); assertEquals(queryParams.get("dimension1"), "foo"); assertEquals(queryParams.get("dimension2"), "bar"); assertFalse(queryParams.containsKey("dimension0")); assertFalse(queryParams.containsKey("dimension3")); assertFalse(queryParams.containsKey("dimension4")); }
Source:
public void batch_mutate(String kvsMethodName, Map<ByteBuffer, Map<String, List<Mutation>>> mutation_map, ConsistencyLevel consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, TException { mutation_map.forEach((key, tableToMutations) -> { tableToMutations.forEach((table, mutations) -> { getCellsWrittenMeterForTable(table).mark(mutations.size()); }); }); }

Target:
public void batch_mutate(String kvsMethodName, Map<ByteBuffer, Map<String, List<Mutation>>> mutation_map, ConsistencyLevel consistency_level) throws InvalidRequestException, UnavailableException, TimedOutException, TException { delegate.batch_mutate(kvsMethodName, mutation_map, consistency_level); Map<String, Long> tablesToCells = new HashMap<>(mutation_map.size()); mutation_map.values().forEach(tableToCellsMap -> { tableToCellsMap.forEach((table, cells) -> { Long numberOfCells = tablesToCells.getOrDefault(table, 0L); tablesToCells.put(table, numberOfCells + cells.size()); }); }); tablesToCells.forEach((table, numberOfCells) -> getCellsWrittenMeterForTable(table).mark(numberOfCells)); }
Source:
public void setReplicators(Replicator[] replicators) { if (replicators != null && replicators.length > 0) { if (mReplicationPolicyManager == null) { mReplicationPolicyManager = new ReplicationPolicyManager(); } mReplicationPolicyManager.addReplicators(replicators); mReplicationPolicyManager.setReplicationsCompletedListener(this); synchronized (mCommandQueue) { mReplicatorsInitialised = true; for (Message msg : mCommandQueue) { mServiceHandler.sendMessage(msg); } mCommandQueue.clear(); } } else { throw new RuntimeException( "No replications setup. Please pass Replicators to setReplicators(Replicator[])"); } }

Target:
public void setReplicators(Replicator[] replicators) { if (mReplicatorsInitialised) { throw new IllegalStateException("Replicators already set"); } if (replicators != null && replicators.length > 0) { if (mReplicationPolicyManager == null) { mReplicationPolicyManager = new ReplicationPolicyManager(); } mReplicationPolicyManager.addReplicators(replicators); mReplicationPolicyManager.setReplicationsCompletedListener(this); synchronized (mCommandQueue) { mReplicatorsInitialised = true; for (Message msg : mCommandQueue) { mServiceHandler.sendMessage(msg); } mCommandQueue.clear(); } } else { throw new IllegalArgumentException( "No replications setup. Please pass Replicators to setReplicators(Replicator[])"); } }
Source:
public Location getLocation() { return new Location((Extent) getEntityWorld(), new Vector3d(getPositionVector().xCoord, getPositionVector().yCoord, getPositionVector().zCoord)); }

Target:
public Location getLocation() { return new Location((Extent) getEntityWorld(), VecHelper.toVector(getPositionVector())); }
Source:
private boolean containsInstance(Object bean) { for (Object element : list) { if (JHelper.objectSameReference(element, bean)) { return true; } } return false; }

Target:
private boolean containsInstance(Object bean) { for (Object element : list) { if (element == bean) { return true; } } return false; }