auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static Throwable getRootCause(final Throwable throwable) { Throwable slowPointer = throwable; boolean advanceSlowPointer = false; Throwable parent = throwable; Throwable cause; while ((cause = parent.getCause()) != null) { parent = cause; if (parent == slowPointer) { throw new IllegalArgumentException("loop in causal chain"); } if (advanceSlowPointer) { slowPointer = slowPointer.getCause(); } advanceSlowPointer = !advanceSlowPointer; } return throwable; }

Target:
public static Throwable getRootCause(final Throwable throwable) { Throwable slowPointer = throwable; boolean advanceSlowPointer = false; Throwable parent = throwable; Throwable cause; while ((cause = parent.getCause()) != null) { parent = cause; if (parent == slowPointer) { throw new IllegalArgumentException("loop in causal chain"); } if (advanceSlowPointer) { slowPointer = slowPointer.getCause(); } advanceSlowPointer = !advanceSlowPointer; } return parent; }
Source:
private <A extends Annotation> void initializeValidator( ConstraintDescriptor<A> descriptor, ConstraintValidator<A, ?> constraintValidator, HibernateConstraintValidatorInitializationContext initializationContext) { try { if ( constraintValidator instanceof HibernateConstraintValidator ) { ( (HibernateConstraintValidator) constraintValidator ).initialize( descriptor, initializationContext ); } else { constraintValidator.initialize( descriptor.getAnnotation() ); } } catch (RuntimeException e) { if ( e instanceof ConstraintDeclarationException ) { throw e; } throw LOG.getUnableToInitializeConstraintValidatorException( constraintValidator.getClass(), e ); } }

Target:
private <A extends Annotation> void initializeValidator( ConstraintDescriptor<A> descriptor, ConstraintValidator<A, ?> constraintValidator, HibernateConstraintValidatorInitializationContext initializationContext) { try { if ( constraintValidator instanceof HibernateConstraintValidator ) { ( (HibernateConstraintValidator<A, ?>) constraintValidator ).initialize( descriptor, initializationContext ); } else { constraintValidator.initialize( descriptor.getAnnotation() ); } } catch (RuntimeException e) { if ( e instanceof ConstraintDeclarationException ) { throw e; } throw LOG.getUnableToInitializeConstraintValidatorException( constraintValidator.getClass(), e ); } }
Source:
public <OutType> Yielder<OutType> toYielder( OutType initValue, YieldingAccumulator<OutType, T> accumulator ) { final Yielder<OutType> baseYielder; try { baseYielder = baseSequence.toYielder(initValue, accumulator); } catch (RuntimeException e) { try { Closeables.close(closeable, true); } catch (IOException ioe) { throw Throwables.propagate(ioe); } throw e; } return new ResourceClosingYielder<OutType>(baseYielder, closeable); }

Target:
public <OutType> Yielder<OutType> toYielder( OutType initValue, YieldingAccumulator<OutType, T> accumulator ) { final Yielder<OutType> baseYielder; try { baseYielder = baseSequence.toYielder(initValue, accumulator); } catch (RuntimeException e) { CloseQuietly.close(closeable); throw e; } return new ResourceClosingYielder<OutType>(baseYielder, closeable); }
Source:
@Override public <T> T get(Object key, Callable<T> valueLoader) { Object val = cache.get(key); if (val == null) { try { val = valueLoader.call(); } catch (Exception ignored) { return null; } put(key, val); } return (T)val; }

Target:
@Override public <T> T get(Object key, Callable<T> valueLoader) { try { return cache.invoke(key, new ValueLoaderEntryProcessor<T>(), valueLoader); } catch (Exception e) { throw new ValueRetrievalException(key, valueLoader, e); } }
Source:
private void printDebugMessage( String message ) { if(GdbDebugOptions.DEBUG_COMMAND_TIMEOUTS) { if(!message.endsWith("\n")) { message = message + "\n"; } GdbDebugOptions.trace(String.format( "%s %s %s", GdbPlugin.getDebugTime(), TIMEOUT_TRACE_IDENTIFIER, message)); } }

Target:
private void printDebugMessage( String message ) { if(GdbDebugOptions.DEBUG_COMMAND_TIMEOUTS) { GdbDebugOptions.trace(String.format( "%s %s %s\n", GdbPlugin.getDebugTime(), TIMEOUT_TRACE_IDENTIFIER, message)); } }
Source:
public void testActionJoinIfPossibleAndNoTx() throws Exception { MuleTransactionConfig config = new MuleTransactionConfig(TransactionConfig.ACTION_JOIN_IF_POSSIBLE); ExecutionTemplate executionTemplate = createExecutionTemplate(config); Object result = executionTemplate.execute(getEmptyTransactionCallback()); assertThat(result, is(RETURN_VALUE)); assertThat(TransactionCoordination.getInstance().getTransaction(), IsNull.nullValue()); }

Target:
public void testActionJoinIfPossibleAndNoTx() throws Exception { MuleTransactionConfig config = new MuleTransactionConfig(ACTION_JOIN_IF_POSSIBLE); ExecutionTemplate executionTemplate = createExecutionTemplate(config); Object result = executionTemplate.execute(getEmptyTransactionCallback()); assertThat(result, is(RETURN_VALUE)); assertThat(getInstance().getTransaction(), nullValue()); }
Source:
public void testSeekToReadaheadAndRead() throws Throwable { describe("Seek to readahead limit and call InputStream.read(byte[])"); Path path = path("testSeekToReadaheadAndRead"); FileSystem fs = getFileSystem(); writeTestDataset(path); try (FSDataInputStream in = fs.open(path)) { readAtEndAndReturn(in); final byte[] temp = new byte[5]; int offset = READAHEAD - 1; in.seek(offset); int l = in.read(temp); assertTrue("Reading in temp data", l > 0); LOG.info("Read of byte array at offset returned bytes", offset, l); assertDatasetEquals(offset, "read at end of boundary", temp, l); } }

Target:
public void testSeekToReadaheadAndRead() throws Throwable { describe("Seek to just before readahead limit and call" + " InputStream.read(byte[])"); Path path = path("testSeekToReadaheadAndRead"); FileSystem fs = getFileSystem(); writeTestDataset(path); try (FSDataInputStream in = fs.open(path)) { readAtEndAndReturn(in); final byte[] temp = new byte[5]; int offset = READAHEAD - 1; in.seek(offset); int l = in.read(temp); assertTrue("Reading in temp data", l > 0); LOG.info("Read of byte array at offset returned bytes", offset, l); assertDatasetEquals(offset, "read at end of boundary", temp, l); } }
Source:
private void setRuleset(List<Process> processes) { if (isActionParameterInvalid("ruleset")) { return; } try { List<Ruleset> rulesets = serviceManager.getRulesetService() .getByQuery("from Ruleset where title='" + this.parameters.get("ruleset") + "'"); if (rulesets == null || rulesets.size() == 0) { Helper.setFehlerMeldung(KITODO_SCRIPT_FIELD, "Could not find ruleset: ", "ruleset"); return; } Ruleset ruleset = rulesets.get(0); for (Process process : processes) { process.setRuleset(ruleset); serviceManager.getProcessService().save(process); } } catch (Exception e) { Helper.setFehlerMeldung(e); logger.error(e.getMessage(), e); } }

Target:
private void setRuleset(List<Process> processes) { if (isActionParameterInvalid("ruleset")) { return; } try { List<Ruleset> rulesets = serviceManager.getRulesetService() .getByQuery("from Ruleset where title='" + this.parameters.get("ruleset") + "'"); if (rulesets == null || rulesets.size() == 0) { Helper.setFehlerMeldung(KITODO_SCRIPT_FIELD, "Could not find ruleset: ", "ruleset"); return; } Ruleset ruleset = rulesets.get(0); for (Process process : processes) { process.setRuleset(ruleset); serviceManager.getProcessService().save(process); } } catch (DataException | RuntimeException e) { Helper.setFehlerMeldung(e); logger.error(e.getMessage(), e); } }
Source:
public void testLoadPrivateKeyFromKeyStore() throws Exception { Optional<String> optPassword = x509TestContext.getKeyStorePassword().length() > 0 ? Optional.of(x509TestContext.getKeyStorePassword()) : Optional.empty(); PrivateKey privateKey = PemReader.loadPrivateKey( x509TestContext.getKeyStoreFile(KeyStoreFileType.PEM), optPassword); Assert.assertEquals(x509TestContext.getKeyStoreKeyPair().getPrivate(), privateKey); }

Target:
public void testLoadPrivateKeyFromKeyStore() throws IOException, GeneralSecurityException { Optional<String> optPassword = x509TestContext.getKeyStorePassword().length() > 0 ? Optional.of(x509TestContext.getKeyStorePassword()) : Optional.empty(); PrivateKey privateKey = PemReader.loadPrivateKey(x509TestContext.getKeyStoreFile(KeyStoreFileType.PEM), optPassword); assertEquals(x509TestContext.getKeyStoreKeyPair().getPrivate(), privateKey); }
Source:
public void createFileTypes(@NotNull FileTypeConsumer fileTypeConsumer) { fileTypeConsumer.consume(ElixirFileType.INSTANCE, "ex"); fileTypeConsumer.consume(ElixirFileType.SCRIPT, "exs"); }

Target:
public void createFileTypes(@NotNull FileTypeConsumer fileTypeConsumer) { fileTypeConsumer.consume(ElixirFileType.INSTANCE, ElixirFileType.INSTANCE.getDefaultExtension()); fileTypeConsumer.consume(ElixirFileType.SCRIPT, ElixirFileType.SCRIPT.getDefaultExtension()); }
Source:
public <PT> void addProperty (ConfigurationProperty<PT> property, List<String> path) { _properties.add(property); _pathsByPropertyUUID.put( property.getUUID(), path ); }

Target:
public <PT> void addProperty (ConfigurationProperty<PT> property, List<String> path) { _properties.add(property); _pathsByProperty.put( property, path ); }
Source:
protected VmPool deprecatedPopulate(VmPool model, org.ovirt.engine.core.common.businessentities.VmPool entity) { if (model.isSetSize() && model.getSize() > 0) { VM vm = getVM(model); model.setTemplate(new Template()); model.getTemplate().setId(vm.getVmtGuid().toString()); model = getMapper(VM.class, VmPool.class).map(vm, model); DisplayHelper.adjustDisplayData(this, model.getVm()); if (vm.getInstanceTypeId() != null) { model.setInstanceType(new org.ovirt.engine.api.model.InstanceType()); model.getInstanceType().setId(vm.getInstanceTypeId().toString()); } } return model; }

Target:
protected VmPool deprecatedPopulate(VmPool model, org.ovirt.engine.core.common.businessentities.VmPool entity) { if (model.isSetSize() && model.getSize() > 0) { VM vm = getVM(model); model.setTemplate(new Template()); model.getTemplate().setId(vm.getVmtGuid().toString()); model = getMapper(VM.class, VmPool.class).map(vm, model); DisplayHelper.adjustDisplayData(this, model.getVm()); if (vm.getInstanceTypeId() != null) { model.setInstanceType(new InstanceType()); model.getInstanceType().setId(vm.getInstanceTypeId().toString()); } } return model; }
Source:
public void call(final Subscriber<? super T> subscriber) { try { final Resource resource = resourceFactory.call(); final DisposeAction<Resource> disposeOnceOnly = new DisposeAction<Resource>(dispose, resource); subscriber.add(disposeOnceOnly); final Observable<? extends T> source = observableFactory .call(resource); final Observable<? extends T> observable; if (disposeEagerly) observable = source .doOnTerminate(disposeOnceOnly); else observable = source; try { observable.unsafeSubscribe(Subscribers.from(subscriber)); } catch (Throwable e) { Throwable disposeError = disposeEagerlyIfRequested(disposeOnceOnly); if (disposeError != null) subscriber.onError(new CompositeException(Arrays.asList(e, disposeError))); else subscriber.onError(e); } } catch (Throwable e) { subscriber.onError(e); } }

Target:
public void call(final Subscriber<? super T> subscriber) { try { final Resource resource = resourceFactory.call(); final DisposeAction<Resource> disposeOnceOnly = new DisposeAction<Resource>(dispose, resource); subscriber.add(disposeOnceOnly); final Observable<? extends T> source = observableFactory .call(resource); final Observable<? extends T> observable; if (disposeEagerly) observable = source .doOnTerminate(disposeOnceOnly); else observable = source; try { observable.unsafeSubscribe(Subscribers.wrap(subscriber)); } catch (Throwable e) { Throwable disposeError = disposeEagerlyIfRequested(disposeOnceOnly); if (disposeError != null) subscriber.onError(new CompositeException(Arrays.asList(e, disposeError))); else subscriber.onError(e); } } catch (Throwable e) { subscriber.onError(e); } }
Source:
public void onResume() { super.onResume(); if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) { editTextNewComment.post(new Runnable() { @Override public void run() { editTextNewComment.clearFocus(); } }); } }

Target:
public void onResume() { super.onResume(); if (getResources().getConfiguration().orientation == Configuration.ORIENTATION_LANDSCAPE) { SoftKeyboardUtil.clearViewFocus(editTextNewComment); } }
Source:
public static void main(String[] args) throws Exception { final Display display = new Display(); Shell shell = new Shell(display); shell.setSize(400, 600); shell.setLayout(new FillLayout()); shell.setText("ExpandBar Bug"); expandBar(shell); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose(); }

Target:
public static void main(String[] args) { final Display display = new Display(); Shell shell = new Shell(display); shell.setSize(400, 600); shell.setLayout(new FillLayout()); shell.setText("ExpandBar Bug"); expandBar(shell); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) display.sleep(); } display.dispose(); }
Source:
private void onChunkOperationComplete(GetChunk chunk) { if (chunk.getChunkException() != null) { setOperationException(chunk.getChunkException()); } if (chunk == firstChunk) { if (operationCallbackInvoked.compareAndSet(false, true)) { long timeElapsed = time.milliseconds() - submissionTimeMs; routerMetrics.getBlobOperationLatencyMs.update(timeElapsed); if (hasRange) { routerMetrics.getBlobWithRangeOperationLatencyMs.update(timeElapsed); } Exception e = getOperationException(); getBlobResult = e == null ? new GetBlobResult() : null; if (e != null) { routerMetrics.onGetBlobError(e, options); } operationCompleteCallback.completeOperation(operationFuture, operationCallback, getBlobResult, e); } } chunk.postCompletionCleanup(); if (getBlobResult != null) { getBlobResult.maybeWriteToChannel(); } }

Target:
private void onChunkOperationComplete(GetChunk chunk) { if (chunk.getChunkException() != null) { setOperationException(chunk.getChunkException()); } if (chunk == firstChunk) { if (operationCallbackInvoked.compareAndSet(false, true)) { long timeElapsed = time.milliseconds() - submissionTimeMs; routerMetrics.getBlobOperationLatencyMs.update(timeElapsed); Exception e = getOperationException(); getBlobResult = e == null ? new GetBlobResult() : null; if (e != null) { routerMetrics.onGetBlobError(e, options); } operationCompleteCallback.completeOperation(operationFuture, operationCallback, getBlobResult, e); } } chunk.postCompletionCleanup(); if (getBlobResult != null) { getBlobResult.maybeWriteToChannel(); } }
Source:
public BuiltInFunctionSymbolicValue(Constraint returnedValueConstraint, IntFunction<Constraint> signature) { this.returnedValueConstraint = returnedValueConstraint; this.signature = signature; this.argumentsConstrainer = null; }

Target:
public BuiltInFunctionSymbolicValue(Constraint returnedValueConstraint, IntFunction<Constraint> signature) { this(returnedValueConstraint, null, signature); }
Source:
protected void doSetSelection(ISelection selection) { if (!selection.isEmpty() && selection instanceof StructuredSelection) { Object selected = ((StructuredSelection) selection) .getFirstElement(); if (selected instanceof FileDiffRegion) { FileDiffRegion newRange = (FileDiffRegion) selected; if (!newRange.equals(currentFileDiffRange)) { currentFileDiffRange = newRange; selectAndReveal(newRange.getOffset(), 0); } return; } } super.doSetSelection(selection); }

Target:
protected void doSetSelection(ISelection selection) { if (!selection.isEmpty() && selection instanceof StructuredSelection) { Object selected = ((StructuredSelection) selection) .getFirstElement(); if (selected instanceof FileDiffRegion) { FileDiffRegion newRange = (FileDiffRegion) selected; if (!newRange.equals(currentFileDiffRange)) { currentFileDiffRange = newRange; selectAndReveal(newRange.getOffset(), 0); if (outlinePage != null) { outlinePage.setSelection( new StructuredSelection(selected)); } } return; } } super.doSetSelection(selection); }
Source:
public void onBindViewHolder(TranslationViewHolder holder, int position) { TranslationRowData rowItem = mTranslations.get(position); switch (holder.getItemViewType()) { case R.layout.translation_row: TranslationItem item = (TranslationItem) rowItem; holder.getTranslationTitle().setText(item.name()); if (isEmpty(item.translation.translatorNameLocalized)) { holder.getTranslationInfo().setText(item.translation.translator); } else { holder.getTranslationInfo().setText(item.translation.translatorNameLocalized); } if (item.exists()) { if (item.needsUpgrade()) { holder.getLeftImage().setImageResource(R.drawable.ic_download); holder.getLeftImage().setVisibility(View.VISIBLE); holder.getTranslationInfo().setText(R.string.update_available); } else { holder.getLeftImage().setVisibility(View.GONE); } holder.getRightImage().setImageResource(R.drawable.ic_cancel); holder.getRightImage().setVisibility(View.VISIBLE); holder.getRightImage().setContentDescription(context.getString(R.string.remove_button)); holder.itemView.setOnClickListener(v -> onClickRemoveSubject.onNext(item)); } else { holder.getLeftImage().setVisibility(View.GONE); holder.getRightImage().setImageResource(R.drawable.ic_download); holder.getRightImage().setVisibility(View.VISIBLE); holder.getRightImage().setOnClickListener(null); holder.getRightImage().setClickable(false); holder.getRightImage().setContentDescription(null); holder.itemView.setOnClickListener(v -> onClickDownloadSubject.onNext(item)); } break; case R.layout.translation_sep: holder.getSeparatorText().setText(rowItem.name()); break; } }

Target:
public void onBindViewHolder(TranslationViewHolder holder, int position) { TranslationRowData rowItem = mTranslations.get(position); switch (holder.getItemViewType()) { case R.layout.translation_row: TranslationItem item = (TranslationItem) rowItem; holder.getTranslationTitle().setText(item.name()); if (TextUtils.isEmpty(item.translation.translatorNameLocalized)) { holder.getTranslationInfo().setText(item.translation.translator); } else { holder.getTranslationInfo().setText(item.translation.translatorNameLocalized); } ImageView leftImage = holder.getLeftImage(); ImageView rightImage = holder.getRightImage(); if (item.exists()) { if (item.needsUpgrade()) { leftImage.setImageResource(R.drawable.ic_download); leftImage.setVisibility(View.VISIBLE); holder.getTranslationInfo().setText(R.string.update_available); } else { leftImage.setVisibility(View.GONE); } rightImage.setImageResource(R.drawable.ic_cancel); rightImage.setVisibility(View.VISIBLE); rightImage.setContentDescription(context.getString(R.string.remove_button)); holder.itemView.setOnClickListener(v -> onClickRemoveSubject.onNext(item)); } else { leftImage.setVisibility(View.GONE); rightImage.setImageResource(R.drawable.ic_download); rightImage.setVisibility(View.VISIBLE); rightImage.setOnClickListener(null); rightImage.setClickable(false); rightImage.setContentDescription(null); holder.itemView.setOnClickListener(v -> onClickDownloadSubject.onNext(item)); } break; case R.layout.translation_sep: holder.getSeparatorText().setText(rowItem.name()); break; } }
Source:
public void remove(final String name) { try { new JdkRequest(UriBuilder.fromUri(this.home).build()) .header(HttpHeaders.ACCEPT, MediaType.APPLICATION_XML) .header(HttpHeaders.AUTHORIZATION, this.token) .method(Request.GET) .fetch() .as(RestResponse.class) .assertStatus(HttpURLConnection.HTTP_OK) .as(XmlResponse.class) .rel( String.format( "/page/rules/rule[name='%s']/links/link[@rel='remove']/@href", name ) ) .method(Request.GET) .fetch() .as(RestResponse.class) .assertStatus(HttpURLConnection.HTTP_OK); } catch (IOException ex) { throw new IllegalStateException(ex); } }

Target:
public void remove(final String name) { try { new JdkRequest(this.home) .header(HttpHeaders.ACCEPT, MediaType.APPLICATION_XML) .header(HttpHeaders.AUTHORIZATION, this.token) .fetch() .as(RestResponse.class) .assertStatus(HttpURLConnection.HTTP_OK) .as(XmlResponse.class) .rel( String.format( "/page/rules/rule[name='%s']/links/link[@rel='remove']/@href", name ) ) .fetch() .as(RestResponse.class) .assertStatus(HttpURLConnection.HTTP_OK); } catch (IOException ex) { throw new IllegalStateException(ex); } }
Source:
protected void executeCommand() { String connectionId = getConnection().getid(); getStorageServerConnectionDao().remove(connectionId); log.debugFormat("Removing connection %s from database ", connectionId); if (Guid.isNullOrEmpty(getParameters().getVdsId())) { log.debug("No vdsId passed - hosts will not be disconnected."); } else { disconnectStorage(); } setSucceeded(true); }

Target:
protected void executeCommand() { String connectionId = getConnection().getid(); getStorageServerConnectionDao().remove(connectionId); log.debugFormat("Removing connection {0} from database ", connectionId); if (Guid.isNullOrEmpty(getParameters().getVdsId())) { log.debug("No vdsId passed - hosts will not be disconnected."); } else { disconnectStorage(); } setSucceeded(true); }
Source:
public void _diff(diffOptions options) throws UnsupportedEncodingException, IOException, Exception { List<String> args = options._arguments(); String newer = args.remove(0); String older = args.size() > 0 ? args.remove(0) : null; RepositoryPlugin rnewer = findRepo(newer); RepositoryPlugin rolder = older == null ? null : findRepo(older); if (rnewer == null) { bnd.messages.NoSuchRepository_(newer); return; } if (older != null && rolder == null) { bnd.messages.NoSuchRepository_(newer); return; } PrintWriter pw = IO.writer(bnd.out, UTF_8); Tree tNewer = RepositoryElement.getTree(rnewer); if (rolder == null) { if (options.json()) codec.enc() .to(pw) .put(tNewer.serialize()) .flush(); else DiffCommand.show(pw, tNewer, 0); } else { Tree tOlder = RepositoryElement.getTree(rolder); Diff diff = new DiffImpl(tNewer, tOlder); MultiMap<String, String> map = new MultiMap<>(); for (Diff bsn : diff.getChildren()) { for (Diff version : bsn.getChildren()) { if (version.getDelta() == Delta.UNCHANGED) continue; if (options.remove() == false && options.added() == false || (options.remove() && version.getDelta() == Delta.REMOVED) || (options.added() && version.getDelta() == Delta.ADDED)) { map.add(bsn.getName(), version.getName()); } } } if (options.json()) codec.enc() .to(pw) .put(map) .flush(); else if (!options.diff()) MultiMap.format(map); else DiffCommand.show(pw, diff, 0, !options.full()); } pw.flush(); }

Target:
public void _diff(diffOptions options) throws UnsupportedEncodingException, IOException, Exception { List<String> args = options._arguments(); String newer = args.remove(0); String older = args.size() > 0 ? args.remove(0) : null; RepositoryPlugin rnewer = findRepo(newer); RepositoryPlugin rolder = older == null ? null : findRepo(older); if (rnewer == null) { bnd.messages.NoSuchRepository_(newer); return; } if (older != null && rolder == null) { bnd.messages.NoSuchRepository_(newer); return; } PrintWriter pw = IO.writer(bnd.out, UTF_8); Tree tNewer = RepositoryElement.getTree(rnewer); if (rolder == null) { if (options.json()) codec.enc() .to(pw) .put(tNewer.serialize()) .flush(); else DiffCommand.show(pw, tNewer, 0); } else { Tree tOlder = RepositoryElement.getTree(rolder); Diff diff = new DiffImpl(tNewer, tOlder); MultiMap<String, String> map = new MultiMap<>(); for (Diff bsn : diff.getChildren()) { for (Diff version : bsn.getChildren()) { if (version.getDelta() == Delta.UNCHANGED) continue; if (options.remove() == false && options.added() == false || (options.remove() && version.getDelta() == Delta.REMOVED) || (options.added() && version.getDelta() == Delta.ADDED)) { map.add(bsn.getName(), version.getName()); } } } if (options.json()) codec.enc() .to(pw) .put(map) .flush(); else if (!options.diff()) bnd.out.println(MultiMap.format(map)); else DiffCommand.show(pw, diff, 0, !options.full()); } pw.flush(); }
Source:
public String toStringShort() { return MoreObjects.toStringHelper("Channel") .add("ClientType", getStringFromOptional(mClientType)) .add("ServerAddress", mServerAddress) .add("ChannelId", mChannelId) .omitNullValues() .toString(); }

Target:
public String toStringShort() { return MoreObjects.toStringHelper("Channel") .add("ClientType", getStringFromOptional(mClientType)) .add("ClientHostname", mLocalHostName) .add("ServerAddress", mServerAddress) .add("ChannelId", mChannelId) .omitNullValues() .toString(); }
Source:
public void reconfigure(Object... updatedPolicyParameters) { this.timer.cancel(); setCheckNodeStateEach(updatedPolicyParameters); this.scheduleRestartTimer(); }

Target:
public void reconfigure(Object... updatedPolicyParameters) { super.reconfigure(updatedPolicyParameters); this.timer.cancel(); setCheckNodeStateEach(updatedPolicyParameters); this.scheduleRestartTimer(); }
Source:
public void testLongIdDomainPartition() { Mono<Void> deletedMono = this.repository.deleteAll(); StepVerifier.create(deletedMono).thenAwait().verifyComplete(); Mono<LongIdDomainPartition> idMono = this.repository.findById(ID_1, new PartitionKey(entityInformation.getPartitionKeyFieldValue(DOMAIN_1))); StepVerifier.create(idMono).verifyComplete(); Mono<LongIdDomainPartition> saveMono = this.repository.save(DOMAIN_1); StepVerifier.create(saveMono).thenConsumeWhile(domain -> true).expectComplete().verify(); Mono<LongIdDomainPartition> findIdMono = this.repository.findById(ID_1, new PartitionKey(entityInformation.getPartitionKeyFieldValue(DOMAIN_1))); StepVerifier.create(findIdMono).expectNext(DOMAIN_1).expectComplete().verify(); Mono<Void> deleteMono = this.repository.delete(DOMAIN_1); StepVerifier.create(deleteMono).verifyComplete(); Mono<LongIdDomainPartition> afterDelIdMono = this.repository.findById(ID_1, new PartitionKey(entityInformation.getPartitionKeyFieldValue(DOMAIN_1))); StepVerifier.create(afterDelIdMono).verifyComplete(); }

Target:
public void testLongIdDomainPartition() { Mono<Void> deletedMono = this.repository.deleteAll(); StepVerifier.create(deletedMono).thenAwait().verifyComplete(); Mono<LongIdDomainPartition> idMono = this.repository.findById(ID_1, new PartitionKey(entityInformation.getPartitionKeyFieldValue(DOMAIN_1))); StepVerifier.create(idMono).expectNextCount(0).verifyComplete(); Mono<LongIdDomainPartition> saveMono = this.repository.save(DOMAIN_1); StepVerifier.create(saveMono).expectNext(DOMAIN_1).expectComplete().verify(); Mono<LongIdDomainPartition> findIdMono = this.repository.findById(ID_1, new PartitionKey(entityInformation.getPartitionKeyFieldValue(DOMAIN_1))); StepVerifier.create(findIdMono).expectNext(DOMAIN_1).expectComplete().verify(); Mono<Void> deleteMono = this.repository.delete(DOMAIN_1); StepVerifier.create(deleteMono).verifyComplete(); Mono<LongIdDomainPartition> afterDelIdMono = this.repository.findById(ID_1, new PartitionKey(entityInformation.getPartitionKeyFieldValue(DOMAIN_1))); StepVerifier.create(afterDelIdMono).expectNextCount(0).verifyComplete(); }
Source:
public ResponseEntity<?> getTicketTokensOpenForTransfer(Authentication auth) { UserDetails currentUser = (UserDetails) auth.getPrincipal(); Collection<TicketTransferToken> tokens = ticketService.getTicketTransferTokensByUser(currentUser.getUsername()); return createResponseEntity(HttpStatus.OK, "Ticket transfer tokens successfully retrieved", tokens); }

Target:
public ResponseEntity<?> getTicketTokensOpenForTransfer(Authentication auth) { UserDetails currentUser = (UserDetails) auth.getPrincipal(); Collection<TicketTransferToken> tokens = ticketService.getValidTicketTransferTokensByUser(currentUser.getUsername()); return createResponseEntity(HttpStatus.OK, "Ticket transfer tokens successfully retrieved.", tokens); }
Source:
String getConstraintType() { final ConstraintType constraintType = presenter.getConstraintType(); if (constraintType == null) { return presenter.inferComponentType(presenter.getConstraintValue()).value(); } else { return constraintType.toString(); } }

Target:
private String getConstraintType() { if (presenter.getConstraintType() == null) { return presenter.inferComponentType(presenter.getConstraintValue()).value(); } else { return presenter.getConstraintType().toString(); } }
Source:
private void writeVideo(VmDevice device) { writer.writeStartElement("video"); writer.writeStartElement("model"); writer.writeAttributeString("type", device.getDevice()); if (device.getSpecParams() != null) { Object vram = device.getSpecParams().get(VdsProperties.VIDEO_VRAM); writer.writeAttributeString("vram", vram != null ? vram.toString() : "32768"); Object heads = device.getSpecParams().get(VdsProperties.VIDEO_HEADS); writer.writeAttributeString("heads", heads != null ? heads.toString() : "1"); if (device.getSpecParams().containsKey(VdsProperties.VIDEO_RAM)) { writer.writeAttributeString("ram", device.getSpecParams().get(VdsProperties.VIDEO_RAM).toString()); } if (device.getSpecParams().containsKey(VdsProperties.VIDEO_VGAMEM)) { writer.writeAttributeString("vgamem", device.getSpecParams().get(VdsProperties.VIDEO_VGAMEM).toString()); } } writer.writeEndElement(); writeAddress(device); writer.writeEndElement(); }

Target:
private void writeVideo(VmDevice device) { writer.writeStartElement("video"); writer.writeStartElement("model"); writer.writeAttributeString("type", device.getDevice()); Object vram = device.getSpecParams().get(VdsProperties.VIDEO_VRAM); writer.writeAttributeString("vram", vram != null ? vram.toString() : "32768"); Object heads = device.getSpecParams().get(VdsProperties.VIDEO_HEADS); writer.writeAttributeString("heads", heads != null ? heads.toString() : "1"); if (device.getSpecParams().containsKey(VdsProperties.VIDEO_RAM)) { writer.writeAttributeString("ram", device.getSpecParams().get(VdsProperties.VIDEO_RAM).toString()); } if (device.getSpecParams().containsKey(VdsProperties.VIDEO_VGAMEM)) { writer.writeAttributeString("vgamem", device.getSpecParams().get(VdsProperties.VIDEO_VGAMEM).toString()); } writer.writeEndElement(); writeAddress(device); writer.writeEndElement(); }
Source:
private static void writeValueToFile(String value, String filename) throws IOException { if (TextUtils.isEmpty(value)) { return; } BufferedWriter writer = null; try { String path = Constants.FILES_PATH + "/" + filename; if (!TextUtils.isEmpty(value) && TextUtils.getTrimmedLength(value) > 0) { writer = new BufferedWriter(new FileWriter(path)); writer.write(value); writer.flush(); } } catch (IOException e) { e.printStackTrace(); } finally { if (writer != null) { writer.close(); } } }

Target:
private static void writeValueToFile(String value, String filename) throws IOException { if (TextUtils.isEmpty(value)) { return; } BufferedWriter writer = null; try { String path = Constants.FILES_PATH + "/" + filename; if (!TextUtils.isEmpty(value) && TextUtils.getTrimmedLength(value) > 0) { writer = new BufferedWriter(new FileWriter(path)); writer.write(value); writer.flush(); } } catch (IOException e) { HockeyLog.error("Failed to write value to " + filename, e); } finally { if (writer != null) { writer.close(); } } }
Source:
private void logLicensingInfo() { String type = getLicenseType(); SimpleDateFormat formatter = new SimpleDateFormat(); hostLog.info("LICENSE INFORMATION: " + type + " license issued by VoltDB to " + m_licenseApi.licensee() + " on " + formatter.format(m_licenseApi.issued())); hostLog.info("LICENSE KEY: " + m_licenseApi.signature()); hostLog.info("LICENSE EXPIRES: " + formatter.format(m_licenseApi.expires())); hostLog.info("LICENSE CONSTRAINTS: " + m_licenseApi.maxHostcount() + " nodes"); hostLog.info("LICENCE FEATURES: " + "commandLoggingEnabled=" + m_licenseApi.isCommandLoggingAllowed() + ", activeActiveDREnabled=" + m_licenseApi.isDrActiveActiveAllowed() + ", isDatabaseReplicationAllowed=" + m_licenseApi.isDrReplicationAllowed()); }

Target:
private void logLicensingInfo() { SimpleDateFormat sdf = new SimpleDateFormat("EEE MMM d, yyyy"); hostLog.info("LICENSE INFORMATION: " + m_licenseApi.getLicenseType() + " license issued by VoltDB to " + m_licenseApi.licensee() + " on " + sdf.format(m_licenseApi.issued().getTime())); hostLog.info("LICENSE KEY: " + m_licenseApi.getSignature()); hostLog.info("LICENSE EXPIRES: " + sdf.format(m_licenseApi.expires().getTime())); hostLog.info("LICENSE CONSTRAINTS: " + m_licenseApi.maxHostcount() + " nodes"); if(m_licenseApi.isUnrestricted()) { hostLog.info("LICENSE FEATURES: Unrestricted"); } else { hostLog.info("LICENSE FEATURES: " + "commandLoggingEnabled=" + m_licenseApi.isCommandLoggingAllowed() + ", activeActiveDREnabled=" + m_licenseApi.isDrActiveActiveAllowed() + ", isDatabaseReplicationAllowed=" + m_licenseApi.isDrReplicationAllowed()); } }
Source:
public Streamlet<R> setName(String sName) { if (sName == null) { throw new IllegalArgumentException("Streamlet name cannot be null"); } this.name = sName; return this; }

Target:
public Streamlet<R> setName(String sName) { if (sName == null || sName.isEmpty()) { throw new IllegalArgumentException("Streamlet name cannot be null/empty"); } this.name = sName; return this; }
Source:
public Response deletePolicy(@PathParam("tenant") String tenant, @PathParam("subject") String subject, @PathParam("policyId") String policyId) { String id = URLEncoding.decode(policyId); LOGGER.debug("Removing policy with id [" + policyId + "] for [" + tenant + "] and subject [" + subject + "]"); Policy p = dao.loadPolicy(tenant, subject, id); if (p != null) { dao.deletePolicy(p); return Response.ok(p.getPolicy()).build(); } else { return Response.status(404).build(); } }

Target:
public Response deletePolicy(@PathParam("tenant") String tenant, @PathParam("subject") String subject, @PathParam("policyId") String policyId) { String id = URLEncoding.decode(policyId); LOGGER.debug("Removing policy with id for and subject [{}]", policyId, tenant, subject); Policy p = dao.loadPolicy(tenant, subject, id); if (p != null) { dao.deletePolicy(p); return Response.ok(p.getPolicy()).build(); } else { return Response.status(404).build(); } }
Source:
public static long getDirectorySize(Path path, FileSystem fs) throws IOException { return getDirectorySize(path, fs, PathFilters.ACCEPT_ALL_PATHS_FILTER); }

Target:
public static long getDirectorySize(Path path, FileSystem fs) throws IOException { ContentSummary cs = fs.getContentSummary(path); return cs.getLength(); }
Source:
public void testDistinctCountWithOtherAggregationGroupByPushdown() { Map<String, String> outputVariables = ImmutableMap.of("agg", "count(*)", "count(regionid)", "DISTINCTCOUNT(regionId)"); PlanNode justScan = buildPlan(planBuilder -> tableScan(planBuilder, pinotTable, regionId, secondsSinceEpoch, city, fare)); PlanNode markDistinct = buildPlan(planBuilder -> markDistinct(planBuilder, v("regionid$distinct"), ImmutableList.of(v("regionid")), justScan)); testPQL( new PinotConfig().setAllowMultipleAggregations(true), planBuilder -> planBuilder.aggregation(aggBuilder -> aggBuilder.source(markDistinct).singleGroupingSet(v("city")).addAggregation(planBuilder.variable("agg"), getRowExpression("count(*)", defaultSessionHolder)).addAggregation(planBuilder.variable("count(regionid)"), getRowExpression("count(regionid)", defaultSessionHolder), Optional.empty(), Optional.empty(), false, Optional.of(v("regionid$distinct")))), "SELECT __expressions__ FROM realtimeOnly GROUP BY city TOP 10000", defaultSessionHolder, outputVariables); }

Target:
public void testDistinctCountWithOtherAggregationGroupByPushdown() { PlanNode justScan = buildPlan(planBuilder -> tableScan(planBuilder, pinotTable, regionId, secondsSinceEpoch, city, fare)); PlanNode markDistinct = buildPlan(planBuilder -> markDistinct(planBuilder, variable("regionid$distinct"), ImmutableList.of(variable("regionid")), justScan)); PlanNode aggregate = buildPlan(planBuilder -> planBuilder.aggregation(aggBuilder -> aggBuilder.source(markDistinct).singleGroupingSet(variable("city")).addAggregation(planBuilder.variable("agg"), getRowExpression("count(*)", defaultSessionHolder)).addAggregation(planBuilder.variable("count(regionid)"), getRowExpression("count(regionid)", defaultSessionHolder), Optional.empty(), Optional.empty(), false, Optional.of(variable("regionid$distinct"))))); String expectedPQL; if (aggregate.getOutputVariables().get(1).getName().equalsIgnoreCase("count(regionid)")) { expectedPQL = "SELECT DISTINCTCOUNT(regionId), count(*) FROM realtimeOnly GROUP BY city TOP 10000"; } else { expectedPQL = "SELECT count(*), DISTINCTCOUNT(regionId) FROM realtimeOnly GROUP BY city TOP 10000"; } testPQL(new PinotConfig().setAllowMultipleAggregations(true), aggregate, expectedPQL); }
Source:
private WebElement getMinOptionsToBeRankedCheckbox(int qnNumber) { if ("RANK_OPTIONS".equals(getQuestionType(qnNumber))) { return browser.driver.findElement(By.id("minOptionsToBeRankedEnabled-" + qnNumber)); } return browser.driver.findElement(By.id("minRecipientsToBeRankedEnabled-" + qnNumber)); }

Target:
private WebElement getMinOptionsToBeRankedCheckbox(int qnNumber) { if (isRankOptionsQuestion(qnNumber)) { return browser.driver.findElement(By.id("minOptionsToBeRankedEnabled-" + qnNumber)); } return browser.driver.findElement(By.id("minRecipientsToBeRankedEnabled-" + qnNumber)); }
Source:
public void testPrintXpathOption() throws Exception { final String expected = addEndOfLine( "CLASS_DEF -> CLASS_DEF [3:0]", "`--OBJBLOCK -> OBJBLOCK [3:28]", " |--METHOD_DEF -> METHOD_DEF [4:4]", " | `--SLIST -> { [4:20]", " | |--VARIABLE_DEF -> VARIABLE_DEF [5:8]", " | | |--IDENT -> a [5:12]"); exit.checkAssertionAfterwards(() -> { assertEquals("Unexpected output log", expected, systemOut.getLog()); assertEquals("Unexpected system error log", "", systemErr.getLog()); }); Main.main("-b", "/CLASS_DEF getPath("InputMainXPath.java")); }

Target:
public void testPrintXpathOption() throws Exception { final String expected = addEndOfLine( "CLASS_DEF -> CLASS_DEF [3:0]", "`--OBJBLOCK -> OBJBLOCK [3:28]", " |--METHOD_DEF -> METHOD_DEF [4:4]", " | `--SLIST -> { [4:20]", " | |--VARIABLE_DEF -> VARIABLE_DEF [5:8]", " | | |--IDENT -> a [5:12]"); exit.checkAssertionAfterwards(() -> { Assert.assertThat("Unexpected output log", systemOut.getLog(), is(expected)); Assert.assertThat("Unexpected system error log", systemErr.getLog(), is("")); }); Main.main("-b", "/CLASS_DEF getPath("InputMainXPath.java")); }
Source:
public static ClickType getClickType(int mode, int button, int slot) { switch (mode) { case 0: if (button == 0) { return slot == -1 ? ClickType.WINDOW_BORDER_LEFT : ClickType.LEFT; } else if (button == 1) { return slot == -1 ? ClickType.WINDOW_BORDER_RIGHT : ClickType.RIGHT; } break; case 1: if (button == 0) { return ClickType.SHIFT_LEFT; } else if (button == 1) { return ClickType.SHIFT_RIGHT; } break; case 2: return ClickType.NUMBER_KEY; case 3: if (button == 2) { return ClickType.MIDDLE; } break; case 4: if (button == 0) { return ClickType.DROP; } else if (button == 1) { return ClickType.CONTROL_DROP; } break; case 6: return ClickType.DOUBLE_CLICK; case 5: default: return ClickType.UNKNOWN; } return ClickType.UNKNOWN; }

Target:
public static ClickType getClickType(int mode, int button, int slot) { switch (mode) { case 0: if (button == 0) { return slot == -1 ? ClickType.WINDOW_BORDER_LEFT : ClickType.LEFT; } else if (button == 1) { return slot == -1 ? ClickType.WINDOW_BORDER_RIGHT : ClickType.RIGHT; } break; case 1: if (button == 0) { return ClickType.SHIFT_LEFT; } else if (button == 1) { return ClickType.SHIFT_RIGHT; } break; case 2: return ClickType.NUMBER_KEY; case 3: if (button == 2) { return ClickType.MIDDLE; } break; case 4: if (button == 0) { return ClickType.DROP; } else if (button == 1) { return ClickType.CONTROL_DROP; } break; case 5: break; case 6: return ClickType.DOUBLE_CLICK; default: return ClickType.UNKNOWN; } return ClickType.UNKNOWN; }
Source:
private Logger(){ setLayout(new BorderLayout()); list = new JList<>(); JScrollPane pane = new JScrollPane(list); add(pane, BorderLayout.CENTER); JButton button = new JButton("Clear Logger"); button.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { clearLogger(); addMessage("Logger cleared", false); } }); add(button, BorderLayout.SOUTH); list.setCellRenderer(getRenderer()); model = new DefaultListModel<>(); list.setModel(model); setPreferredSize(new Dimension((int) GamePanel.getInstance().getPreferredSize().getWidth(), 150)); model.addElement("Logger started"); setVisible(false); }

Target:
private Logger(){ setLayout(new BorderLayout()); list = new JList<>(); JScrollPane pane = new JScrollPane(list); add(pane, BorderLayout.CENTER); JButton button = new JButton("Clear Logger"); button.addActionListener(new ActionListener() { @Override public void actionPerformed(ActionEvent e) { clearLogger(); addMessage("Logger started", false); } }); add(button, BorderLayout.SOUTH); list.setCellRenderer(getRenderer()); model = new DefaultListModel<>(); list.setModel(model); setPreferredSize(new Dimension((int) GamePanel.getInstance().getPreferredSize().getWidth(), 150)); model.addElement("Logger started"); setVisible(false); }
Source:
public long countStudiesByGid(final int gid) throws MiddlewareQueryException { try { final SQLQuery query = this.getSession() .createSQLQuery("select count(distinct p.project_id) " + "FROM stock s " + "LEFT JOIN nd_experiment_stock es ON s.stock_id = es.stock_id " + "LEFT JOIN nd_experiment e on es.nd_experiment_id = e.nd_experiment_id " + "LEFT JOIN nd_experiment_project ep ON ep.nd_experiment_id = e.nd_experiment_id " + "LEFT JOIN project_relationship pr ON pr.subject_project_id = ep.project_id " + "LEFT JOIN project p ON pr.object_project_id = p.project_id " + "WHERE s.dbxref_id = " + gid + " AND p.project_id NOT IN (SELECT pp.project_id FROM projectprop pp WHERE pp.variable_id = " + TermId.STUDY_STATUS.getId() + " AND pp.value = " + TermId.DELETED_STUDY.getId() + ")"); return ((BigInteger) query.uniqueResult()).longValue(); } catch (final HibernateException e) { throw new MiddlewareQueryException("Error in countStudiesByGid=" + gid + " in StockDao: " + e.getMessage(), e); } }

Target:
public long countStudiesByGid(final int gid) { try { final SQLQuery query = this.getSession() .createSQLQuery("select count(distinct p.project_id) " + "FROM stock s " + "LEFT JOIN nd_experiment_stock es ON s.stock_id = es.stock_id " + "LEFT JOIN nd_experiment e on es.nd_experiment_id = e.nd_experiment_id " + "LEFT JOIN nd_experiment_project ep ON ep.nd_experiment_id = e.nd_experiment_id " + "LEFT JOIN project_relationship pr ON pr.subject_project_id = ep.project_id " + "LEFT JOIN project p ON pr.object_project_id = p.project_id " + "WHERE s.dbxref_id = " + gid + " AND p.project_id NOT IN (SELECT pp.project_id FROM projectprop pp WHERE pp.variable_id = " + TermId.STUDY_STATUS.getId() + " AND pp.value = " + TermId.DELETED_STUDY.getId() + ")"); return ((BigInteger) query.uniqueResult()).longValue(); } catch (final HibernateException e) { throw new MiddlewareQueryException("Error in countStudiesByGid=" + gid + " in StockDao: " + e.getMessage(), e); } }
Source:
protected void updateEntityFields(CashPoint cashPoint) { cashPoint.setName(cashPoint.getName() + " updated"); cashPoint.setDescription(cashPoint.getDescription() + " updated"); cashPoint.setLocation(Context.getLocationService().getLocation(1)); cashPoint.setCreator(Context.getAuthenticatedUser()); cashPoint.setDateChanged(new Date()); }

Target:
protected void updateEntityFields(CashPoint cashPoint) { cashPoint.setName(cashPoint.getName() + " updated"); cashPoint.setDescription(cashPoint.getDescription() + " updated"); cashPoint.setLocation(Context.getLocationService().getLocation(0)); }
Source:
public void test() throws Exception { ServiceManager serviceManager = new ServiceManager(); long counted = serviceManager.getProcessService().count("from Process"); Assert.assertNotNull("No Process found", counted); Assert.assertEquals(4, counted); String title = serviceManager.getProcessService().find(1).getTitle(); Assert.assertEquals("DBConnectionTest", title); }

Target:
public void test() throws Exception { ServiceManager serviceManager = new ServiceManager(); long counted = serviceManager.getProcessService().count("from Process"); Assert.assertNotNull("No Process found", counted); Assert.assertEquals(4, counted); String title = serviceManager.getProcessService().find(4).getTitle(); Assert.assertEquals("DBConnectionTest", title); }
Source:
public Profile(String managers, String community, String oid) { Matcher m = HOST_PATTERN.matcher(managers); while (m.find()) { hosts.add(new Host( m.group("host") != null ? m.group("host") : m.group("ipv6"), m.group("port"))); } this.community = new OctetString(community); this.oid = new OID(oid); if (!this.oid.isValid()) { throw new IllegalArgumentException( String.format( "Invalid oid '%s'", oid ) ); } }

Target:
public Profile(String managers, String community, String oid) { Matcher m = HOST_PATTERN.matcher(managers); while (m.find()) { hosts.add(new Host(m.group("host"), m.group("port"))); } this.community = new OctetString(community); this.oid = new OID(oid); if (!this.oid.isValid()) { throw new IllegalArgumentException( String.format( "Invalid oid '%s'", oid ) ); } }
Source:
public void setShouldRenderWhilePanning( boolean shouldRender ) { mShouldRenderWhilePanning = shouldRender; if( shouldRender ) { mTileCanvasViewGroup.setRenderBuffer( TileCanvasViewGroup.FAST_RENDER_BUFFER ); } else { mTileCanvasViewGroup.setRenderBuffer( TileCanvasViewGroup.DEFAULT_RENDER_BUFFER ); } }

Target:
public void setShouldRenderWhilePanning( boolean shouldRender ) { mShouldRenderWhilePanning = shouldRender; int buffer = shouldRender ? TileCanvasViewGroup.FAST_RENDER_BUFFER : TileCanvasViewGroup.DEFAULT_RENDER_BUFFER; mTileCanvasViewGroup.setRenderBuffer( buffer ); }
Source:
public void declareManagedMemoryUseCaseAtSlotScope(ManagedMemoryUseCase managedMemoryUseCase) { throw new UnsupportedOperationException( "Do not support declare slot scope's managed memory for SinkTransformation."); }

Target:
public void declareManagedMemoryUseCaseAtSlotScope(ManagedMemoryUseCase managedMemoryUseCase) { throw new UnsupportedOperationException( "Declaring managed memory use cases is not supported for SinkTransformation."); }
Source:
public void usageRatio() { tracer.maxPages( 10 ); assertThat( tracer.usageRatio(), closeTo( 0d, 0.0001 ) ); tracer.faults( 5 ); assertThat( tracer.usageRatio(), closeTo( 0.5, 0.0001 ) ); tracer.faults( 5 ); tracer.evictions( 5 ); assertThat( tracer.usageRatio(), closeTo( 0.5, 0.0001 ) ); tracer.faults( 5 ); assertThat( tracer.usageRatio(), closeTo( 1d, 0.0001 ) ); }

Target:
public void usageRatio() { assertThat( tracer.usageRatio(), is( Double.NaN ) ); tracer.maxPages( 10 ); assertThat( tracer.usageRatio(), closeTo( 0d, 0.0001 ) ); tracer.faults( 5 ); assertThat( tracer.usageRatio(), closeTo( 0.5, 0.0001 ) ); tracer.faults( 5 ); tracer.evictions( 5 ); assertThat( tracer.usageRatio(), closeTo( 0.5, 0.0001 ) ); tracer.faults( 5 ); assertThat( tracer.usageRatio(), closeTo( 1d, 0.0001 ) ); }
Source:
public OidcClient getOidcClient(String callBackUri) { OidcClient oidcClient = createOidcClient(idpType, oidcConfiguration, callBackUri); try { oidcClient.init(); } catch (TechnicalException e) { LOGGER.warn( "OIDC Client could not initialize; this may be due to a configuration issue. See the configuration under \"OIDC Handler Configuration\" in the Admin Console"); return null; } return oidcClient; }

Target:
public OidcClient getOidcClient(String callBackUri) { OidcClient oidcClient = createOidcClient(idpType, oidcConfiguration, callBackUri); try { oidcClient.init(); } catch (TechnicalException e) { LOGGER.warn( "OIDC Client could not initialize; this may be due to a configuration issue. See the configuration under \"OIDC Handler Configuration\" in the Admin Console"); LOGGER.debug(e.getMessage()); } return oidcClient; }
Source:
public void marshal(ITypeMarshalBuffer buffer) throws CoreException { final int kind= getKind().ordinal(); final int shiftedKind= kind * ITypeMarshalBuffer.FIRST_FLAG; final int modifiers= getModifiers(); if (modifiers == 0) { buffer.putShort((short) (ITypeMarshalBuffer.BASIC_TYPE | shiftedKind)); } else { buffer.putShort((short) (ITypeMarshalBuffer.BASIC_TYPE | ITypeMarshalBuffer.LAST_FLAG)); buffer.putByte((byte) kind); buffer.putByte((byte) modifiers); } }

Target:
public void marshal(ITypeMarshalBuffer buffer) throws CoreException { final int kind= getKind().ordinal(); final int shiftedKind= kind * ITypeMarshalBuffer.FIRST_FLAG; final int modifiers= getModifiers(); if (modifiers == 0) { buffer.putShort((short) (ITypeMarshalBuffer.BASIC_TYPE | shiftedKind)); } else { buffer.putShort((short) (ITypeMarshalBuffer.BASIC_TYPE | shiftedKind | ITypeMarshalBuffer.LAST_FLAG)); buffer.putByte((byte) modifiers); } }