auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void finishRecord() { checkState(field != -1, "not in record"); checkState(field == columnTypes.size(), "not all fields set"); field = -1; cassandraSession.executeWithSession(s -> s.execute(insert.bind(values.toArray()))); }

Target:
public void finishRecord() { checkState(field != -1, "not in record"); checkState(field == columnTypes.size(), "not all fields set"); field = -1; cassandraSession.execute(insert.bind(values.toArray())); }
Source:
public Comparator<LamiTableEntry> getComparator() { return (o1, o2) -> { Number d1 = resolveNumber(o1); Number d2 = resolveNumber(o2); if (d1 == null && d2 == null) { return 0; } if (d1 == null) { return 1; } if (d2 == null) { return -1; } BigDecimal bd1 = new BigDecimal(d1.toString()); BigDecimal bd2 = new BigDecimal(d2.toString()); return bd1.compareTo(bd2); }; }

Target:
public Comparator<LamiTableEntry> getComparator() { return (o1, o2) -> { Number d1 = resolveNumber(o1); Number d2 = resolveNumber(o2); if (d1 == null && d2 == null) { return 0; } if (d1 == null) { return 1; } if (d2 == null) { return -1; } return Long.compare(d1.longValue(), d2.longValue()); }; }
Source:
private FinderPattern[] selectBestPatterns() throws NotFoundException { int startSize = possibleCenters.size(); if (startSize < 3) { throw NotFoundException.getNotFoundInstance(); } Collections.sort(possibleCenters, new EstimatedModuleComparator()); double distotion = Double.MAX_VALUE; double[] squares = new double[3]; FinderPattern[] bestPatterns = new FinderPattern[3]; for (int i = 0; i < possibleCenters.size() - 2; i++) { for (int j = i + 1; j < possibleCenters.size() - 1; j++) { for (int k = j + 1; k < possibleCenters.size(); k++) { float minModuleSize = possibleCenters.get(i).getEstimatedModuleSize(); float maxModuleSize = possibleCenters.get(k).getEstimatedModuleSize(); if (maxModuleSize > minModuleSize * 1.4f) { continue; } squares[0] = square(possibleCenters.get(i), possibleCenters.get(j)); squares[1] = square(possibleCenters.get(j), possibleCenters.get(k)); squares[2] = square(possibleCenters.get(k), possibleCenters.get(i)); Arrays.sort(squares); double d = Math.abs(squares[2] - 2 * squares[1]) + Math.abs(squares[2] - 2 * squares[0]); if (d < distotion) { distotion = d; bestPatterns[0] = possibleCenters.get(i); bestPatterns[1] = possibleCenters.get(j); bestPatterns[2] = possibleCenters.get(k); } } } } if (distotion == Double.MAX_VALUE) { throw NotFoundException.getNotFoundInstance(); } return bestPatterns; }

Target:
private FinderPattern[] selectBestPatterns() throws NotFoundException { int startSize = possibleCenters.size(); if (startSize < 3) { throw NotFoundException.getNotFoundInstance(); } Collections.sort(possibleCenters, moduleComparator); double distortion = Double.MAX_VALUE; double[] squares = new double[3]; FinderPattern[] bestPatterns = new FinderPattern[3]; for (int i = 0; i < possibleCenters.size() - 2; i++) { FinderPattern fpi = possibleCenters.get(i); float minModuleSize = fpi.getEstimatedModuleSize(); for (int j = i + 1; j < possibleCenters.size() - 1; j++) { FinderPattern fpj = possibleCenters.get(j); double squares0 = squaredDistance(fpi, fpj); for (int k = j + 1; k < possibleCenters.size(); k++) { FinderPattern fpk = possibleCenters.get(k); float maxModuleSize = fpk.getEstimatedModuleSize(); if (maxModuleSize > minModuleSize * 1.4f) { continue; } squares[0] = squares0; squares[1] = squaredDistance(fpj, fpk); squares[2] = squaredDistance(fpi, fpk); Arrays.sort(squares); double d = Math.abs(squares[2] - 2 * squares[1]) + Math.abs(squares[2] - 2 * squares[0]); if (d < distortion) { distortion = d; bestPatterns[0] = fpi; bestPatterns[1] = fpj; bestPatterns[2] = fpk; } } } } if (distortion == Double.MAX_VALUE) { throw NotFoundException.getNotFoundInstance(); } return bestPatterns; }
Source:
public static int hexStringToInt(String hexString) { return ByteBuffer.wrap(hexStringToByteArray(hexString)).getInt(); }

Target:
public static int hexStringToInt(String hexString) { if (hexString.length() != 8) { throw new IllegalArgumentException("Invalid hex string length for integer type"); } return ByteBuffer.wrap(hexStringToByteArray(hexString)).getInt(); }
Source:
public void readPayload(int id, PacketBuffer buffer, Side side, MessageContext ctx) throws IOException { super.readPayload(id, buffer, side, ctx); if(id == NET_RENDER_DATA) { power = buffer.readLong(); } }

Target:
public void readPayload(int id, PacketBuffer buffer, Side side, MessageContext ctx) throws IOException { super.readPayload(id, buffer, side, ctx); if(id == NET_GUI_DATA) { power = buffer.readLong(); } }
Source:
public Schema outputSchema(Schema input) { try { return Utils .getSchemaFromString("PopulationInfo:Tuple(columnId : int, binLen : int, unitSum : double, positiveCounter : chararray, negativeCounter : chararray)"); } catch (ParserException e) { log.debug("Error when generating output schema.", e); return null; } }

Target:
public Schema outputSchema(Schema input) { try { return Utils .getSchemaFromString("PopulationInfo:Tuple(columnId : int, binLen : int, unitSum : double, positiveCounter : chararray, negativeCounter : chararray)"); } catch (ParserException e) { log.error("Error when generating output schema.", e); return null; } }
Source:
private BlobId addBlobToSet(MockMessageWriteSet messageWriteSet, long size, long expiresAtMs, short accountId, short containerId) throws StoreException { BlobId id = getUniqueId(accountId, containerId); long crc = random.nextLong(); MessageInfo info = new MessageInfo(id, size, false, false, expiresAtMs, crc, accountId, containerId, Utils.Infinite_Time); ByteBuffer buffer = ByteBuffer.wrap(TestUtils.getRandomBytes((int) size)); messageWriteSet.add(info, buffer); return id; }

Target:
private BlobId addBlobToSet(MockMessageWriteSet messageWriteSet, long size, long expiresAtMs, short accountId, short containerId) { BlobId id = getUniqueId(accountId, containerId); long crc = random.nextLong(); MessageInfo info = new MessageInfo(id, size, false, false, expiresAtMs, crc, accountId, containerId, Utils.Infinite_Time); ByteBuffer buffer = ByteBuffer.wrap(TestUtils.getRandomBytes((int) size)); messageWriteSet.add(info, buffer); return id; }
Source:
public void run() { try { while (true) { Request request = submittedRequests.take(); if (Request.requestOfDeath == request) { break; } if (request.mustDrop()) { continue; } if (maxRequests > 0) { while (!killed) { if (dropStaleRequests && request.isStale()) { dropRequest(request); ServerMetrics.getMetrics().STALE_REQUESTS_DROPPED.add(1); request = null; break; } if (zks.getInProcess() < maxRequests) { break; } throttleSleep(stallTime); } } if (killed) { break; } if (request != null) { if (request.isStale()) { ServerMetrics.getMetrics().STALE_REQUESTS.add(1); } zks.submitRequestNow(request); } } } catch (InterruptedException e) { LOG.error("Unexpected interruption", e); } int dropped = drainQueue(); LOG.info("RequestThrottler shutdown. Dropped " + dropped + " requests"); }

Target:
public void run() { try { while (true) { if (killed) { break; } Request request = submittedRequests.take(); if (Request.requestOfDeath == request) { break; } if (request.mustDrop()) { continue; } if (maxRequests > 0) { while (!killed) { if (dropStaleRequests && request.isStale()) { dropRequest(request); ServerMetrics.getMetrics().STALE_REQUESTS_DROPPED.add(1); request = null; break; } if (zks.getInProcess() < maxRequests) { break; } throttleSleep(stallTime); } } if (killed) { break; } if (request != null) { if (request.isStale()) { ServerMetrics.getMetrics().STALE_REQUESTS.add(1); } zks.submitRequestNow(request); } } } catch (InterruptedException e) { LOG.error("Unexpected interruption", e); } int dropped = drainQueue(); LOG.info("RequestThrottler shutdown. Dropped requests", dropped); }
Source:
protected void ExecuteVmCommand() { lockVmWithCompensationIfNeeded(); if (!isInternalExecution()) { freeLock(); } restoreSnapshotAndRemoveObsoleteSnapshots(); VdcReturnValueBase returnValue = null; for (DiskImage image : getImagesList()) { if (image.getimageStatus() != ImageStatus.ILLEGAL) { ImagesContainterParametersBase params = new RestoreFromSnapshotParameters(image.getImageId(), getVmId(), targetSnapshot, removedSnapshotId); returnValue = runAsyncTask(VdcActionType.RestoreFromSnapshot, params); } } if (getImagesList().size() > 0) { if (getTaskIdList().size() == 0) { log.errorFormat("Can't restore snapshot for VM, since no destroyImage task could be established in the VDSM."); if (returnValue != null) { getReturnValue().setFault(returnValue.getFault()); return; } } else { setSucceeded(true); } deleteOrphanedImages(); removeSnapshotsFromDB(); } else { removeSnapshotsFromDB(); EndVmCommand(); setSucceeded(true); } }

Target:
protected void ExecuteVmCommand() { lockVmWithCompensationIfNeeded(); if (!isInternalExecution()) { freeLock(); } restoreSnapshotAndRemoveObsoleteSnapshots(); if (getImagesList().size() > 0) { VdcReturnValueBase returnValue = null; for (DiskImage image : getImagesList()) { if (image.getimageStatus() != ImageStatus.ILLEGAL) { ImagesContainterParametersBase params = new RestoreFromSnapshotParameters(image.getImageId(), getVmId(), targetSnapshot, removedSnapshotId); returnValue = runAsyncTask(VdcActionType.RestoreFromSnapshot, params); } } if (getTaskIdList().size() == 0) { log.errorFormat("Can't restore snapshot for VM, since no destroyImage task could be established in the VDSM."); if (returnValue != null) { getReturnValue().setFault(returnValue.getFault()); return; } } else { setSucceeded(true); } deleteOrphanedImages(); removeSnapshotsFromDB(); } else { removeSnapshotsFromDB(); EndVmCommand(); setSucceeded(true); } }
Source:
public void start() { String disableReceiver = System.getProperty(DISABLE_RECEIVER); if (disableReceiver != null && Boolean.parseBoolean(disableReceiver)) { log.info("Receiver disabled."); return; } try { ThriftDataReceiverConfiguration thriftDataReceiverConfiguration = new ThriftDataReceiverConfiguration( ServiceHolder.getDataBridgeReceiverService().getInitialConfig(), ServiceHolder.getCarbonRuntime().getConfiguration().getPortsConfig().getOffset()); if (ServiceHolder.getDataReceiver() == null) { ServiceHolder.setDataReceiver(new ThriftDataReceiverFactory().createAgentServer( thriftDataReceiverConfiguration, ServiceHolder.getDataBridgeReceiverService())); String hostName = thriftDataReceiverConfiguration.getReceiverHostName(); if (null == hostName) { hostName = HostAddressFinder.findAddress("localhost"); } ServiceHolder.getDataReceiver().start(hostName); } } catch (DataBridgeException e) { log.error("Can not create and start Agent Server ", e); } catch (RuntimeException e) { log.error("Error in starting Agent Server ", e); } catch (Throwable e) { log.error("Unexpected Error in starting Agent Server ", e); } }

Target:
public void start() { String disableReceiver = System.getProperty(DISABLE_RECEIVER); if (Boolean.parseBoolean(disableReceiver)) { log.info("Receiver disabled."); return; } try { ThriftDataReceiverConfiguration thriftDataReceiverConfiguration = new ThriftDataReceiverConfiguration( ServiceHolder.getDataBridgeReceiverService().getInitialConfig(), ServiceHolder.getCarbonRuntime().getConfiguration().getPortsConfig().getOffset()); if (ServiceHolder.getDataReceiver() == null) { ServiceHolder.setDataReceiver(new ThriftDataReceiverFactory().createAgentServer( thriftDataReceiverConfiguration, ServiceHolder.getDataBridgeReceiverService())); String hostName = thriftDataReceiverConfiguration.getReceiverHostName(); if (null == hostName) { hostName = HostAddressFinder.findAddress("localhost"); } ServiceHolder.getDataReceiver().start(hostName); isStarted = true; } } catch (DataBridgeException e) { log.error("Can not create and start Agent Server ", e); } catch (RuntimeException e) { log.error("Error in starting Agent Server ", e); } catch (Throwable e) { log.error("Unexpected Error in starting Agent Server ", e); } }
Source:
public static void input(@AggregationState HyperLogLogState state, @SqlType(StandardTypes.BIGINT) long value, @SqlType(StandardTypes.DOUBLE) double maxStandardError) { HyperLogLog hll = ApproximateCountDistinctAggregation.getOrCreateHyperLogLog(state, maxStandardError); state.addMemoryUsage(-hll.estimatedInMemorySize()); hll.add(value); state.addMemoryUsage(hll.estimatedInMemorySize()); }

Target:
public static void input(@AggregationState HyperLogLogState state, @SqlType(StandardTypes.BIGINT) long value, @SqlType(StandardTypes.DOUBLE) double maxStandardError) { HyperLogLog hll = HyperLogLogUtils.getOrCreateHyperLogLog(state, maxStandardError); state.addMemoryUsage(-hll.estimatedInMemorySize()); hll.add(value); state.addMemoryUsage(hll.estimatedInMemorySize()); }
Source:
public ProfileEntryValue convert( final com.alliander.osgp.domain.core.valueobjects.smartmetering.ProfileEntryValue source, final Type<? extends ProfileEntryValue> destinationType) { final ProfileEntryValue result = new ProfileEntryValue(); if (source.getValue() instanceof Date) { result.getStringValueOrDateValueOrFloatValue().add( DateConverter.createXMLGregorianCalendar((Date) source.getValue())); } else { result.getStringValueOrDateValueOrFloatValue().add(source.getValue()); } return result; }

Target:
public ProfileEntryValue convert( final com.alliander.osgp.domain.core.valueobjects.smartmetering.ProfileEntryValue source, final Type<? extends ProfileEntryValue> destinationType) { final ProfileEntryValue result = new ProfileEntryValue(); if (source.getValue() instanceof Date) { final XMLGregorianCalendar xmlGregCal = this.mapperFacade .map(source.getValue(), XMLGregorianCalendar.class); result.getStringValueOrDateValueOrFloatValue().add(xmlGregCal); } else { result.getStringValueOrDateValueOrFloatValue().add(source.getValue()); } return result; }
Source:
public void testCreate() throws StripeException { Map<String, Object> params = new HashMap<String, Object>(); params.put("amount", 100); params.put("currency", "usd"); params.put("destination", "acct_123"); Transfer transfer = Transfer.create(params); assertNotNull(transfer); verifyRequest( APIResource.RequestMethod.POST, "/v1/transfers", params ); }

Target:
public void testCreate() throws StripeException { final Map<String, Object> params = new HashMap<String, Object>(); params.put("amount", 100); params.put("currency", "usd"); params.put("destination", "acct_123"); final Transfer transfer = Transfer.create(params); assertNotNull(transfer); verifyRequest( APIResource.RequestMethod.POST, "/v1/transfers", params ); }
Source:
public DefaultLogger(String className) { String classPath; try { classPath = Class.forName(className).getCanonicalName(); } catch (ClassNotFoundException e) { classPath = className; } this.classPath = classPath; this.configuredLogLevel = LogLevel.fromString(Configuration.getGlobalConfiguration().get(Configuration.PROPERTY_AZURE_LOG_LEVEL)) .getLogLevel(); }

Target:
public DefaultLogger(String className) { String classPath; try { classPath = Class.forName(className).getCanonicalName(); } catch (ClassNotFoundException e) { classPath = className; } this.classPath = classPath; int configuredLogLevel = LogLevel.fromString(Configuration.getGlobalConfiguration().get(Configuration.PROPERTY_AZURE_LOG_LEVEL)) .getLogLevel(); isTraceEnabled = LogLevel.VERBOSE.getLogLevel() > configuredLogLevel; isDebugEnabled = LogLevel.VERBOSE.getLogLevel() >= configuredLogLevel; isInfoEnabled = LogLevel.INFORMATIONAL.getLogLevel() >= configuredLogLevel; isWarnEnabled = LogLevel.WARNING.getLogLevel() >= configuredLogLevel; isErrorEnabled = LogLevel.ERROR.getLogLevel() >= configuredLogLevel; }
Source:
private static PlanFragment createTableScanPlanFragment(String name) { Symbol symbol = new Symbol("column"); PlanNode planNode = new TableScanNode( new PlanNodeId(name), new TableHandle(new ConnectorId("test"), new TestingMetadata.TestingTableHandle()), ImmutableList.of(symbol), ImmutableMap.of(symbol, new TestingColumnHandle("column")), Optional.empty(), TupleDomain.all(), null); return createFragment(planNode); }

Target:
private static PlanFragment createTableScanPlanFragment(String name) { Symbol symbol = new Symbol("column"); PlanNode planNode = new TableScanNode( new PlanNodeId(name), new TableHandle(new ConnectorId("test"), new TestingTableHandle()), ImmutableList.of(symbol), ImmutableMap.of(symbol, new TestingColumnHandle("column")), Optional.empty(), TupleDomain.all(), null); return createFragment(planNode); }
Source:
private String getErrorPrefix() { String toRet = "In presenter " + presenterInspector.getPresenterClassName() + ", method " + functionName + " annotated with @" + ProxyEvent.class.getSimpleName(); if (classParameter != Null.class) { toRet += ", signed with one class parameter,"; } return toRet; }

Target:
private String getErrorPrefix() { String toReturn = "In presenter " + presenterInspector.getPresenterClassName() + ", method " + functionName + " annotated with @" + ProxyEvent.class.getSimpleName(); if (classParameter != Null.class) { toReturn += ", signed with one class parameter,"; } return toReturn; }
Source:
public void testSingleTypeElement() throws IOException, ParserException { final TestFileUtilsImpl fileUtils = new TestFileUtilsImpl(); final Ds3SpecParser parser = new Ds3SpecParserImpl(); final Ds3ApiSpec spec = parser.getSpec(CCodeGenerator_Test.class.getResourceAsStream("/input/TypeElement.xml")); final CCodeGenerator codeGenerator = new CCodeGenerator(); codeGenerator.generate(spec, fileUtils, null); final ByteArrayOutputStream bstream = (ByteArrayOutputStream) fileUtils.getOutputStream(); final String output = new String(bstream.toByteArray()); LOG.info("Generated code:\n" + output); assertTrue(output.contains("typedef enum {")); assertTrue(output.contains(" ds3_str* api_version;")); assertTrue(output.contains(" ds3_bool backend_activated;")); assertTrue(output.contains(" ds3_build_information* build_information;")); assertTrue(output.contains(" ds3_str* serial_number;")); assertTrue(output.contains("}")); }

Target:
public void testSingleTypeElement() throws IOException, ParserException { final TestFileUtilsImpl fileUtils = new TestFileUtilsImpl(); final Ds3SpecParser parser = new Ds3SpecParserImpl(); final Ds3ApiSpec spec = parser.getSpec(CCodeGenerator_Test.class.getResourceAsStream("/input/TypeElement.xml")); final CCodeGenerator codeGenerator = new CCodeGenerator(); codeGenerator.generate(spec, fileUtils, null); final ByteArrayOutputStream bstream = (ByteArrayOutputStream) fileUtils.getOutputStream(); final String output = new String(bstream.toByteArray()); LOG.info("Generated code:\n" + output); assertTrue(output.contains("typedef enum {")); assertTrue(output.contains(" ds3_str* api_version;")); assertTrue(output.contains(" ds3_bool backend_activated;")); assertTrue(output.contains(" ds3_build_information* build_information;")); assertTrue(output.contains(" ds3_str* serial_number;")); assertTrue(output.contains("}ds3_get_system_information_response;")); }
Source:
public List<CompletePaxosHistoryForNamespaceAndUseCase> getHistory() { Map<NamespaceAndUseCase, Long> lastVerifiedSequences = getNamespaceAndUseCaseToLastVerifiedSeqMap(); PaxosHistoryOnSingleNode localPaxosHistory = localHistoryLoader.getLocalPaxosHistory(lastVerifiedSequences); List<HistoryQuery> historyQueries = getHistoryQueryListForRemoteServers(lastVerifiedSequences); List<PaxosHistoryOnRemote> rawHistoryFromAllRemotes = getHistoriesFromRemoteServers(historyQueries); List<NamespaceAndUseCaseWiseConsolidatedLearnerAndAcceptorRecords> historyFromAllRemotes = buildHistoryFromRemoteResponses(rawHistoryFromAllRemotes); return consolidateAndGetHistoriesAcrossAllNodes( lastVerifiedSequences, localPaxosHistory, historyFromAllRemotes); }

Target:
public List<CompletePaxosHistoryForNamespaceAndUseCase> getHistory() { Map<NamespaceAndUseCase, Long> lastVerifiedSequences = getNamespaceAndUseCaseToLastVerifiedSeqMap(); PaxosHistoryOnSingleNode localPaxosHistory = localHistoryLoader.getLocalPaxosHistory(lastVerifiedSequences); List<HistoryQuery> historyQueries = getHistoryQueryListForRemoteServers(lastVerifiedSequences); List<PaxosHistoryOnRemote> rawHistoryFromAllRemotes = getHistoriesFromRemoteServers(historyQueries); List<ConsolidatedPaxosHistoryOnSingleNode> historyFromAllRemotes = buildHistoryFromRemoteResponses(rawHistoryFromAllRemotes); return consolidateAndGetHistoriesAcrossAllNodes( lastVerifiedSequences, localPaxosHistory, historyFromAllRemotes); }
Source:
private RowExpression toRowExpression(Session session, Expression projectionExpression) { Map<NodeRef<Expression>, Type> expressionTypes = getExpressionTypes( session, metadata, SQL_PARSER, TypeProvider.copyOf(INPUT_TYPES), projectionExpression, ImmutableList.of(), WarningCollector.NOOP); return toRowExpression(projectionExpression, expressionTypes, INPUT_MAPPING); }

Target:
private RowExpression toRowExpression(Session session, Expression projectionExpression) { Map<NodeRef<Expression>, Type> expressionTypes = getExpressionTypes( session, metadata, SQL_PARSER, SYMBOL_TYPES, projectionExpression, ImmutableList.of(), WarningCollector.NOOP); return toRowExpression(projectionExpression, expressionTypes, INPUT_MAPPING); }
Source:
protected boolean checkBillingFrequency() { boolean success = true; String newBillingFrequencyCode = newAwardCopy.getBillingFrequencyCode(); String oldBillingFrequencyCode = oldAwardCopy.getBillingFrequencyCode(); if (!org.apache.commons.lang3.StringUtils.equals(newBillingFrequencyCode, oldBillingFrequencyCode)) { if (org.apache.commons.lang3.StringUtils.equals(oldBillingFrequencyCode, CGConstants.MILESTONE_BILLING_SCHEDULE_CODE) && SpringContext.getBean(AccountsReceivableModuleBillingService.class).hasActiveMilestones(newAwardCopy.getProposalNumber())) { success = false; putFieldError(CGPropertyConstants.AwardFields.BILLING_FREQUENCY_CODE, CGKeyConstants.AwardConstants.ERROR_CG_ACTIVE_MILESTONES_EXIST, getBillingFrequencyDescription(newAwardCopy)); } else if (org.apache.commons.lang3.StringUtils.equals(oldBillingFrequencyCode, CGConstants.PREDETERMINED_BILLING_SCHEDULE_CODE) && SpringContext.getBean(AccountsReceivableModuleBillingService.class).hasActiveBills(newAwardCopy.getProposalNumber())) { success = false; putFieldError(CGPropertyConstants.AwardFields.BILLING_FREQUENCY_CODE, CGKeyConstants.AwardConstants.ERROR_CG_ACTIVE_BILLS_EXIST, getBillingFrequencyDescription(newAwardCopy)); } } return success; }

Target:
protected boolean checkBillingFrequency() { boolean success = true; String newBillingFrequencyCode = newAwardCopy.getBillingFrequencyCode(); String oldBillingFrequencyCode = oldAwardCopy.getBillingFrequencyCode(); if (!StringUtils.equals(newBillingFrequencyCode, oldBillingFrequencyCode)) { if (StringUtils.equals(oldBillingFrequencyCode, CGConstants.MILESTONE_BILLING_SCHEDULE_CODE) && SpringContext.getBean(AccountsReceivableModuleBillingService.class).hasActiveMilestones(newAwardCopy.getProposalNumber())) { success = false; putFieldError(CGPropertyConstants.AwardFields.BILLING_FREQUENCY_CODE, CGKeyConstants.AwardConstants.ERROR_CG_ACTIVE_MILESTONES_EXIST, getBillingFrequencyDescription(newAwardCopy)); } else if (StringUtils.equals(oldBillingFrequencyCode, CGConstants.PREDETERMINED_BILLING_SCHEDULE_CODE) && SpringContext.getBean(AccountsReceivableModuleBillingService.class).hasActiveBills(newAwardCopy.getProposalNumber())) { success = false; putFieldError(CGPropertyConstants.AwardFields.BILLING_FREQUENCY_CODE, CGKeyConstants.AwardConstants.ERROR_CG_ACTIVE_BILLS_EXIST, getBillingFrequencyDescription(newAwardCopy)); } } return success; }
Source:
public void setNumerator(final long value) { numerator.dec(numerator.getCount()); numerator.inc(value); }

Target:
public void setNumerator(final long value) { numerator.set(value); }
Source:
private OnHeapValueHolder<V> putIfAbsent(final K key, final V value, boolean returnInCacheHolder) throws CacheAccessException { putIfAbsentObserver.begin(); checkKey(key); checkValue(value); final AtomicReference<OnHeapValueHolder<V>> returnValue = new AtomicReference<OnHeapValueHolder<V>>(null); final AtomicBoolean entryActuallyAdded = new AtomicBoolean(); final long now = timeSource.getTimeMillis(); try { OnHeapValueHolder<V> inCache = map.compute(key, new BiFunction<K, OnHeapValueHolder<V>, OnHeapValueHolder<V>>() { @Override public OnHeapValueHolder<V> apply(K mappedKey, OnHeapValueHolder<V> mappedValue) { if (mappedValue == null || mappedValue.isExpired(now, TimeUnit.MILLISECONDS)) { if (mappedValue != null) { onExpiration(mappedKey, mappedValue); } entryActuallyAdded.set(true); return newCreateValueHolder(key, value, now); } returnValue.set(mappedValue); if (setAccessTimeAndExpiry(key, mappedValue, now) == null) { onExpiration(mappedKey, mappedValue); return null; } return mappedValue; } }); if (entryActuallyAdded.get()) { putIfAbsentObserver.end(StoreOperationOutcomes.PutIfAbsentOutcome.PUT); enforceCapacity(1); } else { putIfAbsentObserver.end(StoreOperationOutcomes.PutIfAbsentOutcome.HIT); } if (returnInCacheHolder) { return inCache; } } catch (RuntimeException re) { handleRuntimeException(re); } return returnValue.get(); }

Target:
private OnHeapValueHolder<V> putIfAbsent(final K key, final V value, boolean returnInCacheHolder) throws CacheAccessException { putIfAbsentObserver.begin(); checkKey(key); checkValue(value); final AtomicReference<OnHeapValueHolder<V>> returnValue = new AtomicReference<OnHeapValueHolder<V>>(null); final AtomicBoolean entryActuallyAdded = new AtomicBoolean(); final long now = timeSource.getTimeMillis(); try { OnHeapValueHolder<V> inCache = map.compute(key, new BiFunction<K, OnHeapValueHolder<V>, OnHeapValueHolder<V>>() { @Override public OnHeapValueHolder<V> apply(K mappedKey, OnHeapValueHolder<V> mappedValue) { if (mappedValue == null || mappedValue.isExpired(now, TimeUnit.MILLISECONDS)) { if (mappedValue != null) { onExpiration(mappedKey, mappedValue); } entryActuallyAdded.set(true); return newCreateValueHolder(key, value, now); } returnValue.set(mappedValue); return setAccessTimeAndExpiryThenReturnMapping(key, mappedValue, now, false); } }); if (entryActuallyAdded.get()) { putIfAbsentObserver.end(StoreOperationOutcomes.PutIfAbsentOutcome.PUT); enforceCapacity(1); } else { putIfAbsentObserver.end(StoreOperationOutcomes.PutIfAbsentOutcome.HIT); } if (returnInCacheHolder) { return inCache; } } catch (RuntimeException re) { handleRuntimeException(re); } return returnValue.get(); }
Source:
public EngineBackupLog getLastSuccessfulEngineBackup(String dbName) { TypedQuery query = entityManager.createNamedQuery("EngineBackupLog.getLatest", EngineBackupLog.class).setParameter("dbName", dbName); query.setMaxResults(1); EngineBackupLog log = singleResult(query); return log; }

Target:
public EngineBackupLog getLastSuccessfulEngineBackup(String dbName) { TypedQuery<EngineBackupLog> query = entityManager.createNamedQuery("EngineBackupLog.getLatest", EngineBackupLog.class).setParameter("dbName", dbName).setMaxResults(1); return singleResult(query); }
Source:
public Mono<ResponseEntity<?>> setSignal(@ApiParam("Internal id for workflow instance") @PathVariable("id") long id, @RequestBody @Valid @ApiParam("New signal value") SetSignalRequest req) { return handleExceptions(() -> { return wrapBlocking(() -> { SetSignalResponse response = new SetSignalResponse(); response.setSignalSuccess = workflowInstances.setSignal(id, ofNullable(req.signal), req.reason, WorkflowActionType.externalChange); return ok(response); }); }); }

Target:
public Mono<ResponseEntity<?>> setSignal(@ApiParam("Internal id for workflow instance") @PathVariable("id") long id, @RequestBody @Valid @ApiParam("New signal value") SetSignalRequest req) { return handleExceptions(() -> wrapBlocking(() -> { SetSignalResponse response = new SetSignalResponse(); response.setSignalSuccess = workflowInstances.setSignal(id, ofNullable(req.signal), req.reason, WorkflowActionType.externalChange); return ok(response); })); }
Source:
@Test public void topPrivateDomain() { assertThat(parse("<LINK_0>").topPrivateDomain()).isEqualTo("google.com"); assertThat(parse("<LINK_6>").topPrivateDomain()) .isEqualTo("google.co.uk"); assertThat(parse("https://栃.栃木.jp").topPrivateDomain()) .isEqualTo("xn--ewv.xn--4pvxs.jp"); assertThat(parse("<LINK_1>").topPrivateDomain()) .isEqualTo("xn--ewv.xn--4pvxs.jp"); assertThat(parse("<LINK_4>").topPrivateDomain()).isNull(); assertThat(parse("https://square").topPrivateDomain()).isNull(); assertThat(parse("https://栃木.jp").topPrivateDomain()).isNull(); assertThat(parse("<LINK_2>").topPrivateDomain()).isNull(); assertThat(parse("https://localhost").topPrivateDomain()).isNull(); assertThat(parse("<LINK_3>").topPrivateDomain()).isNull(); assertThat(parse("http://a./").topPrivateDomain()).isNull(); }

Target:
@Test public void topPrivateDomain() { assertThat(parse("<LINK_0>").topPrivateDomain()).isEqualTo("google.com"); assertThat(parse("<LINK_6>").topPrivateDomain()) .isEqualTo("google.co.uk"); assertThat(parse("https://栃.栃木.jp").topPrivateDomain()) .isEqualTo("xn--ewv.xn--4pvxs.jp"); assertThat(parse("<LINK_1>").topPrivateDomain()) .isEqualTo("xn--ewv.xn--4pvxs.jp"); assertThat(parse("<LINK_4>").topPrivateDomain()).isNull(); assertThat(parse("https://square").topPrivateDomain()).isNull(); assertThat(parse("https://栃木.jp").topPrivateDomain()).isNull(); assertThat(parse("<LINK_2>").topPrivateDomain()).isNull(); assertThat(parse("https://localhost").topPrivateDomain()).isNull(); assertThat(parse("<LINK_3>").topPrivateDomain()).isNull(); assertThat(parse("http://a./").topPrivateDomain()).isNull(); assertThat(parse("http://./").topPrivateDomain()).isNull(); assertThat(parse("<LINK_5>").topPrivateDomain()).isEqualTo("squareup.com"); }
Source:
public void validate(SourceStorage source, FactoryParameter.Version version) throws ConflictException { for (Map.Entry<String, String> entry : source.getParameters().entrySet()) { switch (entry.getKey()) { case "keepVcs": final String keepVcs = entry.getValue(); if (!"true".equals(keepVcs) && !"false".equals(keepVcs)) { throw new ConflictException( format( PARAMETRIZED_ILLEGAL_PARAMETER_VALUE_MESSAGE, "source.project.parameters.keepVcs", entry.getValue())); } break; case "skipFirstLevel": final String skipFirstLevel = entry.getValue(); if (!"true".equals(skipFirstLevel) && !"false".equals(skipFirstLevel)) { throw new ConflictException( format( PARAMETRIZED_ILLEGAL_PARAMETER_VALUE_MESSAGE, "source.project.parameters.skipFirstLevel", entry.getValue())); } break; case "branch": case "startPoint": case "commitId": case "keepDir": case "fetch": case "branchMerge": break; default: throw new ConflictException( format( PARAMETRIZED_INVALID_PARAMETER_MESSAGE, "source.project.parameters." + entry.getKey(), version)); } } }

Target:
public void validate(SourceStorage source, FactoryParameter.Version version) throws ConflictException { for (Map.Entry<String, String> entry : source.getParameters().entrySet()) { switch (entry.getKey()) { case "keepVcs": final String keepVcs = entry.getValue(); if (!"true".equals(keepVcs) && !"false".equals(keepVcs)) { throw new ConflictException( format( PARAMETRIZED_ILLEGAL_PARAMETER_VALUE_MESSAGE, "source.project.parameters.keepVcs", entry.getValue())); } break; case "skipFirstLevel": final String skipFirstLevel = entry.getValue(); if (!"true".equals(skipFirstLevel) && !"false".equals(skipFirstLevel)) { throw new ConflictException( format( PARAMETRIZED_ILLEGAL_PARAMETER_VALUE_MESSAGE, "project.source.parameters.skipFirstLevel", entry.getValue())); } break; case "branch": case "startPoint": case "commitId": case "keepDir": case "fetch": case "branchMerge": break; default: throw new ConflictException( format( PARAMETRIZED_INVALID_PARAMETER_MESSAGE, "source.project.parameters." + entry.getKey(), version)); } } }
Source:
public void setUp() { this.registration1 = TestClientRegistrations.clientRegistration().build(); this.registration2 = TestClientRegistrations.clientRegistration2().build(); this.registration3 = TestClientRegistrations.clientRegistration3().build(); this.pkceRegistration = TestClientRegistrations.clientRegistration() .registrationId("pkce-client-registration-id") .clientId("pkce-client-id") .clientAuthenticationMethod(ClientAuthenticationMethod.NONE) .clientSecret(null) .build(); this.clientRegistrationRepository = new InMemoryClientRegistrationRepository( this.registration1, this.registration2, this.registration3, this.pkceRegistration); this.resolver = new DefaultOAuth2AuthorizationRequestResolver( this.clientRegistrationRepository, this.authorizationRequestBaseUri); }

Target:
public void setUp() { this.registration1 = TestClientRegistrations.clientRegistration().build(); this.registration2 = TestClientRegistrations.clientRegistration2().build(); this.fineRedirectUriTemplateRegistration = fineRedirectUriTemplateClientRegistration().build(); this.pkceRegistration = TestClientRegistrations.clientRegistration() .registrationId("pkce-client-registration-id") .clientId("pkce-client-id") .clientAuthenticationMethod(ClientAuthenticationMethod.NONE) .clientSecret(null) .build(); this.clientRegistrationRepository = new InMemoryClientRegistrationRepository( this.registration1, this.registration2, this.fineRedirectUriTemplateRegistration, this.pkceRegistration); this.resolver = new DefaultOAuth2AuthorizationRequestResolver( this.clientRegistrationRepository, this.authorizationRequestBaseUri); }
Source:
public MetadataResponse resubmitMessage(EsbMessage esbMessage) { ResubmitRequest request = new ResubmitRequest(); EsbMessageEntity persistedMessage = entityMgr.find(EsbMessageEntity.class, esbMessage.getId()); request.setHeaders( reduceToEsbHeaders(persistedMessage) ); request.setDestination( persistedMessage.getHeader("esbResubmitDestination").getValue() ); request.setSystem( persistedMessage.getSourceSystem() ); if( persistedMessage == null ){ throw new IllegalArgumentException("Message {\n}"+esbMessage.toString()+"\n} does not exist in backend store, cannot update."); } if( isEditableMessage(esbMessage) ){ request.setPayload( esbMessage.getPayload() ); } else { request .setPayload( persistedMessage.getPayload() ); } saveAuditEvent( new AuditEvent(DEFAULT_USER, RESUBMIT_EVENT, "", "", "", request.getPayload().toString() ) ); MetadataResponse result = sendMessageToResubmitGateway( request.toString() ); persistedMessage.setResubmittedOn(new Date()); entityMgr.flush(); return result; }

Target:
public MetadataResponse resubmitMessage(EsbMessage esbMessage) { ResubmitRequest request = new ResubmitRequest(); EsbMessageEntity persistedMessage = entityMgr.find(EsbMessageEntity.class, esbMessage.getId()); if( persistedMessage == null ){ throw new IllegalArgumentException("Message {\n}"+esbMessage.toString()+"\n} does not exist in backend store, cannot update."); } try{ request.setDestination( persistedMessage.getHeader( getResubmitControlHeader() ).getValue() ); }catch(Exception e){ LOG.warn("Warning: Message that was resubmitted lacked configured control header! Message ID: " + new Long(esbMessage.getId()).toString() ); MetadataResponse result = new MetadataResponse(); result.setErrorMessage("Unable to resubmit message due to configured resubmit control header not being present on message."); return result; } request.setHeaders( reduceToEsbHeaders(persistedMessage) ); request.setSystem( persistedMessage.getSourceSystem() ); LOG.warn(esbMessage.toString()); if( isEditableMessage(persistedMessage) ){ request.setPayload( esbMessage.getPayload() ); } else { request.setPayload( persistedMessage.getPayload() ); } saveAuditEvent( new AuditEvent(DEFAULT_USER, RESUBMIT_EVENT, "", "", "", request.getPayload().toString() ) ); MetadataResponse result = sendMessageToResubmitGateway( request.toString() ); persistedMessage.setResubmittedOn(new Date()); entityMgr.flush(); return result; }
Source:
public void verify(DecodedJWT jwt) throws SignatureVerificationException { byte[] contentBytes = String.format("%s.%s", jwt.getHeader(), jwt.getPayload()).getBytes(Charset.forName("UTF-8")); byte[] signatureBytes = Base64.decodeBase64(jwt.getSignature()); try { ECPublicKey publicKey = keyProvider.getPublicKeyById(jwt.getKeyId()); if (publicKey == null) { throw new IllegalStateException("The given Public Key is null."); } boolean valid = crypto.verifySignatureFor(getDescription(), publicKey, contentBytes, JOSEToDER(signatureBytes)); if (!valid) { throw new SignatureVerificationException(this); } } catch (Exception e) { throw new SignatureVerificationException(this, e); } }

Target:
public void verify(DecodedJWT jwt) throws SignatureVerificationException { byte[] contentBytes = String.format("%s.%s", jwt.getHeader(), jwt.getPayload()).getBytes(Charset.forName(Charsets.UTF_8)); byte[] signatureBytes = Base64.decodeBase64(jwt.getSignature()); try { ECPublicKey publicKey = keyProvider.getPublicKeyById(jwt.getKeyId()); if (publicKey == null) { throw new IllegalStateException("The given Public Key is null."); } boolean valid = crypto.verifySignatureFor(getDescription(), publicKey, contentBytes, JOSEToDER(signatureBytes)); if (!valid) { throw new SignatureVerificationException(this); } } catch (NoSuchAlgorithmException e) { throw new SignatureVerificationException(this, e); } catch (SignatureException e) { throw new SignatureVerificationException(this, e); } catch (InvalidKeyException e) { throw new SignatureVerificationException(this, e); } catch (IllegalStateException e) { throw new SignatureVerificationException(this, e); } }
Source:
protected CompilationUnit assertNoCompilationError(ICompilationUnit cu) { ASTParser parser= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); parser.setSource(cu); parser.setResolveBindings(true); CompilationUnit root= (CompilationUnit) parser.createAST(null); IProblem[] problems= root.getProblems(); boolean hasProblems= false; for (IProblem prob : problems) { if (prob.isWarning() || prob.isInfo()) { continue; } switch (prob.getID()) { case IProblem.MethodNameClash: continue; case IProblem.MethodMustOverride: continue; default: hasProblems= true; break; } } if (hasProblems) { StringBuilder buf= new StringBuilder(); buf.append(cu.getElementName() + " has compilation problems: \n"); for (IProblem problem : problems) { buf.append(problem.getMessage()).append('\n'); } assertTrue(buf.toString(), false); } return root; }

Target:
protected CompilationUnit assertNoCompilationError(ICompilationUnit cu) { ASTParser parser= ASTParser.newParser(IASTSharedValues.SHARED_AST_LEVEL); parser.setSource(cu); parser.setResolveBindings(true); CompilationUnit root= (CompilationUnit) parser.createAST(null); IProblem[] problems= root.getProblems(); boolean hasProblems= false; for (IProblem prob : problems) { if (prob.isWarning() || prob.isInfo()) { continue; } switch (prob.getID()) { case IProblem.MethodNameClash: continue; case IProblem.MethodMustOverride: continue; default: hasProblems= true; break; } } if (hasProblems) { StringBuilder buf= new StringBuilder(); buf.append(cu.getElementName() + " has compilation problems: \n"); for (IProblem prob : problems) { buf.append(prob.getMessage()).append('\n'); } assertTrue(buf.toString(), false); } return root; }
Source:
@Override public BinaryObjectImpl deserialize(JsonParser parser, DeserializationContext dCtx) throws IOException { String type = (String)dCtx.findInjectableValue(BINARY_TYPE_PROPERTY, null, null); String cacheName = (String)dCtx.findInjectableValue(CACHE_NAME_PROPERTY, null, null); assert type != null; assert !ctx.marshallerContext().isSystemType(type); ObjectCodec mapper = parser.getCodec(); JsonNode jsonTree = mapper.readTree(parser); return (BinaryObjectImpl)deserialize0(cacheName, type, jsonTree, mapper); }

Target:
@Override public BinaryObject deserialize(JsonParser parser, DeserializationContext dCtx) throws IOException { String type = (String)dCtx.findInjectableValue(BINARY_TYPE_PROPERTY, null, null); String cacheName = (String)dCtx.findInjectableValue(CACHE_NAME_PROPERTY, null, null); assert type != null; JsonNode tree = parser.readValueAsTree(); ObjectCodec mapper = parser.getCodec(); Map<String, BinaryFieldMetadata> binFields = binaryFields(type); Map<String, Class<?>> qryFields = queryFields(cacheName, type); BinaryObjectBuilder builder = ctx.cacheObjects().builder(type); Iterator<Map.Entry<String, JsonNode>> itr = tree.fields(); while (itr.hasNext()) { Map.Entry<String, JsonNode> entry = itr.next(); String field = entry.getKey(); JsonNode node = entry.getValue(); BinaryFieldMetadata meta = binFields.get(field); Class<?> fieldCls = meta != null ? BinaryUtils.FLAG_TO_CLASS.get((byte)meta.typeId()) : null; if (fieldCls == null) fieldCls = qryFields.getOrDefault(QueryUtils.normalizeObjectName(field, true), Object.class); builder.setField(field, mapper.treeToValue(node, fieldCls)); } return builder.build(); }
Source:
public boolean canEnable() throws JavaModelException { if (fPackageFragments.length == 0) return false; for (IPackageFragment fPackageFragment : fPackageFragments) { if (JavaElementUtil.isDefaultPackage(fPackageFragment) || fPackageFragment.isReadOnly()) { return false; } } if (ReorgUtils.containsLinkedResources(fPackageFragments)) return false; return true; }

Target:
public boolean canEnable() throws JavaModelException { if (fPackageFragments.length == 0) return false; for (IPackageFragment pack : fPackageFragments) { if (JavaElementUtil.isDefaultPackage(pack) || pack.isReadOnly()) { return false; } } if (ReorgUtils.containsLinkedResources(fPackageFragments)) return false; return true; }
Source:
public Matrix(String matrixAsString) { String[] rows = matrixAsString.split("\\n"); matrix = new int[rows.length][]; for (int i = 0; i < rows.length; i++) { String[] columnValues = rows[i].split(" "); matrix[i] = new int[columnValues.length]; for (int j = 0; j < columnValues.length; j++) { matrix[i][j] = Integer.valueOf(columnValues[j]); } } }

Target:
public Matrix(String matrixAsString) { String[] rows = newlinePattern.split(matrixAsString); matrix = new int[rows.length][]; for (int i = 0; i < rows.length; i++) { String[] columnValues = spacePattern.split(rows[i]); matrix[i] = new int[columnValues.length]; for (int j = 0; j < columnValues.length; j++) { matrix[i][j] = Integer.parseInt(columnValues[j]); } } }
Source:
public ASTNode() { location = null; metadataSet = new HashSet<>(); }

Target:
public ASTNode() { this((FileLocation)null); }
Source:
public List<Class<?>> getParameters() { throw new UnsupportedOperationException( "Use getDefinedParameters instead."); }

Target:
public List<Class<?>> getParameters() { final List<String> parametersRegex = parameters.values().stream() .map(RouteParameterData::getRegex).map(Optional::get) .collect(Collectors.toList()); return HasUrlParameterFormat.getParameterTypes(parametersRegex); }
Source:
static <T> Iterator<? extends T> reverseIterator(Iterable<? extends T> iterable) { if (iterable instanceof java.util.List) { java.util.List<T> list = (java.util.List<T>) iterable; return new Iterator<T>() { java.util.ListIterator<T> delegate = list.listIterator(list.size()); @Override public boolean hasNext() { return delegate.hasPrevious(); } @Override public T next() { return delegate.previous(); } }; } else { return seq(iterable).reverseIterator(); } }

Target:
static <T> Iterator<? extends T> reverseIterator(Iterable<? extends T> iterable) { if (iterable instanceof java.util.List) { final java.util.List<T> list = (java.util.List<T>) iterable; return new Iterator<T>() { java.util.ListIterator<T> delegate = list.listIterator(list.size()); @Override public boolean hasNext() { return delegate.hasPrevious(); } @Override public T next() { return delegate.previous(); } }; } else { final Seq<? extends T> result = (iterable instanceof Seq) ? (Seq<T>) iterable : Vector.ofAll(iterable); return result.reverseIterator(); } }
Source:
public void onClosed(Channel channel, IOException cause) { event.fireChannelClosed(cause); try { event.getSocket().close(); } catch (IOException e) { } }

Target:
public void onClosed(Channel channel, IOException cause) { if (channel != event.getChannel()) { return; } event.fireChannelClosed(cause); channel.removeListener(this); try { event.getSocket().close(); } catch (IOException e) { } }
Source:
public TestSuiteProgress() { useColor = System.getenv("JENKINS_HOME") == null; out = new PrintStream(new FileOutputStream(FileDescriptor.out)); }

Target:
public TestSuiteProgress() { useColor = !Boolean.getBoolean("jansi.strip"); prefix = System.out.getClass().equals(PrintStream.class) ? "" : "H ,"; out = new PrintStream(new FileOutputStream(FileDescriptor.out)); }
Source:
public ServiceResponse(HttpResponse response) throws IOException { BufferedReader reader = new BufferedReader(new InputStreamReader(response.getEntity().getContent())); String line; StringBuilder string_response = new StringBuilder(); while ((line = reader.readLine()) != null) { string_response.append(line); } this.message = string_response.toString(); this.code = response.getStatusLine().getStatusCode(); this.response = response; logger.info( "The web service response status is " + code); logger.info("The web service response is:\n" + Util.prettyPrintXmlOrJson(message)); }

Target:
public ServiceResponse(HttpResponse response) throws IOException { BufferedReader reader = new BufferedReader(new InputStreamReader(response.getEntity().getContent())); String line; StringBuilder string_response = new StringBuilder(); while ((line = reader.readLine()) != null) { string_response.append(line); } this.message = string_response.toString(); this.code = response.getStatusLine().getStatusCode(); this.response = response; logger.info("The web service response is:\n" + Util.prettyPrintXmlOrJson(message)); }
Source:
public PieChartViewerStateNoContentSelected(final TmfPieChartViewer context) { if (context.isDisposed()) { return; } Display.getDefault().asyncExec(new Runnable() { @Override public void run() { synchronized (context.getMutexLayoutChange()) { if (!context.isDisposed()) { if (context.getTimeRangePC() != null) { if (!context.getTimeRangePC().isDisposed()) { context.getTimeRangePC().dispose(); } context.setTimeRangePC(null); } context.updateGlobalPieChart(); context.getGlobalPC().getLegend().setPosition(SWT.RIGHT); context.layout(); } } } }); }

Target:
public PieChartViewerStateNoContentSelected(final TmfPieChartViewer context) { if (context.isDisposed()) { return; } Display.getDefault().asyncExec(new Runnable() { @Override public void run() { synchronized (context) { if (!context.isDisposed()) { if (context.getTimeRangePC() != null) { if (!context.getTimeRangePC().isDisposed()) { context.getTimeRangePC().dispose(); } context.setTimeRangePC(null); } context.updateGlobalPieChart(); context.getGlobalPC().getLegend().setPosition(SWT.RIGHT); context.layout(); } } } }); }
Source:
public void enableAccelerometer(byte[] config) { BluetoothLeGattCharacteristic enableChar; if (this.cc2650) { try { enableChar = this.gattServices.get(MOVEMENT).findCharacteristic(TiSensorTagGatt.UUID_MOV_SENSOR_ENABLE); writeOnCharacteristic(config, enableChar); } catch (KuraException e) { logger.error(MOV_ERROR_MESSAGE, e); } } else { try { enableChar = this.gattServices.get(ACCELEROMETER) .findCharacteristic(TiSensorTagGatt.UUID_ACC_SENSOR_ENABLE); enableChar.writeValue(config); } catch (KuraException e) { logger.error("Accelerometer enable failed", e); } } }

Target:
public boolean enableAccelerometer(byte[] config) { boolean result = false; BluetoothLeGattCharacteristic enableChar; if (this.cc2650) { try { enableChar = this.gattServices.get(MOVEMENT).findCharacteristic(TiSensorTagGatt.UUID_MOV_SENSOR_ENABLE); writeOnCharacteristic(config, enableChar); result = true; } catch (KuraException e) { logger.error(MOV_ERROR_MESSAGE, e); } } else { try { enableChar = this.gattServices.get(ACCELEROMETER) .findCharacteristic(TiSensorTagGatt.UUID_ACC_SENSOR_ENABLE); enableChar.writeValue(config); result = true; } catch (KuraException e) { logger.error("Accelerometer enable failed", e); } } return result; }
Source:
public void start() throws Exception { this.executorService = Executors.newFixedThreadPool(1); }

Target:
public void start() throws Exception { this.executorService = Executors.newSingleThreadExecutor( new ExecutorThreadFactory( "collect-sink-operator-coordinator-executor-thread-pool")); }
Source:
private void initGlobalDefaultValues() { if (system.getEnvironmentVariable(BITBUCKET_CLOUD_ENV_VAR) != null) { setGlobalDefaultValue(ScannerProperties.HOST_URL, SONARCLOUD_HOST); } else { setGlobalDefaultValue(ScannerProperties.HOST_URL, "http://localhost:9000"); } }

Target:
private void initGlobalDefaultValues() { if (system.getEnvironmentVariable(BITBUCKET_CLOUD_ENV_VAR) != null) { setGlobalDefaultValue(ScannerProperties.HOST_URL, SONARCLOUD_HOST); logger.info("Bitbucket Cloud Pipelines detected"); } else { setGlobalDefaultValue(ScannerProperties.HOST_URL, "http://localhost:9000"); } }