auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public boolean isModified(DirCacheEntry entry, boolean forceContentCheck) { if (entry.isAssumeValid()) return false; if (entry.isUpdateNeeded()) return true; if (!entry.isSmudged() && (getEntryLength() != entry.getLength())) return true; int modeDiff = getEntryRawMode() ^ entry.getRawMode(); if (modeDiff != 0 && entry.getFileMode() != FileMode.SYMLINK) { if (!state.options.isFileMode()) modeDiff &= ~FileMode.EXECUTABLE_FILE.getBits(); if (modeDiff != 0) return true; } long cacheLastModified = entry.getLastModified(); long fileLastModified = getEntryLastModified(); if (cacheLastModified % 1000 == 0) fileLastModified = fileLastModified - fileLastModified % 1000; if (fileLastModified != cacheLastModified) { if (forceContentCheck) { return contentCheck(entry); } else { return true; } } else { if (entry.isSmudged()) { return contentCheck(entry); } else { return false; } } }

Target:
public boolean isModified(DirCacheEntry entry, boolean forceContentCheck) { if (entry.isAssumeValid()) return false; if (entry.isUpdateNeeded()) return true; if (!entry.isSmudged() && (getEntryLength() != entry.getLength())) return true; int modeDiff = getEntryRawMode() ^ entry.getRawMode(); if (modeDiff != 0 && !FileMode.SYMLINK.equals(entry.getRawMode())) { if (!state.options.isFileMode()) modeDiff &= ~FileMode.EXECUTABLE_FILE.getBits(); if (modeDiff != 0) return true; } long cacheLastModified = entry.getLastModified(); long fileLastModified = getEntryLastModified(); if (cacheLastModified % 1000 == 0) fileLastModified = fileLastModified - fileLastModified % 1000; if (fileLastModified != cacheLastModified) { if (forceContentCheck) { return contentCheck(entry); } else { return true; } } else { if (entry.isSmudged()) { return contentCheck(entry); } else { return false; } } }
Source:
private Transformer getTransformer(StreamSource streamSource) { net.sf.saxon.TransformerFactoryImpl impl = new net.sf.saxon.TransformerFactoryImpl(); try { return impl.newTransformer(streamSource); } catch (TransformerConfigurationException e) { e.printStackTrace(); } return null; }

Target:
private Transformer getTransformer(StreamSource streamSource) throws TransformerConfigurationException { return this.transformerFactory.newTransformer(streamSource); }
Source:
public void endProcessingNode() { if (nodeCount.decrementAndGet() == 0 && recorder != null) { Node node = rootNode.build(); trace.setTimestamp(node.getTimestamp()); trace.setTransaction(getTransaction()); trace.getNodes().add(node); if (checkForSamplingProperties(node)) { reportingLevel = ReportingLevel.All; } boolean sampled = sampler.isSampled(trace, reportingLevel); if (sampled && reportingLevel == null) { reportingLevel = ReportingLevel.All; } if (sampled) { recorder.report(trace); } rootNode.addProperty(this.serviceName); rootNode.addProperty(ENV_BUILD_STAMP); } }

Target:
public void endProcessingNode() { if (nodeCount.decrementAndGet() == 0 && recorder != null) { Node node = rootNode.build(); trace.setTimestamp(node.getTimestamp()); trace.setTransaction(getTransaction()); trace.getNodes().add(node); if (checkForSamplingProperties(node)) { reportingLevel = ReportingLevel.All; } boolean sampled = sampler.isSampled(trace, reportingLevel); if (sampled && reportingLevel == null) { reportingLevel = ReportingLevel.All; } if (sampled) { recorder.report(trace); } } }
Source:
public void testExportDanglingSources() throws Exception { int rowCount = 0; m_client = getClient(m_cluster); Object[] data = new Object[3]; Arrays.fill(data, 1); for (int i = 0; i < LOOP_COUNT; i++) { insertToStream(STREAM_NAME, rowCount, ROW_BATCH, m_client, data); rowCount += ROW_BATCH; } m_client.drain(); m_cluster.killSingleHost(0); m_cluster.killSingleHost(1); Thread.sleep(500); m_client = getClient(m_cluster); for (int i = 0; i < LOOP_COUNT; i++) { insertToStream(STREAM_NAME, rowCount, ROW_BATCH, m_client, data); rowCount += ROW_BATCH; } m_client.drain(); m_cluster.rejoinOne(1); Thread.sleep(500); m_cluster.recoverOne(0, null, ""); Thread.sleep(500); m_client = getClient(m_cluster); for (int i = 0; i < LOOP_COUNT; i++) { insertToStream(STREAM_NAME, rowCount, ROW_BATCH, m_client, data); rowCount += ROW_BATCH; } m_client.drain(); m_builder.addExport(true , ServerExportEnum.CUSTOM, "org.voltdb.exportclient.SocketExporter", createSocketExportProperties(STREAM_NAME, false ), TARGET_NAME); m_cluster.updateCatalog(m_builder); List<String> list = new ArrayList<>(1); list.add(STREAM_NAME); TestExportBaseSocketExport.waitForExportAllRowsDelivered(m_client, list); m_verifier.verifyRows(); assertTrue(m_cluster.verifyLogMessage(0, m_logPattern) || m_cluster.verifyLogMessage(1, m_logPattern) || m_cluster.verifyLogMessage(2, m_logPattern) || m_cluster.verifyLogMessage(3, m_logPattern) || m_cluster.verifyLogMessage(4, m_logPattern)); }

Target:
public void testExportDanglingSources() throws Exception { int rowCount = 0; m_client = getClient(m_cluster); Object[] data = new Object[] {1, 1, 1}; for (int i = 0; i < LOOP_COUNT; i++) { insertToStream(STREAM_NAME, rowCount, ROW_BATCH, m_client, data); rowCount += ROW_BATCH; } m_client.drain(); m_cluster.killSingleHost(0); m_cluster.killSingleHost(1); Thread.sleep(500); m_client = getClient(m_cluster); for (int i = 0; i < LOOP_COUNT; i++) { insertToStream(STREAM_NAME, rowCount, ROW_BATCH, m_client, data); rowCount += ROW_BATCH; } m_client.drain(); m_cluster.rejoinOne(1); Thread.sleep(500); m_cluster.recoverOne(0, null, ""); Thread.sleep(500); m_client = getClient(m_cluster); for (int i = 0; i < LOOP_COUNT; i++) { insertToStream(STREAM_NAME, rowCount, ROW_BATCH, m_client, data); rowCount += ROW_BATCH; } m_client.drain(); m_builder.addExport(true , ServerExportEnum.CUSTOM, "org.voltdb.exportclient.SocketExporter", createSocketExportProperties(STREAM_NAME, false ), TARGET_NAME); m_cluster.updateCatalog(m_builder); List<String> list = ImmutableList.of(STREAM_NAME); TestExportBaseSocketExport.waitForExportAllRowsDelivered(m_client, list); m_verifier.verifyRows(); assertTrue(m_cluster.anyHostHasLogMessage(m_logPattern)); }
Source:
public int computeNumberOfFixes(CompilationUnit compilationUnit) { int result= 0; IProblem[] problems= compilationUnit.getProblems(); if (isEnabled(CleanUpConstants.REMOVE_UNUSED_CODE_IMPORTS) && !isEnabled(CleanUpConstants.ORGANIZE_IMPORTS)) { for (int i=0;i<problems.length;i++) { int id= problems[i].getID(); if (id == IProblem.UnusedImport || id == IProblem.DuplicateImport || id == IProblem.ConflictingImport || id == IProblem.CannotImportPackage || id == IProblem.ImportNotFound) result++; } } if (isEnabled(CleanUpConstants.REMOVE_UNUSED_CODE_PRIVATE_MEMBERS) && isEnabled(CleanUpConstants.REMOVE_UNUSED_CODE_PRIVATE_METHODS)) result+= getNumberOfProblems(problems, IProblem.UnusedPrivateMethod); if (isEnabled(CleanUpConstants.REMOVE_UNUSED_CODE_PRIVATE_MEMBERS) && isEnabled(CleanUpConstants.REMOVE_UNUSED_CODE_PRIVATE_CONSTRUCTORS)) result+= getNumberOfProblems(problems, IProblem.UnusedPrivateConstructor); if (isEnabled(CleanUpConstants.REMOVE_UNUSED_CODE_PRIVATE_MEMBERS) && isEnabled(CleanUpConstants.REMOVE_UNUSED_CODE_PRIVATE_TYPES)) result+= getNumberOfProblems(problems, IProblem.UnusedPrivateType); if (isEnabled(CleanUpConstants.REMOVE_UNUSED_CODE_PRIVATE_MEMBERS) && isEnabled(CleanUpConstants.REMOVE_UNUSED_CODE_PRIVATE_FELDS)) result+= getNumberOfProblems(problems, IProblem.UnusedPrivateField); if (isEnabled(CleanUpConstants.REMOVE_UNUSED_CODE_LOCAL_VARIABLES)) result+= getNumberOfProblems(problems, IProblem.LocalVariableIsNeverUsed); return result; }

Target:
public int computeNumberOfFixes(CompilationUnit compilationUnit) { int result= 0; IProblem[] problems= compilationUnit.getProblems(); if (isEnabled(CleanUpConstants.REMOVE_UNUSED_CODE_IMPORTS) && !isEnabled(CleanUpConstants.ORGANIZE_IMPORTS)) { for (IProblem problem : problems) { int id= problem.getID(); if (id == IProblem.UnusedImport || id == IProblem.DuplicateImport || id == IProblem.ConflictingImport || id == IProblem.CannotImportPackage || id == IProblem.ImportNotFound) result++; } } if (isEnabled(CleanUpConstants.REMOVE_UNUSED_CODE_PRIVATE_MEMBERS) && isEnabled(CleanUpConstants.REMOVE_UNUSED_CODE_PRIVATE_METHODS)) result+= getNumberOfProblems(problems, IProblem.UnusedPrivateMethod); if (isEnabled(CleanUpConstants.REMOVE_UNUSED_CODE_PRIVATE_MEMBERS) && isEnabled(CleanUpConstants.REMOVE_UNUSED_CODE_PRIVATE_CONSTRUCTORS)) result+= getNumberOfProblems(problems, IProblem.UnusedPrivateConstructor); if (isEnabled(CleanUpConstants.REMOVE_UNUSED_CODE_PRIVATE_MEMBERS) && isEnabled(CleanUpConstants.REMOVE_UNUSED_CODE_PRIVATE_TYPES)) result+= getNumberOfProblems(problems, IProblem.UnusedPrivateType); if (isEnabled(CleanUpConstants.REMOVE_UNUSED_CODE_PRIVATE_MEMBERS) && isEnabled(CleanUpConstants.REMOVE_UNUSED_CODE_PRIVATE_FELDS)) result+= getNumberOfProblems(problems, IProblem.UnusedPrivateField); if (isEnabled(CleanUpConstants.REMOVE_UNUSED_CODE_LOCAL_VARIABLES)) result+= getNumberOfProblems(problems, IProblem.LocalVariableIsNeverUsed); return result; }
Source:
public byte[] download(URI uri) throws Exception { byte[] data; try { HttpClient client = Central.getWorkspace() .getPlugin(HttpClient.class); if (client == null) client = new HttpClient(); Pair<String, byte[]> cachedTag = cache.get(uri); if (cachedTag == null) { TaggedData td = client.connectTagged(uri.toURL()); if (td == null || td.isNotFound()) throw new FileNotFoundException("Not found"); data = IO.read(td.getInputStream()); if (td.getTag() != null) cache.put(uri, new Pair<String, byte[]>(td.getTag(), data)); } else { TaggedData td = client.connectTagged(uri.toURL(), cachedTag.getFirst()); if (td == null || td.isNotFound()) throw new FileNotFoundException("Not found"); if (td.getResponseCode() == 304) { data = cachedTag.getSecond(); } else { data = IO.read(td.getInputStream()); if (td.getTag() == null) { cache.remove(uri); } else { cache.put(uri, new Pair<String, byte[]>(td.getTag(), data)); } } } return data; } catch (IOException e) { throw e; } catch (Exception e) { throw new IOException(e); } }

Target:
public byte[] download(URI uri) throws Exception { byte[] data; try { HttpClient client = Central.getWorkspace() .getPlugin(HttpClient.class); Pair<String, byte[]> cachedTag = cache.get(uri); if (cachedTag == null) { TaggedData td = client.connectTagged(uri.toURL()); if (td == null || td.isNotFound()) throw new FileNotFoundException("Not found"); data = IO.read(td.getInputStream()); if (td.getTag() != null) cache.put(uri, new Pair<String, byte[]>(td.getTag(), data)); } else { TaggedData td = client.connectTagged(uri.toURL(), cachedTag.getFirst()); if (td == null || td.isNotFound()) throw new FileNotFoundException("Not found"); if (td.getResponseCode() == 304) { data = cachedTag.getSecond(); } else { data = IO.read(td.getInputStream()); if (td.getTag() == null) { cache.remove(uri); } else { cache.put(uri, new Pair<String, byte[]>(td.getTag(), data)); } } } return data; } catch (IOException e) { throw e; } catch (Exception e) { throw new IOException(e); } }
Source:
public Long create(Sample sample) throws IOException { loadChildEntities(sample); authorizationManager.throwIfNotWritable(sample); setChangeDetails(sample); if (isDetailedSample(sample)) { if (!isIdentitySample(sample)) { DetailedSample detailed = (DetailedSample) sample; try { detailed.setParent(findOrCreateParent(detailed)); detailed.inheritPermissions(detailed.getParent()); if (detailed.getParent().hasNonStandardAlias()) { detailed.setNonStandardAlias(true); } } catch (MisoNamingException e) { throw new IOException(e.getMessage(), e); } validateHierarchy(detailed); if (detailed.getDetailedQcStatus() != null) { detailed.setQcPassed(detailed.getDetailedQcStatus().getStatus()); } } } sample.setName(generateTemporaryName()); if (isDetailedSample(sample) && ((DetailedSample) sample).hasNonStandardAlias()) { } else if (isStringEmptyOrNull(sample.getAlias()) && sampleNamingScheme.hasGeneratorFor("alias")) { sample.setAlias(generateTemporaryName()); } else { validateAliasUniqueness(sample.getAlias()); } if (isStockSample(sample) || isAliquotSample(sample) || isTissueProcessingSample(sample)) { DetailedSample detailed = (DetailedSample) sample; if (detailed.getParent() != null && detailed.getSiblingNumber() == null) { int siblingNumber = sampleDao.getNextSiblingNumber(detailed.getParent(), detailed.getSampleClass()); detailed.setSiblingNumber(siblingNumber); } } return save(sample).getId(); }

Target:
public Long create(Sample sample) throws IOException { loadChildEntities(sample); authorizationManager.throwIfNotWritable(sample); setChangeDetails(sample); if (isDetailedSample(sample)) { if (!isIdentitySample(sample)) { DetailedSample detailed = (DetailedSample) sample; try { detailed.setParent(findOrCreateParent(detailed)); detailed.inheritPermissions(detailed.getParent()); if (detailed.getParent().hasNonStandardAlias()) { detailed.setNonStandardAlias(true); } } catch (MisoNamingException e) { throw new IOException(e.getMessage(), e); } validateHierarchy(detailed); } } sample.setName(generateTemporaryName()); if (isDetailedSample(sample) && ((DetailedSample) sample).hasNonStandardAlias()) { } else if (isStringEmptyOrNull(sample.getAlias()) && sampleNamingScheme.hasGeneratorFor("alias")) { sample.setAlias(generateTemporaryName()); } else { validateAliasUniqueness(sample.getAlias()); } if (isStockSample(sample) || isAliquotSample(sample) || isTissueProcessingSample(sample)) { DetailedSample detailed = (DetailedSample) sample; if (detailed.getParent() != null && detailed.getSiblingNumber() == null) { int siblingNumber = sampleDao.getNextSiblingNumber(detailed.getParent(), detailed.getSampleClass()); detailed.setSiblingNumber(siblingNumber); } } return save(sample).getId(); }
Source:
public boolean hasNext() { if (maxPayloads > 0 && count >= maxPayloads) { return false; } return randomOrder ? true : iterator.hasNext(); }

Target:
public boolean hasNext() { if(randomOrder){ return count < maxPayloads; } if (maxPayloads > 0 && count >= maxPayloads) { return false; } return iterator.hasNext(); }
Source:
public void deleteColumn(EntityId entityId, String family, String qualifier, long upToTimestamp) throws IOException { final State state = mState.get(); Preconditions.checkState(state == State.OPEN, "Cannot delete column while KijiTableWriter %s is in state %s.", this, state); final HBaseColumnName hbaseColumnName = mWriterLayoutCapsule.getColumnNameTranslator() .toHBaseColumnName(new KijiColumnName(family, qualifier)); final DeleteRequest delete = new DeleteRequest( Bytes.toBytes(mTable.getName()), entityId.getHBaseRowKey(), hbaseColumnName.getFamily(), hbaseColumnName.getQualifier(), upToTimestamp); delete.setDeleteAtTimestampOnly(false); try { mHBClient.delete(delete).join(); } catch (Exception e) { ZooKeeperUtils.wrapAndRethrow(e); } }

Target:
public void deleteColumn(EntityId entityId, String family, String qualifier, long upToTimestamp) throws IOException { final State state = mState.get(); Preconditions.checkState(state == State.OPEN, "Cannot delete column while KijiTableWriter %s is in state %s.", this, state); final HBaseColumnName hbaseColumnName = mWriterLayoutCapsule.getColumnNameTranslator() .toHBaseColumnName(new KijiColumnName(family, qualifier)); final DeleteRequest delete = new DeleteRequest( mTableName, entityId.getHBaseRowKey(), hbaseColumnName.getFamily(), hbaseColumnName.getQualifier(), upToTimestamp); delete.setDeleteAtTimestampOnly(false); try { mHBClient.delete(delete).join(); } catch (Exception e) { ZooKeeperUtils.wrapAndRethrow(e); } }
Source:
public PypiArtifactCoordinates() { this(DISTRIBUTION, VERSION, "", LANGUAGE_IMPLEMENTATION_VERSION, ABI, PLATFORM, WHEEL_EXTENSION); }

Target:
public PypiArtifactCoordinates() { resetCoordinates(DISTRIBUTION, VERSION, BUILD, LANGUAGE_IMPLEMENTATION_VERSION, ABI, PLATFORM, PACKAGING); }
Source:
private void setDefaults() { IPreferenceStore store = GdbUIPlugin.getDefault().getPreferenceStore(); setInvertedColors(store.getBoolean(IGdbDebugPreferenceConstants.PREF_CONSOLE_INVERTED_COLORS)); int bufferSize = store.getInt(IGdbDebugPreferenceConstants.PREF_CONSOLE_BUFFERLINES); fTerminalControl.setBufferLineLimit(bufferSize); }

Target:
private void setDefaults() { IPreferenceStore store = GdbUIPlugin.getDefault().getPreferenceStore(); setInvertedColors(store.getBoolean(IGdbDebugPreferenceConstants.PREF_CONSOLE_INVERTED_COLORS)); setBufferLineLimit(store.getInt(IGdbDebugPreferenceConstants.PREF_CONSOLE_BUFFERLINES)); }
Source:
private SynchronizationModel resolveModelsWithLocal(IStorageProviderAccessor storageAccessor, IFile left, IStorage right, IStorage origin, ThreadSafeProgressMonitor monitor) throws InterruptedException { if (getResolutionScope() != CrossReferenceResolutionScope.SELF) { final SynchronizedResourceSet resourceSet = new SynchronizedResourceSet( new MonitoredProxyCreationListener(monitor, false)); updateDependencies(resourceSet, left, monitor); updateChangedResources(resourceSet, monitor); } while (!currentlyResolving.isEmpty()) { resolutionEnd.await(); } if (monitor.isCanceled()) { throw new OperationCanceledException(); } addModelDependenciesFromCustomProviders(left); final Set<IStorage> leftTraversal = resolveTraversal(left, Collections.<URI> emptySet()); return resolveRemoteTraversals(storageAccessor, leftTraversal, right, origin, monitor); }

Target:
private SynchronizationModel resolveModelsWithLocal(IStorageProviderAccessor storageAccessor, IFile left, IStorage right, IStorage origin, ThreadSafeProgressMonitor monitor) throws InterruptedException { if (getResolutionScope() != CrossReferenceResolutionScope.SELF) { final SynchronizedResourceSet resourceSet = new SynchronizedResourceSet( new MonitoredProxyCreationListener(monitor, false)); updateDependencies(resourceSet, left, monitor); updateChangedResources(resourceSet, monitor); } while (!currentlyResolving.isEmpty()) { resolutionEnd.await(); } if (monitor.isCanceled()) { throw new OperationCanceledException(); } lock.lock(); try { addModelDependenciesFromCustomProviders(left); } finally { lock.unlock(); } final Set<IStorage> leftTraversal = resolveTraversal(left, Collections.<URI> emptySet()); return resolveRemoteTraversals(storageAccessor, leftTraversal, right, origin, monitor); }
Source:
public void bootstrap(List<Task> tasks) { try { Map<String, ZkWorker> existingTasks = Maps.newHashMap(); Set<String> existingWorkers = Sets.newHashSet(cf.getChildren().forPath(config.getIndexerAnnouncementPath())); for (String existingWorker : existingWorkers) { Worker worker = jsonMapper.readValue( cf.getData() .forPath( JOINER.join( config.getIndexerAnnouncementPath(), existingWorker ) ), Worker.class ); ZkWorker zkWorker = addWorker(worker); List<String> runningTasks = cf.getChildren() .forPath(JOINER.join(config.getIndexerStatusPath(), existingWorker)); for (String runningTask : runningTasks) { existingTasks.put(runningTask, zkWorker); } } for (Task task : tasks) { TaskRunnerWorkItem taskRunnerWorkItem = new TaskRunnerWorkItem( task, SettableFuture.<TaskStatus>create(), new DateTime() ); ZkWorker zkWorker = existingTasks.remove(task.getId()); if (zkWorker != null) { runningTasks.put(task.getId(), taskRunnerWorkItem); zkWorker.addRunningTask(task); } else { addPendingTask(taskRunnerWorkItem); } } for (String existingTask : existingTasks.keySet()) { shutdown(existingTask); } } catch (Exception e) { throw Throwables.propagate(e); } init(); }

Target:
public void bootstrap(List<Task> tasks) { try { if (!started) { throw new ISE("Must start RTR first before calling bootstrap!"); } Set<String> existingTasks = Sets.newHashSet(); for (ZkWorker zkWorker : zkWorkers.values()) { existingTasks.addAll(zkWorker.getRunningTasks().keySet()); } for (Task task : tasks) { if (existingTasks.contains(task.getId())) { log.info("Bootstrap found %s running.", task.getId()); runningTasks.put( task.getId(), new RemoteTaskRunnerWorkItem(task, SettableFuture.<TaskStatus>create()) ); } else { log.info("Bootstrap didn't find %s running. Running it again", task.getId()); run(task); } } } catch (Exception e) { throw Throwables.propagate(e); } }
Source:
public TopologyDescriptor(long topologyConfigId, @NonNull List<ClusterDescriptor> activeClusters, @NonNull List<ClusterDescriptor> standbyClusters) { this.topologyConfigId = topologyConfigId; this.activeClusters = new HashMap<>(); this.standbyClusters = new HashMap<>(); if(activeClusters != null) { activeClusters.forEach(activeCluster -> this.activeClusters.put(activeCluster.getClusterId(), activeCluster)); } if(standbyClusters != null) { standbyClusters.forEach(activeCluster -> this.standbyClusters.put(activeCluster.getClusterId(), activeCluster)); } }

Target:
public TopologyDescriptor(long topologyConfigId, @NonNull List<ClusterDescriptor> activeClusters, @NonNull List<ClusterDescriptor> standbyClusters) { this.topologyConfigId = topologyConfigId; this.activeClusters = new HashMap<>(); this.standbyClusters = new HashMap<>(); this.invalidClusters = new HashMap<>(); if(activeClusters != null) { activeClusters.forEach(activeCluster -> this.activeClusters.put(activeCluster.getClusterId(), activeCluster)); } if(standbyClusters != null) { standbyClusters.forEach(standbyCluster -> this.standbyClusters.put(standbyCluster.getClusterId(), standbyCluster)); } }
Source:
RsWithBody(final Response res, final Body body) { super( new RsOf( () -> RsWithBody.append(res, body.length()), body::stream ) ); }

Target:
RsWithBody(final Response res, final Body body) { super( new ResponseOf( () -> { final String header = "Content-Length"; return new RsWithHeader( new RsWithoutHeader(res, header), header, Integer.toString(body.length()) ).head(); }, body::stream ) ); }
Source:
public void put(ThreadState state) { cluster.add(state.randomKey(), Integer.MAX_VALUE, state.randomValue()); }

Target:
public OperationFuture<Boolean> put(ThreadState state) { return client.add(state.randomKey(), ttl, state.randomValue(), state.transcoder()); }
Source:
public GitInfo() { Resource resource = new ClassPathResource("/git.properties"); Properties props = new Properties(); try { props = PropertiesLoaderUtils.loadProperties(resource); } catch (Exception e) { log.error("Could not get the git commit info", e); } this.branch = getPropertyValue(props, "git.branch"); this.describe = getPropertyValue(props, "git.commit.id.describe"); this.commitId = getPropertyValue(props, "git.commit.id"); this.commitIdAbbrev = getPropertyValue(props, "git.commit.id.abbrev"); this.commitUserName = getPropertyValue(props, "git.commit.user.name"); this.commitUserEmail = getPropertyValue(props, "git.commit.user.email"); this.commitMessageFull = getPropertyValue(props, "git.commit.message.full"); this.commitMessageShort = getPropertyValue(props, "git.commit.message.short"); this.commitTime = getPropertyValue(props, "git.commit.time"); this.buildUserName = getPropertyValue(props, "git.build.user.name"); this.buildUserEmail = getPropertyValue(props, "git.build.user.email"); this.buildTime = getPropertyValue(props, "git.build.time"); }

Target:
public GitInfo() { Resource resource = new ClassPathResource("/git.properties"); Properties props = new Properties(); try { props = PropertiesLoaderUtils.loadProperties(resource); } catch (Exception e) { log.warn("Could not get the git commit info", e); } this.branch = getPropertyValue(props, "git.branch"); this.describe = getPropertyValue(props, "git.commit.id.describe"); this.commitId = getPropertyValue(props, "git.commit.id"); this.commitIdAbbrev = getPropertyValue(props, "git.commit.id.abbrev"); this.commitUserName = getPropertyValue(props, "git.commit.user.name"); this.commitUserEmail = getPropertyValue(props, "git.commit.user.email"); this.commitMessageFull = getPropertyValue(props, "git.commit.message.full"); this.commitMessageShort = getPropertyValue(props, "git.commit.message.short"); this.commitTime = getPropertyValue(props, "git.commit.time"); this.buildUserName = getPropertyValue(props, "git.build.user.name"); this.buildUserEmail = getPropertyValue(props, "git.build.user.email"); this.buildTime = getPropertyValue(props, "git.build.time"); }
Source:
public String[] getServiceCheckTags() { List<String> tags = new ArrayList<String>(); if (this.instanceMap.get("host") != null) { tags.add("jmx_server:" + this.instanceMap.get("host")); } if (this.tags != null) { for (Entry<String, String> e : this.tags.entrySet()) { if (e.getValue() != null) { tags.add(e.getKey() + ":" + e.getValue()); } else { tags.add(e.getKey()); } } } tags.add("instance:" + this.instanceName); if (this.service != null && this.service != "") { tags.add("service:" + this.service); } if (this.emptyDefaultHostname) { tags.add("host:"); } return tags.toArray(new String[tags.size()]); }

Target:
public String[] getServiceCheckTags() { List<String> tags = new ArrayList<String>(); if (this.instanceMap.get("host") != null) { tags.add("jmx_server:" + this.instanceMap.get("host")); } if (this.tags != null) { for (Entry<String, String> e : this.tags.entrySet()) { if (e.getValue() != null) { tags.add(e.getKey() + ":" + e.getValue()); } else { tags.add(e.getKey()); } } } tags.add("instance:" + this.instanceName); if (this.service != null && !this.service.isEmpty()) { tags.add("service:" + this.service); } if (this.emptyDefaultHostname) { tags.add("host:"); } return tags.toArray(new String[tags.size()]); }
Source:
protected ResourceInfo getResourceInfo( ResourceRequest resourceRequest, String site, boolean isEnterprise, StringBuilder federatedSite, Map<String, Serializable> requestProperties, boolean fanoutEnabled) throws ResourceNotSupportedException, ResourceNotFoundException { ResourceInfo resourceInfo; Query query = null; URI resourceUri = null; String name = resourceRequest.getAttributeName(); Object value = resourceRequest.getAttributeValue(); if (value instanceof URI) { resourceUri = (URI) value; } try { query = createPropertyIsEqualToQuery( resourceRequest.getAttributeName(), resourceRequest.getAttributeValue().toString()); QueryRequest queryRequest = new QueryRequestImpl( anyTag(query, site, isEnterprise), isEnterprise, Collections.singletonList(site == null ? this.getId() : site), resourceRequest.getProperties()); resourceInfo = getResourceInfo( queryRequest, resourceUri, requestProperties, federatedSite, fanoutEnabled); } catch (UnsupportedQueryException | FederationException e) { throw new ResourceNotFoundException(DEFAULT_RESOURCE_NOT_FOUND_MESSAGE, e); } if (resourceInfo.getResourceUri() == null) { throw new ResourceNotFoundException(DEFAULT_RESOURCE_NOT_FOUND_MESSAGE); } LOGGER.debug("Returning resourceURI: {}", resourceInfo.getResourceUri()); return resourceInfo; }

Target:
protected ResourceInfo getResourceInfo( ResourceRequest resourceRequest, String site, boolean isEnterprise, StringBuilder federatedSite, Map<String, Serializable> requestProperties, boolean fanoutEnabled) throws ResourceNotSupportedException, ResourceNotFoundException { ResourceInfo resourceInfo; Query query; String attributeName = resourceRequest.getAttributeName(); Object attributeValue = resourceRequest.getAttributeValue(); try { query = createPropertyIsEqualToQuery(attributeName, attributeValue.toString()); QueryRequest queryRequest = new QueryRequestImpl( anyTag(query, site, isEnterprise), isEnterprise, Collections.singletonList(site == null ? this.getId() : site), resourceRequest.getProperties()); QueryResponse queryResponse = queryOperations.query(queryRequest, null, true, fanoutEnabled); if (queryResponse.getResults().isEmpty()) { throw new ResourceNotFoundException( String.format( "Could not find a metacard with a %s of %s.", attributeName, attributeValue.toString())); } if (queryResponse.getResults().size() > 1) { throw new UnsupportedQueryException( String.format( "found multiple metacards with a %s of %s.", attributeName, attributeValue.toString())); } resourceInfo = getResourceInfo(queryResponse, attributeValue, requestProperties, federatedSite); } catch (UnsupportedQueryException | FederationException e) { throw new ResourceNotFoundException(DEFAULT_RESOURCE_NOT_FOUND_MESSAGE, e); } if (resourceInfo.getResourceUri() == null) { throw new ResourceNotFoundException(DEFAULT_RESOURCE_NOT_FOUND_MESSAGE); } LOGGER.debug("Returning resourceURI: {}", resourceInfo.getResourceUri()); return resourceInfo; }
Source:
public void validate() { super.validate(); if (Strings.isNullOrEmpty(username) ^ Strings.isNullOrEmpty(password)) { throw new IllegalArgumentException("You must either set both username and password or " + "neither username nor password."); } try { InternetAddress[] addresses = InternetAddress.parse(sender); if (addresses.length == 0) { throw new IllegalArgumentException("Must specify a sender email address."); } if (addresses.length > 1) { throw new IllegalArgumentException(String.format( "%s is an invalid sender email address. Only one sender is supported.", sender)); } } catch (AddressException e) { throw new IllegalArgumentException( String.format("%s is an invalid sender email address. Reason: %s", sender, e.getMessage())); } try { InternetAddress.parse(sender); } catch (AddressException e) { throw new IllegalArgumentException( String.format("%s is an invalid list of recipient email addresses. Reason: %s", recipients, e.getMessage())); } }

Target:
public void validate() { super.validate(); if (Strings.isNullOrEmpty(username) ^ Strings.isNullOrEmpty(password)) { throw new IllegalArgumentException("You must either set both username and password or " + "neither username nor password."); } try { InternetAddress[] addresses = InternetAddress.parse(sender); if (addresses.length == 0) { throw new IllegalArgumentException("Must specify a sender email address."); } if (addresses.length > 1) { throw new IllegalArgumentException(String.format( "%s is an invalid sender email address. Only one sender is supported.", sender)); } } catch (AddressException e) { throw new IllegalArgumentException( String.format("%s is an invalid sender email address. Reason: %s", sender, e.getMessage())); } try { InternetAddress.parse(recipients); } catch (AddressException e) { throw new IllegalArgumentException( String.format("%s is an invalid list of recipient email addresses. Reason: %s", recipients, e.getMessage())); } }
Source:
protected void readNativeField(JsonParser par, Native.Builder nativ, String fieldName) throws IOException { switch (fieldName) { case "request": nativ.setRequest(par.getText()); break; case "request_native": readNativeAsObject(nativ, par); break; case "ver": nativ.setVer(par.getText()); break; case "api": for (startArray(par); endArray(par); par.nextToken()) { APIFramework value = APIFramework.valueOf(par.getIntValue()); if (checkEnum(value)) { nativ.addApi(value); } } break; case "battr": for (startArray(par); endArray(par); par.nextToken()) { CreativeAttribute value = CreativeAttribute.valueOf(par.getIntValue()); if (checkEnum(value)) { nativ.addBattr(value); } } break; default: readOther(nativ, par, fieldName); } }

Target:
protected void readNativeField(JsonParser par, Native.Builder nativ, String fieldName) throws IOException { switch (fieldName) { case "request": { OpenRtbNativeJsonReader nativeReader = factory().newNativeReader(); if(par.getCurrentToken() == JsonToken.VALUE_STRING) { nativ.setRequestNative(nativeReader.readNativeRequest(new CharArrayReader( par.getTextCharacters(), par.getTextOffset(), par.getTextLength()))); } else { nativ.setRequestNative(nativeReader.readNativeRequest(par)); } } break; case "ver": nativ.setVer(par.getText()); break; case "api": for (startArray(par); endArray(par); par.nextToken()) { APIFramework value = APIFramework.valueOf(par.getIntValue()); if (checkEnum(value)) { nativ.addApi(value); } } break; case "battr": for (startArray(par); endArray(par); par.nextToken()) { CreativeAttribute value = CreativeAttribute.valueOf(par.getIntValue()); if (checkEnum(value)) { nativ.addBattr(value); } } break; default: readOther(nativ, par, fieldName); } }
Source:
public void onPartitionsRevoked(Collection<TopicPartition> partitions) { LOG.debug("onPartitionsRevoked: from topic {}", threadId, topicName); StateRepository<String, String> offsetRepository = endpoint.getConfiguration().getOffsetRepository(); for (TopicPartition partition : partitions) { String offsetKey = serializeOffsetKey(partition); Long offset = lastProcessedOffset.get(offsetKey); if (offset == null) { offset = -1L; } LOG.debug("Saving offset repository state from offsetKey with offset: {}", threadId, offsetKey, offset); try { commitOffset(offsetRepository, partition, offset, true); } catch (java.lang.Exception e) { LOG.error("Error saving offset repository state from offsetKey with offset: {}", threadId, offsetKey, offset); throw e; } finally { lastProcessedOffset.clear(); } lastProcessedOffset.remove(offsetKey); } }

Target:
public void onPartitionsRevoked(Collection<TopicPartition> partitions) { LOG.debug("onPartitionsRevoked: from topic {}", threadId, topicName); StateRepository<String, String> offsetRepository = endpoint.getConfiguration().getOffsetRepository(); for (TopicPartition partition : partitions) { String offsetKey = serializeOffsetKey(partition); Long offset = lastProcessedOffset.get(offsetKey); if (offset == null) { offset = -1L; } LOG.debug("Saving offset repository state from offsetKey with offset: {}", threadId, offsetKey, offset); try { commitOffset(offsetRepository, partition, offset, true); } catch (java.lang.Exception e) { LOG.error("Error saving offset repository state from offsetKey with offset: {}", threadId, offsetKey, offset); throw e; } finally { lastProcessedOffset.remove(offsetKey); } } }
Source:
public AbstractGenericScanFilter() { this( (filterData, value) -> { return filterData.contains((Object) value); }); }

Target:
public AbstractGenericScanFilter() { this((filterData, value) -> filterData.contains((Object) value)); }
Source:
public Builder<EvictionConfiguration> configure(OperationContext context, ModelNode model) throws OperationFailedException { EvictionStrategy strategy = ModelNodes.asEnum(STRATEGY.getDefinition().resolveModelAttribute(context, model), EvictionStrategy.class); if (strategy.isEnabled()) { this.builder.type(EvictionType.COUNT).size(MAX_ENTRIES.getDefinition().resolveModelAttribute(context, model).asLong()); } return this; }

Target:
public Builder<EvictionConfiguration> configure(OperationContext context, ModelNode model) throws OperationFailedException { EvictionStrategy strategy = ModelNodes.asEnum(STRATEGY.getDefinition().resolveModelAttribute(context, model), EvictionStrategy.class); this.builder.strategy(strategy); if (strategy.isEnabled()) { this.builder.type(EvictionType.COUNT).size(MAX_ENTRIES.getDefinition().resolveModelAttribute(context, model).asLong()); } return this; }
Source:
private void startHostsWithPMInReboot(List<VDS> hosts) { final List<VDS> hostsWithPMInReboot = hosts.stream() .filter(host -> host.isPmEnabled() && host.getStatus() == VDSStatus.Reboot).collect(Collectors.toList()); if (hostsWithPMInReboot.size() > 0) { Runnable task = () -> { waitUntilFencingAllowed(); startHosts(hostsWithPMInReboot); }; ThreadPoolUtil.execute(task); } }

Target:
private void startHostsWithPMInReboot(List<VDS> hosts) { final List<VDS> hostsWithPMInReboot = hosts.stream() .filter(host -> host.isPmEnabled()) .filter(host -> host.getStatus() == VDSStatus.Reboot) .collect(Collectors.toList()); if (hostsWithPMInReboot.size() > 0) { ThreadPoolUtil.execute(() -> { waitUntilFencingAllowed(); startHosts(hostsWithPMInReboot); }); } }
Source:
private ICPPASTCapture capture() throws EndOfFileException, BacktrackException { final int offset= LA().getOffset(); final ICPPASTCapture result = getNodeFactory().newCapture(); switch (LT(1)) { case IToken.t_this: return setRange(result, offset, consume().getEndOffset()); case IToken.tAMPER: consume(); result.setIsByReference(true); break; } final IASTName identifier= identifier(); result.setIdentifier(identifier); switch(LT(1)) { case IToken.tELLIPSIS: result.setIsPackExpansion(true); return setRange(result, offset, consume().getEndOffset()); case IToken.tASSIGN: { consume(); IASTDeclarator declarator = getNodeFactory().newDeclarator(identifier); IASTInitializerClause initClause = initClause(false); declarator.setInitializer(getNodeFactory().newEqualsInitializer(initClause)); ICPPASTInitCapture initResult = getNodeFactory().newInitCapture(declarator); return setRange(initResult, offset, calculateEndOffset(initClause)); } case IToken.tLBRACE: case IToken.tLPAREN: { IASTDeclarator declarator = getNodeFactory().newDeclarator(identifier); IASTInitializer initializer = bracedOrCtorStyleInitializer(); declarator.setInitializer(initializer); ICPPASTInitCapture initResult = getNodeFactory().newInitCapture(declarator); return setRange(initResult, offset, calculateEndOffset(initializer)); } } return setRange(result, offset, calculateEndOffset(identifier)); }

Target:
private ICPPASTCapture capture() throws EndOfFileException, BacktrackException { final int offset = LA().getOffset(); ICPPASTCapture result = getNodeFactory().newCapture(); boolean referenceCapture = false; switch (LT(1)) { case IToken.t_this: return setRange(result, offset, consume().getEndOffset()); case IToken.tAMPER: consume(); referenceCapture = true; break; } final IASTName identifier = identifier(); result.setIdentifier(identifier); setRange(result, offset, calculateEndOffset(identifier)); switch(LT(1)) { case IToken.tASSIGN: result = createInitCapture(identifier, equalsInitalizerClause(false), offset); break; case IToken.tLBRACE: case IToken.tLPAREN: result = createInitCapture(identifier, bracedOrCtorStyleInitializer(), offset); break; } result.setIsByReference(referenceCapture); if (LT(1) == IToken.tELLIPSIS) { result.setIsPackExpansion(true); return setRange(result, offset, consume().getEndOffset()); } return result; }
Source:
public void onRemoval(RemovalNotification<Path, Long> notification) { Path path = notification.getKey(); CacheRange cacheRange = persistedRanges.remove(path); cacheScopeFiles.get(notification.getValue()).remove(path); if (cacheScopeFiles.get(notification.getValue()).size() == 0) { cacheScopeFiles.remove(notification.getValue()); } if (cacheRange == null) { return; } cacheRemovalExecutor.submit(() -> { Collection<LocalCacheFile> files; cacheRange.lock.readLock().lock(); try { files = cacheRange.getRange().asMapOfRanges().values(); } finally { cacheRange.lock.readLock().unlock(); } for (LocalCacheFile file : files) { try { Files.delete(new File(file.getPath().toUri()).toPath()); } catch (IOException e) { } } }); }

Target:
public void onRemoval(RemovalNotification<Path, Long> notification) { Path path = notification.getKey(); CacheRange cacheRange = persistedRanges.remove(path); cacheScopeFiles.get(notification.getValue()).remove(path); if (cacheScopeFiles.get(notification.getValue()).isEmpty()) { cacheScopeFiles.remove(notification.getValue()); } if (cacheRange == null) { return; } cacheRemovalExecutor.submit(() -> { Collection<LocalCacheFile> files; cacheRange.lock.readLock().lock(); try { files = cacheRange.getRange().asMapOfRanges().values(); } finally { cacheRange.lock.readLock().unlock(); } for (LocalCacheFile file : files) { try { Files.delete(new File(file.getPath().toUri()).toPath()); } catch (IOException e) { } } }); }
Source:
public List<String> getValues() { return values; }

Target:
public List<String> getValues() { return new ArrayList<>(values); }
Source:
public void setUp() { Context context = InstrumentationRegistry.getTargetContext(); sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context); SharedPreferences.Editor editor = sharedPreferences.edit(); editor.clear(); editor.putBoolean(SettingsActivity.SETTINGS_CRASH_REPORTS, true); editor.commit(); CrashReporter.setIsCrashReportEnabled(true); CrashReporter.initialize(context); }

Target:
public void setUp() throws Exception { super.setUp(); Context context = InstrumentationRegistry.getTargetContext(); sharedPreferences = PreferenceManager.getDefaultSharedPreferences(context); editor = sharedPreferences.edit(); editor.clear(); editor.putBoolean(SettingsActivity.SETTINGS_CRASH_REPORTS, true); editor.commit(); CrashReporter.setIsCrashReportEnabled(true); CrashReporter.initialize(context); }
Source:
protected void buildTagList(File directory, boolean interactive) { this.tagList = new TreeSet<>(); ArrayList<String> argv = new ArrayList<>(); LinkedList<String> tagsList = new LinkedList<>(); ensureCommand(CMD_PROPERTY_KEY, CMD_FALLBACK); argv.add(RepoCommand); argv.add("tag"); Executor executor = new Executor(argv, directory, RuntimeEnvironment.getInstance().getInteractiveCommandTimeout()); int status = executor.exec(); try { try (BufferedReader in = new BufferedReader(new InputStreamReader( executor.getOutputStream()))) { String line; while ((line = in.readLine()) != null) { tagsList.add(line); } } } catch (IOException e) { LOGGER.log(Level.WARNING, "Failed to read tag list: {0}", e.getMessage()); this.tagList = null; } if (status != 0) { LOGGER.log(Level.WARNING, "Failed to get tags for: \"{0}\" Exit code: {1}", new Object[]{directory.getAbsolutePath(), String.valueOf(status)}); this.tagList = null; } try { for (String tags : tagsList) { TagEntry tagEntry = buildTagEntry(directory, tags); this.tagList.add(tagEntry); } } catch (HistoryException e) { LOGGER.log(Level.WARNING, "Failed to parse tag list: {0}", e.getMessage()); this.tagList = null; } catch (IOException e) { LOGGER.log(Level.WARNING, "Failed to read tag list: {0}", e.getMessage()); this.tagList = null; } }

Target:
protected void buildTagList(File directory, boolean interactive) { this.tagList = new TreeSet<>(); ArrayList<String> argv = new ArrayList<>(); LinkedList<String> tagsList = new LinkedList<>(); ensureCommand(CMD_PROPERTY_KEY, CMD_FALLBACK); argv.add(RepoCommand); argv.add("tag"); Executor executor = new Executor(argv, directory, interactive ? RuntimeEnvironment.getInstance().getInteractiveCommandTimeout() : RuntimeEnvironment.getInstance().getCommandTimeout()); int status = executor.exec(); try { try (BufferedReader in = new BufferedReader(new InputStreamReader( executor.getOutputStream()))) { String line; while ((line = in.readLine()) != null) { tagsList.add(line); } } } catch (IOException e) { LOGGER.log(Level.WARNING, "Failed to read tag list: {0}", e.getMessage()); this.tagList = null; } if (status != 0) { LOGGER.log(Level.WARNING, "Failed to get tags for: \"{0}\" Exit code: {1}", new Object[]{directory.getAbsolutePath(), String.valueOf(status)}); this.tagList = null; } try { for (String tags : tagsList) { TagEntry tagEntry = buildTagEntry(directory, tags, interactive); this.tagList.add(tagEntry); } } catch (HistoryException e) { LOGGER.log(Level.WARNING, "Failed to parse tag list: {0}", e.getMessage()); this.tagList = null; } catch (IOException e) { LOGGER.log(Level.WARNING, "Failed to read tag list: {0}", e.getMessage()); this.tagList = null; } }
Source:
public void addVideoDevices(VmBase vmBase, int numberOfVideoDevices) { if (vmBase.getDefaultDisplayType() != DisplayType.none && vmBase.getDefaultDisplayType().getDefaultVmDeviceType() != null) { for (int i = 0; i < numberOfVideoDevices; i++) { addManagedDevice( new VmDeviceId(Guid.newGuid(), vmBase.getId()), VmDeviceGeneralType.VIDEO, vmBase.getDefaultDisplayType().getDefaultVmDeviceType(), getVideoDeviceSpecParams(vmBase), true, false); } } }

Target:
public void addVideoDevices(VmBase vmBase, int numberOfVideoDevices) { if (vmBase.getDefaultDisplayType() != DisplayType.none) { for (int i = 0; i < numberOfVideoDevices; i++) { addManagedDevice( new VmDeviceId(Guid.newGuid(), vmBase.getId()), VmDeviceGeneralType.VIDEO, vmBase.getDefaultDisplayType().getDefaultVmDeviceType(), getVideoDeviceSpecParams(vmBase), true, false); } } }
Source:
public void testSetPath() { assertStatement("SET PATH iLikeToEat.apples, andBananas", new SetPath(new PathSpecification(Optional.empty(), ImmutableList.of( new PathElement(Optional.of(new Identifier("iLikeToEat")), new Identifier("apples")), new PathElement(Optional.empty(), new Identifier("andBananas")))))); assertStatement("SET PATH \"schemas,with\".\"grammar.in\", \"their!names\"", new SetPath(new PathSpecification(Optional.empty(), ImmutableList.of( new PathElement(Optional.of(new Identifier("schemas,with")), new Identifier("grammar.in")), new PathElement(Optional.empty(), new Identifier("their!names")))))); assertStatement("SET PATH \"\"", new SetPath(new PathSpecification(Optional.empty(), ImmutableList.of( new PathElement(Optional.empty(), new Identifier("")))))); try { assertStatement("SET PATH one.too.many, qualifiers", new SetPath(new PathSpecification(Optional.empty(), ImmutableList.of( new PathElement(Optional.empty(), new Identifier("dummyValue")))))); fail(); } catch (RuntimeException e) { } try { SQL_PARSER.createStatement("SET PATH ", new ParsingOptions()); } catch (RuntimeException e) { } }

Target:
public void testSetPath() { assertStatement("SET PATH iLikeToEat.apples, andBananas", new SetPath(new PathSpecification(Optional.empty(), ImmutableList.of( new PathElement(Optional.of(new Identifier("iLikeToEat")), new Identifier("apples")), new PathElement(Optional.empty(), new Identifier("andBananas")))))); assertStatement("SET PATH \"schemas,with\".\"grammar.in\", \"their!names\"", new SetPath(new PathSpecification(Optional.empty(), ImmutableList.of( new PathElement(Optional.of(new Identifier("schemas,with")), new Identifier("grammar.in")), new PathElement(Optional.empty(), new Identifier("their!names")))))); assertStatement("SET PATH \"\"", new SetPath(new PathSpecification(Optional.empty(), ImmutableList.of( new PathElement(Optional.empty(), new Identifier("")))))); try { assertStatement("SET PATH one.too.many, qualifiers", new SetPath(new PathSpecification(Optional.empty(), ImmutableList.of( new PathElement(Optional.empty(), new Identifier("dummyValue")))))); fail(); } catch (RuntimeException e) { } try { SQL_PARSER.createStatement("SET PATH ", new ParsingOptions()); fail(); } catch (RuntimeException e) { } }
Source:
public BulkheadEventsEndpointResponse getAllBulkheadEvents() { List<BulkheadEventDTO> response = eventConsumerRegistry.getAllEventConsumer().stream() .flatMap(bulkheadEventCircularEventConsumer -> bulkheadEventCircularEventConsumer .getBufferedEvents() .stream()) .sorted(Comparator.comparing(BulkheadEvent::getCreationTime)) .map(BulkheadEventDTOFactory::createBulkheadEventDTO) .collect(Collectors.toUnmodifiableList()); return new BulkheadEventsEndpointResponse(response); }

Target:
public BulkheadEventsEndpointResponse getAllBulkheadEvents() { List<BulkheadEventDTO> response = eventConsumerRegistry.getAllEventConsumer().stream() .flatMap(CircularEventConsumer::getBufferedEventsStream) .sorted(Comparator.comparing(BulkheadEvent::getCreationTime)) .map(BulkheadEventDTOFactory::createBulkheadEventDTO) .collect(Collectors.toList()); return new BulkheadEventsEndpointResponse(response); }
Source:
static String generateBoundary(String userAgent) { return new StringBuilder().append("=--") .append(nomaliseUserAgent(userAgent)).append("_") .append(Thread.currentThread().hashCode()).append("_") .append(System.currentTimeMillis()).append("_") .append(count.getAndIncrement()) .toString(); }

Target:
static String generateBoundary(String userAgent) { return "=--" + nomaliseUserAgent(userAgent) + "_" + Thread.currentThread().hashCode() + "_" + System.currentTimeMillis() + "_" + count.getAndIncrement(); }
Source:
public FulfillerDetails save(FulfillerDetails delegate) { Context.getOrderService().updateOrderFulfillerStatus(delegate.getOrder(), delegate.getFulfillerStatus(), delegate.getFulfillerComment()); return delegate; }

Target:
public FulfillerDetails save(FulfillerDetails delegate) { Context.getOrderService().updateOrderFulfillerStatus(delegate.getOrder(), delegate.getFulfillerStatus(), delegate.getFulfillerComment()); return null; }