auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public Transceiver readFlaggedComments() throws IOException { return new Transceiver() { @Override protected HashSet<CommentNodeView> getData() throws IOException { CommentNodeView.Factory viewFactory = new CommentNodeView.Factory(runtimeConfiguration); return getAllFlags().stream() .map(Flag::getFlaggedComment) .map(viewFactory::create) .collect(Collectors.toCollection(HashSet::new)); } @Override protected Calendar getLastModifiedDate() throws IOException { return null; } }; }

Target:
public Transceiver readFlaggedComments() throws IOException { return new Transceiver() { @Override protected Set<CommentNodeView> getData() throws IOException { CommentNodeView.Factory viewFactory = new CommentNodeView.Factory(runtimeConfiguration); return getAllFlags().stream() .map(Flag::getFlaggedComment) .map(viewFactory::create) .collect(Collectors.toSet()); } @Override protected Calendar getLastModifiedDate() throws IOException { return null; } }; }
Source:
public Vm defaultVmMapper(final Cloudlet cloudlet) { if (cloudlet.isBindToVm() && this.equals(cloudlet.getVm().getBroker()) && cloudlet.getVm().isCreated()) { return cloudlet.getVm(); } if (firstVmMapperCall) { for (Vm vm : getVmCreatedList()) { updateNumberOfPes(vm.getId(), vm.getNumberOfPes()); } firstVmMapperCall = false; } Optional<Map.Entry<Long, Long>> minVmPes = vmNumberOfPesUpdated .entrySet() .stream() .filter(x -> x.getValue() >= cloudlet.getNumberOfPes()) .min(Comparator.comparingLong(x -> x.getValue())); if (minVmPes.isPresent()) { Vm mappedVm = getVmCreatedList() .stream() .filter(vm -> vm.getId() == minVmPes.get().getKey()) .findFirst() .orElse(Vm.NULL); if (mappedVm != Vm.NULL) { LOGGER.debug("{} (PEs: {}) mapped to (available PEs: {})", cloudlet, cloudlet.getNumberOfPes(), mappedVm, vmNumberOfPesUpdated.get(mappedVm.getId())); updateNumberOfPes(mappedVm.getId(), mappedVm.getNumberOfPes() - cloudlet.getNumberOfPes()); } return mappedVm; } else { LOGGER.warn("{} (PEs: {}) couldn't be mapped to any VM", cloudlet, cloudlet.getNumberOfPes()); } return Vm.NULL; }

Target:
public Vm defaultVmMapper(final Cloudlet cloudlet) { if (cloudlet.isBoundToCreatedVm()) { return cloudlet.getVm(); } final Vm mappedVm = getVmCreatedList() .stream() .filter(vm -> vm.getExpectedFreePesNumber() >= cloudlet.getNumberOfPes()) .min(Comparator.comparingLong(vm -> vm.getExpectedFreePesNumber())) .orElse(Vm.NULL); if(mappedVm != Vm.NULL){ LOGGER.debug("{}: {}: (PEs: {}) mapped to (available PEs: {}, tot PEs: {})", getSimulation().clock(), getName(), cloudlet, cloudlet.getNumberOfPes(), mappedVm, mappedVm.getExpectedFreePesNumber(), mappedVm.getFreePesNumber()); } else { LOGGER.warn(": {}: {}: (PEs: {}) couldn't be mapped to any VM", getSimulation().clock(), getName(), cloudlet, cloudlet.getNumberOfPes()); } return mappedVm; }
Source:
public void shouldInvokeStorageServiceAndResetContributorsWhenEventIsCreatedByCopy() { DocumentModel doc = session.createDocumentModel("File"); Map<String, Serializable> properties = new HashMap<>(); properties.put(RESET_CREATOR, true); DocumentEventContext ctx = new DocumentEventContext(session, session.getPrincipal(), doc); ctx.setProperties(properties); Event event = ctx.newEvent(DOCUMENT_CREATED_BY_COPY); eventService.fireEvent(event); Calendar expectedDate = Calendar.getInstance(); expectedDate.setTime(new Date(event.getTime())); assertNull(doc.getPropertyValue("dc:creator")); assertNull(doc.getPropertyValue("dc:contributors")); assertNull(doc.getPropertyValue("dc:lastContributor")); verify(storageService).setCreationDate(eq(doc), eq(expectedDate)); verify(storageService).setModificationDate(eq(doc), eq(expectedDate)); verify(storageService).addContributor(eq(doc), eq(event)); }

Target:
public void shouldInvokeStorageServiceAndResetContributorsWhenEventIsCreatedByCopy() { DocumentModel doc = session.createDocumentModel("File"); Map<String, Serializable> properties = new HashMap<>(); properties.put(RESET_CREATOR, true); DocumentEventContext ctx = new DocumentEventContext(session, session.getPrincipal(), doc); ctx.setProperties(properties); Event event = ctx.newEvent(DOCUMENT_CREATED_BY_COPY, FLAG_INLINE); eventService.fireEvent(event); Calendar expectedDate = Calendar.getInstance(); expectedDate.setTime(new Date(event.getTime())); assertNull(doc.getPropertyValue(DUBLINCORE_CREATOR_PROPERTY)); assertNull(doc.getPropertyValue(DUBLINCORE_CONTRIBUTORS_PROPERTY)); assertNull(doc.getPropertyValue(DUBLINCORE_LAST_CONTRIBUTOR_PROPERTY)); verify(storageService).setCreationDate(eq(doc), eq(expectedDate)); verify(storageService).setModificationDate(eq(doc), eq(expectedDate)); verify(storageService).addContributor(eq(doc), eq(event)); }
Source:
public DhcpdImpl() { Runtime.getRuntime().addShutdownHook(new Thread(new Runnable() { @Override public void run() { DhcpdImpl.this.shutdown = true; DhcpdImpl.this.port67Listener.stop(); DhcpdImpl.this.port68Listener.stop(); LOG.debug("Dhcpd terminated successfully."); } })); }

Target:
public DhcpdImpl() { }
Source:
void update(ObservationPoint obsPoint, MapView mapView, boolean isMlsPointUpdate) { final Projection pj = mapView.getProjection(); GeoPoint geoPoint = (isMlsPointUpdate)? obsPoint.pointMLS : obsPoint.pointGPS; if (geoPoint == null) { Log.i(LOG_TAG, "Caller error: geoPoint is null"); return; } final Point point = pj.toPixels(geoPoint, null); final int size = mSize3px * 2; final Rect dirty = new Rect(point.x - size, point.y - size, point.x + size, point.y + size); dirty.offset(mapView.getScrollX(), mapView.getScrollY()); mapView.postInvalidate(dirty.left, dirty.top, dirty.right, dirty.bottom); if (!isMlsPointUpdate) { addToGridHash(obsPoint, point); } }

Target:
void update(ObservationPoint obsPoint, MapView mapView, boolean isMlsPointUpdate) { final Projection pj = mapView.getProjection(); GeoPoint geoPoint = (isMlsPointUpdate)? obsPoint.pointMLS : obsPoint.pointGPS; if (geoPoint == null) { Log.w(LOG_TAG, "Caller error: geoPoint is null"); return; } final Point point = pj.toPixels(geoPoint, null); final int size = mSize3px * 2; final Rect dirty = new Rect(point.x - size, point.y - size, point.x + size, point.y + size); dirty.offset(mapView.getScrollX(), mapView.getScrollY()); mapView.postInvalidate(dirty.left, dirty.top, dirty.right, dirty.bottom); if (!isMlsPointUpdate) { addToGridHash(obsPoint, point); } }
Source:
public static String loadJSONFromCommit(String filename, String shacommit) throws IOException { String json = ""; json = getFromUrl("<LINK_0>" + shacommit + "/" + filename); if (!json.isEmpty()) json = json.replaceAll(" return json; }

Target:
public static String loadJSONFromCommit(String filename, String shacommit) throws IOException { String json = ""; if (!SystemProperties.getDefault().githubTestsLoadLocal()) json = getFromUrl("<LINK_0>" + shacommit + "/" + filename); if (!json.isEmpty()) json = json.replaceAll(" return json.isEmpty() ? getFromLocal(filename) : json; }
Source:
public String getCookie(String name) { String cookies = headers.get("cookie"); if(null != cookies) { String[] rawCookies = cookies.split(";"); for(String cookie : rawCookies) { String[] pair = cookie.split("="); if(pair[0].trim().equalsIgnoreCase(name) && pair.length == 2) { return pair[1].trim(); } } } return ""; }

Target:
public String getCookie(String name) { if (hasHeader("cookie")) { String[] rawCookies = getHeader("cookie").split(";"); for (String cookie : rawCookies) { String[] pair = cookie.split("="); if (pair.length == 2 && pair[0].trim().equalsIgnoreCase(name)) { return pair[1].trim(); } } } return ""; }
Source:
public void testConverter() throws Exception { String converterName = cs.getConverterName("application/pdf", "text/plain"); assertEquals("pdf2text", converterName); checkConverterAvailability(converterName); checkCommandAvailability("pdftotext"); BlobHolder pdfBH = getBlobFromPath("test-docs/hello.pdf"); BlobHolder result = cs.convert(converterName, pdfBH, null); assertNotNull(result); List<Blob> blobs = result.getBlobs(); assertNotNull(blobs); assertEquals(1, blobs.size()); Blob blob = result.getBlob(); assertNotNull(blob); assertEquals("text/plain", blob.getMimeType()); assertTrue(blob.getLength() > 0); String newline = System.getProperty("line.separator"); assertEquals("Hello from a PDF Document!" + newline + newline + "\f", blob.getString()); }

Target:
public void testConverter() throws Exception { String converterName = cs.getConverterName("application/pdf", "text/plain"); assertEquals("pdf2text", converterName); checkConverterAvailability(converterName); checkCommandAvailability("pdftotext"); BlobHolder pdfBH = getBlobFromPath("test-docs/hello.pdf"); BlobHolder result = cs.convert(converterName, pdfBH, null); assertNotNull(result); List<Blob> blobs = result.getBlobs(); assertNotNull(blobs); assertEquals(1, blobs.size()); Blob blob = result.getBlob(); assertNotNull(blob); assertEquals("text/plain", blob.getMimeType()); assertTrue(blob.getLength() > 0); String newline = System.lineSeparator(); assertEquals("Hello from a PDF Document!" + newline + newline + "\f", blob.getString()); }
Source:
private void assignStatelessActiveTasks() { final PriorityQueue<UUID> statelessActiveTaskClientsQueue = getClientPriorityQueueByTaskLoad(clientStates); statelessActiveTaskClientsQueue.addAll(clientStates.keySet()); for (final TaskId task : statelessTasks) { final UUID client = statelessActiveTaskClientsQueue.poll(); final ClientState state = clientStates.get(client); state.assignActive(task); statelessActiveTaskClientsQueue.offer(client); } }

Target:
private void assignStatelessActiveTasks() { final ValidClientsByTaskLoadQueue statelessActiveTaskClientsByTaskLoad = new ValidClientsByTaskLoadQueue( clientStates, (client, task) -> true ); statelessActiveTaskClientsByTaskLoad.offerAll(clientStates.keySet()); for (final TaskId task : statelessTasks) { final UUID client = statelessActiveTaskClientsByTaskLoad.poll(task); final ClientState state = clientStates.get(client); state.assignActive(task); statelessActiveTaskClientsByTaskLoad.offer(client); } }
Source:
public List<PermissionSubject> getPermissionCheckSubjects() { if (listPermissionSubjects == null) { listPermissionSubjects = super.getPermissionCheckSubjects(); Guid diskId = _oldDisk == null ? null : _oldDisk.getimage_group_id(); listPermissionSubjects.add(new PermissionSubject(diskId, VdcObjectType.Disk, ActionGroup.EDIT_DISK_PROPERTIES)); listPermissionSubjects = QuotaHelper.getInstance().addQuotaPermissionSubject(listPermissionSubjects, getStoragePool(), getQuotaId()); } return listPermissionSubjects; }

Target:
public List<PermissionSubject> getPermissionCheckSubjects() { if (listPermissionSubjects == null) { listPermissionSubjects = new ArrayList<PermissionSubject>(); Guid diskId = _oldDisk == null ? null : _oldDisk.getimage_group_id(); listPermissionSubjects.add(new PermissionSubject(diskId, VdcObjectType.Disk, ActionGroup.EDIT_DISK_PROPERTIES)); listPermissionSubjects = QuotaHelper.getInstance().addQuotaPermissionSubject(listPermissionSubjects, getStoragePool(), getQuotaId()); } return listPermissionSubjects; }
Source:
public void removeSpecificUserOwner(PerunSession sess, User user, User specificUser) throws InternalErrorException, UserNotExistsException, PrivilegeException, SpecificUserExpectedException, NotSpecificUserExpectedException, RelationNotExistsException, SpecificUserOwnerAlreadyRemovedException { Utils.checkPerunSession(sess); getUsersManagerBl().checkUserExists(sess, user); getUsersManagerBl().checkUserExists(sess, specificUser); if (user.isServiceUser()) throw new NotSpecificUserExpectedException(user); if (user.isSponsoredUser() && specificUser.isSponsoredUser()) throw new NotSpecificUserExpectedException(specificUser); if (!specificUser.isSpecificUser()) throw new SpecificUserExpectedException(specificUser); if(!AuthzResolver.authorizedInternal(sess, "removeSpecificUserOwner_User_User_policy", Collections.singletonList(specificUser))) { throw new PrivilegeException(sess, "removeSpecificUserOwner"); } getUsersManagerBl().removeSpecificUserOwner(sess, user, specificUser); }

Target:
public void removeSpecificUserOwner(PerunSession sess, User user, User specificUser) throws InternalErrorException, UserNotExistsException, PrivilegeException, SpecificUserExpectedException, NotSpecificUserExpectedException, RelationNotExistsException, SpecificUserOwnerAlreadyRemovedException { Utils.checkPerunSession(sess); getUsersManagerBl().checkUserExists(sess, user); getUsersManagerBl().checkUserExists(sess, specificUser); if (user.isServiceUser()) throw new NotSpecificUserExpectedException(user); if (user.isSponsoredUser() && specificUser.isSponsoredUser()) throw new NotSpecificUserExpectedException(specificUser); if (!specificUser.isSpecificUser()) throw new SpecificUserExpectedException(specificUser); if(!AuthzResolver.authorizedInternal(sess, "removeSpecificUserOwner_User_User_policy", Collections.singletonList(specificUser)) && !AuthzResolver.authorizedInternal(sess, "owner-removeSpecificUserOwner_User_User_policy", Collections.singletonList(user))) { throw new PrivilegeException(sess, "removeSpecificUserOwner"); } getUsersManagerBl().removeSpecificUserOwner(sess, user, specificUser); }
Source:
public int hashCode() { return formField.getPageNumber() * formField.getFieldNumber() * (int) Math.floor((double) formField.getSortWeight()); }

Target:
public int hashCode() { return new HashCodeBuilder().append(formField.getPageNumber()).build(); }
Source:
public void visitUnionType(UnionTypeTree tree) { resolveAs((List<TypeTree>) tree.typeAlternatives(), JavaSymbol.TYP); ImmutableList.Builder<Type> builder = ImmutableList.builder(); for (TypeTree typeTree : tree.typeAlternatives()) { builder.add(typeTree.symbolType()); } registerType(tree, (JavaType) resolve.leastUpperBound(builder.build())); }

Target:
public void visitUnionType(UnionTypeTree tree) { resolveAs((List<TypeTree>) tree.typeAlternatives(), JavaSymbol.TYP); ImmutableList.Builder<Type> uniontype = ImmutableList.builder(); for (TypeTree typeTree : tree.typeAlternatives()) { uniontype.add(typeTree.symbolType()); } registerType(tree, (JavaType) resolve.leastUpperBound(uniontype.build())); }
Source:
public static List<LogsForNamespaceAndUseCase> getLogsForHistoryQueries( LocalHistoryLoader localHistoryLoader, List<HistoryQuery> historyQueries) { Map<NamespaceAndUseCase, SequenceBounds> lastVerifiedSequences = historyQueries.stream() .collect(Collectors.toMap( HistoryQuery::getNamespaceAndUseCase, HistoryLoaderAndTransformer::sequenceBounds, HistoryLoaderAndTransformer::seqBoundsCollisionResolver)); PaxosHistoryOnSingleNode localPaxosHistory = localHistoryLoader.getLocalPaxosHistory(lastVerifiedSequences); return KeyedStream.stream(localPaxosHistory.history()) .mapEntries(HistoryLoaderAndTransformer::processHistory) .values() .collect(Collectors.toList()); }

Target:
public static List<LogsForNamespaceAndUseCase> getLogsForHistoryQueries( LocalHistoryLoader localHistoryLoader, List<HistoryQuery> historyQueries) { Map<NamespaceAndUseCase, HistoryQuerySequenceBounds> namespaceAndUseCaseWiseSequenceRangeToBeVerified = historyQueries.stream() .collect(Collectors.toMap( HistoryQuery::getNamespaceAndUseCase, HistoryQuery::getSequenceBounds, HistoryLoaderAndTransformer::minimalLowerBoundResolver)); PaxosHistoryOnSingleNode localPaxosHistory = localHistoryLoader.getLocalPaxosHistory(namespaceAndUseCaseWiseSequenceRangeToBeVerified); return KeyedStream.stream(localPaxosHistory.history()) .mapEntries(HistoryLoaderAndTransformer::processHistory) .values() .collect(Collectors.toList()); }
Source:
public Iterable<NodeMetadata> listNodesByIds(Iterable<String> ids) { return Iterables.transform(Maps.filterKeys(nodes.get().asMap(), in(ImmutableSet.copyOf(ids))).values(), converter); }

Target:
public Iterable<NodeMetadata> listNodesByIds(Iterable<String> ids) { return transform(filterKeys(nodes.get().asMap(), in(ImmutableSet.copyOf(ids))).values(), converter); }
Source:
@Override public IQuickAssistAssistant getQuickAssistAssistant(ISourceViewer sourceViewer) { QuickAssistAssistant quickAssistAssistant = new QuickAssistAssistant(); List<IQuickAssistProcessor> quickAssistProcessors = new ArrayList<IQuickAssistProcessor>(); quickAssistProcessors.add(new MarkerResoltionQuickAssistProcessor()); quickAssistProcessors.addAll(GenericEditorPlugin.getDefault().getQuickAssistProcessorRegistry().getQuickAssistProcessors()); CompositeQuickAssistProcessor compQuickAssistProcessor = new CompositeQuickAssistProcessor(quickAssistProcessors); quickAssistAssistant.setQuickAssistProcessor(compQuickAssistProcessor); quickAssistAssistant.setRestoreCompletionProposalSize(EditorsPlugin.getDefault().getDialogSettingsSection("quick_assist_proposal_size")); quickAssistAssistant.setInformationControlCreator(parent -> new DefaultInformationControl(parent, EditorsPlugin.getAdditionalInfoAffordanceString())); return quickAssistAssistant; }

Target:
@Override public IQuickAssistAssistant getQuickAssistAssistant(ISourceViewer sourceViewer) { QuickAssistAssistant quickAssistAssistant = new QuickAssistAssistant(); List<IQuickAssistProcessor> quickAssistProcessors = new ArrayList<IQuickAssistProcessor>(); quickAssistProcessors.add(new MarkerResoltionQuickAssistProcessor()); quickAssistProcessors.addAll(GenericEditorPlugin.getDefault().getQuickAssistProcessorRegistry().getQuickAssistProcessors(sourceViewer, editor, getContentTypes(sourceViewer))); CompositeQuickAssistProcessor compQuickAssistProcessor = new CompositeQuickAssistProcessor(quickAssistProcessors); quickAssistAssistant.setQuickAssistProcessor(compQuickAssistProcessor); quickAssistAssistant.setRestoreCompletionProposalSize(EditorsPlugin.getDefault().getDialogSettingsSection("quick_assist_proposal_size")); quickAssistAssistant.setInformationControlCreator(parent -> new DefaultInformationControl(parent, EditorsPlugin.getAdditionalInfoAffordanceString())); return quickAssistAssistant; }
Source:
public SearchFormsLoader generateLoader( CatalogFramework catalogFramework, EndpointUtil endpointUtil, String formsDir, String formsFile, String resultsFile) { return new SearchFormsLoader(catalogFramework, endpointUtil, formsDir, formsFile, resultsFile); }

Target:
protected SearchFormsLoader generateLoader( CatalogFramework catalogFramework, EndpointUtil endpointUtil, String formsDir, String formsFile, String resultsFile) { return new SearchFormsLoader(catalogFramework, endpointUtil, formsDir, formsFile, resultsFile); }
Source:
public Retrofit2ClientBuilder hostMetricsRegistry(HostMetricsRegistry newHostMetricsRegistry) { hostMetricsRegistry = newHostMetricsRegistry; return this; }

Target:
public Retrofit2ClientBuilder hostMetricsRegistry(HostMetricsRegistry newHostMetricsRegistry) { Preconditions.checkNotNull(newHostMetricsRegistry, "hostMetricsRegistry can't be null"); hostMetricsRegistry = newHostMetricsRegistry; return this; }
Source:
private TestRunner() { this.configs = new HashMap<>(); this.inMemoryScope = RandomStringUtils.random(10, true, true); configs.put(ApplicationConfig.APP_NAME, JOB_NAME); configs.put(JobConfig.PROCESSOR_ID(), "1"); configs.put(JobCoordinatorConfig.JOB_COORDINATOR_FACTORY, PassthroughJobCoordinatorFactory.class.getName()); configs.put(JobConfig.STARTPOINT_METADATA_STORE_FACTORY(), InMemoryMetadataStoreFactory.class.getCanonicalName()); configs.put(TaskConfig.GROUPER_FACTORY(), SingleContainerGrouperFactory.class.getName()); configs.put(JobConfig.JOB_NON_LOGGED_STORE_BASE_DIR(), new File(System.getProperty("java.io.tmpdir"), this.inMemoryScope + "-non-logged").getAbsolutePath()); configs.put(JobConfig.JOB_LOGGED_STORE_BASE_DIR(), new File(System.getProperty("java.io.tmpdir"), this.inMemoryScope + "-logged").getAbsolutePath()); addConfig(JobConfig.JOB_DEFAULT_SYSTEM(), JOB_DEFAULT_SYSTEM); addConfig(ClusterManagerConfig.JOB_HOST_AFFINITY_ENABLED, Boolean.FALSE.toString()); addConfig(InMemorySystemConfig.INMEMORY_SCOPE, inMemoryScope); addConfig(new InMemorySystemDescriptor(JOB_DEFAULT_SYSTEM).withInMemoryScope(inMemoryScope).toConfig()); }

Target:
private TestRunner() { this.configs = new HashMap<>(); this.inMemoryScope = RandomStringUtils.random(10, true, true); configs.put(ApplicationConfig.APP_NAME, APP_NAME); configs.put(JobConfig.PROCESSOR_ID(), "1"); configs.put(JobCoordinatorConfig.JOB_COORDINATOR_FACTORY, PassthroughJobCoordinatorFactory.class.getName()); configs.put(JobConfig.STARTPOINT_METADATA_STORE_FACTORY(), InMemoryMetadataStoreFactory.class.getCanonicalName()); configs.put(TaskConfig.GROUPER_FACTORY(), SingleContainerGrouperFactory.class.getName()); configs.put(JobConfig.JOB_NON_LOGGED_STORE_BASE_DIR(), new File(System.getProperty("java.io.tmpdir"), this.inMemoryScope + "-non-logged").getAbsolutePath()); configs.put(JobConfig.JOB_LOGGED_STORE_BASE_DIR(), new File(System.getProperty("java.io.tmpdir"), this.inMemoryScope + "-logged").getAbsolutePath()); addConfig(JobConfig.JOB_DEFAULT_SYSTEM(), JOB_DEFAULT_SYSTEM); addConfig(ClusterManagerConfig.JOB_HOST_AFFINITY_ENABLED, Boolean.FALSE.toString()); addConfig(InMemorySystemConfig.INMEMORY_SCOPE, inMemoryScope); addConfig(new InMemorySystemDescriptor(JOB_DEFAULT_SYSTEM).withInMemoryScope(inMemoryScope).toConfig()); }
Source:
public static boolean mountAll(WebApplication app) { String mapInfoClassName = app.getClass().getCanonicalName() + "MountInfo"; try { MountInfo mountInfo = (MountInfo) Class.forName(mapInfoClassName).newInstance(); mountInfo.getMountList().mount(app); return true; } catch (Exception ex) { return false; } }

Target:
public static boolean mountAll(WebApplication app) { final String mapInfoClassName = app.getClass().getCanonicalName() + "MountInfo"; try { final MountInfo mountInfo = (MountInfo) WicketObjects.newInstance(mapInfoClassName); for(IRequestMapper mapper: mountInfo.getMountList()) { app.mount(mapper); } return true; } catch (Exception ex) { LOG.warn("Failed to automount pages.",ex); return false; } }
Source:
private static IndexFamilyDto asDto(IndexFamily from, boolean includeChildren) { IndexFamilyDto dto = new IndexFamilyDto(); dto.setId(from.getId()); dto.setName(from.getName()); dto.setArchived(from.getArchived()); dto.setIndices(from.getIndices().stream().map(x -> asDto(x, false)).collect(Collectors.toList())); dto.setMaximumNumber(from.getMaximumNumber()); dto.setPlatformType(from.getPlatformType() == null ? null : from.getPlatformType().name()); return dto; }

Target:
private static IndexFamilyDto asDto(IndexFamily from, boolean includeChildren) { IndexFamilyDto dto = new IndexFamilyDto(); dto.setId(from.getId()); dto.setName(from.getName()); dto.setArchived(from.getArchived()); if (includeChildren) { dto.setIndices(from.getIndices().stream().map(x -> asDto(x, false)).collect(Collectors.toList())); } dto.setMaximumNumber(from.getMaximumNumber()); dto.setPlatformType(from.getPlatformType() == null ? null : from.getPlatformType().name()); return dto; }
Source:
private Iterator<Object[]> zipArgs(Method method, Object[] args) { boolean foundIterator = false; List<Iterator<?>> extras = new ArrayList<>(); for (int paramIdx = 0; paramIdx < method.getParameterCount(); paramIdx++) { final boolean singleValue = method.getParameters()[paramIdx].isAnnotationPresent(SingleValue.class); final Object arg = args[paramIdx]; if (ReflectionArrayIterator.isIterable(arg) && !singleValue) { extras.add(ReflectionArrayIterator.of(arg)); foundIterator = true; } else { extras.add(Stream.generate(() -> arg).iterator()); } } if (!foundIterator) { throw new UnableToCreateStatementException("@SqlBatch method has no Iterable or array parameters," + " did you mean @SqlQuery?", null, null); } final Object[] sharedArg = new Object[args.length]; return new Iterator<Object[]>() { @Override public boolean hasNext() { for (Iterator<?> extra : extras) { if (!extra.hasNext()) { return false; } } return true; } @Override public Object[] next() { for (int i = 0; i < extras.size(); i++) { sharedArg[i] = extras.get(i).next(); } return sharedArg; } }; }

Target:
private Iterator<Object[]> zipArgs(Method method, Object[] args) { boolean foundIterator = false; List<Iterator<?>> extras = new ArrayList<>(); for (int paramIdx = 0; paramIdx < method.getParameterCount(); paramIdx++) { final boolean singleValue = method.getParameters()[paramIdx].isAnnotationPresent(SingleValue.class); final Object arg = args[paramIdx]; if (!singleValue && ReflectionArrayIterator.isIterable(arg)) { extras.add(ReflectionArrayIterator.of(arg)); foundIterator = true; } else { extras.add(Stream.generate(() -> arg).iterator()); } } if (!foundIterator) { throw new UnableToCreateStatementException("@SqlBatch method has no Iterable or array parameters," + " did you mean @SqlQuery?", null, null); } final Object[] sharedArg = new Object[args.length]; return new Iterator<Object[]>() { @Override public boolean hasNext() { for (Iterator<?> extra : extras) { if (!extra.hasNext()) { return false; } } return true; } @Override public Object[] next() { for (int i = 0; i < extras.size(); i++) { sharedArg[i] = extras.get(i).next(); } return sharedArg; } }; }
Source:
private static LineEdit readEdit(final InputStream in) throws IOException { final int beginA = readVarInt32(in); final int endA = readVarInt32(in); final int beginB = readVarInt32(in); final int endB = readVarInt32(in); return new LineEdit(beginA, endA, beginB, endB); }

Target:
private static BaseEdit readEdit(final InputStream in) throws IOException { final int beginA = readVarInt32(in); final int endA = readVarInt32(in); final int beginB = readVarInt32(in); final int endB = readVarInt32(in); return new BaseEdit(beginA, endA, beginB, endB); }
Source:
public KafkaConnector createConnector(String connectorName, Properties config) { VerifiableProperties verifiableProperties = new VerifiableProperties(config); long commitMillis = verifiableProperties.getLongInRange(KafkaConnector.CONFIG_COMMIT_INTERVAL_MILLIS, TimeUnit.SECONDS.toMillis(30), 0, TimeUnit.HOURS.toMillis(1)); String factory = verifiableProperties.getString(KafkaConnector.CONFIG_CONSUMER_FACTORY_CLASS); KafkaConsumerFactory<?, ?> kafkaConsumerFactory = ReflectionUtils.createInstance(factory); if (kafkaConsumerFactory == null) { throw new DatastreamRuntimeException("Unable to instantiate factory class" + factory); } return new KafkaConnector(connectorName, commitMillis, kafkaConsumerFactory); }

Target:
public KafkaConnector createConnector(String connectorName, Properties config) { VerifiableProperties verifiableProperties = new VerifiableProperties(config); long commitMillis = verifiableProperties.getLongInRange(KafkaConnector.CONFIG_COMMIT_INTERVAL_MILLIS, TimeUnit.SECONDS.toMillis(30), 0, TimeUnit.HOURS.toMillis(1)); String factory = verifiableProperties.getString(KafkaConnector.CONFIG_CONSUMER_FACTORY_CLASS, KafkaConsumerFactoryImpl.class.getName()); KafkaConsumerFactory<?, ?> kafkaConsumerFactory = ReflectionUtils.createInstance(factory); if (kafkaConsumerFactory == null) { throw new DatastreamRuntimeException("Unable to instantiate factory class: " + factory); } Properties kafkaConsumerProps = verifiableProperties.getDomainProperties(DOMAIN_KAFKA_CONSUMER); return new KafkaConnector(connectorName, commitMillis, kafkaConsumerFactory, kafkaConsumerProps); }
Source:
public static BlockRayBuilder from(Entity entity) { final Vector3d rotation = entity.getRotation(); final Vector3d direction = Quaterniond.fromAxesAnglesDeg(rotation.getY(), 360 - rotation.getX(), rotation.getZ()).getDirection(); final Location location = entity.getLocation(); final Vector3d position; final Optional<EyeLocationData> data = entity.getData(EyeLocationData.class); if (data.isPresent()) { position = data.get().getEyeLocation(); } else { position = location.getPosition(); } return from(location.getExtent(), position).direction(direction); }

Target:
public static BlockRayBuilder from(Entity entity) { Preconditions.checkNotNull(entity, "entity"); final Vector3d rotation = entity.getRotation(); final Vector3d direction = Quaterniond.fromAxesAnglesDeg(rotation.getY(), 360 - rotation.getX(), rotation.getZ()).getDirection(); final Location location = entity.getLocation(); final Vector3d position; final Optional<EyeLocationData> data = entity.getData(EyeLocationData.class); if (data.isPresent()) { position = data.get().getEyeLocation(); } else { position = location.getPosition(); } return from(location.getExtent(), position).direction(direction); }
Source:
private Database(CatalogContext context, String type, String name, UnderDatabase udb, CatalogConfiguration config) { mContext = context; mType = type; mName = name; mTables = new ConcurrentHashMap<>(); mUdb = udb; mConfig = config; mIgnoreTables = Sets.newHashSet(Splitter.on(",").trimResults().omitEmptyStrings() .split(mConfig.get(CatalogProperty.DB_IGNORE_TABLES))); }

Target:
private Database(CatalogContext context, String type, String name, UnderDatabase udb, CatalogConfiguration config) { mContext = context; mType = type; mName = name; mTables = new ConcurrentHashMap<>(); mUdb = udb; mConfig = config; mIgnoreTables = Sets.newHashSet( ConfigurationUtils.parseAsList(mConfig.get(CatalogProperty.DB_IGNORE_TABLES), ",")); }
Source:
public static String printLogical(List<PlanFragment> fragments, Session session) { GraphvizPrinter printer = new GraphvizPrinter(session); Map<PlanFragmentId, PlanFragment> fragmentsById = Maps.uniqueIndex(fragments, PlanFragment::getId); PlanNodeIdGenerator idGenerator = new PlanNodeIdGenerator(); StringBuilder output = new StringBuilder(); output.append("digraph logical_plan {\n"); for (PlanFragment fragment : fragments) { printFragmentNodes(output, fragment, idGenerator, session); } for (PlanFragment fragment : fragments) { fragment.getRoot().accept(new EdgePrinter(output, fragmentsById, idGenerator), null); } output.append("}\n"); return output.toString(); }

Target:
public static String printLogical(List<PlanFragment> fragments, Session session) { Map<PlanFragmentId, PlanFragment> fragmentsById = Maps.uniqueIndex(fragments, PlanFragment::getId); PlanNodeIdGenerator idGenerator = new PlanNodeIdGenerator(); StringBuilder output = new StringBuilder(); output.append("digraph logical_plan {\n"); for (PlanFragment fragment : fragments) { printFragmentNodes(output, fragment, idGenerator, session); } for (PlanFragment fragment : fragments) { fragment.getRoot().accept(new EdgePrinter(output, fragmentsById, idGenerator), null); } output.append("}\n"); return output.toString(); }
Source:
public boolean filter(String filter, boolean fullTrace, Locale locale) { return allocatedClassMatches(filter, locale) || getMatchingStackFrames(filter, fullTrace, locale).size() > 0; }

Target:
public boolean filter(String filter, boolean fullTrace, Locale locale) { return allocatedClassMatches(filter, locale) || !getMatchingStackFrames(filter, fullTrace, locale).isEmpty(); }
Source:
public void destroyNode(final String id) { logger.debug("Destroying %s ...", id); String storageAccountName = id.replaceAll("[^A-Za-z0-9 ]", "") + "storage"; int index = id.lastIndexOf("-"); String group = id.substring(0, index); URI uri = api.getVirtualMachineApi(azureGroup).delete(id); if (uri != null){ boolean jobDone = Predicates2.retry(new Predicate<URI>() { @Override public boolean apply(URI uri) { return ParseJobStatus.JobStatus.DONE == api.getJobApi().jobStatus(uri); } }, 60 * 10 * 1000 ).apply(uri); if (jobDone) { api.getStorageAccountApi(azureGroup).delete(storageAccountName); uri = api.getNetworkInterfaceCardApi(azureGroup).delete(id + "nic"); if (uri != null){ jobDone = Predicates2.retry(new Predicate<URI>() { @Override public boolean apply(URI uri) { return ParseJobStatus.JobStatus.DONE == api.getJobApi().jobStatus(uri) || ParseJobStatus.JobStatus.NO_CONTENT == api.getJobApi().jobStatus(uri); } }, 60 * 10 * 1000 ).apply(uri); if (jobDone) { api.getPublicIPAddressApi(azureGroup).delete(id + "publicip"); api.getDeploymentApi(azureGroup).delete(id); api.getVirtualNetworkApi(azureGroup).delete(group + "virtualnetwork"); } } } } }

Target:
public void destroyNode(final String id) { checkState(cleanupResources.apply(id), "server(%s) and its resources still there after deleting!?", id); }
Source:
public static <T, R> R create(Function1<T, R> function, T source, int elementCount, Function1<R, Boolean> assertion) { final Tuple2<Integer, Function1<?, ?>> key = Tuple.of(elementCount, function); return (R) FUNCTION_CACHE.get(key).getOrElse(() -> { final R result = function.apply(source); assert assertion.apply(result); FUNCTION_CACHE = FUNCTION_CACHE.put(key, result); MemoryUsage.storeMemoryUsages(source, elementCount, result); return result; }); }

Target:
public static <T, R> R create(Function1<T, R> function, T source, int elementCount, Function1<R, Boolean> assertion) { final R result = function.apply(source); assert assertion.apply(result); MemoryUsage.storeMemoryUsages(source, elementCount, result); return result; }
Source:
protected void acquire(TransactionLocks locks) throws IOException { setLockMode(lockType); Set<String> hldrs = new HashSet<>(); if (leaseHolder != null) { hldrs.add(leaseHolder); } else if (leaseHolder == null && LeaseHolderResolveType.ALL_PATHS == resolveType ) { Collection<Lease> leases = acquireLockList(lockType, Lease.Finder.All); for(Lease lease : leases){ hldrs.add(lease.getHolder()); } } if (locks.containsLock(Type.INode)) { BaseINodeLock inodeLock = (BaseINodeLock) locks.getLock(Type.INode); for (INode f : inodeLock.getAllResolvedINodes()) { if ((f instanceof INodeFile) && f.isUnderConstruction()) { hldrs.add(((INodeFile) f).getFileUnderConstructionFeature().getClientName()); } } } List<String> holders = new ArrayList<>(hldrs); Collections.sort(holders); if (holders.isEmpty() && !locks.containsLock(Type.INode)) { Collection<Lease> allLeases = acquireLockList(lockType, Lease.Finder.All); if (leases != null) { leases.addAll(allLeases); } } for (String h : holders) { acquireLock(lockType, LeaseCreationLock.Finder.ByRowID, Math.abs(Lease.getHolderId(h)) % LEASE_CREATION_LOCK_ROWS); Lease lease = acquireLock(lockType, Lease.Finder.ByHolder, h, Lease.getHolderId(h)); if (lease != null) { leases.add(lease); } } }

Target:
protected void acquire(TransactionLocks locks) throws IOException { setLockMode(lockType); Set<String> hldrs = new HashSet<>(); if (leaseHolder != null) { hldrs.add(leaseHolder); } if (locks.containsLock(Type.INode)) { BaseINodeLock inodeLock = (BaseINodeLock) locks.getLock(Type.INode); for (INode f : inodeLock.getAllResolvedINodes()) { if ((f instanceof INodeFile) && f.isUnderConstruction()) { hldrs.add(((INodeFile) f).getFileUnderConstructionFeature().getClientName()); } } } if (LeaseHolderResolveType.ALL_SYSTEM_PATHS_FOR_TESTSING == resolveType ) { Collection<Lease> leases = acquireLockList(lockType, Lease.Finder.All); for(Lease lease : leases){ hldrs.add(lease.getHolder()); } } List<String> holders = new ArrayList<>(hldrs); Collections.sort(holders); if (holders.isEmpty() && !locks.containsLock(Type.INode)) { Collection<Lease> allLeases = acquireLockList(lockType, Lease.Finder.All); if (leases != null) { leases.addAll(allLeases); } } for (String h : holders) { acquireLock(lockType, LeaseCreationLock.Finder.ByRowID, Math.abs(Lease.getHolderId(h)) % LEASE_CREATION_LOCK_ROWS); Lease lease = acquireLock(lockType, Lease.Finder.ByHolder, h, Lease.getHolderId(h)); if (lease != null) { leases.add(lease); } } }
Source:
public boolean hasNext() { if (next == null) { checkInvariants(); if (iterator.isValid()) { next = new AbstractMap.SimpleEntry( serializer.deserialize(Unpooled.wrappedBuffer(iterator.key()), corfuRuntime), serializer.deserialize(Unpooled.wrappedBuffer(iterator.value()), corfuRuntime)); iterator.next(); } else { iterator.close(); } } return next != null; }

Target:
public boolean hasNext() { if (next != null) { return true; } checkInvariants(); if (iterator.isValid()) { next = new AbstractMap.SimpleEntry( serializer.deserialize(Unpooled.wrappedBuffer(iterator.key()), corfuRuntime), serializer.deserialize(Unpooled.wrappedBuffer(iterator.value()), corfuRuntime)); iterator.next(); } else { iterator.close(); } return next != null; }
Source:
private void assertQuery(String query, byte[] checksum) { byte[] expected = (byte[]) computeActual(query).getOnlyValue(); for (int i = 0; i < expected.length; i++) { System.err.print(expected[i] + ", "); } assertEquals(computeActual(query).getOnlyValue(), checksum); }

Target:
private void assertQuery(String query, byte[] checksum) { assertEquals(computeActual(query).getOnlyValue(), checksum); }
Source:
public static Item getRepositoryContextItemById(String contextId) { if (IContextParameter.BUILT_IN.equals(contextId)) { return null; } if (checkObject(contextId)) { return null; } IProxyRepositoryFactory factory = CoreRuntimePlugin.getInstance().getProxyRepositoryFactory(); try { final IRepositoryViewObject lastVersion = factory.getLastVersion(contextId, ERepositoryObjectType.CONTEXT); if (lastVersion != null) { final Item item = lastVersion.getProperty().getItem(); if (item != null) { return item; } } } catch (PersistenceException e) { ExceptionHandler.process(e); } return null; }

Target:
public static Item getRepositoryContextItemById(String contextId) { if (IContextParameter.BUILT_IN.equals(contextId)) { return null; } if (checkObject(contextId)) { return null; } List<ERepositoryObjectType> possibleTypes = new ArrayList<ERepositoryObjectType>(); possibleTypes.add(ERepositoryObjectType.CONTEXT); possibleTypes.addAll(ERepositoryObjectType.getAllTypesOfJoblet()); possibleTypes.addAll(ERepositoryObjectType.getAllTypesOfProcess()); try { IRepositoryViewObject lastVersion = CoreRuntimePlugin.getInstance().getProxyRepositoryFactory() .getLastVersion(contextId, possibleTypes); if (lastVersion != null) { final Item item = lastVersion.getProperty().getItem(); if (item != null) { return item; } } } catch (PersistenceException e) { ExceptionHandler.process(e); } return null; }
Source:
public CitationStyleToClipboardWorker(BasePanel basePanel, CitationStyleOutputFormat outputFormat, DialogService dialogService, ClipBoardManager clipBoardManager, PreviewPreferences previewPreferences) { this.basePanel = basePanel; this.selectedEntries = basePanel.getSelectedEntries(); this.style = previewPreferences.getPreviewCycle().get(previewPreferences.getPreviewCyclePosition()); this.previewStyle = previewPreferences.getPreviewStyle(); this.outputFormat = outputFormat; this.clipBoardManager = clipBoardManager; this.dialogService = dialogService; dialogService.notify(Localization.lang("Copying...")); BackgroundTask.wrap(this::loadCitationStyles).onFailure(ex -> LOGGER.error("Error while copying citations to the clipboard", ex)) .onSuccess(this::done); }

Target:
public CitationStyleToClipboardWorker(BasePanel basePanel, CitationStyleOutputFormat outputFormat, DialogService dialogService, ClipBoardManager clipBoardManager, PreviewPreferences previewPreferences) { this.basePanel = basePanel; this.selectedEntries = basePanel.getSelectedEntries(); this.style = previewPreferences.getPreviewCycle().get(previewPreferences.getPreviewCyclePosition()); this.previewStyle = previewPreferences.getPreviewStyle(); this.outputFormat = outputFormat; this.clipBoardManager = clipBoardManager; this.dialogService = dialogService; }
Source:
public String getStorageDir(DataSegment dataSegment) { String seg = JOINER.join( dataSegment.getDataSource(), String.format( Locale.ENGLISH, "%s_%s", dataSegment.getInterval().getStart().toString(ISODateTimeFormat.basicDateTime()), dataSegment.getInterval().getEnd().toString(ISODateTimeFormat.basicDateTime()) ), dataSegment.getVersion(), dataSegment.getShardSpec().getPartitionNum() ); log.info("DataSegment: " + seg); return seg.replace(":", "_"); }

Target:
public String getStorageDir(DataSegment dataSegment) { String seg = JOINER.join( dataSegment.getDataSource(), StringUtils.format( "%s_%s", dataSegment.getInterval().getStart().toString(ISODateTimeFormat.basicDateTime()), dataSegment.getInterval().getEnd().toString(ISODateTimeFormat.basicDateTime()) ), dataSegment.getVersion().replace(":", "_"), dataSegment.getShardSpec().getPartitionNum() ); log.info("DataSegment: [%s]", seg); return seg; }
Source:
private static HttpScope sessionScope(HttpServerExchange exchange, ScopeSessionListener listener) { ServletRequestContext context = exchange.getAttachment(ServletRequestContext.ATTACHMENT_KEY); return new HttpScope() { private HttpSession session = context.getOriginalRequest().getSession(); @Override public String getID() { return (exists()) ? session.getId() : null; } @Override public boolean exists() { return session != null; } @Override public synchronized boolean create() { if (exists()) { return false; } session = context.getOriginalRequest().getSession(true); return session != null; } @Override public boolean supportsAttachments() { return exists(); } @Override public void setAttachment(String key, Object value) { if (exists()) { session.setAttribute(key, value); } } @Override public Object getAttachment(String key) { return (exists()) ? session.getAttribute(key) : null; } @Override public boolean supportsInvalidation() { return exists(); } @Override public boolean invalidate() { if (exists()) { try { session.invalidate(); return true; } catch (IllegalStateException cause) { UndertowLogger.ROOT_LOGGER.debugf("Failed to invalidate session", cause); } } return false; } @Override public boolean supportsNotifications() { return exists(); } @Override public void registerForNotification(Consumer<HttpScopeNotification> consumer) { if (exists()) { listener.registerListener(session.getId(), consumer); } } }; }

Target:
private static HttpScope sessionScope(HttpServerExchange exchange, ScopeSessionListener listener) { ServletRequestContext context = exchange.getAttachment(ServletRequestContext.ATTACHMENT_KEY); return new HttpScope() { private HttpSession session = context.getOriginalRequest().getSession(false); @Override public String getID() { return (exists()) ? session.getId() : null; } @Override public boolean exists() { return session != null; } @Override public synchronized boolean create() { if (exists()) { return false; } session = context.getOriginalRequest().getSession(true); return session != null; } @Override public boolean supportsAttachments() { return exists(); } @Override public void setAttachment(String key, Object value) { if (exists()) { session.setAttribute(key, value); } } @Override public Object getAttachment(String key) { return (exists()) ? session.getAttribute(key) : null; } @Override public boolean supportsInvalidation() { return exists(); } @Override public boolean invalidate() { if (exists()) { try { session.invalidate(); return true; } catch (IllegalStateException cause) { UndertowLogger.ROOT_LOGGER.debugf("Failed to invalidate session", cause); } } return false; } @Override public boolean supportsNotifications() { return exists(); } @Override public void registerForNotification(Consumer<HttpScopeNotification> consumer) { if (exists()) { listener.registerListener(session.getId(), consumer); } } }; }
Source:
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); if (getActivity() instanceof PreLoadingListener) { preloadingListener = (PreLoadingListener) getActivity(); } else { throw new RuntimeException("Parent activity of this Fragment should implement the PreLoadingListener interface"); } swipeContainer.setEnabled(false); authWebView.initWebView(getActivity(), true, false); authWebView.getWebViewClient().setPageStatusListener(new URLInterceptorWebViewClient.IPageStatusListener() { @Override public void onPageStarted() { isPageLoading = true; } @Override public void onPageFinished() { if (authWebView.isPageLoaded()) { isProblemXBlock(); if (getUserVisibleHint()) { preloadingListener.setLoadingState(PreLoadingListener.State.MAIN_UNIT_LOADED); } isPageLoading = false; EventBus.getDefault().post(new UnitLoadedEvent()); } } @Override public void onPageLoadError(WebView view, int errorCode, String description, String failingUrl) { isPageLoading = false; } @Override public void onPageLoadError(WebView view, WebResourceRequest request, WebResourceResponse errorResponse, boolean isMainRequestFailure) { isPageLoading = false; } @Override public void onPageLoadProgressChanged(WebView webView, int progress) { } }); if (getUserVisibleHint() || preloadingListener.isMainUnitLoaded()) { loadUnit(); } }

Target:
public void onViewCreated(@NonNull View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); if (getActivity() instanceof PreLoadingListener) { preloadingListener = (PreLoadingListener) getActivity(); } else { throw new RuntimeException("Parent activity of this Fragment should implement the PreLoadingListener interface"); } swipeContainer.setEnabled(false); authWebView.initWebView(getActivity(), true, false); authWebView.getWebViewClient().setPageStatusListener(new URLInterceptorWebViewClient.IPageStatusListener() { @Override public void onPageStarted() { isPageLoading = true; } @Override public void onPageFinished() { if (authWebView.isPageLoaded()) { fetchDateBannerInfo(); if (getUserVisibleHint()) { preloadingListener.setLoadingState(PreLoadingListener.State.MAIN_UNIT_LOADED); } isPageLoading = false; EventBus.getDefault().post(new UnitLoadedEvent()); } } @Override public void onPageLoadError(WebView view, int errorCode, String description, String failingUrl) { isPageLoading = false; } @Override public void onPageLoadError(WebView view, WebResourceRequest request, WebResourceResponse errorResponse, boolean isMainRequestFailure) { isPageLoading = false; } @Override public void onPageLoadProgressChanged(WebView webView, int progress) { } }); if (getUserVisibleHint() || preloadingListener.isMainUnitLoaded()) { loadUnit(); } if (unit.getType() == BlockType.PROBLEM) { initObserver(); } }
Source:
ExecutionPath(@Nullable ExplodedGraph.Edge edge, PSet<ExplodedGraph.Edge> visited, @Nullable Symbol trackSymbol, List<JavaFileScannerContext.Location> flow, boolean finished) { this.trackSymbol = trackSymbol; this.lastEdge = edge; this.visited = visited; this.flow = flow; this.finished = finished; }

Target:
private ExecutionPath(@Nullable ExplodedGraph.Edge edge, PSet<ExplodedGraph.Edge> visited, @Nullable Symbol trackSymbol, List<JavaFileScannerContext.Location> flow, boolean finished) { this.trackSymbol = trackSymbol; this.lastEdge = edge; this.visited = visited; this.flow = flow; this.finished = finished; }
Source:
public ByteBuffer readMessage() throws IOException { int read; ByteBuffer lengthBuffer = ByteBuffer.allocate(4); for (int i = 0; i < 4 && lengthBuffer.hasRemaining(); i++) { read = m_socketChannel.read(lengthBuffer); if (read == -1) { throw new IOException("End of stream while reading message length"); } } lengthBuffer.flip(); int len = lengthBuffer.getInt(); if (len > VoltPort.MAX_MESSAGE_LENGTH) { throw new IOException("Packet exceeds maximum allowed size"); } ByteBuffer message = ByteBuffer.allocate(len); while (message.hasRemaining()) { read = m_socketChannel.read(message); if (read == -1) { throw new IOException("End of stream while reading message"); } } message.flip(); return message; }

Target:
public ByteBuffer readMessage() throws IOException { int read; ByteBuffer lengthBuffer = ByteBuffer.allocate(4); for (int i = 0; i < 4 && lengthBuffer.hasRemaining(); i++) { read = m_socketChannel.read(lengthBuffer); if (read == -1) { throw new IOException("Failed to read message length"); } } lengthBuffer.flip(); int len = lengthBuffer.getInt(); if (len <= 0) { throw new IOException("Packet size is invalid"); } if (len > VoltPort.MAX_MESSAGE_LENGTH) { throw new IOException("Packet exceeds maximum allowed size"); } ByteBuffer message = ByteBuffer.allocate(len); while (message.hasRemaining()) { read = m_socketChannel.read(message); if (read == -1) { throw new IOException("Failed to read message"); } } message.flip(); return message; }
Source:
public Route(final List<Territory> territories) { this.start = checkNotNull(territories.get(0)); for (int i = 1; i < territories.size(); i++) { add(territories.get(i)); } }

Target:
public Route(final List<Territory> territories) { this(territories.get(0), territories.subList(1, territories.size())); }