auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private static void browsePostOrPageEx( Context context, SiteModel site, PostModel post, RemotePreviewType remotePreviewType) { if (site == null || post == null || TextUtils.isEmpty(post.getLink())) { return; } if (remotePreviewType == RemotePreviewType.REMOTE_PREVIEW_WITH_REMOTE_AUTO_SAVE && TextUtils.isEmpty(post.getAutoSavePreviewUrl())) { return; } String url = PostUtils.getPreviewUrlForPost(remotePreviewType, post); String shareableUrl = post.getLink(); String shareSubject = post.getTitle(); boolean startPreviewForResult = remotePreviewType != RemotePreviewType.NOT_A_REMOTE_PREVIEW; if (site.isWPCom()) { WPWebViewActivity.openPostUrlByUsingGlobalWPCOMCredentials( context, url, shareableUrl, shareSubject, true, startPreviewForResult); } else if (site.isJetpackConnected() && !TextUtils.isEmpty(site.getFrameNonce())) { WPWebViewActivity .openJetpackBlogPostPreview( context, url, shareableUrl, shareSubject, site.getFrameNonce(), true, startPreviewForResult); } else { WPWebViewActivity.openUrlByUsingBlogCredentials( context, site, post, url, new String[]{post.getLink()}, true, true, startPreviewForResult); } }

Target:
private static void browsePostOrPageEx( Context context, SiteModel site, PostModel post, RemotePreviewType remotePreviewType) { if (site == null || post == null || TextUtils.isEmpty(post.getLink())) { return; } if (remotePreviewType == RemotePreviewType.REMOTE_PREVIEW_WITH_REMOTE_AUTO_SAVE && TextUtils.isEmpty(post.getAutoSavePreviewUrl())) { return; } String url = PostUtils.getPreviewUrlForPost(remotePreviewType, post); String shareableUrl = post.getLink(); String shareSubject = post.getTitle(); boolean startPreviewForResult = remotePreviewType != RemotePreviewType.NOT_A_REMOTE_PREVIEW; if (site.isWPCom()) { WPWebViewActivity.openPostUrlByUsingGlobalWPCOMCredentials( context, url, shareableUrl, shareSubject, true, startPreviewForResult); } else if (site.isJetpackConnected() && site.isUsingWpComRestApi()) { WPWebViewActivity .openJetpackBlogPostPreview( context, url, shareableUrl, shareSubject, site.getFrameNonce(), true, startPreviewForResult); } else { WPWebViewActivity.openUrlByUsingBlogCredentials( context, site, post, url, new String[]{post.getLink()}, true, true, startPreviewForResult); } }
Source:
public Surface<Double, Double, Pair<Double, DoubleMatrix1D>> getVolAndParameterSensitivitySurface(final DoubleMatrix1D modelParameters) { final BasisFunctionAggregation<double[]> bSpline = new BasisFunctionAggregation<>(_bSplines, modelParameters.getData()); final Function2D<Double, Pair<Double, DoubleMatrix1D>> func = new Function2D<Double, Pair<Double, DoubleMatrix1D>>() { @Override public Pair<Double, DoubleMatrix1D> evaluate(final Double t, final Double k) { return bSpline.valueAndWeightSensitivity(new double[] {t, k }); } }; return new FunctionalSurface<>(func); }

Target:
public Surface<Double, Double, Pair<Double, DoubleMatrix1D>> getVolAndParameterSensitivitySurface(final DoubleMatrix1D modelParameters) { ArgumentChecker.notNull(modelParameters, "modelParameters"); final BasisFunctionAggregation<double[]> bSpline = new BasisFunctionAggregation<>(_bSplines, modelParameters.getData()); final Function2D<Double, Pair<Double, DoubleMatrix1D>> func = new Function2D<Double, Pair<Double, DoubleMatrix1D>>() { @Override public Pair<Double, DoubleMatrix1D> evaluate(final Double t, final Double k) { return bSpline.valueAndWeightSensitivity(new double[] {t, k }); } }; return new FunctionalSurface<>(func); }
Source:
public FsckError check(ProgressMonitor pm) throws IOException { if (pm == null) { pm = NullProgressMonitor.INSTANCE; } FsckError errors = new FsckError(); if (!connectivityOnly) { checkPacks(pm, errors); } checkConnectivity(pm, errors); objChecker.reset(); return errors; }

Target:
public FsckError check(ProgressMonitor pm) throws IOException { if (pm == null) { pm = NullProgressMonitor.INSTANCE; } FsckError errors = new FsckError(); if (!connectivityOnly) { objChecker.reset(); checkPacks(pm, errors); } checkConnectivity(pm, errors); return errors; }
Source:
public synchronized ContainerAccess getContainerAccess(String container) { Path path = new File(buildPathStartingFromBaseDir(container)).toPath(); if ( System.getProperty("os.name", "").toLowerCase().contains("windows") ) { UserPrincipal everyone = null; try { everyone = getDefault().getUserPrincipalLookupService() .lookupPrincipalByName("Everyone"); } catch (IOException e) { throw new RuntimeException(e); } AclFileAttributeView aclFileAttributes = java.nio.file.Files.getFileAttributeView( path, AclFileAttributeView.class); try { for (AclEntry aclEntry : aclFileAttributes.getAcl()) { if (aclEntry.principal().equals(everyone)) { return ContainerAccess.PUBLIC_READ; } } return ContainerAccess.PRIVATE; } catch (IOException e) { throw new RuntimeException(e); } } else { Set<PosixFilePermission> permissions; try { permissions = getPosixFilePermissions(path); } catch (IOException ioe) { throw Throwables.propagate(ioe); } return permissions.contains(PosixFilePermission.OTHERS_READ) ? ContainerAccess.PUBLIC_READ : ContainerAccess.PRIVATE; } }

Target:
public ContainerAccess getContainerAccess(String container) { Path path = new File(buildPathStartingFromBaseDir(container)).toPath(); if ( isWindows() ) { try { if (isPrivate(path)) { return ContainerAccess.PRIVATE; } else { return ContainerAccess.PUBLIC_READ; } } catch (IOException e) { throw new RuntimeException(e); } } else { Set<PosixFilePermission> permissions; try { permissions = getPosixFilePermissions(path); } catch (IOException ioe) { throw Throwables.propagate(ioe); } return permissions.contains(PosixFilePermission.OTHERS_READ) ? ContainerAccess.PUBLIC_READ : ContainerAccess.PRIVATE; } }
Source:
public void changeUserPasswordUsingActivationKey_shouldUpdatePasswordIfActivationKeyIsCorrect() { User u = new User(); u.setPerson(new Person()); u.addName(new PersonName("Benjamin", "A", "Wolfe")); u.setUsername("bwolfe"); u.getPerson().setGender("M"); User createdUser = userService.createUser(u, "Openmr5xy"); String key = "h4ph0fpNzQCIPSw8plJI"; int validTime = 10 * 60 * 1000; Long tokenTime = System.currentTimeMillis() + validTime; LoginCredential credentials = dao.getLoginCredential(createdUser); credentials.setActivationKey( "b071c88d6d877922e35af2e6a90dd57d37ac61143a03bb986c5f353566f3972a86ce9b2604c31a22dfa467922dcfd54fa7d18b0a7c7648d94ca3d97a88ea2fd0:" + tokenTime); dao.updateLoginCredential(credentials); assertFalse(createdUser.hasPrivilege(PrivilegeConstants.EDIT_USER_PASSWORDS)); Context.authenticate(createdUser.getUsername(), "Openmr5xy"); userService.changeUserPasswordUsingActivationKey(key, "Admin123"); Context.authenticate(createdUser.getUsername(), "Admin123"); }

Target:
public void changeUserPasswordUsingActivationKey_shouldUpdatePasswordIfActivationKeyIsCorrect() { User u = new User(); u.setPerson(new Person()); u.addName(new PersonName("Benjamin", "A", "Wolfe")); u.setUsername("bwolfe"); u.getPerson().setGender("M"); User createdUser = userService.createUser(u, "Openmr5xy"); String key = "h4ph0fpNzQCIPSw8plJI"; int validTime = 10 * 60 * 1000; Long tokenTime = System.currentTimeMillis() + validTime; LoginCredential credentials = dao.getLoginCredential(createdUser); credentials.setActivationKey( "b071c88d6d877922e35af2e6a90dd57d37ac61143a03bb986c5f353566f3972a86ce9b2604c31a22dfa467922dcfd54fa7d18b0a7c7648d94ca3d97a88ea2fd0:" + tokenTime); dao.updateLoginCredential(credentials); Context.authenticate(createdUser.getUsername(), "Openmr5xy"); userService.changeUserPasswordUsingActivationKey(key, "Admin123"); Context.authenticate(createdUser.getUsername(), "Admin123"); }
Source:
public Credentials.IdentityProvider getProvider() { String nativeProvider = nativeGetProvider(nativePtr); String id = identityProvider.getId(); if (nativeProvider.equals(id)) { return identityProvider; } else { throw new AssertionError("The provider from the Object Store differs from the one in Realm."); } }

Target:
public String getProvider() { return nativeGetProvider(nativePtr); }
Source:
private void sizeCheck() { long minRecordToWait = Long.MAX_VALUE; long maxUnwrittenRows = 0; int pageRowCountLimit = props.getPageRowCountLimit(); for (ColumnWriterBase writer : columns.values()) { long usedMem = writer.getCurrentPageBufferedSize(); long rows = rowCount - writer.getRowsWrittenSoFar(); long remainingMem = props.getPageSizeThreshold() - usedMem; long actualPageRowCount = rowCount - writer.getRowsWrittenSoFar(); if (remainingMem <= thresholdTolerance || actualPageRowCount >= pageRowCountLimit) { writer.writePage(); remainingMem = props.getPageSizeThreshold(); } else if (actualPageRowCount > maxUnwrittenRows) { maxUnwrittenRows = actualPageRowCount; } long rowsToFillPage = usedMem == 0 ? props.getMaxRowCountForPageSizeCheck() : (long) ((float) rows) / usedMem * remainingMem; if (rowsToFillPage < minRecordToWait) { minRecordToWait = rowsToFillPage; } } if (minRecordToWait == Long.MAX_VALUE) { minRecordToWait = props.getMinRowCountForPageSizeCheck(); } if (props.estimateNextSizeCheck()) { rowCountForNextSizeCheck = rowCount + min( max(minRecordToWait / 2, props.getMinRowCountForPageSizeCheck()), props.getMaxRowCountForPageSizeCheck()); } else { rowCountForNextSizeCheck = rowCount + props.getMinRowCountForPageSizeCheck(); } long rowCountForNextRowCountCheck = rowCount + pageRowCountLimit - maxUnwrittenRows; if (rowCountForNextRowCountCheck < rowCountForNextSizeCheck) { rowCountForNextSizeCheck = rowCountForNextRowCountCheck; } }

Target:
private void sizeCheck() { long minRecordToWait = Long.MAX_VALUE; int pageRowCountLimit = props.getPageRowCountLimit(); long rowCountForNextRowCountCheck = rowCount + pageRowCountLimit; for (ColumnWriterBase writer : columns.values()) { long usedMem = writer.getCurrentPageBufferedSize(); long rows = rowCount - writer.getRowsWrittenSoFar(); long remainingMem = props.getPageSizeThreshold() - usedMem; if (remainingMem <= thresholdTolerance || rows >= pageRowCountLimit) { writer.writePage(); remainingMem = props.getPageSizeThreshold(); } else { rowCountForNextRowCountCheck = min(rowCountForNextRowCountCheck, rowCount + (pageRowCountLimit - rows)); } long rowsToFillPage = usedMem == 0 ? props.getMaxRowCountForPageSizeCheck() : (long) ((float) rows) / usedMem * remainingMem; if (rowsToFillPage < minRecordToWait) { minRecordToWait = rowsToFillPage; } } if (minRecordToWait == Long.MAX_VALUE) { minRecordToWait = props.getMinRowCountForPageSizeCheck(); } if (props.estimateNextSizeCheck()) { rowCountForNextSizeCheck = rowCount + min( max(minRecordToWait / 2, props.getMinRowCountForPageSizeCheck()), props.getMaxRowCountForPageSizeCheck()); } else { rowCountForNextSizeCheck = rowCount + props.getMinRowCountForPageSizeCheck(); } if (rowCountForNextRowCountCheck < rowCountForNextSizeCheck) { rowCountForNextSizeCheck = rowCountForNextRowCountCheck; } }
Source:
public final void assertEventsMatchLooselyInOrder(Condition<? super Event>... conditions) { Preconditions.notNull(conditions, "conditions must not be null"); assertEventsMatchLooselyInOrder(this.events, conditions); }

Target:
public final void assertEventsMatchLooselyInOrder(Condition<? super Event>... conditions) { Preconditions.notNull(conditions, "conditions must not be null"); Preconditions.containsNoNullElements(conditions, "conditions must not contain null elements"); assertEventsMatchLooselyInOrder(this.events, conditions); }
Source:
public void testWriteHeaderTwice() throws IOException { final File bcfOutputFile = File.createTempFile("testWriteAndReadVCF.", ".bcf", tempDir); Tribble.indexFile(bcfOutputFile); final SAMSequenceDictionary sequenceDict = createArtificialSequenceDictionary(); final VCFHeader header = createFakeHeader(sequenceDict); final VariantContextWriter writer1 = new VariantContextWriterBuilder() .setOutputFile(bcfOutputFile).setReferenceDictionary(sequenceDict) .build(); writer1.writeHeader(header); writer1.writeHeader(header); writer1.close(); }

Target:
public void testWriteHeaderTwice() throws IOException { final File bcfOutputFile = File.createTempFile("testWriteAndReadVCF.", ".bcf", tempDir); bcfOutputFile.deleteOnExit(); final VCFHeader header = createFakeHeader(); try (final VariantContextWriter writer = new VariantContextWriterBuilder() .setOutputFile(bcfOutputFile).setReferenceDictionary(header.getSequenceDictionary()) .unsetOption(Options.INDEX_ON_THE_FLY) .build()) { writer.writeHeader(header); writer.writeHeader(header); } }
Source:
public Task(Context context) { super(context); if (context instanceof TaskProcessCallback) { setTaskProcessCallback((TaskProcessCallback) context); } }

Target:
public Task(Context context) { this(context, Type.LOADING_NON_CACHED); }
Source:
public <E> void setList(String fieldName, RealmList<E> list) { proxyState.getRealm$realm().checkIfValid(); if (list == null) { throw new IllegalArgumentException("Non-null 'list' required"); } long columnIndex = proxyState.getRow$realm().getColumnIndex(fieldName); final RealmFieldType columnType = proxyState.getRow$realm().getColumnType(columnIndex); switch (columnType) { case LIST: setModelList(fieldName, (RealmList<DynamicRealmObject>) list); break; case INTEGER_LIST: case BOOLEAN_LIST: case STRING_LIST: case BINARY_LIST: case DATE_LIST: case FLOAT_LIST: case DOUBLE_LIST: setValueList(fieldName, list, columnType); break; default: throw new IllegalArgumentException(String.format("Field '%s' is not a list but a %s", fieldName, columnType)); } }

Target:
public <E> void setList(String fieldName, RealmList<E> list) { proxyState.getRealm$realm().checkIfValid(); if (list == null) { throw new IllegalArgumentException("Non-null 'list' required"); } long columnIndex = proxyState.getRow$realm().getColumnIndex(fieldName); final RealmFieldType columnType = proxyState.getRow$realm().getColumnType(columnIndex); switch (columnType) { case LIST: if (!list.isEmpty()) { E element = list.first(); if (!(element instanceof DynamicRealmObject) && RealmModel.class.isAssignableFrom(element.getClass())) { throw new IllegalArgumentException("RealmList must contain `DynamicRealmObject's, not Java model classes."); } } setModelList(fieldName, (RealmList<DynamicRealmObject>) list); break; case INTEGER_LIST: case BOOLEAN_LIST: case STRING_LIST: case BINARY_LIST: case DATE_LIST: case FLOAT_LIST: case DOUBLE_LIST: setValueList(fieldName, list, columnType); break; default: throw new IllegalArgumentException(String.format("Field '%s' is not a list but a %s", fieldName, columnType)); } }
Source:
public String getSourceAttributeFriendlyName() { return "eduPersonEntitlement"; }

Target:
public String getSourceAttributeFriendlyName() { return "entitlement"; }
Source:
private Object toPrestoValue(Object tpchValue, Type columnType) { if (columnType instanceof VarcharType) { return Slices.utf8Slice((String) tpchValue); } else if (tpchValue instanceof String && columnType.equals(DATE)) { return LocalDate.parse((CharSequence) tpchValue).toEpochDay(); } if (columnType.equals(BIGINT) || columnType.equals(INTEGER) || columnType.equals(DATE)) { return ((Number) tpchValue).longValue(); } if (columnType.equals(DOUBLE)) { return ((Number) tpchValue).doubleValue(); } throw new IllegalArgumentException("unsupported column type " + columnType); }

Target:
private Object toPrestoValue(Object tpchValue, Type columnType) { if (columnType instanceof VarcharType) { return Slices.utf8Slice((String) tpchValue); } if (columnType.equals(BIGINT) || columnType.equals(INTEGER) || columnType.equals(DATE)) { return ((Number) tpchValue).longValue(); } if (columnType.equals(DOUBLE)) { return ((Number) tpchValue).doubleValue(); } throw new IllegalArgumentException("unsupported column type " + columnType); }
Source:
public Token<OzoneTokenIdentifier> getDelegationToken(Text renewer) throws OMException { Token<OzoneTokenIdentifier> token; try { if (!isAllowedDelegationTokenOp()) { throw new OMException("Delegation Token can be issued only with " + "kerberos or web authentication", INVALID_AUTH_METHOD); } if (delegationTokenMgr == null || !delegationTokenMgr.isRunning()) { LOG.warn("trying to get DT with no secret manager running in OM."); return null; } UserGroupInformation ugi = getRemoteUser(); String user = ugi.getUserName(); Text owner = new Text(user); Text realUser = null; if (ugi.getRealUser() != null) { realUser = new Text(ugi.getRealUser().getUserName()); } token = delegationTokenMgr.createToken(owner, renewer, realUser); LOG.debug("OmDelegationToken: created.", token); return token; } catch (OMException oex) { throw oex; } catch (IOException ex) { LOG.error("Get Delegation token failed, cause: {}", ex.getMessage()); throw new OMException("Get Delegation token failed.", ex, TOKEN_ERROR_OTHER); } }

Target:
public Token<OzoneTokenIdentifier> getDelegationToken(Text renewer) throws OMException { Token<OzoneTokenIdentifier> token; try { if (!isAllowedDelegationTokenOp()) { throw new OMException("Delegation Token can be issued only with " + "kerberos or web authentication", INVALID_AUTH_METHOD); } if (delegationTokenMgr == null || !delegationTokenMgr.isRunning()) { LOG.warn("trying to get DT with no secret manager running in OM."); return null; } UserGroupInformation ugi = getRemoteUser(); String user = ugi.getUserName(); Text owner = new Text(user); Text realUser = null; if (ugi.getRealUser() != null) { realUser = new Text(ugi.getRealUser().getUserName()); } return delegationTokenMgr.createToken(owner, renewer, realUser); } catch (OMException oex) { throw oex; } catch (IOException ex) { LOG.error("Get Delegation token failed, cause: {}", ex.getMessage()); throw new OMException("Get Delegation token failed.", ex, TOKEN_ERROR_OTHER); } }
Source:
Type getExtractedType() { return extractedType; }

Target:
public Type getExtractedType() { return extractedType; }
Source:
public IStatus validate(IValidationContext ctx) { RTConnector target = (RTConnector) ctx.getTarget(); Connector connector = target.getBase_Connector(); if (connector.getEnds().size() == 2) { Port port1 = (Port) connector.getEnds().get(0).getRole(); Port port2 = (Port) connector.getEnds().get(1).getRole(); if (!port1.getType().equals(port2.getType())) { return ctx.createFailureStatus("Ports must be typed with compatible protocol."); } if (connector.getKind().equals(ConnectorKind.ASSEMBLY_LITERAL)) { if (!(port1.isConjugated() ^ port2.isConjugated())) { return ctx.createFailureStatus("Assembly connector must have different conjugation between connected ports."); } } else { if (port1.isConjugated() != port2.isConjugated()) { return ctx.createFailureStatus("Delegation connector must have same conjugation between connected ports."); } } } return ctx.createSuccessStatus(); }

Target:
public IStatus validate(IValidationContext ctx) { RTConnector target = (RTConnector) ctx.getTarget(); Connector connector = target.getBase_Connector(); if (connector.getEnds().size() == 2) { Port port1 = (Port) connector.getEnds().get(0).getRole(); Port port2 = (Port) connector.getEnds().get(1).getRole(); String arg = "'" + port1.getQualifiedName() + "' and '" + port2.getQualifiedName() + "'"; if (!port1.getType().equals(port2.getType())) { return ctx.createFailureStatus(arg, "Ports must be typed with compatible protocol."); } if (connector.getKind().equals(ConnectorKind.ASSEMBLY_LITERAL)) { if (port1.isConjugated() == port2.isConjugated()) { return ctx.createFailureStatus(arg, "Assembly connector must have different conjugation between connected ports."); } } else { if (port1.isConjugated() != port2.isConjugated()) { return ctx.createFailureStatus(arg, "Delegation connector must have same conjugation between connected ports."); } } } return ctx.createSuccessStatus(); }
Source:
public void test_register() { ApplicationRegistrator registrator = mock(ApplicationRegistrator.class); RegistrationApplicationListener listener = new RegistrationApplicationListener(registrator); TaskScheduler scheduler = mock(ThreadPoolTaskScheduler.class); ReflectionTestUtils.setField(listener, "taskScheduler", scheduler); listener.onApplicationReady(new ApplicationReadyEvent(mock(SpringApplication.class), null, mock(ConfigurableWebApplicationContext.class))); verify(scheduler).scheduleAtFixedRate(isA(Runnable.class), eq(Duration.ofSeconds(10))); }

Target:
public void test_register() { ApplicationRegistrator registrator = mock(ApplicationRegistrator.class); ThreadPoolTaskScheduler scheduler = mock(ThreadPoolTaskScheduler.class); RegistrationApplicationListener listener = new RegistrationApplicationListener(registrator, scheduler); listener.onApplicationReady(new ApplicationReadyEvent(mock(SpringApplication.class), null, mock(ConfigurableWebApplicationContext.class))); verify(scheduler).scheduleAtFixedRate(isA(Runnable.class), eq(Duration.ofSeconds(10))); }
Source:
default GarbageCollectionStatus getGarbageCollectionStatus() { return null; }

Target:
default List<GarbageCollectionStatus> getGarbageCollectionStatus() { return Collections.emptyList(); }
Source:
protected InputStream openFile(Path path) throws IOException { InputStream is = super.openFile(path); if (is != null) { try { DatumReader<GenericRecord> datumReader = new GenericDatumReader<GenericRecord>(); avroDataStream = new DataFileStream<GenericRecord>(is, datumReader); datumReader.setSchema(avroDataStream.getSchema()); return is; } catch (NullPointerException npe) { LOG.error("Schemaless file - " + npe.getMessage()); } } return null; }

Target:
protected InputStream openFile(Path path) throws IOException { InputStream is = super.openFile(path); if (is != null) { DatumReader<GenericRecord> datumReader = new GenericDatumReader<GenericRecord>(); avroDataStream = new DataFileStream<GenericRecord>(is, datumReader); datumReader.setSchema(avroDataStream.getSchema()); } return is; }
Source:
public DocumentRevisionTree add(BasicDocumentRevision documentRevision) { Preconditions.checkArgument(!sequenceMap.containsKey(documentRevision.getSequence()), "The revision must not be added to the tree before."); if(documentNumericId == -1l && docId == null){ documentNumericId = documentRevision.getInternalNumericId(); docId = documentRevision.getId(); } else if (documentRevision.getInternalNumericId() != documentNumericId || !documentRevision.getId().equals(docId)) { throw new IllegalArgumentException("Document revision is not part of the same tree"); } if(documentRevision.getParent() <= 0) { addRootDBObject(documentRevision); } else { addNode(documentRevision); } return this; }

Target:
public DocumentRevisionTree add(BasicDocumentRevision documentRevision) { Preconditions.checkArgument(!sequenceMap.containsKey(documentRevision.getSequence()), "The revision must not be added to the tree before."); if(documentNumericId == -1l && docId == null){ documentNumericId = documentRevision.getInternalNumericId(); docId = documentRevision.getId(); } else if (!(documentRevision.getInternalNumericId() == documentNumericId || documentRevision.getId().equals(docId))) { throw new IllegalArgumentException("Document revision is not part of the same tree"); } if(documentRevision.getParent() <= 0) { addRootDBObject(documentRevision); } else { addNode(documentRevision); } return this; }
Source:
public void setUp() throws Exception { super.setUp(); siteService = ContentServiceFactory.getInstance().getSiteService(); alwaysTrue = authorizationFeatureService.find(AlwaysTrueFeature.NAME); alwaysFalse = authorizationFeatureService.find(AlwaysFalseFeature.NAME); alwaysException = authorizationFeatureService.find(AlwaysThrowExceptionFeature.NAME); trueForAdmins = authorizationFeatureService.find(TrueForAdminsFeature.NAME); trueForLoggedUsers = authorizationFeatureService.find(TrueForLoggedUsersFeature.NAME); trueForTestUsers = authorizationFeatureService.find(TrueForTestUsersFeature.NAME); trueForUsersInGroupTest = authorizationFeatureService.find(TrueForUsersInGroupTestFeature.NAME); loginOnBehalfOf = authorizationFeatureService.find(LoginOnBehalfOfFeature.NAME); }

Target:
public void setUp() throws Exception { super.setUp(); siteService = ContentServiceFactory.getInstance().getSiteService(); alwaysTrue = authorizationFeatureService.find(AlwaysTrueFeature.NAME); alwaysFalse = authorizationFeatureService.find(AlwaysFalseFeature.NAME); alwaysException = authorizationFeatureService.find(AlwaysThrowExceptionFeature.NAME); trueForAdmins = authorizationFeatureService.find(TrueForAdminsFeature.NAME); trueForLoggedUsers = authorizationFeatureService.find(TrueForLoggedUsersFeature.NAME); trueForTestUsers = authorizationFeatureService.find(TrueForTestUsersFeature.NAME); trueForUsersInGroupTest = authorizationFeatureService.find(TrueForUsersInGroupTestFeature.NAME); }
Source:
public void valueOutOfUpperRange() { initConfiguredRange(); Set<ConstraintViolation<ConfiguredRangeContainer>> validate = validate(new ConfiguredRangeContainer(TEST_OUT_OF_UPPER_RANGE)); Assert.assertTrue(validate.size() > 0); }

Target:
public void valueOutOfUpperRange() { initConfiguredRange(); validateAndAssertResult(new ConfiguredRangeContainer(TEST_OUT_OF_UPPER_RANGE), false); }
Source:
private void awaitDisablingPartition() throws InterruptedException { Properties properties = new Properties(); properties.setProperty("helix.property.store.root.path", "/" + clusterName + "/" + PROPERTYSTORE_STR); HelixPropertyStoreConfig propertyStoreConfig = new HelixPropertyStoreConfig(new VerifiableProperties(properties)); HelixPropertyStore<ZNRecord> helixPropertyStore = CommonUtils.createHelixPropertyStore(zkConnectStr, propertyStoreConfig, null); String path = PARTITION_DISABLED_ZNODE_PATH + instanceName; int count = 1; while (!helixPropertyStore.exists(path, AccessOption.PERSISTENT)) { Thread.sleep(clusterMapConfig.clustermapRetryDisablePartitionCompletionBackoffMs); logger.info("{} th attempt on checking the completion of disabling partition.", ++count); } }

Target:
private void awaitDisablingPartition() throws InterruptedException { Properties properties = new Properties(); properties.setProperty("helix.property.store.root.path", "/" + clusterName + "/" + PROPERTYSTORE_STR); HelixPropertyStoreConfig propertyStoreConfig = new HelixPropertyStoreConfig(new VerifiableProperties(properties)); HelixPropertyStore<ZNRecord> helixPropertyStore = CommonUtils.createHelixPropertyStore(zkConnectStr, propertyStoreConfig, null); String path = PARTITION_DISABLED_ZNODE_PATH + instanceName; int count = 1; while (helixPropertyStore.exists(path, AccessOption.PERSISTENT)) { Thread.sleep(clusterMapConfig.clustermapRetryDisablePartitionCompletionBackoffMs); logger.info("{} th attempt on checking the completion of disabling partition.", ++count); } helixPropertyStore.stop(); }
Source:
public GiantAlbatross(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{U}"); this.subtype.add(SubType.BIRD); this.power = new MageInt(1); this.toughness = new MageInt(1); this.addAbility(FlyingAbility.getInstance()); Ability ability = new DiesTriggeredAbility(new DoIfCostPaid(new GiantAlbatrossEffect(), new ManaCostsImpl("{1}{U}"))); DealtDamageToWatcher watcher = new DealtDamageToWatcher(); watcher.setSourceId(this.objectId); ability.addWatcher(watcher); this.addAbility(ability); }

Target:
public GiantAlbatross(UUID ownerId, CardSetInfo setInfo) { super(ownerId, setInfo, new CardType[]{CardType.CREATURE}, "{1}{U}"); this.subtype.add(SubType.BIRD); this.power = new MageInt(1); this.toughness = new MageInt(1); this.addAbility(FlyingAbility.getInstance()); Ability ability = new DiesTriggeredAbility(new DoIfCostPaid(new GiantAlbatrossEffect(), new ManaCostsImpl("{1}{U}"))); this.addAbility(ability); }
Source:
protected CmdBase(String cmdName, ServerConfiguration conf, JCommander commander) { this.conf = conf; this.commander = commander; this.commander.setProgramName("bookie-shell " + cmdName); }

Target:
protected CmdBase(String cmdName, ServerConfiguration conf, JCommander commander) { this.conf = conf; this.commander = commander; this.commander.setProgramName("bookkeeper-cli " + cmdName); }
Source:
String getFilename(Object object) { String suffix = ""; if (object instanceof Error) { Error error = (Error) object; Object duration = error.getAppData().get("duration"); if (duration instanceof Number && isStartupCrash(((Number) error.getAppData().get("duration")).longValue())) { suffix = STARTUP_CRASH; } } else { suffix = "not-jvm"; } return String.format(Locale.US, "%s%d_%s%s.json", storeDirectory, System.currentTimeMillis(), UUID.randomUUID().toString(), suffix); }

Target:
String getFilename(Object object) { String suffix = ""; if (object instanceof Error) { Error error = (Error) object; Map<String, Object> appData = error.getAppData(); if (appData instanceof Map) { Object duration = appData.get("duration"); if (duration instanceof Number && isStartupCrash(((Number) appData.get("duration")).longValue())) { suffix = STARTUP_CRASH; } } } else { suffix = "not-jvm"; } return String.format(Locale.US, "%s%d_%s%s.json", storeDirectory, System.currentTimeMillis(), UUID.randomUUID().toString(), suffix); }
Source:
protected void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); outState.putString(SIS_KEY_AUTH_STATE_NONCE, mAuthStateNonce); outState.putSerializable(SIS_KEY_PKCE_MANAGER, mPKCEManager); }

Target:
protected void onSaveInstanceState(Bundle outState) { super.onSaveInstanceState(outState); outState.putString(SIS_KEY_AUTH_STATE_NONCE, mAuthStateNonce); outState.putString(SIS_KEY_PKCE_CODE_VERIFIER, mPKCEManager.getCodeVerifier()); }
Source:
private InputStream getHistoryRev(String fullpath, String rev) { InputStream ret = null; File directory = new File(directoryName); Process process = null; try { String filename = (new File(parent, fullpath)).getCanonicalPath() .substring(directoryName.length() + 1); ensureCommand(CMD_PROPERTY_KEY, CMD_FALLBACK); String argv[] = { RepoCommand, "show", rev + ":" + filename }; process = Runtime.getRuntime().exec(argv, null, directory); ByteArrayOutputStream out = new ByteArrayOutputStream(); byte[] buffer = new byte[32 * 1024]; try (InputStream in = process.getInputStream()) { int len; while ((len = in.read(buffer)) != -1) { if (len > 0) { out.write(buffer, 0, len); } } } if (process.waitFor() == 0) { ret = new ByteArrayInputStream(out.toByteArray()); } else { ret = null; } } catch (Exception exp) { LOGGER.log(Level.SEVERE, "Failed to get history: " + exp.getClass().toString(), exp); } finally { if (process != null) { try { process.exitValue(); } catch (IllegalThreadStateException exp) { process.destroy(); } } } return ret; }

Target:
private InputStream getHistoryRev(String fullpath, String rev) { InputStream ret = null; File directory = new File(directoryName); Process process = null; try { String filename = fullpath.substring(directoryName.length() + 1); ensureCommand(CMD_PROPERTY_KEY, CMD_FALLBACK); String argv[] = { RepoCommand, "show", rev + ":" + filename }; process = Runtime.getRuntime().exec(argv, null, directory); ByteArrayOutputStream out = new ByteArrayOutputStream(); byte[] buffer = new byte[32 * 1024]; try (InputStream in = process.getInputStream()) { int len; while ((len = in.read(buffer)) != -1) { if (len > 0) { out.write(buffer, 0, len); } } } if (process.waitFor() == 0) { ret = new ByteArrayInputStream(out.toByteArray()); } else { ret = null; } } catch (Exception exp) { LOGGER.log(Level.SEVERE, "Failed to get history: " + exp.getClass().toString(), exp); } finally { if (process != null) { try { process.exitValue(); } catch (IllegalThreadStateException exp) { process.destroy(); } } } return ret; }
Source:
public synchronized void setMetadata(String metadata) { this.metadata = metadata; eraseEntityDescriptions(); }

Target:
public void setMetadata(String metadata) { this.metadata = metadata; entityData.getAndSet(null); }
Source:
protected <T> T internalValueOfString(final String value, final Boolean isNullable, final Integer maxLength, final Integer precision, final Integer scale, final Boolean isUnicode, final Class<T> returnType) throws EdmPrimitiveTypeException { LocalDate date; try { date = LocalDate.parse(value); } catch (DateTimeParseException ex) { throw new EdmPrimitiveTypeException("The literal '" + value + "' has illegal content."); } if (returnType.isAssignableFrom(LocalDate.class)) { return (T) date; } else if (returnType.isAssignableFrom(java.sql.Date.class)) { return (T) java.sql.Date.valueOf(date); } ZonedDateTime zdt = LocalDateTime.of(date, LocalTime.MIDNIGHT).atZone(ZoneId.systemDefault()); if (returnType.isAssignableFrom(Calendar.class)) { return (T) GregorianCalendar.from(zdt); } else if (returnType.isAssignableFrom(Long.class)) { return (T) Long.valueOf(zdt.toInstant().toEpochMilli()); } else if (returnType.isAssignableFrom(java.util.Date.class)) { return (T) java.util.Date.from(zdt.toInstant()); } else { throw new EdmPrimitiveTypeException("The value type " + returnType + " is not supported."); } }

Target:
protected <T> T internalValueOfString(final String value, final Boolean isNullable, final Integer maxLength, final Integer precision, final Integer scale, final Boolean isUnicode, final Class<T> returnType) throws EdmPrimitiveTypeException { LocalDate date; try { date = LocalDate.parse(value); } catch (DateTimeParseException ex) { throw new EdmPrimitiveTypeException("The literal '" + value + "' has illegal content."); } if (returnType.isAssignableFrom(LocalDate.class)) { return (T) date; } else if (returnType.isAssignableFrom(java.sql.Date.class)) { return (T) java.sql.Date.valueOf(date); } ZonedDateTime zdt = LocalDateTime.of(date, LocalTime.MIDNIGHT).atZone(ZoneId.systemDefault()); if (returnType.isAssignableFrom(Calendar.class)) { return (T) GregorianCalendar.from(zdt); } else if (returnType.isAssignableFrom(Long.class)) { return (T) Long.valueOf(zdt.toInstant().toEpochMilli()); } else if (returnType.isAssignableFrom(java.sql.Date.class)) { throw new EdmPrimitiveTypeException("The value type " + returnType + " is not supported."); } else if (returnType.isAssignableFrom(java.sql.Timestamp.class)) { return (T) java.sql.Timestamp.from(zdt.toInstant()); } else if (returnType.isAssignableFrom(java.util.Date.class)) { return (T) java.util.Date.from(zdt.toInstant()); } else { throw new EdmPrimitiveTypeException("The value type " + returnType + " is not supported."); } }
Source:
private void testSnapshotSender(int batchSize) throws Exception { initLogReplicationFSM(ReaderImplementation.TEST); ((TestSnapshotReader)snapshotReader).setBatchSize(batchSize); writeToStream(); transitionAvailable.acquire(); transition(LogReplicationEventType.SNAPSHOT_SYNC_REQUEST, LogReplicationStateType.IN_SNAPSHOT_SYNC); int numTransition = (NUM_ENTRIES/(batchSize* SnapshotSender.SNAPSHOT_BATCH_SIZE)) + 1; Queue<LogReplicationEntry> listenerQueue = ((TestDataSender) dataSender).getEntryQueue(); for (int i = 0; i < numTransition; i++) { System.out.print("\nnumTransitions " + numTransition + " i " + i); transitionAvailable.acquire(); } assertThat(listenerQueue.size()).isEqualTo(NUM_ENTRIES); for (int i = 0; i < NUM_ENTRIES; i++) { assertThat(listenerQueue.poll().getPayload()) .isEqualTo( String.format(PAYLOAD_FORMAT, i).getBytes()); } }

Target:
private void testSnapshotSender(int batchSize) throws Exception { initLogReplicationFSM(ReaderImplementation.TEST); ((TestSnapshotReader)snapshotReader).setBatchSize(batchSize); writeToStream(); transitionAvailable.acquire(); transition(LogReplicationEventType.SNAPSHOT_SYNC_REQUEST, LogReplicationStateType.IN_SNAPSHOT_SYNC); int numTransition = (NUM_ENTRIES/(batchSize* SnapshotSender.DEFAULT_SNAPSHOT_BATCH_SIZE)) + 1; Queue<LogReplicationEntry> listenerQueue = ((TestDataSender) dataSender).getEntryQueue(); for (int i = 0; i < numTransition; i++) { System.out.print("\nnumTransitions " + numTransition + " i " + i); transitionAvailable.acquire(); } assertThat(listenerQueue.size()).isEqualTo(NUM_ENTRIES); for (int i = 0; i < NUM_ENTRIES; i++) { assertThat(listenerQueue.poll().getPayload()) .isEqualTo( String.format(PAYLOAD_FORMAT, i).getBytes()); } }
Source:
private CoordinatorStats doRun( Map<String, DataSourceCompactionConfig> compactionConfigs, int numAvailableCompactionTaskSlots, CompactionSegmentIterator iterator ) { int numSubmittedTasks = 0; for (; iterator.hasNext() && numSubmittedTasks < numAvailableCompactionTaskSlots; numSubmittedTasks++) { final List<DataSegment> segmentsToCompact = iterator.next(); final String dataSourceName = segmentsToCompact.get(0).getDataSource(); if (!segmentsToCompact.isEmpty()) { final DataSourceCompactionConfig config = compactionConfigs.get(dataSourceName); final String taskId = indexingServiceClient.compactSegments( segmentsToCompact, config.getTaskPriority(), ClientCompactQueryTuningConfig.from(config.getTuningConfig(), config.getMaxRowsPerSegment()), config.getTaskContext() ); LOG.info( "Submitted a compactTask[%s] for segments %s", taskId, Iterables.transform(segmentsToCompact, DataSegment::getId) ); } else { throw new ISE("Failed to find segments for dataSource[%s]", dataSourceName); } } return makeStats(numSubmittedTasks, iterator); }

Target:
private CoordinatorStats doRun( Map<String, DataSourceCompactionConfig> compactionConfigs, int numAvailableCompactionTaskSlots, CompactionSegmentIterator iterator ) { int numSubmittedTasks = 0; for (; iterator.hasNext() && numSubmittedTasks < numAvailableCompactionTaskSlots; numSubmittedTasks++) { final List<DataSegment> segmentsToCompact = iterator.next(); if (!segmentsToCompact.isEmpty()) { final String dataSourceName = segmentsToCompact.get(0).getDataSource(); final DataSourceCompactionConfig config = compactionConfigs.get(dataSourceName); final String taskId = indexingServiceClient.compactSegments( segmentsToCompact, config.getTaskPriority(), ClientCompactQueryTuningConfig.from(config.getTuningConfig(), config.getMaxRowsPerSegment()), newAutoCompactionContext(config.getTaskContext()) ); LOG.info( "Submitted a compactTask[%s] for segments %s", taskId, Iterables.transform(segmentsToCompact, DataSegment::getId) ); } else { throw new ISE("segmentsToCompact is empty?"); } } return makeStats(numSubmittedTasks, iterator); }
Source:
public StreamInputPacketIndexEntry(long dataOffsetBits, StructDefinition streamPacketContextDef, long fileSizeBytes, long lostSoFar) { for (String field : streamPacketContextDef.getDeclaration().getFieldsList()) { IDefinition id = streamPacketContextDef.lookupDefinition(field); if (id instanceof IntegerDefinition) { fAttributes.put(field, ((IntegerDefinition) id).getValue()); } else if (id instanceof FloatDefinition) { fAttributes.put(field, ((FloatDefinition) id).getValue()); } else if (id instanceof EnumDefinition) { fAttributes.put(field, ((EnumDefinition) id).getValue()); } else if (id instanceof StringDefinition) { fAttributes.put(field, ((StringDefinition) id).getValue()); } } Long contentSize = (Long) fAttributes.get(CTFStrings.CONTENT_SIZE); Long packetSize = (Long) fAttributes.get(CTFStrings.PACKET_SIZE); Long tsBegin = (Long) fAttributes.get(CTFStrings.TIMESTAMP_BEGIN); Long tsEnd = (Long) fAttributes.get(CTFStrings.TIMESTAMP_END); boolean hasDevice = fAttributes.containsKey(CTFStrings.DEVICE); Long cpuId = (Long) fAttributes.get(CTFStrings.CPU_ID); Long lostEvents = (Long) fAttributes.get(CTFStrings.EVENTS_DISCARDED); fContentSizeBits = computeContentSize(fileSizeBytes, contentSize, packetSize); fPacketSizeBits = computePacketSize(fileSizeBytes, packetSize); fTimestampBegin = computeTsBegin(tsBegin); fTimestampEnd = computeTsEnd(tsEnd); Target target = lookupTarget(streamPacketContextDef, hasDevice, cpuId); fTarget = target.string; fTargetID = target.number; fLostEvents = computeLostEvents(lostSoFar, lostEvents); fOffsetBits = dataOffsetBits; fOffsetBytes = dataOffsetBits / Byte.SIZE; }

Target:
public StreamInputPacketIndexEntry(long dataOffsetBits, StructDefinition streamPacketContextDef, long fileSizeBytes, long lostSoFar) { for (String field : streamPacketContextDef.getDeclaration().getFieldsList()) { IDefinition id = streamPacketContextDef.lookupDefinition(field); if (id instanceof IntegerDefinition) { fAttributes.put(field, ((IntegerDefinition) id).getValue()); } else if (id instanceof FloatDefinition) { fAttributes.put(field, ((FloatDefinition) id).getValue()); } else if (id instanceof EnumDefinition) { fAttributes.put(field, ((EnumDefinition) id).getValue()); } else if (id instanceof StringDefinition) { fAttributes.put(field, ((StringDefinition) id).getValue()); } } fContentSizeBits = computeContentSize(fileSizeBytes); fPacketSizeBits = computePacketSize(fileSizeBytes); fTimestampBegin = computeTsBegin(); fTimestampEnd = computeTsEnd(); Target target = lookupTarget(streamPacketContextDef); fTarget = target.string; fTargetID = target.number; fLostEvents = computeLostEvents(lostSoFar); fOffsetBits = dataOffsetBits; fOffsetBytes = dataOffsetBits / Byte.SIZE; }
Source:
private void processQuery() { try { parser.process(sqlQuery); eclQuery = new ECLEngine(parser, dbMetadata, hpccConnection.getProperties()); eclQuery.generateECL(); } catch (SQLException e) { System.out.println(e.getLocalizedMessage()); if (warnings == null) warnings = new SQLWarning(); warnings.setNextException(e); eclQuery = null; parser = null; } }

Target:
private void processQuery() { try { if (!this.closed) { if (parser != null) parser.process(sqlQuery); else throw new SQLException("Error parser is not ready, cannot execute query"); eclQuery = new ECLEngine(parser, dbMetadata, hpccConnection.getProperties()); eclQuery.generateECL(); } else throw new SQLException("HPCCPreparedStatement closed, cannot execute query"); } catch (SQLException e) { System.out.println(e.getLocalizedMessage()); if (warnings == null) warnings = new SQLWarning(); warnings.setNextException(e); eclQuery = null; parser = null; } }
Source:
public void test() throws Exception { String rawInput = getResource(TEST_DOC); String expected = getResource(CONVERTED_HTML); String input = NormalizeHtml.convertToNormalizedHTML(rawInput); input = bodyOnly(input); expected = bodyOnly(expected); input = input.replaceAll("\r", ""); expected = expected.replaceAll("\r", ""); input = input.replaceAll("br>", "br />"); input = input.replaceAll("br\\[>", "br[ />"); input = input.replaceAll("br\\]>", "br />"); Assert.assertEquals("Converted HTML does not equal expected", expected, input); input = rawInput.replaceAll("BODY", "body"); input = bodyOnly(input); input = NormalizeHtml.wrapAndNormalizeHTML(input, false, false, false); input = bodyOnly(input); input = input.replaceAll("\r", ""); input = input.replaceAll("br>", "br />"); input = input.replaceAll("br\\[>", "br[ />"); input = input.replaceAll("br\\]>", "br />"); Assert.assertEquals("Converted body only HTML does not equal expected", expected, input); }

Target:
public void test() throws Exception { String rawInput = getResource(TEST_DOC); String expected = getResource(CONVERTED_HTML); String input = NormalizeHtml.convertToNormalizedHTML(rawInput); input = bodyOnly(input); input = input.replaceAll("br /", "br"); expected = bodyOnly(expected); input = input.replaceAll("\r", ""); expected = expected.replaceAll("\r", ""); Assert.assertEquals("Converted HTML does not equal expected", expected, input); input = rawInput.replaceAll("BODY", "body"); input = bodyOnly(input); input = NormalizeHtml.wrapAndNormalizeHTML(input, false, false, false); input = bodyOnly(input); input = input.replaceAll("\r", ""); input = input.replaceAll("br /", "br"); Assert.assertEquals("Converted body only HTML does not equal expected", expected, input); }
Source:
public CompletableFuture<WriteAdvHandle> execute() { CompletableFuture<WriteAdvHandle> counter = new CompletableFuture<>(); create(new SyncCreateCallback(), counter); return counter; }

Target:
public CompletableFuture<WriteAdvHandle> execute() { CompletableFuture<WriteAdvHandle> future = new CompletableFuture<>(); SyncCreateCallback callback = new SyncCreateCallback(future); create(callback); return future; }
Source:
public static List<GAV> convert2GAV(String gavString) { List<GAV> gavs = new ArrayList<>(); String[] componentsStr = gavString.split(","); for (String componentStr : componentsStr) { String[] component = componentStr.split(":"); GAV gav = new GAV(); gav.setGroupId(component[0]); gav.setArtifactId(component[1]); gav.setVersion(component[2]); gavs.add(gav); } return gavs; }

Target:
public static List<GAV> convert2GAV(String gavString) { List<GAV> gavs = new ArrayList<>(); String[] componentsStr = gavString.split(","); for (String componentStr : componentsStr) { String[] component = componentStr.split(":"); GAV gav = new GAV(); gav.setGroupId(component[0]); gav.setArtifactId(component[1]); gav.setVersion(component[2]); if (3 < component.length) { gav.setClassifier(component[3]); } if (4 < component.length) { gav.setType(component[4]); } gavs.add(gav); } return gavs; }
Source:
public ClosePresenceChecker(SimpleName cursorSimpleName, String recycleMethodName) { super(); this.closePresent = false; this.lastCursorUse = null; this.cursorSimpleName = cursorSimpleName; this.recycleMethodName = recycleMethodName; }

Target:
public ClosePresenceChecker(SimpleName cursorSimpleName, String recycleMethodName) { this.cursorSimpleName = cursorSimpleName; this.recycleMethodName = recycleMethodName; }
Source:
protected ViewModel verify(HttpServletRequest request, HttpServletResponse response, String sptoken) throws ServletException, IOException { Account account = client.verifyAccountEmail(sptoken); RequestEvent e = createVerifiedEvent(request, response, account); publish(e); if (isJsonPreferred(request, response)) { if (autoLogin){ final AuthenticationResult result = new TransientAuthenticationResult(account); this.authenticationResultSaver.set(request, response, result); Map<String,Object> model = new HashMap<String, Object>(); model.put("account", accountModelFactory.toMap(account, Collections.EMPTY_LIST)); return new DefaultViewModel("stormpathJsonView", model); } else { return new DefaultViewModel("stormpathJsonView"); } } else { if (autoLogin) { final AuthenticationResult result = new TransientAuthenticationResult(account); this.authenticationResultSaver.set(request, response, result); return new DefaultViewModel(loginNextUri).setRedirect(true); } else { return new DefaultViewModel(nextUri).setRedirect(true); } } }

Target:
protected ViewModel verify(HttpServletRequest request, HttpServletResponse response, String sptoken) throws ServletException, IOException { Account account = client.verifyAccountEmail(sptoken); RequestEvent e = createVerifiedEvent(request, response, account); publish(e); if (isJsonPreferred(request, response)) { if (autoLogin){ final AuthenticationResult result = new TransientAuthenticationResult(account); this.authenticationResultSaver.set(request, response, result); Map<String,Object> model = new HashMap<String, Object>(); model.put("account", accountModelFactory.toMap(account, Collections.EMPTY_LIST)); return new DefaultViewModel(STORMPATH_JSON_VIEW_NAME, model); } else { return null; } } else { if (autoLogin) { final AuthenticationResult result = new TransientAuthenticationResult(account); this.authenticationResultSaver.set(request, response, result); return new DefaultViewModel(loginNextUri).setRedirect(true); } else { return new DefaultViewModel(nextUri).setRedirect(true); } } }
Source:
public void invalidate() { if (mNativeMap.isEmpty()) { return; } final WeakHashMap<android.view.MenuItem, MenuItem> menuMapCopy = new WeakHashMap<android.view.MenuItem, MenuItem>(mNativeMap.size()); for (int i = 0; i < mNativeMenu.size(); i++) { final android.view.MenuItem item = mNativeMenu.getItem(i); menuMapCopy.put(item, mNativeMap.get(item)); } mNativeMap.clear(); mNativeMap.putAll(menuMapCopy); }

Target:
public void invalidate() { if (mNativeMap.isEmpty()) return; final WeakHashMap<android.view.MenuItem, MenuItem> menuMapCopy = new WeakHashMap<android.view.MenuItem, MenuItem>(mNativeMap.size()); for (int i = 0; i < mNativeMenu.size(); i++) { final android.view.MenuItem item = mNativeMenu.getItem(i); menuMapCopy.put(item, mNativeMap.get(item)); } mNativeMap.clear(); mNativeMap.putAll(menuMapCopy); }