auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public Object clone() throws CloneNotSupportedException { CreateTable createTable = (CreateTable) super.clone(); createTable.external = external; createTable.tableName = tableName; if (tableElements != null) { createTable.tableElements = new ColumnDefinition[tableElements.length]; } createTable.storageType = storageType; createTable.location = location; createTable.subquery = subquery; createTable.params = new HashMap<String, String>(params); createTable.partition = (PartitionMethodDescExpr) partition.clone(); createTable.ifNotExists = ifNotExists; return createTable; }

Target:
public Object clone() throws CloneNotSupportedException { CreateTable createTable = (CreateTable) super.clone(); createTable.external = external; createTable.tableName = tableName; if (tableElements != null) { createTable.tableElements = new ColumnDefinition[tableElements.length]; for (int i = 0; i < tableElements.length; i++) { createTable.tableElements[i] = (ColumnDefinition) tableElements[i].clone(); } } createTable.storageType = storageType; createTable.location = location; createTable.subquery = subquery; createTable.params = new HashMap<String, String>(params); createTable.partition = (PartitionMethodDescExpr) partition.clone(); createTable.ifNotExists = ifNotExists; return createTable; }
Source:
public WindowAggProjection(StreamInput in) throws IOException { windowDefinition = new WindowDefinition(in); startFrameOffset = in.readGenericValue(); endFrameOffset = in.readGenericValue(); standaloneWithInputs = Symbols.listFromStream(in); int functionsCount = in.readVInt(); functionsWithInputs = new LinkedHashMap<>(functionsCount, 1f); for (int i = 0; i < functionsCount; i++) { WindowFunction function = (WindowFunction) Symbols.fromStream(in); List<Symbol> inputs = Symbols.listFromStream(in); functionsWithInputs.put(function, inputs); } outputs = new ArrayList<>(functionsWithInputs.keySet()); }

Target:
public WindowAggProjection(StreamInput in) throws IOException { windowDefinition = new WindowDefinition(in); if (in.getVersion().onOrAfter(Version.V_4_1_0)) { startFrameOffset = in.readGenericValue(); endFrameOffset = in.readGenericValue(); } standaloneWithInputs = Symbols.listFromStream(in); int functionsCount = in.readVInt(); functionsWithInputs = new LinkedHashMap<>(functionsCount, 1f); for (int i = 0; i < functionsCount; i++) { WindowFunction function = (WindowFunction) Symbols.fromStream(in); List<Symbol> inputs = Symbols.listFromStream(in); functionsWithInputs.put(function, inputs); } outputs = new ArrayList<>(functionsWithInputs.keySet()); }
Source:
public int getStatus() { return status; }

Target:
public ExitCode getStatus() { return status; }
Source:
private void initCommitsMap() { commitsMap = new HashMap<String, PlotCommit>(); for (PlotCommit commit : allCommits) { commitsMap.put(commit.getId().name(), commit); } }

Target:
private void initCommitsMap() { commitsMap = new HashMap<String, PlotCommit>(); for (PlotCommit commit : allCommits) commitsMap.put(commit.getId().name(), commit); }
Source:
protected void sanityCheckTableMetadata(TableReference tableRef, byte[] tableMetadata) { if (tableMetadata == null || Arrays.equals(tableMetadata, AtlasDbConstants.EMPTY_TABLE_METADATA)) { throw new IllegalArgumentException( String.format( "Passing in empty table metadata for table '%s' does not make sense, and is disallowed.", tableRef)); } }

Target:
protected static void sanityCheckTableMetadata(TableReference tableRef, byte[] tableMetadata) { if (tableMetadata == null || Arrays.equals(tableMetadata, AtlasDbConstants.EMPTY_TABLE_METADATA)) { throw new IllegalArgumentException( String.format( "Passing in empty table metadata for table '%s' is disallowed," + " as reasoning about such tables is hard. Consider using" + " AtlasDbConstants.GENERIC_TABLE_METADATA instead.", tableRef)); } }
Source:
public void testBackLogout() { final CasConfiguration configuration = new CasConfiguration(); configuration.setLoginUrl(LOGIN_URL); final CasClient casClient = new CasClient(configuration); casClient.setCallbackUrl(CALLBACK_URL); casClient.init(null); final MockWebContext context = MockWebContext.create().addRequestParameter(CasConfiguration.LOGOUT_REQUEST_PARAMETER, LOGOUT_MESSAGE) .setRequestMethod("POST"); TestsHelper.expectException(() -> casClient.getCredentials(context), HttpAction.class, "back logout request: no credential returned"); assertEquals(204, context.getResponseStatus()); }

Target:
public void testBackLogout() { final CasConfiguration configuration = new CasConfiguration(); configuration.setLoginUrl(LOGIN_URL); final CasClient casClient = new CasClient(configuration); casClient.setCallbackUrl(CALLBACK_URL); casClient.init(null); final MockWebContext context = MockWebContext.create().addRequestParameter(CasConfiguration.LOGOUT_REQUEST_PARAMETER, LOGOUT_MESSAGE) .setRequestMethod("POST"); TestsHelper.expectException(() -> casClient.getCredentials(context), HttpAction.class, "back logout request: no credential returned"); assertEquals(200, context.getResponseStatus()); }
Source:
public void setTaskStatus(final JobId jobId, final TaskStatus status) throws InterruptedException { log.debug("setting task status: {}", status); taskStatuses.put(jobId.toString(), status.toJsonBytes()); if (historyWriter != null) { try { historyWriter.saveHistoryItem(status); } catch (Exception e) { log.error("Error saving task status to ZooKeeper: {}", status, e); } } final TaskStatusEvent event = new TaskStatusEvent(status, System.currentTimeMillis(), agent); final byte[] message = event.toJsonBytes(); for (final EventSender sender : eventSenders) { sender.send(TaskStatusEvent.KAFKA_TOPIC, message); } }

Target:
public void setTaskStatus(final JobId jobId, final TaskStatus status) throws InterruptedException { log.debug("setting task status: {}", status); taskStatuses.put(jobId.toString(), status.toJsonBytes()); if (historyWriter != null) { try { historyWriter.saveHistoryItem(status); } catch (Exception e) { log.error("Error saving task status to ZooKeeper: {}", status, e); } } final TaskStatusEvent event = new TaskStatusEvent(status, System.currentTimeMillis(), agent); final byte[] message = event.toJsonBytes(); for (final EventSender sender : eventSenders) { sender.send(TaskStatusEvent.TASK_STATUS_EVENT_TOPIC, message); } }
Source:
protected void executeCommand() { handleVmLease(); TransactionSupport.executeInNewTransaction(() -> { initImportClonedTemplateDisks(); addVmTemplateToDb(); addPermissionsToDB(); updateOriginalTemplateNameOnDerivedVms(); addVmInterfaces(); getCompensationContext().stateChanged(); vmHandler.addVmInitToDB(getVmTemplate().getVmInit()); return null; }); boolean doesVmTemplateContainImages = !getImages().isEmpty(); if (doesVmTemplateContainImages && !getParameters().isImagesExistOnTargetStorageDomain()) { moveOrCopyAllImageGroups(getVmTemplateId(), getImages()); } getVmDeviceUtils().addImportedDevices(getVmTemplate(), getParameters().isImportAsNewEntity(), false); if (!doesVmTemplateContainImages || getParameters().isImagesExistOnTargetStorageDomain()) { endMoveOrCopyCommand(); } discardHelper.logIfDisksWithIllegalPassDiscardExist(getVmTemplateId()); checkTrustedService(); incrementDbGeneration(); setSucceeded(true); }

Target:
protected void executeCommand() { TransactionSupport.executeInNewTransaction(() -> { handleVmLease(); initImportClonedTemplateDisks(); addVmTemplateToDb(); addPermissionsToDB(); updateOriginalTemplateNameOnDerivedVms(); addVmInterfaces(); getCompensationContext().stateChanged(); vmHandler.addVmInitToDB(getVmTemplate().getVmInit()); return null; }); boolean doesVmTemplateContainImages = !getImages().isEmpty(); if (doesVmTemplateContainImages && !getParameters().isImagesExistOnTargetStorageDomain()) { moveOrCopyAllImageGroups(getVmTemplateId(), getImages()); } getVmDeviceUtils().addImportedDevices(getVmTemplate(), getParameters().isImportAsNewEntity(), false); if (!doesVmTemplateContainImages || getParameters().isImagesExistOnTargetStorageDomain()) { endMoveOrCopyCommand(); } discardHelper.logIfDisksWithIllegalPassDiscardExist(getVmTemplateId()); checkTrustedService(); incrementDbGeneration(); setSucceeded(true); }
Source:
public void destroyFolderTest() { PID folderObjPid = objsToDestroy.get(0); initializeJob(Arrays.asList(folderObjPid)); FolderObject folderObj = repoObjLoader.getFolderObject(folderObjPid); WorkObject workObj = repoObjLoader.getWorkObject(folderObj.getMembers().get(0).getPid()); FileObject fileObj = repoObjLoader.getFileObject(workObj.getMembers().get(0).getPid()); job.run(); verify(spyProxyService).destroyProxy(folderObjPid); assertTrue(fileObj.getModel().contains(fileObj.getResource(), RDF.type, Cdr.Tombstone)); assertTrue(workObj.getModel().contains(workObj.getResource(), RDF.type, Cdr.Tombstone)); assertTrue(folderObj.getModel().contains(folderObj.getResource(), RDF.type, Cdr.Tombstone)); }

Target:
public void destroyFolderTest() { PID folderObjPid = objsToDestroy.get(0); initializeJob(Arrays.asList(folderObjPid)); FolderObject folderObj = repoObjLoader.getFolderObject(folderObjPid); WorkObject workObj = (WorkObject) folderObj.getMembers().get(0); FileObject fileObj = (FileObject) workObj.getMembers().get(0); job.run(); verify(spyProxyService).destroyProxy(folderObjPid); assertTrue(fileObj.getModel().contains(fileObj.getResource(), RDF.type, Cdr.Tombstone)); assertTrue(workObj.getModel().contains(workObj.getResource(), RDF.type, Cdr.Tombstone)); assertTrue(folderObj.getModel().contains(folderObj.getResource(), RDF.type, Cdr.Tombstone)); }
Source:
protected List<String> getChildren(final String path, final boolean watch) { long startT = System.currentTimeMillis(); final int[] connectionLossRetryCount = {0}; try { List<String> children = retryUntilConnected(new Callable<List<String>>() { @Override public List<String> call() throws Exception { try { return getConnection().getChildren(path, watch); } catch (ConnectionLossException e) { ++connectionLossRetryCount[0]; if (connectionLossRetryCount[0] >= 3) { Stat stat = getStat(path); if (stat != null && stat.getNumChildren() > NUM_CHILDREN_LIMIT) { LOG.error("Failed to get children for path because number of children " + "exceeds limit {}, aborting retry.", path, stat.getNumChildren(), NUM_CHILDREN_LIMIT); throw new KeeperException.MarshallingErrorException(); } } throw e; } } }); record(path, null, startT, ZkClientMonitor.AccessType.READ); return children; } catch (ZkNoNodeException e) { record(path, null, startT, ZkClientMonitor.AccessType.READ); throw e; } catch (Exception e) { recordFailure(path, ZkClientMonitor.AccessType.READ); throw e; } finally { long endT = System.currentTimeMillis(); if (LOG.isTraceEnabled()) { LOG.trace("getChildren, path: " + path + ", time: " + (endT - startT) + " ms"); } } }

Target:
protected List<String> getChildren(final String path, final boolean watch) { long startT = System.currentTimeMillis(); try { List<String> children = retryUntilConnected(new Callable<List<String>>() { private int connectionLossRetryCount = 0; @Override public List<String> call() throws Exception { try { return getConnection().getChildren(path, watch); } catch (ConnectionLossException e) { ++connectionLossRetryCount; if (connectionLossRetryCount >= 3) { checkNumChildrenLimit(path); connectionLossRetryCount = 0; } throw e; } } }); record(path, null, startT, ZkClientMonitor.AccessType.READ); return children; } catch (ZkNoNodeException e) { record(path, null, startT, ZkClientMonitor.AccessType.READ); throw e; } catch (Exception e) { recordFailure(path, ZkClientMonitor.AccessType.READ); throw e; } finally { long endT = System.currentTimeMillis(); if (LOG.isTraceEnabled()) { LOG.trace("getChildren, path: " + path + ", time: " + (endT - startT) + " ms"); } } }
Source:
boolean isAssignmentValid(AssignableNode node, AssignableReplica replica, ClusterContext clusterContext) { Map<String, Integer> nodeCurrentCapacity = node.getCurrentCapacity(); Map<String, Integer> repCurrentCapacity = replica.getCapacity(); for (String key : repCurrentCapacity.keySet()) { if (nodeCurrentCapacity.containsKey(key)) { if (nodeCurrentCapacity.get(key) < repCurrentCapacity.get(key)) { return false; } } } return true; }

Target:
boolean isAssignmentValid(AssignableNode node, AssignableReplica replica, ClusterContext clusterContext) { Map<String, Integer> nodeCapacity = node.getCurrentCapacity(); Map<String, Integer> replicaCapacity = replica.getCapacity(); for (String key : replicaCapacity.keySet()) { if (nodeCapacity.containsKey(key)) { if (nodeCapacity.get(key) < replicaCapacity.get(key)) { return false; } } } return true; }
Source:
private static boolean containsDisallowedWords(String str, String[] keywords) { return Arrays.stream(keywords).parallel().anyMatch(str.toUpperCase(Locale.ENGLISH)::contains); }

Target:
private static boolean containsDisallowedWords(String str, String[] keywords) { return Arrays.stream(keywords).anyMatch(str.toUpperCase(Locale.ENGLISH)::contains); }
Source:
public boolean isCheckPointCompleted(){ boolean checkPointCompleted = this.status != GeoRepSessionStatus.FAULTY; for (GlusterGeoRepSessionDetails details : getSessionDetails()) { if (details.getStatus() == GeoRepSessionStatus.ACTIVE && !details.getCheckPointStatus().equals("COMPLETED")) { checkPointCompleted = false; } } return checkPointCompleted; }

Target:
public boolean isCheckPointCompleted(){ boolean checkPointCompleted = this.status != GeoRepSessionStatus.FAULTY; for (GlusterGeoRepSessionDetails details : getSessionDetails()) { if (details.getStatus() == GeoRepSessionStatus.ACTIVE && !details.isCheckpointCompleted()) { checkPointCompleted = false; } } return checkPointCompleted; }
Source:
public void processProduct(ProductSummary product) throws Exception { super.processProduct(product); ExtentSummary extent = new ExtentSummary(product); if (extent.isValid()) { LOGGER.log(Level.FINE, "[" + getName() + "] adding product " + product.getIndexId() + " to extent table"); ((ExtentIndex) productIndex).addExtentSummary(extent); } else { LOGGER.log(Level.FINE, "[" + getName() + "] product " + product.getIndexId() + " has no extent information; won't add to extent table"); } setLastIndexId(product.getIndexId()); }

Target:
public void processProduct(ProductSummary product) throws Exception { super.processProduct(product); ExtentSummary extent = new ExtentSummary(product); if (extent.isValid()) { LOGGER.log(Level.FINE, "[" + getName() + "] adding product " + product.getId().toString() + " to extent table"); ((ExtentIndex) productIndex).addExtentSummary(extent); } else { LOGGER.log(Level.FINE, "[" + getName() + "] product " + product.getId().toString() + " has no extent information; won't add to extent table"); } setLastIndexId(product.getIndexId()); }
Source:
private <T> T applyOnNodeChannel(UUID nodeId, Function<ClientChannel, T> function) { ClientChannelHolder hld = null; ClientChannel channel = null; try { hld = nodeChannels.get(nodeId); channel = Optional .ofNullable(hld) .map(ClientChannelHolder::getOrCreateChannel) .orElse(null); if (channel != null) return function.apply(channel); } catch (ClientConnectionException e) { onChannelFailure(hld, channel); } return null; }

Target:
private <T> T applyOnNodeChannel(UUID nodeId, Function<ClientChannel, T> function) { ClientChannelHolder hld = null; ClientChannel channel = null; try { hld = nodeChannels.get(nodeId); channel = hld != null ? hld.getOrCreateChannel() : null; if (channel != null) return function.apply(channel); } catch (ClientConnectionException e) { onChannelFailure(hld, channel); } return null; }
Source:
public FSLeafQueue getQueue() { return (FSLeafQueue)super.getQueue(); }

Target:
public FSLeafQueue getQueue() { Queue queue = super.getQueue(); assert queue instanceof FSLeafQueue; return (FSLeafQueue) queue; }
Source:
private SpillableArrayListImpl<V> getHelper(@Nullable K key) { SpillableArrayListImpl<V> spillableArrayList = cache.get(key); if (spillableArrayList == null) { Slice keyPrefix = serdeKey.serialize(key); Integer size = map.get(SliceUtils.concatenate(keyPrefix, SIZE_KEY_SUFFIX)); if (size == null) { return null; } spillableArrayList = new SpillableArrayListImpl<V>(bucket, keyPrefix.buffer, store, serdeValue); spillableArrayList.setSize(size); cache.put(key, spillableArrayList); } return spillableArrayList; }

Target:
private SpillableArrayListImpl<V> getHelper(@Nullable K key) { SpillableArrayListImpl<V> spillableArrayList = cache.get(key); if (spillableArrayList == null) { Slice keySlice = serdeKey.serialize(key); Integer size = map.get(SliceUtils.concatenate(keySlice, SIZE_KEY_SUFFIX).toByteArray()); if (size == null) { return null; } Slice keyPrefix = SliceUtils.concatenate(identifier, keySlice); spillableArrayList = new SpillableArrayListImpl<V>(bucket, keyPrefix.toByteArray(), store, serdeValue); spillableArrayList.setSize(size); } cache.put(key, spillableArrayList); return spillableArrayList; }
Source:
public boolean matches(long numberOfRows, Map<ColumnDescriptor, Statistics<?>> statistics, ParquetDataSourceId id, boolean failOnCorruptedParquetStatistics) throws ParquetCorruptionException { if (numberOfRows == 0) { return false; } if (effectivePredicate.isNone()) { return false; } Map<ColumnDescriptor, Domain> effectivePredicateDomains = effectivePredicate.getDomains() .orElseThrow(() -> new IllegalStateException("Effective predicate other than none should have domains")); for (RichColumnDescriptor column : columns) { Statistics<?> columnStatistics = statistics.get(column); Type type = getPrestoType(effectivePredicate, column); if (columnStatistics == null || columnStatistics.isEmpty()) { } else { Domain domain = getDomain(type, numberOfRows, columnStatistics, id, column.toString(), failOnCorruptedParquetStatistics); if (domain.isNone()) { return false; } Domain effectivePredicateDomain = effectivePredicateDomains.get(column); if (effectivePredicateDomain != null) { if (effectivePredicateDomain.intersect(domain).isNone()) { return false; } } } } return true; }

Target:
public boolean matches(long numberOfRows, Map<ColumnDescriptor, Statistics<?>> statistics, ParquetDataSourceId id, boolean failOnCorruptedParquetStatistics) throws ParquetCorruptionException { if (numberOfRows == 0) { return false; } if (effectivePredicate.isNone()) { return false; } Map<ColumnDescriptor, Domain> effectivePredicateDomains = effectivePredicate.getDomains() .orElseThrow(() -> new IllegalStateException("Effective predicate other than none should have domains")); for (RichColumnDescriptor column : columns) { Domain effectivePredicateDomain = effectivePredicateDomains.get(column); if (effectivePredicateDomain == null) { continue; } Statistics<?> columnStatistics = statistics.get(column); if (columnStatistics == null || columnStatistics.isEmpty()) { } else { Domain domain = getDomain(effectivePredicateDomain.getType(), numberOfRows, columnStatistics, id, column.toString(), failOnCorruptedParquetStatistics); if (effectivePredicateDomain.intersect(domain).isNone()) { return false; } } } return true; }
Source:
public void openFile(Path file, boolean raisePanel) { openFiles(new ArrayList<>(Collections.singletonList(file)), raisePanel); }

Target:
public void openFile(Path file, boolean raisePanel) { openFiles(Arrays.asList(file), raisePanel); }
Source:
public void setLoadMetersEnabled(boolean enabled) { m_loadMetersEnabled = enabled; disposeLoadMeterTimer(); initializeLoadMeterTimer(); }

Target:
public void setLoadMetersEnabled(boolean enabled) { if (m_loadMetersEnabled == enabled) return; m_loadMetersEnabled = enabled; disposeLoadMeterTimer(); initializeLoadMeterTimer(); }
Source:
public void initialize(Server server, Injector injector) { final ServletContextHandler root = new ServletContextHandler(ServletContextHandler.SESSIONS); root.addServlet(new ServletHolder(new DefaultServlet()), "/*"); root.addServlet( new ServletHolder( new AsyncQueryForwardingServlet( jsonMapper, smileMapper, hostFinder, httpClient, emitter, requestLogger ) ), "/druid/v2/*" ); addExtensionFilters(root, injector); root.addFilter(defaultAsyncGzipFilterHolder(), "/*", null); root.addFilter(GuiceFilter.class, "/status/*", null); final HandlerList handlerList = new HandlerList(); handlerList.setHandlers(new Handler[]{root}); server.setHandler(handlerList); }

Target:
public void initialize(Server server, Injector injector) { final ServletContextHandler root = new ServletContextHandler(ServletContextHandler.SESSIONS); root.addServlet(new ServletHolder(new DefaultServlet()), "/*"); final AsyncQueryForwardingServlet asyncQueryForwardingServlet = new AsyncQueryForwardingServlet( jsonMapper, smileMapper, hostFinder, httpClientProvider, httpClientConfig, emitter, requestLogger ); asyncQueryForwardingServlet.setTimeout(httpClientConfig.getReadTimeout().getMillis()); root.addServlet(new ServletHolder(asyncQueryForwardingServlet), "/druid/v2/*"); JettyServerInitUtils.addExtensionFilters(root, injector); root.addFilter(JettyServerInitUtils.defaultAsyncGzipFilterHolder(), "/*", null); root.addFilter(GuiceFilter.class, "/status/*", null); final HandlerList handlerList = new HandlerList(); handlerList.setHandlers(new Handler[]{root}); server.setHandler(handlerList); }
Source:
static long getCacheDuration() { return Long.parseLong( System.getProperty( "org.codice.ddf.security.saml.Metadata.cacheDuration", String.valueOf(Duration.ofDays(7).toMillis()))); }

Target:
public static Duration getCacheDuration() { return Duration.parse( System.getProperty("org.codice.ddf.security.saml.Metadata.cacheDuration", "P7D")); }
Source:
public boolean matches(DataSourceMetadata other) { if (getClass() != other.getClass()) { return false; } DerivativeDataSourceMetadata that = (DerivativeDataSourceMetadata) other; if (!baseDataSource.equals(that.getBaseDataSource()) || !metrics.equals(that.getMetrics())) { return false; } return dimensions.equals(that.getDimensions()); }

Target:
public boolean matches(DataSourceMetadata other) { return equals(other); }
Source:
public static void addBulletList(XWPFDocument document, List<String> bulletListItems, boolean bulletListItemsAsLink) throws XmlException { CTNumbering cTNumbering = CTNumbering.Factory.parse(cTAbstractNumBulletXML); CTAbstractNum cTAbstractNum = cTNumbering.getAbstractNumArray(0); XWPFAbstractNum abstractNum = new XWPFAbstractNum(cTAbstractNum); XWPFNumbering numbering = document.createNumbering(); BigInteger abstractNumID = numbering.addAbstractNum(abstractNum); BigInteger numID = numbering.addNum(abstractNumID); for (int i = 0; i < bulletListItems.size(); i++) { String bulletItem = bulletListItems.get(i); XWPFParagraph paragraph = document.createParagraph(); paragraph.setNumID(numID); if (bulletListItemsAsLink) { addHyperLink(paragraph, "bookmark_" + bulletItem, bulletItem); } else { setText(paragraph.createRun(), bulletItem); } if (i < bulletListItems.size() - 1) { paragraph.setSpacingAfter(0); } } }

Target:
public static void addBulletList(XWPFDocument document, List<String> bulletListItems, boolean bulletListItemsAsLink) throws XmlException { CTNumbering cTNumbering = CTNumbering.Factory.parse(cTAbstractNumBulletXML); CTAbstractNum cTAbstractNum = cTNumbering.getAbstractNumArray(0); XWPFAbstractNum abstractNum = new XWPFAbstractNum(cTAbstractNum); XWPFNumbering numbering = document.createNumbering(); BigInteger abstractNumID = numbering.addAbstractNum(abstractNum); BigInteger numID = numbering.addNum(abstractNumID); for (int i = 0; i < bulletListItems.size(); i++) { String bulletItem = bulletListItems.get(i); XWPFParagraph paragraph = document.createParagraph(); paragraph.setNumID(numID); if (bulletListItemsAsLink) { addBookmarkHyperLink(paragraph, bulletItem, bulletItem); } else { setText(paragraph.createRun(), bulletItem); } if (i < bulletListItems.size() - 1) { paragraph.setSpacingAfter(0); } } }
Source:
public boolean supportsReset() { return delegates.stream() .map(EventHandlerInvoker::supportsReset) .reduce(false, Boolean::logicalOr); }

Target:
public boolean supportsReset() { return delegates.stream() .anyMatch(EventHandlerInvoker::supportsReset); }
Source:
protected void hyperlinkActivated(@NotNull Notification notification, @NotNull HyperlinkEvent e) { if (myHyperlinks.length == 1) { myHyperlinks[0].executeIfClicked(myProject, e); return; } for (NotificationHyperlink hyperlink : myHyperlinks) { if (hyperlink.executeIfClicked(myProject, e)) { return; } } }

Target:
protected void hyperlinkActivated(@NotNull Notification notification, @NotNull HyperlinkEvent e) { for (NotificationHyperlink hyperlink : myHyperlinks) { if (hyperlink.executeIfClicked(myProject, e)) { return; } } }
Source:
public void clearWindowState(W window) { windowAccumulateData.setCurrentNamespace(window); windowAccumulateData.clear(); windowRetractData.setCurrentNamespace(window); windowRetractData.clear(); }

Target:
public void clearWindowState(W window) { throw new RuntimeException("The method clearWindowState should not be called."); }
Source:
public String commitSegmentFile(String realtimeTableName, CommittingSegmentDescriptor committingSegmentDescriptor) throws Exception { Preconditions.checkState(!_isStopping, "Segment manager is stopping"); String rawTableName = TableNameBuilder.extractRawTableName(realtimeTableName); String segmentName = committingSegmentDescriptor.getSegmentName(); LOGGER.info("Committing segment file for segment: {}", segmentName); String segmentLocation = committingSegmentDescriptor.getSegmentLocation(); URI segmentFileURI = URIUtils.getUri(segmentLocation); URI tableDirURI = URIUtils.getUri(_controllerConf.getDataDir(), rawTableName); URI uriToMoveTo = URIUtils.getUri(_controllerConf.getDataDir(), rawTableName, URIUtils.encode(segmentName)); PinotFS pinotFS = PinotFSFactory.create(tableDirURI.getScheme()); Preconditions.checkState(pinotFS.move(segmentFileURI, uriToMoveTo, true), "Failed to move segment file for segment: %s from: %s to: %s", segmentName, segmentLocation, uriToMoveTo); try { for (String uri : pinotFS.listFiles(tableDirURI, false)) { if (uri.contains(SegmentCompletionUtils.getSegmentNamePrefix(segmentName))) { LOGGER.warn("Deleting temporary segment file: {}", uri); Preconditions.checkState(pinotFS.delete(new URI(uri), true), "Failed to delete file: %s", uri); } } } catch (Exception e) { LOGGER.warn("Caught exception while deleting temporary segment files for segment: {}", segmentName, e); } return uriToMoveTo.toString(); }

Target:
public void commitSegmentFile(String realtimeTableName, CommittingSegmentDescriptor committingSegmentDescriptor) throws Exception { Preconditions.checkState(!_isStopping, "Segment manager is stopping"); if (isPeerSegmentDownloadScheme(committingSegmentDescriptor)) { LOGGER.info("No moving needed for segment on peer servers: {}", committingSegmentDescriptor.getSegmentLocation()); return; } String rawTableName = TableNameBuilder.extractRawTableName(realtimeTableName); String segmentName = committingSegmentDescriptor.getSegmentName(); LOGGER.info("Committing segment file for segment: {}", segmentName); String segmentLocation = committingSegmentDescriptor.getSegmentLocation(); URI segmentFileURI = URIUtils.getUri(segmentLocation); URI tableDirURI = URIUtils.getUri(_controllerConf.getDataDir(), rawTableName); URI uriToMoveTo = URIUtils.getUri(_controllerConf.getDataDir(), rawTableName, URIUtils.encode(segmentName)); PinotFS pinotFS = PinotFSFactory.create(tableDirURI.getScheme()); Preconditions.checkState(pinotFS.move(segmentFileURI, uriToMoveTo, true), "Failed to move segment file for segment: %s from: %s to: %s", segmentName, segmentLocation, uriToMoveTo); try { for (String uri : pinotFS.listFiles(tableDirURI, false)) { if (uri.contains(SegmentCompletionUtils.getSegmentNamePrefix(segmentName))) { LOGGER.warn("Deleting temporary segment file: {}", uri); Preconditions.checkState(pinotFS.delete(new URI(uri), true), "Failed to delete file: %s", uri); } } } catch (Exception e) { LOGGER.warn("Caught exception while deleting temporary segment files for segment: {}", segmentName, e); } committingSegmentDescriptor.setSegmentLocation(uriToMoveTo.toString()); }
Source:
public Response getClusterStateModelDefinition(@PathParam("clusterId") String clusterId, @PathParam("statemodel") String statemodel) { HelixDataAccessor dataAccessor = getDataAccssor(clusterId); StateModelDefinition stateModelDef = dataAccessor.getProperty(dataAccessor.keyBuilder().stateModelDef(statemodel)); if (stateModelDef == null) { return notFound(); } return JSONRepresentation(stateModelDef.getRecord()); }

Target:
public Response getClusterStateModelDefinition(@PathParam("clusterId") String clusterId, @PathParam("statemodel") String statemodel) { HelixDataAccessor dataAccessor = getDataAccssor(clusterId); StateModelDefinition stateModelDef = dataAccessor.getProperty(dataAccessor.keyBuilder().stateModelDef(statemodel)); if (stateModelDef == null) { return badRequest("Statemodel not found!"); } return JSONRepresentation(stateModelDef.getRecord()); }
Source:
public BugReportDialog(Context context) { super(context); final BugReportView view = (BugReportView) LayoutInflater.from(context).inflate(R.layout.bugreport_view, null); view.setBugReportListener(this); setTitle("Report a bug"); setView(view); setButton(Dialog.BUTTON_NEGATIVE, "Cancel", new OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { } }); setButton(Dialog.BUTTON_POSITIVE, "Submit", new OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { if (listener != null) { listener.onBugReportSubmit(view.getReport()); } } }); }

Target:
public BugReportDialog(Context context) { super(context); final BugReportView view = (BugReportView) LayoutInflater.from(context).inflate(R.layout.bugreport_view, null); view.setBugReportListener(this); setTitle("Report a bug"); setView(view); setButton(Dialog.BUTTON_NEGATIVE, "Cancel", (OnClickListener) null); setButton(Dialog.BUTTON_POSITIVE, "Submit", new OnClickListener() { @Override public void onClick(DialogInterface dialog, int which) { if (listener != null) { listener.onBugReportSubmit(view.getReport()); } } }); }
Source:
public static void setUp() throws IOException, TimeoutException, InterruptedException { operations.add(endpointConfigurationAddress); administration.reloadIfRequired(); operations.add(preHandlerChainAddress); administration.reloadIfRequired(); operations.add(postHandlerChainAddress); administration.reloadIfRequired(); }

Target:
public static void setUp() throws IOException, TimeoutException, InterruptedException { operations.add(endpointConfigurationAddress); administration.reloadIfRequired(); operations.add(preHandlerChainAddress); operations.add(postHandlerChainAddress); administration.reloadIfRequired(); }
Source:
private static ImmutableList<Arguments> getRequiredArgs(final Ds3Request ds3Request) { final ImmutableList.Builder<Arguments> requiredArgsBuilder = ImmutableList.builder(); LOG.debug("Getting required args..."); if (ds3Request.getBucketRequirement() == Requirement.REQUIRED) { LOG.debug("bucket name REQUIRED."); requiredArgsBuilder.add(new Arguments("String", "bucketName")); if (ds3Request.getObjectRequirement() == Requirement.REQUIRED) { LOG.debug("object name REQUIRED."); requiredArgsBuilder.add(new Arguments("String", "objectName")); } } LOG.debug("Getting required query params..."); if (ConverterUtil.isEmpty(ds3Request.getRequiredQueryParams())) { return requiredArgsBuilder.build(); } for (final Ds3Param ds3Param : ds3Request.getRequiredQueryParams()) { if (ds3Param == null) break; LOG.debug(" query param " + ds3Param.getType()); final String paramType = ds3Param.getType().substring(ds3Param.getType().lastIndexOf(".") + 1); LOG.debug(" param " + paramType + " is required."); requiredArgsBuilder.add(new Arguments(paramType, ds3Param.getName())); } return requiredArgsBuilder.build(); }

Target:
private static ImmutableList<Arguments> getRequiredArgs(final Ds3Request ds3Request) { final ImmutableList.Builder<Arguments> requiredArgsBuilder = ImmutableList.builder(); LOG.debug("Getting required args..."); if (ds3Request.getBucketRequirement() == Requirement.REQUIRED) { LOG.debug("\tbucket name REQUIRED."); requiredArgsBuilder.add(new Arguments("String", "bucketName")); if (ds3Request.getObjectRequirement() == Requirement.REQUIRED) { LOG.debug("\tobject name REQUIRED."); requiredArgsBuilder.add(new Arguments("String", "objectName")); } } LOG.debug("Getting required query params..."); if (ConverterUtil.isEmpty(ds3Request.getRequiredQueryParams())) { return requiredArgsBuilder.build(); } for (final Ds3Param ds3Param : ds3Request.getRequiredQueryParams()) { if (ds3Param == null) break; LOG.debug("\tquery param " + ds3Param.getType()); final String paramType = ds3Param.getType().substring(ds3Param.getType().lastIndexOf(".") + 1); LOG.debug("\tparam " + paramType + " is required."); requiredArgsBuilder.add(new Arguments(paramType, ds3Param.getName())); } return requiredArgsBuilder.build(); }
Source:
private void setupKeyEvents() { addEventHandler(KeyEvent.KEY_PRESSED, event -> { if ((KeyboardShortcuts.rightPanel.match(event) || KeyboardShortcuts.leftPanel.match(event))) { handleKeys(KeyboardShortcuts.rightPanel.match(event)); assert currentlySelectedPanel.isPresent() : "handleKeys doesn't set selectedIndex!"; } if (KeyboardShortcuts.SWAP_PANEL_LEFT.match(event)) { Optional<Integer> current = this.currentlySelectedPanel; if (current.isPresent()) { movePanelLeft(current.get()); } } else if (KeyboardShortcuts.SWAP_PANEL_RIGHT.match(event)) { Optional<Integer> current = this.currentlySelectedPanel; if (current.isPresent()) { movePanelRight(current.get()); } } }); }

Target:
private void setupKeyEvents() { addEventHandler(KeyEvent.KEY_PRESSED, event -> { if ((KeyboardShortcuts.rightPanel.match(event) || KeyboardShortcuts.leftPanel.match(event))) { handleKeys(KeyboardShortcuts.rightPanel.match(event)); assert currentlySelectedPanel.isPresent() : "handleKeys doesn't set selectedIndex!"; } if (KeyboardShortcuts.SWAP_PANEL_LEFT.match(event)) { currentlySelectedPanel.ifPresent(this::movePanelLeft); } else if (KeyboardShortcuts.SWAP_PANEL_RIGHT.match(event)) { currentlySelectedPanel.ifPresent(this::movePanelRight); } }); }
Source:
public Expression visitTerminal(TerminalNode node) { if (node.getSymbol().getType() == ManifoldLexer.INTEGER_VALUE) { Value value = new IntegerValue(Integer.valueOf(node.getText())); return new LiteralExpression(value); } else { assert(false); return null; } }

Target:
public Expression visitTerminal(TerminalNode node) { if (node.getSymbol().getType() == ManifoldLexer.INTEGER_VALUE) { return new LiteralExpression( new IntegerValue(Integer.valueOf(node.getText())) ); } else if (node.getSymbol().getType() == ManifoldLexer.BOOLEAN_VALUE) { return new LiteralExpression( BooleanValue.getInstance(Boolean.parseBoolean(node.getText())) ); } else { assert(false); return null; } }
Source:
public AbstractBuilder withCommunicationWindow(final List<WindowElementDto> communicationWindow) { if (communicationWindow == null) { this.communicationWindow = null; } else { this.communicationWindow = new ArrayList<>(communicationWindow); } this.communicationWindow = communicationWindow; return this; }

Target:
public AbstractBuilder withCommunicationWindow(final List<WindowElementDto> communicationWindow) { if (communicationWindow == null) { this.communicationWindow = null; } else { this.communicationWindow = communicationWindow; } this.communicationWindow = communicationWindow; return this; }
Source:
public String getJBossDiscoveryDirectory() { String directory = System.getProperty(JBOSS_DISCOVERY_DIRECTORY, null); if (directory == null) { IPropertiesProvider pp = PropertiesHelper.getPropertiesProvider(); try { directory = pp.getValue(JBOSS_DISCOVERY_DIRECTORY, new NullProgressMonitor()); } catch (CoreException e) { throw new RuntimeException(e); } } return directory; }

Target:
public String getJBossDiscoveryDirectory() { String directory = System.getProperty(JBOSS_DISCOVERY_DIRECTORY, null); if (directory == null) { IPropertiesProvider pp = PropertiesHelper.getPropertiesProvider(); directory = pp.getValue(JBOSS_DISCOVERY_DIRECTORY); } return directory; }
Source:
public void getLdapAccessHandlesNull() { GitlabGroup group = new GitlabGroup(); group.setLdapAccess(null); group.getLdapAccess(); }

Target:
public void getLdapAccessHandlesNull() { GitlabGroup group = new GitlabGroup(); group.setLdapAccess(null); assertNull( group.getLdapAccess() ); }
Source:
private void assertCostHasUnknownComponentsForUnknownStats(PlanNode node, Map<String, Type> types) { new CostAssertionBuilder(calculateCumulativeCost( costCalculatorUsingExchanges, node, planNode -> UNKNOWN_COST, planNode -> PlanNodeStatsEstimate.unknown(), types)) .hasUnknownComponents(); new CostAssertionBuilder(calculateCumulativeCost( costCalculatorWithEstimatedExchanges, node, planNode -> UNKNOWN_COST, planNode -> PlanNodeStatsEstimate.unknown(), types)) .hasUnknownComponents(); }

Target:
private void assertCostHasUnknownComponentsForUnknownStats(PlanNode node, Map<String, Type> types) { new CostAssertionBuilder(calculateCumulativeCost( costCalculatorUsingExchanges, node, planNode -> PlanNodeCostEstimate.unknown(), planNode -> PlanNodeStatsEstimate.unknown(), types)) .hasUnknownComponents(); new CostAssertionBuilder(calculateCumulativeCost( costCalculatorWithEstimatedExchanges, node, planNode -> PlanNodeCostEstimate.unknown(), planNode -> PlanNodeStatsEstimate.unknown(), types)) .hasUnknownComponents(); }
Source:
protected void sharedHarvest(ItemStack stack, World world, EntityPlayer player, BlockPos blockPos, IBlockState blockState, boolean silkTouch, int fortuneLvl) { if (blockState.getBlockHardness(world, blockPos) != -1.0F) { float strengthVsBlock = getDestroySpeed(stack, blockState); if (strengthVsBlock > 1.1F && world.canMineBlockBody(player, blockPos)) { if (silkTouch && blockState.getBlock().canSilkHarvest(world, blockPos, world.getBlockState(blockPos), player)) ItemHandlerHelper.giveItemToPlayer(player, new ItemStack(Item.getItemFromBlock(blockState.getBlock()))); else { NonNullList<ItemStack> itemDrops = NonNullList.create(); blockState.getBlock().getDrops(itemDrops, world, blockPos, world.getBlockState(blockPos), fortuneLvl); for (ItemStack stacks : itemDrops) ItemHandlerHelper.giveItemToPlayer(player, stacks); } blockState.getBlock().removedByPlayer(world.getBlockState(blockPos), world, blockPos, player, false); } } }

Target:
protected void sharedHarvest(ItemStack stack, World world, EntityPlayer player, BlockPos blockPos, IBlockState blockState, boolean silkTouch, int fortuneLvl) { if (blockState.getBlockHardness(world, blockPos) != -1.0F) { float strengthVsBlock = getDestroySpeed(stack, blockState); if (strengthVsBlock > 1.1F && world.canMineBlockBody(player, blockPos)) { if (silkTouch && blockState.getBlock().canSilkHarvest(world, blockPos, world.getBlockState(blockPos), player)) ItemHandlerHelper.giveItemToPlayer(player, new ItemStack(Item.getItemFromBlock(blockState.getBlock()))); else { NonNullList<ItemStack> itemDrops = new NonNullList<>(); blockState.getBlock().getDrops(itemDrops, world, blockPos, world.getBlockState(blockPos), fortuneLvl); for (ItemStack stacks : itemDrops) ItemHandlerHelper.giveItemToPlayer(player, stacks); } blockState.getBlock().removedByPlayer(world.getBlockState(blockPos), world, blockPos, player, false); } } }
Source:
public void setSessionId(long sessionId) { this.fSessionId = sessionId; }

Target:
public void setSessionId(long sessionId) { fSessionId = sessionId; }
Source:
public String addSharedScope(Scope scope, String tenantDomain) throws APIManagementException { Set<Scope> scopeSet = new HashSet<>(); scopeSet.add(scope); int tenantId = APIUtil.getTenantIdFromTenantDomain(tenantDomain); scopesDAO.addScopes(scopeSet, tenantId); Map<String, KeyManagerDto> tenantKeyManagers = KeyManagerHolder.getTenantKeyManagers(tenantDomain); for (Map.Entry<String, KeyManagerDto> keyManagerDtoEntry : tenantKeyManagers.entrySet()) { KeyManager keyManager = keyManagerDtoEntry.getValue().getKeyManager(); if (keyManager != null) { try{ keyManager.registerScope(scope); }catch (APIManagementException e){ log.error("Error occured while registering Scope in KeyManager " + keyManagerDtoEntry.getKey(), e); } } if (log.isDebugEnabled()) { log.debug("Adding shared scope mapping: " + scope.getKey() + " to Keymanager: " + keyManagerDtoEntry.getKey()); } } return ApiMgtDAO.getInstance().addSharedScope(scope, tenantDomain); }

Target:
public String addSharedScope(Scope scope, String tenantDomain) throws APIManagementException { Set<Scope> scopeSet = new HashSet<>(); scopeSet.add(scope); int tenantId = APIUtil.getTenantIdFromTenantDomain(tenantDomain); addScopes(scopeSet, tenantId); Map<String, KeyManagerDto> tenantKeyManagers = KeyManagerHolder.getTenantKeyManagers(tenantDomain); for (Map.Entry<String, KeyManagerDto> keyManagerDtoEntry : tenantKeyManagers.entrySet()) { KeyManager keyManager = keyManagerDtoEntry.getValue().getKeyManager(); if (keyManager != null) { try { keyManager.registerScope(scope); } catch (APIManagementException e) { log.error("Error occurred while registering Scope in Key Manager " + keyManagerDtoEntry.getKey(), e); } } if (log.isDebugEnabled()) { log.debug("Adding shared scope mapping: " + scope.getKey() + " to Key Manager : " + keyManagerDtoEntry.getKey()); } } return ApiMgtDAO.getInstance().addSharedScope(scope, tenantDomain); }
Source:
public void addPrimaryReassignmentDetails(PartitionRebalanceInfo details) { totalPrimaryTransfersCompleted += details.getPrimaryTransfersCompleted(); totalPrimaryTransferTime = totalPrimaryTransferTime + details.getPrimaryTransferTime(); }

Target:
public void addPrimaryReassignmentDetails(PartitionRebalanceInfo details) { totalPrimaryTransfersCompleted += details.getPrimaryTransfersCompleted(); totalPrimaryTransferTime += details.getPrimaryTransferTime(); }
Source:
public SourceState poll(Emitter<StructuredRecord> writer, SourceState currentState) throws Exception { URL url = new URL(config.getUrl()); String response; URLConnection rawConnection = url.openConnection(); try { HttpURLConnection connection = (HttpURLConnection) url.openConnection(); try { if (connection.getResponseCode() == HttpURLConnection.HTTP_OK) { response = new String(ByteStreams.toByteArray(connection.getInputStream()), Charsets.UTF_8); } else if (connection.getResponseCode() == HttpURLConnection.HTTP_BAD_REQUEST) { response = new String(ByteStreams.toByteArray(connection.getErrorStream()), Charsets.UTF_8); } else { throw new Exception("Invalid response code returned: " + connection.getResponseCode()); } } finally { connection.disconnect(); } } catch (ClassCastException e) { if (e.getMessage().contains("FileURLConnection cannot be cast to java.net.HttpURLConnection")) { response = new String(ByteStreams.toByteArray(rawConnection.getInputStream()), Charsets.UTF_8); } else { throw e; } } Map<String, List<String>> headers = rawConnection.getHeaderFields(); Map<String, String> flattenedHeaders = new HashMap<>(); for (Map.Entry<String, List<String>> entry : headers.entrySet()) { if (!Strings.isNullOrEmpty(entry.getKey())) { flattenedHeaders.put(entry.getKey(), Joiner.on(',').skipNulls().join(entry.getValue())); } } writeDefaultRecords(writer, response, flattenedHeaders); TimeUnit.SECONDS.sleep(config.getDelayInSeconds()); return currentState; }

Target:
public SourceState poll(Emitter<StructuredRecord> writer, SourceState currentState) throws Exception { URL url = new URL(config.getUrl()); String response; URLConnection rawConnection = url.openConnection(); try { HttpURLConnection connection = (HttpURLConnection) rawConnection; try { if (connection.getResponseCode() == HttpURLConnection.HTTP_OK) { response = Bytes.toString(ByteStreams.toByteArray(connection.getInputStream())); } else if (connection.getResponseCode() == HttpURLConnection.HTTP_BAD_REQUEST) { response = Bytes.toString(ByteStreams.toByteArray(connection.getErrorStream())); } else { throw new Exception("Invalid response code returned: " + connection.getResponseCode()); } } finally { connection.disconnect(); } } catch (ClassCastException e) { if (e.getMessage().contains("FileURLConnection cannot be cast to java.net.HttpURLConnection")) { response = Bytes.toString(ByteStreams.toByteArray(rawConnection.getInputStream())); } else { throw e; } } Map<String, List<String>> headers = rawConnection.getHeaderFields(); Map<String, String> flattenedHeaders = new HashMap<>(); for (Map.Entry<String, List<String>> entry : headers.entrySet()) { if (!Strings.isNullOrEmpty(entry.getKey())) { flattenedHeaders.put(entry.getKey(), Joiner.on(',').skipNulls().join(entry.getValue())); } } writeDefaultRecords(writer, response, flattenedHeaders); TimeUnit.SECONDS.sleep(config.getIntervalInSeconds()); return currentState; }
Source:
public void afterPlace(GlowPlayer player, GlowBlock block, ItemStack holding) { if (block.getType() == Material.BED_BLOCK) { BlockFace direction; direction = ((Bed)block.getState().getData()).getFacing(); GlowBlock headBlock; headBlock = block.getRelative(direction); headBlock.setType(Material.BED_BLOCK); GlowBlockState headBlockState; headBlockState = headBlock.getState(); MaterialData data = headBlockState.getData(); ((Bed)data).setHeadOfBed(true); ((Bed)data).setFacingDirection(direction); headBlockState.setData(data); headBlockState.update(true); } }

Target:
public void afterPlace(GlowPlayer player, GlowBlock block, ItemStack holding) { if (block.getType() == Material.BED_BLOCK) { BlockFace direction = ((Bed)block.getState().getData()).getFacing(); GlowBlock headBlock = block.getRelative(direction); headBlock.setType(Material.BED_BLOCK); GlowBlockState headBlockState = headBlock.getState(); MaterialData data = headBlockState.getData(); ((Bed)data).setHeadOfBed(true); ((Bed)data).setFacingDirection(direction); headBlockState.setData(data); headBlockState.update(true); } }
Source:
private static Integer sysPropToIntOrNull(String sysProp) { final String val = System.getProperty(sysProp, null); if (val == null) { return null; } try { return Integer.parseInt(val); } catch (NumberFormatException e) { LOG.error("Failed to parse value of system property {}='{}' to an integer. Using default value."); return null; } }

Target:
private static Integer sysPropToIntOrNull(String sysProp) { final String val = System.getProperty(sysProp, null); if (val == null) { return null; } try { return Integer.parseInt(val); } catch (NumberFormatException e) { LOG.error("Failed to parse value of system property {}='{}' to an integer. Using default value.", sysProp, val); return null; } }
Source:
public void testPutFunctionExtension1() throws InterruptedException { log.info("PutFunctionExtension TestCase with test attributeExpressionExecutors length"); SiddhiManager siddhiManager = new SiddhiManager(); String inStreamDefinition = "\ndefine stream inputStream (symbol string, price long, volume long);"; String query = ("@info(name = 'query1') from inputStream select symbol,price, " + "map:create() as tmpMap insert into tmpStream;" + "@info(name = 'query2') from tmpStream select symbol,price,tmpMap, map:put(tmpMap,symbol) as newmap" + " insert into outputStream;" ); ExecutionPlanRuntime executionPlanRuntime = siddhiManager.createExecutionPlanRuntime(inStreamDefinition + query); InputHandler inputHandler = executionPlanRuntime.getInputHandler("inputStream"); executionPlanRuntime.start(); executionPlanRuntime.shutdown(); }

Target:
public void testPutFunctionExtension1() throws InterruptedException { log.info("PutFunctionExtension TestCase with test attributeExpressionExecutors length"); SiddhiManager siddhiManager = new SiddhiManager(); String inStreamDefinition = "\ndefine stream inputStream (symbol string, price long, volume long);"; String query = ("@info(name = 'query1') from inputStream select symbol,price, " + "map:create() as tmpMap insert into tmpStream;" + "@info(name = 'query2') from tmpStream select symbol,price,tmpMap, map:put(tmpMap,symbol) as newmap" + " insert into outputStream;" ); ExecutionPlanRuntime executionPlanRuntime = siddhiManager.createExecutionPlanRuntime(inStreamDefinition + query); executionPlanRuntime.start(); executionPlanRuntime.shutdown(); }