auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected Warning createWarning(final Matcher matcher) { Priority priority; if ("Remark".equals(matcher.group(3))) { priority = Priority.LOW; } else if ("Warning".equals(matcher.group(3))) { priority = Priority.NORMAL; } else if ("Error".equals(matcher.group(3))) { priority = Priority.HIGH; } else if ("Fatal Error".equals(matcher.group(3))) { priority = Priority.HIGH; } else { return FALSE_POSITIVE; } String message = normalizeWhitespaceInMessage(matcher.group(5)); return createWarning(matcher.group(1), getLineNumber(matcher.group(2)), matcher.group(4), message, priority); }

Target:
protected Warning createWarning(final Matcher matcher) { Priority priority; priority = determinePriority(matcher.group(GROUP_NUMBER)); return composeWarning(matcher, priority); }
Source:
private void processHandshakeRecord(final Record record, final Connection connection) { LOGGER.debug("Received record from peer [{}]", record.getType(), record.getPeerAddress()); try { if (record.isNewClientHello()) { throw new IllegalArgumentException("new CLIENT_HELLO must be processed by processClientHello!"); } HandshakeMessage handshakeMessage = (HandshakeMessage) record.getFragment(); switch (handshakeMessage.getMessageType()) { case CLIENT_HELLO: if (record.getEpoch() > 0) { LOGGER.debug("Reject re-negociation from peer {}", record.getPeerAddress()); DTLSSession session = connection.getEstablishedSession(); send(new AlertMessage(AlertLevel.WARNING, AlertDescription.NO_RENEGOTIATION, record.getPeerAddress()), session); } else { LOGGER.debug("Discard CLIENT_HELLO for re-negociation from peer {}", record.getPeerAddress()); } break; case HELLO_REQUEST: processHelloRequest(connection); break; default: Handshaker handshaker = connection.getOngoingHandshake(); if (handshaker != null) { handshaker.processMessage(record); } else { LOGGER.debug( "Discarding HANDSHAKE message [epoch={}] from peer [{}], no ongoing handshake!", record.getEpoch(), record.getPeerAddress()); } break; } } catch (HandshakeException e) { handleExceptionDuringHandshake(e, e.getAlert().getLevel(), e.getAlert().getDescription(), connection, record); } }

Target:
private void processHandshakeRecord(final Record record, final Connection connection) { LOGGER.debug("Received record from peer [{}]", record.getType(), record.getPeerAddress()); try { if (record.isNewClientHello()) { throw new IllegalArgumentException("new CLIENT_HELLO must be processed by processClientHello!"); } HandshakeMessage handshakeMessage = (HandshakeMessage) record.getFragment(); switch (handshakeMessage.getMessageType()) { case CLIENT_HELLO: LOGGER.debug("Reject re-negociation from peer {}", record.getPeerAddress()); DTLSSession session = connection.getEstablishedSession(); send(new AlertMessage(AlertLevel.WARNING, AlertDescription.NO_RENEGOTIATION, record.getPeerAddress()), session); break; case HELLO_REQUEST: processHelloRequest(connection); break; default: Handshaker handshaker = connection.getOngoingHandshake(); if (handshaker != null) { handshaker.processMessage(record); } else { LOGGER.debug( "Discarding HANDSHAKE message [epoch={}] from peer [{}], no ongoing handshake!", record.getEpoch(), record.getPeerAddress()); } break; } } catch (HandshakeException e) { handleExceptionDuringHandshake(e, e.getAlert().getLevel(), e.getAlert().getDescription(), connection, record); } }
Source:
static Annotation parseAnnotation(JsonParser parser) throws IOException { if (!parser.isExpectedStartObjectToken()) { throw new IOException("Not a valid JSON object, start token: " + parser.currentToken()); } long timestamp = 0; String value = null; while (parser.nextValue() != JsonToken.END_OBJECT) { switch (parser.currentName()) { case "timestamp": timestamp = parser.getLongValue(); break; case "value": value = parser.getValueAsString(); break; default: } } if (timestamp == 0 || value == null) { throw new IllegalStateException("Incomplete annotation at " + parser.currentToken()); } return Annotation.create(timestamp, value); }

Target:
static Annotation parseAnnotation(JsonParser parser) throws IOException { if (!parser.isExpectedStartObjectToken()) { throw new IllegalArgumentException("Not a valid JSON object, start token: " + parser.currentToken()); } long timestamp = 0; String value = null; while (parser.nextValue() != JsonToken.END_OBJECT) { switch (parser.currentName()) { case "timestamp": timestamp = parser.getLongValue(); break; case "value": value = parser.getValueAsString(); break; default: } } if (timestamp == 0 || value == null) { throw new IllegalArgumentException("Incomplete annotation at " + parser.currentToken()); } return Annotation.create(timestamp, value); }
Source:
public ProductDiscountDraftBuilder isActive(final Boolean isActive) { this.isActive = isActive; return this; }

Target:
public ProductDiscountDraftBuilder isActive(final Boolean isActive) { this.active = isActive; return this; }
Source:
public SetFactoryBean ldapAuthenticationHandlerSetFactoryBean() { val bean = new SetFactoryBean() { @Override protected void destroyInstance(final Set set) { set.forEach(Unchecked.consumer(handler -> { ((DisposableBean) handler).destroy(); })); } }; bean.setSourceSet(new HashSet()); return bean; }

Target:
public SetFactoryBean ldapAuthenticationHandlerSetFactoryBean() { val bean = new SetFactoryBean() { @Override protected void destroyInstance(final Set set) { set.forEach(Unchecked.consumer(handler -> ((DisposableBean) handler).destroy() )); } }; bean.setSourceSet(new HashSet<>()); return bean; }
Source:
public void value(final int destRow) { if (TupleUtils.tupleEquals(inputTB, keyColIndices, sourceRow, uniqueTuples, destRow)) { found = true; int oldcount = tupleCounts.getInt(0, destRow); if (oldcount < threshold) { tupleCounts.replace(0, destRow, new IntArrayColumn(new int[] { oldcount + 1 }, 1), 0); meet = (oldcount + 1 >= threshold); } } }

Target:
public void value(final int destRow) { if (TupleUtils.tupleEquals(inputTB, keyColIndices, sourceRow, uniqueTuples, destRow)) { found = true; int newcount = tupleCounts.getInt(0, destRow) + 1; if (newcount <= threshold) { tupleCounts.replaceInt(0, destRow, newcount); } meet = (newcount >= threshold); } }
Source:
URL setUpBoolShapefile() throws Exception { File d = File.createTempFile("ogrgeojson_8b0dc300", "shp", new File("target")); d.delete(); d.mkdirs(); String[] exts = new String[]{"shp", "shx", "dbf", "prj"}; for (String ext : exts) { if("prj".equals(ext)) { String wkt = CRS.decode("EPSG:4326", true).toWKT(); FileUtils.writeStringToFile(new File(d, "ogrgeojson_8b0dc300.prj"), wkt); } else { FileUtils.copyURLToFile(TestData.url("shapes/ogrgeojson_8b0dc300." + ext), new File(d, "ogrgeojson_8b0dc300." + ext)); } } return URLs.fileToUrl(new File(d, "ogrgeojson_8b0dc300.shp")); }

Target:
URL setUpBoolShapefile() throws Exception { File d = File.createTempFile("BooleanTest", "shp", new File("target")); d.delete(); d.mkdirs(); String[] exts = new String[]{"shp", "shx", "dbf", "prj"}; for (String ext : exts) { if("prj".equals(ext)) { String wkt = CRS.decode("EPSG:4326", true).toWKT(); FileUtils.writeStringToFile(new File(d, "BooleanTest.prj"), wkt); } else { FileUtils.copyURLToFile(TestData.url("shapes/BooleanTest." + ext), new File(d, "BooleanTest." + ext)); } } return URLs.fileToUrl(new File(d, "BooleanTest.shp")); }
Source:
private void updateGeoRepStatus(GlusterVolumeEntity volume, GlusterGeoRepSession session) { List<HashMap<Guid, GeoRepSessionStatus>> list = new ArrayList<>(); int replicaCount = volume.getReplicaCount() == 0 ? 1 : volume.getReplicaCount(); for (int i = 0; i < volume.getBricks().size(); i = i + replicaCount) { HashMap<Guid, GeoRepSessionStatus> subVolumeStatusMap = new HashMap<>(); int j = 0; while (j < replicaCount) { Guid brickId = volume.getBricks().get(i + j).getId(); subVolumeStatusMap.put(brickId, getStatusForBrickFromSession(session, brickId)); j++; } list.add(subVolumeStatusMap); } session.setStatus(GeoRepSessionStatus.ACTIVE); for (HashMap<Guid, GeoRepSessionStatus> subVolumeStatusMap : list) { if (subVolumeStatusMap.containsValue(GeoRepSessionStatus.ACTIVE)) { continue; } else if (subVolumeStatusMap.containsValue(GeoRepSessionStatus.FAULTY)) { session.setStatus(GeoRepSessionStatus.FAULTY); return; } HashSet<GeoRepSessionStatus> statusValues = new HashSet<GeoRepSessionStatus>(subVolumeStatusMap.values()); if (ArrayUtils.contains(overridableStatuses, session.getStatus())) { if (statusValues.size() == 1) { session.setStatus((GeoRepSessionStatus) statusValues.toArray()[0]); } else { log.info("Multiple status values found in volume: {}", session.getMasterVolumeName()); } } } }

Target:
private void updateGeoRepStatus(GlusterVolumeEntity volume, GlusterGeoRepSession session) { List<HashSet<GeoRepSessionStatus>> list = new ArrayList<>(); int replicaCount = volume.getReplicaCount() == 0 ? 1 : volume.getReplicaCount(); for (int i = 0; i < volume.getBricks().size(); i = i + replicaCount) { HashSet<GeoRepSessionStatus> subVolumeStatusSet = new HashSet<>(); int j = 0; while (j < replicaCount) { Guid brickId = volume.getBricks().get(i + j).getId(); subVolumeStatusSet.add(getStatusForBrickFromSession(session, brickId)); j++; } list.add(subVolumeStatusSet); } session.setStatus(GeoRepSessionStatus.ACTIVE); for (HashSet<GeoRepSessionStatus> subVolumeStatusValues : list) { if (subVolumeStatusValues.contains(GeoRepSessionStatus.ACTIVE)) { continue; } else if (subVolumeStatusValues.contains(GeoRepSessionStatus.FAULTY)) { session.setStatus(GeoRepSessionStatus.FAULTY); return; } if (ArrayUtils.contains(overridableStatuses, session.getStatus())) { if (subVolumeStatusValues.size() == 1) { session.setStatus((GeoRepSessionStatus) subVolumeStatusValues.toArray()[0]); } else { log.info("Multiple status values found in volume '{}'", session.getMasterVolumeName()); } } } }
Source:
private void updateEnqueuedWrites(long writes, long timestamp) { enqueuedWrites.accumulateValue(writes); lastWrittenTs = timestamp; }

Target:
private void updateEnqueuedWrites(long writes, long timestamp) { enqueuedWrites.accumulateValue(writes); lastWrittenTs.accumulateAndGet(timestamp, Long::max); }
Source:
public void start(@Nullable BundleContext context) throws Exception { super.start(context); plugin = this; try { Class.forName("org.eclipse.tracecompass.tracing.rcp.ui.cli.CliParserExtension"); } catch (ClassNotFoundException e) { return; } }

Target:
public void start(@Nullable BundleContext context) throws Exception { super.start(context); plugin = this; }
Source:
public SelectorFilter( String dimension, String value, ExtractionFn extractionFn ) { this.dimension = dimension; this.value = Strings.nullToEmpty(value);; this.extractionFn = extractionFn; }

Target:
public SelectorFilter( String dimension, String value, ExtractionFn extractionFn ) { this.dimension = dimension; this.value = Strings.nullToEmpty(value); this.extractionFn = extractionFn; }
Source:
public static String get_software_version(){ String release_name = "-rc.5"; return BuildConfig.VERSION_NAME + release_name + "+" +BuildConfig.VERSION_CODE; }

Target:
public static String get_software_version(){ return BuildConfig.VERSION_NAME + "+" + BuildConfig.VERSION_CODE; }
Source:
public void registerDefaults() { types.put("NORMAL", new SpongeZombieType("NORMAL")); types.put("VILLAGER", new SpongeZombieType("VILLAGER")); types.put("HUSK", new SpongeZombieType("HUSK")); }

Target:
public void registerDefaults() { this.types.put("normal", new SpongeZombieType("minecraft:normal")); this.types.put("villager", new SpongeZombieType("minecraft:villager")); this.types.put("husk", new SpongeZombieType("minecraft:husk")); }
Source:
private static MemoryHistory getHistory() { String prestoCliHistoryFilePath = System.getenv("PRESTO_CLI_HISTORY_FILE"); File historyFile; if (Strings.isNullOrEmpty(prestoCliHistoryFilePath)) { historyFile = new File(getUserHome(), ".presto_history"); } else { historyFile = new File(prestoCliHistoryFilePath); } return getHistory(historyFile); }

Target:
private static MemoryHistory getHistory() { return getHistory(new File(getUserHome(), ".presto_history")); }
Source:
public int scan(String table, String startkey, int recordcount, Set<String> fields, Vector<HashMap<String, ByteIterator>> result) { MongoCursor<Document> cursor = null; try { MongoCollection<Document> collection = database.getCollection(table); Document scanRange = new Document("$gte", startkey); Document query = new Document("_id", scanRange); Document sort = new Document("_id", INCLUDE); FindIterable<Document> findIterable = collection.find(query).sort(sort).limit(recordcount); if (fields != null) { Document projection = new Document(); for (String fieldName : fields) { projection.put(fieldName, INCLUDE); } findIterable.projection(projection); } cursor = findIterable.iterator(); if (!cursor.hasNext()) { System.err.println("Nothing found in scan for key " + startkey); return StatusCode.ERROR; } result.ensureCapacity(recordcount); while (cursor.hasNext()) { HashMap<String, ByteIterator> resultMap = new HashMap<String, ByteIterator>(); Document obj = cursor.next(); fillMap(resultMap, obj); result.add(resultMap); } return StatusCode.OK; } catch (Exception e) { System.err.println(e.toString()); return StatusCode.ERROR; } finally { if (cursor != null) { cursor.close(); } } }

Target:
public Status scan(String table, String startkey, int recordcount, Set<String> fields, Vector<HashMap<String, ByteIterator>> result) { MongoCursor<Document> cursor = null; try { MongoCollection<Document> collection = database.getCollection(table); Document scanRange = new Document("$gte", startkey); Document query = new Document("_id", scanRange); Document sort = new Document("_id", INCLUDE); FindIterable<Document> findIterable = collection.find(query).sort(sort).limit(recordcount); if (fields != null) { Document projection = new Document(); for (String fieldName : fields) { projection.put(fieldName, INCLUDE); } findIterable.projection(projection); } cursor = findIterable.iterator(); if (!cursor.hasNext()) { System.err.println("Nothing found in scan for key " + startkey); return Status.ERROR; } result.ensureCapacity(recordcount); while (cursor.hasNext()) { HashMap<String, ByteIterator> resultMap = new HashMap<String, ByteIterator>(); Document obj = cursor.next(); fillMap(resultMap, obj); result.add(resultMap); } return Status.OK; } catch (Exception e) { System.err.println(e.toString()); return Status.ERROR; } finally { if (cursor != null) { cursor.close(); } } }
Source:
public Ordering<Row> getRowOrdering(final boolean granular) { final boolean pushDownSort = getContextBoolean(GroupByQueryConfig.CTX_KEY_PUSH_DOWN_LIMIT, false); if (pushDownSort && !DefaultLimitSpec.sortingOrderHasNonGroupingFields(limitSpec, dimensions)) { return getRowOrderingForPushDown(granular, (DefaultLimitSpec) limitSpec, aggregatorSpecs); } final boolean sortByDimsFirst = getContextSortByDimsFirst(); final Comparator<Row> timeComparator = getTimeComparator(granular); if (timeComparator == null) { return Ordering.from( new Comparator<Row>() { @Override public int compare(Row lhs, Row rhs) { return compareDims(dimensions, lhs, rhs); } } ); } else if (sortByDimsFirst) { return Ordering.from( new Comparator<Row>() { @Override public int compare(Row lhs, Row rhs) { final int cmp = compareDims(dimensions, lhs, rhs); if (cmp != 0) { return cmp; } return timeComparator.compare(lhs, rhs); } } ); } else { return Ordering.from( new Comparator<Row>() { @Override public int compare(Row lhs, Row rhs) { final int timeCompare = timeComparator.compare(lhs, rhs); if (timeCompare != 0) { return timeCompare; } return compareDims(dimensions, lhs, rhs); } } ); } }

Target:
public Ordering<Row> getRowOrdering(final boolean granular) { if (applyLimitPushDown) { if (!DefaultLimitSpec.sortingOrderHasNonGroupingFields((DefaultLimitSpec) limitSpec, dimensions)) { return getRowOrderingForPushDown(granular, (DefaultLimitSpec) limitSpec); } } final boolean sortByDimsFirst = getContextSortByDimsFirst(); final Comparator<Row> timeComparator = getTimeComparator(granular); if (timeComparator == null) { return Ordering.from((lhs, rhs) -> compareDims(dimensions, lhs, rhs)); } else if (sortByDimsFirst) { return Ordering.from( (lhs, rhs) -> { final int cmp = compareDims(dimensions, lhs, rhs); if (cmp != 0) { return cmp; } return timeComparator.compare(lhs, rhs); } ); } else { return Ordering.from( (lhs, rhs) -> { final int timeCompare = timeComparator.compare(lhs, rhs); if (timeCompare != 0) { return timeCompare; } return compareDims(dimensions, lhs, rhs); } ); } }
Source:
public Response start(Action action) { return doAction(VdcActionType.StartGlusterVolume, new GlusterVolumeActionParameters(guid, action.isForce() == null ? false : action.isForce()), action); }

Target:
public Response start(Action action) { return doAction(VdcActionType.StartGlusterVolume, new GlusterVolumeActionParameters(guid, action.isSetForce() ? action.isForce() : false), action); }
Source:
public RaptorCachingHdfsConfiguration( @ForCachingFileSystem RaptorHdfsConfiguration hiveHdfsConfiguration, CacheConfig cacheConfig, CacheManager cacheManager) { this.hiveHdfsConfiguration = requireNonNull(hiveHdfsConfiguration, "hiveHdfsConfiguration is null"); this.cacheManager = requireNonNull(cacheManager, "CacheManager is null"); cacheConfig = requireNonNull(cacheConfig, "cacheConfig is null"); this.cacheValidationEnabled = cacheConfig.isValidationEnabled(); }

Target:
public RaptorCachingHdfsConfiguration( @ForCachingFileSystem RaptorHdfsConfiguration hiveHdfsConfiguration, CacheConfig cacheConfig, CacheManager cacheManager) { this.hiveHdfsConfiguration = requireNonNull(hiveHdfsConfiguration, "hiveHdfsConfiguration is null"); this.cacheManager = requireNonNull(cacheManager, "CacheManager is null"); this.cacheValidationEnabled = requireNonNull(cacheConfig, "cacheConfig is null").isValidationEnabled(); }
Source:
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { resp.setContentType("text.plain"); int count = 0; Object sessionValue = req.getSession().getAttribute("count"); if (sessionValue != null) { count = (int)sessionValue; count++; resp.getWriter().println("Session parameter: " + count); } else { resp.getWriter().println("No session parameter found, reload the page"); } req.getSession().setAttribute("count", count); }

Target:
protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException { resp.setContentType("text/plain"); int count = 0; Object sessionValue = req.getSession().getAttribute("count"); if (sessionValue != null) { count = (int)sessionValue; count++; resp.getWriter().println("Session parameter: " + count); } else { resp.getWriter().println("No session parameter found, reload the page"); } req.getSession().setAttribute("count", count); }
Source:
private static int findBucket( final ByteBuffer tableBuffer, final int buckets, final int bucketSize, final boolean allowNewBucket, final ByteBuffer keyBuffer, final int keySize, final int keyHash ) { Preconditions.checkArgument( keySize == keyBuffer.remaining(), "keyBuffer.remaining[%s] != keySize[%s]", keyBuffer.remaining(), keySize ); final int startBucket = Math.abs(keyHash % buckets); int bucket = startBucket; outer: while (true) { final int bucketOffset = bucket * bucketSize; if ((tableBuffer.get(bucketOffset) & 0x80) == 0) { return allowNewBucket ? bucket : -1; } for (int i = bucketOffset + HASH_SIZE, j = keyBuffer.position(); j < keyBuffer.position() + keySize; i++, j++) { if (tableBuffer.get(i) != keyBuffer.get(j)) { bucket += 1; if (bucket == buckets) { bucket = 0; } if (bucket == startBucket) { return -1; } continue outer; } } return bucket; } }

Target:
private static int findBucket( final ByteBuffer tableBuffer, final int buckets, final int bucketSize, final boolean allowNewBucket, final ByteBuffer keyBuffer, final int keySize, final int keyHash ) { final int startBucket = keyHash % buckets; int bucket = startBucket; outer: while (true) { final int bucketOffset = bucket * bucketSize; if ((tableBuffer.get(bucketOffset) & 0x80) == 0) { return allowNewBucket ? bucket : -1; } for (int i = bucketOffset + HASH_SIZE, j = keyBuffer.position(); j < keyBuffer.position() + keySize; i++, j++) { if (tableBuffer.get(i) != keyBuffer.get(j)) { bucket += 1; if (bucket == buckets) { bucket = 0; } if (bucket == startBucket) { return -1; } continue outer; } } return bucket; } }
Source:
private void loginOnBehalf(String externalId, String authzName, String namespace) { try { AuthenticationProfile profile = getProfileByAuthzName(authzName); DirectoryUser pR = DirectoryUtils.findDirectoryUserById( profile.getAuthz(), namespace, externalId, true, true); Collection<ExtMap> principalRecords = AuthzUtils.findPrincipalsByIds( profile.getAuthz(), namespace, Arrays.asList(externalId), true, true); if (!principalRecords.isEmpty()) { ExtMap principalRecord = principalRecords.iterator().next(); DirectoryUtils.flatGroups(principalRecord); attachUserToSession(profile, principalRecord); } } catch (Exception ex) { log.debug("Exception", ex); } }

Target:
private void loginOnBehalf(String externalId, String authzName, String namespace) { try { AuthenticationProfile profile = getProfileByAuthzName(authzName); Collection<ExtMap> principalRecords = AuthzUtils.findPrincipalsByIds( profile.getAuthz(), namespace, Arrays.asList(externalId), true, true); if (!principalRecords.isEmpty()) { ExtMap principalRecord = principalRecords.iterator().next(); DirectoryUtils.flatGroups(principalRecord); attachUserToSession(profile, principalRecord); } } catch (Exception ex) { log.debug("Exception", ex); } }
Source:
public void handlePullRequestEvent(PullRequestEvent pullRequestEvent) throws IOException { Set<PullRequestEvent.Action> openActions = Sets.newHashSet(PullRequestEvent.Action.opened, PullRequestEvent.Action.reopened); GitInfo gitInfo = branchService.upsert(gitInfo(pullRequestEvent, openActions.contains(pullRequestEvent.getAction()))); if (pullRequestEvent.getAction().equals(PullRequestEvent.Action.opened) || pullRequestEvent.getAction().equals(PullRequestEvent.Action.reopened)) { Set<Module> modules = moduleService.getByBranch(gitInfo.getId().get()); triggerBuilds(gitInfo, modules); recordEvents(modules, pullRequestEvent.getPullRequestOrBuilder().getUser().getUsername()); } else if (pullRequestEvent.getAction().equals(PullRequestEvent.Action.closed)) { branchService.delete(gitInfo); } else { LOG.info("Pull request action has no impact on builds, not doing anything", pullRequestEvent.getAction()); } }

Target:
public void handlePullRequestEvent(PullRequestEvent pullRequestEvent) throws IOException { Set<PullRequestEvent.Action> openActions = EnumSet.of(PullRequestEvent.Action.opened, PullRequestEvent.Action.reopened); GitInfo gitInfo = branchService.upsert(gitInfo(pullRequestEvent, openActions.contains(pullRequestEvent.getAction()))); if (pullRequestEvent.getAction().equals(PullRequestEvent.Action.opened) || pullRequestEvent.getAction().equals(PullRequestEvent.Action.reopened)) { Set<Module> modules = moduleService.getByBranch(gitInfo.getId().get()); triggerBuilds(gitInfo, modules); recordEvents(modules, pullRequestEvent.getPullRequestOrBuilder().getUser().getUsername()); } else if (pullRequestEvent.getAction().equals(PullRequestEvent.Action.closed)) { branchService.delete(gitInfo); } else { LOG.info("Pull request action has no impact on builds, not doing anything", pullRequestEvent.getAction()); } }
Source:
public CompletionStageAssert<V> isCancelled() { assertThat(actual.toCompletableFuture().isCancelled()) .overridingErrorMessage("Expected completion stage to be cancelled") .isTrue(); return this; }

Target:
public CompletionStageAssert<V> isCancelled() { boolean cancelled = false; try { actual.toCompletableFuture().get(2, TimeUnit.SECONDS); } catch (CancellationException e) { cancelled = true; } catch (Exception ignored) { } if (!cancelled) { fail("Expected completion stage to be cancelled"); } return this; }
Source:
public void run() { try { this.departureHandlers.add(this.teleportationEngine); this.activityHandlers.add( this.activityEngine ) ; prepareSim(); this.listenerManager.fireQueueSimulationInitializedEvent(); for (MobsimAgent agent : new ArrayList<>(this.agents.values())) { arrangeNextAgentAction(agent); } boolean doContinue = true; while (doContinue) { doContinue = doSimStep(); } } finally { try { cleanupSim(); } catch(Exception e) { log.warn("exception in finally block - this may be a follow-up exception of an exception thrown in the try block."); e.printStackTrace(); } } }

Target:
public void run() { try { this.departureHandlers.add(this.teleportationEngine); this.activityHandlers.add( this.activityEngine ) ; prepareSim(); this.listenerManager.fireQueueSimulationInitializedEvent(); for (MobsimAgent agent : new ArrayList<>(this.agents.values())) { arrangeNextAgentAction(agent); } boolean doContinue = true; while (doContinue) { doContinue = doSimStep(); } } finally { try { cleanupSim(); } catch(Exception e) { log.warn( "exception in finally block - " + "this may be a follow-up exception of an exception thrown in the try block.", e); } } }
Source:
private IBundleProvider performSearch(String theCriteria) { IFhirResourceDao<?> subscriptionDao = myDaoRegistry.getSubscriptionDao(); RuntimeResourceDefinition responseResourceDef = subscriptionDao.validateCriteriaAndReturnResourceDefinition(theCriteria); SearchParameterMap responseCriteriaUrl = myMatchUrlService.translateMatchUrl(theCriteria, responseResourceDef); IFhirResourceDao<? extends IBaseResource> responseDao = myDaoRegistry.getResourceDao(responseResourceDef.getImplementingClass()); responseCriteriaUrl.setLoadSynchronousUpTo(1); if (ourForceDelayBeforeMatching) { try { Thread.sleep(2000); } catch (InterruptedException theE) { theE.printStackTrace(); } } TransactionTemplate txTemplate = new TransactionTemplate(myTxManager); txTemplate.setPropagationBehavior(TransactionTemplate.PROPAGATION_REQUIRES_NEW); return txTemplate.execute(t -> responseDao.search(responseCriteriaUrl)); }

Target:
private IBundleProvider performSearch(String theCriteria) { IFhirResourceDao<?> subscriptionDao = myDaoRegistry.getSubscriptionDao(); RuntimeResourceDefinition responseResourceDef = subscriptionDao.validateCriteriaAndReturnResourceDefinition(theCriteria); SearchParameterMap responseCriteriaUrl = myMatchUrlService.translateMatchUrl(theCriteria, responseResourceDef); IFhirResourceDao<? extends IBaseResource> responseDao = myDaoRegistry.getResourceDao(responseResourceDef.getImplementingClass()); responseCriteriaUrl.setLoadSynchronousUpTo(1); TransactionTemplate txTemplate = new TransactionTemplate(myTxManager); txTemplate.setPropagationBehavior(TransactionDefinition.PROPAGATION_REQUIRES_NEW); return txTemplate.execute(t -> responseDao.search(responseCriteriaUrl)); }
Source:
public void hangup(GsmCdmaCall call) throws CallStateException { if (call.getConnections().size() == 0) { throw new CallStateException("no connections in call"); } if (call == mRingingCall) { if (Phone.DEBUG_PHONE) log("(ringing) hangup waiting or background"); logHangupEvent(call); mCi.hangupWaitingOrBackground(obtainCompleteMessage()); } else if (call == mForegroundCall) { if (call.isDialingOrAlerting()) { if (Phone.DEBUG_PHONE) { log("(foregnd) hangup dialing or alerting..."); } hangup((GsmCdmaConnection)(call.getConnections().get(0))); } else if (isPhoneTypeGsm() && mRingingCall.isRinging()) { log("hangup all conns in active/background call, without affecting ringing call"); hangupAllConnections(call); } else if (mBackgroundCall.mConnections.size() == 0) { log("hangup the foreground call"); hangupWaitingOrBackground(); } else { logHangupEvent(call); hangupForegroundResumeBackground(); } } else if (call == mBackgroundCall) { if (mRingingCall.isRinging()) { if (Phone.DEBUG_PHONE) { log("hangup all conns in background call"); } hangupAllConnections(call); } else { hangupWaitingOrBackground(); } } else { throw new RuntimeException ("GsmCdmaCall " + call + "does not belong to GsmCdmaCallTracker " + this); } call.onHangupLocal(); mPhone.notifyPreciseCallStateChanged(); }

Target:
public void hangup(GsmCdmaCall call) throws CallStateException { if (call.getConnections().size() == 0) { throw new CallStateException("no connections in call"); } if (call == mRingingCall) { if (Phone.DEBUG_PHONE) log("(ringing) hangup waiting or background"); logHangupEvent(call); mCi.hangupWaitingOrBackground(obtainCompleteMessage()); } else if (call == mForegroundCall) { if (call.isDialingOrAlerting()) { if (Phone.DEBUG_PHONE) { log("(foregnd) hangup dialing or alerting..."); } hangup((GsmCdmaConnection)(call.getConnections().get(0))); } else if (isPhoneTypeGsm() && mRingingCall.isRinging()) { log("hangup all conns in active/background call, without affecting ringing call"); hangupAllConnections(call); } else if (call.mHoldingRequestState.isStarted()) { log("hangup waiting or background call"); logHangupEvent(call); hangupWaitingOrBackground(); } else { logHangupEvent(call); hangupForegroundResumeBackground(); } } else if (call == mBackgroundCall) { if (mRingingCall.isRinging()) { if (Phone.DEBUG_PHONE) { log("hangup all conns in background call"); } hangupAllConnections(call); } else { hangupWaitingOrBackground(); } } else { throw new RuntimeException ("GsmCdmaCall " + call + "does not belong to GsmCdmaCallTracker " + this); } call.onHangupLocal(); mPhone.notifyPreciseCallStateChanged(); }
Source:
private DbUser getDbUserForPrincipalName(String principalName, String authzName) { ExtMap principalRecord = AuthzUtils.fetchPrincipalRecord( EngineExtensionsManager.getInstance().getExtensionByName(authzName), principalName, false, false); if (principalRecord == null) { throw new RuntimeException(String.format("Unable to find principal %s in domain '%s'", principalName, authzName)); } DbUser user = new DbUser(DirectoryUtils.mapPrincipalRecordToDirectoryUser(authzName, principalRecord)); user.setId(Guid.newGuid()); return user; }

Target:
private DbUser getDbUserForPrincipalName(String principalName, String authzName) { ExtMap principalRecord = AuthzUtils.fetchPrincipalRecord( EngineExtensionsManager.getInstance().getExtensionByName(authzName), principalName, false, false); if (principalRecord == null) { throw new EngineException(EngineError.PRINCIPAL_NOT_FOUND, String.format("%s in domain '%s", principalName, authzName)); } DbUser user = new DbUser(DirectoryUtils.mapPrincipalRecordToDirectoryUser(authzName, principalRecord)); user.setId(Guid.newGuid()); return user; }
Source:
public void selectTab(Tab tabName){ WebElement tab = waitForElementByCss("a[rel='"+tabName.toString()+"Tab']"); scrollAndClick(tab); waitForElementByCss("li.selected a[rel='"+tabName.toString()+"Tab']"); PageObjectLogging.log("submitSelection", "selection of new skin saved", true); }

Target:
public void selectTab(Tab tabName){ WebElement tab = waitForElementByCss(tabSelector.replace("%tabName%", tabName.toString())); scrollAndClick(tab); waitForElementByCss(selectedTabSelector.replace("%tabName%", tabName.toString())); PageObjectLogging.log("selectTab", tabName.toString()+" tab has been selected", true); }
Source:
public boolean purgeBlob(CloudBlobMetadata blobMetadata) throws CloudStorageException { String blobId = blobMetadata.getId(); String blobFileName = blobMetadata.getCloudBlobName(); String partitionPath = blobMetadata.getPartitionId(); String containerName = getAzureContainerName(partitionPath); RequestOptions options = new RequestOptions(); options.setPartitionKey(new PartitionKey(partitionPath)); azureMetrics.blobDeleteRequestCount.inc(); Timer.Context deleteTimer = azureMetrics.blobDeletionTime.time(); try { CloudBlobContainer azureContainer = azureBlobClient.getContainerReference(containerName); CloudBlockBlob azureBlob = azureContainer.getBlockBlobReference(blobFileName); azureBlob.deleteIfExists(); String docLink = cosmosCollectionLink + "/docs/" + blobId; documentClient.deleteDocument(docLink, options); azureMetrics.blobDeletedCount.inc(); return true; } catch (Exception e) { azureMetrics.blobDeleteErrorCount.inc(); String error = (e instanceof DocumentClientException) ? "Failed to delete metadata document for blob " + blobId : "Failed to delete blob " + blobId + ", storage path: " + containerName + "/" + blobFileName; throw new CloudStorageException(error, e); } finally { deleteTimer.stop(); } }

Target:
public boolean purgeBlob(CloudBlobMetadata blobMetadata) throws CloudStorageException { String blobId = blobMetadata.getId(); String blobFileName = blobMetadata.getCloudBlobName(); String partitionPath = blobMetadata.getPartitionId(); String containerName = getAzureContainerName(partitionPath); RequestOptions options = new RequestOptions(); options.setPartitionKey(new PartitionKey(partitionPath)); azureMetrics.blobDeleteRequestCount.inc(); Timer.Context deleteTimer = azureMetrics.blobDeletionTime.time(); try { CloudBlobContainer azureContainer = azureBlobClient.getContainerReference(containerName); CloudBlockBlob azureBlob = azureContainer.getBlockBlobReference(blobFileName); boolean deletionDone = azureBlob.deleteIfExists(); String docLink = cosmosCollectionLink + "/docs/" + blobId; try { documentClient.deleteDocument(docLink, options); deletionDone = true; logger.debug("Purged blob from partition {}.", blobId, partitionPath); } catch (DocumentClientException dex) { if (dex.getStatusCode() == HttpURLConnection.HTTP_NOT_FOUND) { logger.warn("Could not find metadata for blob to delete", blobId); } else { throw dex; } } azureMetrics.blobDeletedCount.inc(deletionDone ? 1 : 0); return deletionDone; } catch (Exception e) { azureMetrics.blobDeleteErrorCount.inc(); String error = (e instanceof DocumentClientException) ? "Failed to delete metadata document for blob " + blobId : "Failed to delete blob " + blobId + ", storage path: " + containerName + "/" + blobFileName; throw new CloudStorageException(error, e); } finally { deleteTimer.stop(); } }
Source:
public static SimpleInterval trimInterval(final Locatable interval, final TargetCollection<? extends Locatable> targets, final TargetCollection<? extends Locatable> snps) { Utils.nonNull(interval, "The interval cannot be null."); Utils.nonNull(targets, "The collection of targets cannot be null."); Utils.nonNull(snps, "The collection of SNPs cannot be null."); final IndexRange targetRange = targets.indexRange(interval); final IndexRange snpRange = snps.indexRange(interval); final int numTargetsInInterval = targetRange.size(); final int numSNPsInInterval = snpRange.size(); int start = interval.getStart(); int end = interval.getEnd(); if (numTargetsInInterval == 0 && numSNPsInInterval > 0) { start = snps.target(snpRange.from).getStart(); end = snps.target(snpRange.to - 1).getEnd(); } else if (numTargetsInInterval > 0) { if (!(targets.target(targetRange.from).getStart() <= interval.getStart() && interval.getStart() <= targets.target(targetRange.from).getEnd())) { start = targets.target(targetRange.from).getStart(); } if (!(targets.target(targetRange.to - 1).getStart() <= interval.getEnd() && interval.getEnd() <= targets.target(targetRange.to - 1).getEnd())) { end = targets.target(targetRange.to - 1).getEnd(); } if (numSNPsInInterval > 0) { start = Math.min(start, snps.target(snpRange.from).getStart()); end = Math.max(end, snps.target(snpRange.to - 1).getEnd()); } } if (start < interval.getStart() || end > interval.getEnd() || end < start) { throw new GATKException.ShouldNeverReachHereException("Something went wrong in trimming interval."); } return new SimpleInterval(interval.getContig(), start, end); }

Target:
public static SimpleInterval trimInterval(final Locatable interval, final TargetCollection<? extends Locatable> targets, final TargetCollection<? extends Locatable> snps) { Utils.nonNull(interval, "The interval cannot be null."); Utils.nonNull(targets, "The collection of targets cannot be null."); Utils.nonNull(snps, "The collection of SNPs cannot be null."); final IndexRange targetRange = targets.indexRange(interval); final IndexRange snpRange = snps.indexRange(interval); final int numTargetsInInterval = targetRange.size(); final int numSNPsInInterval = snpRange.size(); int start = interval.getStart(); int end = interval.getEnd(); if (numTargetsInInterval == 0 && numSNPsInInterval > 0) { start = snps.target(snpRange.from).getStart(); end = snps.target(snpRange.to - 1).getEnd(); } else if (numTargetsInInterval > 0) { start = Math.max(start, targets.target(targetRange.from).getStart()); end = Math.min(end, targets.target(targetRange.to - 1).getEnd()); if (numSNPsInInterval > 0) { start = Math.min(start, snps.target(snpRange.from).getStart()); end = Math.max(end, snps.target(snpRange.to - 1).getEnd()); } } if (start < interval.getStart() || end > interval.getEnd() || end < start) { throw new GATKException.ShouldNeverReachHereException("Something went wrong in trimming interval."); } return new SimpleInterval(interval.getContig(), start, end); }
Source:
private static void appendOptionalMatchOwnerEmbeddedNodes(StringBuilder queryBuilder) { queryBuilder.append( " OPTIONAL MATCH (owner) -[r*]->(:" ); queryBuilder.append( NodeLabel.EMBEDDED ); queryBuilder.append( ")" ); }

Target:
private static void appendOptionalMatchOwnerEmbeddedNodes(StringBuilder queryBuilder) { queryBuilder.append( " OPTIONAL MATCH (" ); queryBuilder.append( ENTITY_ALIAS ); queryBuilder.append( ") -[r*]->(:" ); queryBuilder.append( NodeLabel.EMBEDDED ); queryBuilder.append( ")" ); }
Source:
public void testPolicies() throws Exception { String permission = WRITE; String[] permissions = { WRITE }; Document doc = mockery.mock(Document.class, "document1"); mockery.checking(new Expectations() { { allowing(doc).getLock(); will(returnValue(null)); } }); assertSame(UNKNOWN, service.checkPermission(doc, null, creatorPrincipal, permission, permissions, null)); assertSame(UNKNOWN, service.checkPermission(doc, null, userPrincipal, permission, permissions, null)); Lock lock = new Lock(user, new GregorianCalendar()); Document doc2 = mockery.mock(Document.class, "document2"); mockery.checking(new Expectations() { { allowing(doc2).getLock(); will(returnValue(lock)); allowing(doc2).getPropertyValue("dc:creator"); will(returnValue(creator)); } }); assertSame(DENY, service.checkPermission(doc2, null, creatorPrincipal, permission, permissions, null)); assertSame(UNKNOWN, service.checkPermission(doc2, null, userPrincipal, permission, permissions, null)); deployContrib(CORE_TESTS_BUNDLE, "test-security-policy-contrib.xml"); applyInlineDeployments(); postSetUp(); assertSame(GRANT, service.checkPermission(doc2, null, creatorPrincipal, permission, permissions, null)); assertSame(UNKNOWN, service.checkPermission(doc2, null, userPrincipal, permission, permissions, null)); }

Target:
public void testPolicies() throws Exception { String permission = WRITE; String[] permissions = { WRITE }; Document doc = mockery.mock(Document.class, "document1"); mockery.checking(new Expectations() { { allowing(doc).getLock(); will(returnValue(null)); } }); assertSame(UNKNOWN, service.checkPermission(doc, null, creatorPrincipal, permission, permissions, null)); assertSame(UNKNOWN, service.checkPermission(doc, null, userPrincipal, permission, permissions, null)); Lock lock = new Lock(user, new GregorianCalendar()); Document doc2 = mockery.mock(Document.class, "document2"); mockery.checking(new Expectations() { { allowing(doc2).getLock(); will(returnValue(lock)); allowing(doc2).getPropertyValue("dc:creator"); will(returnValue(creator)); } }); assertSame(DENY, service.checkPermission(doc2, null, creatorPrincipal, permission, permissions, null)); assertSame(UNKNOWN, service.checkPermission(doc2, null, userPrincipal, permission, permissions, null)); pushInlineDeployments(CORE_TESTS_BUNDLE + ":test-security-policy-contrib.xml"); assertSame(GRANT, service.checkPermission(doc2, null, creatorPrincipal, permission, permissions, null)); assertSame(UNKNOWN, service.checkPermission(doc2, null, userPrincipal, permission, permissions, null)); }
Source:
public String selector() { return FAILED_ENV_STACK_CONIFG_UPDATES_EVENT.name(); }

Target:
public String selector() { return FAILED_ENV_STACK_CONIFG_UPDATES_EVENT.event(); }
Source:
public CloseableReference<Bitmap> decodeFromEncodedImageWithColorSpace( final EncodedImage encodedImage, Bitmap.Config bitmapConfig, @Nullable Rect regionToDecode, @Nullable final ColorSpace colorSpace) { BitmapFactory.Options options = getBitmapFactoryOptions( encodedImage.getSampleSize(), bitmapConfig); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { options.inPreferredColorSpace = colorSpace == null ? ColorSpace.get(ColorSpace.Named.SRGB) : colorSpace; } CloseableReference<PooledByteBuffer> bytesRef = encodedImage.getByteBufferRef(); Preconditions.checkNotNull(bytesRef); try { Bitmap bitmap = decodeByteArrayAsPurgeable(bytesRef, options); return pinBitmap(bitmap); } finally { CloseableReference.closeSafely(bytesRef); } }

Target:
public CloseableReference<Bitmap> decodeFromEncodedImageWithColorSpace( final EncodedImage encodedImage, Bitmap.Config bitmapConfig, @Nullable Rect regionToDecode, @Nullable final ColorSpace colorSpace) { BitmapFactory.Options options = getBitmapFactoryOptions( encodedImage.getSampleSize(), bitmapConfig); if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O) { OreoUtils.setColorSpace(options, colorSpace); } CloseableReference<PooledByteBuffer> bytesRef = encodedImage.getByteBufferRef(); Preconditions.checkNotNull(bytesRef); try { Bitmap bitmap = decodeByteArrayAsPurgeable(bytesRef, options); return pinBitmap(bitmap); } finally { CloseableReference.closeSafely(bytesRef); } }
Source:
public static String getDatanodeIdFilePath(Configuration conf) { String dataNodeIDDirPath = conf.get(ScmConfigKeys.OZONE_SCM_DATANODE_ID); if (dataNodeIDDirPath == null) { File metaDirPath = ServerUtils.getOzoneMetaDirPath(conf); if (metaDirPath == null) { throw new IllegalArgumentException("Unable to locate meta data" + "directory when getting datanode id path"); } dataNodeIDDirPath = metaDirPath.toString(); } return new File(dataNodeIDDirPath, ScmConfigKeys.OZONE_SCM_DATANODE_ID_PATH_DEFAULT).toString(); }

Target:
public static String getDatanodeIdFilePath(Configuration conf) { String dataNodeIDDirPath = conf.get(ScmConfigKeys.OZONE_SCM_DATANODE_ID_DIR); if (dataNodeIDDirPath == null) { File metaDirPath = ServerUtils.getOzoneMetaDirPath(conf); if (metaDirPath == null) { throw new IllegalArgumentException("Unable to locate meta data" + "directory when getting datanode id path"); } dataNodeIDDirPath = metaDirPath.toString(); } return new File(dataNodeIDDirPath, OzoneConsts.OZONE_SCM_DATANODE_ID_FILE_DEFAULT).toString(); }
Source:
private void init() throws Exception { String originalAppId = propertiesBuilder.conf.get(ORIGINAL_APP_ID); if (originalAppId == null) { throw new AssertionError("Need original app id if launching without apa or appjar"); } Path appsBasePath = new Path(StramClientUtils.getDTDFSRootDir(fs, conf), StramClientUtils.SUBDIR_APPS); Path origAppPath = new Path(appsBasePath, originalAppId); StringWriter writer = new StringWriter(); try (FSDataInputStream in = fs.open(new Path(origAppPath, "meta.json"))) { IOUtils.copy(in, writer); } JSONObject metaJson = new JSONObject(writer.toString()); String originalLibJars = null; try { JSONObject attributes = metaJson.getJSONObject("attributes"); originalLibJars = attributes.getString(LogicalPlan.LIBRARY_JARS.getSimpleName()); recoveryAppName = attributes.getString(Context.DAGContext.APPLICATION_NAME.getSimpleName()); } catch (JSONException ex) { } LinkedHashSet<URL> clUrls = new LinkedHashSet<>(); String libjars = propertiesBuilder.conf.get(LIBJARS_CONF_KEY_NAME); if (StringUtils.isBlank(libjars)) { libjars = originalLibJars; } else if (StringUtils.isNotBlank(originalLibJars)){ libjars = libjars + "," + originalLibJars; } propertiesBuilder.conf.set(LIBJARS_CONF_KEY_NAME, libjars); processLibJars(libjars, clUrls); for (URL baseURL : clUrls) { LOG.debug("Dependency: {}", baseURL); } this.launchDependencies = clUrls; }

Target:
private void init() throws Exception { String originalAppId = propertiesBuilder.conf.get(ORIGINAL_APP_ID); if (originalAppId == null) { throw new AssertionError("Need original app id if launching without apa or appjar"); } Path appsBasePath = new Path(StramClientUtils.getDTDFSRootDir(fs, conf), StramClientUtils.SUBDIR_APPS); Path origAppPath = new Path(appsBasePath, originalAppId); StringWriter writer = new StringWriter(); try (FSDataInputStream in = fs.open(new Path(origAppPath, "meta.json"))) { IOUtils.copy(in, writer); } JSONObject metaJson = new JSONObject(writer.toString()); String originalLibJars = null; try { JSONObject attributes = metaJson.getJSONObject("attributes"); originalLibJars = attributes.getString(LogicalPlan.LIBRARY_JARS.getSimpleName()); recoveryAppName = attributes.getString(Context.DAGContext.APPLICATION_NAME.getSimpleName()); } catch (JSONException ex) { recoveryAppName = "Recovery App From " + originalAppId; } LinkedHashSet<URL> clUrls = new LinkedHashSet<>(); String libjars = propertiesBuilder.conf.get(LIBJARS_CONF_KEY_NAME); if (StringUtils.isBlank(libjars)) { libjars = originalLibJars; } else if (StringUtils.isNotBlank(originalLibJars)) { libjars = libjars + "," + originalLibJars; } propertiesBuilder.conf.set(LIBJARS_CONF_KEY_NAME, libjars); processLibJars(libjars, clUrls); for (URL baseURL : clUrls) { LOG.debug("Dependency: {}", baseURL); } this.launchDependencies = clUrls; }
Source:
public void overlapTests() { HashSet<String> generatedIds = new HashSet<>(); for (int i = 0; i < 100; ++i) { for (int j = 0; j < 100; ++j) { for (int k = 0; k < 100; ++k) { String iPart = CompressingIdGenerator.generateCompressedIdString(i, GROWTH_LIMITED, LEAD_LIMITED, BODY_LIMITED, 1); String jPart = CompressingIdGenerator.generateCompressedIdString(j, GROWTH_LIMITED, LEAD_LIMITED, BODY_LIMITED, 1); String kPart = CompressingIdGenerator.generateCompressedIdString(k, GROWTH_LIMITED, LEAD_LIMITED, BODY_LIMITED, 1); String joined = iPart + jPart + kPart; if (generatedIds.contains(joined)) { Assert.fail(String.format("Duplicate ID [%s]@[%d,%d,%d]", joined, i, j, k)); } generatedIds.add(joined); } } } }

Target:
public void overlapTests() { HashSet<String> generatedIds = new HashSet<>(); for (int i = 0; i < 100; ++i) { String iPart = CompressingIdGenerator.generateCompressedIdString(i, GROWTH_LIMITED, LEAD_LIMITED, BODY_LIMITED, 1); for (int j = 0; j < 100; ++j) { String jPart = CompressingIdGenerator.generateCompressedIdString(j, GROWTH_LIMITED, LEAD_LIMITED, BODY_LIMITED, 1); for (int k = 0; k < 100; ++k) { String kPart = CompressingIdGenerator.generateCompressedIdString(k, GROWTH_LIMITED, LEAD_LIMITED, BODY_LIMITED, 1); String joined = iPart + jPart + kPart; if (generatedIds.contains(joined)) { Assert.fail(String.format("Duplicate ID [%s]@[%d,%d,%d]", joined, i, j, k)); } generatedIds.add(joined); } } } }
Source:
private boolean updateDataSource(VXQueryCollectionDataSource ds, Mutable<ILogicalExpression> expression) { boolean added = false; List<Mutable<ILogicalExpression>> finds = new ArrayList<Mutable<ILogicalExpression>>(); ExpressionToolbox.findAllFunctionExpressions(expression, BuiltinOperators.CHILD.getFunctionIdentifier(), finds); for (int i = finds.size(); i > 0; --i) { int typeId = ExpressionToolbox.getTypeExpressionTypeArgument(finds.get(i - 1)); SequenceType sType = null; if (typeId > 0) { sType = dCtx.lookupSequenceType(typeId); if (sType.getItemType().equals(ElementType.ANYELEMENT) && typeId > 0) { ds.addChildSeq(typeId); added = true; } } } return added; }

Target:
private boolean updateDataSource(VXQueryCollectionDataSource ds, Mutable<ILogicalExpression> expression) { boolean added = false; List<Mutable<ILogicalExpression>> finds = new ArrayList<Mutable<ILogicalExpression>>(); ExpressionToolbox.findAllFunctionExpressions(expression, BuiltinOperators.CHILD.getFunctionIdentifier(), finds); for (int i = finds.size(); i > 0; --i) { int typeId = ExpressionToolbox.getTypeExpressionTypeArgument(finds.get(i - 1)); if (typeId > 0) { SequenceType sType = dCtx.lookupSequenceType(typeId); if (sType.getItemType().equals(ElementType.ANYELEMENT) && typeId > 0) { ds.addChildSeq(typeId); added = true; } } } return added; }