auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public Principal authenticate(HttpServletRequest request) throws AuthenticationException { String header = nullToEmpty(request.getHeader(AUTHORIZATION)); int space = header.indexOf(' '); if ((space < 0) || !header.substring(0, space).equalsIgnoreCase("bearer")) { throw needAuthentication(null); } String token = header.substring(space + 1).trim(); try { Jws<Claims> claimsJws = jwtParser.parseClaimsJws(token); String subject = claimsJws.getBody().getSubject(); return new BasicPrincipal(subject); } catch (RuntimeException e) { throw new RuntimeException("Authentication error", e); } }

Target:
public Principal authenticate(HttpServletRequest request) throws AuthenticationException { String header = nullToEmpty(request.getHeader(AUTHORIZATION)); int space = header.indexOf(' '); if ((space < 0) || !header.substring(0, space).equalsIgnoreCase("bearer")) { throw needAuthentication(null); } String token = header.substring(space + 1).trim(); if (token.isEmpty()) { throw needAuthentication(null); } try { Jws<Claims> claimsJws = jwtParser.parseClaimsJws(token); String subject = claimsJws.getBody().getSubject(); return new BasicPrincipal(subject); } catch (JwtException e) { throw needAuthentication(e.getMessage()); } catch (RuntimeException e) { throw new RuntimeException("Authentication error", e); } }
Source:
private synchronized RedisConnection getRedisConnection() throws Exception { try { RedisConnection connection = redisClient.connect(new ByteArrayCodec()); logger.info("Redis Connection is Opened"); return connection; } catch (Exception e) { logger.error("Exception Occurred while connecting to the server", e); throw e; } }

Target:
private synchronized RedisConnection getRedisConnection() { RedisConnection connection = redisClient.connect(new ByteArrayCodec()); logger.info("Redis Connection is Opened"); return connection; }
Source:
private static boolean isReloadable(String optionName) throws SecurityException, NoSuchFieldException { return ConfigValues.class.getField(optionName).isAnnotationPresent(Reloadable.class); }

Target:
private static boolean isReloadable(String optionName) throws NoSuchFieldException { return ConfigValues.class.getField(optionName).isAnnotationPresent(Reloadable.class); }
Source:
public String[] getCriteriaNames() { criteriaList.put("a", a); criteriaList.put("b", b); criteriaList.put("c", c); criteriaList.put("d", d); criteriaList.put("e", e); criteriaList.put("f", f); criteriaList.put("g", g); criteriaList.put("h", h); String[] criteria = new String[100]; int i = 0; String[] letter = {"A", "B"}; HashMap<String, Integer> sub = new HashMap<String, Integer>(); sub.put("b5", 2); for(Map.Entry<String, int[]> entry: criteriaList.entrySet()){ for(int j : entry.getValue()){ if(sub.containsKey(entry.getKey() + String.valueOf(j))){ for(int k = 0; k < sub.get(entry.getKey() + String.valueOf(j)); k++){ criteria[i] = "170.314 (" + entry.getKey() + ")(" + j + ")(" + letter[k] + ")"; i++; } }else{ criteria[i] = "170.314 (" + entry.getKey() + ")(" + j + ")"; i++; } } } return criteria; }

Target:
public String[] getCriteriaNames() { return this.criteriaNames; }
Source:
public void updateMappingsConcurrently() throws InterruptedException { final VControl control = VViewFactory.eINSTANCE.createControl(); final EObject domainObject = EcoreUtil.create(EcorePackage.eINSTANCE.getEClass()); final SettingToControlMapperImpl settingToControlMapper = new SettingToControlMapperImpl( new EMFFormsMappingProviderManager() { @Override public Set<UniqueSetting> getAllSettingsFor(VDomainModelReference domainModelReference, EObject domainObject) { final Set<UniqueSetting> settings = new LinkedHashSet<UniqueSetting>(); settings.add( UniqueSetting.createSetting(domainObject, EcorePackage.eINSTANCE.getEClass_EAttributes())); return settings; } }, new FakeViewContext(domainObject, control)); final List<Throwable> exceptions = Collections.synchronizedList(new ArrayList<Throwable>()); final ArrayList<Runnable> runnables = new ArrayList<Runnable>(); for (int i = 0; i < NR_RUNNABLES; i++) { runnables.add(new Runnable() { @Override public void run() { try { int j = 0; while (j < NR_UPDATES) { settingToControlMapper.updateControlMapping(control); Thread.sleep(1); j += 1; } } catch (final Exception exception) { exceptions.add(exception); END SUPRESS CATCH EXCEPTION } } }); } final ExecutorService newFixedThreadPool = Executors.newFixedThreadPool(runnables.size()); for (final Runnable runnable : runnables) { newFixedThreadPool.submit(runnable); } assertTrue(exceptions.isEmpty()); }

Target:
public void updateMappingsConcurrently() throws InterruptedException { final CountDownLatch latch = new CountDownLatch(NR_RUNNABLES); final VControl control = VViewFactory.eINSTANCE.createControl(); final EObject domainObject = EcoreUtil.create(EcorePackage.eINSTANCE.getEClass()); final SettingToControlMapperImpl settingToControlMapper = new SettingToControlMapperImpl( new EMFFormsMappingProviderManager() { @Override public Set<UniqueSetting> getAllSettingsFor(VDomainModelReference domainModelReference, EObject domainObject) { final Set<UniqueSetting> settings = new LinkedHashSet<UniqueSetting>(); settings.add( UniqueSetting.createSetting(domainObject, EcorePackage.eINSTANCE.getEClass_EAttributes())); return settings; } }, new FakeViewContext(domainObject, control)); final List<Throwable> exceptions = Collections.synchronizedList(new ArrayList<Throwable>()); final ArrayList<Runnable> runnables = new ArrayList<Runnable>(); for (int i = 0; i < NR_RUNNABLES; i++) { runnables.add(new Runnable() { @Override public void run() { try { int j = 0; while (j < NR_UPDATES) { settingToControlMapper.updateControlMapping(control); Thread.sleep(1); j += 1; } latch.countDown(); } catch (final Exception exception) { exceptions.add(exception); END SUPRESS CATCH EXCEPTION } } }); } final ExecutorService newFixedThreadPool = Executors.newFixedThreadPool(runnables.size()); for (final Runnable runnable : runnables) { newFixedThreadPool.submit(runnable); } latch.await(); assertTrue(exceptions.isEmpty()); }
Source:
protected void setupEventRouting(EventRouting<UserId> routing) { super.setupEventRouting(routing); routing.route(RUserSignedIn.class, (e, ctx) -> ImmutableSet.of(e.getUserId())); routing.route(RUserConsentRequested.class, (e, ctx) -> ImmutableSet.of(e.getUserId())); }

Target:
protected void setupEventRouting(EventRouting<UserId> routing) { super.setupEventRouting(routing); routing.route(RUserSignedIn.class, (e, ctx) -> withId(e.getUserId())); routing.route(RUserConsentRequested.class, (e, ctx) -> withId(e.getUserId())); }
Source:
public static void cleanUp() { fLogger.removeAllAppenders(); fFileLocation.delete(); }

Target:
public static void cleanUp() { fLogger.removeAllAppenders(); fFileLocation.delete(); tearDown(); }
Source:
public Void visitAggregation(AggregationNode node, ImmutableList.Builder<RowExpression> context) { node.getAggregations().values() .forEach(aggregation -> { aggregation.getArguments().stream() .map(OriginalExpressionUtils::castToRowExpression) .forEach(context::add); aggregation.getFilter().map(OriginalExpressionUtils::castToRowExpression).ifPresent(context::add); aggregation.getOrderBy().map(OrderingScheme::getOrderBy).orElse(ImmutableList.of()) .stream().map(Symbol::toSymbolReference).map(OriginalExpressionUtils::castToRowExpression).forEach(context::add); }); return super.visitAggregation(node, context); }

Target:
public Void visitAggregation(AggregationNode node, ImmutableList.Builder<RowExpression> context) { node.getAggregations().values() .forEach(aggregation -> { aggregation.getArguments().forEach(context::add); aggregation.getFilter().ifPresent(context::add); aggregation.getOrderBy() .map(OrderingScheme::getOrderBy) .orElse(ImmutableList.of()) .forEach(context::add); }); return super.visitAggregation(node, context); }
Source:
public void setup() { Signature signature = new Signature("$operator$CAST", FunctionKind.SCALAR, RowType.anonymous(fromFieldTypes).getTypeSignature(), RowType.anonymous(toFieldTypes).getTypeSignature()); List<RowExpression> projections = ImmutableList.of( new CallExpression(signature, RowType.anonymous(fromFieldTypes), ImmutableList.of(field(0, RowType.anonymous(toFieldTypes))))); MetadataManager metadata = MetadataManager.createTestMetadataManager(); pageProcessor = new ExpressionCompiler(metadata, new PageFunctionCompiler(metadata, 0)) .compilePageProcessor(Optional.empty(), projections) .get(); Block[] fieldBlocks = fromFieldTypes.stream() .map(type -> createBlock(POSITION_COUNT, type)) .toArray(Block[]::new); Block rowBlock = RowBlock.fromFieldBlocks(new boolean[POSITION_COUNT], fieldBlocks); page = new Page(rowBlock); }

Target:
public void setup() { Signature signature = new Signature("$operator$CAST", SCALAR, RowType.anonymous(fromFieldTypes).getTypeSignature(), RowType.anonymous(toFieldTypes).getTypeSignature()); List<RowExpression> projections = ImmutableList.of( new CallExpression(signature, RowType.anonymous(fromFieldTypes), ImmutableList.of(field(0, RowType.anonymous(toFieldTypes))))); MetadataManager metadata = MetadataManager.createTestMetadataManager(); pageProcessor = new ExpressionCompiler(metadata, new PageFunctionCompiler(metadata, 0)) .compilePageProcessor(Optional.empty(), projections) .get(); Block[] fieldBlocks = fromFieldTypes.stream() .map(type -> createBlock(POSITION_COUNT, type)) .toArray(Block[]::new); Block rowBlock = fromFieldBlocks(new boolean[POSITION_COUNT], fieldBlocks); page = new Page(rowBlock); }
Source:
public SelectorResolutionResult(Status status, Throwable throwable) { this.status = status; this.throwable = throwable; }

Target:
private SelectorResolutionResult(Status status, Throwable throwable) { this.status = status; this.throwable = throwable; }
Source:
public long getDiskCount() { long count = 0; for (Datacenter datacenter : datacenters) { for (DataNode dataNode : datacenter.getDataNodes()) { count += dataNode.getDisks().size(); } } return count; }

Target:
public long getDiskCount() { return diskCount; }
Source:
public Single<String> getTextForBadge(EvaluationContext ec) { final EvaluationContext[] abandonableContext = new EvaluationContext[] {ec.spawnWithCleanLifecycle()}; if (display.getBadgeText() == null) { return Single.just(""); } return Single.fromCallable(new Callable<String>() { @Override public String call() throws Exception { return display.getBadgeText().evaluate(abandonableContext[0]); } }).doOnDispose(new Action() { @Override public void run() throws Exception { abandonableContext[0].signalAbandoned(); abandonableContext[0] = null; } }); }

Target:
public Single<String> getTextForBadge(EvaluationContext ec) { if (display.getBadgeText() == null) { return Single.just(""); } return display.getBadgeText().getDisposableSingleForEvaluation(ec); }
Source:
public void testCluster() { Config config = new Config(); NetworkConfig networkConfig = config.getNetworkConfig(); networkConfig.getInterfaces().addInterface("127.0.0.1"); networkConfig.getJoin().getMulticastConfig().setEnabled(false); networkConfig.getJoin().getTcpIpConfig().setEnabled(true).addMember("127.0.0.1"); try { HazelcastInstance hz1 = Hazelcast.newHazelcastInstance(config); HazelcastInstance hz2 = Hazelcast.newHazelcastInstance(config); hz1.getMap("test").put("a", "b"); assertClusterSize(2, hz1, hz2); HazelcastInstance client = HazelcastClient.newHazelcastClient(); assertEquals("b", client.getMap("test").get("a")); } finally { HazelcastInstanceFactory.terminateAll(); HazelcastClient.shutdownAll(); } }

Target:
public void testCluster() { Config config = new Config(); NetworkConfig networkConfig = config.getNetworkConfig(); networkConfig.getInterfaces().addInterface("127.0.0.1"); networkConfig.getJoin().getMulticastConfig().setEnabled(false); networkConfig.getJoin().getTcpIpConfig().setEnabled(true).addMember("127.0.0.1"); HazelcastInstance hz1 = Hazelcast.newHazelcastInstance(config); HazelcastInstance hz2 = Hazelcast.newHazelcastInstance(config); hz1.getMap("test").put("a", "b"); assertClusterSize(2, hz1, hz2); HazelcastInstance client = HazelcastClient.newHazelcastClient(); assertEquals("b", client.getMap("test").get("a")); }
Source:
public SimpleCertificateResponseMessageType undoImportKeystore(ImportCertificateChainRequestMessageType request) { if (StringUtils.isBlank(request.getAlias()) || null == request.getRootCert() || CollectionUtils.isEmpty(request.getIntermediateList())) { return buildSimpleResponse(false, "Undo import in KeyStore required Alias, CA Root and CA Intermediate."); } try{ Map<String, Certificate> removeCerts = convertCertificateMap(request.getAlias(), request); removeCertificatesFrom(getTempKeystore(), removeCerts.values()); saveTempKeystore(); } catch (UtilException | KeyStoreException | CertificateManagerException ex) { LOG.error("Error occured on undo import in temporary KeyStore: {}", ex.getLocalizedMessage(), ex); return buildSimpleResponse(false, "Error occured on undo import in temporary KeyStore."); } return buildSimpleResponse(true, "Undo import in temporary Keystore successful."); }

Target:
public SimpleCertificateResponseMessageType undoImportKeystore(ImportCertificateChainRequestMessageType request) { if (null == request.getRootCert() || CollectionUtils.isEmpty(request.getIntermediateList())) { return buildSimpleResponse(false, "Undoing an import requires the CA Root, and Intermediate certificates."); } try{ Map<String, Certificate> removeCerts = convertCertificateMap("noalias", request); removeCertificatesFrom(getTempKeystore(), removeCerts.values()); saveTempKeystore(); } catch (UtilException | KeyStoreException | CertificateManagerException ex) { LOG.error("Error occured on undo import in temporary KeyStore: {}", ex.getLocalizedMessage(), ex); return buildSimpleResponse(false, "Error occured on undo import in temporary KeyStore."); } return buildSimpleResponse(true, "Undo import in temporary Keystore successful."); }
Source:
public ImmutableCollection<EntityRecord> readAllByType(final TypeUrl type, FieldMask fieldMask) { final Map<AggregateStateId, EntityRecord> allRecords = readAll(fieldMask); final Map<AggregateStateId, EntityRecord> resultMap = Maps.filterKeys( allRecords, new Predicate<AggregateStateId>() { @Override public boolean apply(@Nullable AggregateStateId stateId) { checkNotNull(stateId); final boolean typeMatches = stateId.getStateType() .equals(type); return typeMatches; } }); final ImmutableList<EntityRecord> result = ImmutableList.copyOf(resultMap.values()); return result; }

Target:
public ImmutableCollection<EntityRecord> readAllByType(final TypeUrl type, FieldMask fieldMask) { final Map<AggregateStateId, EntityRecord> allRecords = readAll(fieldMask); final Map<AggregateStateId, EntityRecord> resultMap = filterByType(allRecords, type); final ImmutableList<EntityRecord> result = ImmutableList.copyOf(resultMap.values()); return result; }
Source:
public void onEquipped(ItemStack itemstack, EntityLivingBase player) { if (!player.worldObj.isRemote) { player.worldObj.playAuxSFXAtEntity((EntityPlayer) player, 1, new BlockPos(player.posX, player.posY, player.posZ), 1); } }

Target:
public void onEquipped(ItemStack itemstack, EntityLivingBase player) { if (!player.worldObj.isRemote) { player.playSound(SoundEvents.item_armor_equip_diamond, 0.1F, 1.3f); } }
Source:
public void init(MessageLocation messageLocation) { }

Target:
public void init(MessageLocation messageLocation) { getJsonTextArea().setText(messageLocation.getValue()); }
Source:
public boolean canEditPipeline(String pipelineName, Username username) { if (getCurrentConfig().hasPipelineNamed(new CaseInsensitiveString(pipelineName)) && isUserAdminOfGroup(username.getUsername(), findGroupNameByPipeline(new CaseInsensitiveString(pipelineName)))) { return true; } return false; }

Target:
public boolean canEditPipeline(String pipelineName, Username username) { if (pipelineExists(pipelineName) && isUserAdminOfGroup(username.getUsername(), findGroupNameByPipeline(new CaseInsensitiveString(pipelineName)))) { return true; } return false; }
Source:
public List<SourceRecord> poll() { if (!stopped) { if (throttler.shouldThrottle(seqno - startingSeqno, System.currentTimeMillis())) { throttler.throttle(); } taskHandle.record(batchSize); return LongStream.range(0, batchSize) .mapToObj(i -> new SourceRecord( Collections.singletonMap("task.id", taskId), Collections.singletonMap("saved", ++seqno), topicName, null, Schema.STRING_SCHEMA, "key-" + taskId + "-" + seqno, Schema.STRING_SCHEMA, "value-" + taskId + "-" + seqno)) .collect(Collectors.toList()); } else { log.info("Task stopped but still going: {}", stopped); } return null; }

Target:
public List<SourceRecord> poll() { if (!stopped) { if (throttler.shouldThrottle(seqno - startingSeqno, System.currentTimeMillis())) { throttler.throttle(); } taskHandle.record(batchSize); return LongStream.range(0, batchSize) .mapToObj(i -> new SourceRecord( Collections.singletonMap("task.id", taskId), Collections.singletonMap("saved", ++seqno), topicName, null, Schema.STRING_SCHEMA, "key-" + taskId + "-" + seqno, Schema.STRING_SCHEMA, "value-" + taskId + "-" + seqno)) .collect(Collectors.toList()); } return null; }
Source:
private boolean validateCanUpdateShareable() { if (DiskStorageType.LUN == getOldDisk().getDiskStorageType()) { return true; } if (!isVmNotInPreviewSnapshot()) { return false; } if (isUpdatedToShareable(getOldDisk(), getNewDisk())) { StorageDomain storageDomain = getStorageDomainDAO().get(((DiskImage)getNewDisk()).getStorageIds().get(0)); if (storageDomain.getStorageType() == StorageType.GLUSTERFS) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_SHAREABLE_DISKS_NOT_SUPPORTED_ON_GLUSTER_DOMAIN); } List<DiskImage> diskImageList = getDiskImageDao().getAllSnapshotsForImageGroup(getOldDisk().getId()); if ((diskImageList.size() > 1) || !Guid.Empty.equals(((DiskImage) getOldDisk()).getImageTemplateId())) { return failCanDoAction(VdcBllMessages.SHAREABLE_DISK_IS_NOT_SUPPORTED_FOR_DISK); } if (!isVersionSupportedForShareable(getOldDisk(), getStoragePoolDAO().get(getVm().getStoragePoolId()) .getcompatibility_version() .getValue())) { return failCanDoAction(VdcBllMessages.ACTION_NOT_SUPPORTED_FOR_CLUSTER_POOL_LEVEL); } if (!isVolumeFormatSupportedForShareable(((DiskImage) getNewDisk()).getVolumeFormat())) { return failCanDoAction(VdcBllMessages.SHAREABLE_DISK_IS_NOT_SUPPORTED_BY_VOLUME_FORMAT); } } else if (isUpdatedToNonShareable(getOldDisk(), getNewDisk())) { if (vmsDiskOrSnapshotAttachedTo.size() > 1) { return failCanDoAction(VdcBllMessages.DISK_IS_ALREADY_SHARED_BETWEEN_VMS); } } return true; }

Target:
private boolean validateCanUpdateShareable() { if (DiskStorageType.LUN == getOldDisk().getDiskStorageType()) { return true; } if (!isVmNotInPreviewSnapshot()) { return false; } if (isUpdatedToShareable(getOldDisk(), getNewDisk())) { StorageDomainStatic sds = getStorageDomainStaticDAO().get(((DiskImage)getNewDisk()).getStorageIds().get(0)); if (sds.getStorageType() == StorageType.GLUSTERFS) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_SHAREABLE_DISKS_NOT_SUPPORTED_ON_GLUSTER_DOMAIN); } List<DiskImage> diskImageList = getDiskImageDao().getAllSnapshotsForImageGroup(getOldDisk().getId()); if ((diskImageList.size() > 1) || !Guid.Empty.equals(((DiskImage) getOldDisk()).getImageTemplateId())) { return failCanDoAction(VdcBllMessages.SHAREABLE_DISK_IS_NOT_SUPPORTED_FOR_DISK); } if (!isVersionSupportedForShareable(getOldDisk(), getStoragePoolDAO().get(getVm().getStoragePoolId()) .getcompatibility_version() .getValue())) { return failCanDoAction(VdcBllMessages.ACTION_NOT_SUPPORTED_FOR_CLUSTER_POOL_LEVEL); } if (!isVolumeFormatSupportedForShareable(((DiskImage) getNewDisk()).getVolumeFormat())) { return failCanDoAction(VdcBllMessages.SHAREABLE_DISK_IS_NOT_SUPPORTED_BY_VOLUME_FORMAT); } } else if (isUpdatedToNonShareable(getOldDisk(), getNewDisk())) { if (vmsDiskOrSnapshotAttachedTo.size() > 1) { return failCanDoAction(VdcBllMessages.DISK_IS_ALREADY_SHARED_BETWEEN_VMS); } } return true; }
Source:
private Map<String, String> buildSamHeaderParameters(final List<String> barcodes) { final Map<String, String> params = new LinkedHashMap<>(); String platformUnit = RUN_BARCODE + "." + LANE; if (barcodes != null) { final String barcodeString = IlluminaUtil.barcodeSeqsToString(barcodes); platformUnit += ("." + barcodeString); if (INCLUDE_BC_IN_RG_TAG) params.put("BC", barcodeString); } if (PLATFORM != null) { params.put(SAMReadGroupRecord.PLATFORM_TAG, PLATFORM); } params.put(SAMReadGroupRecord.PLATFORM_UNIT_TAG, platformUnit); if (SEQUENCING_CENTER != null) params.put(SAMReadGroupRecord.SEQUENCING_CENTER_TAG, SEQUENCING_CENTER); params.put(SAMReadGroupRecord.DATE_RUN_PRODUCED_TAG, RUN_START_DATE == null ? null : new Iso8601Date(RUN_START_DATE).toString()); return params; }

Target:
private Map<String, String> buildSamHeaderParameters(final List<String> barcodes) { final Map<String, String> params = new LinkedHashMap<>(); String platformUnit = RUN_BARCODE + "." + LANE; if (barcodes != null) { final String barcodeString = IlluminaUtil.barcodeSeqsToString(barcodes); platformUnit += "." + barcodeString; if (INCLUDE_BC_IN_RG_TAG) { params.put("BC", barcodeString); } } if (PLATFORM != null) { params.put(SAMReadGroupRecord.PLATFORM_TAG, PLATFORM); } params.put(SAMReadGroupRecord.PLATFORM_UNIT_TAG, platformUnit); if (SEQUENCING_CENTER != null) { params.put(SAMReadGroupRecord.SEQUENCING_CENTER_TAG, SEQUENCING_CENTER); } params.put(SAMReadGroupRecord.DATE_RUN_PRODUCED_TAG, RUN_START_DATE == null ? null : new Iso8601Date(RUN_START_DATE).toString()); return params; }
Source:
public void setToolchain( Toolchain toolchain ) throws Exception { Field toolchainField = AbstractSurefireMojo.class.getDeclaredField( "toolchain" ); toolchainField.setAccessible( true ); toolchainField.set( this, toolchain ); }

Target:
public void setToolchain( Toolchain toolchain ) throws Exception { setInternalState( this, "toolchain", toolchain ); }
Source:
public final MessageSerializer getDefaultSerializer() { if (null == this.defaultSerializer) { this.defaultSerializer = getSerializer(false, false); } return defaultSerializer; }

Target:
public final MessageSerializer getDefaultSerializer() { if (null == this.defaultSerializer) { synchronized(this) { if (null == this.defaultSerializer) { this.defaultSerializer = getSerializer(false, false); } } } return defaultSerializer; }
Source:
public void testGet() throws Exception { final IgniteCache<Integer, Integer> cache = grid(2).getOrCreateCache(getConfig()); for (TransactionConcurrency concurrency : TransactionConcurrency.values()) for (TransactionIsolation isolation : TransactionIsolation.values()) { try (Transaction tx = grid(2).transactions().txStart(concurrency, isolation)) { info(concurrency + " " + isolation); tx.savepoint("sp"); assertEquals("Broken savepoint in " + concurrency + " " + isolation + " transaction.", null, cache.get(1)); tx.rollbackToSavepoint("sp"); IgniteInternalFuture<Boolean> fut = GridTestUtils.runAsync(new Callable<Boolean>() { @Override public Boolean call() throws Exception { return cache.putIfAbsentAsync(1, 1).get(); } },cacheMode().name()+"_get"); assertTrue(fut.get(3_000)); assertEquals("Broken multithreaded rollback to savepoint in " + concurrency + " " + isolation + " transaction.", (Integer) 1, cache.get(1)); tx.commit(); } finally { cache.remove(1); } } }

Target:
public void testGet() throws Exception { executeTestForAllCaches( new CIX3<NodeCombination, IgniteCache<Integer, Integer>, CacheConfiguration<Integer, Integer>>() { @Override public void applyx( NodeCombination nodes, IgniteCache<Integer, Integer> cache, CacheConfiguration<Integer, Integer> cfg) throws IgniteCheckedException { int key = generateKey(cfg, nodes.primaryForKey()); IgniteCache<Integer, Integer> cacheAsync = nodes.anotherTxOwner().getOrCreateCache(cfg); for (TxType txType : txTypes) { info("Transaction type [" + txType + ']'); try (Transaction tx = nodes.txOwner().transactions().txStart(txType.concurrency, txType.isolation)) { tx.savepoint("sp"); assertEquals("Broken savepoint in " + txType.concurrency + ' ' + txType.isolation + " transaction.", null, cache.get(key)); tx.rollbackToSavepoint("sp"); IgniteInternalFuture<Boolean> fut = GridTestUtils.runAsync(() -> cacheAsync.putIfAbsent(key, 1), cacheMode().name() + "_get"); assertTrue(fut.get(FUT_TIMEOUT)); assertEquals("Broken multithreaded rollback to savepoint in " + txType.concurrency + ' ' + txType.isolation + " transaction.", (Integer)1, cache.get(key)); tx.commit(); } finally { cache.remove(key); } } }}); }
Source:
public void testListRemote_Smart_DetachedHEAD() throws Exception { Repository src = remoteRepository.getRepository(); RefUpdate u = src.updateRef(Constants.HEAD, true); RevCommit Q = remoteRepository.commit().message("Q").create(); u.setNewObjectId(Q); assertEquals(RefUpdate.Result.FORCED, u.forceUpdate()); Repository dst = createBareRepository(); Ref head; try (Transport t = Transport.open(dst, smartAuthNoneURI)) { try (FetchConnection c = t.openFetch()) { head = c.getRef(Constants.HEAD); } } assertNotNull("has " + Constants.HEAD, head); assertEquals(Q, head.getObjectId()); }

Target:
public void testListRemote_Smart_DetachedHEAD() throws Exception { Repository src = remoteRepository.getRepository(); RefUpdate u = src.updateRef(Constants.HEAD, true); RevCommit Q = remoteRepository.commit().message("Q").create(); u.setNewObjectId(Q); assertEquals(RefUpdate.Result.FORCED, u.forceUpdate()); Repository dst = createBareRepository(); Ref head; try (Transport t = Transport.open(dst, smartAuthNoneURI); FetchConnection c = t.openFetch()) { head = c.getRef(Constants.HEAD); } assertNotNull("has " + Constants.HEAD, head); assertEquals(Q, head.getObjectId()); }
Source:
private PageMode getMode() { final PageMode currentMode = PageMode.get(request); return currentMode.showLive ? currentMode : APILocator.getHTMLPageAssetRenderedAPI().getDefaultEditPageMode(user, request, uri, response); }

Target:
private PageMode getMode() { final PageMode currentMode = PageMode.get(request); return currentMode.showLive ? currentMode : APILocator.getHTMLPageAssetRenderedAPI().getDefaultEditPageMode(user, request, uri); }
Source:
private boolean outerScopeIsImmutable() { if (getFirstOuterMixin() == null) { return true; } return getFirstOuterMixin().allSlotsAreImmutable && getFirstOuterMixin().outerScopeIsImmutable(); }

Target:
private boolean outerScopeIsImmutable() { if (isModule()) { return true; } return outerMixin.allSlotsAreImmutable && outerMixin.outerScopeIsImmutable(); }
Source:
private void authCredentials(HttpServletRequest request, HttpServletResponse response) throws IOException { try { Credentials credentials = SSOUtils.getUserCredentialsFromHeader(request); if (credentials == null) { response.sendError(HttpServletResponse.SC_UNAUTHORIZED); } else { AuthenticationUtils.handleCredentials( request.getSession(true), credentials.getUsername(), credentials.getPassword(), credentials.getProfile()); String issueTicket = request.getParameter("ticket"); if (StringUtils.isEmpty(issueTicket) || "0".equals(issueTicket)) { response.getWriter().print(SSOUtils.getSsoToken(request.getSession(true).getId())); } else { try (OutputStream os = response.getOutputStream()) { os.write(SSOUtils.issueTicket(request.getServletContext(), request.getSession(true).getId(), request).getBytes("UTF-8")); } } } } catch (Exception e) { log.error("Unable to authenticate {}", e.getMessage()); response.sendError(HttpServletResponse.SC_UNAUTHORIZED); } }

Target:
private void authCredentials(HttpServletRequest request, HttpServletResponse response) throws IOException { try { Credentials credentials = SSOUtils.getUserCredentialsFromHeader(request); if (credentials == null) { response.sendError(HttpServletResponse.SC_UNAUTHORIZED); } else { AuthenticationUtils.handleCredentials( request.getSession(true), credentials.getUsername(), credentials.getPassword(), credentials.getProfile()); String returnPayload = request.getParameter("payload"); if (StringUtils.isEmpty(returnPayload) || "0".equals(returnPayload)) { response.getWriter().print(SSOUtils.getSsoToken(request.getSession(true).getId())); } else { try (OutputStream os = response.getOutputStream()) { Map<String, Object> payload = SSOUtils.getTokenPayload(request.getServletContext(), request.getSession(true).getId()); payload.put(STATUS, HttpServletResponse.SC_OK); os.write(SSOUtils.getJson(payload).getBytes("UTF-8")); } } } } catch (Exception e) { log.error("Unable to authenticate {}", e.getMessage()); Map<String, Object> errorData = new HashMap<>(); errorData.put(STATUS, HttpServletResponse.SC_UNAUTHORIZED); errorData.put(MESSAGE, e.getMessage()); response.getWriter().print(SSOUtils.getJson(errorData)); } }
Source:
public void setGlobalTargetTaskThreadPoolSize(int globalTargetTaskThreadPoolSize) { ClusterConfig clusterConfig = _accessor.getProperty(_accessor.keyBuilder().clusterConfig()); if (clusterConfig == null) { throw new IllegalStateException("Failed to find ClusterConfig!"); } clusterConfig.setGlobalTargetTaskThreadPoolSize(globalTargetTaskThreadPoolSize); }

Target:
public void setGlobalTargetTaskThreadPoolSize(int globalTargetTaskThreadPoolSize) { ClusterConfig clusterConfig = getClusterConfig(); clusterConfig.setGlobalTargetTaskThreadPoolSize(globalTargetTaskThreadPoolSize); }
Source:
protected AbstractAvroMessageConverter(MimeType supportedMimeType, AvroSchemaServiceManager avroSchemaServiceManager) { this(Collections.singletonList(supportedMimeType), avroSchemaServiceManager); this.avroSchemaServiceManager = avroSchemaServiceManager; }

Target:
protected AbstractAvroMessageConverter(MimeType supportedMimeType, AvroSchemaServiceManager avroSchemaServiceManager) { this(Collections.singletonList(supportedMimeType), avroSchemaServiceManager); }
Source:
public void doPolling(Guid cmdId, List<Guid> childCmdIds) { boolean anyFailed = false; for (Guid childCmdId : childCmdIds) { CommandStatus commandStatus = CommandCoordinatorUtil.getCommandStatus(childCmdId); switch (commandStatus) { case ACTIVE: log.info("Waiting on CloneCinderDisksCommandCallback child commands to complete"); return; case FAILED: case FAILED_RESTARTED: case UNKNOWN: anyFailed = true; break; default: log.error("Invalid command status: '{}", commandStatus); break; } } T command = getCommand(cmdId); command.getParameters().setTaskGroupSuccess(!anyFailed); command.setCommandStatus(anyFailed ? CommandStatus.FAILED : CommandStatus.SUCCEEDED); log.info("All CloneCinderDisksCommandCallback commands have completed, status '{}'", command.getCommandStatus()); }

Target:
public void doPolling(Guid cmdId, List<Guid> childCmdIds) { boolean anyFailed = false; for (Guid childCmdId : childCmdIds) { CommandStatus commandStatus = CommandCoordinatorUtil.getCommandStatus(childCmdId); switch (commandStatus) { case ACTIVE: log.info("Waiting on CloneCinderDisksCommandCallback child commands to complete"); return; case FAILED: case FAILED_RESTARTED: case UNKNOWN: anyFailed = true; log.error("Unknown command status."); break; default: log.error("Invalid command status: '{}", commandStatus); break; } } T command = getCommand(cmdId); command.getParameters().setTaskGroupSuccess(!anyFailed); command.setCommandStatus(anyFailed ? CommandStatus.FAILED : CommandStatus.SUCCEEDED); log.info("All CloneCinderDisksCommandCallback commands have completed, status '{}'", command.getCommandStatus()); }
Source:
public void handle(Willie bot, Channel channel, User sender, String[] args) { ConfigurationBuilder cb = new ConfigurationBuilder(); cb.setDebugEnabled(true) .setOAuthConsumerKey(bot.getConfig().getTwitterConsumerKey()) .setOAuthConsumerSecret(bot.getConfig().getTwitterConsumerKeySecret()) .setOAuthAccessToken(bot.getConfig().getTwitterAccessToken()) .setOAuthAccessTokenSecret(bot.getConfig().getTwitterAccessTokenSecret()); TwitterFactory tf = new TwitterFactory(cb.build()); Twitter twitter = tf.getInstance(); try { Trends trend = twitter.getPlaceTrends(1); int trendsToShow = bot.getConfig().getTwitterTrendsToShow(); channel.sendMessage(Colors.CYAN + "Top " + trendsToShow + " trend(s) on Twitter right now..."); for (Trend t : trend.getTrends()) { if (trendsToShow > 0) { channel.sendMessage(t.getName()); } trendsToShow =- 1; } } catch (TwitterException e) { e.printStackTrace(); } }

Target:
public void handle(Willie bot, Channel channel, User sender, String[] args) { ConfigurationBuilder cb = new ConfigurationBuilder(); cb.setDebugEnabled(true) .setOAuthConsumerKey(bot.getConfig().getTwitterConsumerKey()) .setOAuthConsumerSecret(bot.getConfig().getTwitterConsumerKeySecret()) .setOAuthAccessToken(bot.getConfig().getTwitterAccessToken()) .setOAuthAccessTokenSecret(bot.getConfig().getTwitterAccessTokenSecret()); TwitterFactory tf = new TwitterFactory(cb.build()); Twitter twitter = tf.getInstance(); try { Trends trend = twitter.getPlaceTrends(1); int trendsToShow = 5; channel.sendMessage(Colors.CYAN + "Top " + trendsToShow + " trends on Twitter right now..."); for (Trend t : trend.getTrends()) { if (trendsToShow > 0) { channel.sendMessage(t.getName()); } trendsToShow =- 1; } } catch (TwitterException e) { e.printStackTrace(); } }
Source:
private Comparator<File> getHtBackupFileComparatorByVersion() { return (a, b) -> { Pattern htJarFileBackupPattern = Pattern.compile(HT_BACKUP_FILENAME_PATTERN_STRING); Matcher htJarFileBackupMatcher = htJarFileBackupPattern.matcher(a.getName()); htJarFileBackupMatcher.find(); Version aVersion = Version.fromString(htJarFileBackupMatcher.group(1)); htJarFileBackupMatcher = htJarFileBackupPattern.matcher(b.getName()); htJarFileBackupMatcher.find(); Version bVersion = Version.fromString(htJarFileBackupMatcher.group(1)); return aVersion.compareTo(bVersion); }; }

Target:
private Comparator<File> getHtBackupFileComparatorByVersion() { return (a, b) -> getVersionOfHtBackupFileFromFilename(a.getName()) .compareTo(getVersionOfHtBackupFileFromFilename(b.getName())); }
Source:
public void loadLocalCache() { final long start = System.currentTimeMillis(); File baseDir = config.getInfoDir(); if (!baseDir.exists() && !config.getInfoDir().mkdirs()) { return; } List<DataSegment> cachedSegments = Lists.newArrayList(); File[] segmentsToLoad = baseDir.listFiles(); for (int i = 0; i < segmentsToLoad.length; i++) { File file = segmentsToLoad[i]; log.info("Loading segment cache file [%d/%d][%s].", i, segmentsToLoad.length, file); try { final DataSegment segment = jsonMapper.readValue(file, DataSegment.class); if (!segment.getIdentifier().equals(file.getName())) { log.makeAlert("Ignoring cache file for dataSource[%s].", segment.getDataSource()) .addData("cacheFile", file.getPath()) .addData("segmentIdentifier", segment.getIdentifier()) .emit(); } else if (serverManager.isSegmentCached(segment)) { cachedSegments.add(segment); } else { log.warn("Unable to find cache file for %s. Deleting lookup entry", segment.getIdentifier()); File segmentInfoCacheFile = new File(config.getInfoDir(), segment.getIdentifier()); if (!segmentInfoCacheFile.delete()) { log.warn("Unable to delete segmentInfoCacheFile[%s]", segmentInfoCacheFile); } } } catch (Exception e) { log.makeAlert(e, "Failed to load segment from segmentInfo file") .addData("file", file) .emit(); } } addSegments( cachedSegments, new DataSegmentChangeCallback() { @Override public void execute() { log.info("Cache load took %,d ms", System.currentTimeMillis() - start); } } ); }

Target:
public void loadLocalCache() { final long start = System.currentTimeMillis(); File baseDir = config.getInfoDir(); if (!baseDir.exists() && !config.getInfoDir().mkdirs()) { return; } List<DataSegment> cachedSegments = Lists.newArrayList(); File[] segmentsToLoad = baseDir.listFiles(); int ignored = 0; for (int i = 0; i < segmentsToLoad.length; i++) { File file = segmentsToLoad[i]; log.info("Loading segment cache file [%d/%d][%s].", i, segmentsToLoad.length, file); try { final DataSegment segment = jsonMapper.readValue(file, DataSegment.class); if (!segment.getIdentifier().equals(file.getName())) { log.warn("Ignoring cache file[%s] for segment[%s].", file.getPath(), segment.getIdentifier()); ignored++; } else if (serverManager.isSegmentCached(segment)) { cachedSegments.add(segment); } else { log.warn("Unable to find cache file for %s. Deleting lookup entry", segment.getIdentifier()); File segmentInfoCacheFile = new File(config.getInfoDir(), segment.getIdentifier()); if (!segmentInfoCacheFile.delete()) { log.warn("Unable to delete segmentInfoCacheFile[%s]", segmentInfoCacheFile); } } } catch (Exception e) { log.makeAlert(e, "Failed to load segment from segmentInfo file") .addData("file", file) .emit(); } } if (ignored > 0) { log.makeAlert("Ignored misnamed segment cache files on startup.") .addData("numIgnored", ignored) .emit(); } addSegments( cachedSegments, new DataSegmentChangeCallback() { @Override public void execute() { log.info("Cache load took %,d ms", System.currentTimeMillis() - start); } } ); }
Source:
Properties getProperties() { return props; }

Target:
public Properties getProperties() { return props; }
Source:
public CumulativeNonDistinctResultsCollection(Collection<? extends Collection<E>> results, int limit, List<Metadata> collectionsMetadata) { this.results = results; this.limit = limit; this.collectionsMetdata = collectionsMetadata; System.out.println("JASON"); }

Target:
public CumulativeNonDistinctResultsCollection(Collection<? extends Collection<E>> results, int limit, List<Metadata> collectionsMetadata) { this.results = results; this.limit = limit; this.collectionsMetdata = collectionsMetadata; }
Source:
static InetSocketAddress getResolvedHttpProxyAddress(String host, int port) throws IOException { InetSocketAddress targetAddress = null; Iterator<Proxy> proxies = ProxySelector.getDefault().select(URI.create(String.format("http://%s:%d", host, port))).iterator(); while (targetAddress == null && proxies.hasNext()) { Proxy proxy = proxies.next(); if(proxy.type() == Proxy.Type.HTTP) { if (!(proxy.address() instanceof InetSocketAddress)) throw new IOException("Unsupported proxy address type " + proxy.address().getClass()); InetSocketAddress proxyAddress = (InetSocketAddress) proxy.address(); if(proxyAddress.isUnresolved()) proxyAddress = new InetSocketAddress(proxyAddress.getHostName(), proxyAddress.getPort()); targetAddress = proxyAddress; } } if(targetAddress == null) { String httpProxy = System.getenv("http_proxy"); if(httpProxy != null) { try { URL url = new URL(httpProxy); targetAddress = new InetSocketAddress(url.getHost(), url.getPort()); } catch (MalformedURLException e) { System.err.println("Not use http_proxy environment variable which is invalid: "+e.getMessage()); } } } return targetAddress; }

Target:
static InetSocketAddress getResolvedHttpProxyAddress(String host, int port) throws IOException { InetSocketAddress targetAddress = null; Iterator<Proxy> proxies = ProxySelector.getDefault().select(URI.create(String.format("http://%s:%d", host, port))).iterator(); while (targetAddress == null && proxies.hasNext()) { Proxy proxy = proxies.next(); if(proxy.type() == Proxy.Type.DIRECT) { break; } if(proxy.type() == Proxy.Type.HTTP) { final SocketAddress address = proxy.address(); if (!(address instanceof InetSocketAddress)) { System.err.println("Unsupported proxy address type " + (address != null ? address.getClass() : "null")); continue; } InetSocketAddress proxyAddress = (InetSocketAddress) address; if(proxyAddress.isUnresolved()) proxyAddress = new InetSocketAddress(proxyAddress.getHostName(), proxyAddress.getPort()); targetAddress = proxyAddress; } } if(targetAddress == null) { String httpProxy = System.getenv("http_proxy"); if(httpProxy != null) { try { URL url = new URL(httpProxy); targetAddress = new InetSocketAddress(url.getHost(), url.getPort()); } catch (MalformedURLException e) { System.err.println("Not use http_proxy environment variable which is invalid: "+e.getMessage()); } } } return targetAddress; }
Source:
void createHandle (int index) { state |= HANDLE | THEME_BACKGROUND; fixedHandle = OS.g_object_new (display.gtk_fixed_get_type (), 0); if (fixedHandle == 0) error (SWT.ERROR_NO_HANDLES); OS.gtk_widget_set_has_window (fixedHandle, true); handle = OS.gtk_toolbar_new (); if (handle == 0) error (SWT.ERROR_NO_HANDLES); OS.gtk_container_add (fixedHandle, handle); if ((style & SWT.FLAT) != 0 && !OS.GTK3) { byte swt_toolbar_flat = Converter.wcsToMbcs (null, "swt-toolbar-flat", true); OS.gtk_widget_set_name (handle, swt_toolbar_flat); } OS.gtk_toolbar_set_icon_size (handle, OS.GTK3 ? OS.GTK_ICON_SIZE_SMALL_TOOLBAR : OS.GTK_ICON_SIZE_LARGE_TOOLBAR); if (OS.GTK_VERSION < OS.VERSION(3, 21, 0)) { setFontDescription(defaultFont().handle); } }

Target:
void createHandle (int index) { state |= HANDLE | THEME_BACKGROUND; fixedHandle = OS.g_object_new (display.gtk_fixed_get_type (), 0); if (fixedHandle == 0) error (SWT.ERROR_NO_HANDLES); OS.gtk_widget_set_has_window (fixedHandle, true); handle = OS.gtk_toolbar_new (); if (handle == 0) error (SWT.ERROR_NO_HANDLES); OS.gtk_container_add (fixedHandle, handle); if ((style & SWT.FLAT) != 0 && !OS.GTK3) { byte swt_toolbar_flat = Converter.wcsToMbcs (null, "swt-toolbar-flat", true); OS.gtk_widget_set_name (handle, swt_toolbar_flat); } OS.gtk_toolbar_set_icon_size (handle, OS.GTK3 ? OS.GTK_ICON_SIZE_SMALL_TOOLBAR : OS.GTK_ICON_SIZE_LARGE_TOOLBAR); if (OS.GTK_VERSION < OS.VERSION(3, 22, 0)) { setFontDescription(defaultFont().handle); } }
Source:
public RouterException(String message, RouterErrorCode errorCode) { super(message + errorCode); this.errorCode = errorCode; }

Target:
public RouterException(String message, RouterErrorCode errorCode) { super(message + " Error: " + errorCode); this.errorCode = errorCode; }
Source:
private void handleAJAXAction(final HttpServletRequest req, final HttpServletResponse resp, final Session session) throws ServletException, IOException { final HashMap<String, Object> ret = new HashMap<>(); final String ajaxName = getParam(req, "ajax"); try { if (ajaxName.equals("addNote")) { ajaxAddNotes(req, ret, session.getUser()); } else { ajaxRemoveNotes(req, ret, session.getUser()); } } catch (final Exception e) { ret.put("error", e.getMessage()); } this.writeJSON(resp, ret); }

Target:
private void handleAJAXAction(final HttpServletRequest req, final HttpServletResponse resp, final Session session) throws ServletException, IOException { final HashMap<String, Object> ret = new HashMap<>(); final String ajaxName = getParam(req, "ajax"); try { if (ajaxName.equals("addNote")) { ajaxAddNotes(req, ret); } else if (ajaxName.equals("removeNote")){ ajaxRemoveNotes(ret); } else { ret.put("error", "Can not find the ajax operation"); } } catch (final Exception e) { ret.put("error", e.getMessage()); } this.writeJSON(resp, ret); }
Source:
public String toString(Duration value) { if ( value == null ) { return null; } return new StringBuilder() .append( value.getSeconds() ) .append( value.toNanos() ) .toString(); }

Target:
public String toString(Duration value) { if ( value == null ) { return null; } String seconds = String.valueOf( value.getSeconds() ); String nanos = String.valueOf( value.getNano() ); String zeros = StringHelper.repeat( '0', 9-nanos.length() ); return seconds + zeros + nanos; }
Source:
private boolean repairBendpointsOfEdge(Edge edge, Rectangle srcBounds, Point srcRef, Rectangle tgtBounds, Point tgtRef) { boolean isEdgeModified = false; PointList newPointList = new PointList(); Option<Point> srcConnectionBendpoint = GraphicalHelper.getIntersection(srcRef, tgtRef, srcBounds, true); Option<Point> tgtConnectionBendpoint = GraphicalHelper.getIntersection(srcRef, tgtRef, tgtBounds, false); if (srcConnectionBendpoint.some() && tgtConnectionBendpoint.some()) { isEdgeModified = true; EdgeQuery edgeQuery = new EdgeQuery(edge); Routing routingStyle = edgeQuery.getRoutingStyle(); if (Routing.RECTILINEAR_LITERAL.equals(routingStyle) && srcBounds != null && srcBounds.equals(tgtBounds)) { newPointList = RectilinearEdgeUtil.computeRectilinearBendpointsSameSourceAndTarget(srcBounds, tgtBounds, srcBounds.getRight(), PositionConstants.EAST); } else if (Routing.RECTILINEAR_LITERAL.equals(routingStyle)) { newPointList = RectilinearEdgeUtil.computeRectilinearBendpoints(srcBounds, tgtBounds, srcConnectionBendpoint.get(), tgtConnectionBendpoint.get()); } else { newPointList.addPoint(srcConnectionBendpoint.get()); newPointList.addPoint(tgtConnectionBendpoint.get()); } newPointList = RectilinearEdgeUtil.normalizeToStraightLineTolerance(newPointList, 2); setNewBendPoints(edge, srcRef, tgtRef, newPointList); } return isEdgeModified; }

Target:
private boolean repairBendpointsOfEdge(Edge edge, Rectangle srcBounds, Point srcRef, Rectangle tgtBounds, Point tgtRef) { boolean isEdgeModified = false; PointList newPointList = new PointList(); Option<Point> srcConnectionBendpoint = GraphicalHelper.getIntersection(srcRef, tgtRef, srcBounds, true); Option<Point> tgtConnectionBendpoint = GraphicalHelper.getIntersection(srcRef, tgtRef, tgtBounds, false); if (srcConnectionBendpoint.some() && tgtConnectionBendpoint.some()) { isEdgeModified = true; EdgeQuery edgeQuery = new EdgeQuery(edge); Routing routingStyle = edgeQuery.getRoutingStyle(); if (Routing.RECTILINEAR_LITERAL.equals(routingStyle) && srcBounds != null && srcBounds.equals(tgtBounds)) { newPointList = RectilinearEdgeUtil.computeRectilinearBendpointsSameSourceAndTarget(srcBounds, srcBounds.getRight(), PositionConstants.EAST); } else if (Routing.RECTILINEAR_LITERAL.equals(routingStyle)) { newPointList = RectilinearEdgeUtil.computeRectilinearBendpoints(srcBounds, tgtBounds, srcConnectionBendpoint.get(), tgtConnectionBendpoint.get()); } else { newPointList.addPoint(srcConnectionBendpoint.get()); newPointList.addPoint(tgtConnectionBendpoint.get()); } newPointList = RectilinearEdgeUtil.normalizeToStraightLineTolerance(newPointList, 2); setNewBendPoints(edge, srcRef, tgtRef, newPointList); } return isEdgeModified; }
Source:
public ImmutableSpongeBreakableData(Set<BlockType> breakable) { super(ImmutableBreakableData.class); registerGetters(); this.breakable = breakable; }

Target:
public ImmutableSpongeBreakableData(Set<BlockType> breakable) { super(ImmutableBreakableData.class, breakable, Keys.BREAKABLE_BLOCK_TYPES, SpongeBreakableData.class); }
Source:
@Test public void parameterVariableElement() { TypeElement classElement = getElement(VariableElementParameterClass.class); List<ExecutableElement> methods = methodsIn(elements.getAllMembers(classElement)); ExecutableElement element = findFirstExecutable(methods, "foo"); VariableElement parameterElement = element.getParameters().get(0); assertThat(ParameterSpec.get(parameterElement).toString()) .isEqualTo("@javax.annotation.Nullable java.lang.String arg0"); }

Target:
@Test public void parameterVariableElement() { TypeElement classElement = getElement(VariableElementParameterClass.class); List<ExecutableElement> methods = methodsIn(elements.getAllMembers(classElement)); ExecutableElement element = findFirst(methods, "foo"); VariableElement parameterElement = element.getParameters().get(0); assertThat(ParameterSpec.get(parameterElement).toString()) .isEqualTo("@javax.annotation.Nullable java.lang.String arg0"); }
Source:
public OpenIdConfigurationResponse getConnectDiscoveryResponse(String opConfigurationEndpoint, String opHost, String opDiscoveryPath) { return Strings.isNullOrEmpty(opConfigurationEndpoint) ? getConnectDiscoveryResponse(opHost, opDiscoveryPath) : getConnectDiscoveryResponse(opConfigurationEndpoint); }

Target:
public OpenIdConfigurationResponse getConnectDiscoveryResponse(String opConfigurationEndpoint, String opHost, String opDiscoveryPath) { return Strings.isNullOrEmpty(opConfigurationEndpoint) ? getConnectDiscoveryResponse(getConnectDiscoveryUrl(opHost, opDiscoveryPath)) : getConnectDiscoveryResponse(opConfigurationEndpoint); }
Source:
ErrorCallback<Object> getErrorCallback() { return (message, throwable) -> { showWarningMessage(); loadConstraintValues(emptyList()); return true; }; }

Target:
ErrorCallback<Object> getErrorCallback() { return (message, throwable) -> { showWarningMessage(); loadConstraintValues(emptyList()); return false; }; }
Source:
private static String trimEndOfLine(String line) { int index = line.length()-1; for (; index > 0; index--) { char c = line.charAt(index); if (!Character.isWhitespace(c)) { break; } } return line.substring(0, index+1); }

Target:
private static String trimEndOfLine(String line) { return RTRIM.matcher(line).replaceAll(""); }