auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private OpenFoodAPIClient(String apiUrl) { if (Build.VERSION.SDK_INT == 24) { OkHttpClient.Builder builder = new OkHttpClient.Builder(); ConnectionSpec spec = new ConnectionSpec.Builder(ConnectionSpec.MODERN_TLS) .tlsVersions(TlsVersion.TLS_1_2) .cipherSuites(CipherSuite.TLS_DHE_RSA_WITH_AES_128_GCM_SHA256) .build(); builder.connectionSpecs(Collections.singletonList(spec)); httpClient = builder.build(); } apiService = new Retrofit.Builder() .baseUrl(apiUrl) .client(httpClient) .addConverterFactory(jacksonConverterFactory) .build() .create(OpenFoodAPIService.class); }

Target:
private OpenFoodAPIClient(String apiUrl) { apiService = new Retrofit.Builder() .baseUrl(apiUrl) .client(httpClient) .addConverterFactory(jacksonConverterFactory) .build() .create(OpenFoodAPIService.class); }
Source:
MantaMultipartUploadPart uploadPart(final JobsMultipartUpload upload, final int partNumber, final HttpEntity entity, final HttpContext context) throws IOException { Validate.notNull(upload, "Multipart upload object must not be null"); Validate.notNull(entity, "Upload entity must not be null"); final String path = multipartPath(upload.getId(), partNumber); final HttpPut put = httpHelper.getRequestFactory().put(path); put.setEntity(entity); final int expectedStatusCode = HttpStatus.SC_NO_CONTENT; try (CloseableHttpResponse response = httpHelper.getConnectionContext().getHttpClient().execute(put, context)) { StatusLine statusLine = response.getStatusLine(); final MantaObjectResponse objectResponse = new MantaObjectResponse(path, new MantaHttpHeaders(response.getAllHeaders())); if (statusLine.getStatusCode() != expectedStatusCode) { String errorMessage = "Manta server responded with an unexpected response code"; MantaClientHttpResponseException mchre = new MantaClientHttpResponseException(put, response, path); MantaMultipartException e = new MantaMultipartException(errorMessage, mchre); HttpHelper.annotateContextedException(e, put, response); throw e; } return new MantaMultipartUploadPart(objectResponse); } }

Target:
MantaMultipartUploadPart uploadPart(final JobsMultipartUpload upload, final int partNumber, final HttpEntity entity, final HttpContext context) throws IOException { Validate.notNull(upload, "Multipart upload object must not be null"); Validate.notNull(entity, "Upload entity must not be null"); final String path = multipartPath(upload.getId(), partNumber); final HttpPut put = httpHelper.getRequestFactory().put(path); put.setEntity(entity); final int expectedStatusCode = HttpStatus.SC_NO_CONTENT; final CloseableHttpClient httpClient = httpHelper.getConnectionContext().getHttpClient(); try (CloseableHttpResponse response = httpClient.execute(put, context)) { StatusLine statusLine = response.getStatusLine(); final MantaObjectResponse objectResponse = new MantaObjectResponse(path, new MantaHttpHeaders(response.getAllHeaders())); if (statusLine.getStatusCode() != expectedStatusCode) { String errorMessage = "Manta server responded with an unexpected response code"; MantaClientHttpResponseException mchre = new MantaClientHttpResponseException(put, response, path); MantaMultipartException e = new MantaMultipartException(errorMessage, mchre); HttpHelper.annotateContextedException(e, put, response); throw e; } return new MantaMultipartUploadPart(objectResponse); } }
Source:
public void preCommit() { if (deletionPlan.isRejected()) { throw new ConflictException(deletionPlan.toString()); } else if (!deletionPlan.isEmpty()) { final Set<String> deletedIds = deletionPlan.getDeletedItems() .stream() .filter(Component.class::isInstance) .map(Component.class::cast) .map(Component::getId) .collect(Collectors.toSet()); if (!deletedIds.isEmpty()) { deletionPlan.markForDeletion(getReferringRefSetMembers(deletedIds)); } delete(); deletionPlan = new SnomedDeletionPlan(); } if (isUniquenessCheckEnabled()) { List<CDOIDAndVersion> newObjects = transaction.getChangeSetData().getNewObjects(); ComponentIdUniquenessValidator uniquenessEnforcer = new ComponentIdUniquenessValidator(this); for (CDOIDAndVersion newCdoIdAndVersion : newObjects) { CDOObject newObject = transaction.getObject(newCdoIdAndVersion.getID()); if (newObject instanceof Component) { Component newComponent = (Component) newObject; uniquenessEnforcer.validateAndReplaceComponentId(newComponent); } } } new EffectiveTimeRestorer(getBranch()).restoreEffectiveTimes(transaction.getChangeSetData().getChangedObjects().stream() .map(cdoKey -> transaction.getObject(cdoKey.getID()))::iterator); }

Target:
public void preCommit() { if (deletionPlan.isRejected()) { throw new ConflictException(deletionPlan.toString()); } else if (!deletionPlan.isEmpty()) { final Set<String> deletedIds = deletionPlan.getDeletedItems() .stream() .filter(Component.class::isInstance) .map(Component.class::cast) .map(Component::getId) .collect(Collectors.toSet()); if (!deletedIds.isEmpty()) { deletionPlan.markForDeletion(getReferringRefSetMembers(deletedIds)); } delete(); deletionPlan = new SnomedDeletionPlan(); } if (isUniquenessCheckEnabled()) { List<CDOIDAndVersion> newObjects = transaction.getChangeSetData().getNewObjects(); ComponentIdUniquenessValidator uniquenessEnforcer = new ComponentIdUniquenessValidator(this); for (CDOIDAndVersion newCdoIdAndVersion : newObjects) { CDOObject newObject = transaction.getObject(newCdoIdAndVersion.getID()); if (newObject instanceof Component) { Component newComponent = (Component) newObject; uniquenessEnforcer.validateAndReplaceComponentId(newComponent); } } } effectiveTimeRestorer.restoreEffectiveTimes(transaction.getChangeSetData().getChangedObjects().stream().map(cdoKey -> transaction.getObject(cdoKey.getID()))::iterator, getBranch()); }
Source:
protected Long nullUnsafeScalar(OffsetTime value) { return value.atDate( LocalDate.of( 1970, Month.JANUARY, 1 ) ).toInstant().toEpochMilli(); }

Target:
protected Long nullUnsafeScalar(OffsetTime value) { return value.atDate( EPOCH_DATE ).toInstant().toEpochMilli(); }
Source:
public void schemaDoesNotExistOnCreate() { when(schemaService.getUploadSchema(any(), eq("guid"))).thenThrow(new EntityNotFoundException(AppConfig.class)); AppConfig appConfig = AppConfig.create(); appConfig.setStudyId("studyId"); SchemaReference schemaRef = new SchemaReference("guid", 3); appConfig.getSchemaReferences().add(schemaRef); assertValidatorMessage(newValidator, appConfig, "schemaReferences[0]", "does not refer to an upload schema"); }

Target:
public void schemaDoesNotExistOnCreate() { when(schemaService.getUploadSchemaByIdAndRev(TEST_STUDY, "guid", 3)) .thenThrow(new EntityNotFoundException(AppConfig.class)); appConfig.getSchemaReferences().add(RESOLVED_SCHEMA_REF); assertValidatorMessage(newValidator, appConfig, "schemaReferences[0]", "does not refer to an upload schema"); }
Source:
public void successfulDeletePermanently() { List<SchedulePlan> plans = createSchedulePlanListWithSurveyReference(false); Activity oldActivity = getActivityList(plans).get(0); Activity activity = new Activity.Builder().withActivity(oldActivity) .withSurvey("Survey", "otherGuid", SURVEY_CREATED_ON).build(); getActivityList(plans).set(0, activity); Survey survey = createSurvey(); when(mockSurveyDao.getSurvey(any(), eq(false))).thenReturn(survey); service.deleteSurveyPermanently(TEST_STUDY, survey); verify(mockSharedModuleMetadataService).queryAllMetadata(eq(false), eq(false), queryCaptor.capture(), paramsCaptor.capture(), eq(null), eq(true)); String queryStr = queryCaptor.getValue(); assertEquals("surveyGuid=:surveyGuid AND surveyCreatedOn=:surveyCreatedOn", queryStr); assertEquals(survey.getGuid(), paramsCaptor.getValue().get("surveyGuid")); assertEquals(survey.getCreatedOn(), paramsCaptor.getValue().get("surveyCreatedOn")); verify(mockSurveyDao).deleteSurveyPermanently(keysCaptor.capture()); assertEquals(survey, keysCaptor.getValue()); }

Target:
public void successfulDeletePermanently() { List<SchedulePlan> plans = createSchedulePlanListWithSurveyReference(false); Activity oldActivity = getActivityList(plans).get(0); Activity activity = new Activity.Builder().withActivity(oldActivity) .withSurvey("Survey", "otherGuid", SURVEY_CREATED_ON).build(); getActivityList(plans).set(0, activity); doReturn(plans).when(mockSchedulePlanService).getSchedulePlans(ClientInfo.UNKNOWN_CLIENT, TEST_STUDY, true); Survey survey = createSurvey(); when(mockSurveyDao.getSurvey(any(), eq(false))).thenReturn(survey); service.deleteSurveyPermanently(TEST_STUDY, survey); verify(mockSharedModuleMetadataService).queryAllMetadata(eq(false), eq(false), queryCaptor.capture(), paramsCaptor.capture(), eq(null), eq(true)); String queryStr = queryCaptor.getValue(); assertEquals("surveyGuid=:surveyGuid AND surveyCreatedOn=:surveyCreatedOn", queryStr); assertEquals(survey.getGuid(), paramsCaptor.getValue().get("surveyGuid")); assertEquals(survey.getCreatedOn(), paramsCaptor.getValue().get("surveyCreatedOn")); verify(mockSurveyDao).deleteSurveyPermanently(keysCaptor.capture()); assertEquals(survey, keysCaptor.getValue()); }
Source:
public TopNMapFn( TopNQuery query, TopNAlgorithm topNAlgorithm ) { this.query = query; this.topNAlgorithm = topNAlgorithm; this.dimension = query.getDimensionSpec().getDimension(); this.extractionFn = TopNQueryEngine.canApplyExtractionInPost(query) ? null : query.getDimensionSpec().getExtractionFn(); }

Target:
public TopNMapFn( TopNQuery query, TopNAlgorithm topNAlgorithm ) { this.query = query; this.topNAlgorithm = topNAlgorithm; }
Source:
@Override public ReflogEntry getReverseEntry(int number) throws IOException { lock.lock(); try { LogCursor cursor = reftable.seekLog(refname); while (true) { if (!cursor.next() || number < 0) { return null; } if (number == 0) { return cursor.getReflogEntry(); } number--; } } finally { lock.unlock(); } }

Target:
public ReflogEntry getReverseEntry(int number) throws IOException { lock.lock(); try { LogCursor cursor = reftable.seekLog(refname); while (true) { if (!cursor.next() || number < 0) { return null; } if (number == 0) { return cursor.getReflogEntry(); } number--; } } finally { lock.unlock(); } }
Source:
public CompositeByteBuf addFlattenedComponents(boolean increaseWriterIndex, ByteBuf buffer) { checkNotNull(buffer, "buffers"); final int ridx = buffer.readerIndex(); final int widx = buffer.writerIndex(); if (ridx == widx) { buffer.release(); return this; } if (!(buffer instanceof CompositeByteBuf)) { addComponent0(increaseWriterIndex, componentCount, buffer); consolidateIfNeeded(); return this; } final CompositeByteBuf from = (CompositeByteBuf) buffer; from.checkIndex(ridx, widx - ridx); final Component[] fromComponents = from.components; final int compCountBefore = componentCount; final int writerIndexBefore = writerIndex; try { for (int cidx = from.toComponentIndex0(ridx), newOffset = capacity();; cidx++) { final Component component = fromComponents[cidx]; final int compOffset = component.offset; final int fromIdx = Math.max(ridx, compOffset); final int toIdx = Math.min(widx, component.endOffset); final int len = toIdx - fromIdx; if (len > 0) { final ByteBuf buf = component.buf, slice = component.slice, newSlice; if (slice == null) { newSlice = null; buf.retain(); } else { newSlice = slice.retainedSlice(fromIdx - compOffset, len); } addComp(componentCount, new Component(buf, component.idx(fromIdx), newOffset, len, newSlice)); } if (widx == toIdx) { break; } newOffset += len; } if (increaseWriterIndex) { writerIndex = writerIndexBefore + (widx - ridx); } consolidateIfNeeded(); buffer.release(); buffer = null; return this; } finally { if (buffer != null) { if (increaseWriterIndex) { writerIndex = writerIndexBefore; } for (int cidx = componentCount - 1; cidx >= compCountBefore; cidx--) { components[cidx].free(); removeComp(cidx); } } } }

Target:
public CompositeByteBuf addFlattenedComponents(boolean increaseWriterIndex, ByteBuf buffer) { checkNotNull(buffer, "buffer"); final int ridx = buffer.readerIndex(); final int widx = buffer.writerIndex(); if (ridx == widx) { buffer.release(); return this; } if (!(buffer instanceof CompositeByteBuf)) { addComponent0(increaseWriterIndex, componentCount, buffer); consolidateIfNeeded(); return this; } final CompositeByteBuf from = (CompositeByteBuf) buffer; from.checkIndex(ridx, widx - ridx); final Component[] fromComponents = from.components; final int compCountBefore = componentCount; final int writerIndexBefore = writerIndex; try { for (int cidx = from.toComponentIndex0(ridx), newOffset = capacity();; cidx++) { final Component component = fromComponents[cidx]; final int compOffset = component.offset; final int fromIdx = Math.max(ridx, compOffset); final int toIdx = Math.min(widx, component.endOffset); final int len = toIdx - fromIdx; if (len > 0) { addComp(componentCount, new Component( component.buf.retain(), component.idx(fromIdx), newOffset, len, null)); } if (widx == toIdx) { break; } newOffset += len; } if (increaseWriterIndex) { writerIndex = writerIndexBefore + (widx - ridx); } consolidateIfNeeded(); buffer.release(); buffer = null; return this; } finally { if (buffer != null) { if (increaseWriterIndex) { writerIndex = writerIndexBefore; } for (int cidx = componentCount - 1; cidx >= compCountBefore; cidx--) { components[cidx].free(); removeComp(cidx); } } } }
Source:
public void runOperation(VariableMap variableMap, IProgressMonitor monitor) throws Exception { Branch branch = variableMap.getBranch("Branch"); AttributeType attributeType = variableMap.getAttributeType("Attribute Type"); String input = variableMap.getString(ARTIFACT_IDS_WIDGET_NAME); ArrayList<String> inputArtIds = new ArrayList<String>(Arrays.asList(input.split("[,\\s]+"))); SkynetTransaction transaction = TransactionManager.createTransaction(branch, "BLAM: Delete invalid attribute type"); for (String id : inputArtIds) { Artifact art = ArtifactQuery.getArtifactFromId(id, branch); if (!art.isAttributeTypeValid(attributeType)) { List<Attribute<?>> attrs = art.getAttributes(false); for (Attribute<?> attr : attrs) { if (attr.isOfType(attributeType)) { attr.delete(); log(String.format("Artifact [%s] attribute type [%s] deleted: [%s]\n", art.toStringWithId(), attributeType.toString(), attr.toString())); } } art.persist(transaction); } else { log(String.format("Artifact [%s] attribute type [%s] is not invalid\n", art.toStringWithId(), attributeType.toString())); } } transaction.execute(); }

Target:
public void runOperation(VariableMap variableMap, IProgressMonitor monitor) throws OseeCoreException { Branch branch = variableMap.getBranch("Branch"); List<AttributeType> attributeTypes = variableMap.getAttributeTypes("Attribute Type"); String input = variableMap.getString(ARTIFACT_IDS_WIDGET_NAME); Conditions.checkNotNullOrEmpty(input, ARTIFACT_IDS_WIDGET_NAME); List<String> inputArtIds = Arrays.asList(input.split("[,\\s]+")); SkynetTransaction transaction = TransactionManager.createTransaction(branch, "BLAM: Delete invalid attribute type"); List<Artifact> arts = ArtifactQuery.getArtifactListFromIds(inputArtIds, branch); for (AttributeType attrType : attributeTypes) { deleteInvalidAttributeType(arts, attrType, transaction); } transaction.execute(); }
Source:
public void bind(InatorContext context, Map<String, Object> instanceData) { @SuppressWarnings("unchecked") List<String> ports = (List<String>)CollectionUtils.toList(instanceData.get(InstanceConstants.FIELD_PORTS)); boolean changed = false; int port = Integer.parseInt(portNum); for (int i = 0 ; i < ports.size() ; i++) { try { PortSpec spec = new PortSpec(ports.get(i)); if (spec.getPublicPort() == null && spec.getPrivatePort() == port) { Object owner = getOwner(getDeploymentUnit(context)); Account account = getAccount(owner); Account clusterAccount = svc.clusterDao.getOwnerAcccountForCluster(account.getClusterId()); PooledResource resource = svc.lockManager.lock(new PortUnitLock(clusterAccount, this), () -> { return svc.poolManager.allocateOneResource(clusterAccount, owner, new PooledResourceOptions() .withSubOwner(getSubOwner()) .withQualifier(ResourcePoolConstants.ENVIRONMENT_PORT)); }); if (resource == null) { throw new ResourceExhaustionException("Not enough environment ports"); } spec.setPublicPort(Integer.parseInt(resource.getName())); ports.set(i, spec.toSpec()); changed = true; break; } } catch (ClientVisibleException e) { } } if (changed) { instanceData.put(InstanceConstants.FIELD_PORTS, ports); } }

Target:
public void bind(InatorContext context, Map<String, Object> instanceData) { @SuppressWarnings("unchecked") List<String> ports = (List<String>)CollectionUtils.toList(instanceData.get(InstanceConstants.FIELD_PORTS)); boolean changed = false; int port = Integer.parseInt(portNum); Map<Long, Account> clusterAccounts = new HashMap<>(); Map<Long, Account> accounts = new HashMap<>(); for (int i = 0 ; i < ports.size() ; i++) { try { PortSpec spec = new PortSpec(ports.get(i)); if (spec.getPublicPort() == null && spec.getPrivatePort() == port) { Object owner = getOwner(getDeploymentUnit(context)); Account account = getAccount(accounts, owner); Account clusterAccount = getClusterAccount(account, clusterAccounts, account.getClusterId()); PooledResource resource = svc.lockManager.lock(new PortUnitLock(account.getClusterId(), this), () -> { return svc.poolManager.allocateOneResource(clusterAccount, owner, new PooledResourceOptions() .withSubOwner(getSubOwner()) .withQualifier(ResourcePoolConstants.ENVIRONMENT_PORT)); }); if (resource == null) { throw new ResourceExhaustionException("Not enough environment ports"); } spec.setPublicPort(Integer.parseInt(resource.getName())); ports.set(i, spec.toSpec()); changed = true; break; } } catch (ClientVisibleException e) { } } if (changed) { instanceData.put(InstanceConstants.FIELD_PORTS, ports); } }
Source:
public void addResolutionListener(IQualifiedTypeResolutionListener resolutionListener) { for (int i = 0; i < this.resolutionListeners.length; i++){ if (this.resolutionListeners[i].equals(resolutionListener)) return; } int length = this.resolutionListeners.length; System.arraycopy(this.resolutionListeners, 0, this.resolutionListeners = new IQualifiedTypeResolutionListener[length + 1], 0, length); this.resolutionListeners[this.resolutionListeners.length - 1] = resolutionListener; }

Target:
public void addResolutionListener(IQualifiedTypeResolutionListener resolutionListener) { for (int i = 0; i < this.resolutionListeners.length; i++){ if (this.resolutionListeners[i].equals(resolutionListener)) return; } int length = this.resolutionListeners.length; System.arraycopy(this.resolutionListeners, 0, this.resolutionListeners = new IQualifiedTypeResolutionListener[length + 1], 0, length); this.resolutionListeners[length] = resolutionListener; }
Source:
public EncryptionHttpHelper(final MantaConnectionContext connectionContext, final ConfigContext config) { this(connectionContext, null, config); }

Target:
public EncryptionHttpHelper(final MantaConnectionContext connectionContext, final ConfigContext config) { super(connectionContext, config); this.encryptionKeyId = ObjectUtils.firstNonNull( config.getEncryptionKeyId(), "unknown-key"); this.permitUnencryptedDownloads = ObjectUtils.firstNonNull( config.permitUnencryptedDownloads(), DefaultsConfigContext.DEFAULT_PERMIT_UNENCRYPTED_DOWNLOADS ); this.encryptionAuthenticationMode = ObjectUtils.firstNonNull( config.getEncryptionAuthenticationMode(), EncryptionAuthenticationMode.DEFAULT_MODE); this.cipherDetails = ObjectUtils.firstNonNull( SupportedCiphersLookupMap.INSTANCE.getWithCaseInsensitiveKey( config.getEncryptionAlgorithm()), DefaultsConfigContext.DEFAULT_CIPHER); if (config.getEncryptionPrivateKeyPath() != null) { Path keyPath = Paths.get(config.getEncryptionPrivateKeyPath()); try { secretKey = SecretKeyUtils.loadKeyFromPath(keyPath, this.cipherDetails); } catch (IOException e) { String msg = String.format("Unable to load secret key from file: %s", keyPath); throw new UncheckedIOException(msg, e); } } else if (config.getEncryptionPrivateKeyBytes() != null) { secretKey = SecretKeyUtils.loadKey(config.getEncryptionPrivateKeyBytes(), cipherDetails); } else { throw new MantaClientEncryptionException( "Either private encryption key path or bytes must be specified"); } }
Source:
private String prettyPrintJobs(String... jobs) { String result = ""; for (String job : jobs) { int index = job.lastIndexOf('.'); result += job.substring(index + 1) + ", "; } return result.replaceAll(", $", ""); }

Target:
private String prettyPrintJobs(String... jobs) { List<String> jobNames = new ArrayList<String>(); for (String job : jobs) { jobNames.add(StringUtils.substringAfterLast(job, ".")); } return StringUtils.join(jobNames, ", "); }
Source:
private AbstractExpression parseRankValueExpression(VoltXMLElement exprNode) { List<AbstractExpression> partitionbyExprs = new ArrayList<AbstractExpression>(); List<AbstractExpression> orderbyExprs = new ArrayList<AbstractExpression>(); List<SortDirectionType> orderbyDirs = new ArrayList<SortDirectionType>(); boolean areAllDecending = false; boolean isPercentRank = Boolean.valueOf(exprNode.attributes.get("isPercentRank")); for (VoltXMLElement ele : exprNode.children) { if (ele.name.equals("partitionbyList")) { for(int i = 0; i < ele.children.size(); i++) { VoltXMLElement childNode = ele.children.get(i); AbstractExpression expr = parseExpressionNode(childNode); partitionbyExprs.add(expr); } } else if (ele.name.equals("orderbyList")) { for(int i = 0; i < ele.children.size(); i++) { VoltXMLElement childNode = ele.children.get(i); boolean isDecending = Boolean.valueOf(childNode.attributes.get("decending")); if (i == 0) { areAllDecending = isDecending; } else if (areAllDecending != isDecending) { throw new PlanningErrorException("invalid RANK order by expression without consistent " + "ascending order or decending order"); } AbstractExpression expr = parseExpressionNode(childNode.children.get(0)); orderbyExprs.add(expr); orderbyDirs.add(isDecending ? SortDirectionType.DESC : SortDirectionType.ASC); } } else { throw new PlanningErrorException("invalid RANK expression found: " + ele.name); } } WindowedExpression rankExpr = new WindowedExpression(ExpressionType.AGGREGATE_WINDOWED_RANK, partitionbyExprs, orderbyExprs, orderbyDirs, m_db, areAllDecending, isPercentRank); return rankExpr; }

Target:
private AbstractExpression parseRankValueExpression(VoltXMLElement exprNode) { List<AbstractExpression> partitionbyExprs = new ArrayList<AbstractExpression>(); List<AbstractExpression> orderbyExprs = new ArrayList<AbstractExpression>(); List<SortDirectionType> orderbyDirs = new ArrayList<SortDirectionType>(); boolean areAllDecending = false; boolean isPercentRank = Boolean.valueOf(exprNode.attributes.get("isPercentRank")); for (VoltXMLElement ele : exprNode.children) { if (ele.name.equals("partitionbyList")) { for (int i = 0; i < ele.children.size(); i++) { VoltXMLElement childNode = ele.children.get(i); AbstractExpression expr = parseExpressionNode(childNode); partitionbyExprs.add(expr); } } else if (ele.name.equals("orderbyList")) { for (int i = 0; i < ele.children.size(); i++) { VoltXMLElement childNode = ele.children.get(i); SortDirectionType sortDir = Boolean.valueOf(childNode.attributes.get("decending")) ? SortDirectionType.DESC : SortDirectionType.ASC; AbstractExpression expr = parseExpressionNode(childNode.children.get(0)); orderbyExprs.add(expr); orderbyDirs.add(sortDir); } } else { throw new PlanningErrorException("invalid RANK expression found: " + ele.name); } } WindowedExpression rankExpr = new WindowedExpression(ExpressionType.AGGREGATE_WINDOWED_RANK, partitionbyExprs, orderbyExprs, orderbyDirs, m_db, areAllDecending, isPercentRank); return rankExpr; }
Source:
public synchronized void connect() throws ConnectionException { try { final S7PlcOptions currentOptions = this.options.get(); if (this.state.options != currentOptions) { logger.info("configuration changed, disconnecting..."); disconnect(); this.state = createClientState(currentOptions); logger.info("configuration changed, disconnecting...done"); } if (!this.state.client.Connected) { logger.debug("Connecting to S7 PLC..."); this.state.client.SetConnectionType(S7.OP); int code = this.state.client.ConnectTo(currentOptions.getIp(), currentOptions.getRack(), currentOptions.getSlot()); if (code != 0) { throw new ConnectionException("Failed to connect to PLC, ConnectTo() failed with code: " + code); } if (currentOptions.shouldAuthenticate()) { authenticate(this.state); } logger.debug("Connecting to S7 PLC... Done"); } } catch (Exception e) { throw new ConnectionException("Connection failed, unexpected exception", e); } }

Target:
public synchronized void connect() throws ConnectionException { try { final S7PlcOptions currentOptions = this.options.get(); if (this.state.options != currentOptions) { logger.info("configuration changed, disconnecting..."); disconnect(); this.state = createClientState(currentOptions); logger.info("configuration changed, disconnecting...Done"); } if (!this.state.client.Connected) { logger.debug("Connecting to S7 PLC..."); this.state.client.SetConnectionType(S7.OP); int code = this.state.client.ConnectTo(currentOptions.getIp(), currentOptions.getRack(), currentOptions.getSlot()); if (code != 0) { throw new ConnectionException("Failed to connect to PLC, ConnectTo() failed with code: " + code); } if (currentOptions.shouldAuthenticate()) { authenticate(this.state); } logger.debug("Connecting to S7 PLC... Done"); } } catch (Exception e) { throw new ConnectionException("Connection failed, unexpected exception", e); } }
Source:
public String getProfileBanner1500x500URL() { return profileBannerImageUrl != null ? profileBannerImageUrl + "1500x500" : null; }

Target:
public String getProfileBanner1500x500URL() { return profileBannerImageUrl != null ? profileBannerImageUrl + "/1500x500" : null; }
Source:
public Aggregator factorize(ColumnSelectorFactory metricFactory) { ColumnValueSelector selector = metricFactory.makeColumnValueSelector(fieldName); return new SketchAggregator(selector, size); }

Target:
public Aggregator factorize(ColumnSelectorFactory metricFactory) { BaseObjectColumnValueSelector selector = metricFactory.makeColumnValueSelector(fieldName); return new SketchAggregator(selector, size); }
Source:
protected TargetFeature[] resolveFeatures(ITargetDefinition definition, IProgressMonitor monitor) throws CoreException { File dir = getDirectory(); if (!dir.isDirectory()) { throw new CoreException(new Status(IStatus.ERROR, PDECore.PLUGIN_ID, NLS.bind(Messages.DirectoryBundleContainer_1, dir.toString()))); } File site = getFeatureSite(dir); File[] files = site.listFiles(); SubMonitor localMonitor = SubMonitor.convert(monitor, Messages.DirectoryBundleContainer_0, files.length); List<TargetFeature> features = new ArrayList<>(files.length); for (int i = 0; i < files.length; i++) { if (localMonitor.isCanceled()) { return new TargetFeature[0]; } try { TargetFeature rf = new TargetFeature(files[i]); features.add(rf); } catch (CoreException e) { } localMonitor.worked(1); } localMonitor.done(); return features.toArray(new TargetFeature[features.size()]); }

Target:
protected TargetFeature[] resolveFeatures(ITargetDefinition definition, IProgressMonitor monitor) throws CoreException { File dir = getDirectory(); if (!dir.isDirectory()) { throw new CoreException(new Status(IStatus.ERROR, PDECore.PLUGIN_ID, NLS.bind(Messages.DirectoryBundleContainer_1, dir.toString()))); } File site = getFeatureSite(dir); File[] files = site.listFiles(); SubMonitor localMonitor = SubMonitor.convert(monitor, Messages.DirectoryBundleContainer_0, files.length); List<TargetFeature> features = new ArrayList<>(files.length); for (File file : files) { try { TargetFeature rf = new TargetFeature(file); features.add(rf); } catch (CoreException e) { } localMonitor.step(1); } return features.toArray(new TargetFeature[features.size()]); }
Source:
public LuceneSearchQuery<H> build() { LoadingContext<?, ?> loadingContext = loadingContextBuilder.build(); BooleanQuery.Builder luceneQueryBuilder = new BooleanQuery.Builder(); luceneQueryBuilder.add( luceneQuery, Occur.MUST ); luceneQueryBuilder.add( LuceneQueries.mainDocumentQuery(), Occur.FILTER ); Sort luceneSort = null; if ( sortFields != null && !sortFields.isEmpty() ) { luceneSort = new Sort( sortFields.toArray( new SortField[0] ) ); } Query definitiveLuceneQuery = searchContext.decorateLuceneQuery( luceneQueryBuilder.build(), sessionContext.getTenantIdentifier() ); if ( nestedFieldSorts != null ) { for ( LuceneFieldComparatorSource nestedField : nestedFieldSorts ) { nestedField.setOriginalParentQuery( definitiveLuceneQuery ); } } LuceneSearchQueryRequestContext requestContext = new LuceneSearchQueryRequestContext( sessionContext, loadingContext, definitiveLuceneQuery, luceneSort ); TimeoutManagerImpl timeoutManager = new TimeoutManagerImpl( definitiveLuceneQuery.toString() ); if ( timeout != null && timeUnit != null ) { timeoutManager.setTimeout( timeout, timeUnit ); timeoutManager.raiseExceptionOnTimeout(); } LuceneSearcherImpl<H> searcher = new LuceneSearcherImpl<>( requestContext, storedFieldVisitor, rootProjection, aggregations == null ? Collections.emptyMap() : aggregations, timeoutManager ); return new LuceneSearchQueryImpl<>( queryOrchestrator, workFactory, searchContext, sessionContext, loadingContext, routingKeys, timeoutManager, definitiveLuceneQuery, luceneSort, searcher ); }

Target:
public LuceneSearchQuery<H> build() { LoadingContext<?, ?> loadingContext = loadingContextBuilder.build(); BooleanQuery.Builder luceneQueryBuilder = new BooleanQuery.Builder(); luceneQueryBuilder.add( luceneQuery, Occur.MUST ); luceneQueryBuilder.add( LuceneQueries.mainDocumentQuery(), Occur.FILTER ); Sort luceneSort = null; if ( sortFields != null && !sortFields.isEmpty() ) { luceneSort = new Sort( sortFields.toArray( new SortField[0] ) ); } Query definitiveLuceneQuery = searchContext.decorateLuceneQuery( luceneQueryBuilder.build(), sessionContext.getTenantIdentifier() ); if ( nestedFieldSorts != null ) { for ( LuceneFieldComparatorSource nestedField : nestedFieldSorts ) { nestedField.setOriginalParentQuery( definitiveLuceneQuery ); } } LuceneSearchQueryRequestContext requestContext = new LuceneSearchQueryRequestContext( sessionContext, loadingContext, definitiveLuceneQuery, luceneSort ); TimeoutManager timeoutManager = searchContext.createTimeoutManager( definitiveLuceneQuery, timeout, timeUnit, exceptionOnTimeout ); LuceneSearcherImpl<H> searcher = new LuceneSearcherImpl<>( requestContext, storedFieldVisitor, rootProjection, aggregations == null ? Collections.emptyMap() : aggregations, timeoutManager ); return new LuceneSearchQueryImpl<>( queryOrchestrator, workFactory, searchContext, sessionContext, loadingContext, routingKeys, timeoutManager, definitiveLuceneQuery, luceneSort, searcher ); }
Source:
@Override public Object getValueAt(int rowIndex, int columnIndex) { ExclusionItem item = rows.get(rowIndex); if (columnIndex == 0) { return StringUtils.capitalize(item.type().name().toLowerCase()); } return item.item(); }

Target:
@Override public Object getValueAt(int rowIndex, int columnIndex) { ExclusionItem item = rows.get(rowIndex); if (columnIndex == 0) { return StringUtils.capitalize(item.type().name().toLowerCase(Locale.US)); } return item.item(); }
Source:
public void reset() { if (snackbar != null) { snackbar.dismiss(); snackbar = null; } }

Target:
public void reset() { if (snackbar == null) { return; } snackbar.dismiss(); snackbar = null; }
Source:
static void showRemoteMessages(String pkt) { PrintWriter writer = new PrintWriter(System.err); while (0 < pkt.length()) { final int lf = pkt.indexOf('\n'); final int cr = pkt.indexOf('\r'); final int s; if (0 <= lf && 0 <= cr) s = Math.min(lf, cr); else if (0 <= lf) s = lf; else if (0 <= cr) s = cr; else { writer.format(CLIText.get().remoteMessage, pkt); writer.println(); break; } if (pkt.charAt(s) == '\r') writer.format(CLIText.get().remoteMessage, pkt.substring(0, s) + "\r"); else { writer.format(CLIText.get().remoteMessage, pkt.substring(0, s)); writer.println(); } pkt = pkt.substring(s + 1); } writer.flush(); }

Target:
static void showRemoteMessages(String pkt) { PrintWriter writer = new PrintWriter(System.err); while (0 < pkt.length()) { final int lf = pkt.indexOf('\n'); final int cr = pkt.indexOf('\r'); final int s; if (0 <= lf && 0 <= cr) s = Math.min(lf, cr); else if (0 <= lf) s = lf; else if (0 <= cr) s = cr; else { writer.format(CLIText.get().remoteMessage, pkt); writer.println(); break; } if (pkt.charAt(s) == '\r') { writer.format(CLIText.get().remoteMessage, pkt.substring(0, s)); writer.print('\r'); } else { writer.format(CLIText.get().remoteMessage, pkt.substring(0, s)); writer.println(); } pkt = pkt.substring(s + 1); } writer.flush(); }
Source:
private synchronized void tryReleaseWorkers() { if (blockedWorkerIds.size() == numWorkersToSync) { LOG.log(Level.INFO, "{0} workers are blocked. Sending response messages to awake them", numWorkersToSync); transitState(globalStateMachine); if (globalStateMachine.getCurrentState().equals(STATE_RUN)) { initLatch.countDown(); } for (final String workerId : blockedWorkerIds) { sendResponseMessage(workerId, EMPTY_DATA); } blockedWorkerIds.clear(); } }

Target:
private synchronized void tryReleaseWorkers() { if (blockedWorkerIds.size() == numWorkersToSync) { LOG.log(Level.INFO, "Send response messages to wake up {0} workers that have been blocked", numWorkersToSync); transitState(globalStateMachine); if (globalStateMachine.getCurrentState().equals(STATE_RUN)) { initLatch.countDown(); } else if (globalStateMachine.getCurrentState().equals(STATE_CLEANUP)) { try { allowCleanupLatch.await(); } catch (final InterruptedException e) { LOG.log(Level.WARNING, "Interrupted while waiting for the optimization to be done", e); } } for (final String workerId : blockedWorkerIds) { sendResponseMessage(workerId, EMPTY_DATA); } blockedWorkerIds.clear(); } }
Source:
public static String formatDateTime(OffsetDateTime dt) { return DateTimeFormatter.ofPattern("yyyy-MM-dd'T'HH:mm:ssxxx").format(dt); }

Target:
public static String formatDateTime(OffsetDateTime dt) { return DateTimeFormatter.ofPattern(ISO_DATE_TIME_FORMAT).format(dt); }
Source:
protected Long getBranchUuidFromTxId(int tx) { QueryFactory queryFactory = orcsApi.getQueryFactory(getContext()); TransactionQuery txQuery = queryFactory.transactionQuery(); Long branchId = txQuery.andTxId(tx).getResults().getExactlyOne().getBranchId(); return branchId; }

Target:
protected Long getBranchUuidFromTxId(int tx) { TransactionQuery txQuery = getQueryFactory().transactionQuery(); Long branchId = txQuery.andTxId(tx).getResults().getExactlyOne().getBranchId(); return branchId; }
Source:
public void setEntries(IRuntimeClasspathEntry[] entries) { model.removeAll(); IRuntimeClasspathEntry entry; for (IRuntimeClasspathEntry entrie : entries) { entry = entrie; switch (entry.getClasspathProperty()) { case IRuntimeClasspathEntry.USER_CLASSES: model.addEntry(ClasspathModel.USER, entry); break; default: model.addEntry(ClasspathModel.BOOTSTRAP, entry); break; } } refresh(); }

Target:
public void setEntries(IRuntimeClasspathEntry[] entries) { model.removeAll(); for (IRuntimeClasspathEntry entry : entries) { switch (entry.getClasspathProperty()) { case IRuntimeClasspathEntry.USER_CLASSES: model.addEntry(ClasspathModel.USER, entry); break; default: model.addEntry(ClasspathModel.BOOTSTRAP, entry); break; } } refresh(); }
Source:
private boolean canBeSafelyDeleted(Path path, Instant threshold) { try { return Files.getLastModifiedTime(path).toInstant().isBefore(threshold); } catch (IOException e) { LOG.warn("Unable to access lastModifiedTime of and thus cannot be 100% sure that it can be deleted", path, e); return false; } }

Target:
private boolean canBeSafelyDeleted(Path path, Instant threshold) { try { return Files.getLastModifiedTime(path).toInstant().isBefore(threshold); } catch (IOException e) { LOG.warn(MessageFormat.format( JGitText.get().cannotAccessLastModifiedForSafeDeletion, path), e); return false; } }
Source:
protected void replaceInHistory( final ContributionAnnotation oldAnnotation, final ContributionAnnotation newAnnotation) { for (List<ContributionAnnotation> entry : queue) { for (final ListIterator<ContributionAnnotation> annotationsLit = entry.listIterator(); annotationsLit.hasNext(); ) { final ContributionAnnotation annotation = annotationsLit.next(); if (annotation.equals(oldAnnotation)) { annotationsLit.remove(); assert oldAnnotation.getSource().equals(newAnnotation.getSource()); annotationsLit.add(newAnnotation); return; } } } log.warn( "could not find annotation " + oldAnnotation + " in the current history for user: " + oldAnnotation.getSource()); }

Target:
void replaceInHistory( final ContributionAnnotation oldAnnotation, final ContributionAnnotation newAnnotation) { for (final List<ContributionAnnotation> entry : queue) { for (final ListIterator<ContributionAnnotation> annotationsListIt = entry.listIterator(); annotationsListIt.hasNext(); ) { final ContributionAnnotation annotation = annotationsListIt.next(); if (annotation.equals(oldAnnotation)) { annotationsListIt.remove(); assert oldAnnotation.getSource().equals(newAnnotation.getSource()); annotationsListIt.add(newAnnotation); return; } } } log.warn( "could not find annotation " + oldAnnotation + " in the current history for user: " + oldAnnotation.getSource()); }
Source:
public void start() { log.infof("Starting Hawkular Metrics Group Trigger Manager, distributed=%s", distributed); mgtExecutor = new ScheduledThreadPoolExecutor(THREAD_POOL_SIZE); refresh(); if (null == definitionsListener) { log.info("Registering Trigger UPDATE/REMOVE listener"); definitionsListener = new DefinitionsListener() { @Override public void onChange(Set<DefinitionsEvent> event) { if (coordinator) { log.warnf("Refreshing due to change event %s", event); refresh(); } } }; definitions.registerListener(definitionsListener, DefinitionsEvent.Type.TRIGGER_CONDITION_CHANGE, DefinitionsEvent.Type.TRIGGER_REMOVE); } }

Target:
public void start() { log.infof("Starting Hawkular Metrics Group Trigger Manager, distributed=%s", distributed); mgtExecutor = new ScheduledThreadPoolExecutor(THREAD_POOL_SIZE); refresh(); if (null == definitionsListener) { log.info("Registering Trigger UPDATE/REMOVE listener"); definitionsListener = new DefinitionsListener() { @Override public void onChange(Set<DefinitionsEvent> event) { if (coordinator) { log.debugf("Refreshing due to change event %s", event); refresh(); } } }; definitions.registerListener(definitionsListener, DefinitionsEvent.Type.TRIGGER_CONDITION_CHANGE, DefinitionsEvent.Type.TRIGGER_REMOVE); } }
Source:
public void render(DriveableType type) { super.render(type); renderPart(leftBackWheelModel); renderPart(rightBackWheelModel); renderPart(leftFrontWheelModel); renderPart(rightFrontWheelModel); renderPart(rightTrackModel); renderPart(leftTrackModel); renderPart(rightTrackWheelModels); renderPart(leftTrackWheelModels); renderPart(bodyDoorCloseModel); renderPart(trailerModel); renderPart(turretModel); renderPart(barrelModel); renderPart(drillHeadModel); for(ModelRendererTurbo[] mods : ammoModel) renderPart(mods); for(ModelRendererTurbo[] latm : leftAnimTrackModel) renderPart(latm); for(ModelRendererTurbo[] ratm : rightAnimTrackModel) renderPart(ratm); renderPart(rightAnimTrackModel1); renderPart(leftAnimTrackModel1); renderPart(rightAnimTrackModel2); renderPart(leftAnimTrackModel2); renderPart(rightAnimTrackModel3); renderPart(leftAnimTrackModel3); renderPart(steeringWheelModel); }

Target:
public void render(DriveableType type) { super.render(type); renderPart(leftBackWheelModel); renderPart(rightBackWheelModel); renderPart(leftFrontWheelModel); renderPart(rightFrontWheelModel); renderPart(rightTrackModel); renderPart(leftTrackModel); renderPart(rightTrackWheelModels); renderPart(leftTrackWheelModels); renderPart(bodyDoorCloseModel); renderPart(trailerModel); renderPart(turretModel); renderPart(barrelModel); renderPart(drillHeadModel); for(ModelRendererTurbo[] mods : ammoModel) renderPart(mods); for(ModelRendererTurbo[] latm : leftAnimTrackModel) renderPart(latm); for(ModelRendererTurbo[] ratm : rightAnimTrackModel) renderPart(ratm); renderPart(steeringWheelModel); }
Source:
private void loadPlugins() { Collection<File> pluginJars; try { pluginJars = getPluginFiles(); } catch (IOException e) { log.error("Cannot scan Gerrit plugins directory looking for jar files", e); return; } for (File jarFile : pluginJars) { Plugin plugin; try { plugin = loadPlugin(jarFile); pluginCache.put(plugin.name, plugin); } catch (IOException e) { log.error("Cannot access Plugin jar " + jarFile, e); } catch (ClassNotFoundException e) { log.error("Cannot load Plugin class module from " + jarFile, e); } } }

Target:
private void loadPlugins() { Collection<File> pluginJars; try { pluginJars = getPluginFiles(); } catch (IOException e) { log.error("Cannot scan Gerrit plugins directory looking for jar files", e); return; } for (File jarFile : pluginJars) { Plugin plugin; try { plugin = loadPlugin(jarFile); pluginCache.put(plugin.name, plugin); } catch (IOException e) { log.error("Cannot access plugin jar " + jarFile, e); } catch (ClassNotFoundException e) { log.error("Cannot load plugin class module from " + jarFile, e); } } }
Source:
protected void disposeAllServerInstances() throws Exception { if (TestConfig.isLocalServer() || TestConfig.isControllerProvided()) { KieServerControllerClient controllerClient; KieServerMgmtControllerClient mgmtControllerClient; if (TestConfig.isLocalServer()) { controllerClient = new KieServerControllerClient(TestConfig.getControllerHttpUrl(), null, null); mgmtControllerClient = new KieServerMgmtControllerClient(TestConfig.getControllerHttpUrl(), null, null); } else { controllerClient = new KieServerControllerClient(TestConfig.getControllerHttpUrl(), TestConfig.getUsername(), TestConfig.getPassword()); mgmtControllerClient = new KieServerMgmtControllerClient(TestConfig.getControllerHttpUrl(), TestConfig.getUsername(), TestConfig.getPassword()); } controllerClient.setMarshallingFormat(MarshallingFormat.JAXB); mgmtControllerClient.setMarshallingFormat(MarshallingFormat.JAXB); KieServerInstance[] serverInstrances = controllerClient.listKieServerInstances().getKieServerInstances(); for (KieServerInstance serverInstance : serverInstrances) { controllerClient.deleteKieServerInstance(serverInstance.getIdentifier()); } Collection<ServerTemplate> serverTemplates = mgmtControllerClient.listServerTemplates(); for (ServerTemplate serverTemplate : serverTemplates) { mgmtControllerClient.deleteServerTemplate(serverTemplate.getId()); } controllerClient.close(); mgmtControllerClient.close(); } }

Target:
protected void disposeAllServerInstances() throws Exception { if (TestConfig.isLocalServer() || TestConfig.isControllerProvided()) { disposeServerInstances(); disposeServerTemplates(); } }
Source:
private void configureAvailabilitySetForTemplate(Template template) { AvailabilitySet as = templateToAvailabilitySet.apply(template); if (as != null) { logger.debug(">> configuring nodes in availability set [%s]", as.name()); template.getOptions().as(AzureTemplateOptions.class).availabilitySet(as); } }

Target:
private void configureAvailabilitySetForTemplate(Template template) { AvailabilitySet availabilitySet = templateToAvailabilitySet.apply(template); if (availabilitySet != null) { logger.debug(">> configuring nodes in availability set [%s]", availabilitySet.name()); template.getOptions().as(AzureTemplateOptions.class).availabilitySet(availabilitySet); } }
Source:
public void startDetection(String containerId, String machineId, String workspaceId) { if (enableDetector) { instances.put(containerId, Pair.of(machineId, workspaceId)); } }

Target:
public void startDetection(String containerId, String machineId, String workspaceId) { if (isEnabled) { instances.put(containerId, Pair.of(machineId, workspaceId)); } }
Source:
private boolean authorSatisfies(IModel model, TurboIssue issue) { if (!content.isPresent()) return false; boolean shouldWarnUser = !model.isUserInRepo(issue.getRepoId(), content.get()); if (shouldWarnUser) { throw new SemanticException(String.format(USER_WARNING_ERROR_FORMAT, content.get(), issue.getRepoId())); } String creator = issue.getCreator(); return creator.toLowerCase().contains(content.get().toLowerCase()); }

Target:
private boolean authorSatisfies(IModel model, TurboIssue issue) { if (!content.isPresent()) return false; enforceUserInRepoCondition(model, issue.getRepoId(), content.get()); String creator = issue.getCreator(); return creator.toLowerCase().contains(content.get().toLowerCase()); }
Source:
public void succeedValidateNFS() { StorageServerConnections newNFSConnection = createNFSConnection( "multipass.my.domain.tlv.company.com:/export/allstorage/data2", StorageType.NFS, NfsVersion.V4, 300, 0); parameters.setStorageServerConnection(newNFSConnection); StorageDomain domain1 = new StorageDomain(); domain1.setStorage(newNFSConnection.getConnection()); domain1.setStatus(StorageDomainStatus.Maintenance); initDomainListForConnection(newNFSConnection.getId(), domain1); String guid = Guid.newGuid().toString(); when(storageConnDao.get(newNFSConnection.getId())).thenReturn(oldNFSConnection); doReturn("").when(command).isConnWithSameDetailsExists(newNFSConnection, null); doReturn("storage_domain_01").when(command).getStorageNameByConnectionId(guid); ValidateTestUtils.runAndAssertValidateSuccess(command); }

Target:
public void succeedValidateNFS() { StorageServerConnections newNFSConnection = createNFSConnection( "multipass.my.domain.tlv.company.com:/export/allstorage/data2", StorageType.NFS, NfsVersion.V4, 300, 0); parameters.setStorageServerConnection(newNFSConnection); StorageDomain domain1 = new StorageDomain(); domain1.setStorage(newNFSConnection.getConnection()); domain1.setStatus(StorageDomainStatus.Maintenance); initDomainListForConnection(newNFSConnection.getId(), domain1); String guid = Guid.newGuid().toString(); when(storageConnDao.get(newNFSConnection.getId())).thenReturn(oldNFSConnection); doReturn("").when(command).isConnWithSameDetailsExists(newNFSConnection, null); ValidateTestUtils.runAndAssertValidateSuccess(command); }
Source:
public void test() { assertThat(Kind.DECORATOR) .matches("@decorator") .matches("@foo.decorator") .matches("@decorator()") .matches("@decorator(1, 2)") .matches("@foo.decorator()") ; }

Target:
public void test() { assertThat(Kind.DECORATOR) .matches("@decorator") .matches("@foo.decorator") .matches("@foo.bar.decorator") .matches("@decorator()") .matches("@decorator(1, 2)") .matches("@foo.decorator()") .matches("@foo.bar.decorator(1, 2)") ; }
Source:
public boolean isLogReplaying() { CoordinatedStateManager m = server.getCoordinatedStateManager(); if (m == null) return false; return ((BaseCoordinatedStateManager)m).getSplitLogManagerCoordination().isReplaying(); }

Target:
public boolean isLogReplaying() { if (server.getCoordinatedStateManager() == null) return false; return ((BaseCoordinatedStateManager) server.getCoordinatedStateManager()) .getSplitLogManagerCoordination().isReplaying(); }
Source:
public boolean areServersStarted() { try { Map<ServerIdentity, ControlledProcessState.State> statuses = getServerStatuses(); for (Map.Entry<ServerIdentity, ControlledProcessState.State> entry : statuses.entrySet()) { switch (entry.getValue()) { case RUNNING: continue; default: log.log(Level.INFO, entry.getKey() + " status is " + entry.getValue()); return false; } } return true; } catch (Exception ignored) { log.severe(ignored.getLocalizedMessage()); } return false; }

Target:
public boolean areServersStarted() { try { Map<ServerIdentity, ControlledProcessState.State> statuses = getServerStatuses(); for (Map.Entry<ServerIdentity, ControlledProcessState.State> entry : statuses.entrySet()) { switch (entry.getValue()) { case RUNNING: continue; default: log.log(Level.INFO, entry.getKey() + " status is " + entry.getValue()); return false; } } return true; } catch (Exception ignored) { } return false; }