auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public SearchResult query(SearchQuery query) { final String input = query.getInput(); final CriteriaBuilder builder = new CriteriaBuilder(OnmsCategory.class) .ilike("name", QueryUtils.ilike(input)) .orderBy("name") .distinct(); final int totalCount = categoryDao.countMatching(builder.toCriteria()); final Criteria criteria = builder.limit(query.getMaxResults()).toCriteria(); final List<OnmsCategory> matchingResult = categoryDao.findMatching(criteria); final List<SearchResultItem> searchResultItems = matchingResult.stream().map(category -> { final SearchResultItem searchResultItem = new SearchResultItem(); searchResultItem.setIdentifier(category.getId().toString()); searchResultItem.setLabel("Show nodes in category '" + category.getName() + "'"); searchResultItem.setUrl("element/nodeList.htm?category1=" + category.getName()); return searchResultItem; }).collect(Collectors.toList()); final SearchResult searchResult = new SearchResult(Contexts.Action).withMore(totalCount > searchResultItems.size()).withResults(searchResultItems); return searchResult; }

Target:
public SearchResult query(SearchQuery query) { final String input = query.getInput(); final CriteriaBuilder builder = new CriteriaBuilder(OnmsCategory.class) .ilike("name", QueryUtils.ilike(input)) .orderBy("name") .distinct(); final int totalCount = categoryDao.countMatching(builder.toCriteria()); final Criteria criteria = builder.limit(query.getMaxResults()).toCriteria(); final List<OnmsCategory> matchingResult = categoryDao.findMatching(criteria); final List<SearchResultItem> searchResultItems = matchingResult.stream().map(category -> { final SearchResultItem searchResultItem = new SearchResultItem(); searchResultItem.setIdentifier(category.getId().toString()); searchResultItem.setLabel("Show nodes in category '" + category.getName() + "'"); searchResultItem.setUrl("element/nodeList.htm?category1=" + UrlUtils.encode(category.getName())); return searchResultItem; }).collect(Collectors.toList()); final SearchResult searchResult = new SearchResult(Contexts.Action).withMore(totalCount > searchResultItems.size()).withResults(searchResultItems); return searchResult; }
Source:
public boolean isServiceDetected(InetAddress address) { try { SnmpAgentConfig agentConfig = getAgentConfigFactory().getAgentConfig(address); String expectedValue = null; configureAgentPTR(agentConfig); configureAgentVersion(agentConfig); if (getVbvalue() != null) { expectedValue = getVbvalue(); } if (this.m_isTable) { LOG.debug(getServiceName() + ": Table detect enabled"); SnmpObjId snmpObjId = SnmpObjId.get(getOid()); Map<SnmpInstId, SnmpValue> table = SnmpUtils.getOidValues(agentConfig, DEFAULT_SERVICE_NAME, snmpObjId); for (Map.Entry<SnmpInstId, SnmpValue> e : table.entrySet()) { String retrievedValue; if (m_hex) { retrievedValue = e.getValue().toHexString(); } else { retrievedValue = e.getValue().toString(); } LOG.debug(getServiceName() + ": retrieved value [" + retrievedValue + "]"); if (retrievedValue != null && expectedValue != null && Pattern.compile(expectedValue).matcher(retrievedValue).matches()) { LOG.debug(getServiceName() + ": expected value matched"); return true; } else if (retrievedValue != null) { return true; } } return false; } else { String retrievedValue = getValue(agentConfig, getOid()); if (retrievedValue != null && expectedValue != null) { return (Pattern.compile(expectedValue).matcher(retrievedValue).matches()); } else { return (retrievedValue != null); } } } catch (Throwable t) { throw new UndeclaredThrowableException(t); } }

Target:
public boolean isServiceDetected(InetAddress address) { try { SnmpAgentConfig agentConfig = getAgentConfigFactory().getAgentConfig(address); configureAgentPTR(agentConfig); configureAgentVersion(agentConfig); final String expectedValue = getVbvalue(); if (this.m_isTable) { LOG.debug(getServiceName() + ": table detect enabled"); final SnmpObjId snmpObjId = SnmpObjId.get(getOid()); final Map<SnmpInstId, SnmpValue> table = SnmpUtils.getOidValues(agentConfig, DEFAULT_SERVICE_NAME, snmpObjId); final List<String> retrievedValues = table.values().stream().map(snmpValue -> m_hex ? snmpValue.toHexString() : snmpValue.toString()).collect(Collectors.toList()); return isServiceDetected(this.matchType, retrievedValues, expectedValue); } else { final String retrievedValue = getValue(agentConfig, getOid(), m_hex); MatchType matchType = this.matchType; if (matchType == null && expectedValue != null) { matchType = MatchType.Any; } return isServiceDetected(matchType, Lists.newArrayList(retrievedValue), expectedValue); } } catch (Throwable t) { throw new UndeclaredThrowableException(t); } }
Source:
protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); String result = null; switch (requestCode) { case BARCODE_CAPTURE: if (resultCode == Activity.RESULT_OK) { lastInstallMode = INSTALL_MODE_BARCODE; result = data.getStringExtra("SCAN_RESULT"); } break; case OFFLINE_INSTALL: if (resultCode == Activity.RESULT_OK) { lastInstallMode = INSTALL_MODE_OFFLINE; result = data.getStringExtra(InstallArchiveActivity.ARCHIVE_JR_REFERENCE); } break; case GET_APPS_FROM_HQ: if (resultCode == Activity.RESULT_OK) { lastInstallMode = INSTALL_MODE_FROM_LIST; result = data.getStringExtra(InstallFromListActivity.PROFILE_REF); } break; case MULTIPLE_APPS_LIMIT: setResult(RESULT_CANCELED); finish(); return; } if (result == null) { return; } if (lastInstallMode == INSTALL_MODE_FROM_LIST) { GoogleAnalyticsUtils.reportFeatureUsage(GoogleAnalyticsFields.ACTION_INSTALL_FROM_LIST); } setReadyToInstall(result); }

Target:
protected void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); String result = null; switch (requestCode) { case BARCODE_CAPTURE: if (resultCode == Activity.RESULT_OK) { lastInstallMode = INSTALL_MODE_BARCODE; result = data.getStringExtra("SCAN_RESULT"); Log.i(TAG, "Got url from barcode scanner: " + result); } break; case OFFLINE_INSTALL: if (resultCode == Activity.RESULT_OK) { lastInstallMode = INSTALL_MODE_OFFLINE; result = data.getStringExtra(InstallArchiveActivity.ARCHIVE_JR_REFERENCE); } break; case GET_APPS_FROM_HQ: if (resultCode == Activity.RESULT_OK) { lastInstallMode = INSTALL_MODE_FROM_LIST; result = data.getStringExtra(InstallFromListActivity.PROFILE_REF); } break; case MULTIPLE_APPS_LIMIT: setResult(RESULT_CANCELED); finish(); return; } if (result == null) { return; } if (lastInstallMode == INSTALL_MODE_FROM_LIST) { FirebaseAnalyticsUtil.reportFeatureUsage(AnalyticsParamValue.FEATURE_INSTALL_FROM_LIST); } setReadyToInstall(result); }
Source:
public CppCharStream(JavaccTokenDocument document) { super(document); }

Target:
CppCharStream(JavaccTokenDocument document) { super(document); }
Source:
public void sendSync(long userId, Event event, Position position) { final User user = Context.getPermissionsManager().getUser(userId); if (user.getAttributes().containsKey("notificationTokens")) { Message message = new Message(); message.tokens = user.getString("notificationTokens").split("[, ]"); message.data = NotificationFormatter.buildData(userId, event, position); String body = NotificationFormatter.formatShortMessage(userId, event, position).trim(); if (isFormatDataOnly) { message.data.put("body", body); } else { Notification notification = new Notification(); notification.body = body; message.notification = notification; } ClientBuilder.newClient().target(URL).request() .header("Authorization", "key=" + key) .async().post(Entity.json(message), new InvocationCallback<Object>() { @Override public void completed(Object o) { LOGGER.info("Firebase notification sent to user: {}", userId); } @Override public void failed(Throwable throwable) { LOGGER.warn("Firebase notification error", throwable); } }); } }

Target:
public void sendSync(long userId, Event event, Position position) { final User user = Context.getPermissionsManager().getUser(userId); if (user.getAttributes().containsKey("notificationTokens")) { Message message = new Message(); message.tokens = user.getString("notificationTokens").split("[, ]"); message.data = NotificationFormatter.buildData(userId, event, position); String body = NotificationFormatter.formatShortMessage(userId, event, position).trim(); if (formatDataOnly) { message.data.put("body", body); } else { Notification notification = new Notification(); notification.body = body; message.notification = notification; } client.target(URL).request() .header("Authorization", "key=" + key) .async().post(Entity.json(message), new InvocationCallback<Object>() { @Override public void completed(Object o) { LOGGER.debug("Firebase notification sent to user: {}", userId); } @Override public void failed(Throwable throwable) { LOGGER.warn("Firebase notification error", throwable); } }); } }
Source:
public JSONObject convertEntityIdValueToJson(EntityIdValue value){ JSONObject result = new JSONObject(); JSONObject valueResult = new JSONObject(); result.put(KEY_TYP, "wikibase-entityid"); switch (value.getEntityType()) { case EntityIdValue.ET_ITEM: valueResult = visit((ItemIdValue) value); break; case EntityIdValue.ET_PROPERTY: valueResult = visit((PropertyIdValue) value); break; default: throw new JSONException("Unknown EntityType: " + value.getEntityType()); } result.put(KEY_VALUE, valueResult); return result; }

Target:
JSONObject convertEntityIdValueToJson(EntityIdValue value) { JSONObject result = new JSONObject(); JSONObject valueResult = new JSONObject(); result.put(KEY_TYPE, "wikibase-entityid"); switch (value.getEntityType()) { case EntityIdValue.ET_ITEM: valueResult = visit((ItemIdValue) value); break; case EntityIdValue.ET_PROPERTY: valueResult = visit((PropertyIdValue) value); break; default: throw new JSONException("Unknown EntityType: " + value.getEntityType()); } result.put(KEY_VALUE, valueResult); return result; }
Source:
public void plus_binary_expression() throws Exception { execute("x = a + b"); assertSingleValueInStackWithConstraint(Constraint.NUMBER.or(Constraint.STRING)); execute("x = a + 'str'"); assertSingleValueInStackWithConstraint(Constraint.STRING); execute("x = a + 1"); assertSingleValueInStackWithConstraint(Constraint.NUMBER); execute("x = 'str' + 1"); assertSingleValueInStackWithConstraint(Constraint.STRING); execute("x = 'str' + true"); assertSingleValueInStackWithConstraint(Constraint.STRING); execute("x = a + true"); assertSingleValueInStackWithConstraint(Constraint.NUMBER); }

Target:
public void plus_binary_expression() throws Exception { Constraint numberOrString = Constraint.NUMBER.or(Constraint.STRING); execute("x = a + b"); assertSingleValueInStackWithConstraint(numberOrString); execute("x = a + 'str'"); assertSingleValueInStackWithConstraint(Constraint.STRING); execute("x = a + 1"); assertSingleValueInStackWithConstraint(numberOrString); execute("x = 'str' + 1"); assertSingleValueInStackWithConstraint(Constraint.STRING); execute("x = 'str' + true"); assertSingleValueInStackWithConstraint(Constraint.STRING); execute("x = a + true"); assertSingleValueInStackWithConstraint(numberOrString); }
Source:
protected void ExecuteVdsBrokerCommand() { List<String> vmIds = ((FullListVDSCommandParameters) getParameters()).getVmIds(); String[] vmIdsArray = vmIds.toArray(new String[vmIds.size()]); fullVmListReturn = getBroker().list("true", vmIdsArray); ProceedProxyReturnValue(); XmlRpcStruct[] struct = fullVmListReturn.mVmList; setReturnValue(struct); }

Target:
protected void ExecuteVdsBrokerCommand() { List<String> vmIds = getParameters().getVmIds(); String[] vmIdsArray = vmIds.toArray(new String[vmIds.size()]); fullVmListReturn = getBroker().list(Boolean.TRUE.toString(), vmIdsArray); ProceedProxyReturnValue(); XmlRpcStruct[] struct = fullVmListReturn.mVmList; setReturnValue(struct); }
Source:
public void start() { super.start(); if (apiKey == null) { throw new IllegalStateException("apiKey required"); } client = new Client(apiKey); }

Target:
public void start() { super.start(); if (installHandler && Thread.getDefaultUncaughtExceptionHandler() == null) { Thread.setDefaultUncaughtExceptionHandler(new Thread.UncaughtExceptionHandler() { public void uncaughtException(Thread t, Throwable e) { System.err.printf("Exception in thread \"%s\" ", t.getName()); e.printStackTrace(System.err); } }); } client = new Client(apiKey, installHandler); client.setReleaseStage(releaseStage); client.setUseSSL(true); }
Source:
UndeleteOperationTracker(RouterConfig routerConfig, PartitionId partitionId, String originatingDcName) { super(routerConfig, RouterOperation.UndeleteOperation, partitionId, originatingDcName, false); List<? extends ReplicaId> replicas = partitionId.getReplicaIds(); for (ReplicaId replica : replicas) { String dcName = replica.getDataNodeId().getDatacenterName(); numReplicasInDcs.put(dcName, numReplicasInDcs.getOrDefault(dcName, 0) + 1); } Map<String, Integer> numEligibleReplicasInDcs = new HashMap<>(); for (ReplicaId replica : replicaPool) { String dcName = replica.getDataNodeId().getDatacenterName(); numEligibleReplicasInDcs.put(dcName, numEligibleReplicasInDcs.getOrDefault(dcName, 0) + 1); } if (!hasReachedGlobalQuorum(numReplicasInDcs, numEligibleReplicasInDcs)) { throw new IllegalArgumentException( "Eligible replicas are not sufficient for undelete operation for partition " + partitionId); } for (String dcName : numReplicasInDcs.keySet()) { int totalNum = numReplicasInDcs.get(dcName); if (numEligibleReplicasInDcs.containsKey(dcName)) { int eligibleNum = numEligibleReplicasInDcs.get(dcName); if (eligibleNum != totalNum) { numFailureInDcs.put(dcName, totalNum - eligibleNum); } } } }

Target:
UndeleteOperationTracker(RouterConfig routerConfig, PartitionId partitionId, String originatingDcName) { super(routerConfig, RouterOperation.UndeleteOperation, partitionId, originatingDcName, false); List<? extends ReplicaId> replicas = partitionId.getReplicaIds(); for (ReplicaId replica : replicas) { String dcName = replica.getDataNodeId().getDatacenterName(); numReplicasInDcs.put(dcName, numReplicasInDcs.getOrDefault(dcName, 0) + 1); } Map<String, Integer> numEligibleReplicasInDcs = new HashMap<>(); for (ReplicaId replica : replicaPool) { String dcName = replica.getDataNodeId().getDatacenterName(); numEligibleReplicasInDcs.put(dcName, numEligibleReplicasInDcs.getOrDefault(dcName, 0) + 1); } if (!hasReachedGlobalQuorum(numReplicasInDcs, numEligibleReplicasInDcs)) { throw new IllegalArgumentException( "Eligible replicas are not sufficient for undelete operation for partition " + partitionId); } for (String dcName : numReplicasInDcs.keySet()) { int totalNum = numReplicasInDcs.get(dcName); int eligibleNum = numEligibleReplicasInDcs.getOrDefault(dcName, 0); numFailureInDcs.put(dcName, totalNum - eligibleNum); } }
Source:
public final Date getExtendedExpiresOn() { return this.mExtendedExpiresOn; }

Target:
public final Date getExtendedExpiresOn() { return mExtendedExpiresOn; }
Source:
public void setConf(Configuration conf) { this.conf = conf; }

Target:
public void setConf(Configuration conf) { Preconditions.checkNotNull(conf); Preconditions.checkArgument(conf instanceof StatefulMongoDBRdfConfiguration, "Expected an instance of %s; received %s", StatefulMongoDBRdfConfiguration.class.getName(), conf.getClass().getName()); this.conf = (StatefulMongoDBRdfConfiguration) conf; }
Source:
private void logContext(RelationshipOp operation, Environment environment) { List<Field> children = environment.field.getSelectionSet() != null ? (List) environment.field.getSelectionSet().getChildren() : new ArrayList<>(); String requestedFields = environment.field.getName() + (children.size() > 0 ? "(" + children.stream().map(Field::getName).collect(Collectors.toList()) + ")" : ""); GraphQLType parent = environment.parentType; log.debug("{} fields for with parent {}<{}>", operation, requestedFields, environment.source, parent.getClass().getSimpleName(), parent.getName()); }

Target:
private void logContext(RelationshipOp operation, Environment environment) { List<Field> children = environment.field.getSelectionSet() != null ? (List) environment.field.getSelectionSet().getChildren() : new ArrayList<>(); String requestedFields = environment.field.getName() + (children.size() > 0 ? "(" + children.stream().map(Field::getName).collect(Collectors.toList()) + ")" : ""); GraphQLType parent = environment.parentType; log.debug("{} fields with parent {}<{}>", operation, requestedFields, parent.getClass().getSimpleName(), parent.getName()); }
Source:
private boolean checkEventType(EventMessage event) { boolean result = (eventTypeUrl == null) || event.typeUrl() .equals(eventTypeUrl); return result; }

Target:
private boolean checkEventType(EventMessage event) { boolean result = (eventTypeUrl == null) || eventTypeUrl.equals(event.typeUrl()); return result; }
Source:
public boolean isAlphabeticallySortActive() { return alphabeticallySort; }

Target:
private boolean isAlphabeticallySortActive() { return alphabeticallySort; }
Source:
public static File findLatestAndroidPlatformFolder(File platformsFolder) { File[] platformVersions = platformsFolder.listFiles(new FileFilter() { @Override public boolean accept(File file) { return file.getName().matches("android-\\d+$"); } }); if (platformVersions == null || platformVersions.length == 0) { throw new SelendroidException("No valid Android platform folder found in " + platformsFolder.getName()); } Arrays.sort( platformVersions, new Comparator<File>() { @Override public int compare(File f1, File f2) { int v1 = Integer.parseInt(f1.getName().split("-")[1]); int v2 = Integer.parseInt(f2.getName().split("-")[1]); return Integer.compare(v1, v2); } }); return platformVersions[platformVersions.length - 1].getAbsoluteFile(); }

Target:
public static File findLatestAndroidPlatformFolder(File platformsFolder) { File[] platformVersions = platformsFolder.listFiles(new FileFilter() { @Override public boolean accept(File file) { return file.getName().matches(PLATFORM_VERSION_REGEX); } }); if (platformVersions == null || platformVersions.length == 0) { throw new SelendroidException("No valid Android platform folder found in " + platformsFolder.getName()); } Pattern pattern = Pattern.compile(PLATFORM_VERSION_REGEX); Arrays.sort( platformVersions, new Comparator<File>() { @Override public int compare(File f1, File f2) { Matcher m1 = pattern.matcher(f1.getName()); Matcher m2 = pattern.matcher(f2.getName()); m1.find(); m2.find(); return Integer.compare( Integer.parseInt(m1.group(1)), Integer.parseInt(m2.group(1))); } }); return platformVersions[platformVersions.length - 1].getAbsoluteFile(); }
Source:
public void onCreate() { JDBCConfiguration jdbcConfiguration = asJDBCConfiguration(configurationService.getConfiguration()); validate(jdbcConfiguration); if (dataSource == null) { dataSource = new BasicDataSource(); dataSource.setDriverClassName(jdbcConfiguration.getDriver()); dataSource.setUrl(jdbcConfiguration.getJdbcUrl()); dataSource.setUsername(jdbcConfiguration.getUsername()); dataSource.setPassword(jdbcConfiguration.getPassword()); dataSource.setMinIdle(5); dataSource.setMaxIdle(10); dataSource.setMaxOpenPreparedStatements(100); } }

Target:
public void onCreate() { try { JDBCConfiguration jdbcConfiguration = asJDBCConfiguration(configurationService.getConfiguration()); validate(jdbcConfiguration); dataSource = new BasicDataSource(); dataSource.setDriverClassName(jdbcConfiguration.getDriver()); dataSource.setUrl(jdbcConfiguration.getJdbcUrl()); dataSource.setUsername(jdbcConfiguration.getUsername()); dataSource.setPassword(jdbcConfiguration.getPassword()); dataSource.setMinIdle(5); dataSource.setMaxIdle(10); dataSource.setMaxOpenPreparedStatements(100); } catch (Exception e) { LOG.error("Error in creating jdbc connection.", e); throw new RuntimeException(e); } }
Source:
private void verify(MatchableInvocation wanted, List<Invocation> invocations) { if (invocations.isEmpty()) { return; } try { Location location = invocations.get(0).getLocation(); Field stackTraceHolderField = getStackTraceHolderField(location); for (Invocation invocation : invocations) { if (wanted.matches(invocation) && getStackTraceElements(stackTraceHolderField, invocation) .noneMatch(this::isDoPrivilegedCall)) { throw new MockitoAssertionError(wanted + " not called in a doPrivileged block"); } } } catch (NoSuchFieldException | IllegalAccessException e) { throw new MockitoAssertionError( "Failed to verify that " + wanted + " was called in a doPrivileged block, most likely because Mockito's" + " internal implementation has changed."); } }

Target:
private void verify(MatchableInvocation wanted, List<Invocation> invocations) { if (invocations.isEmpty()) { return; } Location location = invocations.get(0).getLocation(); Field stackTraceHolderField = getStackTraceHolderField(wanted, location); if (invocations .stream() .filter(wanted::matches) .flatMap(i -> getStackTraceElements(stackTraceHolderField, wanted, i)) .noneMatch(this::isDoPrivilegedCall)) { throw new MockitoAssertionError(wanted + " not called in a doPrivileged block"); } }
Source:
public static Expression toPredicate(TupleDomain<Symbol> tupleDomain) { if (tupleDomain.isNone()) { return FALSE_LITERAL; } Map<Symbol, Domain> domains = tupleDomain.getDomains().get(); return domains.keySet().stream() .sorted(comparing(Symbol::getName)) .map(symbol -> toPredicate(domains.get(symbol), symbol.toSymbolReference())) .collect(combineConjuncts()); }

Target:
public static Expression toPredicate(TupleDomain<Symbol> tupleDomain) { if (tupleDomain.isNone()) { return FALSE_LITERAL; } Map<Symbol, Domain> domains = tupleDomain.getDomains().get(); return domains.entrySet().stream() .sorted(comparing(entry -> entry.getKey().getName())) .map(entry -> toPredicate(entry.getValue(), entry.getKey().toSymbolReference())) .collect(collectingAndThen(toImmutableList(), ExpressionUtils::combineConjuncts)); }
Source:
private void run(CommandInterpreter interpreter) { String groovyScriptFile = interpreter.nextArgument(); if (groovyScriptFile == null || groovyScriptFile.length() == 0) { interpreter.println(getHelp()); return; } try { final String script = Files.lines(Paths.get(groovyScriptFile)).collect(Collectors.joining(System.getProperty("line.separator"))); final ClassLoader classLoader = ApplicationContext.getServiceForClass(ExtensionBasedRepositoryClassLoaderProviderRegistry.class).getClassLoader(); ScriptEngine.run("groovy", classLoader, script, Collections.emptyMap()); } catch (Exception e) { interpreter.printStackTrace(e); } }

Target:
private void run(CommandInterpreter interpreter) { String groovyScriptFile = interpreter.nextArgument(); if (groovyScriptFile == null || groovyScriptFile.length() == 0) { interpreter.println(getHelp()); return; } try { final String script = Files.lines(Paths.get(groovyScriptFile)).collect(Collectors.joining(System.getProperty("line.separator"))); final ClassLoader classLoader = ApplicationContext.getServiceForClass(RepositoryClassLoaderProviderRegistry.class).getClassLoader(); ScriptEngine.run("groovy", classLoader, script, Collections.emptyMap()); } catch (Exception e) { interpreter.printStackTrace(e); } }
Source:
private void performRename(RenameRefactoringSession session) { final LinkedRenameRefactoringApply dto = createLinkedRenameRefactoringApplyDto(newName, session.getSessionId()); Promise<RefactoringResult> applyModelPromise = refactoringServiceClient.applyLinkedModeRename(dto); applyModelPromise.then(new Operation<RefactoringResult>() { @Override public void apply(RefactoringResult result) throws OperationException { switch (result.getSeverity()) { case OK: case INFO: RefactorInfo refactorInfo = RefactorInfo.of(RefactoredItemType.JAVA_ELEMENT, null); refactoringUpdater.updateAfterRefactoring(refactorInfo, result.getChanges()); refactoringServiceClient.reindexProject(textEditor.getDocument().getFile().getProject().getProjectConfig().getPath()); break; case WARNING: case ERROR: enableAutoSave(); undoChanges(); showWarningDialog(); break; case FATAL: undoChanges(); notificationManager.notify(locale.failedToRename(), result.getEntries().get(0).getMessage(), FAIL, FLOAT_MODE); break; default: break; } } }).catchError(new Operation<PromiseError>() { @Override public void apply(PromiseError arg) throws OperationException { enableAutoSave(); undoChanges(); notificationManager.notify(locale.failedToRename(), arg.getMessage(), FAIL, FLOAT_MODE); } }); }

Target:
private void performRename(RenameRefactoringSession session) { final LinkedRenameRefactoringApply dto = createLinkedRenameRefactoringApplyDto(newName, session.getSessionId()); Promise<RefactoringResult> applyModelPromise = refactoringServiceClient.applyLinkedModeRename(dto); applyModelPromise.then(new Operation<RefactoringResult>() { @Override public void apply(RefactoringResult result) throws OperationException { switch (result.getSeverity()) { case OK: case INFO: RefactorInfo refactorInfo = RefactorInfo.of(RefactoredItemType.JAVA_ELEMENT, null); refactoringUpdater.updateAfterRefactoring(refactorInfo, result.getChanges()); String projectPath = textEditor.getDocument().getFile().getProject().getProjectConfig().getPath(); refactoringServiceClient.reindexProject(projectPath); break; case WARNING: case ERROR: enableAutoSave(); undoChanges(); showWarningDialog(); break; case FATAL: undoChanges(); notificationManager.notify(locale.failedToRename(), result.getEntries().get(0).getMessage(), FAIL, FLOAT_MODE); break; default: break; } } }).catchError(new Operation<PromiseError>() { @Override public void apply(PromiseError arg) throws OperationException { enableAutoSave(); undoChanges(); notificationManager.notify(locale.failedToRename(), arg.getMessage(), FAIL, FLOAT_MODE); } }); }
Source:
public final void validationFailsOnCommandersMismatch() throws Exception { final String architect = "Yegor2048"; final Profile master = new Profile.Fixed( new XMLDocument( String.format( ProfilesTest.PROFILE, architect, "Yegor32", "do_something2" ) ) ); final Profile merged = new Profile.Fixed( new XMLDocument( String.format( ProfilesTest.PROFILE, architect, "Bob", "do_another2" ) ) ); try { new Profiles().validated(master, merged); } catch (final Profile.ConfigException exception) { MatcherAssert.assertThat( exception.getMessage(), Matchers.is( String.format( ProfilesTest.MESSAGE, "commander" ) ) ); } }

Target:
public final void validationFailsOnCommandersMismatch() throws Exception { final String architect = "Yegor2048"; final String commander = "Yegor4096"; final Profile master = new Profile.Fixed( new XMLDocument( String.format( ProfilesTest.PROFILE, architect, "Yegor32", "do_something2", "Yegor16", commander ) ) ); final Profile merged = new Profile.Fixed( new XMLDocument( String.format( ProfilesTest.PROFILE, architect, "Bob", "do_another2", "Marley", commander ) ) ); try { new Profiles().validated(master, merged); Assert.fail("Method above must throw an exception"); } catch (final Profile.ConfigException exception) { MatcherAssert.assertThat( exception.getMessage(), Matchers.is( String.format( ProfilesTest.MESSAGE, ProfilesTest.MERGE_COMMANDERS ) ) ); } }
Source:
public VmSnapshotListViewItem(String name, Snapshot snapshot, VmSnapshotListModel listModel, SnapshotModel snapshotModel) { super(name, snapshot); if (listModel == null) { return; } Container generalInfoContainer = createGeneralItemContainerPanel(snapshot, listModel); generalExpand.setDetails(generalInfoContainer); listGroupItem.add(generalInfoContainer); updateValues(snapshotModel); }

Target:
public VmSnapshotListViewItem(String name, Snapshot snapshot, VmSnapshotListModel listModel, SnapshotModel snapshotModel) { super(name, snapshot); Container generalInfoContainer = createGeneralItemContainerPanel(snapshot, listModel); generalExpand.setDetails(generalInfoContainer); listGroupItem.add(generalInfoContainer); updateValues(snapshotModel); }
Source:
public void invalidateVisualState() { super.invalidateVisualState(); invalidateInputVisuals(); invalidateOutputVisuals(); }

Target:
public void invalidateVisualState() { super.invalidateVisualState(); argumentSpace.invalidateInputContent(); argumentSpace.invalidateOutputContent(); }
Source:
private void addFeatureAsyncDelete(Features features) { Feature feature = new Feature(); feature.setName("Async Delete"); feature.setDescription("Ability to specify that DELETE request will be performed asynchronously, using the 'async' url parameter."); features.getFeature().add(feature); }

Target:
private void addFeatureAsyncDelete(Features features) { Feature feature = new Feature(); feature.setName("Async Delete"); feature.setDescription("Ability to specify that DELETE request will be performed asynchronously, using the 'async' url parameter."); Parameter async = new Parameter(); async.setName("async"); async.setValue("true|false"); async.setType("boolean"); async.setContext("matrix"); feature.setUrl(new Url()); feature.getUrl().getParametersSets().add(new ParametersSet()); feature.getUrl().getParametersSets().get(0).getParameters().add(async); features.getFeature().add(feature); }
Source:
public boolean insert(Set<DatasetEntry<E, A, V>> entries) { for (DatasetEntry<E, A, V> entry : entries) { if(!insert(entry)) { return false; } } return true; }

Target:
public int insert(Set<DatasetEntry<E, A, V>> entries) { int count = 0; for (DatasetEntry<E, A, V> entry : entries) { if(insert(entry)) { count++; } } return count; }
Source:
public String toString() { String fromState = this.fromState.isPresent() ? this.fromState.get() : "_"; String toState = this.toState.isPresent() ? this.toState.get() : "_"; return fromState+"->"+toState; }

Target:
public String toString() { String fromState = this.fromState.orElse("_"); String toState = this.toState.orElse("_"); return String.format("%s->%s", fromState, toState); }
Source:
private void privateRunJUnit(XmlTest xmlTest) { final ClassInfoMap cim = new ClassInfoMap(m_testClassesFromXml, false); final Set<Class<?>> classes = cim.getClasses(); final List<ITestNGMethod> runMethods = Lists.newArrayList(); List<IWorker<ITestNGMethod>> workers = Lists.newArrayList(); workers.add(new IWorker<ITestNGMethod>() { @Override public long getTimeOut() { return 0; } @Override public void run() { for(Class<?> tc: classes) { List<XmlInclude> includedMethods = cim.getXmlClass(tc).getIncludedMethods(); List<String> methods = Lists.newArrayList(); for (XmlInclude inc: includedMethods) { methods.add(inc.getName()); } IJUnitTestRunner tr= ClassHelper.createTestRunner(TestRunner.this); tr.setInvokedMethodListeners(m_invokedMethodListeners); try { tr.run(tc, methods.toArray(new String[methods.size()])); } catch(Exception ex) { ex.printStackTrace(); } finally { runMethods.addAll(tr.getTestMethods()); } } } @Override public List<ITestNGMethod> getTasks() { throw new TestNGException("JUnit not supported"); } @Override public int getPriority() { if (m_allTestMethods.length == 1) { return m_allTestMethods[0].getPriority(); } else { return 0; } } @Override public int compareTo(IWorker<ITestNGMethod> other) { return getPriority() - other.getPriority(); } }); runWorkers(workers); m_allTestMethods= runMethods.toArray(new ITestNGMethod[runMethods.size()]); }

Target:
private void privateRunJUnit(XmlTest xmlTest) { final ClassInfoMap cim = new ClassInfoMap(m_testClassesFromXml, false); final Set<Class<?>> classes = cim.getClasses(); final List<ITestNGMethod> runMethods = Lists.newArrayList(); List<IWorker<ITestNGMethod>> workers = Lists.newArrayList(); workers.add(new IWorker<ITestNGMethod>() { @Override public long getTimeOut() { return 0; } @Override public void run() { for(Class<?> tc: classes) { List<XmlInclude> includedMethods = cim.getXmlClass(tc).getIncludedMethods(); List<String> methods = Lists.newArrayList(); for (XmlInclude inc: includedMethods) { methods.add(inc.getName()); } IJUnitTestRunner tr= ClassHelper.createTestRunner(TestRunner.this); tr.setInvokedMethodListeners(m_invokedMethodListeners); try { tr.run(tc, methods.toArray(new String[methods.size()])); } catch(Exception ex) { ex.printStackTrace(); } finally { runMethods.addAll(tr.getTestMethods()); } } } @Override public List<ITestNGMethod> getTasks() { throw new TestNGException("JUnit not supported"); } @Override public int getPriority() { if (m_allTestMethods.length == 1) { return m_allTestMethods[0].getPriority(); } else { return 0; } } @Override public int compareTo(IWorker<ITestNGMethod> other) { return getPriority() - other.getPriority(); } }); runJUnitWorkers(workers); m_allTestMethods= runMethods.toArray(new ITestNGMethod[runMethods.size()]); }
Source:
public String description() { return "browser contains text"; }

Target:
public String description() { return "browser contains text: " + this.text; }
Source:
private RelyingPartyRegistration asRegistration(String id, Registration properties) { boolean signRequest = properties.getIdentityprovider().getSinglesignon().isSignRequest(); validateSigningCredentials(properties, signRequest); RelyingPartyRegistration.Builder builder = RelyingPartyRegistration.withRegistrationId(id); builder.assertionConsumerServiceUrlTemplate( "{baseUrl}" + Saml2WebSsoAuthenticationFilter.DEFAULT_FILTER_PROCESSES_URI); builder.providerDetails( (details) -> details.webSsoUrl(properties.getIdentityprovider().getSinglesignon().getUrl())); builder.providerDetails((details) -> details.entityId(properties.getIdentityprovider().getEntityId())); builder.providerDetails( (details) -> details.binding(properties.getIdentityprovider().getSinglesignon().getBinding())); builder.providerDetails((details) -> details.signAuthNRequest(signRequest)); builder.credentials((credentials) -> credentials.addAll(asCredentials(properties))); Optional.ofNullable(properties.getLocalEntityIdTemplate()) .ifPresent((template) -> builder.localEntityIdTemplate(template)); return builder.build(); }

Target:
private RelyingPartyRegistration asRegistration(String id, Registration properties) { boolean signRequest = properties.getIdentityprovider().getSinglesignon().isSignRequest(); validateSigningCredentials(properties, signRequest); RelyingPartyRegistration.Builder builder = RelyingPartyRegistration.withRegistrationId(id); builder.assertionConsumerServiceUrlTemplate( "{baseUrl}" + Saml2WebSsoAuthenticationFilter.DEFAULT_FILTER_PROCESSES_URI); builder.providerDetails( (details) -> details.webSsoUrl(properties.getIdentityprovider().getSinglesignon().getUrl())); builder.providerDetails((details) -> details.entityId(properties.getIdentityprovider().getEntityId())); builder.providerDetails( (details) -> details.binding(properties.getIdentityprovider().getSinglesignon().getBinding())); builder.providerDetails((details) -> details.signAuthNRequest(signRequest)); builder.credentials((credentials) -> credentials.addAll(asCredentials(properties))); builder.entityId(properties.getRelyingPartyEntityId()); return builder.build(); }
Source:
public int getProjectId(String projectName) throws MLHttpClientException { CloseableHttpResponse response; try { response = doHttpGet("/api/projects/" + projectName); BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(response.getEntity().getContent())); JSONObject responseJson = new JSONObject(bufferedReader.readLine()); bufferedReader.close(); response.close(); return responseJson.getInt("id"); } catch (MLHttpClientException e) { throw new MLHttpClientException("Faile to get ID of project: " + projectName, e); } catch (IOException e) { throw new MLHttpClientException("Faile to get ID of project: " + projectName, e); } catch (JSONException e) { throw new MLHttpClientException("Faile to get ID of project: " + projectName, e); } }

Target:
public int getProjectId(String projectName) throws MLHttpClientException { CloseableHttpResponse response; try { response = doHttpGet("/api/projects/" + projectName); BufferedReader bufferedReader = new BufferedReader(new InputStreamReader(response.getEntity().getContent())); JSONObject responseJson = new JSONObject(bufferedReader.readLine()); bufferedReader.close(); response.close(); return responseJson.getInt("id"); } catch (Exception e) { throw new MLHttpClientException("Failed to get ID of project: " + projectName, e); } }
Source:
public static VmInitNetwork map(GuestNicConfiguration model, VmInitNetwork template) { VmInitNetwork entity = template != null ? template : new VmInitNetwork(); if (model.isSetName()) { entity.setName(model.getName()); } if (model.isOnBoot()) { entity.setStartOnBoot(model.isOnBoot()); } if (model.isSetBootProtocol()) { entity.setBootProtocol(BootProtocolMapper.map(BootProtocol.fromValue(model.getBootProtocol()), NetworkBootProtocol.NONE)); } if (model.isSetIp()) { if (!model.isSetBootProtocol()) { entity.setBootProtocol(NetworkBootProtocol.STATIC_IP); } if (model.getIp().isSetAddress()) { entity.setIp(model.getIp().getAddress()); } if (model.getIp().isSetNetmask()) { entity.setNetmask(model.getIp().getNetmask()); } if (model.getIp().isSetGateway()) { entity.setGateway(model.getIp().getGateway()); } } return entity; }

Target:
public static VmInitNetwork map(GuestNicConfiguration model, VmInitNetwork template) { VmInitNetwork entity = template != null ? template : new VmInitNetwork(); if (model.isSetName()) { entity.setName(model.getName()); } if (model.isOnBoot()) { entity.setStartOnBoot(model.isOnBoot()); } if (model.isSetBootProtocol()) { entity.setBootProtocol(BootProtocolMapper.map(BootProtocol.fromValue(model.getBootProtocol()), NetworkBootProtocol.NONE)); } if (model.isSetIp()) { if (model.getIp().isSetAddress()) { entity.setIp(model.getIp().getAddress()); } if (model.getIp().isSetNetmask()) { entity.setNetmask(model.getIp().getNetmask()); } if (model.getIp().isSetGateway()) { entity.setGateway(model.getIp().getGateway()); } } return entity; }
Source:
public void testAllOutputsReferenced() throws Exception { tester().assertThat(new PruneFilterColumns()) .on(p -> buildProjectedFilter(p, Predicates.alwaysTrue())) .doesNotFire(); }

Target:
public void testAllOutputsReferenced() throws Exception { tester().assertThat(new PruneFilterColumns()) .on(p -> buildProjectedFilter(p, alwaysTrue())) .doesNotFire(); }
Source:
public boolean connection(DbSession dbSession, String hostId, byte[] arg0, boolean isSsl) throws Reply530Exception, Reply421Exception { DbHostAuth auth = null; try { auth = new DbHostAuth(hostId); } catch (WaarpDatabaseException e) { logger.error("Cannot find authentication for " + hostId); setIsIdentified(false); currentAuth = null; throw new Reply530Exception("HostId not allowed"); } if (auth.isSsl() != isSsl) { if (auth.isSsl()) { logger.error("Hostid must use SSL", hostId); } else { logger.error("Hostid cannot use SSL", hostId); } setIsIdentified(false); currentAuth = null; throw new Reply530Exception("HostId not allowed"); } currentAuth = auth; role.clear(); if (currentAuth.isKeyValid(arg0)) { setIsIdentified(true); user = hostId; setRootFromAuth(); getSession().getDir().initAfterIdentification(); isAdmin = currentAuth.isAdminrole(); if (Configuration.configuration.getRoles().isEmpty()) { if (isAdmin) { role.setRole(ROLE.FULLADMIN); } else { role.setRole(ROLE.PARTNER); } } else { RoleDefault configRole = Configuration.configuration.getRoles().get(hostId); if (configRole == null) { role.setRole(ROLE.PARTNER); } else { role.setRoleDefault(configRole); if (this.role.isContaining(ROLE.FULLADMIN)) { isAdmin = true; } } if (isAdmin) { role.setRole(ROLE.FULLADMIN); } } logger.debug(this.role.toString()); return true; } throw new Reply530Exception("Key is not valid for this HostId"); }

Target:
public boolean connection(DbSession dbSession, String hostId, byte[] arg0, boolean isSsl) throws Reply530Exception, Reply421Exception { return connection(hostId, arg0, isSsl); }
Source:
private void addStep(final Task task, Map<String, Task> config) { steps.add(task); project.getTasks().getByName("release").dependsOn(task); if (previousStep != null) { if (project.hasProperty("singleStep")) { } else { task.dependsOn(previousStep); } } previousStep = task; for (final Callable<Boolean> allower : allowers) { task.onlyIf(new SpecAdapter(allower)); } StepConfiguration stepConfig = new StepConfiguration(config); if (stepConfig.isEmpty()) { return; } Task rollback = stepConfig.getRollback(); if (rollback != null) { if (!project.hasProperty("dryRun")) { rollback.setEnabled(false); } } else { rollback = stepConfig.getCleanup(); } rollbacks.add(rollback); rollback.mustRunAfter(steps); if (previousRollback != null) { previousRollback.mustRunAfter(rollback); } previousRollback = rollback; task.finalizedBy(rollback); rollback.onlyIf(new Spec<Task>() { public boolean isSatisfiedBy(Task t) { return task.getState().getFailure() == null; } }); for (Callable<Boolean> allower : allowers) { rollback.onlyIf(new SpecAdapter(allower)); } }

Target:
private void addStep(final Task task, Map<String, Task> config) { steps.add(task); project.getTasks().getByName("release").dependsOn(task); if (previousStep != null) { if (project.hasProperty("singleStep")) { } else { task.dependsOn(previousStep); } } previousStep = task; for (final Callable<Boolean> allower : allowers) { task.onlyIf(new SpecAdapter(allower)); } StepConfiguration stepConfig = new StepConfiguration(config); if (stepConfig.isEmpty()) { return; } Task postStep = stepConfig.getRollback(); if (postStep != null) { if (!project.hasProperty("dryRun")) { postStep.setEnabled(false); } } else { postStep = stepConfig.getCleanup(); } postSteps.add(postStep); postStep.mustRunAfter(steps); if (previousPostStep != null) { previousPostStep.mustRunAfter(postStep); } previousPostStep = postStep; task.finalizedBy(postStep); postStep.onlyIf(new Spec<Task>() { public boolean isSatisfiedBy(Task t) { return task.getState().getFailure() == null; } }); for (Callable<Boolean> allower : allowers) { postStep.onlyIf(new SpecAdapter(allower)); } }
Source:
public Point2D transform(VisualizationServer<N, E> vv, Point2D p) { MultiLayerTransformer multiLayerTransformer = vv.getRenderContext().getMultiLayerTransformer(); MutableTransformer viewTransformer = multiLayerTransformer.getTransformer(Layer.VIEW); MutableTransformer layoutTransformer = multiLayerTransformer.getTransformer(Layer.LAYOUT); VisualizationModel<N, E, Point2D> model = vv.getModel(); if (viewTransformer instanceof LensTransformer) { p = multiLayerTransformer.transform(p); } else if (layoutTransformer instanceof LensTransformer) { LayoutModel<N, Point2D> layoutModel = model.getLayoutModel(); Dimension d = new Dimension(layoutModel.getWidth(), layoutModel.getHeight()); HyperbolicShapeTransformer shapeChanger = new HyperbolicShapeTransformer(d, viewTransformer); LensTransformer lensTransformer = (LensTransformer) layoutTransformer; shapeChanger.getLens().setLensShape(lensTransformer.getLens().getLensShape()); MutableTransformer layoutDelegate = ((MutableTransformerDecorator) layoutTransformer).getDelegate(); p = shapeChanger.transform(layoutDelegate.transform(p)); } else { p = multiLayerTransformer.transform(Layer.LAYOUT, p); } return p; }

Target:
public Point2D transform(VisualizationServer<N, E> vv, Point2D p) { MultiLayerTransformer multiLayerTransformer = vv.getRenderContext().getMultiLayerTransformer(); MutableTransformer viewTransformer = multiLayerTransformer.getTransformer(Layer.VIEW); MutableTransformer layoutTransformer = multiLayerTransformer.getTransformer(Layer.LAYOUT); VisualizationModel<N, E> model = vv.getModel(); if (viewTransformer instanceof LensTransformer) { p = multiLayerTransformer.transform(p); } else if (layoutTransformer instanceof LensTransformer) { LayoutModel<N> layoutModel = model.getLayoutModel(); Dimension d = new Dimension(layoutModel.getWidth(), layoutModel.getHeight()); HyperbolicShapeTransformer shapeChanger = new HyperbolicShapeTransformer(d, viewTransformer); LensTransformer lensTransformer = (LensTransformer) layoutTransformer; shapeChanger.getLens().setLensShape(lensTransformer.getLens().getLensShape()); MutableTransformer layoutDelegate = ((MutableTransformerDecorator) layoutTransformer).getDelegate(); p = shapeChanger.transform(layoutDelegate.transform(p)); } else { p = multiLayerTransformer.transform(Layer.LAYOUT, p); } return p; }
Source:
public TemplateScheduledPushPayload build() { Preconditions.checkArgument( audience != null && deviceTypes != null && mergeData != null, "audience, deviceTypes, and mergeData cannot be null." ); return new TemplateScheduledPushPayload(this); }

Target:
public TemplateScheduledPushPayload build() { Preconditions.checkArgument( audience != null && deviceTypes != null && mergeData != null && schedule != null, "audience, deviceTypes, mergeData and schedule cannot be null." ); return new TemplateScheduledPushPayload(this); }
Source:
public static Slice stCentroid(@SqlType(GEOMETRY_TYPE_NAME) Slice input) { OGCGeometry geometry = deserialize(input); validateType("ST_Centroid", geometry, EnumSet.of(POINT, MULTI_POINT, LINE_STRING, MULTI_LINE_STRING, POLYGON, MULTI_POLYGON)); GeometryType typeName = GeometryUtils.valueOf(geometry.geometryType()); if (typeName == POINT) { return input; } int pointCount = ((MultiVertexGeometry) geometry.getEsriGeometry()).getPointCount(); if (pointCount == 0) { return serialize(createFromEsriGeometry(new Point(), geometry.getEsriSpatialReference())); } Point centroid; switch (typeName) { case MULTI_POINT: centroid = computePointsCentroid((MultiVertexGeometry) geometry.getEsriGeometry()); break; case LINE_STRING: case MULTI_LINE_STRING: centroid = computeLineCentroid((Polyline) geometry.getEsriGeometry()); break; case POLYGON: centroid = computePolygonCentroid((Polygon) geometry.getEsriGeometry()); break; case MULTI_POLYGON: centroid = computeMultiPolygonCentroid((OGCMultiPolygon) geometry); break; default: throw new PrestoException(INVALID_FUNCTION_ARGUMENT, "Invalid typeName: " + typeName); } return serialize(createFromEsriGeometry(centroid, geometry.getEsriSpatialReference())); }

Target:
public static Slice stCentroid(@SqlType(GEOMETRY_TYPE_NAME) Slice input) { OGCGeometry geometry = deserialize(input); validateType("ST_Centroid", geometry, EnumSet.of(POINT, MULTI_POINT, LINE_STRING, MULTI_LINE_STRING, POLYGON, MULTI_POLYGON)); GeometryType geometryType = GeometryType.getForEsriGeometryType(geometry.geometryType()); if (geometryType == POINT) { return input; } int pointCount = ((MultiVertexGeometry) geometry.getEsriGeometry()).getPointCount(); if (pointCount == 0) { return serialize(createFromEsriGeometry(new Point(), geometry.getEsriSpatialReference())); } Point centroid; switch (geometryType) { case MULTI_POINT: centroid = computePointsCentroid((MultiVertexGeometry) geometry.getEsriGeometry()); break; case LINE_STRING: case MULTI_LINE_STRING: centroid = computeLineCentroid((Polyline) geometry.getEsriGeometry()); break; case POLYGON: centroid = computePolygonCentroid((Polygon) geometry.getEsriGeometry()); break; case MULTI_POLYGON: centroid = computeMultiPolygonCentroid((OGCMultiPolygon) geometry); break; default: throw new PrestoException(INVALID_FUNCTION_ARGUMENT, "Unexpected geometry type: " + geometryType); } return serialize(createFromEsriGeometry(centroid, geometry.getEsriSpatialReference())); }
Source:
public void testLuceneWildcardsAreEscaped() { QueryFactory qf = getQueryFactory(); Query q = qf.from(getModelFactory().getUserImplClass()) .having("name").like("J%n").toBuilder() .build(); assertEquals(1, q.list().size()); q = qf.from(getModelFactory().getUserImplClass()) .having("name").like("J*n").toBuilder() .build(); q = qf.from(getModelFactory().getUserImplClass()) .having("name").like("Jo_n").toBuilder() .build(); assertEquals(1, q.list().size()); q = qf.from(getModelFactory().getUserImplClass()) .having("name").like("Jo?n").toBuilder() .build(); assertEquals(0, q.list().size()); }

Target:
public void testLuceneWildcardsAreEscaped() { QueryFactory qf = getQueryFactory(); Query q1 = qf.from(getModelFactory().getUserImplClass()) .having("name").like("J%n").toBuilder() .build(); assertEquals(1, q1.list().size()); Query q2 = qf.from(getModelFactory().getUserImplClass()) .having("name").like("J*n").toBuilder() .build(); assertEquals(0, q2.list().size()); Query q3 = qf.from(getModelFactory().getUserImplClass()) .having("name").like("Jo_n").toBuilder() .build(); assertEquals(1, q3.list().size()); Query q4 = qf.from(getModelFactory().getUserImplClass()) .having("name").like("Jo?n").toBuilder() .build(); assertEquals(0, q4.list().size()); }
Source:
private final void endAssociation(int xaState, int txInfoState) throws XAException { if (_doEnd && _theTransaction != null) { _theTransaction.endAssociation(_tranID, _theXAResource, xaState, txInfoState); } }

Target:
private final void endAssociation(int xaState, int txInfoState) throws XAException { if (_theTransaction != null) { _theTransaction.endAssociation(_tranID, _theXAResource, xaState, txInfoState); } }