auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public Observable<ResultSet> updateStatusToFinished(Date timeSlice, UUID jobId) { return session.executeAndFetch(findByIdAndSlice.bind(timeSlice, jobId)).flatMap( (_jobId) -> session.execute(updateStatus.bind((byte) 1, timeSlice, jobId)) .doOnError(t -> logger.warnf("There was an error updating the status to finished for %s in time " + "slice [%s]", jobId, timeSlice.getTime())) ); }

Target:
public Observable<ResultSet> updateStatusToFinished(Date timeSlice, UUID jobId) { return session.executeAndFetch(findByIdAndSlice.bind(timeSlice, jobId)) .isEmpty() .flatMap(empty -> { if (empty) { logger.warnf("Attempt to update status of non-exist job with id %s", jobId); return Observable.empty(); } else { return session.execute(updateStatus.bind((byte) 1, timeSlice, jobId)) .doOnError(t -> logger .warnf("There was an error updating the status to finished for %s in time " + "slice [%s]", jobId, timeSlice.getTime())); } }); }
Source:
public Verification withAudience(String... audience) { requireClaim(PublicClaims.AUDIENCE, audience); return this; }

Target:
public Verification withAudience(String... audience) { requireClaim(PublicClaims.AUDIENCE, audience == null ? null : Arrays.asList(audience)); return this; }
Source:
public ReportInfoFragment newReportInfoFragment(@NonNull Trip trip) { Bundle args = new Bundle(); args.putParcelable(Trip.Companion.getPARCEL_KEY(), trip); return attachArguments(ReportInfoFragment.newInstance(), args); }

Target:
public ReportInfoFragment newReportInfoFragment(@NonNull Trip trip) { Bundle args = new Bundle(); args.putParcelable(Trip.PARCEL_KEY, trip); return attachArguments(ReportInfoFragment.newInstance(), args); }
Source:
private void getSCMSignedCert(OzoneConfiguration config) { try { PKCS10CertificationRequest csr = getCSR(config); SCMSecurityProtocol secureScmClient = HddsUtils.getScmSecurityClient(config, HddsUtils.getScmAddressForSecurityProtocol(config)); String pemEncodedCert = secureScmClient.getDataNodeCertificate( datanodeDetails.getProtoBufMessage(), getEncodedString(csr)); dnCertClient.storeCertificate(pemEncodedCert, true, false); datanodeDetails.setCertSerialId(getX509Certificate(pemEncodedCert). getSerialNumber().toString()); persistDatanodeDetails(datanodeDetails); String pemEncodedRootCert = secureScmClient.getCACertificate(); dnCertClient.storeCertificate(pemEncodedRootCert, true, true); } catch (IOException | CertificateException e) { LOG.error("Error while storing SCM signed certificate.", e); throw new RuntimeException(e); } }

Target:
private void getSCMSignedCert(OzoneConfiguration config) { try { PKCS10CertificationRequest csr = getCSR(config); SCMSecurityProtocol secureScmClient = HddsUtils.getScmSecurityClient(config, HddsUtils.getScmAddressForSecurityProtocol(config)); String pemEncodedCert = secureScmClient.getDataNodeCertificate( datanodeDetails.getProtoBufMessage(), getEncodedString(csr)); dnCertClient.storeCertificate(pemEncodedCert, true); datanodeDetails.setCertSerialId(getX509Certificate(pemEncodedCert). getSerialNumber().toString()); persistDatanodeDetails(datanodeDetails); String pemEncodedRootCert = secureScmClient.getCACertificate(); dnCertClient.storeCertificate(pemEncodedRootCert, true, true); } catch (IOException | CertificateException e) { LOG.error("Error while storing SCM signed certificate.", e); throw new RuntimeException(e); } }
Source:
private void setScrollListener() { gridView.setOnScrollListener(new AbsListView.OnScrollListener() { @Override public void onScrollStateChanged(AbsListView view, int scrollState) { view.setFastScrollEnabled(scrollState!=SCROLL_STATE_IDLE); } @Override public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) { if (hasMoreImages && !isLoading && (firstVisibleItem + visibleItemCount + 1 >= totalItemCount)) { isLoading = true; fetchMoreImages(); } if (!hasMoreImages){ progressBar.setVisibility(GONE); } } }); }

Target:
private void setScrollListener() { gridView.setOnScrollListener(new AbsListView.OnScrollListener() { @Override public void onScrollStateChanged(AbsListView view, int scrollState) { } @Override public void onScroll(AbsListView view, int firstVisibleItem, int visibleItemCount, int totalItemCount) { if (hasMoreImages && !isLoading && (firstVisibleItem + visibleItemCount + 1 >= totalItemCount)) { isLoading = true; fetchMoreImages(); } if (!hasMoreImages){ progressBar.setVisibility(GONE); } } }); }
Source:
public boolean isDeleted(ArtifactId artifact) { return ((ArtifactReadable) artifact).isDeleted(); }

Target:
public boolean isDeleted(ArtifactId artifact) { return atsServer.getArtifact(artifact).isDeleted(); }
Source:
public static Date toDate(String sDate) { try { SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); return sdf.parse(sDate); } catch (ParseException e) { throw new RuntimeException(e); } }

Target:
public static Date toDate(String sDate) { return Date.from(LocalDate.parse(sDate).atStartOfDay(ZoneId.systemDefault()).toInstant()); }
Source:
private GrillClientResultSetWithStats getResultsFromStatement(GrillStatement statement) { QueryStatus.Status status = statement.getStatus().getStatus(); if(status != QueryStatus.Status.SUCCESSFUL) { throw new IllegalStateException(statement.getStatus().getStatusMessage() + " cause:" + statement.getStatus().getErrorMessage()); } GrillClientResultSet result = new GrillClientResultSet(statement.getResultSet(), statement.getResultSetMetaData()); return new GrillClientResultSetWithStats(result, statement.getQuery()); }

Target:
private GrillClientResultSetWithStats getResultsFromStatement(GrillStatement statement) { QueryStatus.Status status = statement.getStatus().getStatus(); if(status != QueryStatus.Status.SUCCESSFUL) { throw new IllegalStateException(statement.getStatus().getStatusMessage() + " cause:" + statement.getStatus().getErrorMessage()); } GrillClientResultSet result = null; if (statement.getStatus().isResultSetAvailable()) { result = new GrillClientResultSet(statement.getResultSet(), statement.getResultSetMetaData()); } return new GrillClientResultSetWithStats(result, statement.getQuery()); }
Source:
public Long getMaximumExistingDatafileIdentifier(Dataset dataset) { long zeroFiles = new Long(0); Long retVal = zeroFiles; Long testVal; List<Object> idResults; Long dsId = dataset.getId(); if (dsId != null) { try { idResults = em.createNativeQuery("select o.identifier from dvobject o " + "where o.owner_Id = " + dsId + "").getResultList(); } catch (NoResultException ex) { logger.fine("No files found in dataset id " + dsId + ". Returning a count of zero."); return zeroFiles; } if (idResults != null) { for (Object raw: idResults){ String identifier = (String) raw; identifier = identifier.substring(identifier.lastIndexOf("/") + 1); testVal = new Long(identifier) ; if (testVal > retVal){ retVal = testVal; } } } } return retVal; }

Target:
public Long getMaximumExistingDatafileIdentifier(Dataset dataset) { long zeroFiles = new Long(0); Long retVal = zeroFiles; Long testVal; List<Object> idResults; Long dsId = dataset.getId(); if (dsId != null) { try { idResults = em.createNamedQuery("Dataset.findByOwnerIdentifier") .setParameter("owner_id", dsId).getResultList(); } catch (NoResultException ex) { logger.fine("No files found in dataset id " + dsId + ". Returning a count of zero."); return zeroFiles; } if (idResults != null) { for (Object raw: idResults){ String identifier = (String) raw; identifier = identifier.substring(identifier.lastIndexOf("/") + 1); testVal = new Long(identifier) ; if (testVal > retVal){ retVal = testVal; } } } } return retVal; }
Source:
@Test public void noUsernameOrPassphrase() throws Exception { final String credentialsId = "creds"; final String keyContent = "the-key"; story.addStep(new Statement() { @Override public void evaluate() throws Throwable { SSHUserPrivateKey c = new DummyPrivateKey(credentialsId, "", "", keyContent); CredentialsProvider.lookupStores(story.j.jenkins).iterator().next().addCredentials(Domain.global(), c); WorkflowJob p = story.j.jenkins.createProject(WorkflowJob.class, "p"); p.setDefinition(new CpsFlowDefinition("" + "node {\n" + " withCredentials([sshUserPrivateKey(keyFileVariable: 'THEKEY', credentialsId: '" + credentialsId + "')]) {\n" + " semaphore 'basics'\n" + " sh '''\n" + " set +x\n" + " cat $THEKEY > key.txt" + " '''\n" + " }\n" + "}", true)); WorkflowRun b = p.scheduleBuild2(0).waitForStart(); SemaphoreStep.waitForStart("basics/1", b); } }); story.addStep(new Statement() { @Override public void evaluate() throws Throwable { WorkflowJob p = story.j.jenkins.getItemByFullName("p", WorkflowJob.class); assertNotNull(p); WorkflowRun b = p.getBuildByNumber(1); assertNotNull(b); SemaphoreStep.success("basics/1", null); story.j.waitForCompletion(b); story.j.assertBuildStatusSuccess(b); FilePath key = story.j.jenkins.getWorkspaceFor(p).child("key.txt"); assertTrue(key.exists()); assertEquals(keyContent, key.readToString().trim()); } }); }

Target:
@Test public void noUsernameOrPassphrase() throws Exception { final String credentialsId = "creds"; final String keyContent = "the-key"; story.addStep(new Statement() { @Override public void evaluate() throws Throwable { SSHUserPrivateKey c = new DummyPrivateKey(credentialsId, "", "", keyContent); CredentialsProvider.lookupStores(story.j.jenkins).iterator().next().addCredentials(Domain.global(), c); WorkflowJob p = story.j.jenkins.createProject(WorkflowJob.class, "p"); String script; if (Functions.isWindows()) { script = " bat '''\n" + " @echo off\n" + " type \"%THEKEY%\" > key.txt" + " '''\n"; } else { script = " sh '''\n" + " cat $THEKEY > key.txt" + " '''\n"; } p.setDefinition(new CpsFlowDefinition("" + "node {\n" + " withCredentials([sshUserPrivateKey(keyFileVariable: 'THEKEY', credentialsId: '" + credentialsId + "')]) {\n" + " semaphore 'basics'\n" + script + " }\n" + "}", true)); WorkflowRun b = p.scheduleBuild2(0).waitForStart(); SemaphoreStep.waitForStart("basics/1", b); } }); story.addStep(new Statement() { @Override public void evaluate() throws Throwable { WorkflowJob p = story.j.jenkins.getItemByFullName("p", WorkflowJob.class); assertNotNull(p); WorkflowRun b = p.getBuildByNumber(1); assertNotNull(b); SemaphoreStep.success("basics/1", null); story.j.waitForCompletion(b); story.j.assertBuildStatusSuccess(b); FilePath key = story.j.jenkins.getWorkspaceFor(p).child("key.txt"); assertTrue(key.exists()); assertEquals(keyContent, key.readToString().trim()); } }); }
Source:
private UserTuneManager(XMPPConnection connection) throws NotLoggedInException { super(connection); PepManager.getInstanceFor(connection).addPepListener(new PepListener() { @Override public void eventReceived(EntityBareJid from, EventElement event, Message message) { if (!USERTUNE_NODE.equals(event.getEvent().getNode())) { return; } final BareJid contact = from.asBareJid(); asyncButOrdered.performAsyncButOrdered(contact, new Runnable() { @Override public void run() { ItemsExtension items = (ItemsExtension) event.getExtensions().get(0); PayloadItem<?> payload = (PayloadItem) items.getItems().get(0); UserTuneElement tune = (UserTuneElement) payload.getPayload(); for (UserTuneListener listener : userTuneListeners) { listener.onUserTuneUpdated(contact, message, tune); } } }); } }); ServiceDiscoveryManager.getInstanceFor(connection).addFeature(USERTUNE_NOTIFY); pubSubManager = PubSubManager.getInstanceFor(getAuthenticatedConnectionOrThrow(), connection().getUser().asBareJid()); }

Target:
private UserTuneManager(XMPPConnection connection) throws NotLoggedInException { super(connection); pepManager = PepManager.getInstanceFor(connection); pepManager.addPepListener(new PepListener() { @Override public void eventReceived(EntityBareJid from, EventElement event, Message message) { if (!USERTUNE_NODE.equals(event.getEvent().getNode())) { return; } final BareJid contact = from.asBareJid(); asyncButOrdered.performAsyncButOrdered(contact, () -> { ItemsExtension items = (ItemsExtension) event.getExtensions().get(0); PayloadItem<?> payload = (PayloadItem) items.getItems().get(0); UserTuneElement tune = (UserTuneElement) payload.getPayload(); for (UserTuneListener listener : userTuneListeners) { synchronized (userTuneListeners) { listener.onUserTuneUpdated(contact, message, tune); } } }); } }); if (ENABLE_USER_TUNE_NOTIFICATIONS_BY_DEFAULT) { enableUserTuneNotifications(); } }
Source:
private void parseNext() { if (eventStreamReader != null) { try { long startTime = System.currentTimeMillis(); dataBuffer.setLength(0); String line; while ((line = eventStreamReader.readLine()) != null) { int colonIndex; if (line.trim().isEmpty()) { break; } else if (line.startsWith(":")) { } else if ((colonIndex = line.indexOf(":")) != -1) { String field = line.substring(0, colonIndex); String value = line.substring(colonIndex + 1).replaceFirst(" ", EMPTY_STRING); processField(field, value); } else { processField(line.trim(), EMPTY_STRING); } } if (line == null) { endOfStreamReached = true; close(); } if (dataBuffer.length() > 0) { String data = dataBuffer.toString(); if (data.endsWith("\n")) { data = data.substring(0, data.length() - 1); } nextMessage = new StreamMessage(eventNameBuffer, lastEventId, data); } else { log.debug(eventNameBuffer.toString()); eventNameBuffer = EMPTY_STRING; nextMessage = null; } if (log.isDebugEnabled()) { log.debug("total stream message read/parse time (ms): " + (System.currentTimeMillis() - startTime)); } } catch (IOException ex) { log.error("failed to parse next stream event", ex); throw new SignalFlowException("failed to parse next stream event", ex); } } else { nextMessage = null; } }

Target:
private void parseNext() { if (eventStreamReader != null) { try { long startTime = System.currentTimeMillis(); dataBuffer.setLength(0); String line; while ((line = eventStreamReader.readLine()) != null) { int colonIndex; if (line.trim().isEmpty()) { break; } else if (line.startsWith(":")) { } else if ((colonIndex = line.indexOf(":")) != -1) { String field = line.substring(0, colonIndex); String value = line.substring(colonIndex + 1).replaceFirst(" ", EMPTY_STRING); processField(field, value); } else { processField(line.trim(), EMPTY_STRING); } } if (line == null) { endOfStreamReached = true; close(); } if (dataBuffer.length() > 0) { String data = dataBuffer.toString(); if (data.endsWith("\n")) { data = data.substring(0, data.length() - 1); } nextMessage = new StreamMessage(eventNameBuffer, lastEventId, data); } else { log.debug(eventNameBuffer.toString()); eventNameBuffer = EMPTY_STRING; nextMessage = null; } log.debug("total stream message read/parse time (ms): {}", (System.currentTimeMillis() - startTime)); } catch (IOException ex) { log.error("failed to parse next stream event", ex); throw new SignalFlowException("failed to parse next stream event", ex); } } else { nextMessage = null; } }
Source:
private ResultSet bindAndExecute(Object[] columnValues, RegularStatement statement) { try { PreparedStatement preparedStatement = session.prepare( statement ); BoundStatement boundStatement = new BoundStatement( preparedStatement ); for ( int i = 0; i < columnValues.length; i++ ) { DataType dataType = preparedStatement.getVariables().getType( i ); boundStatement.setBytesUnsafe( i, dataType.serialize( columnValues[i], protocolVersion ) ); } return session.execute( boundStatement ); } catch (DriverException e) { log.failToExecuteCQL( statement.getQueryString(), e ); return null; } }

Target:
private ResultSet bindAndExecute(Object[] columnValues, RegularStatement statement) { try { PreparedStatement preparedStatement = session.prepare( statement ); BoundStatement boundStatement = new BoundStatement( preparedStatement ); for ( int i = 0; i < columnValues.length; i++ ) { DataType dataType = preparedStatement.getVariables().getType( i ); boundStatement.setBytesUnsafe( i, dataType.serialize( columnValues[i], protocolVersion ) ); } return session.execute( boundStatement ); } catch (DriverException e) { log.failToExecuteCQL( statement.getQueryString(), e ); throw e; } }
Source:
private String getDestinationKey(String auxItemTag) throws IOException { if (dvObject instanceof DataFile) { if (key == null) { String baseKey = this.getDataFile().getOwner().getAuthority() + "/" + this.getDataFile().getOwner().getIdentifier(); String storageIdentifier = dvObject.getStorageIdentifier(); if (storageIdentifier == null || "".equals(storageIdentifier)) { throw new FileNotFoundException("Data Access: No local storage identifier defined for this datafile."); } if (storageIdentifier.startsWith("s3://")) { bucketName = storageIdentifier.substring(storageIdentifier.indexOf(":") + 3, storageIdentifier.lastIndexOf(":")); key = baseKey + "/" + storageIdentifier.substring(storageIdentifier.lastIndexOf(":") + 1); } else { throw new IOException("S3AccessIO: DataFile (storage identifier "+storageIdentifier+") does not appear to be an S3 object."); } } return key + "." + auxItemTag; } else if (dvObject instanceof Dataset) { return key + "/" + auxItemTag; } else { throw new IOException("S3AccessIO: This operation is only supported for Datasets and DataFiles."); } }

Target:
private String getDestinationKey(String auxItemTag) throws IOException { if (dvObject instanceof DataFile) { return getMainFileKey() + "." + auxItemTag; } else if (dvObject instanceof Dataset) { return key + "/" + auxItemTag; } else { throw new IOException("S3AccessIO: This operation is only supported for Datasets and DataFiles."); } }
Source:
protected Map<String, String> resolveProperties(Map<String, String> originalProperties, Map<String, String> properties, Boolean overrideProperties) { if (properties != null) { if (!overrideProperties) { properties.putAll(originalProperties); } originalProperties = properties; } return originalProperties; }

Target:
protected Map<String, String> resolveProperties(Map<String, String> originalProperties, Map<String, String> properties, Boolean overrideProperties) { if (properties != null) { if (!overrideProperties) { properties.putAll(originalProperties); } return properties; } return originalProperties; }
Source:
protected void doStart() { super.doStart(); if (this.idleEventInterval > 0) { this.getRequiredTaskScheduler().scheduleWithFixedDelay(() -> { long now = System.currentTimeMillis(); long lastAlertAt = FileTailingMessageProducerSupport.this.lastNoMessageAlert.get(); long lastReceive = FileTailingMessageProducerSupport.this.lastReceive; if (now > lastReceive + FileTailingMessageProducerSupport.this.idleEventInterval && now > lastAlertAt + FileTailingMessageProducerSupport.this.idleEventInterval && FileTailingMessageProducerSupport.this.lastNoMessageAlert.compareAndSet(lastAlertAt, now)) { publishIdleEvent(now - lastReceive); } }, this.idleEventInterval); } }

Target:
protected void doStart() { super.doStart(); if (this.idleEventInterval > 0) { this.idleEventScheduledFuture = getTaskScheduler().scheduleWithFixedDelay(() -> { long now = System.currentTimeMillis(); long lastAlertAt = this.lastNoMessageAlert.get(); long lastProduce = this.lastProduce; if (now > lastProduce + this.idleEventInterval && now > lastAlertAt + this.idleEventInterval && this.lastNoMessageAlert.compareAndSet(lastAlertAt, now)) { publishIdleEvent(now - lastProduce); } }, this.idleEventInterval); } }
Source:
public EurekaArchaius2ClientConfig(Config config, String namespace) { this.defaultRegion = config.getString("@region", null); this.config = config.getPrefixedView(DEFAULT_NAMESPACE); }

Target:
public EurekaArchaius2ClientConfig(Config config, String namespace) { this.defaultRegion = config.getString("@region", null); this.config = config.getPrefixedView(namespace); }
Source:
private WrappedServletRequest wrapGzippedRequest(HttpServletRequest request) throws IOException { try { GZIPInputStream input = new GZIPInputStream(request.getInputStream(), inputBufferSize); InputStream exceptionHandlingInput = new ZipExceptionHandlingInputStream(input, GZIP); return new WrappedServletRequest(request, exceptionHandlingInput); } catch (ZipException e) { throw ZipExceptionHandlingInputStream.buildBadDataException(GZIP, e); } catch (EOFException e) { throw ZipExceptionHandlingInputStream.buildPrematureEofException(GZIP, e); } }

Target:
private WrappedServletRequest wrapGzippedRequest(HttpServletRequest request) throws IOException { try { final GZIPInputStream input = new GZIPInputStream(request.getInputStream(), inputBufferSize); return new WrappedServletRequest(request, new ZipExceptionHandlingInputStream(input, GZIP)); } catch (IOException e) { throw ZipExceptionHandlingInputStream.handleException(GZIP, e); } }
Source:
public Array<?> getSelectedNodes() { return tree.getSelectionModel().getSelectedNodes(); }

Target:
public Array<TreeNode<?>> getSelectedNodes() { return tree.getSelectionModel().getSelectedNodes(); }
Source:
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { final HttpServletRequest httpRequest = (HttpServletRequest) request; final HttpServletResponse httpResponse = (HttpServletResponse) response; if (cacheFilterPatternMathes(httpRequest)) { HttpServletResponseWrapper responseWrapper = getCacheHeaderResponseWrapper(httpResponse); httpResponse.setHeader(CACHE_CONTROL, CACHE_YEAR); httpResponse.setHeader(EXPIRES, getNowPlusYearHttpDate()); chain.doFilter(request, responseWrapper); } else if (noCacheFilterPatternMatches(httpRequest)) { chain.doFilter(request, response); httpResponse.setHeader(CACHE_CONTROL, NO_CACHE); httpResponse.setHeader(EXPIRES, getYesterdayHttpDate()); } else { chain.doFilter(request, response); } }

Target:
public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) throws IOException, ServletException { final HttpServletRequest httpRequest = (HttpServletRequest) request; final HttpServletResponse httpResponse = (HttpServletResponse) response; if (cacheFilterPatternMatches(httpRequest)) { HttpServletResponseWrapper responseWrapper = getCacheHeaderResponseWrapper(httpResponse); httpResponse.setHeader(CACHE_CONTROL, CACHE_YEAR); httpResponse.setHeader(EXPIRES, getNowPlusYearHttpDate()); chain.doFilter(request, responseWrapper); } else if (noCacheFilterPatternMatches(httpRequest)) { chain.doFilter(request, response); httpResponse.setHeader(CACHE_CONTROL, NO_CACHE); httpResponse.setHeader(EXPIRES, getYesterdayHttpDate()); } else { chain.doFilter(request, response); } }
Source:
private void updateEid() { boolean shouldHaveEid = false; String eid = null; if (mTelephonyManager.getPhoneCount() > PhoneConstants.MAX_PHONE_COUNT_SINGLE_SIM) { Map<Integer, Integer> slotMapping = mTelephonyManager.getLogicalToPhysicalSlotMapping(); Integer physicalSlotId = slotMapping.get(mSlotId); if (physicalSlotId != null) { List<UiccCardInfo> infos = mTelephonyManager.getUiccCardsInfo(); for (UiccCardInfo info : infos) { if (info.getSlotIndex() == physicalSlotId.intValue()) { if (info.isEuicc()) { shouldHaveEid = true; eid = info.getEid(); if (TextUtils.isEmpty(eid)) { eid = mEuiccManager.createForCardId(info.getCardId()).getEid(); } } break; } } } } else { if (mEuiccManager.isEnabled()) { shouldHaveEid = true; eid = mEuiccManager.getEid(); } } if (TextUtils.isEmpty(eid)) { if (!shouldHaveEid) { mDialog.removeSettingFromScreen(EID_INFO_LABEL_ID); mDialog.removeSettingFromScreen(EID_INFO_VALUE_ID); } } else { mDialog.setText(EID_INFO_VALUE_ID, eid); } }

Target:
private void updateEid() { boolean shouldHaveEid = false; String eid = null; if (mTelephonyManager.getPhoneCount() > PhoneConstants.MAX_PHONE_COUNT_SINGLE_SIM) { Map<Integer, Integer> mapping = mTelephonyManager.getLogicalToPhysicalSlotMapping(); int pSlotId = mapping.getOrDefault(mSlotId, SubscriptionManager.INVALID_SIM_SLOT_INDEX); if (pSlotId != SubscriptionManager.INVALID_SIM_SLOT_INDEX) { List<UiccCardInfo> infos = mTelephonyManager.getUiccCardsInfo(); for (UiccCardInfo info : infos) { if (info.getSlotIndex() == pSlotId) { if (info.isEuicc()) { shouldHaveEid = true; eid = info.getEid(); if (TextUtils.isEmpty(eid)) { eid = mEuiccManager.createForCardId(info.getCardId()).getEid(); } } break; } } } } else if (mEuiccManager.isEnabled()) { shouldHaveEid = true; eid = mEuiccManager.getEid(); } if (!shouldHaveEid) { mDialog.removeSettingFromScreen(EID_INFO_LABEL_ID); mDialog.removeSettingFromScreen(EID_INFO_VALUE_ID); } else if (!TextUtils.isEmpty(eid)) { mDialog.setText(EID_INFO_VALUE_ID, eid); } }
Source:
protected ReversedScannerCallable createScannerCallable() { int replicaId = (scan.getConsistency() == Consistency.TIMELINE) ? scan.getReplicaId() : 0; return new ReversedScannerCallable(getConnection(), getTable(), scan, this.scanMetrics, this.rpcControllerFactory, replicaId); }

Target:
protected ReversedScannerCallable createScannerCallable() { return new ReversedScannerCallable(getConnection(), getTable(), scan, this.scanMetrics, this.rpcControllerFactory, getScanReplicaId()); }
Source:
private void preRenderSetupSceneReflectiveRefractive() { sceneReflectiveRefractive = dynamicFBM.getFBO(REFRACTIVE_REFLECTIVE_URN); sceneReflectiveRefractive.bind(); if (isHeadUnderWater) { GL11.glDisable(GL11.GL_CULL_FACE); } }

Target:
private void preRenderSetupSceneReflectiveRefractive() { sceneReflectiveRefractive = displayResolutionDependentFBOs.get(REFRACTIVE_REFLECTIVE); sceneReflectiveRefractive.bind(); if (isHeadUnderWater) { GL11.glDisable(GL11.GL_CULL_FACE); } }
Source:
public int getUnmeteredDevices(String os) { if (os.equalsIgnoreCase("Android")) { return getAccountSettings().getUnmeteredDevices().get("ANDROID"); } else if (os.equalsIgnoreCase("IOS")) { return getAccountSettings().getUnmeteredDevices().get("IOS"); } else { return 0; } }

Target:
public int getUnmeteredDevices(String os) { AccountSettings accountSettings = getAccountSettings(); if (accountSettings == null) { return 0; } else if (os.equalsIgnoreCase("ANDROID")) { return getAccountSettings().getUnmeteredDevices().get("ANDROID"); } else if (os.equalsIgnoreCase("IOS")) { return getAccountSettings().getUnmeteredDevices().get("IOS"); } else { return 0; } }
Source:
private List<CertificationCriterionEntity> getAllEntities() { Query query = entityManager.createQuery( "SELECT cce " + "FROM CertificationCriterionEntity cce " + "WHERE cce.id IN ( " + "SELECT c.id FROM CertificationCriterionEntity c " + "LEFT JOIN c.certificationResult cr " + "LEFT JOIN cr.certifiedProduct cp " + "LEFT JOIN cr.certificationResultTestTool crtt " + "LEFT JOIN crtt.testTool tt " + "WHERE (tt.retired = true AND cp.icsCode = '1') OR (tt.retired = false) AND c.deleted = false)" , CertificationCriterionEntity.class); List<CertificationCriterionEntity> result = query.getResultList(); return result; }

Target:
private List<CertificationCriterionEntity> getAllEntities() { Query query = entityManager.createQuery( "SELECT cce " + "FROM CertificationCriterionEntity cce " + "WHERE cce.id IN ( " + "SELECT c.id FROM CertificationCriterionEntity c " + "LEFT JOIN c.certificationResult cr " + "LEFT JOIN cr.certifiedProduct cp " + "LEFT JOIN cr.certificationResultTestTool crtt " + "LEFT JOIN crtt.testTool tt " + "WHERE (tt.retired = true AND CAST(cp.icsCode as integer) >= 1) OR (tt.retired = false) AND c.deleted = false)" , CertificationCriterionEntity.class); List<CertificationCriterionEntity> result = query.getResultList(); return result; }
Source:
public void bindFieldNull() throws SQLException { final List<Schema> nullableTypes = Arrays.asList( Schema.INT8_SCHEMA, Schema.INT16_SCHEMA, Schema.INT32_SCHEMA, Schema.INT64_SCHEMA, Schema.FLOAT32_SCHEMA, Schema.FLOAT64_SCHEMA, Schema.BOOLEAN_SCHEMA, Schema.BYTES_SCHEMA, Schema.STRING_SCHEMA ); int index = 0; for (Schema schema : nullableTypes) { verifyBindField(++index, schema, null).setObject(index, null); } }

Target:
public void bindFieldNull() throws SQLException { final List<Schema> nullableTypes = Arrays.asList( Schema.INT8_SCHEMA, Schema.INT16_SCHEMA, Schema.INT32_SCHEMA, Schema.INT64_SCHEMA, Schema.FLOAT32_SCHEMA, Schema.FLOAT64_SCHEMA, Schema.BOOLEAN_SCHEMA, Schema.BYTES_SCHEMA, Schema.STRING_SCHEMA, Decimal.schema(0), Date.SCHEMA, Time.SCHEMA, Timestamp.SCHEMA ); int index = 0; for (Schema schema : nullableTypes) { verifyBindField(++index, schema, null).setObject(index, null); } }
Source:
public InputStream copyContainer(String containerId, String path) throws DockerException, InterruptedException { final String apiVersion = version().apiVersion(); final int versionComparison = compareVersion(apiVersion, "1.20"); if (versionComparison < 0) { return doCopyContainer(containerId, path); } else { return doArchiveContainer(containerId, path); } }

Target:
public InputStream copyContainer(String containerId, String path) throws DockerException, InterruptedException { final String apiVersion = version().apiVersion(); final int versionComparison = compareVersion(apiVersion, "1.24"); if (versionComparison >= 0) { throw new UnsupportedApiVersionException(apiVersion); } final WebTarget resource = resource() .path("containers").path(containerId).path("copy"); final JsonNodeFactory nf = JsonNodeFactory.instance; final JsonNode params = nf.objectNode().set("Resource", nf.textNode(path)); try { return request(POST, InputStream.class, resource, resource.request(APPLICATION_OCTET_STREAM_TYPE), Entity.json(params)); } catch (DockerRequestException e) { switch (e.status()) { case 404: throw new ContainerNotFoundException(containerId, e); default: throw e; } } }
Source:
public void viewInfoUpdated() { this.reinitialize(); }

Target:
public void viewInfoUpdated() { reinitialize(); }
Source:
protected void addMetaList(String key, Object value, Hashtable<String, Object> meta) { Vector list = (Vector) meta.get(key); meta.remove(key); addMeta(key, value, meta); Object newValue = meta.get(key); meta.remove(key); if (newValue != null) { if (list == null) { list = new Vector(); } list.add(newValue); meta.put(key, list); } else if (list != null) { meta.put(key, list); } }

Target:
protected void addMetaList(String key, Object value, Hashtable<String, Object> meta) { Vector list = (Vector) meta.remove(key); addMeta(key, value, meta); Object newValue = meta.remove(key); if (newValue != null) { if (list == null) { list = new Vector(); } list.add(newValue); meta.put(key, list); } else if (list != null) { meta.put(key, list); } }
Source:
public ImmutableHideData asImmutable() { return new ImmutableSpongeHideData(this.enchantments, this.attributes, this.unbreakable, this.canDestroy, this.canPlace, this.miscellaneous); }

Target:
public ImmutableHideData asImmutable() { return ImmutableDataCachingUtil.getManipulator(ImmutableSpongeHideData.class, this.enchantments, this.attributes, this.unbreakable, this.canDestroy, this.canPlace, this.miscellaneous); }
Source:
public void startService() { super.startService(); this.addServoEventListener(this); }

Target:
public void startService() { super.startService(); if (isEventsEnabled) { this.addServoEventListener(this); } }
Source:
public static <T, R> Single<R> zip(final Single<? extends T>[] singles, final FuncN<? extends R> zipper) { return Single.create(new Single.OnSubscribe<R>() { @Override public void call(final SingleSubscriber<? super R> subscriber) { final AtomicInteger wip = new AtomicInteger(singles.length); final AtomicBoolean once = new AtomicBoolean(); final Object[] values = new Object[singles.length]; CompositeSubscription compositeSubscription = new CompositeSubscription(); subscriber.add(compositeSubscription); for (int i = 0; i < singles.length; i++) { if (compositeSubscription.isUnsubscribed() || once.get()) { break; } final int j = i; SingleSubscriber<T> singleSubscriber = new SingleSubscriber<T>() { @Override public void onSuccess(T value) { values[j] = value; if (wip.decrementAndGet() == 0) { R r; try { r = zipper.call(values); } catch (Throwable e) { Exceptions.throwIfFatal(e); subscriber.onError(e); return; } subscriber.onSuccess(r); } } @Override public void onError(Throwable error) { if (once.compareAndSet(false, true)) { subscriber.onError(error); } else { RxJavaPlugins.getInstance().getErrorHandler().handleError(error); } } }; compositeSubscription.add(singleSubscriber); if (compositeSubscription.isUnsubscribed() || once.get()) { break; } singles[i].subscribe(singleSubscriber); } } }); }

Target:
public static <T, R> Single<R> zip(final Single<? extends T>[] singles, final FuncN<? extends R> zipper) { return Single.create(new Single.OnSubscribe<R>() { @Override public void call(final SingleSubscriber<? super R> subscriber) { final AtomicInteger wip = new AtomicInteger(singles.length); final AtomicBoolean once = new AtomicBoolean(); final Object[] values = new Object[singles.length]; CompositeSubscription compositeSubscription = new CompositeSubscription(); subscriber.add(compositeSubscription); for (int i = 0; i < singles.length; i++) { if (compositeSubscription.isUnsubscribed() || once.get()) { break; } final int j = i; SingleSubscriber<T> singleSubscriber = new SingleSubscriber<T>() { @Override public void onSuccess(T value) { values[j] = value; if (wip.decrementAndGet() == 0) { R r; try { r = zipper.call(values); } catch (Throwable e) { Exceptions.throwIfFatal(e); onError(e); return; } subscriber.onSuccess(r); } } @Override public void onError(Throwable error) { if (once.compareAndSet(false, true)) { subscriber.onError(error); } else { RxJavaPlugins.getInstance().getErrorHandler().handleError(error); } } }; compositeSubscription.add(singleSubscriber); if (compositeSubscription.isUnsubscribed() || once.get()) { break; } singles[i].subscribe(singleSubscriber); } } }); }
Source:
private HttpPipeline setupPipeline(HttpClient httpClient) { List<HttpPipelinePolicy> policies = new ArrayList<>(); HttpLogOptions httpLogOptions = new HttpLogOptions(); HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(new RetryPolicy()); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(httpLogOptions)); HttpClient client = httpClient != null ? httpClient : HttpClient.createDefault(); return new HttpPipelineBuilder().httpClient(client) .policies(policies.toArray(new HttpPipelinePolicy[0])).build(); }

Target:
private HttpPipeline setupPipeline(HttpClient httpClient) { List<HttpPipelinePolicy> policies = new ArrayList<>(); HttpLogOptions httpLogOptions = new HttpLogOptions(); HttpPolicyProviders.addBeforeRetryPolicies(policies); policies.add(new RetryPolicy()); HttpPolicyProviders.addAfterRetryPolicies(policies); policies.add(new HttpLoggingPolicy(httpLogOptions)); return new HttpPipelineBuilder().httpClient(httpClient) .policies(policies.toArray(new HttpPipelinePolicy[0])).build(); }
Source:
public T get(Prolog engine) { T r = getOrNull(engine); if (r == null) { String msg = key.toString(); throw new SystemException(msg); } return r; }

Target:
public T get(Prolog engine) { T obj = getOrNull(engine); if (obj == null) { obj = createValue(engine); if (obj == null) { throw new SystemException("No " + key + " available"); } set(engine, obj); } return obj; }
Source:
private void convertRequireForAlreadyConverted(ModuleImport moduleImport) { String originalPath = moduleImport.requiredNamespace.replace(alreadyConvertedPrefix + ".", "").replace(".", "/"); String referencedFile = pathUtil.getImportPath(moduleImport.originalImportNode.getSourceFileName(), originalPath); Node importSpec = IR.empty(); if (moduleImport.isDestructuringImport) { importSpec = new Node(Token.IMPORT_SPECS); importSpec.setShorthandProperty(true); for (String fullLocalName : moduleImport.fullLocalNames) { Node spec = new Node(Token.IMPORT_SPEC, IR.name(fullLocalName)); spec.setShorthandProperty(true); importSpec.addChildToBack(spec); } } else if (moduleImport.isFullModuleImport()) { String fullLocalName = moduleImport.fullLocalNames.get(0); importSpec = Node.newString(Token.IMPORT_STAR, fullLocalName); if (destructuringAssignments.containsKey(fullLocalName)) { importSpec = destructuringAssignments.get(fullLocalName); Node destructuringLhs = importSpec.getParent(); Node assignmentNode = destructuringLhs.getParent(); importSpec.detach(); assignmentNode.getParent().removeChild(assignmentNode); } } Node importNode = new Node(Token.IMPORT, IR.empty(), importSpec, Node.newString(referencedFile)); nodeComments.replaceWithComment(moduleImport.originalImportNode, importNode); compiler.reportChangeToEnclosingScope(importNode); }

Target:
private void convertRequireForAlreadyConverted(ModuleImport moduleImport) { String originalPath = moduleImport.requiredNamespace.replace(alreadyConvertedPrefix + ".", "").replace(".", "/"); String referencedFile = pathUtil.getImportPath(moduleImport.originalImportNode.getSourceFileName(), originalPath); Node importSpec = IR.empty(); if (moduleImport.isDestructuringImport) { importSpec = new Node(Token.IMPORT_SPECS); importSpec.setShorthandProperty(true); for (String fullLocalName : moduleImport.fullLocalNames) { Node spec = new Node(Token.IMPORT_SPEC, IR.name(fullLocalName)); spec.setShorthandProperty(true); importSpec.addChildToBack(spec); } } else if (moduleImport.isFullModuleImport()) { String fullLocalName = moduleImport.fullLocalNames.get(0); if (!destructuringAssignments.containsKey(fullLocalName)) { importSpec = Node.newString(Token.IMPORT_STAR, fullLocalName); } else { importSpec = destructuringAssignments.get(fullLocalName); Node destructuringLhs = importSpec.getParent(); Node assignmentNode = destructuringLhs.getParent(); importSpec.detach(); assignmentNode.getParent().removeChild(assignmentNode); } } Node importNode = new Node(Token.IMPORT, IR.empty(), importSpec, Node.newString(referencedFile)); nodeComments.replaceWithComment(moduleImport.originalImportNode, importNode); compiler.reportChangeToEnclosingScope(importNode); }
Source:
public void testAddingOptionalField() throws IOException { Schema oldSchema = SchemaBuilder.record("record") .fields() .requiredLong("category_id") .optionalString("name") .endRecord(); Schema newSchema = AvroSchemaConverter.convertToSchema( TableSchema.builder() .field("category_id", DataTypes.BIGINT().notNull()) .field("name", DataTypes.STRING().nullable()) .field("description", DataTypes.STRING().nullable()) .build().toRowDataType().getLogicalType() ); byte[] serializedRecord = AvroTestUtils.writeRecord( new GenericRecordBuilder(oldSchema) .set("category_id", 1L) .set("name", "test") .build(), oldSchema ); GenericDatumReader<GenericRecord> datumReader = new GenericDatumReader<>( oldSchema, newSchema); GenericRecord newRecord = datumReader.read( null, DecoderFactory.get().binaryDecoder(serializedRecord, 0, serializedRecord.length, null)); assertThat( newRecord, equalTo(new GenericRecordBuilder(newSchema) .set("category_id", 1L) .set("name", "test") .set("description", null) .build())); }

Target:
public void testAddingOptionalField() throws IOException { Schema oldSchema = SchemaBuilder.record("record") .fields() .requiredLong("category_id") .optionalString("name") .endRecord(); Schema newSchema = AvroSchemaConverter.convertToSchema( DataTypes.ROW( DataTypes.FIELD("category_id", DataTypes.BIGINT().notNull()), DataTypes.FIELD("name", DataTypes.STRING().nullable()), DataTypes.FIELD("description", DataTypes.STRING().nullable()) ).getLogicalType() ); byte[] serializedRecord = AvroTestUtils.writeRecord( new GenericRecordBuilder(oldSchema) .set("category_id", 1L) .set("name", "test") .build(), oldSchema ); GenericDatumReader<GenericRecord> datumReader = new GenericDatumReader<>( oldSchema, newSchema); GenericRecord newRecord = datumReader.read( null, DecoderFactory.get().binaryDecoder(serializedRecord, 0, serializedRecord.length, null)); assertThat( newRecord, equalTo(new GenericRecordBuilder(newSchema) .set("category_id", 1L) .set("name", "test") .set("description", null) .build())); }
Source:
public void checkNegativeCallParameters(PatternCompositionConstraint constraint) { Predicate<ValueReference> isSingleUseVariable = new Predicate<ValueReference>() { @Override public boolean apply(ValueReference input) { if (input instanceof VariableValue) { VariableValue variableValue = (VariableValue) input; return variableValue.getValue().getVar().startsWith("_"); } else { return false; } } }; if (constraint.isNegative() && Iterables.all(constraint.getCall().getParameters(), isSingleUseVariable)) { warning("A negative pattern call should reference at least one used variable", PatternLanguagePackage.Literals.PATTERN_COMPOSITION_CONSTRAINT__CALL, IssueCodes.NEGATIVE_PATTERN_CALL_WITH_ONLY_SINGLE_USE_VARIABLES); } }

Target:
public void checkNegativeCallParameters(PatternCompositionConstraint constraint) { Predicate<ValueReference> isSingleUseVariable = new Predicate<ValueReference>() { @Override public boolean apply(ValueReference input) { if (input instanceof VariableValue) { VariableValue variableValue = (VariableValue) input; return variableValue.getValue().getVar().startsWith("_"); } else { return false; } } }; if (constraint.isNegative() && Iterables.all(constraint.getCall().getParameters(), isSingleUseVariable)) { warning("This negative pattern call is a global constraint: " + "it expresses that there are no matches of the called pattern at all. " + "Make sure this is intentional!", PatternLanguagePackage.Literals.PATTERN_COMPOSITION_CONSTRAINT__CALL, IssueCodes.NEGATIVE_PATTERN_CALL_WITH_ONLY_SINGLE_USE_VARIABLES); } }
Source:
public static HDHTEntryType fromInt(int i) { HDHTEntryType type = intToTypeMap.get(Integer.valueOf(i)); return type; }

Target:
public static HDHTEntryType fromInt(int i) { return intToTypeMap.get(i); }
Source:
public List<String> listConsumerGroups(String name) { File mqRoot = new File(basePath.toFile(), name); if (!exists(name)) { throw new IllegalArgumentException("Unknown Log: " + name); } return Arrays.stream(mqRoot.list((dir, rep) -> new File(dir, rep).isDirectory() && ChronicleLogOffsetTracker.isOffsetTracker(rep))).map(ChronicleLogOffsetTracker::getGroupFromDirectory).collect(Collectors.toList()); }

Target:
public List<String> listConsumerGroups(String name) { Path logRoot = basePath.resolve(name); if (!Files.exists(logRoot)) { throw new IllegalArgumentException("Unknown Log: " + name); } try { return Files.list(logRoot) .filter(Files::isDirectory) .map(Path::getFileName) .map(Path::toString) .filter(ChronicleLogOffsetTracker::isOffsetTracker) .map(ChronicleLogOffsetTracker::getGroupFromDirectory) .collect(Collectors.toList()); } catch (IOException e) { throw new IllegalArgumentException("Cannot access Log: " + name, e); } }
Source:
public AbstractJcrNode addAclNode( String relPath, String primaryNodeTypeName ) throws ItemExistsException, PathNotFoundException, NoSuchNodeTypeException, LockException, VersionException, ConstraintViolationException, RepositoryException { checkSession(); return addNode(relPath, primaryNodeTypeName, null, true); }

Target:
protected AbstractJcrNode addAclNode( String relPath, String primaryNodeTypeName ) throws ItemExistsException, PathNotFoundException, NoSuchNodeTypeException, LockException, VersionException, ConstraintViolationException, RepositoryException { checkSession(); return addNode(relPath, primaryNodeTypeName, null, true); }
Source:
public void do_not_delete_default_profile() { QualityProfileDto profile = QualityProfileTesting.newQualityProfileDto() .setDefault(true); db.qualityProfileDao().insert(dbSession, profile); dbSession.commit(); dbSession.clearCache(); try { List<ActiveRuleChange> changes = factory.delete(dbSession, profile.getKey(), false); dbSession.commit(); activeRuleIndexer.index(changes); fail(); } catch (BadRequestException e) { assertThat(e).hasMessage("The profile marked as default can not be deleted: " + profile.getKey()); assertThat(db.qualityProfileDao().selectAll(dbSession)).hasSize(1); } }

Target:
public void do_not_delete_default_profile() { QualityProfileDto profile = QualityProfileTesting.newQualityProfileDto() .setOrganizationUuid(organization.getUuid()) .setDefault(true); db.qualityProfileDao().insert(dbSession, profile); dbSession.commit(); try { List<ActiveRuleChange> changes = factory.delete(dbSession, profile.getKey(), false); dbSession.commit(); activeRuleIndexer.index(changes); fail(); } catch (BadRequestException e) { assertThat(e).hasMessage("The profile marked as default can not be deleted: " + profile.getKey()); assertThat(db.qualityProfileDao().selectAll(dbSession, organization)).hasSize(1); } }
Source:
public ITypedElement getAncestor() { return CompareUtils.getFileRevisionTypedElement(gitPath, getAncestorCommit(), getRepository(), ancestorId); }

Target:
public ITypedElement getAncestor() { if (objectExist(getAncestorCommit(), ancestorId)) return CompareUtils.getFileRevisionTypedElement(gitPath, getAncestorCommit(), getRepository(), ancestorId); return null; }
Source:
protected void purgeExpired(Collection<String> expiredKeys, long timeout) { final ThreadPoolExecutor executor = new ThreadPoolExecutor(3, 3, 1, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>()); final Set<String> expired = new ConcurrentHashSet<String>(); for (String key : expiredKeys) expired.add(key); final Set<Object> incorrect = new ConcurrentHashSet<Object>(); final AdvancedCacheWriter.PurgeListener purgeListener = new AdvancedCacheWriter.PurgeListener() { @Override public void entryPurged(Object key) { if (!expired.remove(key)) { incorrect.add(key); } } }; long start = System.nanoTime(); for (;;) { try { executor.submit(new Callable<Void>() { @Override public Void call() throws Exception { cl.purge(executor, purgeListener); return null; } }).get(); } catch (Exception e) { throw new RuntimeException("Purge has thrown an exception", e); } assertTrue(incorrect.isEmpty()); if (expired.isEmpty() || !storePurgesAllExpired()) { return; } if (System.nanoTime() > start + TimeUnit.MILLISECONDS.toNanos(timeout)) { throw new IllegalStateException("Purge has timed out"); } else { Thread.yield(); } } }

Target:
protected void purgeExpired(Collection<String> expiredKeys, long timeout) { final ThreadPoolExecutor executor = new ThreadPoolExecutor(3, 3, 1, TimeUnit.SECONDS, new LinkedBlockingQueue<Runnable>()); final Set<String> expired = new ConcurrentHashSet<String>(); for (String key : expiredKeys) expired.add(key); final Set<Object> incorrect = new ConcurrentHashSet<Object>(); final AdvancedCacheWriter.PurgeListener purgeListener = new AdvancedCacheWriter.PurgeListener() { @Override public void entryPurged(Object key) { if (!expired.remove(key)) { incorrect.add(key); } } }; long start = System.nanoTime(); for (;;) { try { executor.submit(new Callable<Void>() { @Override public Void call() throws Exception { cl.purge(executor, purgeListener); return null; } }).get(); } catch (Exception e) { throw new RuntimeException("Purge has thrown an exception", e); } assertEquals(Collections.emptySet(), incorrect); if (expired.isEmpty() || !storePurgesAllExpired()) { return; } if (System.nanoTime() > start + TimeUnit.MILLISECONDS.toNanos(timeout)) { throw new IllegalStateException("Purge has timed out"); } else { Thread.yield(); } } }
Source:
public void testSetTargetTaskThreadPoolSizeIllegalArgument() { InstanceConfig testConfig = new InstanceConfig("testConfig"); testConfig.setTargetTaskThreadPoolSize(0); }

Target:
public void testSetTargetTaskThreadPoolSizeIllegalArgument() { InstanceConfig testConfig = new InstanceConfig("testConfig"); testConfig.setTargetTaskThreadPoolSize(-1); }
Source:
public Builder builder() { return new Builder(this); }

Target:
public static Builder builder() { return new Builder(); }
Source:
public long getFixedRate() { return 5 * 1000; }

Target:
public long getFixedRate() { return this.userMetricsProperties.getRate(); }
Source:
private OverPeriodDateAttribute copyWithUriQualifier(final OverPeriodDateAttribute attribute, final ObjQualifierConverter objQualifierConverter) { if (attribute.getAttribute() instanceof IdentifierObjQualifier) { final IdentifierObjQualifier attributeIdentifier = (IdentifierObjQualifier) attribute.getAttribute(); return objQualifierConverter.convertToUriQualifier(attributeIdentifier) .map(uriObjQualifier -> new OverPeriodDateAttribute(uriObjQualifier, attribute.getPeriodsAgo())) .orElseThrow(() -> new IllegalArgumentException(format("The converter cannot convert identifier '%s'!", attributeIdentifier))); } return attribute; }

Target:
private OverPeriodDateAttribute copyWithUriQualifier(final OverPeriodDateAttribute attribute, final ObjQualifierConverter objQualifierConverter) { return ObjIdentifierUtilities.copyIfNecessary( attribute, attribute.getAttribute(), uriObjQualifier -> new OverPeriodDateAttribute(uriObjQualifier, attribute.getPeriodsAgo()), objQualifierConverter ); }
Source:
public AuthenticationResult createEscalatedAuthenticationResult() { return new AuthenticationResult(internalClientUsername, authorizerName, "basic", null); }

Target:
public AuthenticationResult createEscalatedAuthenticationResult() { return new AuthenticationResult(internalClientUsername, authorizerName, null, null); }