auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private String generateCreateViewDDL(String columnInfoString, String baseTableFullName, String whereClause, String pSchemaName, String pTableName) { String viewFullName = SchemaUtil.getQualifiedTableName(pSchemaName, pTableName); if(Character.isDigit(pTableName.charAt(0))) { viewFullName = pSchemaName+".\""+pTableName+"\""; } StringBuilder outputBuilder = new StringBuilder(String.format(CREATE_VIEW, viewFullName, columnInfoString, baseTableFullName, whereClause)); return outputBuilder.toString(); }

Target:
private String generateCreateViewDDL(String columnInfoString, String baseTableFullName, String whereClause, String pSchemaName, String pTableName) { String viewFullName = SchemaUtil.getPTableFullNameWithQuotes(pSchemaName, pTableName); StringBuilder outputBuilder = new StringBuilder(String.format(CREATE_VIEW, viewFullName, columnInfoString, baseTableFullName, whereClause)); return outputBuilder.toString(); }
Source:
public static void initPageToken(final String token) { self.attributes.addValue(ATTRIBUTE_TOKEN, token); Window.Location.replace("?" + UrlSerializer.serialize(self.attributes)); }

Target:
public static void initPageToken(final String token) { self.attributes.addValue(ATTRIBUTE_TOKEN, token); Window.Location.replace("#?" + UrlSerializer.serialize(self.attributes)); }
Source:
private List<Map<String, Object>> jsonToMap(String json) { try { ObjectMapper mapper = new ObjectMapper(); return mapper.readValue((String) json, new TypeReference<List<Map<String, Object>>>() { }); } catch (Exception e) { return null; } }

Target:
private List<Map<String, Object>> jsonToMap(String json) throws FormInstanceBuilderException { try { ObjectMapper mapper = new ObjectMapper(); return mapper.readValue(json, new TypeReference<List<Map<String, Object>>>() { }); } catch (IOException e) { throw new FormInstanceBuilderException("Unable to parse JSON", e); } }
Source:
private void initializeTerminologyToShortnameCache() { for (final IConfigurationElement terminology : Platform.getExtensionRegistry().getConfigurationElementsFor(TERMINOLOGY_EXTENSION_POINT_ID)) { final List<String> affectedCodeSystems = Lists.newArrayList(); final String id = terminology.getAttribute(ID_ATTRIBUTE); affectedCodeSystems.addAll( Arrays.stream(terminology.getChildren(DEPENDENCY_ATTRIBUTE)) .map(configurationElement -> configurationElement.getAttribute(SHORT_NAME_ATTRIBUTE)) .collect(Collectors.toList()) ); TERMINOLOGY_ID_TO_SHORTNAMES_CACHE.put(id, ImmutableSortedSet.copyOf(affectedCodeSystems)); } }

Target:
private void initializeTerminologyToShortnameCache() { for (final IConfigurationElement terminology : Platform.getExtensionRegistry().getConfigurationElementsFor(TERMINOLOGY_EXTENSION_POINT_ID)) { final ImmutableSortedSet.Builder<String> affectedCodeSystems = ImmutableSortedSet.naturalOrder(); final String id = terminology.getAttribute(ID_ATTRIBUTE); affectedCodeSystems.addAll( Arrays.stream(terminology.getChildren(DEPENDENCY_ATTRIBUTE)) .map(configurationElement -> configurationElement.getAttribute(SHORT_NAME_ATTRIBUTE)) .collect(Collectors.toList()) ); TERMINOLOGY_ID_TO_SHORTNAMES_CACHE.put(id, affectedCodeSystems.build()); } }
Source:
public <Q, I, U> SubscriptionQueryResult<I, U> subscriptionQuery(String queryName, Q query, ResponseType<I> initialResponseType, ResponseType<U> updateResponseType, int updateBufferSize) { SubscriptionQueryMessage<?, I, U> subscriptionQueryMessage = new GenericSubscriptionQueryMessage<>( asMessage(query), queryName, initialResponseType, updateResponseType ); SubscriptionQueryMessage<?, I, U> interceptedQuery = processInterceptors(subscriptionQueryMessage); SubscriptionQueryResult<QueryResponseMessage<I>, SubscriptionQueryUpdateMessage<U>> result = queryBus.subscriptionQuery(interceptedQuery, updateBufferSize); return new DefaultSubscriptionQueryResult<>( result.initialResult() .filter(initialResult -> Objects.nonNull(initialResult.getPayload())) .map(Message::getPayload) .onErrorMap(e -> e instanceof IllegalPayloadAccessException ? e.getCause() : e), result.updates() .filter(update -> Objects.nonNull(update.getPayload())) .map(SubscriptionQueryUpdateMessage::getPayload), result ); }

Target:
public <Q, I, U> SubscriptionQueryResult<I, U> subscriptionQuery(String queryName, Q query, ResponseType<I> initialResponseType, ResponseType<U> updateResponseType, int updateBufferSize) { SubscriptionQueryMessage<?, I, U> interceptedQuery = getSubscriptionQueryMessage( queryName, query, initialResponseType, updateResponseType); SubscriptionQueryResult<QueryResponseMessage<I>, SubscriptionQueryUpdateMessage<U>> result = queryBus.subscriptionQuery(interceptedQuery, updateBufferSize); return getSubscriptionQueryResult(result); }
Source:
private Optional<ComponentDto> searchProject(DbSession dbSession, AddRequest request) { Optional<ComponentDto> project = request.getProject() == null ? empty() : Optional.of(componentFinder.getByKey(dbSession, request.getProject())); project.ifPresent(p -> checkRequest(Qualifiers.PROJECT.equals(p.qualifier()) && Scopes.PROJECT.equals(p.scope()), "Component '%s' must be a project", request.getProject())); project.ifPresent(p -> { if (p.isPrivate()) { userSession.checkComponentPermission(UserRole.USER, p); } }); return project; }

Target:
private Optional<ComponentDto> searchProject(DbSession dbSession, AddRequest request) { Optional<ComponentDto> project = request.getProject() == null ? empty() : Optional.of(componentFinder.getByKey(dbSession, request.getProject())); project.ifPresent(p -> checkRequest(Qualifiers.PROJECT.equals(p.qualifier()) && Scopes.PROJECT.equals(p.scope()), "Component '%s' must be a project", request.getProject())); project.ifPresent(p -> userSession.checkComponentPermission(UserRole.USER, p)); return project; }
Source:
protected void createMemoryTabsFromMemento(String memento, final Object context) throws Exception { Element root = DebugPlugin.parseDocument(memento); if (!root.getNodeName().equalsIgnoreCase(MEMORY_TABS_LIST)) { IStatus status = new Status(IStatus.ERROR, MemoryBrowserPlugin.PLUGIN_ID, DebugPlugin.INTERNAL_ERROR, "Memory tabs initialization: invalid memento", null); throw new CoreException(status); } NodeList memoryTabsList = root.getChildNodes(); int length = memoryTabsList.getLength(); for (int i = 0; i < length; ++i) { Node node = memoryTabsList.item(i); if (node.getNodeType() == Node.ELEMENT_NODE) { Element entry = (Element) node; if (entry.getNodeName().equalsIgnoreCase(MEMORY_TAB)) { String memorySpace = entry.getAttribute(ATTR_MEMORY_SPACE); if (memorySpace != null && memorySpace.length() == 0) { memorySpace = null; } final String finalMemorySpace = memorySpace; final String address = entry.getAttribute(ATTR_ADDRESS); final String renderingTypeId = entry.getAttribute(ATTR_RENDERING); runOnUIThread(new Callable<Object>(){ public Object call() throws Exception { String oldRenderingTypeId = getDefaultRenderingTypeId(); setDefaultRenderingTypeId(renderingTypeId); fGotoAddressBar.addExpressionToHistory(context, address, finalMemorySpace); performGo(true, address, finalMemorySpace); setDefaultRenderingTypeId(oldRenderingTypeId); return null; } }); } } } }

Target:
protected void createMemoryTabsFromMemento(String memento, final Object context) throws Exception { Element root = DebugPlugin.parseDocument(memento); if (!root.getNodeName().equalsIgnoreCase(MEMORY_TABS_LIST)) { IStatus status = new Status(IStatus.ERROR, MemoryBrowserPlugin.PLUGIN_ID, DebugPlugin.INTERNAL_ERROR, "Memory tabs initialization: invalid memento", null); throw new CoreException(status); } NodeList memoryTabsList = root.getChildNodes(); int length = memoryTabsList.getLength(); for (int i = 0; i < length; ++i) { Node node = memoryTabsList.item(i); if (node.getNodeType() == Node.ELEMENT_NODE) { Element entry = (Element) node; if (entry.getNodeName().equalsIgnoreCase(MEMORY_TAB)) { String memorySpace = entry.getAttribute(ATTR_MEMORY_SPACE); if (memorySpace != null && memorySpace.length() == 0) { memorySpace = null; } final String finalMemorySpace = memorySpace; final String address = entry.getAttribute(ATTR_ADDRESS); final String renderingTypeId = entry.getAttribute(ATTR_RENDERING); runOnUIThread(new Callable<Object>(){ public Object call() throws Exception { String oldRenderingTypeId = getDefaultRenderingTypeId(); setDefaultRenderingTypeId(renderingTypeId); fGotoAddressBar.addExpressionToHistory(context, address, finalMemorySpace); if (!performGo(true, address, finalMemorySpace)) { IStatus status = new Status(IStatus.ERROR, MemoryBrowserPlugin.PLUGIN_ID, DebugPlugin.INTERNAL_ERROR, "Memory tabs initialization: failed to go to address", null); throw new CoreException(status); } setDefaultRenderingTypeId(oldRenderingTypeId); return null; } }); } } } }
Source:
public static boolean isEmpty(Path path) { Objects.requireNonNull(path, "The given path must not be null"); Path normalized = path.normalize(); return normalized.getNameCount() == 1 && normalized.toString().equals(""); }

Target:
public static boolean isEmpty(Path path) { Objects.requireNonNull(path, "The given path must not be null"); Path normalized = path.normalize(); return normalized.getNameCount() == 1 && normalized.toString().isEmpty(); }
Source:
public void testInvalidDateTimerStart() throws Exception { try { createKnowledgeBase("timer/BPMN2-StartTimerDateInvalid.bpmn2"); fail("Should fail as timer expression is not valid"); } catch (RuntimeException e) { Assertions.assertThat(e.getMessage().contains("Could not parse date 'abcdef'")).isTrue(); } }

Target:
public void testInvalidDateTimerStart() throws Exception { Assertions.assertThatExceptionOfType(RuntimeException.class).isThrownBy(() -> { createKnowledgeBase("timer/BPMN2-StartTimerDateInvalid.bpmn2"); }) .withMessageContaining("Could not parse date 'abcdef'"); }
Source:
protected Object handleRequestMessage(Message<?> requestMessage) { final Object result; if (OutboundGatewayType.RETRIEVING.equals(this.gatewayType)) { int firstRecord = 0; if(firstRecordExpression != null) { Object firstRecordEvaluationResult = firstRecordExpression.getValue(evaluationContext, requestMessage); if(firstRecordEvaluationResult != null) { if(firstRecordEvaluationResult instanceof Number) { firstRecord = ((Number)firstRecordEvaluationResult).intValue(); } else { throw new IllegalArgumentException("Expected the value of the firstRecord to be a Number" + " got " + firstRecordEvaluationResult.getClass().getName()); } } } result = this.jpaExecutor.poll(requestMessage, firstRecord); } else if (OutboundGatewayType.UPDATING.equals(this.gatewayType)) { result = this.jpaExecutor.executeOutboundJpaOperation(requestMessage); } else { throw new IllegalArgumentException(String.format("GatewayType '%s' is not supported.", this.gatewayType)); } if (result == null || !producesReply) { return null; } return MessageBuilder.withPayload(result).copyHeaders(requestMessage.getHeaders()).build(); }

Target:
protected Object handleRequestMessage(Message<?> requestMessage) { final Object result; if (OutboundGatewayType.RETRIEVING.equals(this.gatewayType)) { result = this.jpaExecutor.poll(requestMessage); } else if (OutboundGatewayType.UPDATING.equals(this.gatewayType)) { result = this.jpaExecutor.executeOutboundJpaOperation(requestMessage); } else { throw new IllegalArgumentException(String.format("GatewayType '%s' is not supported.", this.gatewayType)); } if (result == null || !producesReply) { return null; } return MessageBuilder.withPayload(result).copyHeaders(requestMessage.getHeaders()).build(); }
Source:
public void testCreatePointStyle(){ PointSymbolizer pointsym = sf.createPointSymbolizer(); pointsym.setGraphic(sf.getDefaultGraphic()); NumberRange<Double> scaleRange = NumberRange.create( 1.0,50000.0); Style2D style = sld.createPointStyle(null, pointsym, scaleRange); assertNotNull( style ); PointStyle2D ps = (PointStyle2D) style; assertEquals(0.0f, ps.getAnchorPointX(), 0.0f); assertEquals(0.5f, ps.getAnchorPointY(), 0.0f); }

Target:
public void testCreatePointStyle(){ PointSymbolizer pointsym = sf.createPointSymbolizer(); pointsym.setGraphic(sf.getDefaultGraphic()); NumberRange<Double> scaleRange = NumberRange.create( 1.0,50000.0); Style2D style = sld.createPointStyle(null, pointsym, scaleRange); assertNotNull( style ); }
Source:
public void testHandles() { assertTrue(classUnderTest.handles(ANONYMOUS_USERS)); assertTrue(classUnderTest.handles(PROJECT_OWNERS)); assertFalse(classUnderTest.handles(OTHER_UUID)); }

Target:
public void testHandles() { assertTrue(backend.handles(ANONYMOUS_USERS)); assertTrue(backend.handles(PROJECT_OWNERS)); assertFalse(backend.handles(OTHER_UUID)); }
Source:
public void receiveMessage(IMessage message) { sync(() -> { if (message.version() > MessagingService.current_version) { throw new IllegalStateException(String.format("Node%d received message version %d but current version is %d", this.config.num(), message.version(), MessagingService.current_version)); } Message<?> messageIn = deserializeMessage(message); Message.Header header = messageIn.header; TraceState state = Tracing.instance.initializeFromMessage(header); if (state != null) state.trace("{} message received from {}", header.verb, header.from); header.verb.stage.execute(ThrowingRunnable.toRunnable(() -> MessagingService.instance().inboundSink.accept(messageIn)), ExecutorLocals.create(state)); }).run(); }

Target:
public void receiveMessage(IMessage message) { sync(() -> { if (message.version() > MessagingService.current_version) { throw new IllegalStateException(String.format("Node%d received message version %d but current version is %d", this.config.num(), message.version(), MessagingService.current_version)); } Message<?> messageIn = deserializeMessage(message); Message.Header header = messageIn.header; TraceState state = Tracing.instance.initializeFromMessage(header); if (state != null) state.trace("{} message received from {}", header.verb, header.from); header.verb.stage.execute(() -> MessagingService.instance().inboundSink.accept(messageIn), ExecutorLocals.create(state)); }).run(); }
Source:
@Test public void customSampler() throws Exception { closeClient(client); RpcTracing rpcTracing = RpcTracing.newBuilder(tracing).clientSampler(RpcRuleSampler.newBuilder() .putRule(methodEquals("SayHelloWithManyReplies"), Sampler.NEVER_SAMPLE) .build()).build(); grpcTracing = GrpcTracing.create(rpcTracing); client = newClient(); assertThat(GreeterGrpc.newBlockingStub(client).sayHelloWithManyReplies(HELLO_REQUEST)) .hasNext(); GreeterGrpc.newBlockingStub(client).sayHello(HELLO_REQUEST); assertThat(takeSpan().name()).isEqualTo("helloworld.greeter/sayhello"); }

Target:
@Test public void customSampler() throws Exception { closeClient(client); RpcTracing rpcTracing = RpcTracing.newBuilder(tracing).clientSampler(RpcRuleSampler.newBuilder() .putRule(methodEquals("SayHelloWithManyReplies"), NEVER_SAMPLE) .putRule(serviceEquals("helloworld.greeter"), ALWAYS_SAMPLE) .build()).build(); grpcTracing = GrpcTracing.create(rpcTracing); client = newClient(); GreeterGrpc.newBlockingStub(client).sayHelloWithManyReplies(HELLO_REQUEST).hasNext(); GreeterGrpc.newBlockingStub(client).sayHello(HELLO_REQUEST); assertThat(takeSpan().name()).isEqualTo("helloworld.greeter/sayhello"); }
Source:
protected int doWork() { IOUtil.assertFileIsReadable(INPUT); IOUtil.assertFileIsReadable(HAPLOTYPE_MAP); IOUtil.assertFileIsWritable(OUTPUT); IOUtil.assertFileIsReadable(referenceSequence.getReferenceFile()); final FingerprintChecker checker = new FingerprintChecker(HAPLOTYPE_MAP); if (!EXTRACT_CONTAMINATION) CONTAMINATION = 1 - CONTAMINATION; checker.setLocusMaxReads(LOCUS_MAX_READS); checker.setValidationStringency(VALIDATION_STRINGENCY); if (SAMPLE_ALIAS != null) { checker.setDefaultSampleID(SAMPLE_ALIAS); } final Map<String, Fingerprint> fingerprintMap = checker.identifyContaminant(INPUT.toPath(), CONTAMINATION); if (fingerprintMap.size() != 1) { log.error("Expected exactly 1 fingerprint, found " + fingerprintMap.size()); throw new IllegalArgumentException("Expected exactly 1 fingerprint in Input file, found " + fingerprintMap.size()); } final Map.Entry<String, Fingerprint> soleEntry = fingerprintMap.entrySet().iterator().next(); final String sampleToUse = getSampleToUse(soleEntry.getKey()); try { FingerprintUtils.writeFingerPrint(soleEntry.getValue(), OUTPUT, referenceSequence.getReferenceFile(), sampleToUse, "PLs derived from " + INPUT + " using an assumed contamination of " + this.CONTAMINATION); } catch (Exception e) { log.error(e); } return 0; }

Target:
protected int doWork() { IOUtil.assertFileIsReadable(INPUT); IOUtil.assertFileIsReadable(HAPLOTYPE_MAP); IOUtil.assertFileIsWritable(OUTPUT); IOUtil.assertFileIsReadable(referenceSequence.getReferenceFile()); final FingerprintChecker checker = new FingerprintChecker(HAPLOTYPE_MAP); if (!EXTRACT_CONTAMINATION) { CONTAMINATION = 1 - CONTAMINATION; } checker.setLocusMaxReads(LOCUS_MAX_READS); checker.setValidationStringency(VALIDATION_STRINGENCY); if (SAMPLE_ALIAS != null) { checker.setDefaultSampleID(SAMPLE_ALIAS); } final Map<String, Fingerprint> fingerprintMap = checker.identifyContaminant(INPUT.toPath(), CONTAMINATION); if (fingerprintMap.size() != 1) { log.error("Expected exactly 1 fingerprint, found " + fingerprintMap.size()); throw new IllegalArgumentException("Expected exactly 1 fingerprint in Input file, found " + fingerprintMap.size()); } final Map.Entry<String, Fingerprint> soleEntry = fingerprintMap.entrySet().iterator().next(); final String sampleToUse = getSampleToUse(soleEntry.getKey()); try { FingerprintUtils.writeFingerPrint(soleEntry.getValue(), OUTPUT, referenceSequence.getReferenceFile(), sampleToUse, "PLs derived from " + INPUT + " using an assumed contamination of " + this.CONTAMINATION); } catch (Exception e) { log.error(e); } return 0; }
Source:
private void toHtmlForAnthology(StringBuilder result) { appendNames(creators, result); appendYear(result); appendArticle(result); if (Objects.nonNull(part)) { result.append(' '); result.append(part); } appendContainedIn(result); appendTitle(result); if (Objects.nonNull(subseries)) { result.append(' '); result.append(subseries); } if (Objects.nonNull(volume)) { result.append(' '); result.append(volume); } if (Objects.nonNull(published)) { result.append(" ("); result.append(published.toString(PUBLICATION_DATE_FORMAT)); result.append(')'); } if (Objects.nonNull(number)) { result.append(' '); result.append(number); } appendPagerange(result); if (Objects.nonNull(accessed)) { result.append(" ("); appendAccessed(result); result.append(')'); } appendURL(result); }

Target:
private void toHtmlForAnthology(StringBuilder result) { appendNames(creators, result); appendYear(result); appendArticle(result); appendContainedIn(result); appendNames(contributors, result); appendTitle(result); appendVolumeInformation(result); appendEdition(result, true); appendPlaceAndPublisher(result); appendOverallTitleAndNumber(result); appendPagerange(result); }
Source:
private void showSetADFNameDialog() { Bundle bundle = new Bundle(); bundle.putString("name", "New ADF"); bundle.putString("id", ""); FragmentManager manager = getFragmentManager(); SetADFNameDialog setADFNameDialog = new SetADFNameDialog(); setADFNameDialog.setArguments(bundle); setADFNameDialog.show(manager, "ADFNameDialog"); }

Target:
private void showSetADFNameDialog() { Bundle bundle = new Bundle(); bundle.putString("name",getResources().getString(R.string.default_adf_name) ); bundle.putString("id", ""); FragmentManager manager = getFragmentManager(); SetADFNameDialog setADFNameDialog = new SetADFNameDialog(); setADFNameDialog.setArguments(bundle); setADFNameDialog.show(manager, "ADFNameDialog"); }
Source:
protected long handleObject(Object object) { Class<?> objClass = object.getClass(); if (objClass == MarshalledValue.class) { MarshalledValue marshalledValue = (MarshalledValue)object; long size = OBJECT_SIZE + POINTER_SIZE; size = roundUpToNearest8(size + POINTER_SIZE * 2 + 4 * 2); MarshalledValueByteStream mvbs = marshalledValue.getRaw(); long mvbsSize; if (mvbs instanceof ImmutableMarshalledValueByteStream) { mvbsSize = OBJECT_SIZE + POINTER_SIZE; mvbsSize = roundUpToNearest8(mvbsSize + POINTER_SIZE); } else if (mvbs instanceof ExpandableMarshalledValueByteStream) { mvbsSize = OBJECT_SIZE + POINTER_SIZE; mvbsSize = roundUpToNearest8(mvbsSize + POINTER_SIZE + 4 * 2); } else { throw new IllegalArgumentException(getClass() + " doesn't support counting for " + mvbs.getClass()); } byte[] bytes = mvbs.getRaw(); size += mvbsSize + roundUpToNearest8(Unsafe.ARRAY_BYTE_BASE_OFFSET + Unsafe.ARRAY_BYTE_INDEX_SCALE * bytes.length); return size; } return super.handleObject(object); }

Target:
protected long handleObject(Object object) { Class<?> objClass = object.getClass(); if (objClass == MarshalledValue.class) { MarshalledValue marshalledValue = (MarshalledValue)object; long size = OBJECT_SIZE + POINTER_SIZE; size = roundUpToNearest8(size + POINTER_SIZE * 2 + 4 * 2); MarshalledValueByteStream mvbs = marshalledValue.getRaw(); long mvbsSize; if (mvbs instanceof ImmutableMarshalledValueByteStream) { mvbsSize = OBJECT_SIZE + POINTER_SIZE; mvbsSize += POINTER_SIZE; mvbsSize = roundUpToNearest8(mvbsSize); } else if (mvbs instanceof ExpandableMarshalledValueByteStream) { mvbsSize = OBJECT_SIZE + POINTER_SIZE; mvbsSize += POINTER_SIZE; mvbsSize += 4; mvbsSize += 4; mvbsSize = roundUpToNearest8(mvbsSize); } else { throw new IllegalArgumentException(getClass() + " doesn't support counting for " + mvbs.getClass()); } byte[] bytes = mvbs.getRaw(); size += mvbsSize + roundUpToNearest8(Unsafe.ARRAY_BYTE_BASE_OFFSET + Unsafe.ARRAY_BYTE_INDEX_SCALE * bytes.length); return size; } return super.handleObject(object); }
Source:
public long getWaitFactor() { return waitFactor; }

Target:
public double getWaitFactor() { return backOffFactor; }
Source:
public Dialog onCreateDialog(Bundle savedInstance) { String externalCode = ""; if (savedInstance != null) { externalCode = (String) savedInstance.getSerializable("external_code"); } LayoutInflater inflater = getActivity().getLayoutInflater(); View view = inflater.inflate(R.layout.keyword_add, null); externalCodeEdit = (EditText) view.findViewById( R.id.keyword_external_code_edit); externalCodeEdit.addTextChangedListener(new TextWatcher() { @Override public void afterTextChanged(Editable s) { if (positiveButton != null) { final boolean valid = isInputValid(); positiveButton.setEnabled(valid); message.setVisibility( valid ? View.INVISIBLE : View.VISIBLE); } } @Override public void beforeTextChanged( CharSequence s, int start, int count, int after) { } @Override public void onTextChanged( CharSequence s, int start, int before, int count) { } }); externalCodeEdit.setText(externalCode); externalCodeEdit.setSelection(externalCode.length()); final EditText externalCodeEditFinal = externalCodeEdit; message = (TextView) view.findViewById(R.id.keyword_add_message); AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); builder.setTitle(R.string.keyword_add_dialog_title) .setView(view) .setPositiveButton( android.R.string.ok, new DialogInterface.OnClickListener() { @Override public void onClick(DialogInterface dialog, int id) { if (isInputValid()) { listener.onKeywordAdded( externalCodeEditFinal.getText().toString()); } } }) .setNegativeButton(android.R.string.cancel, null); final Dialog dialog = builder.create(); dialog.getWindow().setSoftInputMode( WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE); return dialog; }

Target:
public Dialog onCreateDialog(Bundle savedInstance) { String externalCode = ""; if (savedInstance != null) { externalCode = (String) savedInstance.getSerializable("external_code"); } LayoutInflater inflater = getActivity().getLayoutInflater(); View view = inflater.inflate(R.layout.keyword_add, null); externalCodeEdit = (EditText) view.findViewById( R.id.keyword_external_code_edit); externalCodeEdit.addTextChangedListener(new ExternalCodeWatcher()); externalCodeEdit.setText(externalCode); externalCodeEdit.setSelection(externalCode.length()); message = (TextView) view.findViewById(R.id.keyword_add_message); AlertDialog.Builder builder = new AlertDialog.Builder(getActivity()); builder.setTitle(R.string.keyword_add_dialog_title) .setView(view) .setPositiveButton(android.R.string.ok, new OkListener()) .setNegativeButton(android.R.string.cancel, null); final Dialog dialog = builder.create(); dialog.getWindow().setSoftInputMode( WindowManager.LayoutParams.SOFT_INPUT_STATE_VISIBLE); return dialog; }
Source:
public @NonNull TmfModelResponse<@NonNull List<@NonNull ITimeGraphRowModel>> fetchRowModel(@NonNull SelectionTimeQueryFilter filter, @Nullable IProgressMonitor monitor) { IGraphWorker graphWorker = getCurrent(); HorizontalLinksVisitor visitor = fCurrentVisitor; if (visitor == null || !Objects.equals(graphWorker, visitor.fCurrentWorker)) { return new TmfModelResponse<>(null, Status.COMPLETED, CommonStatusMessage.COMPLETED); } List<@NonNull ITimeGraphRowModel> rowModels = new ArrayList<>(); for (Long id : filter.getSelectedItems()) { Collection<ITimeGraphState> states = visitor.fStates.asMap().get(id); if (states != null) { List<ITimeGraphState> filteredStates = new ArrayList<>(states); rowModels.add(new TimeGraphRowModel(id, filteredStates)); } } return new TmfModelResponse<>(rowModels, Status.COMPLETED, CommonStatusMessage.COMPLETED); }

Target:
public @NonNull TmfModelResponse<@NonNull List<@NonNull ITimeGraphRowModel>> fetchRowModel(@NonNull SelectionTimeQueryFilter filter, @Nullable IProgressMonitor monitor) { IGraphWorker graphWorker = getCurrent(); HorizontalLinksVisitor visitor = fHorizontalVisitorCache.getIfPresent(graphWorker); if (visitor == null) { return new TmfModelResponse<>(null, Status.COMPLETED, CommonStatusMessage.COMPLETED); } List<@NonNull ITimeGraphRowModel> rowModels = new ArrayList<>(); for (Long id : filter.getSelectedItems()) { Collection<ITimeGraphState> states = visitor.fStates.asMap().get(id); if (states != null) { List<ITimeGraphState> filteredStates = new ArrayList<>(); for (ITimeGraphState state : states) { if (overlaps(state.getStartTime(), state.getDuration(), filter.getTimesRequested())) { filteredStates.add(state); } } rowModels.add(new TimeGraphRowModel(id, filteredStates)); } } return new TmfModelResponse<>(rowModels, Status.COMPLETED, CommonStatusMessage.COMPLETED); }
Source:
public boolean isEnabled() { return !(Jenkins.get()).getDisabledAdministrativeMonitors().contains(id); }

Target:
public boolean isEnabled() { return !Jenkins.get().getDisabledAdministrativeMonitors().contains(id); }
Source:
public boolean equals(Object o) { if (this == o) return true; if (o == null || getClass() != o.getClass()) return false; JPAMessageId that = (JPAMessageId) o; return value == that.value; }

Target:
public boolean equals(Object o) { if (this == o) {return true;} if (o == null || getClass() != o.getClass()) {return false;} JPAMessageId that = (JPAMessageId) o; return value == that.value; }
Source:
public void merge(BuildPlan source) { Assert.isNotNull(source); @SuppressWarnings("serial") EcoreUtil.Copier copier = new EcoreUtil.Copier() { @Override protected EObject createCopy(EObject source) { return BuildPlan.this; }; @Override protected void copyAttribute(EAttribute eAttribute, EObject eObject, EObject copyEObject) { super.copyAttribute(eAttribute, eObject, copyEObject); } @Override protected void copyContainment(EReference eReference, EObject eObject, EObject copyEObject) { } }; copier.copy(source); getParameterDefinitions().clear(); getParameterDefinitions().addAll(EcoreUtil.copyAll(source.getParameterDefinitions())); getFlags().clear(); getFlags().addAll(source.getFlags()); getHealthReports().clear(); getHealthReports().addAll(EcoreUtil.copyAll(source.getHealthReports())); getAttributes().clear(); getAttributes().putAll(source.getAttributes()); List<IBuildPlan> childrenCopy = new ArrayList<>(); source.getChildren().forEach(sourceChild -> { Optional<IBuildPlan> maybeChild = getChildren().stream() .filter(ch -> ch.getId().equals(sourceChild.getId())) .findAny(); if (maybeChild.isPresent()) { BuildPlan child = (BuildPlan) maybeChild.get(); child.merge((BuildPlan) sourceChild); } childrenCopy.add(maybeChild.orElse(sourceChild)); }); childrenCopy.forEach(child -> { child.setParent(this); child.setSelected(isSelected()); if (child.getServer() == null) { child.setServer(getServer()); child.setRefreshDate(refreshDate); } }); getChildren().clear(); getChildren().addAll(childrenCopy); if (getParent() != null) { if (server == null && getParent().getServer() != null) { setServer(getParent().getServer()); } } }

Target:
public void merge(BuildPlan source) { Assert.isNotNull(source); @SuppressWarnings("serial") EcoreUtil.Copier copier = new EcoreUtil.Copier() { @Override protected EObject createCopy(EObject source) { return BuildPlan.this; }; @Override protected void copyAttribute(EAttribute eAttribute, EObject eObject, EObject copyEObject) { super.copyAttribute(eAttribute, eObject, copyEObject); } @Override protected void copyContainment(EReference eReference, EObject eObject, EObject copyEObject) { } }; copier.copy(source); getParameterDefinitions().clear(); getParameterDefinitions().addAll(EcoreUtil.copyAll(source.getParameterDefinitions())); getFlags().clear(); getFlags().addAll(source.getFlags()); getHealthReports().clear(); getHealthReports().addAll(EcoreUtil.copyAll(source.getHealthReports())); getAttributes().clear(); getAttributes().putAll(source.getAttributes()); List<IBuildPlan> childrenCopy = new ArrayList<>(); source.getChildren().forEach(sourceChild -> { Optional<IBuildPlan> maybeChild = getChildren().stream() .filter(ch -> ch.getId().equals(sourceChild.getId())) .findAny(); if (maybeChild.isPresent()) { BuildPlan child = (BuildPlan) maybeChild.get(); child.merge((BuildPlan) sourceChild); } childrenCopy.add(maybeChild.orElse(sourceChild)); }); childrenCopy.forEach(child -> { child.setParent(this); child.setSelected(isSelected()); if (child.getServer() == null) { child.setServer(getServer()); child.setRefreshDate(refreshDate); } }); getChildren().clear(); getChildren().addAll(childrenCopy); }
Source:
public Collection<ArtifactToken> getArtifactsFromQuery(String query, Object... data) { List<ArtifactId> ids = new LinkedList<>(); jdbcService.getClient().runQuery(stmt -> ids.add(ArtifactId.valueOf(stmt.getInt("art_id"))), query, data); return services.getQueryService().getArtifacts(ids, services.getAtsBranch()); }

Target:
public Collection<ArtifactToken> getArtifactsFromQuery(String query, Object... data) { List<ArtifactId> ids = new LinkedList<>(); jdbcService.getClient().runQuery(stmt -> ids.add(ArtifactId.valueOf(stmt.getLong("art_id"))), query, data); return services.getQueryService().getArtifacts(ids, services.getAtsBranch()); }
Source:
public static void setupBeforeClass() { try { new File(tempOutputDirFromShp).mkdirs(); new File(tempOutputDirFromPbf).mkdirs(); System.out.println("Building from shapefile"); hopperShp = initHopper(new GraphhopperShp(), shapefile, tempOutputDirFromShp); System.out.println("Building from pbf"); hopperPbf = initHopper(new GraphHopperOSM(), pbf, tempOutputDirFromPbf); System.out.println("Finished building"); } catch (Exception e) { BEFORE_CLASS_EXCEPTION = e; } }

Target:
public static void setupBeforeClass() { try { new File(tempOutputDirFromShp).mkdirs(); new File(tempOutputDirFromPbf).mkdirs(); hopperShp = initHopper(new GraphhopperSHP(), shapefile, tempOutputDirFromShp); hopperPbf = initHopper(new GraphHopperOSM(), pbf, tempOutputDirFromPbf); } catch (Exception e) { BEFORE_CLASS_EXCEPTION = e; } }
Source:
public static ANSSRegionsFactory getFactory() { if (SINGLETON == null) { SINGLETON = new ANSSRegionsFactory(); SINGLETON.startup(); Runtime.getRuntime().addShutdownHook(new Thread(() -> { SINGLETON.shutdown(); })); } return SINGLETON; }

Target:
public static synchronized ANSSRegionsFactory getFactory() { return getFactory(true); }
Source:
public void initialise() { infoArea = find("infoArea", UIText.class); infoArea.setText(LatinQuotes[random.nextInt(LatinQuotes.length-1)]); updateInfoButton = find("updateInfoButton", UIButton.class); if (updateInfoButton != null) { updateInfoButton.subscribe(button -> { infoArea.setText(LatinQuotes[random.nextInt(LatinQuotes.length-1)]); }); } }

Target:
public void initialise() { infoArea = find("infoArea", UIText.class); updateInfoButton = find("updateInfoButton", UIButton.class); if (updateInfoButton != null) { updateInfoButton.subscribe(button -> { infoArea.setText(LatinQuotes[random.nextInt(LatinQuotes.length)]); }); } }
Source:
public static Set<Annotation> getQualifiers(AnnotatedElement... elements) { return Arrays.stream(elements) .filter(Objects::nonNull) .flatMap(element -> Stream.of(element.getAnnotations())) .filter(anno -> anno.annotationType().isAnnotationPresent(Qualifier.class)) .collect(toSet()); }

Target:
public static Set<Annotation> getQualifiers(AnnotatedElement... elements) { return Arrays.stream(elements) .filter(Objects::nonNull) .map(AnnotatedElement::getAnnotations) .flatMap(Arrays::stream) .filter(anno -> anno.annotationType().isAnnotationPresent(Qualifier.class)) .collect(toSet()); }
Source:
protected void onConfigure() { super.onConfigure(); getModel().getObject().setTarget(getMarkupId()); if (getModel().getObject().getLayers() != null) { for (Layer layer : getModel().getObject().getLayers()) { if (layer instanceof Vector) { final Vector vectorLayer = (Vector) layer; VectorFeatureDataLoadedListener vectorFeatureDataLoadedListener = new VectorFeatureDataLoadedListener() { @Override public void handleDataLoaded(AjaxRequestTarget target) { vectorLayer.notifyFeaturesLoadedListeners(target); } }; add(vectorFeatureDataLoadedListener); layerDataLoadedMap.put(layer, vectorFeatureDataLoadedListener); } } } }

Target:
protected void onConfigure() { super.onConfigure(); Map map = getModelObject(); map.setTarget(getMarkupId()); if (map.getLayers() != null) { for (Layer layer : map.getLayers()) { if (layer instanceof Vector) { final Vector vectorLayer = (Vector) layer; VectorFeatureDataLoadedListener vectorFeatureDataLoadedListener = new VectorFeatureDataLoadedListener() { @Override public void handleDataLoaded(AjaxRequestTarget target) { vectorLayer.notifyFeaturesLoadedListeners(target); } }; add(vectorFeatureDataLoadedListener); layerDataLoadedMap.put(layer, vectorFeatureDataLoadedListener); } } } }
Source:
public EditingDomain getEditingDomainForContainment() { return actionContext.getEditingDomain(); }

Target:
protected EditingDomain getEditingDomainForContainment() { return actionContext.getEditingDomain(); }
Source:
public void detectSingleTextLanguage() { DetectedLanguage primaryLanguage = new DetectedLanguage("English", "en", 1.0); StepVerifier.create(client.detectLanguage("This is a test English Text")) .assertNext(response -> validateDetectedLanguages(Collections.singletonList(primaryLanguage), Collections.singletonList(response))) .verifyComplete(); }

Target:
public void detectSingleTextLanguage() { DetectedLanguage primaryLanguage = new DetectedLanguage("English", "en", 1.0); StepVerifier.create(client.detectLanguage("This is a test English Text")) .assertNext(response -> validatePrimaryLanguage(primaryLanguage, response)) .verifyComplete(); }
Source:
private boolean parsePackageInformation( Bundle bundle, URL resourceUrl ) { try { URLConnection urlConnection = resourceUrl.openConnection(); RequireJsGenerator gen = RequireJsGenerator.parseJsonPackage( urlConnection.getInputStream() ); if ( gen != null ) { RequireJsGenerator.ArtifactInfo artifactInfo = new RequireJsGenerator.ArtifactInfo( "osgi-bundles", bundle.getSymbolicName(), bundle.getVersion().toString() ); final RequireJsGenerator.ModuleInfo moduleInfo = gen.getConvertedConfig( artifactInfo ); Map<String, Object> requireJsonObject = moduleInfo.getRequireJs(); putInConfigMap( bundle.getBundleId(), requireJsonObject ); return true; } } catch ( Exception ignored ) { ignored.printStackTrace(); } return false; }

Target:
private boolean parsePackageInformation( Bundle bundle, URL resourceUrl ) { try { URLConnection urlConnection = resourceUrl.openConnection(); RequireJsGenerator gen = RequireJsGenerator.parseJsonPackage( urlConnection.getInputStream() ); if ( gen != null ) { RequireJsGenerator.ArtifactInfo artifactInfo = new RequireJsGenerator.ArtifactInfo( "osgi-bundles", bundle.getSymbolicName(), bundle.getVersion().toString() ); final RequireJsGenerator.ModuleInfo moduleInfo = gen.getConvertedConfig( artifactInfo ); Map<String, Object> requireJsonObject = moduleInfo.getRequireJs(); putInConfigMap( bundle.getBundleId(), requireJsonObject ); return true; } } catch ( Exception ignored ) { } return false; }
Source:
public static boolean eligibleForLoad(Period period, Interval interval, DateTime referenceTimestamp) { final Interval currInterval = new Interval(period, referenceTimestamp); return currInterval.overlaps(interval); }

Target:
public static boolean eligibleForLoad(Period period, Interval interval, DateTime referenceTimestamp) { final Interval currInterval = new Interval(period, referenceTimestamp); return eligibleForLoad(currInterval, interval); }
Source:
public String getValue() { return content.orNull(); }

Target:
public String getValue() { return content; }
Source:
protected List<FileStatus> listStatus(Path... dirs) throws IOException { List<FileStatus> result = new ArrayList<FileStatus>(); if (dirs.length == 0) { throw new IOException("No input paths specified in job"); } List<IOException> errors = new ArrayList<IOException>(); List<PathFilter> filters = new ArrayList<PathFilter>(); filters.add(hiddenFileFilter); PathFilter inputFilter = new MultiPathFilter(filters); for (int i = 0; i < dirs.length; ++i) { Path p = dirs[i]; FileStatus[] matches = fs.globStatus(p, inputFilter); if (matches == null) { errors.add(new IOException("Input path does not exist: " + p)); } else if (matches.length == 0) { errors.add(new IOException("Input Pattern " + p + " matches 0 files")); } else { for (FileStatus globStat : matches) { if (globStat.isDirectory()) { for (FileStatus stat : fs.listStatus(globStat.getPath(), inputFilter)) { result.add(stat); } } else { result.add(globStat); } } } } if (!errors.isEmpty()) { throw new InvalidInputException(errors); } LOG.info("Total input paths to process : " + result.size()); return result; }

Target:
protected List<FileStatus> listStatus(Path... dirs) throws IOException { List<FileStatus> result = new ArrayList<FileStatus>(); if (dirs.length == 0) { throw new IOException("No input paths specified in job"); } List<IOException> errors = new ArrayList<IOException>(); List<PathFilter> filters = new ArrayList<PathFilter>(); filters.add(hiddenFileFilter); PathFilter inputFilter = new MultiPathFilter(filters); for (int i = 0; i < dirs.length; ++i) { Path p = dirs[i]; FileStatus[] matches = fs.globStatus(p, inputFilter); if (matches == null) { LOG.warn("Input path does not exist: " + p); } else if (matches.length == 0) { LOG.warn("Input Pattern " + p + " matches 0 files"); } else { for (FileStatus globStat : matches) { if (globStat.isDirectory()) { for (FileStatus stat : fs.listStatus(globStat.getPath(), inputFilter)) { result.add(stat); } } else { result.add(globStat); } } } } if (!errors.isEmpty()) { throw new InvalidInputException(errors); } LOG.info("Total input paths to process : " + result.size()); return result; }
Source:
public DeathlessAncient(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{B}{B}"); this.subtype.add("Vampire"); this.subtype.add("Knight"); this.power = new MageInt(4); this.toughness = new MageInt(4); this.addAbility(FlyingAbility.getInstance()); this.addAbility(new SimpleActivatedAbility(Zone.GRAVEYARD, new ReturnToHandSourceEffect(), new TapTargetCost(new TargetControlledPermanent(3, 3, filter, false)))); }

Target:
public DeathlessAncient(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{4}{B}{B}"); this.subtype.add("Vampire"); this.subtype.add("Knight"); this.power = new MageInt(4); this.toughness = new MageInt(4); this.addAbility(FlyingAbility.getInstance()); this.addAbility(new SimpleActivatedAbility(Zone.GRAVEYARD, new ReturnToHandSourceEffect(), new TapTargetCost(new TargetControlledPermanent(3, 3, filter, true)))); }
Source:
public ServiceIntegrationView(final ServiceDescriptor serviceDescriptor, final long configurationsCount) { this.serviceKey = serviceDescriptor.getServiceKey(); this.name = serviceDescriptor.getName(); this.description = serviceDescriptor.getDescription(); this.iconUrl = serviceDescriptor.getIconUrl(); this.configurationsCount = configurationsCount; }

Target:
public ServiceIntegrationView(final ServiceDescriptor serviceDescriptor, final long configurationsCount) { this.key = serviceDescriptor.getKey(); this.name = serviceDescriptor.getName(); this.description = serviceDescriptor.getDescription(); this.iconUrl = serviceDescriptor.getIconUrl(); this.configurationsCount = configurationsCount; this.sites = null; }
Source:
protected void executeQueryCommand() { VmDeviceDAO dao = DbFacade.getInstance().getVmDeviceDAO(); List<VmDevice> disks = dao.getVmDeviceByVmIdAndType(getParameters().getId(), VmDeviceType.DISK.getName()); for (VmDevice disk: disks) { if (VmPayload.isPayload(disk.getSpecParams())) { VmPayload payload = new VmPayload(VmDeviceType.valueOf(disk.getType().toUpperCase()), disk.getSpecParams()); payload.setType(VmDeviceType.valueOf(disk.getDevice().toUpperCase())); payload.setContent(new String(Base64.decodeBase64(payload.getContent()))); getQueryReturnValue().setReturnValue(payload); } } }

Target:
protected void executeQueryCommand() { VmDeviceDAO dao = getDbFacade().getVmDeviceDAO(); List<VmDevice> disks = dao.getVmDeviceByVmIdAndType(getParameters().getId(), VmDeviceType.DISK.getName()); for (VmDevice disk: disks) { if (VmPayload.isPayload(disk.getSpecParams())) { VmPayload payload = new VmPayload(VmDeviceType.valueOf(disk.getType().toUpperCase()), disk.getSpecParams()); payload.setType(VmDeviceType.valueOf(disk.getDevice().toUpperCase())); payload.setContent(new String(Base64.decodeBase64(payload.getContent()))); getQueryReturnValue().setReturnValue(payload); } } }
Source:
private void collectParentTestInstances(ExtensionContext context, Set<Object> testInstances) { Optional<ExtensionContext> parent = context.getParent(); boolean firstParent = true; while (parent.isPresent() && parent.get() != context.getRoot()) { ExtensionContext parentContext = parent.get(); parent = parentContext.getParent(); if (firstParent) { firstParent = false; continue; } Object testInstance = parentContext.getStore(MOCKITO).remove(TEST_INSTANCE); if (testInstance != null) { testInstances.add(testInstance); } } }

Target:
private void collectParentTestInstances(ExtensionContext context, Set<Object> testInstances) { Optional<ExtensionContext> initialParent = context.getParent(); initialParent.ifPresent(parent -> collectParentTestInstance(parent.getParent(), context, testInstances)); }
Source:
public void convertStoredDefinitionWorks() { StoredWorkflowDefinition convertedOriginal = dao.convert(original); assertThat(convertedOriginal.type, is(original.getType())); assertThat(convertedOriginal.onError, is(original.getErrorState().name())); assertThat(convertedOriginal.description, is(original.getDescription())); assertThat(convertedOriginal.states.size(), is(original.getStates().size())); for (StoredWorkflowDefinition.State convertedState : convertedOriginal.states) { boolean foundMatchingState = false; for (DummyTestState originalState : original.getStates()) { if (originalState.name().equals(convertedState.id)) { assertThat(convertedState.description, is(originalState.getDescription())); WorkflowState originalFailureTransition = original.getFailureTransitions().get(originalState.name()); assertThat(convertedState.onFailure, is(originalFailureTransition != null ? originalFailureTransition.name() : null)); List<String> originalStateTransitions = original.getAllowedTransitions().get(originalState.name()); if (originalStateTransitions != null) { assertThat(convertedState.transitions, containsElementsInAnyOrder(originalStateTransitions)); } else { assertThat(convertedState.transitions.size(), is(0)); } foundMatchingState = true; } } assertThat("Not found match for state " + convertedState.id, foundMatchingState, is(true)); } }

Target:
public void convertStoredDefinitionWorks() { StoredWorkflowDefinition convertedOriginal = dao.convert(original); assertThat(convertedOriginal.type, is(original.getType())); assertThat(convertedOriginal.onError, is(original.getErrorState().name())); assertThat(convertedOriginal.description, is(original.getDescription())); assertThat(convertedOriginal.states.size(), is(original.getStates().size())); for (StoredWorkflowDefinition.State convertedState : convertedOriginal.states) { boolean foundMatchingState = false; for (DummyTestState originalState : original.getStates()) { if (originalState.name().equals(convertedState.id)) { assertThat(convertedState.description, is(originalState.getDescription())); WorkflowState originalFailureTransition = original.getFailureTransitions().get(originalState.name()); assertThat(convertedState.onFailure, is(originalFailureTransition != null ? originalFailureTransition.name() : null)); List<String> originalStateTransitions = original.getAllowedTransitions().get(originalState.name()); if (originalStateTransitions != null) { assertThat(convertedState.transitions, containsElementsInAnyOrder(originalStateTransitions)); } else { assertThat(convertedState.transitions.size(), is(0)); } foundMatchingState = true; break; } } assertThat("Not found match for state " + convertedState.id, foundMatchingState, is(true)); } }
Source:
public EventHubProducer createProducer(EventHubProducerOptions options) { final EventHubAsyncProducer producer = client.createProducer(); return new EventHubProducer(producer, options.retry().tryTimeout()); }

Target:
public EventHubProducer createProducer(EventHubProducerOptions options) { Objects.requireNonNull(options); final EventHubAsyncProducer producer = client.createProducer(options); final Duration tryTimeout = options.retry() != null && options.retry().tryTimeout() != null ? options.retry().tryTimeout() : defaultProducerOptions.retry().tryTimeout(); return new EventHubProducer(producer, tryTimeout); }
Source:
public boolean rename(ByteArrayWrapper oldKey, ByteArrayWrapper newKey) { while (true) { if (!region.containsKey(oldKey)) { return false; } List<ByteArrayWrapper> keysToOperateOn = new ArrayList<>(); keysToOperateOn.add(oldKey); keysToOperateOn.add(newKey); return invoke(RenameFunction.ID, oldKey, oldKey, newKey, keysToOperateOn, new ArrayList<>(), new ArrayList<>()); } }

Target:
public boolean rename(ByteArrayWrapper oldKey, ByteArrayWrapper newKey) { if (!region.containsKey(oldKey)) { return false; } List<ByteArrayWrapper> keysToOperateOn = new ArrayList<>(); keysToOperateOn.add(oldKey); keysToOperateOn.add(newKey); return invoke(RenameFunction.ID, oldKey, oldKey, newKey, keysToOperateOn, new ArrayList<>(), new ArrayList<>()); }
Source:
public void write(Object datum) throws IOException { dataCount++; if (null == datum) { return; } if (null == factory) { factory = (IndexedRecordConverter<Object, ? extends IndexedRecord>) SalesforceAvroRegistry.get() .createIndexedRecordConverter(datum.getClass()); } IndexedRecord input = factory.convertToAvro(datum); OutputAction outputAction = sprops.outputAction.getValue(); LOGGER.info("Prepare to record {}.", outputAction.name().toLowerCase(), dataCount); switch (outputAction) { case INSERT: insert(input); break; case UPDATE: update(input); break; case UPSERT: upsert(input); break; case DELETE: delete(input); } }

Target:
public void write(Object datum) throws IOException { dataCount++; if (null == datum) { return; } if (null == factory) { factory = (IndexedRecordConverter<Object, ? extends IndexedRecord>) SalesforceAvroRegistry.get() .createIndexedRecordConverter(datum.getClass()); } IndexedRecord input = factory.convertToAvro(datum); Property<OutputAction> outputAction = sprops.outputAction; LOGGER.info(MESSAGES.getMessage("info.startMessage", sprops.outputAction.getPossibleValuesDisplayName(outputAction.getValue()).toLowerCase(), dataCount)); switch (outputAction.getValue()) { case INSERT: insert(input); break; case UPDATE: update(input); break; case UPSERT: upsert(input); break; case DELETE: delete(input); } }
Source:
private boolean checkDeviceSDK() { return android.os.Build.VERSION.SDK_INT >= MINIMUM_SDK_VERSION_OF_TESTING_DEVICE; }

Target:
private boolean checkDeviceSDK() { return android.os.Build.VERSION.SDK_INT == SDK_VERSION_OF_TESTING_DEVICE; }