auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void printWarnings(final PrintWriter stdout, final GroupMembersList groupMembers) { boolean hasWarning = false; if (groupMembers.containsNonVisibleGroup()) { stdout.println("Warning: Some included groups are not visible to you " + "and are not shown in the result."); hasWarning = true; } final Map<AccountGroup.UUID, GroupMembersList> unresolvedGroups = new HashMap<AccountGroup.UUID, GroupMembersList>(); if (recursive) { unresolvedGroups.putAll(groupMembers.getUnresolvedGroups()); } else { if (!groupMembers.isResolved()) { unresolvedGroups.put(groupMembers.getGroup().getGroupUUID(), groupMembers); } } if (unresolvedGroups.containsKey(AccountGroup.PROJECT_OWNERS)) { stdout.println("Warning: The group '" + unresolvedGroups.get(AccountGroup.PROJECT_OWNERS).getGroup().getName() + "' could not be resolved. It can only be resolved for a concrete project. " + "Please specify a project with the '--project' option."); hasWarning = true; } unresolvedGroups.remove(AccountGroup.PROJECT_OWNERS); for (final GroupMembersList unresolvedGroup : unresolvedGroups.values()) { stdout.println("Warning: The group '" + unresolvedGroup.getGroup().getName() + "' cannot be resolved."); hasWarning = true; } if (hasWarning) { stdout.println(); } }

Target:
private void printWarnings(final PrintWriter stdout, final GroupMembersList groupMembers) { boolean hasWarning = false; if (groupMembers.containsNonVisibleGroup()) { stdout.print("Warning: Some included groups are not visible to you " + "and are not shown in the result.\n"); hasWarning = true; } final Map<AccountGroup.UUID, GroupMembersList> unresolvedGroups = new HashMap<AccountGroup.UUID, GroupMembersList>(); unresolvedGroups.putAll(groupMembers.getUnresolvedGroups(recursive)); if (unresolvedGroups.containsKey(AccountGroup.PROJECT_OWNERS)) { stdout.print("Warning: The group '" + unresolvedGroups.get(AccountGroup.PROJECT_OWNERS).getGroup().getName() + "' could not be resolved. It can only be resolved for a concrete project. " + "Please specify a project with the '--project' option.\n"); hasWarning = true; } unresolvedGroups.remove(AccountGroup.PROJECT_OWNERS); for (final GroupMembersList unresolvedGroup : unresolvedGroups.values()) { stdout.print("Warning: The group '" + unresolvedGroup.getGroup().getName() + "' cannot be resolved.\n"); hasWarning = true; } if (hasWarning) { stdout.print("\n"); } }
Source:
void error(ZuulException e) { RequestContext.getCurrentContext().setThrowable(e); zuulRunner.error(); LOG.error(e.getMessage(), e); }

Target:
void error(ZuulException e) { RequestContext.getCurrentContext().setThrowable(e); zuulRunner.error(); }
Source:
public void dynamicTestRegistered(TestIdentifier testIdentifier) { notifyTestExecutionListeners(listener -> { try { listener.dynamicTestRegistered(testIdentifier); } catch (Throwable throwable) { rethrowIfBlacklistedAndLogTest(throwable, listener, testIdentifier, "dynamicTestRegistered"); } }); }

Target:
public void dynamicTestRegistered(TestIdentifier testIdentifier) { notifyEach(testExecutionListeners, listener -> listener.dynamicTestRegistered(testIdentifier), () -> "dynamicTestRegistered(" + testIdentifier + ")"); }
Source:
RevCommit next() throws MissingObjectException, IncorrectObjectTypeException, IOException { try { for (;;) { final RevCommit c = pending.next(); if (c == null) { return null; } final boolean produce; if ((c.flags & UNINTERESTING) != 0) produce = false; else { if (filter.requiresCommitBody()) c.parseBody(walker); produce = filter.include(walker, c); } for (int i = 0; i < c.parents.length; i++) { RevCommit p = c.parents[i]; if ((p.flags & PARSED) == 0) { p.parseHeaders(walker); } if (firstParent && i > 0) { continue; } if ((p.flags & SEEN) != 0) { continue; } p.flags |= SEEN; pending.add(p); } walker.carryFlagsImpl(c); if ((c.flags & UNINTERESTING) != 0) { if (pending.everbodyHasFlag(UNINTERESTING)) { final RevCommit n = pending.peek(); if (n != null && n.commitTime >= last.commitTime) { overScan = OVER_SCAN; } else if (--overScan == 0) throw StopWalkException.INSTANCE; } else { overScan = OVER_SCAN; } if (canDispose) c.disposeBody(); continue; } if (produce) return last = c; else if (canDispose) c.disposeBody(); } } catch (StopWalkException swe) { pending.clear(); return null; } }

Target:
RevCommit next() throws MissingObjectException, IncorrectObjectTypeException, IOException { try { for (;;) { final RevCommit c = pending.next(); if (c == null) { return null; } final boolean produce; if ((c.flags & UNINTERESTING) != 0) produce = false; else { if (filter.requiresCommitBody()) c.parseBody(walker); produce = filter.include(walker, c); } for (int i = 0; i < c.parents.length; i++) { if (firstParent && i > 0) { break; } RevCommit p = c.parents[i]; if ((p.flags & PARSED) == 0) { p.parseHeaders(walker); } if ((p.flags & SEEN) != 0) { continue; } p.flags |= SEEN; pending.add(p); } walker.carryFlagsImpl(c); if ((c.flags & UNINTERESTING) != 0) { if (pending.everbodyHasFlag(UNINTERESTING)) { final RevCommit n = pending.peek(); if (n != null && n.commitTime >= last.commitTime) { overScan = OVER_SCAN; } else if (--overScan == 0) throw StopWalkException.INSTANCE; } else { overScan = OVER_SCAN; } if (canDispose) c.disposeBody(); continue; } if (produce) return last = c; else if (canDispose) c.disposeBody(); } } catch (StopWalkException swe) { pending.clear(); return null; } }
Source:
private File local(final HttpServletRequest req) { final String name = req.getPathInfo(); if (name.length() < 2 || !name.startsWith("/")) { return null; } final File p = new File(staticBase, name.substring(1)); try { if (!p.getCanonicalFile().getPath().startsWith(staticBase.getPath()+File.separator)) return null; } catch (IOException e) { return null; } return p.isFile() ? p : null; }

Target:
private File local(final HttpServletRequest req) { final String name = req.getPathInfo(); if (name.length() < 2 || !name.startsWith("/") || isUnreasonableName(name)) { return null; } final File p = new File(staticBase, name.substring(1)); try { if (!p.getCanonicalFile().getPath().startsWith(staticBasePath)) return null; } catch (IOException e) { return null; } return p.isFile() ? p : null; }
Source:
public void iCanUpdateClientWithRequiredFieldsOnly() throws IOException { String data = "{\n" + " \"entity-type\": \"oauth2Client\",\n" + " \"id\": \"nuxeo-client-12\",\n" + " \"name\": \"Nuxeo Client 12\",\n" + " \"isEnabled\": false,\n" + " \"secret\": \"8529\",\n" + " \"isAutoGrant\": false,\n" + " \"redirectURIs\": [\n" + " \"nuxeo://authorize\"\n" + " ]\n" + "}"; makeOperationAndVerify(TEST_OAUTH2_USER, CLIENT_PATH, RequestType.POST, data, Response.Status.CREATED, mapper.readTree(data)); }

Target:
public void iCanUpdateClientWithRequiredFieldsOnly() throws IOException { String data = "{\n" + " \"entity-type\": \"oauth2Client\",\n" + " \"id\": \"%s\",\n" + " \"name\": \"%s\",\n" + " \"redirectURIs\": [\n" + " \"nuxeo://authorize\"\n" + " ]\n" + "}"; String expected = "{\n" + " \"entity-type\": \"oauth2Client\",\n" + " \"id\": \"%s\",\n" + " \"name\": \"%s\",\n" + " \"isEnabled\": false,\n" + " \"isAutoGrant\": false,\n" + " \"redirectURIs\": [\n" + " \"nuxeo://authorize\"\n" + " ],\n" + " \"secret\": null\n" + "}"; data = String.format(data, TEST_CLIENT_NAME, TEST_CLIENT); expected = String.format(expected, TEST_CLIENT_NAME, TEST_CLIENT); makeOperationAndVerify(TEST_OAUTH2_USER, getClientPath(TEST_CLIENT), RequestType.PUT, data, Response.Status.OK, mapper.readTree(expected)); }
Source:
protected void bindToEntry(BibEntry entry) { if (boundEntry != null) { storeSource(boundEntry, codeArea.textProperty().getValue()); } this.boundEntry = entry; if (entry != null) { DefaultTaskExecutor.runAndWaitInJavaFXThread(() -> { codeArea.clear(); try { codeArea.appendText(getSourceString(entry, mode, fieldFormatterPreferences)); highlightSearchPattern(); } catch (IOException ex) { codeArea.setEditable(false); codeArea.appendText(ex.getMessage() + "\n\n" + Localization.lang("Correct the entry, and reopen editor to display/edit source.")); LOGGER.debug("Incorrect entry", ex); } }); } }

Target:
protected void bindToEntry(BibEntry entry) { if (previousEntry != null) { storeSource(previousEntry, codeArea.textProperty().getValue()); } this.previousEntry = entry; updateCodeArea(); entry.getFieldsObservable().addListener((InvalidationListener) listener -> updateCodeArea()); }
Source:
public static String getOMRatisSnapshotDirectory(Configuration conf) { String snapshotDir = conf.get(OMConfigKeys.OZONE_OM_RATIS_SNAPSHOT_DIR); if (Strings.isNullOrEmpty(snapshotDir)) { snapshotDir = getOMRatisDirectory(conf) + "/snapshot"; } return snapshotDir; }

Target:
public static String getOMRatisSnapshotDirectory(Configuration conf) { String snapshotDir = conf.get(OMConfigKeys.OZONE_OM_RATIS_SNAPSHOT_DIR); if (Strings.isNullOrEmpty(snapshotDir)) { snapshotDir = Paths.get(getOMRatisDirectory(conf), "snapshot").toString(); } return snapshotDir; }
Source:
protected Trade(Offer offer, Coin txFee, Coin takerFee, boolean isCurrencyForTakerFeeBtc, @Nullable NodeAddress arbitratorNodeAddress, @Nullable NodeAddress mediatorNodeAddress, @Nullable NodeAddress refundAgentNodeAddress, Storage<? extends TradableList> storage, BtcWalletService btcWalletService) { this.offer = offer; this.txFee = txFee; this.takerFee = takerFee; this.isCurrencyForTakerFeeBtc = isCurrencyForTakerFeeBtc; this.storage = storage; this.btcWalletService = btcWalletService; this.arbitratorNodeAddress = arbitratorNodeAddress; this.mediatorNodeAddress = mediatorNodeAddress; this.refundAgentNodeAddress = refundAgentNodeAddress; txFeeAsLong = txFee.value; takerFeeAsLong = takerFee.value; takeOfferDate = new Date().getTime(); processModel = new ProcessModel(); lastRefreshRequestDate = takeOfferDate; refreshInterval = Math.min(offer.getPaymentMethod().getMaxTradePeriod() / 5, MAX_REFRESH_INTERVAL); xmrProofResult = new XmrProofResult(0, 0, XmrProofResult.State.FEATURE_DISABLED); }

Target:
protected Trade(Offer offer, Coin txFee, Coin takerFee, boolean isCurrencyForTakerFeeBtc, @Nullable NodeAddress arbitratorNodeAddress, @Nullable NodeAddress mediatorNodeAddress, @Nullable NodeAddress refundAgentNodeAddress, Storage<? extends TradableList> storage, BtcWalletService btcWalletService) { this.offer = offer; this.txFee = txFee; this.takerFee = takerFee; this.isCurrencyForTakerFeeBtc = isCurrencyForTakerFeeBtc; this.storage = storage; this.btcWalletService = btcWalletService; this.arbitratorNodeAddress = arbitratorNodeAddress; this.mediatorNodeAddress = mediatorNodeAddress; this.refundAgentNodeAddress = refundAgentNodeAddress; txFeeAsLong = txFee.value; takerFeeAsLong = takerFee.value; takeOfferDate = new Date().getTime(); processModel = new ProcessModel(); lastRefreshRequestDate = takeOfferDate; refreshInterval = Math.min(offer.getPaymentMethod().getMaxTradePeriod() / 5, MAX_REFRESH_INTERVAL); }
Source:
public abstract @CheckForNull MultiBranchProject<?,?> createProject(@Nonnull ItemGroup<?> parent, @Nonnull String name, @Nonnull List<? extends SCMSource> scmSources, @Nonnull Map<String,Object> attributes, @Nonnull TaskListener listener) throws IOException, InterruptedException; @Override public MultiBranchProjectFactoryDescriptor getDescriptor() { return (MultiBranchProjectFactoryDescriptor) super.getDescriptor(); }

Target:
public abstract MultiBranchProject<?,?> createProject(@Nonnull ItemGroup<?> parent, @Nonnull String name, @Nonnull List<? extends SCMSource> scmSources, @Nonnull Map<String,Object> attributes, @Nonnull TaskListener listener) throws IOException, InterruptedException; @Override public MultiBranchProjectFactoryDescriptor getDescriptor() { return (MultiBranchProjectFactoryDescriptor) super.getDescriptor(); }
Source:
protected void addRemoteReplicaInfoToReplicaThread(List<RemoteReplicaInfo> remoteReplicaInfos, boolean startThread) { for (RemoteReplicaInfo remoteReplicaInfo : remoteReplicaInfos) { DataNodeId dataNodeIdToReplicate = remoteReplicaInfo.getReplicaId().getDataNodeId(); String datacenter = dataNodeIdToReplicate.getDatacenterName(); createThreadPoolIfNecessary(datacenter, startThread); ReplicaThread replicaThread = dataNodeIdToReplicaThread.computeIfAbsent(dataNodeIdToReplicate, key -> replicaThreadPoolByDc.get(datacenter).get(getReplicaThreadIndexToUse(datacenter))); replicaThread.addRemoteReplicaInfo(remoteReplicaInfo); remoteReplicaInfo.setReplicaThread(replicaThread); } }

Target:
protected void addRemoteReplicaInfoToReplicaThread(List<RemoteReplicaInfo> remoteReplicaInfos, boolean startThread) { for (RemoteReplicaInfo remoteReplicaInfo : remoteReplicaInfos) { DataNodeId dataNodeIdToReplicate = remoteReplicaInfo.getReplicaId().getDataNodeId(); String datacenter = dataNodeIdToReplicate.getDatacenterName(); List<ReplicaThread> replicaThreads = getOrCreateThreadPoolIfNecessary(datacenter, startThread); if (replicaThreads == null) { logger.warn("Number of replica threads is smaller or equal to 0, not starting any replica threads for {}.", datacenter); continue; } ReplicaThread replicaThread = dataNodeIdToReplicaThread.computeIfAbsent(dataNodeIdToReplicate, key -> replicaThreads.get(getReplicaThreadIndexToUse(datacenter))); replicaThread.addRemoteReplicaInfo(remoteReplicaInfo); remoteReplicaInfo.setReplicaThread(replicaThread); } }
Source:
private <T, SpecT> SpecT createPolicySpec(CatalogItemDo<T, SpecT> loadedItem, DeploymentPlan plan) { Object policy = plan.getCustomAttributes().get("policy"); Map<String, Object> policyConfig; if (policy instanceof String) { policyConfig = ImmutableMap.<String, Object>of("type", policy); } else if (policy instanceof Map) { policyConfig = (Map<String, Object>) policy; } else { throw new IllegalStateException("Policy exepcted to be string or map."); } String policyType = (String) policyConfig.get("type"); Map<String, Object> brooklynConfig = (Map<String, Object>) policyConfig.get("brooklyn.config"); BrooklynClassLoadingContext loader = loadedItem.newClassLoadingContext(mgmt); PolicySpec<? extends Policy> spec = PolicySpec.create(loader.loadClass(policyType, Policy.class)); if (brooklynConfig != null) { spec.configure(brooklynConfig); } return (SpecT) spec; }

Target:
private <T, SpecT> SpecT createPolicySpec(CatalogItemDo<T, SpecT> loadedItem, DeploymentPlan plan) { Object policies = checkNotNull(plan.getCustomAttributes().get(POLICIES_KEY), "policy config"); if (!(policies instanceof Iterable<?>)) { throw new IllegalStateException("The value of " + POLICIES_KEY + " must be an Iterable."); } Object policy = Iterables.getOnlyElement((Iterable<?>)policies); Map<String, Object> policyConfig; if (policy instanceof String) { policyConfig = ImmutableMap.<String, Object>of("type", policy); } else if (policy instanceof Map) { policyConfig = (Map<String, Object>) policy; } else { throw new IllegalStateException("Policy exepcted to be string or map. Unsupported object type " + policy.getClass().getName() + " (" + policy.toString() + ")"); } String policyType = (String) checkNotNull(Yamls.getMultinameAttribute(policyConfig, "policy_type", "policyType", "type"), "policy type"); Map<String, Object> brooklynConfig = (Map<String, Object>) policyConfig.get("brooklyn.config"); BrooklynClassLoadingContext loader = loadedItem.newClassLoadingContext(mgmt); PolicySpec<? extends Policy> spec = PolicySpec.create(loader.loadClass(policyType, Policy.class)); if (brooklynConfig != null) { spec.configure(brooklynConfig); } return (SpecT) spec; }
Source:
private SortingCollection(final Class<T> componentType, final SortingCollection.Codec<T> codec, final Comparator<T> comparator, final int maxRecordsInRam, final Path... tmpDir) { if (maxRecordsInRam <= 0) { throw new IllegalArgumentException("maxRecordsInRam must be > 0"); } if (tmpDir == null || tmpDir.length == 0) { throw new IllegalArgumentException("At least one temp directory must be provided."); } this.tmpDirs = tmpDir; this.codec = codec; this.comparator = comparator; this.maxRecordsInRam = maxRecordsInRam; this.ramRecords = (T[])Array.newInstance(componentType, maxRecordsInRam); }

Target:
private SortingCollection(final Class<T> componentType, final SortingCollection.Codec<T> codec, final Comparator<T> comparator, final int maxRecordsInRam, final Path... tmpDir) { if (maxRecordsInRam <= 0) { throw new IllegalArgumentException("maxRecordsInRam must be > 0"); } if (tmpDir == null || tmpDir.length == 0) { throw new IllegalArgumentException("At least one temp directory must be provided."); } this.tmpDirs = tmpDir; this.codec = codec; this.comparator = comparator; this.maxRecordsInRam = maxRecordsInRam; @SuppressWarnings("unchecked") T[] ramRecords = (T[]) Array.newInstance(componentType, maxRecordsInRam); this.ramRecords = ramRecords; }
Source:
private ContentletRelationships getContentletRelationshipsFromMap(final Contentlet contentlet, final Map<Relationship, List<Contentlet>> contentRelationships) { if(contentRelationships == null) { return null; } final Structure structure = CacheLocator.getContentTypeCache() .getStructureByInode(contentlet.getStructureInode()); final ContentletRelationships relationshipsData = new ContentletRelationships(contentlet); final List<ContentletRelationships.ContentletRelationshipRecords> relationshipsRecords = new ArrayList<ContentletRelationships.ContentletRelationshipRecords>(); relationshipsData.setRelationshipsRecords(relationshipsRecords); for(final Map.Entry<Relationship, List<Contentlet>> relEntry : contentRelationships.entrySet()) { final Relationship relationship = relEntry.getKey(); final boolean hasChildren = FactoryLocator.getRelationshipFactory().isChild(relationship, structure); boolean hasParent = FactoryLocator.getRelationshipFactory().isParent(relationship, structure); if (hasParent && hasChildren) { if(!UtilMethods.isSet(relationship.getParentRelationName())){ hasParent = true; } else { hasParent = false; } } final ContentletRelationships.ContentletRelationshipRecords records = relationshipsData.new ContentletRelationshipRecords(relationship, hasParent); records.setRecords(relEntry.getValue()); relationshipsRecords.add(records); } return relationshipsData; }

Target:
private ContentletRelationships getContentletRelationshipsFromMap(final Contentlet contentlet, final Map<Relationship, List<Contentlet>> contentRelationships) { if(contentRelationships == null) { return null; } final Structure structure = CacheLocator.getContentTypeCache() .getStructureByInode(contentlet.getStructureInode()); final ContentletRelationships relationshipsData = new ContentletRelationships(contentlet); final List<ContentletRelationships.ContentletRelationshipRecords> relationshipsRecords = new ArrayList<ContentletRelationships.ContentletRelationshipRecords>(); relationshipsData.setRelationshipsRecords(relationshipsRecords); for(final Map.Entry<Relationship, List<Contentlet>> relEntry : contentRelationships.entrySet()) { final Relationship relationship = relEntry.getKey(); final boolean hasChildren = FactoryLocator.getRelationshipFactory().isChild(relationship, structure); boolean hasParent = FactoryLocator.getRelationshipFactory().isParent(relationship, structure); if (hasParent && hasChildren) { hasParent = !UtilMethods.isSet(relationship.getParentRelationName()); } final ContentletRelationships.ContentletRelationshipRecords records = relationshipsData.new ContentletRelationshipRecords(relationship, hasParent); records.setRecords(relEntry.getValue()); relationshipsRecords.add(records); } return relationshipsData; }
Source:
@Test public void testDropFunction() throws Exception { try (Connection c = connect(); Statement s = c.createStatement()) { boolean b = s.execute("create schema s"); assertThat(b, is(false)); boolean f = s.execute("drop function if exists t"); assertThat(f, is(false)); try { boolean f2 = s.execute("drop function t"); assertThat(f2, is(false)); } catch (SQLException e) { assertThat(e.getMessage(), containsString("Error while executing SQL \"drop function t\":" + " At line 1, column 15: Type 'T' not found")); } } }

Target:
@Test public void testDropFunction() throws Exception { try (Connection c = connect(); Statement s = c.createStatement()) { boolean b = s.execute("create schema s"); assertThat(b, is(false)); boolean f = s.execute("drop function if exists t"); assertThat(f, is(false)); try { boolean f2 = s.execute("drop function t"); assertThat(f2, is(false)); } catch (SQLException e) { assertThat(e.getMessage(), containsString("Error while executing SQL \"drop function t\":" + " At line 1, column 15: Function 'T' not found")); } CalciteConnection calciteConnection = (CalciteConnection) c; calciteConnection.getRootSchema().add("T", new Function() { @Override public List<FunctionParameter> getParameters() { return new ArrayList<>(); } }); boolean f3 = s.execute("drop function t"); assertThat(f3, is(false)); calciteConnection.getRootSchema().add("t", new Function() { @Override public List<FunctionParameter> getParameters() { return new ArrayList<>(); } }); try { boolean f4 = s.execute("drop function t"); assertThat(f4, is(false)); } catch (SQLException e) { assertThat(e.getMessage(), containsString("Error while executing SQL \"drop function t\":" + " At line 1, column 15: Function 'T' not found")); } } }
Source:
public void testXidReturnedOnlyOnce() throws Throwable { DummyTransaction dummyTransaction1 = beginAndSuspendTx(this.cache(3)); prepareTransaction(dummyTransaction1); manager(3).stop(); TestingUtil.blockUntilViewsReceived(60000, false, cache(0), cache(1), cache(2)); TestingUtil.waitForRehashToComplete(cache(0), cache(1), cache(2)); DummyTransaction dummyTransaction = beginAndSuspendTx(this.cache(0)); Xid[] recover = dummyTransaction.firstEnlistedResource().recover(XAResource.TMSTARTRSCAN | XAResource.TMENDRSCAN); assertEquals(recover.length,1); assertEquals(recover[0], dummyTransaction1.getXid()); }

Target:
public void testXidReturnedOnlyOnce() throws Throwable { DummyTransaction dummyTransaction1 = beginAndSuspendTx(this.cache(3)); prepareTransaction(dummyTransaction1); manager(3).stop(); TestingUtil.blockUntilViewsReceived(60000, false, cache(0), cache(1), cache(2)); TestingUtil.waitForRehashToComplete(cache(0), cache(1), cache(2)); DummyTransaction dummyTransaction = beginAndSuspendTx(this.cache(0)); Xid[] recover = dummyTransaction.firstEnlistedResource().recover(XAResource.TMSTARTRSCAN | XAResource.TMENDRSCAN); assertEquals(recover.length,1); assertEquals(dummyTransaction1.getXid(), recover[0]); }
Source:
public Point(final Float xCoordinate, final Float yCoordinate) { this.xCoordinate = xCoordinate; this.yCoordinate = yCoordinate; }

Target:
public Point(final Float xCoordinate, final Float yCoordinate) { if (xCoordinate != null && yCoordinate != null) { this.xCoordinate = xCoordinate; this.yCoordinate = yCoordinate; } else { this.xCoordinate = null; this.yCoordinate = null; } }
Source:
public void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws IOException, ServletException { request = performGZIPRequest(request); if (isGZIPSupported(request) && isGZIPEnabled()) { log.debug("GZIP supported and enabled, compressing response"); GZIPResponseWrapper wrappedResponse = new GZIPResponseWrapper(response); chain.doFilter(request, wrappedResponse); wrappedResponse.finishResponse(); return; } chain.doFilter(request, response); }

Target:
public void doFilterInternal(HttpServletRequest request, HttpServletResponse response, FilterChain chain) throws IOException, ServletException { try { request = performGZIPRequest(request); } catch (APIException e) { response.sendError(HttpServletResponse.SC_UNSUPPORTED_MEDIA_TYPE); return; } if (isGZIPSupported(request) && isGZIPEnabled()) { log.debug("GZIP supported and enabled, compressing response"); GZIPResponseWrapper wrappedResponse = new GZIPResponseWrapper(response); chain.doFilter(request, wrappedResponse); wrappedResponse.finishResponse(); return; } chain.doFilter(request, response); }
Source:
public void runBeforeEachTest() { PersonName name = new PersonName("Joe", "J", "Doe"); name.setDateCreated(new Date()); Person person = new Person(); person.setDateCreated(new Date()); person.setPersonDateCreated(person.getDateCreated()); person.setGender("M"); userJoe = new User(); userJoe.setSystemId("100-30"); userJoe.setPerson(person); userJoe.addName(name); userJoe.setUsername("juser"); userJoe.setDateCreated(new Date()); userJoe.setActivationKey("XbklsieiskeuztecEnPf:1529341342"); userJoe.setEmail("userJoe@gmail.com"); if (dao == null) { dao = (UserDAO) applicationContext.getBean("userDAO"); } dao.saveUser(userJoe, null); }

Target:
public void runBeforeEachTest() { PersonName name = new PersonName("Joe", "J", "Doe"); name.setDateCreated(new Date()); Person person = new Person(); person.setDateCreated(new Date()); person.setPersonDateCreated(person.getDateCreated()); person.setGender("M"); userJoe = new User(); userJoe.setSystemId("100-30"); userJoe.setPerson(person); userJoe.addName(name); userJoe.setUsername("juser"); userJoe.setDateCreated(new Date()); if (dao == null) { dao = (UserDAO) applicationContext.getBean("userDAO"); } dao.saveUser(userJoe, null); }
Source:
public IUser findUserByProviderUserId(String userId, String provider){ IUser user = null; QuadrigaUserDTO userDTO = dbConnect.findUserByProviderUserId(userId, provider); if (userDTO != null) { user = mapUser(userDTO); } if (user != null) { List<IQuadrigaRole> userRole = user.getQuadrigaRoles(); List<IQuadrigaRole> rolesList = new ArrayList<IQuadrigaRole>(); for (int i = 0; i < userRole.size(); i++) { IQuadrigaRole quadrigaRole = roleManager.getQuadrigaRoleByDbId(IQuadrigaRoleManager.MAIN_ROLES, userRole.get(i) .getDBid()); if (quadrigaRole.getId().equals( RoleNames.ROLE_QUADRIGA_DEACTIVATED)) { rolesList.clear(); rolesList.add(quadrigaRole); break; } rolesList.add(quadrigaRole); } user.setQuadrigaRoles(rolesList); } return user; }

Target:
public IUser findUserByProviderUserId(String userId, String provider) { QuadrigaUserDTO userDTO = dbConnect.findUserByProviderUserId(userId, provider); return constructUserWithRoles(userDTO); }
Source:
private FileItem checkFileItem(FileItem item, FileItem prevValue, String fieldName) { if (prevValue == null) { if (fieldName.equals(item.getFieldName())) { return item; } return null; } else { return prevValue; } }

Target:
private FileItem checkFileItem(FileItem item, FileItem prevValue, String fieldName) { if (prevValue != null) { return prevValue; } if (fieldName.equals(item.getFieldName())) { return item; } return null; }
Source:
public Response addFromVmSnapshot(Template template) { validateIconParameters(template); validateSnapshotExistence(template.getVm()); Guid snapshotId = getSnapshotId(template.getVm().getSnapshots()); org.ovirt.engine.core.common.businessentities.VM vmConfiguration = getVmConfiguration(snapshotId); Guid clusterId = null; if (namedCluster(template)) { clusterId = getClusterId(template); } if (template.getVersion() != null) { validateParameters(template.getVersion(), "baseTemplate"); } VmStatic originalVm = vmConfiguration.getStaticData(); VmStatic staticVm = getMapper(Template.class, VmStatic.class).map(template, originalVm); if (namedCluster(template)) { staticVm.setClusterId(clusterId); } AddVmTemplateFromSnapshotParameters params = new AddVmTemplateFromSnapshotParameters( staticVm, template.getName(), template.getDescription(), snapshotId); return addTemplate(template, originalVm, vmConfiguration.getDiskMap().keySet(), params, ActionType.AddVmTemplateFromSnapshot); }

Target:
public Response addFromVmSnapshot(Template template) { validateIconParameters(template); validateSnapshotExistence(template.getVm()); Guid snapshotId = getSnapshotId(template.getVm().getSnapshots()); org.ovirt.engine.core.common.businessentities.VM vmConfiguration = getVmConfiguration(snapshotId); if (template.getVersion() != null) { validateParameters(template.getVersion(), "baseTemplate"); } VmStatic originalVm = vmConfiguration.getStaticData(); VmStatic staticVm = getMapper(Template.class, VmStatic.class).map(template, originalVm); if (namedCluster(template)) { Guid clusterId = getClusterId(template); staticVm.setClusterId(clusterId); } AddVmTemplateFromSnapshotParameters params = new AddVmTemplateFromSnapshotParameters( staticVm, template.getName(), template.getDescription(), snapshotId); return addTemplate(template, originalVm, vmConfiguration.getDiskMap().keySet(), params, ActionType.AddVmTemplateFromSnapshot); }
Source:
protected PlanNode visitPlan(PlanNode node, RewriteContext<Void> context) { throw new UnsupportedOperationException("Plan node not yet supported: " + node.getClass().getName()); }

Target:
protected PlanNode visitPlan(PlanNode node, RewriteContext<Void> context) { throw new UnsupportedOperationException("Symbol mapping not yet supported for: " + node.getClass().getName()); }
Source:
public boolean isConfigurationNeeded(CmTemplateProcessor cmTemplateProcessor, TemplatePreparationObject source) { boolean datalakeCluster = source.getSharedServiceConfigs() .map(SharedServiceConfigsView::isDatalakeCluster) .orElse(false); String cdhVersion = getCdhVersion(source); boolean is722OrNewer = isVersionNewerOrEqualThanLimited(cdhVersion, CLOUDERAMANAGER_VERSION_7_2_2); GeneralClusterConfigs generalClusterConfigs = source.getGeneralClusterConfigs(); boolean sdxHbaseCloudStorageEnabled = entitlementService == null ? true : entitlementService.sdxHbaseCloudStorageEnabled(generalClusterConfigs.getUserCrn(), generalClusterConfigs.getAccountId()); return source.getFileSystemConfigurationView().isPresent() && cmTemplateProcessor.isRoleTypePresentInService(getServiceType(), getRoleTypes()) && (!datalakeCluster || (is722OrNewer && sdxHbaseCloudStorageEnabled)); }

Target:
public boolean isConfigurationNeeded(CmTemplateProcessor cmTemplateProcessor, TemplatePreparationObject source) { boolean datalakeCluster = source.getSharedServiceConfigs() .map(SharedServiceConfigsView::isDatalakeCluster) .orElse(false); String cdhVersion = getCdhVersion(source); boolean is722OrNewer = isVersionNewerOrEqualThanLimited(cdhVersion, CLOUDERAMANAGER_VERSION_7_2_2); String actorCrn = INTERNAL_ACTOR_CRN; String accountId = ThreadBasedUserCrnProvider.getAccountId(); boolean sdxHbaseCloudStorageEnabled = entitlementService.sdxHbaseCloudStorageEnabled(actorCrn, accountId); return source.getFileSystemConfigurationView().isPresent() && cmTemplateProcessor.isRoleTypePresentInService(getServiceType(), getRoleTypes()) && (!datalakeCluster || (is722OrNewer && sdxHbaseCloudStorageEnabled)); }
Source:
BitMappedTrie<T> prepend(T leading) { if (cannotAdd(leading)) { return map(identity()).prepend(leading); } else { final int newSize = length() + 1; if (length() == 0) { return new BitMappedTrie<>(type, type.asArray(leading), offset, newSize, depthShift); } else { Object array = this.array; int shift = depthShift, offset = this.offset; if (isFullLeft()) { array = obj().copyUpdate(obj().empty(), BRANCHING_FACTOR - 1, array); shift += BRANCHING_BASE; offset = treeSize(BRANCHING_FACTOR - 1, shift); } offset -= 1; array = modifyLeaf(array, shift, offset, COPY_NODE, updateLeafWith(type, leading)); return new BitMappedTrie<>(type, array, offset, newSize, shift); } } }

Target:
BitMappedTrie<T> prepend(T leading) { if (cannotAdd(leading)) { return boxed().prepend(leading); } else { final int newSize = length() + 1; if (length() == 0) { return new BitMappedTrie<>(type, type.asArray(leading), offset, newSize, depthShift); } else { Object array = this.array; int shift = depthShift, offset = this.offset; if (isFullLeft()) { array = obj().copyUpdate(obj().empty(), BRANCHING_FACTOR - 1, array); shift += BRANCHING_BASE; offset = treeSize(BRANCHING_FACTOR - 1, shift); } offset -= 1; array = modifyLeaf(array, shift, offset, COPY_NODE, updateLeafWith(type, leading)); return new BitMappedTrie<>(type, array, offset, newSize, shift); } } }
Source:
public void unlock(Object owner) { synchronized (this.lock) { if (!owner.equals(this.owner)) { throw new IllegalMonitorStateException(); } else { if (--lockCount == 0) { this.owner = null; if (waiters > 0) { lock.notifyAll(); } } } } }

Target:
public void unlock(Object owner) { Assert.checkNotNullParam("owner", owner); synchronized (this.lock) { if (!Objects.equals(owner,this.owner)) { throw new IllegalMonitorStateException(); } else { if (--lockCount == 0) { this.owner = null; if (waiters > 0) { lock.notifyAll(); } } } } }
Source:
DiskManager(DiskId disk, List<ReplicaId> replicas, StoreConfig config, ScheduledExecutorService scheduler, StorageManagerMetrics metrics, StoreKeyFactory keyFactory, MessageStoreRecovery recovery, MessageStoreHardDelete hardDelete, Time time) { this.disk = disk; this.metrics = metrics; diskIOScheduler = new DiskIOScheduler(getThrottlers(config, time)); ScheduledExecutorService storeStatsScheduler = Utils.newScheduler(1, false); for (ReplicaId replica : replicas) { if (disk.equals(replica.getDiskId())) { String storeId = replica.getPartitionId().toString(); BlobStore store = new BlobStore(storeId, config, scheduler, storeStatsScheduler, diskIOScheduler, metrics, replica.getReplicaPath(), replica.getCapacityInBytes(), keyFactory, recovery, hardDelete, time); stores.put(replica.getPartitionId(), store); } } compactionManager = new CompactionManager(disk.getMountPath(), config, stores.values(), time); }

Target:
DiskManager(DiskId disk, List<ReplicaId> replicas, StoreConfig config, ScheduledExecutorService scheduler, StorageManagerMetrics metrics, StoreKeyFactory keyFactory, MessageStoreRecovery recovery, MessageStoreHardDelete hardDelete, Time time) { this.disk = disk; this.metrics = metrics; this.time = time; diskIOScheduler = new DiskIOScheduler(getThrottlers(config, time)); longLivedTaskScheduler = Utils.newScheduler(1, true); for (ReplicaId replica : replicas) { if (disk.equals(replica.getDiskId())) { String storeId = replica.getPartitionId().toString(); BlobStore store = new BlobStore(storeId, config, scheduler, longLivedTaskScheduler, diskIOScheduler, metrics, replica.getReplicaPath(), replica.getCapacityInBytes(), keyFactory, recovery, hardDelete, time); stores.put(replica.getPartitionId(), store); } } compactionManager = new CompactionManager(disk.getMountPath(), config, stores.values(), metrics, time); }
Source:
private static void removeAllUnused(long threshold) throws IOException { for (Iterator<Map.Entry<ConnectionId, GitHubConnection>> iterator = connections.entrySet().iterator(); iterator.hasNext(); ) { GitHubConnection record = Objects.requireNonNull(iterator.next().getValue()); Long lastUse = record.lastUsed; if (record.usageCount == 0 && lastUse < threshold) { iterator.remove(); reverseLookup.remove(record.gitHub); if (record.cache != null && record.cleanupCacheFolder) { record.cache.delete(); record.cache.close(); } } } }

Target:
private static void removeAllUnused(long threshold) throws IOException { for (Iterator<Map.Entry<ConnectionId, GitHubConnection>> iterator = connections.entrySet().iterator(); iterator.hasNext(); ) { Map.Entry<ConnectionId, GitHubConnection> entry = iterator.next(); try { GitHubConnection record = Objects.requireNonNull(entry.getValue()); long lastUse = record.lastUsed; if (record.usageCount == 0 && lastUse < threshold) { iterator.remove(); reverseLookup.remove(record.gitHub); if (record.cache != null && record.cleanupCacheFolder) { record.cache.delete(); record.cache.close(); } } } catch (IOException | NullPointerException e) { LOGGER.log(WARNING, "Exception removing cache directory for unused connection: " + entry.getKey(), e); } } }
Source:
public void start() throws IOException { try { openTarFile(); verify(); restore(); } catch (IOException e) { log.error("failed to restore from backup tar file {}", filePath); throw e; } finally { cleanup(); } log.debug("restore completed"); }

Target:
public void start() throws IOException { try { openTarFile(); verify(); restore(); } catch (IOException e) { log.error("failed to restore from backup tar file {}", filePath); throw e; } finally { cleanup(); } log.info("restore completed"); }
Source:
private void glusterHostRemove(Guid sourceClusterId) { if (getClusterUtils().hasServers(sourceClusterId) && !getClusterUtils().hasVolumeOnServer(getVdsId())) { VDSReturnValue returnValue = runVdsCommand( VDSCommandType.GlusterHostRemove, new GlusterHostRemoveVDSParameters((getClusterUtils().getUpServer(sourceClusterId)).getId(), getVds().gethost_name(), false)); setSucceeded(returnValue.getSucceeded()); if (!getSucceeded()) { getReturnValue().getFault().setError(returnValue.getVdsError().getCode()); getReturnValue().getFault().setMessage(returnValue.getVdsError().getMessage()); errorType = AuditLogType.GLUSTER_HOST_REMOVE_FAILED; return; } } }

Target:
private void glusterHostRemove(Guid sourceClusterId) { VDSReturnValue returnValue = runVdsCommand( VDSCommandType.GlusterHostRemove, new GlusterHostRemoveVDSParameters((getClusterUtils().getUpServer(sourceClusterId)).getId(), getVds().gethost_name(), false)); setSucceeded(returnValue.getSucceeded()); if (!getSucceeded()) { handleVdsError(returnValue); errorType = AuditLogType.GLUSTER_HOST_REMOVE_FAILED; return; } }
Source:
public void testTestSuiteSetting() { List<String> errors = new ArrayList<>(); for (String group : totalGroups) { Set<TestInfo> testsToRun = TestMapping.getAllTests(testMappingsDir, group); for (TestInfo test : testsToRun) { if (!validateSuiteSetting(test.getName())) { errors.add( String.format( "Missing test_suite setting for test: %s with group: %s", test.getName(), group)); } } } if (!errors.isEmpty()) { throw new RuntimeException( String.format( "Fail test_suite setting check:\n%s", Joiner.on("\n").join(errors))); } }

Target:
public void testTestSuiteSetting() { List<String> errors = new ArrayList<>(); for (String testGroup : allTests.keySet()) { for (TestInfo testInfo : allTests.get(testGroup)) { if (!validateSuiteSetting(testInfo.getName())) { errors.add( String.format( "Missing test_suite setting for test: %s, test group: %s, " + "TEST_MAPPING file path: %s", testInfo.getName(), testGroup, testInfo.getSources())); } } } if (!errors.isEmpty()) { throw new RuntimeException( String.format( "Fail test_suite setting check:\n%s", Joiner.on("\n").join(errors))); } }
Source:
public List<ServiceDefinition> getServices(String name) { List<CatalogService> services = client.get().catalogClient() .getService(name, queryOptions) .getResponse(); List<ServiceHealth> healths = client.get().healthClient() .getAllServiceInstances(name, queryOptions) .getResponse(); return services.stream() .map(service -> newService( name, service, healths.stream() .filter(serviceHealth -> serviceHealth.getService().getId().equals(service.getServiceId())) .collect(Collectors.toList()))) .collect(Collectors.toList()); }

Target:
public List<ServiceDefinition> getServices(String name) { List<CatalogService> services = client.get().catalogClient() .getService(name, queryOptions) .getResponse(); List<ServiceHealth> healths = client.get().healthClient() .getAllServiceInstances(name, queryOptions) .getResponse(); return services.stream() .map(service -> newService(name, service, healths)) .collect(Collectors.toList()); }
Source:
public void init() { JOBS_ACB_CAN_CREATE.add(SplitDeveloperJob.JOB_NAME); JOBS_ACB_CAN_CREATE.add(RealWorldTestingUploadJob.JOB_NAME); }

Target:
public void init() { BACKGROUND_JOBS_ACB_CAN_CREATE.add(SplitDeveloperJob.JOB_NAME); BACKGROUND_JOBS_ACB_CAN_CREATE.add(RealWorldTestingUploadJob.JOB_NAME); }
Source:
public <A extends Arg, U> Optional<U> createMetadata( BuildTarget buildTarget, BuildRuleResolver resolver, A args, Class<U> metadataClass) throws NoSuchBuildTargetException { if (metadataClass.isAssignableFrom(FrameworkDependencies.class)) { ImmutableSet.Builder<SourcePath> sourcePaths = ImmutableSet.builder(); resolver.requireRule(buildTarget); sourcePaths.add(new BuildTargetSourcePath(buildTarget)); return Optional.of(metadataClass.cast(FrameworkDependencies.of(sourcePaths.build()))); } return Optional.absent(); }

Target:
public <A extends Arg, U> Optional<U> createMetadata( BuildTarget buildTarget, BuildRuleResolver resolver, A args, Class<U> metadataClass) throws NoSuchBuildTargetException { if (metadataClass.isAssignableFrom(FrameworkDependencies.class)) { resolver.requireRule(buildTarget); ImmutableSet<BuildTargetSourcePath> sourcePaths = ImmutableSet.of(new BuildTargetSourcePath(buildTarget)); return Optional.of(metadataClass.cast(FrameworkDependencies.of(sourcePaths))); } return Optional.absent(); }
Source:
private EndpointCache getOrAddEndpoint(URI endpoint) { EndpointCache endpointCache = this.addressCacheByEndpoint.computeIfAbsent(endpoint , key -> { GatewayAddressCache gatewayAddressCache = new GatewayAddressCache(endpoint, protocol, this.tokenProvider, this.userAgentContainer, this.httpClient); AddressResolver addressResolver = new AddressResolver(); addressResolver.initializeCaches(this.collectionCache, this.routingMapProvider, gatewayAddressCache); EndpointCache cache = new EndpointCache(); cache.addressCache = gatewayAddressCache; cache.addressResolver = addressResolver; return cache; }); if (this.addressCacheByEndpoint.size() > this.maxEndpoints) { List<URI> allEndpoints = new ArrayList<URI>(this.endpointManager.getWriteEndpoints()); allEndpoints.addAll(this.endpointManager.getReadEndpoints()); Collections.reverse(allEndpoints); LinkedList<URI> endpoints = new LinkedList<>(allEndpoints); while (this.addressCacheByEndpoint.size() > this.maxEndpoints) { if (endpoints.size() > 0) { URI dequeueEnpoint = endpoints.pop(); if (this.addressCacheByEndpoint.get(dequeueEnpoint) != null) { this.addressCacheByEndpoint.remove(dequeueEnpoint); } } else { break; } } } return endpointCache; }

Target:
private EndpointCache getOrAddEndpoint(URI endpoint) { EndpointCache endpointCache = this.addressCacheByEndpoint.computeIfAbsent(endpoint , key -> { GatewayAddressCache gatewayAddressCache = new GatewayAddressCache(endpoint, protocol, this.tokenProvider, this.userAgentContainer, this.httpClient); AddressResolver addressResolver = new AddressResolver(); addressResolver.initializeCaches(this.collectionCache, this.routingMapProvider, gatewayAddressCache); EndpointCache cache = new EndpointCache(); cache.addressCache = gatewayAddressCache; cache.addressResolver = addressResolver; return cache; }); if (this.addressCacheByEndpoint.size() > this.maxEndpoints) { List<URI> allEndpoints = new ArrayList<>(this.endpointManager.getWriteEndpoints()); allEndpoints.addAll(this.endpointManager.getReadEndpoints()); Collections.reverse(allEndpoints); LinkedList<URI> endpoints = new LinkedList<>(allEndpoints); while (this.addressCacheByEndpoint.size() > this.maxEndpoints) { if (endpoints.size() > 0) { URI dequeueEnpoint = endpoints.pop(); if (this.addressCacheByEndpoint.get(dequeueEnpoint) != null) { this.addressCacheByEndpoint.remove(dequeueEnpoint); } } else { break; } } } return endpointCache; }
Source:
private void track() { Map<String, Object> props = new HashMap<>(); props.put("login_phase", mLoginPhase.name()); props.put("login_service_is_foreground", isForeground()); AnalyticsTracker.track(AnalyticsTracker.Stat.LOGIN_WPCOM_BACKGROUND_SERVICE_UPDATE, props); }

Target:
private void track() { Map<String, Object> props = new HashMap<>(); props.put("login_phase", mLoginPhase == null ? "null" : mLoginPhase.name()); props.put("login_service_is_foreground", isForeground()); AnalyticsTracker.track(AnalyticsTracker.Stat.LOGIN_WPCOM_BACKGROUND_SERVICE_UPDATE, props); }
Source:
public Builder setSupportedCipherSuites(String... cipherSuites) { if (cipherSuites == null) { throw new NullPointerException("Connector must support at least one cipher suite"); } if (cipherSuites.length == 0) { throw new IllegalArgumentException("Connector must support at least one cipher suite"); } List<CipherSuite> suites = new ArrayList<>(cipherSuites.length); for (int i = 0; i < cipherSuites.length; i++) { if (CipherSuite.TLS_NULL_WITH_NULL_NULL.name().equals(cipherSuites[i])) { throw new IllegalArgumentException("NULL Cipher Suite is not supported by connector"); } CipherSuite knownSuite = CipherSuite.getTypeByName(cipherSuites[i]); if (knownSuite != null) { suites.add(knownSuite); } else { throw new IllegalArgumentException( String.format("Cipher suite [%s] is not (yet) supported", cipherSuites[i])); } } config.supportedCipherSuites = suites; return this; }

Target:
public Builder setSupportedCipherSuites(String... cipherSuites) { if (cipherSuites == null) { throw new NullPointerException("Connector must support at least one cipher suite"); } List<CipherSuite> suites = new ArrayList<>(cipherSuites.length); for (int i = 0; i < cipherSuites.length; i++) { CipherSuite knownSuite = CipherSuite.getTypeByName(cipherSuites[i]); if (knownSuite != null) { suites.add(knownSuite); } else { throw new IllegalArgumentException( String.format("Cipher suite [%s] is not (yet) supported", cipherSuites[i])); } } return setSupportedCipherSuites(suites); }
Source:
private void handleUnexpectedEvent(QueryCacheEventData event) { int partitionId = event.getPartitionId(); long sequence = event.getSequence(); Long prev = brokenSequences.putIfAbsent(partitionId, sequence); if (prev == null && logger.isWarningEnabled()) { InternalQueryCache queryCache = getQueryCache(); if (queryCache != null) { long currentSequence = sequenceProvider.getSequence(partitionId); logger.warning(format("Event lost detected for queryCache=`%s` partitionId=%d, expectedSequence=%d " + "but foundSequence=%d, cacheSize=%d", queryCache.getCacheId(), partitionId, currentSequence + 1L, sequence, queryCache.size())); publishEventLost(context, info.getMapName(), info.getCacheId(), event.getPartitionId()); } } }

Target:
private void handleUnexpectedEvent(QueryCacheEventData event) { int partitionId = event.getPartitionId(); long sequence = event.getSequence(); Long prev = brokenSequences.putIfAbsent(partitionId, sequence); if (prev != null) { return; } InternalQueryCache queryCache = getQueryCache(); if (queryCache != null) { if (logger.isWarningEnabled()) { long currentSequence = sequenceProvider.getSequence(partitionId); logger.warning(format("Event lost detected for queryCache=`%s`: " + "partitionId=%d, expectedSequence=%d, " + "foundSequence=%d, cacheSize=%d", queryCache.getCacheId(), partitionId, currentSequence + 1L, sequence, queryCache.size())); } publishEventLost(context, info.getMapName(), info.getCacheId(), event.getPartitionId()); } }
Source:
public void testPattern02() { PackageNameMatcher matcher = PackageNameMatcher.compile("com.example.*"); Assert.assertNotNull(matcher); Assert.assertFalse(matcher.matches("com.example")); Assert.assertTrue(matcher.matches("com.example.child")); Assert.assertTrue(matcher.matches("com.example.child.granchild")); Assert.assertFalse(matcher.matches("parent.com.example")); }

Target:
public void testPattern02() { PackageNameMatcher matcher = PackageNameMatcher.compile(asList("com.example.*")); assertFalse(matcher.matches("com.example")); assertTrue(matcher.matches("com.example.child")); assertTrue(matcher.matches("com.example.child.granchild")); assertFalse(matcher.matches("parent.com.example")); }
Source:
public void printInactiveBundles() { printInactiveBundles(LOGGER::error, LOGGER::error); }

Target:
private void printInactiveBundles() { printInactiveBundles(LOGGER::error, LOGGER::error); }
Source:
public String getResourceCrnByResourceName(String resourceName) { return repository.findByName(resourceName).get().getResourceCrn().toString(); }

Target:
public String getResourceCrnByResourceName(String resourceName) { return repository.findResourceCrnByName(resourceName).orElseThrow(NotFoundException.notFound("databaseserver", resourceName)).toString(); }