auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void createButtonsForButtonBar(final Composite parent) { createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, true); Button manageButton = createButton(parent, IDialogConstants.CLIENT_ID + 1, Messages.TraceControl_ManageButtonText, true); manageButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(parent.getShell(), ControlRemoteProfilesPreferencePage.ID, new String[] { ControlRemoteProfilesPreferencePage.ID }, null); dialog.open(); if (fLocalComposite != null) { fFolderViewer.refresh(); } } }); Button button = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, true); button.setEnabled(false); }

Target:
protected void createButtonsForButtonBar(final Composite parent) { createButton(parent, IDialogConstants.CANCEL_ID, IDialogConstants.CANCEL_LABEL, false); Button manageButton = createButton(parent, IDialogConstants.CLIENT_ID + 1, Messages.TraceControl_ManageButtonText, false); manageButton.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent e) { PreferenceDialog dialog = PreferencesUtil.createPreferenceDialogOn(parent.getShell(), ControlRemoteProfilesPreferencePage.ID, new String[] { ControlRemoteProfilesPreferencePage.ID }, null); dialog.open(); if (fLocalComposite != null) { fFolderViewer.setInput(LTTngProfileViewer.getViewerInput()); } } }); Button button = createButton(parent, IDialogConstants.OK_ID, IDialogConstants.OK_LABEL, false); button.setEnabled(false); }
Source:
public void incrementRecordCount() { int count = this.getRecordCount(); count++; this.setRecordCount(count); }

Target:
public void incrementRecordCount() { recordCount++; }
Source:
public static String toMemorableString(long num) { StringBuilder memorable = new StringBuilder(); num=Math.abs(num); for (; ; ) { int chunk = (int) (num & 0xf); memorable.append(CONSONANTS[chunk]); num >>= 4; if (num == 0) { break; } chunk = (int) (num & 7); memorable.append(VOWELS[chunk]); num >>= 3; if (num == 0) { break; } } return memorable.toString(); }

Target:
public static String toMemorableString(long num) { StringBuilder memorable = new StringBuilder(); long hashNum = Math.abs(num); for (; ; ) { int chunk = (int) (hashNum & 0xf); memorable.append(CONSONANTS[chunk]); hashNum >>= 4; if (hashNum == 0) { break; } chunk = (int) (hashNum & 7); memorable.append(VOWELS[chunk]); hashNum >>= 3; if (hashNum == 0) { break; } } return memorable.toString(); }
Source:
public void getOffset() throws Exception { mOptions.setRootDir(mTemp.getRoot().getAbsolutePath()); int len = 32; int offset = 3; try (PageStore store = PageStore.create(mOptions)) { PageId id = new PageId(0, 0); store.put(id, BufferUtils.getIncreasingByteArray(len)); ByteBuffer buf = ByteBuffer.allocate(1024); try (ReadableByteChannel channel = store.get(id, offset)) { channel.read(buf); } buf.flip(); assertTrue(BufferUtils.equalIncreasingByteBuffer(3, len - offset, buf)); } }

Target:
public void getOffset() throws Exception { mOptions.setRootDir(mTemp.getRoot().getAbsolutePath()); int len = 32; int offset = 3; try (PageStore store = PageStore.create(mOptions)) { PageId id = new PageId(0, 0); store.put(id, BufferUtils.getIncreasingByteArray(len)); ByteBuffer buf = ByteBuffer.allocate(1024); try (ReadableByteChannel channel = store.get(id, offset)) { channel.read(buf); } buf.flip(); assertTrue(BufferUtils.equalIncreasingByteBuffer(offset, len - offset, buf)); } }
Source:
protected ImmutableList<Variable> toClassVariableArguments(final Ds3Request ds3Request) { final ImmutableList.Builder<Variable> builder = ImmutableList.builder(); for (final Arguments arg : toConstructorArgumentsList(ds3Request)) { builder.add(new Variable(arg.getName(), arg.getType(), true)); } for (final Arguments arg : toOptionalArgumentsList(ds3Request.getOptionalQueryParams())) { builder.add(new Variable(arg.getName(), arg.getType(), false)); } return builder.build(); }

Target:
public ImmutableList<Variable> toClassVariableArguments(final Ds3Request ds3Request) { final ImmutableList.Builder<Variable> builder = ImmutableList.builder(); for (final Arguments arg : toConstructorArgumentsList(ds3Request)) { builder.add(new Variable(arg.getName(), arg.getType(), true)); } for (final Arguments arg : toOptionalArgumentsList(ds3Request.getOptionalQueryParams())) { builder.add(new Variable(arg.getName(), arg.getType(), false)); } return builder.build(); }
Source:
public void breaksSingleLine() throws Exception { MatcherAssert.assertThat( new MarkdownTxtmark().html( Joiner.on(MarkdownTxtmarkTest.EOL) .join("line1", "line2", "", "line3").trim() ), Matchers.equalTo( Joiner.on(MarkdownTxtmarkTest.EOL).join( "<p>line1<br />", "line2<br /></p>", "<p>line3</p>", "" ) ) ); }

Target:
public void breaksSingleLine() throws Exception { MatcherAssert.assertThat( new MarkdownTxtmark().html( Joiner.on(MarkdownTxtmarkTest.EOL) .join("line1 line", "line2", "", "line3").trim() ), Matchers.equalTo( Joiner.on(MarkdownTxtmarkTest.EOL).join( "<p>line1 line<br />", "line2<br /></p>", "<p>line3</p>", "" ) ) ); }
Source:
public TaskParameter(String key, String value) { this.key = key; this.value = value; }

Target:
TaskParameter(String key, String value) { this.key = key; this.value = value; }
Source:
public static DimensionHandler getHandlerFromCapabilities( String dimensionName, ColumnCapabilities capabilities, MultiValueHandling multiValueHandling ) { DimensionHandler handler = null; if (capabilities.getType() == ValueType.STRING) { if (!capabilities.isDictionaryEncoded() || !capabilities.hasBitmapIndexes()) { throw new IAE("String column must have dictionary encoding and bitmap index."); } handler = new StringDimensionHandler(dimensionName, multiValueHandling); } if (handler == null) { throw new IAE("Could not create handler from invalid column type: " + capabilities.getType()); } return handler; }

Target:
public static DimensionHandler getHandlerFromCapabilities( String dimensionName, ColumnCapabilities capabilities, MultiValueHandling multiValueHandling ) { DimensionHandler handler = null; if (capabilities.getType() == ValueType.STRING) { if (!capabilities.isDictionaryEncoded() || !capabilities.hasBitmapIndexes()) { throw new IAE("String column must have dictionary encoding and bitmap index."); } multiValueHandling = multiValueHandling == null ? MultiValueHandling.ofDefault() : multiValueHandling; handler = new StringDimensionHandler(dimensionName, multiValueHandling); } if (handler == null) { throw new IAE("Could not create handler from invalid column type: " + capabilities.getType()); } return handler; }
Source:
public void setUp() throws IOException { tmpFolder = new File(InstrumentationRegistry.getTargetContext().getCacheDir(), "ListProjectFilesTestTmp"); if (tmpFolder.exists()) { StorageOperations.deleteDir(tmpFolder); } tmpFolder.mkdirs(); if (EXTERNAL_STORAGE_ROOT_DIRECTORY.exists()) { StorageOperations.deleteDir(EXTERNAL_STORAGE_ROOT_DIRECTORY); } EXTERNAL_STORAGE_ROOT_DIRECTORY.mkdirs(); }

Target:
public void setUp() throws IOException { tmpFolder = new File(InstrumentationRegistry.getTargetContext().getCacheDir(), "ListProjectFilesTestTmp"); if (tmpFolder.isDirectory()) { StorageOperations.deleteDir(tmpFolder); } tmpFolder.mkdirs(); if (EXTERNAL_STORAGE_ROOT_DIRECTORY.isDirectory()) { StorageOperations.deleteDir(EXTERNAL_STORAGE_ROOT_DIRECTORY); } EXTERNAL_STORAGE_ROOT_DIRECTORY.mkdirs(); }
Source:
public void validateAndImportCertificate() throws CertificateManagerException { if (isHashTokenEmpty()) { if (service.validateTrustStorePassKey(trustStorePasskey)) { String hashToken = service.getHashToken(trustStorePasskey); saveHashToken(hashToken); RequestContext.getCurrentInstance().execute("PF('importPassKeyDlg').hide();"); importSelectedCertificate(hashToken); } else { HelperUtil.addMessageError(IMPORT_PASS_ERR_MSG_ID, INVALID_PASS_ERR_MSG); } } else { importSelectedCertificate(getHashTokenFromSession()); } trustStorePasskey = null; }

Target:
public void validateAndImportCertificate() throws CertificateManagerException { if (isHashTokenEmpty()) { String hashToken = service.getHashToken(trustStorePasskey); if (importSelectedCertificate(hashToken)) { saveHashToken(hashToken); RequestContext.getCurrentInstance().execute("PF('importPassKeyDlg').hide();"); } else { HelperUtil.addMessageError(IMPORT_PASS_ERR_MSG_ID, BAD_MISMATCH_TOKEN); } } else { importSelectedCertificate(getHashTokenFromSession()); } trustStorePasskey = null; }
Source:
public static IObservableList<Object> emptyObservableList() { return emptyObservableList(Realm.getDefault(), null); }

Target:
public static <E> IObservableList<E> emptyObservableList() { return emptyObservableList(Realm.getDefault(), null); }
Source:
public static void refreshPackages(Bundle[] bundles) { FrameworkWiring wiring = context.getBundle(Constants.SYSTEM_BUNDLE_LOCATION).adapt(FrameworkWiring.class); final boolean[] flag = new boolean[] { false }; FrameworkListener listener = event -> { if (event.getType() == FrameworkEvent.PACKAGES_REFRESHED) { synchronized (flag) { flag[0] = true; flag.notifyAll(); } } }; context.addFrameworkListener(listener); wiring.refreshBundles(asList(bundles)); synchronized (flag) { while (!flag[0]) { try { flag.wait(); } catch (InterruptedException e) { } } } context.removeFrameworkListener(listener); }

Target:
public static void refreshPackages(Bundle[] bundles) { FrameworkWiring wiring = context.getBundle(Constants.SYSTEM_BUNDLE_LOCATION).adapt(FrameworkWiring.class); final boolean[] flag = new boolean[] { false }; FrameworkListener listener = event -> { if (event.getType() == FrameworkEvent.PACKAGES_REFRESHED) { synchronized (flag) { flag[0] = true; flag.notifyAll(); } } }; wiring.refreshBundles(asList(bundles), listener); synchronized (flag) { while (!flag[0]) { try { flag.wait(); } catch (InterruptedException e) { } } } }
Source:
public synchronized void primaryResult(Address from, Object value, boolean success) { Collector<Response> collector = primaryCollectors.get(from); if (trace) { log.tracef("[Collector#%s] PutMap Primary ACK. Address=%s. TopologyId=%s (expected=%s).", id, from, topologyId, this.topologyId); } collector.primaryResult(success ? SuccessfulResponse.create(value) : UnsuccessfulResponse.create(value), success); if (unsolicitedAcks != null) { unsolicitedAcks.removeIf(pendingAcks::remove); } if (pendingAcks.isEmpty()) { acksFuture.complete(null); } }

Target:
public synchronized void primaryResult(Address from, Object value, boolean success) { Collector<Response> collector = primaryCollectors.get(from); if (trace) { log.tracef("[Collector#%s] PutMap Primary ACK. Address=%s", id, from); } collector.primaryResult(success ? SuccessfulResponse.create(value) : UnsuccessfulResponse.create(value), success); if (unsolicitedAcks != null) { unsolicitedAcks.removeIf(pendingAcks::remove); } if (pendingAcks.isEmpty()) { acksFuture.complete(null); } }
Source:
@Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(gridName); TcpDiscoverySpi discoverySpi = (TcpDiscoverySpi)cfg.getDiscoverySpi(); discoverySpi.setIpFinder(ipFinder); TestRecordingCommunicationSpi commSpi = new TestRecordingCommunicationSpi(); cfg.setCommunicationSpi(commSpi); DataStorageConfiguration memCfg = new DataStorageConfiguration() .setDefaultDataRegionConfiguration( new DataRegionConfiguration().setMaxSize(100 * 1024 * 1024).setPersistenceEnabled(true)) .setWalMode(WALMode.LOG_ONLY); cfg.setDataStorageConfiguration(memCfg); CacheConfiguration<Integer, byte[]> ccfg1 = new CacheConfiguration<>(); ccfg1.setName(CACHE_1_NAME); ccfg1.setBackups(1); ccfg1.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL); ccfg1.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC); ccfg1.setAffinity(new RendezvousAffinityFunction(false, 32)); destroyCacheCfg = ccfg1; CacheConfiguration<Integer, byte[]> ccfg2 = new CacheConfiguration<>(); ccfg2.setName(CACHE_2_NAME); ccfg2.setBackups(1); ccfg2.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL); ccfg2.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC); ccfg2.setAffinity(new RendezvousAffinityFunction(false, 32)); surviveCacheCfg = ccfg2; cfg.setCacheConfiguration(ccfg1, ccfg2); return cfg; }

Target:
@Override protected IgniteConfiguration getConfiguration(String gridName) throws Exception { IgniteConfiguration cfg = super.getConfiguration(gridName); TestRecordingCommunicationSpi commSpi = new TestRecordingCommunicationSpi(); cfg.setCommunicationSpi(commSpi); DataStorageConfiguration memCfg = new DataStorageConfiguration() .setDefaultDataRegionConfiguration( new DataRegionConfiguration().setMaxSize(100 * 1024 * 1024).setPersistenceEnabled(true)) .setWalMode(WALMode.LOG_ONLY); cfg.setDataStorageConfiguration(memCfg); CacheConfiguration<Integer, byte[]> ccfg1 = new CacheConfiguration<>(); ccfg1.setName(CACHE_1_NAME); ccfg1.setBackups(1); ccfg1.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL); ccfg1.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC); ccfg1.setAffinity(new RendezvousAffinityFunction(false, 32)); destroyCacheCfg = ccfg1; CacheConfiguration<Integer, byte[]> ccfg2 = new CacheConfiguration<>(); ccfg2.setName(CACHE_2_NAME); ccfg2.setBackups(1); ccfg2.setAtomicityMode(CacheAtomicityMode.TRANSACTIONAL); ccfg2.setWriteSynchronizationMode(CacheWriteSynchronizationMode.FULL_SYNC); ccfg2.setAffinity(new RendezvousAffinityFunction(false, 32)); surviveCacheCfg = ccfg2; cfg.setCacheConfiguration(ccfg1, ccfg2); return cfg; }
Source:
@Override public void accept(long pageId, ByteBuffer buf) { assert buf.position() == 0 : buf.position(); assert buf.order() == ByteOrder.nativeOrder() : buf.order(); if (fileIo == null) { lock.writeLock().lock(); try { if (stopped()) return; if (fileIo == null) fileIo = factory.create(deltaFile); } catch (IOException e) { exCons.accept(e); } finally { lock.writeLock().unlock(); } } lock.readLock().lock(); try { if (stopped()) return; if (checkpointComplete.getAsBoolean()) { int pageIdx = PageIdUtils.pageIndex(pageId); if (!pagesWrittenBits.touch(pageIdx)) return; final ByteBuffer locBuf = localBuff.get(); assert locBuf.capacity() == store.getPageSize(); locBuf.clear(); if (!store.read(pageId, locBuf, true)) return; locBuf.flip(); writePage0(pageId, locBuf); } else { writePage0(pageId, buf); } } catch (Throwable ex) { exCons.accept(ex); } finally { lock.readLock().unlock(); } }

Target:
@Override public void accept(long pageId, ByteBuffer buf) { assert buf.position() == 0 : buf.position(); assert buf.order() == ByteOrder.nativeOrder() : buf.order(); if (deltaFileIo == null) { lock.writeLock().lock(); try { if (stopped()) return; if (deltaFileIo == null) deltaFileIo = ioFactory.create(deltaFile); } catch (IOException e) { acceptException(e); } finally { lock.writeLock().unlock(); } } int pageIdx = -1; lock.readLock().lock(); try { if (stopped()) return; pageIdx = PageIdUtils.pageIndex(pageId); if (checkpointComplete.getAsBoolean()) { if (!writtenPages.touch(pageIdx)) return; final ByteBuffer locBuf = locBuff.get(); assert locBuf.capacity() == store.getPageSize(); locBuf.clear(); if (!store.read(pageId, locBuf, true)) return; locBuf.flip(); writePage0(pageId, locBuf); } else { writePage0(pageId, buf); writtenPages.touch(pageIdx); } } catch (Throwable ex) { acceptException(new IgniteCheckedException("Error during writing pages to delta partition file " + "[pageIdx=" + pageIdx + ", writer=" + this + ']', ex)); } finally { lock.readLock().unlock(); } }
Source:
protected IkasanSolrDocumentSearchResults searchBase(Set<String> moduleName, Set<String> flowNames, Set<String> componentNames , String eventId, String searchString, long startTime, long endTime, int offset, int resultSize, List<String> entityTypes, boolean negateQuery , String sortField, String sortOrder) { SolrQuery query = new SolrQuery(); query.setStart(offset); query.setRows(resultSize); if(sortField != null && !sortField.isEmpty() && sortOrder != null && !sortOrder.isEmpty()) { if(sortOrder.equals("DESCENDING")) { query.setSort(sortField, SolrQuery.ORDER.desc); } else { query.setSort(sortField, SolrQuery.ORDER.asc); } } else { query.setSort(CREATED_DATE_TIME, SolrQuery.ORDER.desc); } String queryFilter; try { queryFilter = super.buildQuery(moduleName, flowNames, componentNames, new Date(startTime), new Date(endTime), searchString, eventId, entityTypes, negateQuery); } catch (IOException e) { throw new RuntimeException(String.format("An error has occurred building Sorl query.", e.getMessage())); } query.setQuery(queryFilter); try { logger.info("query: " + query); QueryRequest req = new QueryRequest(query); req.setBasicAuthCredentials(this.solrUsername, this.solrPassword); QueryResponse rsp = req.process(this.solrClient, SolrConstants.CORE); List<IkasanSolrDocument> beans = rsp.getBeans(IkasanSolrDocument.class); return new IkasanSolrDocumentSearchResults(beans, rsp.getResults().getNumFound(), rsp.getQTime()); } catch (Exception e) { throw new RuntimeException("Caught exception perform general ikasan search!", e); } }

Target:
protected IkasanSolrDocumentSearchResults searchBase(Set<String> moduleName, Set<String> flowNames, Set<String> componentNames , String eventId, String searchString, long startTime, long endTime, int offset, int resultSize, List<String> entityTypes, boolean negateQuery , String sortField, String sortOrder) { SolrQuery query = new SolrQuery(); query.setStart(offset); query.setRows(resultSize); if(sortField != null && !sortField.isEmpty() && sortOrder != null && !sortOrder.isEmpty()) { if(sortOrder.equals("DESCENDING")) { query.setSort(sortField, SolrQuery.ORDER.desc); } else { query.setSort(sortField, SolrQuery.ORDER.asc); } } else { query.setSort(CREATED_DATE_TIME, SolrQuery.ORDER.desc); } String queryFilter; try { queryFilter = super.buildQuery(moduleName, flowNames, componentNames, new Date(startTime), new Date(endTime), searchString, eventId, entityTypes, negateQuery); } catch (IOException e) { throw new RuntimeException(String.format("An error has occurred building Sorl query.", e.getMessage())); } query.setQuery(queryFilter); try { logger.debug("query: " + query); QueryRequest req = new QueryRequest(query); req.setBasicAuthCredentials(this.solrUsername, this.solrPassword); QueryResponse rsp = req.process(this.solrClient, SolrConstants.CORE); List<IkasanSolrDocument> beans = rsp.getBeans(IkasanSolrDocument.class); return new IkasanSolrDocumentSearchResults(beans, rsp.getResults().getNumFound(), rsp.getQTime()); } catch (Exception e) { throw new RuntimeException("Caught exception perform general ikasan search!", e); } }
Source:
public void sweepsOnlyThePrescribedNumberOfBatchesAtATime() { for (int partition = 0; partition < readBatchSize + 1; partition++) { enqueueWriteCommitted(TABLE_CONS, LOW_TS + SweepQueueUtils.minTsForFinePartition(partition)); enqueueWriteCommitted(TABLE_CONS, LOW_TS + SweepQueueUtils.minTsForFinePartition(partition) + 1); } enqueueWriteCommitted(TABLE_CONS, TS_FINE_GRANULARITY); sweepNextBatch(ShardAndStrategy.conservative(CONS_SHARD)); assertReadAtTimestampReturnsSentinel( TABLE_CONS, LOW_TS + SweepQueueUtils.minTsForFinePartition(readBatchSize - 1)); assertTestValueEnqueuedAtGivenTimestampStillPresent( TABLE_CONS, LOW_TS + SweepQueueUtils.minTsForFinePartition(readBatchSize - 1) + 1); assertTestValueEnqueuedAtGivenTimestampStillPresent( TABLE_CONS, LOW_TS + SweepQueueUtils.minTsForFinePartition(readBatchSize)); }

Target:
public void sweepsOnlyThePrescribedNumberOfBatchesAtATime() { for (int partition = 0; partition < readBatchSize + 1; partition++) { enqueueWriteCommitted(TABLE_CONS, LOW_TS + SweepQueueUtils.minTsForFinePartition(partition)); enqueueWriteCommitted(TABLE_CONS, LOW_TS + SweepQueueUtils.minTsForFinePartition(partition) + 1); } sweepNextBatch(ShardAndStrategy.conservative(CONS_SHARD)); assertReadAtTimestampReturnsSentinel( TABLE_CONS, LOW_TS + SweepQueueUtils.minTsForFinePartition(readBatchSize - 1)); assertTestValueEnqueuedAtGivenTimestampStillPresent( TABLE_CONS, LOW_TS + SweepQueueUtils.minTsForFinePartition(readBatchSize - 1) + 1); assertTestValueEnqueuedAtGivenTimestampStillPresent( TABLE_CONS, LOW_TS + SweepQueueUtils.minTsForFinePartition(readBatchSize)); }
Source:
private void addSELinuxModes(VersionCaps version, SELinuxMode[] values) { if (VersionUtils.greaterOrEqual(version, VERSION_3_5)) { version.setSelinuxModes(new SELinuxModes()); for (SELinuxMode mode: values) { version.getSelinuxModes().getSELinuxModes().add(mode.toString().toLowerCase()); } } }

Target:
private void addSELinuxModes(VersionCaps version, SELinuxMode[] values) { if (VersionUtils.greaterOrEqual(version, VERSION_3_5)) { version.setSelinuxModes(new SELinuxModes()); for (SELinuxMode mode: values) { version.getSelinuxModes().getSELinuxModes().add(mode.value()); } } }
Source:
private Task getOptimizeInputTask(RelNode rel, RelSubset group) { if (!rel.getTraitSet().satisfies(group.getTraitSet())) { RelNode passThroughRel = convert(rel, group); if (passThroughRel == null) { if (LOGGER.isDebugEnabled()) { LOGGER.debug("Skip optimizing because of traits: {}", rel); } return null; } final RelNode finalPassThroughRel = passThroughRel; applyGenerator(null, () -> planner.register(finalPassThroughRel, group)); rel = passThroughRel; } boolean unProcess = false; for (RelNode input : rel.getInputs()) { RelOptCost winner = ((RelSubset) input).getWinnerCost(); if (winner == null) { unProcess = true; break; } } if (!unProcess) { return new DeriveTrait(rel, group); } if (rel.getInputs().size() == 1) { return new OptimizeInput1(rel, group); } return new OptimizeInputs(rel, group); }

Target:
private Task getOptimizeInputTask(RelNode rel, RelSubset group) { if (!rel.getTraitSet().satisfies(group.getTraitSet())) { RelNode passThroughRel = convert(rel, group); if (passThroughRel == null) { LOGGER.debug("Skip optimizing because of traits: {}", rel); return null; } final RelNode finalPassThroughRel = passThroughRel; applyGenerator(null, () -> planner.register(finalPassThroughRel, group)); rel = passThroughRel; } boolean unProcess = false; for (RelNode input : rel.getInputs()) { RelOptCost winner = ((RelSubset) input).getWinnerCost(); if (winner == null) { unProcess = true; break; } } if (!unProcess) { return new DeriveTrait(rel, group); } if (rel.getInputs().size() == 1) { return new OptimizeInput1(rel, group); } return new OptimizeInputs(rel, group); }
Source:
private void assertJobStatus(String jobId, Status status) { if (status == Status.FAILED || status == Status.KILLED || status == Status.SUSPENDED) { try { log.error(oozieClient.getJobLog(jobId)); } catch (OozieClientException e) { log.warn("Unable to check oozie job log"); } Assert.fail("Job has finished with status: " + status); } log.info("Job has finished sucessfully"); }

Target:
private void assertJobStatus(String jobId, Status status) { if (status == Status.FAILED || status == Status.KILLED || status == Status.SUSPENDED) { printOozieJobLog(jobId); Assert.fail("Job has finished with status: " + status); } log.info("Job has finished sucessfully"); }
Source:
public boolean isNormalCube(BlockState state, IBlockReader world, BlockPos pos) { return notNormalBlock; }

Target:
public boolean isNormalCube(BlockState state, IBlockReader world, BlockPos pos) { return !notNormalBlock; }
Source:
public Object visitValuesCommand(InvocationContext ctx, ValuesCommand command) throws Throwable { Object values = super.visitValuesCommand(ctx, command); if (enabled && !shouldSkipCacheLoader(command)) { final ConcurrentHashSet<Object> processedKeys = new ConcurrentHashSet<Object>(); final List<Object> result = new ArrayList<Object>(); persistenceManager.processOnAllStores(new CollectionKeyFilter(processedKeys), new AdvancedCacheLoader.CacheLoaderTask() { @Override public void processEntry(MarshalledEntry marshalledEntry, AdvancedCacheLoader.TaskContext taskContext) throws InterruptedException { processedKeys.add(marshalledEntry.getKey()); synchronized (result) { result.add(marshalledEntry.getValue()); } } }, true, false); result.addAll((Collection<Object>)values); return Collections.unmodifiableList(result); } return values; }

Target:
public Object visitValuesCommand(InvocationContext ctx, ValuesCommand command) throws Throwable { Object values = super.visitValuesCommand(ctx, command); if (enabled && !shouldSkipCacheLoader(command)) { final ConcurrentLinkedQueue<Object> result = new ConcurrentLinkedQueue<Object>(); persistenceManager.processOnAllStores(null, new AdvancedCacheLoader.CacheLoaderTask() { @Override public void processEntry(MarshalledEntry marshalledEntry, AdvancedCacheLoader.TaskContext taskContext) throws InterruptedException { result.add(marshalledEntry.getValue()); } }, true, false); result.addAll((Collection<Object>)values); return result; } return values; }
Source:
static Application toV4ApplicationDto(final ApplicationEntity applicationEntity) { final ApplicationMetadata.Builder metadataBuilder = new ApplicationMetadata.Builder( applicationEntity.getName(), applicationEntity.getUser(), applicationEntity.getStatus() ) .withVersion(applicationEntity.getVersion()) .withTags(applicationEntity.getTags().stream().map(TagEntity::getTag).collect(Collectors.toSet())); applicationEntity.getType().ifPresent(metadataBuilder::withType); applicationEntity.getDescription().ifPresent(metadataBuilder::withDescription); setDtoMetadata(metadataBuilder, applicationEntity); return new Application( applicationEntity.getUniqueId(), applicationEntity.getCreated(), applicationEntity.getUpdated(), new ExecutionEnvironment( applicationEntity.getConfigs().stream().map(FileEntity::getFile).collect(Collectors.toSet()), applicationEntity.getDependencies().stream().map(FileEntity::getFile).collect(Collectors.toSet()), applicationEntity.getSetupFile().isPresent() ? applicationEntity.getSetupFile().get().getFile() : null ), metadataBuilder.build() ); }

Target:
public static Application toV4ApplicationDto(final ApplicationEntity applicationEntity) { final ApplicationMetadata.Builder metadataBuilder = new ApplicationMetadata.Builder( applicationEntity.getName(), applicationEntity.getUser(), applicationEntity.getStatus() ) .withTags(applicationEntity.getTags().stream().map(TagEntity::getTag).collect(Collectors.toSet())); applicationEntity.getVersion().ifPresent(metadataBuilder::withVersion); applicationEntity.getType().ifPresent(metadataBuilder::withType); applicationEntity.getDescription().ifPresent(metadataBuilder::withDescription); setDtoMetadata(metadataBuilder, applicationEntity); return new Application( applicationEntity.getUniqueId(), applicationEntity.getCreated(), applicationEntity.getUpdated(), new ExecutionEnvironment( applicationEntity.getConfigs().stream().map(FileEntity::getFile).collect(Collectors.toSet()), applicationEntity.getDependencies().stream().map(FileEntity::getFile).collect(Collectors.toSet()), applicationEntity.getSetupFile().isPresent() ? applicationEntity.getSetupFile().get().getFile() : null ), metadataBuilder.build() ); }
Source:
public static Parameter instantiate(SerializationStreamReader reader) throws SerializationException { UUID uuid = UUID_CustomFieldSerializer.instantiate(reader); return Parameter.getByUuid(uuid.toString()); }

Target:
public static Parameter instantiate(SerializationStreamReader reader) throws SerializationException { return Parameter.getByUuid(UUID_CustomFieldSerializer.instantiate(reader).toString()); }
Source:
public boolean equals(Object obj) { if (this == obj) { return true; } if (!super.equals(obj)) { return false; } if (!(obj instanceof NetworkView)) { return false; } NetworkView other = (NetworkView) obj; if (getCompatibilityVersion() == null) { if (other.getCompatibilityVersion() != null) { return false; } } else if (!getCompatibilityVersion().equals(other.getCompatibilityVersion())) { return false; } if (getDataCenterName() == null) { if (other.getDataCenterName() != null) { return false; } } else if (!getDataCenterName().equals(other.getDataCenterName())) { return false; } if (Objects.equals(getProviderName(), other.getProviderName())) { return false; } if (Objects.equals(getQosName(), other.getQosName())) { return false; } return true; }

Target:
public boolean equals(Object obj) { if (this == obj) { return true; } if (!super.equals(obj)) { return false; } if (!(obj instanceof NetworkView)) { return false; } NetworkView other = (NetworkView) obj; if (getCompatibilityVersion() == null) { if (other.getCompatibilityVersion() != null) { return false; } } else if (!getCompatibilityVersion().equals(other.getCompatibilityVersion())) { return false; } if (getDataCenterName() == null) { if (other.getDataCenterName() != null) { return false; } } else if (!getDataCenterName().equals(other.getDataCenterName())) { return false; } if (Objects.equals(getProviderName(), other.getProviderName())) { return false; } if (!Objects.equals(getQosName(), other.getQosName())) { return false; } return true; }
Source:
public final Maybe<Integer> findIndex(@Nonnull F<A, Boolean> f) { ImmutableList<A> self = this; int i = 0; while (self instanceof NonEmptyImmutableList) { NonEmptyImmutableList<A> selfNel = (NonEmptyImmutableList<A>) self; boolean result = f.apply(selfNel.head); if (result) { return Maybe.of(i); } self = selfNel.tail(); ++i; } return Maybe.empty(); }

Target:
public final Maybe<Integer> findIndex(@Nonnull F<A, Boolean> f) { ImmutableList<A> self = this; int i = 0; while (self instanceof NonEmptyImmutableList) { NonEmptyImmutableList<A> selfNel = (NonEmptyImmutableList<A>) self; if (f.apply(selfNel.head)) { return Maybe.of(i); } self = selfNel.tail(); ++i; } return Maybe.empty(); }
Source:
public void calcFillSettings(String field, Map<String, Object> attributes) { if (attributes.containsKey("fillUrl")) { super.calcFillSettings(field, attributes); return; } super.calcFillSettings(field, attributes); if (attributes.containsKey("fillUrl")) { try { JellyContext jelly = Functions.getCurrentJellyContext(); Object it = jelly.findVariable("it"); if (it instanceof CredentialsStore) { ModelObject context = ((CredentialsStore) it).getContext(); for (CredentialsSelectHelper.ContextResolver r : ExtensionList .lookup(CredentialsSelectHelper.ContextResolver.class)) { String token = r.getToken(context); if (token != null) { String fillUrl = (String) attributes.get("fillUrl"); if (fillUrl.indexOf('?') != -1) { fillUrl = fillUrl + '&'; } else { fillUrl = fillUrl + '?'; } attributes.put("fillUrl", fillUrl + "$provider=" + r.getClass().getName() + "&" + "$token=" + URLEncoder.encode(token, "UTF-8")); } } } } catch (AssertionError e) { } catch (UnsupportedEncodingException e) { } } }

Target:
public void calcFillSettings(String field, Map<String, Object> attributes) { if (attributes.containsKey("fillUrl")) { super.calcFillSettings(field, attributes); return; } super.calcFillSettings(field, attributes); if (attributes.containsKey("fillUrl")) { try { JellyContext jelly = Functions.getCurrentJellyContext(); Object it = jelly.findVariable("it"); if (it instanceof CredentialsStore) { ModelObject context = ((CredentialsStore) it).getContext(); for (CredentialsSelectHelper.ContextResolver r : ExtensionList .lookup(CredentialsSelectHelper.ContextResolver.class)) { String token = r.getToken(context); if (token != null) { String fillUrl = (String) attributes.get("fillUrl"); if (fillUrl != null) { if (fillUrl.indexOf('?') != -1) { fillUrl = fillUrl + '&'; } else { fillUrl = fillUrl + '?'; } attributes.put("fillUrl", fillUrl + "$provider=" + URLEncoder.encode(r.getClass().getName(), "UTF-8") + "&$token=" + URLEncoder.encode(token, "UTF-8")); } } } } } catch (AssertionError e) { } catch (UnsupportedEncodingException e) { } } }
Source:
@Override public @Nullable IStrategoTerm invoke(ILanguageImpl impl, IContext context, IStrategoTerm input, String strategy) throws MetaborgException { List<MetaborgException> exceptions = Lists.newArrayList(); for(ILanguageComponent component : impl.components()) { if(component.facet(DynamicClassLoadingFacet.class) == null) { continue; } final HybridInterpreter runtime = strategoRuntimeService.runtime(component, context, true); try { final IStrategoTerm result = invoke(runtime, input, strategy); return result; } catch(MetaborgException ex) { exceptions.add(ex); } } throw new AggregateMetaborgException(exceptions); }

Target:
@Override public @Nullable IStrategoTerm invoke(ILanguageImpl impl, IContext context, IStrategoTerm input, String strategy) throws MetaborgException { List<MetaborgException> exceptions = Lists.newArrayList(); for(ILanguageComponent component : impl.components()) { if(!IStrategoCommon.hasStrategoFacets(component)) { continue; } final HybridInterpreter runtime = strategoRuntimeService.runtime(component, context, true); try { final IStrategoTerm result = invoke(runtime, input, strategy); return result; } catch(MetaborgException ex) { exceptions.add(ex); } } throw new AggregateMetaborgException(exceptions); }
Source:
public String getPortalLogo() { return SchedulerImagesUnbundled.pps_run; }

Target:
public String getPortalLogo() { return SchedulerImagesUnbundled.PPS_RUN; }
Source:
public Map<String, Object> verifyToken(String token) { Objects.requireNonNull(token); Algorithm algorithm = getAlgorithm(); if (algorithm == null) { log.debug("secret not configured, cannot verify token"); return null; } JWTVerifier verifier = JWT.require(algorithm) .withIssuer(NUXEO_ISSUER) .build(); DecodedJWT jwt; try { jwt = verifier.verify(token); } catch (JWTVerificationException e) { if (log.isTraceEnabled()) { log.trace("token verification failed: " + e.toString()); } return null; } Object payload = getFieldValue(jwt, "payload"); Map<String, JsonNode> tree = getFieldValue(payload, "tree"); Map<String, Object> claims = new HashMap<>(); for (Entry<String, JsonNode> es : tree.entrySet()) { claims.put(es.getKey(), nodeToValue(es.getValue())); } return claims; }

Target:
public Map<String, Object> verifyToken(String token) { Objects.requireNonNull(token); Algorithm algorithm = getAlgorithm(); if (algorithm == null) { log.debug("secret not configured, cannot verify token"); return null; } JWTVerifier verifier = JWT.require(algorithm) .withIssuer(NUXEO_ISSUER) .build(); DecodedJWT jwt; try { jwt = verifier.verify(token); } catch (JWTVerificationException e) { if (log.isTraceEnabled()) { log.trace("token verification failed: " + e.toString()); } return null; } Object payload = getFieldValue(jwt, "payload"); Map<String, JsonNode> tree = getFieldValue(payload, "tree"); return tree.entrySet().stream().collect(toMap(Entry::getKey, e -> nodeToValue(e.getValue()))); }
Source:
public boolean match(Name name) { if (patterns.stream().anyMatch(pattern -> name.getUrn().startsWith(pattern))) { return true; } return false; }

Target:
public boolean match(Name name) { return patterns.stream().anyMatch(pattern -> name.getUrn().startsWith(pattern)); }
Source:
private boolean isOffsetUsed(final int bucketOffset) { return tableMemory.getByte(bucketOffset) == 1; }

Target:
private boolean isOffsetUsed(final int bucketOffset) { return tableMemory.getByte(bucketOffset) == USED_BYTE; }
Source:
default boolean await(Duration timeout) throws IOException { return await(timeout.toMillis()); }

Target:
default boolean await(Duration timeout) throws IOException { return timeout != null ? await(timeout.toMillis()) : await(); }
Source:
private void onProxyOverrideComplete() { WebView webView = findViewById(R.id.proxy_override_webview); webView.setWebChromeClient(new WebChromeClient() { @Override public void onReceivedTitle(WebView view, String title) { Log.w(TAG, "Title received: " + title); } }); webView.loadUrl("<LINK_0>"); }

Target:
private void onProxyOverrideComplete() { mWebView.loadUrl("<LINK_1>"); }
Source:
public void writeColumnDefinition(Appendable out) throws IOException { out.append(" <Column ss:Width=\""); out.append(String.valueOf(columnWidth)); if (styleId != null) { out.append("\" ss:StyleID=\""); out.append(styleId); } out.append("\"/>\n"); }

Target:
public void writeColumnDefinition(Appendable out) throws IOException { out.append(" <Column ss:Width=\""); out.append(String.valueOf(columnWidth)); if (Strings.isValid(styleId)) { out.append("\" ss:StyleID=\""); out.append(styleId); } out.append("\"/>\n"); }
Source:
public WinConnection(String host, String username, String password) { this.host = host; this.username = username; this.password = password; this.smbclient = new SMBClient(); this.authentication = new AuthenticationContext(username, password.toCharArray(), null);; }

Target:
public WinConnection(String host, String username, String password) { this.host = host; this.username = username; this.password = password; this.smbclient = new SMBClient(); this.authentication = new AuthenticationContext(username, password.toCharArray(), null); }
Source:
public TaskInfo updateTask( Session session, Optional<PlanFragment> fragment, List<TaskSource> sources, OutputBuffers outputBuffers, BlockEncodingSerde blockEncodingSerde) { try { outputBuffer.setOutputBuffers(outputBuffers); SqlTaskExecution taskExecution; synchronized (this) { TaskHolder taskHolder = taskHolderReference.get(); if (taskHolder.isFinished()) { return taskHolder.getFinalTaskInfo(); } taskExecution = taskHolder.getTaskExecution(); if (taskExecution == null) { checkState(fragment.isPresent(), "fragment must be present"); if (fragment.get().getRoot() instanceof OutputNode) { TaskClientOutputContext clientOutputContext = new TaskClientOutputContext( fragment.get().getTypes(), new PagesSerdeFactory(blockEncodingSerde, isExchangeCompressionEnabled(session)).createPagesSerde(), session.toConnectorSession()); this.clientOutputContext.set(Optional.of(clientOutputContext)); } taskExecution = sqlTaskExecutionFactory.create(session, queryContext, taskStateMachine, outputBuffer, fragment.get(), sources); taskHolderReference.compareAndSet(taskHolder, new TaskHolder(taskExecution)); needsPlan.set(false); } } if (taskExecution != null) { taskExecution.addSources(sources); } } catch (Error e) { failed(e); throw e; } catch (RuntimeException e) { failed(e); } return getTaskInfo(); }

Target:
public TaskInfo updateTask( Session session, Optional<PlanFragment> fragment, List<TaskSource> sources, OutputBuffers outputBuffers, BlockEncodingSerde blockEncodingSerde) { try { outputBuffer.setOutputBuffers(outputBuffers); SqlTaskExecution taskExecution; synchronized (this) { TaskHolder taskHolder = taskHolderReference.get(); if (taskHolder.isFinished()) { return taskHolder.getFinalTaskInfo(); } taskExecution = taskHolder.getTaskExecution(); if (taskExecution == null) { checkState(fragment.isPresent(), "fragment must be present"); if (!clientOutputContext.get().isPresent() && fragment.get().getRoot() instanceof OutputNode) { TaskClientOutputContext clientOutputContext = new TaskClientOutputContext( fragment.get().getTypes(), new PagesSerdeFactory(blockEncodingSerde, isExchangeCompressionEnabled(session)).createPagesSerde(), session.toConnectorSession()); this.clientOutputContext.set(Optional.of(clientOutputContext)); } taskExecution = sqlTaskExecutionFactory.create(session, queryContext, taskStateMachine, outputBuffer, fragment.get(), sources); taskHolderReference.compareAndSet(taskHolder, new TaskHolder(taskExecution)); needsPlan.set(false); } } if (taskExecution != null) { taskExecution.addSources(sources); } } catch (Error e) { failed(e); throw e; } catch (RuntimeException e) { failed(e); } return getTaskInfo(); }
Source:
public void setUp() throws Exception { String simpleSchema = "create table blah (" + "ival bigint default 0 not null, " + "PRIMARY KEY(ival));"; builder = new VoltProjectBuilder(); builder.addLiteralSchema(simpleSchema); builder.addProcedures(CrashJVM.class); builder.addProcedures(CrashVoltDBProc.class); cluster = new LocalCluster("collect.jar", 2, 1, 0, BackendTarget.NATIVE_EE_JNI); cluster.setHasLocalServer(false); boolean success = cluster.compile(builder); assert (success); File voltDbRoot; cluster.startUp(true); if (cluster.isNewCli()) { voltDbRoot = new File(cluster.getServerSpecificVoltDBRoot("0")); } else { String voltDbFilePrefix = cluster.getSubRoots().get(0).getPath(); voltDbRoot = new File(voltDbFilePrefix, builder.getPathToVoltRoot().getPath()); } m_voltDbRootPath = voltDbRoot.getPath(); listener = cluster.getListenerAddresses().get(0); client = ClientFactory.createClient(); client.createConnection(listener); m_outputFileName = ""; m_pid = getpid(m_voltDbRootPath); m_prefix = ""; System.setProperty("VOLT_JUSTATEST", "true"); }

Target:
public void setUp() throws Exception { String simpleSchema = "create table blah (" + "ival bigint default 0 not null, " + "PRIMARY KEY(ival));"; builder = new VoltProjectBuilder(); builder.addLiteralSchema(simpleSchema); builder.addProcedures(CrashJVM.class); builder.addProcedures(CrashVoltDBProc.class); cluster = new LocalCluster("collect.jar", 2, 1, 0, BackendTarget.NATIVE_EE_JNI); cluster.setHasLocalServer(false); boolean success = cluster.compile(builder); assert (success); File voltDbRoot; cluster.startUp(true); if (cluster.isNewCli()) { voltDbRoot = new File(cluster.getServerSpecificRoot("0")); } else { String voltDbFilePrefix = cluster.getSubRoots().get(0).getPath(); voltDbRoot = new File(voltDbFilePrefix, builder.getPathToVoltRoot().getPath()); } m_voltDbRootPath = voltDbRoot.getPath(); listener = cluster.getListenerAddresses().get(0); client = ClientFactory.createClient(); client.createConnection(listener); m_outputFileName = ""; m_pid = getpid(m_voltDbRootPath); m_prefix = ""; System.setProperty("VOLT_JUSTATEST", "true"); }
Source:
protected void checkLeftCurly() { checkCurly("lcurly", getLeftCurly()); }

Target:
protected void checkLeftCurly() { final DetailAST lcurly = getLeftCurly(); final int lcurlyPos = expandedTabsColumnNo(lcurly); if (!curlyIndent().isAcceptable(lcurlyPos) && isOnStartOfLine(lcurly)) { logError(lcurly, "lcurly", lcurlyPos, curlyIndent()); } }
Source:
private AdminClient createAdminClient() { final Properties properties = new Properties(); properties.put(AdminClientConfig.BOOTSTRAP_SERVERS_CONFIG, CLUSTER.bootstrapServers()); return AdminClient.create(properties); }

Target:
private static AdminClient createAdminClient() { final Properties properties = new Properties(); properties.put(AdminClientConfig.BOOTSTRAP_SERVERS_CONFIG, CLUSTER.bootstrapServers()); return AdminClient.create(properties); }
Source:
public void tearDown() throws Exception { Intents.release(); TestUtils.deleteProjects(VisualPlacementBrickTest.class.getSimpleName()); }

Target:
public void tearDown() throws Exception { Intents.release(); baseActivityTestRule.finishActivity(); TestUtils.deleteProjects(SpriteActivityVisualPlacementTest.class.getSimpleName()); }
Source:
public Embedding(Dictionary dictionary, Matrix embedding) { this.dictionary = dictionary; this.embedding = embedding; }

Target:
public Embedding(Dictionary dictionary, Matrix embedding) { this.dictionary = Objects.requireNonNull(dictionary); this.embedding = Objects.requireNonNull(embedding); }
Source:
toFilter(ImmutableList<SubjectParameter<?, ?, ?>> params, LogicalOperator logicalOp) { ImmutableList.Builder<Filter> filters = ImmutableList.builder(); for (SubjectParameter<?, ?, ?> parameter : params) { Column<?, ?> column = parameter.column(); ComparisonOperator comparison = parameter.operator(); Object value = parameter.value(); @Nullable Filter filter; switch (comparison) { case EQUALS: filter = eq(column, value); break; case GREATER_THAN: filter = gt(column, value); break; case GREATER_OR_EQUALS: filter = ge(column, value); break; case LESS_THAN: filter = lt(column, value); break; case LESS_OR_EQUALS: filter = le(column, value); break; default: throw newIllegalStateException("Unsupported comparison operator `%s`", comparison); } filters.add(filter); } ImmutableList<Filter> filterList = filters.build(); CompositeFilter compositeFilter = logicalOp == LogicalOperator.AND ? all(filterList) : either(filterList); return compositeFilter; }

Target:
toFilter(ImmutableList<SubjectParameter<?, ?, ?>> params, LogicalOperator logicalOp) { ImmutableList.Builder<Filter> filters = ImmutableList.builder(); for (SubjectParameter<?, ?, ?> parameter : params) { Filter filter = asProtoFilter(parameter); filters.add(filter); } ImmutableList<Filter> filterList = filters.build(); CompositeFilter compositeFilter = logicalOp == LogicalOperator.AND ? all(filterList) : either(filterList); return compositeFilter; }
Source:
public String toString() { String returnString = ""; if(eventData !=null) { for (String key: eventData.keySet()){ String value = eventData.get(key); returnString = returnString + key + ": " + value + ", "; } } return returnString; }

Target:
public String toString() { return eventData.toString(); }
Source:
private Short getShortValue() { if ( realCellValue.getNumericValue() != null ) { return ( Short ) realCellValue.getNumericValue(); } else if ( realCellValue.getStringValue() == null || realCellValue.getStringValue().isEmpty() ) { return null; } else { return new Short( realCellValue.getStringValue() ); } }

Target:
private Short getShortValue() { if ( realCellValue.getNumericValue() != null ) { return ( Short ) realCellValue.getNumericValue(); } else if ( realCellValue.getStringValue() == null || realCellValue.getStringValue().isEmpty() ) { return null; } else { try { return new Short( realCellValue.getStringValue() ); } catch ( final NumberFormatException nfe ) { return null; } } }
Source:
public URI uploadPackage() { if (s3Client.doesObjectExist(bucket, remoteFilePath)) { s3Client.copyObject(bucket, remoteFilePath, bucket, previousVersionFilePath); } try { s3Client.putObject(bucket, remoteFilePath, packageFileHandler); } catch (SdkClientException e) { LOG.log(Level.SEVERE, "Error writing topology package to " + bucket + " " + remoteFilePath, e); return null; } final URL resourceUrl = s3Client.getUrl(bucket, remoteFilePath); LOG.log(Level.INFO, "Package URL: {0}", resourceUrl); if (resourceUrl == null) { LOG.log(Level.SEVERE, "Resource not found for bucket " + bucket + " and path " + remoteFilePath); return null; } try { return resourceUrl.toURI(); } catch (URISyntaxException e) { LOG.log(Level.SEVERE, e.getMessage()); return null; } }

Target:
public URI uploadPackage() { if (s3Client.doesObjectExist(bucket, remoteFilePath)) { s3Client.copyObject(bucket, remoteFilePath, bucket, previousVersionFilePath); } try { s3Client.putObject(bucket, remoteFilePath, packageFileHandler); } catch (SdkClientException e) { LOG.log(Level.SEVERE, "Error writing topology package to " + bucket + " " + remoteFilePath, e); return null; } final URL resourceUrl = s3Client.getUrl(bucket, remoteFilePath); LOG.log(Level.INFO, "Package URL: {0}", resourceUrl); if (resourceUrl == null) { LOG.log(Level.SEVERE, "Resource not found for bucket " + bucket + " and path " + remoteFilePath); return null; } try { return resourceUrl.toURI(); } catch (URISyntaxException e) { LOG.log(Level.SEVERE, "Could not convert URL " + resourceUrl + " to URI", e); return null; } }
Source:
public Value valueOf(@Nullable Object object) { if(object == null) { return nullValue(); } Class<?> type = object.getClass(); if(type.equals(Coordinate.class)) { return Factory.newValue(this, (Serializable) object); } if(type.equals(String.class)) { return valueOf((String) object); } if(type.equals(JSONArray.class)) { return valueOf(object.toString()); } if(type.equals(JSONObject.class)) { return valueOf(object.toString()); } throw new IllegalArgumentException( "Cannot construct " + getClass().getSimpleName() + " from type " + object.getClass() + "."); }

Target:
public Value valueOf(@Nullable Object object) { if(object == null) { return nullValue(); } return Factory.newValue(this, Coordinate.getCoordinateFrom(object)); }
Source:
public boolean step() { if (componentSystems.hasNext()) { try { currentSystem = componentSystems.next(); currentSystem.postBegin(); } catch(Exception e){ logger.error("Failed to load system : '" + currentSystem.toString() + "'"); } } return !componentSystems.hasNext(); }

Target:
public boolean step() { if (componentSystems.hasNext()) { try { currentSystem = componentSystems.next(); currentSystem.postBegin(); } catch (NoSuchElementException e) { logger.error("Failed to load system : '" + currentSystem.toString() + "'"); } } return !componentSystems.hasNext(); }
Source:
public MarkerAdapter(Consumer<CoreException> reporter) { this.reporter = reporter; }

Target:
public MarkerAdapter(Consumer<CoreException> reporter) { Objects.requireNonNull(reporter); this.reporter = reporter; }