auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private String getProcessedIdToken(ServerAccessToken st) { if (idTokenProvider != null) { IdToken idToken = idTokenProvider.getIdToken(st.getClient().getClientId(), st.getSubject(), OAuthUtils.convertPermissionsToScopeList(st.getScopes())); setAtHashAndNonce(idToken, st); return processJwt(new JwtToken(idToken), st.getClient()); } else if (st.getSubject().getProperties().containsKey(OidcUtils.ID_TOKEN)) { return st.getSubject().getProperties().get(OidcUtils.ID_TOKEN); } else if (st.getSubject() instanceof OidcUserSubject) { OidcUserSubject sub = (OidcUserSubject)st.getSubject(); if (sub.getIdToken() != null) { IdToken idToken = new IdToken(sub.getIdToken()); idToken.setAudience(st.getClient().getClientId()); idToken.setAuthorizedParty(st.getClient().getClientId()); if (null == st.getResponseType()) { final Long iat = st.getIssuedAt(); idToken.setExpiryTime(iat + (idToken.getExpiryTime() - idToken.getIssuedAt())); idToken.setIssuedAt(iat); } setAtHashAndNonce(idToken, st); return processJwt(new JwtToken(idToken), st.getClient()); } } return null; }

Target:
private String getProcessedIdToken(ServerAccessToken st) { if (idTokenProvider != null) { IdToken idToken = idTokenProvider.getIdToken(st.getClient().getClientId(), st.getSubject(), OAuthUtils.convertPermissionsToScopeList(st.getScopes())); setAtHashAndNonce(idToken, st); return processJwt(new JwtToken(idToken), st.getClient()); } else if (st.getSubject().getProperties().containsKey(OidcUtils.ID_TOKEN)) { return st.getSubject().getProperties().get(OidcUtils.ID_TOKEN); } else if (st.getSubject() instanceof OidcUserSubject) { OidcUserSubject sub = (OidcUserSubject)st.getSubject(); if (sub.getIdToken() != null) { IdToken idToken = new IdToken(sub.getIdToken()); idToken.setAudience(st.getClient().getClientId()); idToken.setAuthorizedParty(st.getClient().getClientId()); if (OAuthConstants.REFRESH_TOKEN_GRANT.equals(st.getGrantType())) { final Long iat = st.getIssuedAt(); idToken.setExpiryTime(iat + (idToken.getExpiryTime() - idToken.getIssuedAt())); idToken.setIssuedAt(iat); } setAtHashAndNonce(idToken, st); return processJwt(new JwtToken(idToken), st.getClient()); } } return null; }
Source:
protected boolean isProbablyJavaCode() { try { String sourceName = getSourceName(); if (sourceName == null || sourceName.endsWith(".java")) { return true; } } catch (DebugException e) { return true; } return false; }

Target:
protected boolean isProbablyJavaCode() { try { String sourceName = getSourceName(); if (sourceName == null || JavaCore.isJavaLikeFileName(sourceName)) { return true; } } catch (DebugException e) { return true; } return false; }
Source:
public DateFormat getDateFormat() { return new DateFormat() { private final SimpleDateFormat[] formatters = new SimpleDateFormat[datePatterns.length]; { for (int i = 0; i < datePatterns.length; i++) { formatters[i] = new SimpleDateFormat(datePatterns[i], Locale.US); } } @Override public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) { for (DateFormat formatter : formatters) { return formatter.format(date, toAppendTo, fieldPosition); } return toAppendTo.append("(date null)"); } @Override public Date parse(String source) throws ParseException { ParseException head = null, tail = null; for (SimpleDateFormat formatter : formatters) { try { return formatter.parse(source); } catch (ParseException ex1) { ex1 = new ParseException( String.format("%s with format \"%s\" and locale \"%s\"", ex1.getMessage(), formatter.toPattern(), Locale.getDefault().toString()), ex1.getErrorOffset() ); if (head == null || tail == null) { head = tail = ex1; } else { tail.initCause(ex1); tail = ex1; } } } throw head != null ? head : new ParseException(String.format("Unparseable date: \"%s\"", source), 0); } @Override public Date parse(String source, ParsePosition pos) { Date d = null; for (DateFormat formatter : formatters) { if ((d = formatter.parse(source, pos)) != null) { return d; } } return d; } }; }

Target:
public DateFormat getDateFormat() { return new DateFormat() { private final SimpleDateFormat[] formatters = new SimpleDateFormat[datePatterns.length]; { for (int i = 0; i < datePatterns.length; i++) { formatters[i] = new SimpleDateFormat(datePatterns[i]); } } @Override public StringBuffer format(Date date, StringBuffer toAppendTo, FieldPosition fieldPosition) { for (DateFormat formatter : formatters) { return formatter.format(date, toAppendTo, fieldPosition); } return toAppendTo.append("(date null)"); } @Override public Date parse(String source) throws ParseException { ParseException head = null, tail = null; for (SimpleDateFormat formatter : formatters) { try { return formatter.parse(source); } catch (ParseException ex1) { ex1 = new ParseException( String.format("%s with format \"%s\" and locale \"%s\"", ex1.getMessage(), formatter.toPattern(), Locale.getDefault().toString()), ex1.getErrorOffset() ); if (head == null || tail == null) { head = tail = ex1; } else { tail.initCause(ex1); tail = ex1; } } } throw head != null ? head : new ParseException(String.format("Unparseable date: \"%s\"", source), 0); } @Override public Date parse(String source, ParsePosition pos) { Date d = null; for (DateFormat formatter : formatters) { if ((d = formatter.parse(source, pos)) != null) { return d; } } return d; } }; }
Source:
private Object getParameter(ParameterType type) { for (int ii = 0; ii < parameters.size(); ii += PARAMETER_TUPLE_SIZE) { if (((ParameterType)parameters.get(ii + PARAMETER_TUPLE_TYPE_OFFSET)).equals(type)) { return parameters.get(ii + PARAMETER_TUPLE_PARAMETER_OFFSET); } } return null; }

Target:
private Object getParameter(ParameterType type) { for (int ii = 0; ii < parameters.size(); ii += PARAMETER_TUPLE_SIZE) { if ((parameters.get(ii + PARAMETER_TUPLE_TYPE_OFFSET)).equals(type)) { return parameters.get(ii + PARAMETER_TUPLE_PARAMETER_OFFSET); } } return null; }
Source:
public void exerciseIsCorrectTypeIfItContainsTestthatFile() { Path testCasesRoot = TestUtils.getPath(getClass(), "recognition_test_cases"); Path project = testCasesRoot.resolve("testthat_folder") .resolve("tests"); File testThatR = new File(project.toAbsolutePath().toString() + "/testthat.R"); assertTrue(testThatR.exists()); }

Target:
public void exerciseIsCorrectTypeIfItContainsTestthatFile() { Path testCasesRoot = TestUtils.getPath(getClass(), "recognition_test_cases"); Path project = testCasesRoot.resolve("testthat_folder") .resolve("tests"); assertTrue(Files.exists(project.resolve("testthat.R"))); }
Source:
public static Task<?> getLoadCopyTask(ReplicationSpec replicationSpec, Path srcPath, Path dstPath, HiveConf conf, boolean isAutoPurge, boolean needRecycle, boolean copyToMigratedTxnTable) { Task<?> copyTask = null; LOG.debug("ReplCopyTask:getLoadCopyTask: {}=>{}", srcPath, dstPath); if ((replicationSpec != null) && replicationSpec.isInReplicationScope()){ ReplCopyWork rcwork = new ReplCopyWork(srcPath, dstPath, false); if (replicationSpec.isReplace() && (conf.getBoolVar(REPL_ENABLE_MOVE_OPTIMIZATION) || copyToMigratedTxnTable)) { rcwork.setDeleteDestIfExist(true); rcwork.setAutoPurge(isAutoPurge); rcwork.setNeedRecycle(needRecycle); } rcwork.setCopyToMigratedTxnTable(copyToMigratedTxnTable); rcwork.setCheckDuplicateCopy(replicationSpec.needDupCopyCheck()); LOG.debug("ReplCopyTask:\trcwork"); if (replicationSpec.isLazy()) { LOG.debug("ReplCopyTask:\tlazy"); rcwork.setReadSrcAsFilesList(true); String distCpDoAsUser = conf.getVar(HiveConf.ConfVars.HIVE_DISTCP_DOAS_USER); rcwork.setDistCpDoAsUser(distCpDoAsUser); } copyTask = TaskFactory.get(rcwork, conf); } else { LOG.debug("ReplCopyTask:\tcwork"); copyTask = TaskFactory.get(new CopyWork(srcPath, dstPath, false), conf); } return copyTask; }

Target:
public static Task<?> getLoadCopyTask(ReplicationSpec replicationSpec, Path srcPath, Path dstPath, HiveConf conf, boolean isAutoPurge, boolean needRecycle, boolean copyToMigratedTxnTable) { Task<?> copyTask = null; LOG.debug("ReplCopyTask:getLoadCopyTask: {}=>{}", srcPath, dstPath); if ((replicationSpec != null) && replicationSpec.isInReplicationScope()){ ReplCopyWork rcwork = new ReplCopyWork(srcPath, dstPath, false); if (replicationSpec.isReplace() && (conf.getBoolVar(REPL_ENABLE_MOVE_OPTIMIZATION) || copyToMigratedTxnTable)) { rcwork.setDeleteDestIfExist(true); rcwork.setAutoPurge(isAutoPurge); rcwork.setNeedRecycle(needRecycle); } rcwork.setCopyToMigratedTxnTable(copyToMigratedTxnTable); rcwork.setCheckDuplicateCopy(replicationSpec.needDupCopyCheck() && !replicationSpec.isReplace()); LOG.debug("ReplCopyTask:\trcwork"); if (replicationSpec.isLazy()) { LOG.debug("ReplCopyTask:\tlazy"); rcwork.setReadSrcAsFilesList(true); String distCpDoAsUser = conf.getVar(HiveConf.ConfVars.HIVE_DISTCP_DOAS_USER); rcwork.setDistCpDoAsUser(distCpDoAsUser); } copyTask = TaskFactory.get(rcwork, conf); } else { LOG.debug("ReplCopyTask:\tcwork"); copyTask = TaskFactory.get(new CopyWork(srcPath, dstPath, false), conf); } return copyTask; }
Source:
public SInvokable(final SSymbol signature, final AccessModifier accessModifier, final Invokable invokable, final SInvokable[] embeddedBlocks) { this.signature = signature; this.accessModifier = accessModifier; this.invokable = invokable; this.callTarget = invokable.createCallTarget(); this.embeddedBlocks = embeddedBlocks; if (VmSettings.TRACK_SNAPSHOT_ENTITIES) { SnapshotBackend.registerInvokable(Symbols.symbolFor(this.getIdentifier()), this); } }

Target:
public SInvokable(final SSymbol signature, final AccessModifier accessModifier, final Invokable invokable, final SInvokable[] embeddedBlocks) { this.signature = signature; this.accessModifier = accessModifier; this.invokable = invokable; this.callTarget = invokable.createCallTarget(); this.embeddedBlocks = embeddedBlocks; }
Source:
public void testInvalidProjectByFetchProjectByName() { if (!isTestSetup()) { return; } ProjectLoader loader = createLoader(); try { loader.fetchProjectByName("NonExistantProject"); } catch (ProjectManagerException ex) { System.out.println("Test true"); } Assert.fail("No exception"); }

Target:
public void testInvalidProjectByFetchProjectByName() { if (!isTestSetup()) { return; } ProjectLoader loader = createLoader(); try { loader.fetchProjectByName("NonExistantProject"); } catch (ProjectManagerException ex) { System.out.println("Test true"); } Assert.fail("Expecting exception, but didn't get one"); }
Source:
protected void applyGlobalLogRotators( Job<?,?> job, List<LogRotatorMapping> rotators ) throws IOException, InterruptedException { for( LogRotatorMapping mapping : rotators ) { if( job.getFullName().matches( mapping.getJobNameRegex() ) ) { mapping.getLogRotator().perform( job ); return; } } LOGGER.log( FINE, Messages.LogRotatorPeriodicTask_noGlobalMatch( job.getFullName() ) ); }

Target:
protected void applyGlobalLogRotators( Job<?,?> job, List<LogRotatorMapping> rotators ) throws IOException, InterruptedException { for( LogRotatorMapping mapping : rotators ) { if( job.getFullName().matches( mapping.getJobNameRegex() ) ) { mapping.getLogRotator().perform( job ); return; } } LOGGER.log( FINE, () -> Messages.LogRotatorPeriodicTask_noGlobalMatch( job.getFullName() ) ); }
Source:
public long remove(Type type, String value) throws MailQueueException { try (IndexReader indexReader = DirectoryReader.open(indexWriter)) { int maxCount = Math.max(1, indexReader.maxDoc()); IndexSearcher searcher = new IndexSearcher(indexReader); MutableLong count = new MutableLong(); Term term; Query query; switch (type) { case Name: case Sender: case Recipient: term = new Term(type.name(), value); query = new TermQuery(term); break; default: throw new MailQueueException("Not supported yet"); } Optional.ofNullable(searcher.search(query, maxCount).scoreDocs) .filter(hits -> hits.length > 0) .map(Stream::of) .ifPresent(scoreDocStream -> scoreDocStream .mapToInt(scoreDoc -> scoreDoc.doc) .forEach(id -> Optional.ofNullable(Throwing.supplier(() -> searcher.doc(id, FIELDS_TO_LOAD)).get()) .map(doc -> doc.getField(FILE_PATH_KEY)) .map(IndexableField::stringValue) .map(keyMappings::remove) .ifPresent(fileItem -> { Throwing.runnable(fileItem::delete).run(); Throwing.<Query>consumer(indexWriter::deleteDocuments).accept(query); count.increment(); }) )); return count.longValue(); } catch (IOException e) { throw new MailQueueException("Cannot perform remove operation.", e); } }

Target:
public long remove(Type type, String value) throws MailQueueException { try { return mailQueueIndex.pop(type, value) .stream() .map(keyMappings::remove) .peek(fileItem -> Throwing.runnable(fileItem::delete).run()) .count(); } catch (IOException e) { throw new MailQueueException("Cannot perform remove operation.", e); } }
Source:
public void createControl(Composite parent, final FormToolkit toolkit) { if (taskReviewStore != null) { Collection<String> reviewUrls = taskReviewStore.getReviewUrls(getTaskEditorPage().getTask().getUrl()); getReviewsFromUrls(reviewUrls); } if (reviews == null || reviews.size() == 0) { return; } reviewContainers = new ArrayList<TaskReview>(); populateReviews(reviewContainers); selectionProvider = new SelectionProviderAdapter(); section = createSection(parent, toolkit, true); section.setText(section.getText()); createContents(toolkit, section); section.addExpansionListener(new ExpansionAdapter() { @Override public void expansionStateChanged(ExpansionEvent event) { if (reviewContainers == null) { createContents(toolkit, section); getTaskEditorPage().reflow(); } } }); setSection(toolkit, section); }

Target:
public void createControl(Composite parent, final FormToolkit toolkit) { if (taskReviewStore != null) { Collection<String> reviewUrls = taskReviewStore.getReviewUrls(getTaskEditorPage().getTask().getUrl()); getReviewsFromUrls(reviewUrls); } if (reviews == null || reviews.size() == 0) { return; } reviewContainers = new ArrayList<TaskReview>(); populateReviews(reviewContainers); selectionProvider = new SelectionProviderAdapter(); section = createSection(parent, toolkit, true); section.setText(section.getText()); createContents(toolkit, section); section.addExpansionListener(new ExpansionAdapter()); setSection(toolkit, section); }
Source:
private void processRemovedClient(Client client) { if (client instanceof NetClient) { ServerConnectListManager serverConnectListManager = ServerConnectListManager.getInstance(); if (!serverConnectListManager.isClientAllowedToConnect(client.getId())) { return; } NetClient netClient = (NetClient) client; netClientList.remove(netClient); } clientList.remove(client); clientPlayerLookup.remove(client.getEntity()); logger.info("Client disconnected: " + client.getName()); storageManager.deactivatePlayer(client); client.getEntity().send(new DisconnectedEvent()); client.disconnect(); }

Target:
private void processRemovedClient(Client client) { if (client instanceof NetClient) { ServerConnectListManager serverConnectListManager = context.get(ServerConnectListManager.class); if (!serverConnectListManager.isClientAllowedToConnect(client.getId())) { return; } NetClient netClient = (NetClient) client; netClientList.remove(netClient); } clientList.remove(client); clientPlayerLookup.remove(client.getEntity()); logger.info("Client disconnected: " + client.getName()); storageManager.deactivatePlayer(client); client.getEntity().send(new DisconnectedEvent()); client.disconnect(); }
Source:
public void testConstructor () throws IOException { BloomFilter bloomFilter1 = new BlockSplitBloomFilter(0); assertEquals(bloomFilter1.getBitsetSize(), BlockSplitBloomFilter.MINIMUM_BLOOM_FILTER_BYTES); BloomFilter bloomFilter2 = new BlockSplitBloomFilter(256 * 1024 * 1024); assertEquals(bloomFilter2.getBitsetSize(), BlockSplitBloomFilter.MAXIMUM_BLOOM_FILTER_BYTES); BloomFilter bloomFilter3 = new BlockSplitBloomFilter(1000); assertEquals(bloomFilter3.getBitsetSize(), 1024); }

Target:
public void testConstructor () throws IOException { BloomFilter bloomFilter1 = new BlockSplitBloomFilter(0); assertEquals(bloomFilter1.getBitsetSize(), BlockSplitBloomFilter.MINIMUM_BYTES); BloomFilter bloomFilter2 = new BlockSplitBloomFilter(BlockSplitBloomFilter.MAXIMUM_BYTES + 1); assertEquals(bloomFilter2.getBitsetSize(), BlockSplitBloomFilter.MAXIMUM_BYTES); BloomFilter bloomFilter3 = new BlockSplitBloomFilter(1000); assertEquals(bloomFilter3.getBitsetSize(), 1024); }
Source:
synchronized Response afterLRA(URI lraId, LRAStatus lraStatus) { invokeMethod(AFTER, afterLRAMethod, getInstance(), lraId, lraStatus); return Response.ok().build(); }

Target:
synchronized Response afterLRA(URI lraId, LRAStatus lraStatus) { Object result = invokeMethod(AFTER, afterLRAMethod, getInstance(), lraId, lraStatus); return result instanceof Response ? (Response) result : Response.ok().build(); }
Source:
public void load(GlowFallingBlock entity, CompoundTag tag) { super.load(entity, tag); if (tag.isString("Material")) { entity.setMaterial(Material.getMaterial(tag.getString("Material"))); } }

Target:
public void load(GlowFallingBlock entity, CompoundTag tag) { super.load(entity, tag); if (tag.isString("Block")) { entity.setMaterial(ItemIds.getBlock(tag.getString("Block"))); } if (tag.isByte("Data")) { entity.setBlockData(tag.getByte("Data")); } entity.setHurtEntities(tag.getBool("HurtEntities")); entity.setDropItem(tag.getBool("DropItem")); if (tag.isCompound("TileEntityData")) { entity.setTileEntityCompoundTag(tag.getCompound("TileEntityData")); } }
Source:
public void addProvider(ITimeGraphDataProvider<?> provider) { synchronized (fProviders) { fProviders.add(provider); } }

Target:
public void addProvider(ITimeGraphDataProvider<?> provider) { synchronized (fProviders) { fProviders.add(provider); fStylesMap = null; fStateTable = null; } }
Source:
public List<Lesson> getLessonsByProperties(Map<String, String> properties) { List lessons = lessonDataService.executeQuery(new QueryExecution<List<Lesson>>() { @Override public List<Lesson> execute(Query query, InstanceSecurityRestriction restriction) { query.setFilter(buildParametersFilter(properties)); return (List) QueryExecutor.execute(query, restriction); } }); return new ArrayList<>(lessons); }

Target:
public List<Lesson> getLessonsByProperties(Map<String, String> properties) { return lessonDataService.executeQuery(new PropertiesMapQueryExecution<>(properties)); }
Source:
public void sendSuccessEdgeNotification(final MonitoredMessage trackMessage) { LOG.debug("Inside Message Monitoring API sendSuccessEdgeNotification() method."); final String subject = MessageMonitoringUtil.getSuccessfulMessageSubjectPrefix() + trackMessage.getSubject(); final String emailText = MessageMonitoringUtil.getSuccessfulMessageEmailText() + trackMessage.getRecipients(); final String postmasterEmailId = MessageMonitoringUtil.getDomainPostmasterEmailId() + "@" + MessageMonitoringUtil.getDomainFromEmail(trackMessage.getSenderemailid()); final DirectEdgeProxy proxy = MessageMonitoringUtil.getDirectEdgeProxy(); MimeMessage message = null; String errorMsg = null; try { message = MessageMonitoringUtil.createMimeMessage(postmasterEmailId, subject, trackMessage.getSenderemailid(), emailText, trackMessage.getMessageid()); proxy.provideAndRegisterDocumentSetB(message); getDirectEventLogger().log(DirectEventType.DIRECT_EDGE_NOTIFICATION_SUCCESSFUL, message); <<<<<<< HEAD } catch (final MessagingException ex) { ======= } catch (MessagingException ex) { >>>>>>> 3018470ef5... CONN_2297: PR Feedback errorMsg = ex.getLocalizedMessage(); LOG.error(errorMsg,ex); } LOG.debug("Exiting Message Monitoring API sendSuccessEdgeNotification() method."); }

Target:
public void sendSuccessEdgeNotification(final MonitoredMessage trackMessage) { LOG.debug("Inside Message Monitoring API sendSuccessEdgeNotification() method."); final String subject = MessageMonitoringUtil.getSuccessfulMessageSubjectPrefix() + trackMessage.getSubject(); final String emailText = MessageMonitoringUtil.getSuccessfulMessageEmailText() + trackMessage.getRecipients(); final String postmasterEmailId = MessageMonitoringUtil.getDomainPostmasterEmailId() + "@" + MessageMonitoringUtil.getDomainFromEmail(trackMessage.getSenderemailid()); final DirectEdgeProxy proxy = MessageMonitoringUtil.getDirectEdgeProxy(); MimeMessage message = null; String errorMsg = null; try { message = MessageMonitoringUtil.createMimeMessage(postmasterEmailId, subject, trackMessage.getSenderemailid(), emailText, trackMessage.getMessageid()); proxy.provideAndRegisterDocumentSetB(message); getDirectEventLogger().log(DirectEventType.DIRECT_EDGE_NOTIFICATION_SUCCESSFUL, message); } catch (final MessagingException ex) { errorMsg = ex.getLocalizedMessage(); LOG.error(errorMsg,ex); } LOG.debug("Exiting Message Monitoring API sendSuccessEdgeNotification() method."); }
Source:
private SaslServer getIndirectSaslServer(final String mechanism, final String protocol, final String serverName, final Map<String, Object> props, final String bindingType, final byte[] bindingData) throws SaslException { try { return Subject.doAs(clientSubject, new PrivilegedExceptionAction<SaslServer>() { public SaslServer run() throws SaslException { CallbackHandler cbh = new IndirectCallbackHandler(bindingType, bindingData); return Sasl.createSaslServer(mechanism, protocol, serverName, props, cbh); } }); } catch (PrivilegedActionException e) { if (e.getCause() instanceof SaslException) { throw (SaslException) e.getCause(); } else { throw new RuntimeException(e.getCause()); } } }

Target:
private SaslServer getIndirectSaslServer(final String mechanism, final String protocol, final String serverName, final Map<String, Object> props, final String bindingType, final byte[] bindingData) throws SaslException { try { return Subject.doAs(serverSubject, new PrivilegedExceptionAction<SaslServer>() { public SaslServer run() throws SaslException { CallbackHandler cbh = new IndirectCallbackHandler(bindingType, bindingData); return Sasl.createSaslServer(mechanism, protocol, serverName, props, cbh); } }); } catch (PrivilegedActionException e) { if (e.getCause() instanceof SaslException) { throw (SaslException) e.getCause(); } else { throw new RuntimeException(e.getCause()); } } }
Source:
private void persistRp(String siteId, RegisterSiteParams params) { try { final RegisterRequest registerRequest = createRegisterClientRequest(params, siteId); rp = createRp(registerRequest); rp.setOxdId(siteId); rp.setApplicationType("web"); rp.setOpHost(params.getOpHost()); rp.setOpDiscoveryPath(params.getOpDiscoveryPath()); rp.setUiLocales(params.getUiLocales()); if (!hasClient(params)) { LOG.info("Save RegisterRequest object to register in OP ..."); final RegisterResponse registerResponse = registerClient(params, registerRequest); rp.setClientId(registerResponse.getClientId()); rp.setClientSecret(registerResponse.getClientSecret()); rp.setClientRegistrationAccessToken(registerResponse.getRegistrationAccessToken()); rp.setClientRegistrationClientUri(registerResponse.getRegistrationClientUri()); rp.setClientIdIssuedAt(registerResponse.getClientIdIssuedAt()); rp.setClientSecretExpiresAt(registerResponse.getClientSecretExpiresAt()); } LOG.info("Saving Relying Party object in oxd ..."); getRpService().create(rp); } catch (HttpException e) { throw e; } catch (Exception e) { LOG.error("Failed to persist site configuration, params: " + params, e); throw new RuntimeException(e); } }

Target:
private void persistRp(String siteId, RegisterSiteParams params) { try { final RegisterRequest registerRequest = createRegisterClientRequest(params, siteId); rp = createRp(registerRequest); rp.setOxdId(siteId); rp.setApplicationType("web"); rp.setOpHost(params.getOpHost()); rp.setOpDiscoveryPath(params.getOpDiscoveryPath()); rp.setUiLocales(params.getUiLocales()); if (!hasClient(params)) { final RegisterResponse registerResponse = registerClient(params, registerRequest); rp.setClientId(registerResponse.getClientId()); rp.setClientSecret(registerResponse.getClientSecret()); rp.setClientRegistrationAccessToken(registerResponse.getRegistrationAccessToken()); rp.setClientRegistrationClientUri(registerResponse.getRegistrationClientUri()); rp.setClientIdIssuedAt(registerResponse.getClientIdIssuedAt()); rp.setClientSecretExpiresAt(registerResponse.getClientSecretExpiresAt()); } getRpService().create(rp); } catch (HttpException e) { throw e; } catch (Exception e) { LOG.error("Failed to persist site configuration, params: " + params, e); throw new RuntimeException(e); } }
Source:
private boolean checkNull(ExpressionTree expression) { if (expression.is(Kind.NULL_LITERAL)) { context.reportIssue(NullShouldNotBeUsedWithOptionalCheck.this, expression.firstToken(), "Methods with an \"Optional\" return type should never return null."); return true; } return false; }

Target:
private void checkNull(ExpressionTree expression) { if (isNull(expression)) { context.reportIssue(NullShouldNotBeUsedWithOptionalCheck.this, expression, "Methods with an \"Optional\" return type should never return null."); } }
Source:
public static List<Storage> getAllStorageLocations(Context context) { Collection<String> mounts = new ArrayList<>(); final File[] mountPoints = ContextCompat.getExternalFilesDirs(context, null); if (mountPoints != null && mountPoints.length > 1) { for (int i = 0; i < mountPoints.length; i++) { mounts.add(mountPoints[i].getAbsolutePath()); } } else if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) { mounts = readMountsFile(); if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR2) { Collection<String> vold = readVoldsFile(); List<String> toRemove = new ArrayList<String>(); for (Iterator<String> iter = mounts.iterator(); iter.hasNext(); ) { String mount = iter.next(); if (!vold.contains(mount)) { toRemove.add(mount); } } for (String s : toRemove) { mounts.remove(s); } } else { Log.d(TAG, "Android version: " + Build.VERSION.SDK_INT + ", skip reading vold.fstab file"); } } Log.d(TAG, "mounts list is: " + mounts); return buildMountsList(context, mounts); }

Target:
public static List<Storage> getAllStorageLocations(Context context) { Collection<String> mounts = new ArrayList<>(); final File[] mountPoints = ContextCompat.getExternalFilesDirs(context, null); if (mountPoints != null && mountPoints.length > 1) { for (File mountPoint : mountPoints) { mounts.add(mountPoint.getAbsolutePath()); } } else if (Build.VERSION.SDK_INT < Build.VERSION_CODES.KITKAT) { mounts = readMountsFile(); if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR2) { Collection<String> vold = readVoldsFile(); List<String> toRemove = new ArrayList<>(); for (String mount : mounts) { if (!vold.contains(mount)) { toRemove.add(mount); } } for (String s : toRemove) { mounts.remove(s); } } else { Log.d(TAG, "Android version: " + Build.VERSION.SDK_INT + ", skip reading vold.fstab file"); } } Log.d(TAG, "mounts list is: " + mounts); return buildMountsList(context, mounts); }
Source:
public boolean canExecute() { if (canceled) { return false; } synchronized (queueSet.scheduleQueue.getModificationLock()) { if (queueSet.scheduleQueue.remove(this)) { executing = true; queueSet.scheduleQueue.addLast(this); return true; } else { return false; } } }

Target:
public boolean canExecute() { synchronized (queueSet.scheduleQueue.getModificationLock()) { int index = queueSet.scheduleQueue.indexOf(this); if (index < 0) { return false; } else { queueSet.scheduleQueue.reposition(index, queueSet.scheduleQueue.size()); executing = true; return true; } } }
Source:
public void findOne() throws Exception { context.turnOffAuthorisationSystem(); MetadataSchema metadataSchema = MetadataSchemaBuilder.createMetadataSchema(context, "ATest", "ANamespace") .build(); getClient().perform(get("/api/core/metadataschemas/" + metadataSchema.getID())) .andExpect(status().isOk()) .andExpect(jsonPath("$", is( matchEntry(metadataSchema) ))); }

Target:
public void findOne() throws Exception { context.turnOffAuthorisationSystem(); MetadataSchema metadataSchema = MetadataSchemaBuilder.createMetadataSchema(context, "ATest", "ANamespace") .build(); context.restoreAuthSystemState(); getClient().perform(get("/api/core/metadataschemas/" + metadataSchema.getID())) .andExpect(status().isOk()) .andExpect(jsonPath("$", is( matchEntry(metadataSchema) ))); }
Source:
public void testMetaspaceCompleteness() { final InterceptingOperatorMetricGroup metaspaceMetrics = new InterceptingOperatorMetricGroup(); final InterceptingOperatorMetricGroup parentMetrics = new InterceptingOperatorMetricGroup() { @Override public MetricGroup addGroup(String name) { return metaspaceMetrics; } }; MetricUtils.instantiateMetaspaceMemoryMetrics(parentMetrics); Assert.assertNotNull(metaspaceMetrics.get(MetricNames.MEMORY_USED)); Assert.assertNotNull(metaspaceMetrics.get(MetricNames.MEMORY_COMMITTED)); Assert.assertNotNull(metaspaceMetrics.get(MetricNames.MEMORY_MAX)); }

Target:
public void testMetaspaceCompleteness() { final InterceptingOperatorMetricGroup metaspaceMetrics = new InterceptingOperatorMetricGroup() { @Override public MetricGroup addGroup(String name) { return this; } }; MetricUtils.instantiateMetaspaceMemoryMetrics(metaspaceMetrics); Assert.assertNotNull(metaspaceMetrics.get(MetricNames.MEMORY_USED)); Assert.assertNotNull(metaspaceMetrics.get(MetricNames.MEMORY_COMMITTED)); Assert.assertNotNull(metaspaceMetrics.get(MetricNames.MEMORY_MAX)); }
Source:
@Override public RelNode transform(int ruleSetIndex, RelTraitSet requiredOutputTraits, RelNode rel) throws RelConversionException { ensure(State.STATE_3_CONVERTED); Program program = m_config.getPrograms().get(ruleSetIndex); return program.run( m_relPlanner, rel, requiredOutputTraits, ImmutableList.of() , ImmutableList.of() ); }

Target:
@Override public RelNode transform(int ruleSetIndex, RelTraitSet requiredOutputTraits, RelNode rel) throws RelConversionException { ensure(State.STATE_3_CONVERTED); requiredOutputTraits = requiredOutputTraits.simplify(); Program program = m_config.getPrograms().get(ruleSetIndex); return program.run( m_relPlanner, rel, requiredOutputTraits, ImmutableList.of() , ImmutableList.of() ); }
Source:
protected BigDecimal parseToBigDecimalInternal(String text) { BigDecimal retVal = null; if (text == null) { text = ""; } else { text = text.trim(); } if (text.length() > 0) { text = ensureSuffix(text); ParsePosition p = new ParsePosition(0); BigDecimal valBeforeRounding = null; DecimalFormat f = getFormat(); List<Character> groupingSeparators = getConfiguredLenientGroupingSeparators(); groupingSeparators.add(0, f.getDecimalFormatSymbols().getGroupingSeparator()); for (char c : groupingSeparators) { p.setIndex(0); DecimalFormatSymbols dfs = f.getDecimalFormatSymbols(); dfs.setGroupingSeparator(c); f.setDecimalFormatSymbols(dfs); BigDecimal parsedVal = (BigDecimal) f.parse(text, p); if (p.getErrorIndex() == -1 && p.getIndex() == text.length()) { valBeforeRounding = parsedVal; break; } } if (valBeforeRounding == null) { throw new ProcessingException(TEXTS.get("InvalidNumberMessageX", text)); } try { retVal = roundParsedValue(valBeforeRounding); } catch (ArithmeticException e) { throw new ProcessingException(TEXTS.get("InvalidNumberMessageX", text)); } if (getMinPossibleValue() != null && retVal.compareTo(NumberUtility.numberToBigDecimal(getMinPossibleValue())) < 0) { throwNumberTooSmall(); } if (getMaxPossibleValue() != null && retVal.compareTo(NumberUtility.numberToBigDecimal(getMaxPossibleValue())) > 0) { throwNumberTooLarge(); } } return retVal; }

Target:
protected BigDecimal parseToBigDecimalInternal(String text) { BigDecimal retVal = null; if (text == null) { text = ""; } else { text = text.trim(); } if (text.length() > 0) { text = ensureSuffix(text); ParsePosition p = new ParsePosition(0); BigDecimal valBeforeRounding = null; BigDecimal parsedVal = (BigDecimal) getFormatInternal().parse(text, p); if (p.getErrorIndex() == -1 && p.getIndex() == text.length()) { valBeforeRounding = parsedVal; } if (valBeforeRounding == null) { valBeforeRounding = parseLenient(text); } if (valBeforeRounding == null) { throw new ProcessingException(TEXTS.get("InvalidNumberMessageX", text)); } try { retVal = roundParsedValue(valBeforeRounding); } catch (ArithmeticException e) { throw new ProcessingException(TEXTS.get("InvalidNumberMessageX", text)); } if (getMinPossibleValue() != null && retVal.compareTo(NumberUtility.numberToBigDecimal(getMinPossibleValue())) < 0) { throwNumberTooSmall(); } if (getMaxPossibleValue() != null && retVal.compareTo(NumberUtility.numberToBigDecimal(getMaxPossibleValue())) > 0) { throwNumberTooLarge(); } } return retVal; }
Source:
public ResourceResponse retrieveResource( URI resourceUri, Map<String, Serializable> requestProperties) throws IOException, ResourceNotFoundException, ResourceNotSupportedException { if (resourceUri == null) { throw new IllegalArgumentException( "Unable to retrieve resource because no resource URI was given"); } Serializable serializableId = null; String username = cswSourceConfiguration.getUsername(); String password = cswSourceConfiguration.getPassword(); if (requestProperties != null) { serializableId = requestProperties.get(Core.ID); if (StringUtils.isNotBlank(username)) { requestProperties.put(USERNAME_PROPERTY, username); requestProperties.put(PASSWORD_PROPERTY, password); } } else { requestProperties = new HashMap<>(); } if (canRetrieveResourceById()) { if (serializableId == null) { throw new ResourceNotFoundException( "Unable to retrieve resource because no metacard ID was found."); } String metacardId = serializableId.toString(); LOGGER.debug("Retrieving resource for ID : {}", metacardId); ResourceResponse response = retrieveResourceById(requestProperties, metacardId); if (response != null) { return response; } } LOGGER.debug("Retrieving resource at : {}", resourceUri); return resourceReader.retrieveResource(resourceUri, requestProperties); }

Target:
public ResourceResponse retrieveResource( URI resourceUri, Map<String, Serializable> requestProperties) throws IOException, ResourceNotFoundException, ResourceNotSupportedException { Serializable serializableId = null; String username = cswSourceConfiguration.getUsername(); String password = cswSourceConfiguration.getPassword(); if (requestProperties != null) { serializableId = requestProperties.get(Core.ID); if (StringUtils.isNotBlank(username)) { requestProperties.put(USERNAME_PROPERTY, username); requestProperties.put(PASSWORD_PROPERTY, password); } } if (canRetrieveResourceById()) { if (serializableId == null) { throw new ResourceNotFoundException( "Unable to retrieve resource because no metacard ID was found."); } String metacardId = serializableId.toString(); LOGGER.debug("Retrieving resource for ID : {}", metacardId); ResourceResponse response = retrieveResourceById(requestProperties, metacardId); if (response != null) { return response; } } if (resourceUri == null) { throw new IllegalArgumentException( "Unable to retrieve resource because no resource URI was given"); } LOGGER.debug("Retrieving resource at : {}", resourceUri); return resourceReader.retrieveResource(resourceUri, requestProperties); }
Source:
public int getThreadOnCpu(long cpuId, long ts) { ITmfStateSystem stateSystem = getStateSystem(); if (stateSystem == null) { return -1; } try { int cpuQuark = stateSystem.getQuarkAbsolute(Attributes.CPUS, Long.toString(cpuId), Attributes.CURRENT_THREAD); ITmfStateInterval interval = stateSystem.querySingleState(ts, cpuQuark); ITmfStateValue val = interval.getStateValue(); switch (val.getType()) { case INTEGER: return val.unboxInt(); case LONG: case DOUBLE: case NULL: case STRING: default: break; } } catch (AttributeNotFoundException | StateSystemDisposedException e) { } return -1; }

Target:
public int getThreadOnCpu(long cpuId, long ts) { ITmfStateSystem ss = getStateSystem(); if (ss == null) { return NO_TID; } try { int cpuQuark = ss.getQuarkAbsolute(Attributes.CPUS, Long.toString(cpuId), Attributes.CURRENT_THREAD); ITmfStateInterval interval = ss.querySingleState(ts, cpuQuark); ITmfStateValue val = interval.getStateValue(); switch (val.getType()) { case INTEGER: return val.unboxInt(); case LONG: case DOUBLE: case NULL: case STRING: default: break; } } catch (AttributeNotFoundException | StateSystemDisposedException e) { } return NO_TID; }
Source:
private static void processTagsWithAttributes(Document doc) { if (allowedAttributes == null) { allowedAttributes = new ArrayList<String>(); allowedAttributes.add("border"); allowedAttributes.add("frame"); allowedAttributes.add("rules"); allowedAttributes.add("valign"); allowedAttributes.add("src"); } Elements tables = doc.select("table"); for (Element table : tables) { removeUnsupportedAttributes(table, true); Elements colgroup = table.select("colgroup"); for (Element c : colgroup) { c.remove(); } removeElements(table, "thead"); removeElements(table, "tfoot"); removeElements(table, "tbody"); Elements rows = table.select("td"); for (Element row : rows) { String[] attributeValues = removeUnsupportedAttributes(row, false); Element tr = null; Element parent = row.parent(); if (parent.tagName().equals("tr")) { tr = parent; } else { Elements siblings = row.siblingElements(); for (Element e : siblings) { if (e.tagName().equals("tr")) { tr = e; break; } } } if (tr != null) { for (int i = 0; i < attributeValues.length; i++) { if (attributeValues[i] != null) { tr.attr(allowedAttributes.get(i), attributeValues[i].toLowerCase()); } } } } rows = table.select("tr"); for (Element row : rows) { removeUnsupportedAttributes(row, true); } } Elements images = doc.select("img"); for (Element image : images) { String[] attributeValues = {null, null, null, null, null}; Attributes attr = image.attributes(); for (Attribute a : attr) { if (allowedAttributes.contains(a.getKey())) { if (!(a.getKey().equals("border") && a.getValue().equals("0"))) { attributeValues[allowedAttributes.indexOf(a.getKey())] = a.getValue(); } } image.removeAttr(a.getKey()); } for (int i = 0; i < attributeValues.length; i++) { if (attributeValues[i] != null) { image.attr(allowedAttributes.get(i), attributeValues[i]); } } } }

Target:
private static void processTagsWithAttributes(Document doc) { if (allowedAttributes == null) { allowedAttributes = new ArrayList<String>(); allowedAttributes.add("border"); allowedAttributes.add("frame"); allowedAttributes.add("rules"); allowedAttributes.add("valign"); allowedAttributes.add("src"); } Elements tables = doc.select("table"); for (Element table : tables) { removeUnsupportedAttributes(table, true); Elements colgroup = table.select("colgroup"); for (Element c : colgroup) { c.remove(); } removeElements(table, "thead"); removeElements(table, "tfoot"); removeElements(table, "tbody"); Elements rows = table.select("td"); for (Element row : rows) { String[] attributeValues = removeUnsupportedAttributes(row, false); Element tr = null; Element parent = row.parent(); if (parent.tagName().equals("tr")) { tr = parent; } else { Elements siblings = row.siblingElements(); for (Element e : siblings) { if (e.tagName().equals("tr")) { tr = e; break; } } } if (tr != null) { for (int i = 0; i < attributeValues.length; i++) { if (attributeValues[i] != null) { tr.attr(allowedAttributes.get(i), attributeValues[i].toLowerCase()); } } } } rows = table.select("tr"); for (Element row : rows) { removeUnsupportedAttributes(row, true); } } Elements images = doc.select("img"); for (Element image : images) { removeUnsupportedAttributes(image, true); } }
Source:
public void rename_noSimilarPrimaryKeyWithOldSchema() { buildInitialMigrationSchema(MigrationClassRenamed.CLASS_NAME, true); RealmMigration migration = new RealmMigration() { @Override public void migrate(DynamicRealm realm, long oldVersion, long newVersion) { realm.getSchema() .rename(MigrationPrimaryKey.CLASS_NAME, MigrationClassRenamed.CLASS_NAME); realm.getSchema() .create(MigrationPrimaryKey.CLASS_NAME) .addField(MigrationPrimaryKey.FIELD_FIRST, Byte.class) .addField(MigrationPrimaryKey.FIELD_SECOND, Short.class) .addField(MigrationPrimaryKey.FIELD_PRIMARY, String.class) .addField(MigrationPrimaryKey.FIELD_FOURTH, Integer.class) .addField(MigrationPrimaryKey.FIELD_FIFTH, Long.class); } }; RealmConfiguration realmConfig = configFactory.createConfigurationBuilder() .schemaVersion(1) .schema(MigrationClassRenamed.class) .migration(migration) .build(); Realm realm = Realm.getInstance(realmConfig); realm.close(); DynamicRealm dynamicRealm = DynamicRealm.getInstance(realmConfig); assertTrue(dynamicRealm.getSchema().get(MigrationClassRenamed.CLASS_NAME).hasPrimaryKey()); assertFalse(dynamicRealm.getSchema().get(MigrationPrimaryKey.CLASS_NAME).hasPrimaryKey()); dynamicRealm.close(); }

Target:
public void rename_noSimilarPrimaryKeyWithOldSchema() { buildInitialMigrationSchema(MigrationClassRenamed.CLASS_NAME, true); RealmMigration migration = new RealmMigration() { @Override public void migrate(DynamicRealm realm, long oldVersion, long newVersion) { realm.getSchema() .rename(MigrationPrimaryKey.CLASS_NAME, MigrationClassRenamed.CLASS_NAME); realm.getSchema() .create(MigrationPrimaryKey.CLASS_NAME) .addField(MigrationPrimaryKey.FIELD_FIRST, Byte.class) .addField(MigrationPrimaryKey.FIELD_SECOND, Short.class) .addField(MigrationPrimaryKey.FIELD_PRIMARY, String.class) .addField(MigrationPrimaryKey.FIELD_FOURTH, Integer.class) .addField(MigrationPrimaryKey.FIELD_FIFTH, Long.class); } }; RealmConfiguration realmConfig = configFactory.createConfigurationBuilder() .schemaVersion(1) .schema(MigrationClassRenamed.class) .migration(migration) .build(); Realm realm = Realm.getInstance(realmConfig); realm.close(); DynamicRealm dynamicRealm = DynamicRealm.getInstance(realmConfig); try { assertTrue(dynamicRealm.getSchema().get(MigrationClassRenamed.CLASS_NAME).hasPrimaryKey()); assertFalse(dynamicRealm.getSchema().get(MigrationPrimaryKey.CLASS_NAME).hasPrimaryKey()); } finally { dynamicRealm.close(); } }
Source:
public List<ClassInfo> getTests() { return flatMap(this.classPath.test(), nameToClassInfo()).filter( and(isWithinATestClass(), isIncludedClass(), not(ClassInfo.matchIfAbstract()), not(ClassInfo.matchIfAnnotationPresentWithValueString(RunWith.class, isRanWith(this.excludedRunners))))); }

Target:
public List<ClassInfo> getTests() { return flatMap(this.classPath.test(), nameToClassInfo()).filter( and(isWithinATestClass(), isIncludedClass(), not(ClassInfo.matchIfAbstract()))); }
Source:
private boolean runFirehoseV2(FirehoseV2 firehose) throws Exception { firehose.start(); log.info("FirehoseV2 started"); final Supplier<Committer> committerSupplier = Committers.supplierFromFirehoseV2(firehose); boolean haveRow = true; while (haveRow) { if (Thread.interrupted()) { return false; } InputRow inputRow = null; int numRows = 0; try { inputRow = firehose.currRow(); if (inputRow != null) { numRows = plumber.add(inputRow, committerSupplier); if (numRows < 0) { metrics.incrementThrownAway(); log.debug("Throwing away event[%s]", inputRow); } else { metrics.incrementProcessed(); } } else { log.debug("thrown away null input row, considering unparseable"); metrics.incrementUnparseable(); } } catch (Exception e) { log.makeAlert(e, "Unknown exception, Ignoring and continuing.") .addData("inputRow", inputRow); } try { haveRow = firehose.advance(); } catch (Exception e) { log.debug(e, "exception in firehose.advance(), considering unparseable row"); metrics.incrementUnparseable(); } } return true; }

Target:
private boolean runFirehoseV2(FirehoseV2 firehose) throws Exception { firehose.start(); log.info("FirehoseV2 started"); final Supplier<Committer> committerSupplier = Committers.supplierFromFirehoseV2(firehose); boolean haveRow = true; while (haveRow) { if (Thread.interrupted() || stopping) { return false; } InputRow inputRow = null; int numRows = 0; try { inputRow = firehose.currRow(); if (inputRow != null) { numRows = plumber.add(inputRow, committerSupplier); if (numRows < 0) { metrics.incrementThrownAway(); log.debug("Throwing away event[%s]", inputRow); } else { metrics.incrementProcessed(); } } else { log.debug("thrown away null input row, considering unparseable"); metrics.incrementUnparseable(); } } catch (Exception e) { log.makeAlert(e, "Unknown exception, Ignoring and continuing.") .addData("inputRow", inputRow); } try { haveRow = firehose.advance(); } catch (Exception e) { log.debug(e, "exception in firehose.advance(), considering unparseable row"); metrics.incrementUnparseable(); } } return true; }
Source:
public void test() { Map<String, Object> mobileEmulation = new HashMap<>(); mobileEmulation.put("userAgent", "Mozilla/5.0 (iPhone; CPU iPhone OS 10_3 like Mac OS X) AppleWebKit/602.1.50 (KHTML, like Gecko) CriOS/56.0.2924.75 Mobile/14E5239e Safari/602.1"); ChromeOptions chromeOptions = new ChromeOptions(); chromeOptions.setExperimentalOption("mobileEmulation", mobileEmulation); driver = new ChromiumHeadlessDriver(chromeOptions, true); connect(); waitResponse(); jq(".z-listbox-body").scrollTop(1000); waitResponse(); click(jq("@listcell:last")); waitResponse(); Assert.assertNotEquals(0, jq(".z-listbox-body").scrollTop()); driver = new ChromiumHeadlessDriver(getWebDriverOptions(), true); }

Target:
public void test() { connect(); waitResponse(); jq(".z-listbox-body").scrollTop(1000); waitResponse(); click(jq("@listcell:last")); waitResponse(); Assert.assertNotEquals(0, jq(".z-listbox-body").scrollTop()); }
Source:
public void tripletsWhoseSumIs12() { List<PythagoreanTriplet> actual = PythagoreanTriplet.makeTripletsList().withFactorsLessThanOrEqualTo(12) .thatSumTo(12).build(); List<PythagoreanTriplet> expected = Arrays.asList(new PythagoreanTriplet(3, 4, 5)); assertEquals(expected.size(), actual.size()); for (int i = 0; i < expected.size(); ++i) { assertEquals(expected.get(i), actual.get(i)); } }

Target:
public void tripletsWhoseSumIs12() { List<PythagoreanTriplet> actual = PythagoreanTriplet .makeTripletsList() .withFactorsLessThanOrEqualTo(12) .thatSumTo(12) .build(); List<PythagoreanTriplet> expected = Collections.singletonList(new PythagoreanTriplet(3, 4, 5)); assertEquals(expected, actual); }
Source:
void loadName() { this.name.setText(currentState.getNameText(getAdapterPosition())); }

Target:
void loadName() { name.setText(currentState.getNameText(getAdapterPosition())); }
Source:
default int compareTo(MountPointChooser other) { Validate.notNull(other, "Other must not be null!"); int compResult = Integer.compare(this.getPriority(), other.getPriority()); return compResult != 0 ? compResult : Integer.compare(this.hashCode(), other.hashCode()); }

Target:
default int compareTo(MountPointChooser other) { Preconditions.checkNotNull(other, "Other must not be null!"); return Integer.compare(this.getPriority(), other.getPriority()); }
Source:
private String getEditUrl(String page, String query) { return urlBuilder.appendQueryStringToURL( urlBuilder.getUrlForPage(String.format("/wiki/%s", page.replace(" ", "_"))), query); }

Target:
private String getEditUrl(String page, String query) { return urlBuilder.appendQueryStringToURL( urlBuilder.getUrlForPage(String.format("/wiki/%s", urlBuilder.normalizePageName(page))), query); }