auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private RestTemplate getSecureRestTemplate(ConfigClientProperties client) { SimpleClientHttpRequestFactory requestFactory = new SimpleClientHttpRequestFactory(); requestFactory.setReadTimeout((60 * 1000 * 3) + 5000); RestTemplate template = new RestTemplate(requestFactory); String username = client.getUsername(); String password = client.getPassword(); String authorization = client.getAuthorization(); Map<String, String> headers = client.getHeaders(); if (password != null && authorization != null) { throw new IllegalStateException( "You must set either 'password' or 'authorization'"); } if (password != null) { byte[] token = Base64Utils.encode((username + ":" + password).getBytes()); headers.put("Authorization", "Basic " + new String(token)); } else if (authorization != null) { headers.put("Authorization", authorization); } if (!headers.isEmpty()) { template.setInterceptors(Arrays.<ClientHttpRequestInterceptor> asList( new GenericRequestHeaderInterceptor(headers))); } return template; }

Target:
private RestTemplate getSecureRestTemplate(ConfigClientProperties client) { SimpleClientHttpRequestFactory requestFactory = new SimpleClientHttpRequestFactory(); requestFactory.setReadTimeout((60 * 1000 * 3) + 5000); RestTemplate template = new RestTemplate(requestFactory); String username = client.getUsername(); String password = client.getPassword(); String authorization = client.getAuthorization(); Map<String, String> headers = new HashMap<>(client.getHeaders()); if (password != null && authorization != null) { throw new IllegalStateException( "You must set either 'password' or 'authorization'"); } if (password != null) { byte[] token = Base64Utils.encode((username + ":" + password).getBytes()); headers.put("Authorization", "Basic " + new String(token)); } else if (authorization != null) { headers.put("Authorization", authorization); } if (!headers.isEmpty()) { template.setInterceptors(Arrays.<ClientHttpRequestInterceptor> asList( new GenericRequestHeaderInterceptor(headers))); } return template; }
Source:
public void copyRightToLeft(Diff target, Monitor monitor) { if (target.getState() != DifferenceState.UNRESOLVED) { return; } long startTime = System.currentTimeMillis(); target.setState(DifferenceState.MERGED); final Set<Diff> dependencies = getDirectMergeDependencies(target, true); boolean requiresMerging = requiresMerging(target, true); for (Diff mergeMe : dependencies) { mergeDiff(mergeMe, true, monitor); } for (Diff transitiveMerge : getDirectResultingMerges(target, true)) { transitiveMerge.setState(DifferenceState.MERGED); } if (requiresMerging) { if (target.getSource() == DifferenceSource.LEFT) { reject(target, true); } else { accept(target, true); } } if (isHandleSubDiffs()) { Set<Diff> subDiffs = Sets.newLinkedHashSet(ComparisonUtil.getDirectSubDiffs(false).apply(target)); for (Diff subDiff : subDiffs) { mergeDiff(subDiff, true, monitor); } } if (LOGGER.isDebugEnabled()) { LOGGER.debug("copyLeftToRight(Diff, Monitor) - diff " + target.hashCode() + " merged in " + getTimeSpentInMethod(startTime) + "s"); } }

Target:
public void copyRightToLeft(Diff target, Monitor monitor) { if (target.getState() != DifferenceState.UNRESOLVED) { return; } long start = System.currentTimeMillis(); target.setState(DifferenceState.MERGED); final Set<Diff> dependencies = getDirectMergeDependencies(target, true); boolean requiresMerging = requiresMerging(target, true); for (Diff mergeMe : dependencies) { mergeDiff(mergeMe, true, monitor); } for (Diff transitiveMerge : getDirectResultingMerges(target, true)) { transitiveMerge.setState(DifferenceState.MERGED); } if (requiresMerging) { if (target.getSource() == DifferenceSource.LEFT) { reject(target, true); } else { accept(target, true); } } if (isHandleSubDiffs()) { Set<Diff> subDiffs = Sets.newLinkedHashSet(ComparisonUtil.getDirectSubDiffs(false).apply(target)); for (Diff subDiff : subDiffs) { mergeDiff(subDiff, true, monitor); } } if (LOGGER.isDebugEnabled()) { long duration = System.currentTimeMillis() - start; LOGGER.debug("copyLeftToRight(Diff, Monitor) - diff " + target.hashCode() + " merged in " + duration + "s"); } }
Source:
private static void bootstrapManagementServer(IClientRouter router, Layout layout) throws TimeoutException, NetworkException, AlreadyBootstrappedException { ManagementClient managementClient = new ManagementClient(router, layout.getEpoch(), layout.getClusterId()); CompletableFuture<Void> bootstrapManagementServer = managementClient .bootstrapManagement(layout) .exceptionally(ex -> { try { CFUtils.unwrap(ex, AlreadyBootstrappedException.class); } catch (AlreadyBootstrappedException e) { log.warn("BootstrapUtil: Management Server {}:{} already bootstrapped.", router.getHost(), router.getPort()); return false; } return true; }) .thenCompose(bootstrapSucceeded -> { if (bootstrapSucceeded) return CompletableFuture.completedFuture(layout); return managementClient.getLayout(); }) .thenAccept(retrievedLayout -> { if (retrievedLayout.equals(layout)) { return; } throw new AlreadyBootstrappedException(); }); CFUtils.getUninterruptibly(bootstrapManagementServer, AlreadyBootstrappedException.class, TimeoutException.class, NetworkException.class); }

Target:
public static void bootstrapManagementServer(IClientRouter router, Layout layout) { ManagementClient managementClient = new ManagementClient(router, layout.getEpoch(), layout.getClusterId()); bootstrap(router, layout, () -> managementClient.bootstrapManagement(layout), managementClient::getLayout); }
Source:
boolean internalExecute(String sql) throws SQLException { clearCurrentResults(); checkOpen(); StatementClient client = null; ResultSet resultSet = null; try { client = connection().startQuery(sql, getStatementSessionProperties()); if (client.isFinished() && client.finalStatusInfo().getError() != null) { throw resultsException(client.finalStatusInfo()); } executingClient.set(client); resultSet = new PrestoResultSet(client, maxRows.get(), progressConsumer); if (client.currentStatusInfo().getUpdateType() == null) { currentResult.set(resultSet); return true; } while (resultSet.next()) { } connection().updateSession(client); Long updateCount = client.finalStatusInfo().getUpdateCount(); currentUpdateCount.set((updateCount != null) ? updateCount : 0); currentUpdateType.set(client.finalStatusInfo().getUpdateType()); return false; } catch (ClientException e) { throw new SQLException(e.getMessage(), e); } catch (RuntimeException e) { throw new SQLException("Error executing query", e); } finally { executingClient.set(null); if (currentResult.get() == null) { if (resultSet != null) { resultSet.close(); } if (client != null) { client.close(); } } } }

Target:
boolean internalExecute(String sql) throws SQLException { clearCurrentResults(); checkOpen(); StatementClient client = null; ResultSet resultSet = null; try { client = connection().startQuery(sql, getStatementSessionProperties()); if (client.isFinished()) { QueryStatusInfo finalStatusInfo = client.finalStatusInfo(); if (finalStatusInfo.getError() != null) { throw resultsException(finalStatusInfo); } } executingClient.set(client); resultSet = new PrestoResultSet(client, maxRows.get(), progressConsumer); if (client.currentStatusInfo().getUpdateType() == null) { currentResult.set(resultSet); return true; } while (resultSet.next()) { } connection().updateSession(client); Long updateCount = client.finalStatusInfo().getUpdateCount(); currentUpdateCount.set((updateCount != null) ? updateCount : 0); currentUpdateType.set(client.finalStatusInfo().getUpdateType()); return false; } catch (ClientException e) { throw new SQLException(e.getMessage(), e); } catch (RuntimeException e) { throw new SQLException("Error executing query", e); } finally { executingClient.set(null); if (currentResult.get() == null) { if (resultSet != null) { resultSet.close(); } if (client != null) { client.close(); } } } }
Source:
private void printHelpForKey() throws Exception { final String keyName = parser.getKey(); boolean foundKey = iterateAllKeys(this.configKeyFactory, keysConfig, new ConfigKeyHandler() { @Override public boolean handle(ConfigKey key) { if (key.getKey().equals(keyName)) { console.writeLine(key.getValueHelper().getHelpNote(key)); return false; } return true; } }); if (!foundKey) { console.writeFormat( "Cannot display help for key %1$s. The key does not exist at the configuration file of engine-config.", keyName); } }

Target:
private void printHelpForKey() throws Exception { final String keyName = parser.getKey(); boolean foundKey = iterateAllKeys(this.configKeyFactory, keysConfig, new ConfigKeyHandler() { @Override public boolean handle(ConfigKey key) { if (key.getKey().equals(keyName)) { console.writeLine(key.getValueHelper().getHelpNote(key)); return false; } return true; } }); if (!foundKey) { console.writeFormat(KEY_NOT_FOUND_ERR_MSG, keyName); } }
Source:
public List<GitlabMergeRequest> getOpenMergeRequests(Serializable projectId) throws IOException { return getMergeRequestsWithStatus(projectId, "opened"); }

Target:
public List<GitlabMergeRequest> getOpenMergeRequests(Serializable projectId) throws IOException { return getMergeRequestsWithStatus(projectId, GitlabMergeRequest.STATUS_OPENED); }
Source:
public void setSeverityLevel(int severityLevel) { if (severityLevel < 1 || severityLevel > 5) { throw new IllegalArgumentException("The severty level should be between 1-5"); } this.severityLevel = severityLevel; }

Target:
public void setSeverityLevel(int severityLevel) { this.severityLevel = severityLevel; }
Source:
static Set<Set<Integer>> computeStronglyConnectedComponents(final int numVertex, final List<List<Integer>> outEdges) { final Set<Set<Integer>> stronglyConnectedComponents = new HashSet<>(); final int[] vertexIndices = new int[numVertex]; Arrays.fill(vertexIndices, -1); final int[] vertexLowLinks = new int[numVertex]; final Deque<Integer> stack = new ArrayDeque<>(numVertex); final boolean[] onStack = new boolean[numVertex]; final AtomicInteger indexCounter = new AtomicInteger(0); for (int vertex = 0; vertex < numVertex; vertex++) { if (vertexIndices[vertex] == -1) { dfs(vertex, outEdges, vertexIndices, vertexLowLinks, stack, onStack, indexCounter, stronglyConnectedComponents); } } return stronglyConnectedComponents; }

Target:
static Set<Set<Integer>> computeStronglyConnectedComponents(final int numVertex, final List<List<Integer>> outEdges) { final Set<Set<Integer>> stronglyConnectedComponents = new HashSet<>(); final Deque<Integer> visitingStack = new ArrayDeque<>(numVertex); final boolean[] onVisitingStack = new boolean[numVertex]; final int[] vertexIndices = new int[numVertex]; Arrays.fill(vertexIndices, -1); final AtomicInteger indexCounter = new AtomicInteger(0); final int[] vertexLowLinks = new int[numVertex]; for (int vertex = 0; vertex < numVertex; vertex++) { if (!isVisited(vertex, vertexIndices)) { dfs(vertex, outEdges, vertexIndices, vertexLowLinks, visitingStack, onVisitingStack, indexCounter, stronglyConnectedComponents); } } return stronglyConnectedComponents; }
Source:
private void impl$refreshTrackerStates(EntityType<?> entityType, net.minecraft.world.World world, CallbackInfo ci) { this.bridge$refreshTrackerStates(); final EntityTypeBridge entityTypeBridge = (EntityTypeBridge) entityType; if (!entityTypeBridge.bridge$checkedDamageEntity()) { try { final String mapping = SpongeImplHooks.isDeobfuscatedEnvironment() ? "attackEntityFrom" : "func_70097_a"; final Class<?>[] argTypes = {DamageSource.class, float.class}; final Class<?> clazz = this.getClass().getMethod(mapping, argTypes).getDeclaringClass(); if (!(clazz.equals(LivingEntity.class) || clazz.equals(PlayerEntity.class) || clazz.equals(ServerPlayerEntity.class))) { entityTypeBridge.bridge$setOverridesDamageEntity(true); } } catch (Throwable ex) { } finally { entityTypeBridge.bridge$setCheckedDamageEntity(true); } } }

Target:
private void impl$refreshTrackerStates(EntityType<?> entityType, net.minecraft.world.World world, CallbackInfo ci) { this.bridge$refreshTrackerStates(); final EntityTypeBridge entityTypeBridge = (EntityTypeBridge) entityType; if (!entityTypeBridge.bridge$checkedDamageEntity()) { try { final String mapping = SpongeImplHooks.isDeobfuscatedEnvironment() ? Constants.Entity.ATTACK_ENTITY_FROM_MAPPING : Constants.Entity.ATTACK_ENTITY_FROM_OBFUSCATED; final Class<?>[] argTypes = {DamageSource.class, float.class}; final Class<?> clazz = this.getClass().getMethod(mapping, argTypes).getDeclaringClass(); if (!(clazz.equals(LivingEntity.class) || clazz.equals(PlayerEntity.class) || clazz.equals(ServerPlayerEntity.class))) { entityTypeBridge.bridge$setOverridesDamageEntity(true); } } catch (Throwable ex) { } finally { entityTypeBridge.bridge$setCheckedDamageEntity(true); } } }
Source:
public CommandCallback getCallback() { if (getVm().isQualifiedForLiveSnapshotMerge() || getParameters().isUseCinderCommandCallback() || FeatureSupported.isQemuimgCommitSupported(getStoragePool().getCompatibilityVersion())) { return new ConcurrentChildCommandsExecutionCallback(); } return null; }

Target:
public CommandCallback getCallback() { if (getVm().isQualifiedForLiveSnapshotMerge() || getParameters().isUseCinderCommandCallback() || isQemuimgCommitSupported()) { return new ConcurrentChildCommandsExecutionCallback(); } return null; }
Source:
public void testSimpleRootListing() throws IOException { describe("test the nonrecursive root listing calls"); FileSystem fs = getFileSystem(); Path root = new Path("/"); FileStatus[] statuses = fs.listStatus(root); String listStatusResult = join(statuses, "\n"); List<LocatedFileStatus> locatedStatusList = toList( fs.listLocatedStatus(root)); String locatedStatusResult = join(locatedStatusList, "\n"); assertEquals("listStatus(/) vs listLocatedStatus(/) with \n" + "listStatus =" + listStatusResult +" listLocatedStatus = " + locatedStatusResult, statuses.length, locatedStatusList.size()); List<LocatedFileStatus> fileList = toList(fs.listFiles(root, false)); String listFilesResult = join(fileList, "\n"); assertTrue("listStatus(/) vs listFiles(/, false) with \n" + "listStatus = " + listStatusResult + "listFiles = " + listFilesResult, fileList.size() <= statuses.length); List<FileStatus> statusList = (List<FileStatus>) iteratorToList( fs.listStatusIterator(root)); String listStatusItrRes = join(statusList, "\n"); assertEquals("listStatus(/) vs listStatusIterator(/) with \n" + "listStatus =" + listStatusResult +" listLocatedStatus = " + listStatusItrRes, statuses.length, statusList.size()); }

Target:
public void testSimpleRootListing() throws IOException { describe("test the nonrecursive root listing calls"); FileSystem fs = getFileSystem(); Path root = new Path("/"); FileStatus[] statuses = fs.listStatus(root); String listStatusResult = join(statuses, "\n"); List<LocatedFileStatus> locatedStatusList = toList( fs.listLocatedStatus(root)); String locatedStatusResult = join(locatedStatusList, "\n"); assertEquals("listStatus(/) vs listLocatedStatus(/) with \n" + "listStatus =" + listStatusResult +" listLocatedStatus = " + locatedStatusResult, statuses.length, locatedStatusList.size()); List<LocatedFileStatus> fileList = toList(fs.listFiles(root, false)); String listFilesResult = join(fileList, "\n"); assertTrue("listStatus(/) vs listFiles(/, false) with \n" + "listStatus = " + listStatusResult + "listFiles = " + listFilesResult, fileList.size() <= statuses.length); List<FileStatus> statusList = (List<FileStatus>) iteratorToList( fs.listStatusIterator(root)); Assertions.assertThat(statusList) .describedAs("Result of listStatus(/) and listStatusIterator(/)" + " must match") .hasSameElementsAs(Arrays.stream(statuses) .collect(Collectors.toList())); }
Source:
Object[] generateReturnValues(Doc doc) { cntx.expressions().forEach(x -> x.setNextRow(doc)); List<Object> result = map(cntx.topLevelInputs(), Input::value); return result.isEmpty() ? null : result.toArray(); }

Target:
Object[] generateReturnValues(Doc doc) { if (inputs.isEmpty()) { return null; } expressions.forEach(x -> x.setNextRow(doc)); Object[] result = new Object[inputs.size()]; for (int i = 0; i < result.length; i++) { result[i] = inputs.get(i).value(); } return result; }
Source:
public void printHelp(ICommandSender sender) { super.printHelp(sender); World world = CommandHelpers.getWorld(sender, this); String message = StringUtil.localize("chat.bees.command.mode.current"); message = message.replaceAll("%MODE", PluginApiculture.beeInterface.getBeekeepingMode(world).getName()); message = message.replaceAll("%WORLD", String.valueOf(world.getWorldInfo().getSaveVersion())); CommandHelpers.sendChatMessage(sender, message); CommandHelpers.sendChatMessage(sender, StringUtil.localizeAndFormat("chat.bees.command.mode.help", helpString)); }

Target:
public void printHelp(ICommandSender sender) { super.printHelp(sender); World world = CommandHelpers.getWorld(sender, this); String modeName = PluginApiculture.beeInterface.getBeekeepingMode(world).getName(); String worldName = String.valueOf(world.getWorldInfo().getSaveVersion()); CommandHelpers.sendLocalizedChatMessage(sender, "for.chat.command.forestry.beekeeping.mode.info.current", modeName, worldName); CommandHelpers.sendLocalizedChatMessage(sender, "for.chat.command.forestry.beekeeping.mode.info.available", helpString); }
Source:
public void addAnnotatedType(AnnotatedType<?> type, String id) { checkWithinObserverNotification(); addSyntheticAnnotatedType(type, id); BootstrapLogger.LOG.addAnnotatedTypeCalled(receiver.getClass().getName(), type.getJavaClass()); }

Target:
public void addAnnotatedType(AnnotatedType<?> type, String id) { checkWithinObserverNotification(); addSyntheticAnnotatedType(type, id); BootstrapLogger.LOG.addAnnotatedTypeCalled(getReceiver(), type); }
Source:
public static String speedToString(float speed, Resources resources) { float kmph = (float)3.6*speed; if (kmph < 1) return String.format("%.1g %s", kmph, resources.getString(R.string.trackmgr_speed_kmph)); else if (kmph < 20) return String.format("%.1f %s", kmph, resources.getString(R.string.trackmgr_speed_kmph)); else return String.format("%d %s", Math.round(kmph), resources.getString(R.string.trackmgr_speed_kmph)); }

Target:
public static String speedToString(float speed, Resources resources) { float kmph = (float)3.6*speed; if (kmph < 1) { return resources.getString(R.string.trackmgr_speed_in_kmph).replace("{0}", String.format("%.1g", kmph)); } else if (kmph < STOP_SHOWING_DECIMALS_AFTER) { return resources.getString(R.string.trackmgr_speed_in_kmph).replace("{0}", String.format("%.1f", kmph)); } else { return resources.getString(R.string.trackmgr_speed_in_kmph).replace("{0}", String.valueOf(Math.round(kmph))); } }
Source:
public void initialize(final Query baseQuery) { transition(State.NEW, State.INITIALIZED); String queryId = baseQuery.getId(); if (Strings.isNullOrEmpty(queryId)) { queryId = UUID.randomUUID().toString(); } this.queryPlus = QueryPlus.wrap( QueryContexts.withMaxQueryTimeout( (Query) DirectDruidClient.withDefaultTimeoutAndMaxScatterGatherBytes( baseQuery.withId(queryId), serverConfig ), serverConfig.getMaxQueryTimeout()) ); this.toolChest = warehouse.getToolChest(baseQuery); }

Target:
public void initialize(final Query baseQuery) { transition(State.NEW, State.INITIALIZED); String queryId = baseQuery.getId(); if (Strings.isNullOrEmpty(queryId)) { queryId = UUID.randomUUID().toString(); } this.queryPlus = QueryPlus.wrap(baseQuery.withId(queryId)); this.toolChest = warehouse.getToolChest(baseQuery); }
Source:
public void initTable(final ImmutableList<String> columnHeads) { this.columnCount = columnHeads.size(); this.header = new ASCIITableHeader[this.columnCount]; for (int i = 0; i < this.columnCount; i++) { header[i] = (new ASCIITableHeader(columnHeads.get(i), ASCIITable.ALIGN_LEFT)); } }

Target:
public void initTable(final ImmutableList<String> columnHeads) { this.columnCount = columnHeads.size(); this.header = new ASCIITableHeader[this.columnCount]; for (int i = 0; i < this.columnCount; i++) { header[i] = new ASCIITableHeader(columnHeads.get(i), ASCIITable.ALIGN_LEFT); } }
Source:
public ProjectFeatureFlag(String name) { this(name, true, null); }

Target:
public ProjectFeatureFlag(String name) { this(notEmpty(name, "name"), true, null); }
Source:
public String toJson() { Map<String, Object> map = new HashMap<String, Object>(); map.put(FIELD_HOST, getHost()); map.put(FIELD_SHORT_MESSAGE, getShortMessage()); map.put(FIELD_FULL_MESSAGE, getFullMessage()); map.put(FIELD_TIMESTAMP, getTimestamp()); map.put(FIELD_LEVEL, getLevel()); map.put(FIELD_FACILITY, getFacility()); for (Map.Entry<String, String> additionalField : additonalFields.entrySet()) { if (!ID_NAME.equals(additionalField.getKey())) { Object value; try { value = Double.parseDouble(additionalField.getValue()); } catch (NumberFormatException ex) { value = additionalField.getValue(); } if (!stripLeadingUnderscore) { map.put("_" + additionalField.getKey(), value); } else { map.put("" + additionalField.getKey(), value); } } } return JSONValue.toJSONString(map); }

Target:
public String toJson() { return toJson("_"); }
Source:
public void valueChanged(ListSelectionEvent e) { if (!e.getValueIsAdjusting()) { int selectedRow = noteTable.convertRowIndexToModel(noteTable.getSelectedRow()); int noteID = (int) noteTable.getModel().getValueAt(selectedRow, 0); HistoryReference hr = extHist.getHistoryReference(noteID); extHist.showInHistory(hr); } }

Target:
public void valueChanged(ListSelectionEvent e) { if (!e.getValueIsAdjusting()) { if (noteTable.getSelectedRow() == -1) { return; } int selectedRow = noteTable.convertRowIndexToModel(noteTable.getSelectedRow()); int messageId = ((NotesTableModel) noteTable.getModel()).getRow(selectedRow).getMessageId(); HistoryReference hr = extHist.getHistoryReference(messageId); extHist.showInHistory(hr); } }
Source:
public void test_Ubuntu_12_0_4() throws Exception { runTest(ImmutableMap.<String,Object>of("locationId", "dal06")); }

Target:
public void test_Ubuntu_12_0_4() throws Exception { runTest(ImmutableMap.<String,Object>of("imageId", "UBUNTU_12_64")); }
Source:
private static Bitmap getCroppedCircleBitmap(Bitmap inputImage, int diameter) throws IllegalArgumentException { if (inputImage.getWidth() != inputImage.getHeight()) { throw new IllegalArgumentException(); } Bitmap scaledInputImage; if (inputImage.getWidth() != diameter || inputImage.getHeight() != diameter) { scaledInputImage = Bitmap.createScaledBitmap(inputImage, diameter, diameter, false); } else { scaledInputImage = inputImage; } Bitmap outputImage = Bitmap.createBitmap(diameter, diameter, Bitmap.Config.ARGB_8888); Rect rect = new Rect(0, 0, scaledInputImage.getWidth(), scaledInputImage.getHeight()); Paint paint = new Paint(); paint.setAntiAlias(true); paint.setFilterBitmap(true); paint.setDither(true); Canvas canvas = new Canvas(outputImage); canvas.drawARGB(0, 0, 0, 0); canvas.drawCircle(diameter / 2f, diameter / 2f, diameter / 2f, paint); paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN)); canvas.drawBitmap(scaledInputImage, rect, rect, paint); return outputImage; }

Target:
private static Bitmap getCroppedCircleBitmap(Bitmap inputImage, int diameter) { if (inputImage.getWidth() != inputImage.getHeight()) { throw new IllegalArgumentException("Image should be squared."); } Bitmap scaledInputImage; if (inputImage.getWidth() != diameter || inputImage.getHeight() != diameter) { scaledInputImage = Bitmap.createScaledBitmap(inputImage, diameter, diameter, false); } else { scaledInputImage = inputImage; } Bitmap outputImage = Bitmap.createBitmap(diameter, diameter, Bitmap.Config.ARGB_8888); Rect rect = new Rect(0, 0, scaledInputImage.getWidth(), scaledInputImage.getHeight()); Paint paint = new Paint(); paint.setAntiAlias(true); paint.setFilterBitmap(true); paint.setDither(true); Canvas canvas = new Canvas(outputImage); canvas.drawARGB(0, 0, 0, 0); canvas.drawCircle(diameter / 2f, diameter / 2f, diameter / 2f, paint); paint.setXfermode(new PorterDuffXfermode(PorterDuff.Mode.SRC_IN)); canvas.drawBitmap(scaledInputImage, rect, rect, paint); return outputImage; }
Source:
public IBinding[] findBindings(IASTName n, boolean isPrefix, String[] namespaces) { IBinding[] bindings = CPPSemantics.findBindingsForContentAssist(n, isPrefix, namespaces); List<IBinding> filtered = new ArrayList<IBinding>(); ICPPClassType classType = null; if (getParent() instanceof CPPASTCompositeTypeSpecifier) { IASTName className = ((CPPASTCompositeTypeSpecifier) getParent()).getName(); IBinding binding = className.resolveBinding(); if (binding instanceof ICPPClassType) { classType = (ICPPClassType) binding; } } for (IBinding binding : bindings) { if (binding instanceof ITypedef || binding instanceof ICPPAliasTemplate) { IType type = SemanticUtil.getNestedType((IType) binding, SemanticUtil.TDEF); if (type instanceof ICPPClassType) { if (isBaseClassCandidate(classType, (ICPPClassType) type)) filtered.add(binding); } else if (type instanceof ICPPTemplateTypeParameter) { filtered.add(binding); } } else if (binding instanceof ICPPClassType) { if (isBaseClassCandidate(classType, (ICPPClassType) binding)) filtered.add(binding); } else if (binding instanceof ICPPTemplateTypeParameter) { filtered.add(binding); } } return filtered.toArray(new IBinding[filtered.size()]); }

Target:
public IBinding[] findBindings(IASTName n, boolean isPrefix, String[] namespaces) { IBinding[] bindings = CPPSemantics.findBindingsForContentAssist(n, isPrefix, namespaces); List<IBinding> filtered = new ArrayList<IBinding>(); ICPPClassType classType = null; if (getParent() instanceof CPPASTCompositeTypeSpecifier) { IASTName className = ((CPPASTCompositeTypeSpecifier) getParent()).getName(); IBinding binding = className.resolveBinding(); if (binding instanceof ICPPClassType) { classType = (ICPPClassType) binding; } } for (IBinding binding : bindings) { if (binding instanceof IType) { IType type = (IType) binding; while (type instanceof ITypedef || type instanceof ICPPAliasTemplate) { type = (type instanceof ITypedef) ? ((ITypedef) type).getType() : ((ICPPAliasTemplate) type).getType(); } if (type instanceof ICPPClassType) { if (isBaseClassCandidate(classType, (ICPPClassType) type)) filtered.add(binding); } else if (type instanceof ICPPTemplateTypeParameter) { filtered.add(binding); } } } return filtered.toArray(new IBinding[filtered.size()]); }
Source:
public int getParameterCount(CurveName name) { for (CurveParameterSize entry : data) { if (entry.getName().equals(name)) { return entry.getParameterCount(); } } throw new IllegalArgumentException("Unable to find data for curve: " + name); }

Target:
public int getParameterCount(CurveName name) { return data.stream() .filter(entry -> entry.getName().equals(name)) .findFirst() .map(CurveParameterSize::getParameterCount) .orElseThrow(() -> new IllegalArgumentException("Unable to find data for curve: " + name)); }
Source:
protected void configure(GenericExporter exporter) { super.configure(exporter); exporter.setEmbeddableAnnotation(Embeddable.class); exporter.setEmbeddedAnnotation(Embedded.class); exporter.setEntityAnnotation(Entity.class); exporter.setSkipAnnotation(Transient.class); exporter.setSupertypeAnnotation(MappedSuperclass.class); exporter.addAnnotationHelper(new TypeFactory.AnnotationHelper() { @Override public boolean isSupported(Class<? extends Annotation> annotationClass) { return Temporal.class.isAssignableFrom(annotationClass); } @Override public Object getCustomKey(Annotation annotation) { return ((Temporal)annotation).value(); } @Override public TypeCategory getTypeByAnnotation(Class<?> cl, Annotation annotation) { switch (((Temporal)annotation).value()){ case DATE: return TypeCategory.DATE; case TIME: return TypeCategory.TIME; case TIMESTAMP: return TypeCategory.DATETIME; } return null; } }); }

Target:
protected void configure(GenericExporter exporter) { super.configure(exporter); exporter.setEmbeddableAnnotation(Embeddable.class); exporter.setEmbeddedAnnotation(Embedded.class); exporter.setEntityAnnotation(Entity.class); exporter.setSkipAnnotation(Transient.class); exporter.setSupertypeAnnotation(MappedSuperclass.class); exporter.addAnnotationHelper(JPATemporalAnnotationHelper.INSTANCE); }
Source:
void handleFinish(@Nullable HttpResponse response, @Nullable Throwable error, Span span) { if (response == null && error == null) { throw new IllegalArgumentException( "Either the response or error parameters may be null, but not both"); } if (span.isNoop()) return; long finishTimestamp = response != null ? response.finishTimestamp() : 0L; SpanCustomizer customizer = span.customizer(); try { if (error != null) errorParser.error(error, customizer); responseParser.parse(response, error, span.context(), customizer); } finally { if (finishTimestamp == 0L) { span.finish(); } else { span.finish(finishTimestamp); } } }

Target:
void handleFinish(@Nullable HttpResponse response, @Nullable Throwable error, Span span) { if (response == null && error == null) { throw new IllegalArgumentException( "Either the response or error parameters may be null, but not both"); } if (span.isNoop()) return; if (error != null) { span.error(error); if (response == null) { span.finish(); return; } } try { responseParser.parse(response, span.context(), span.customizer()); } finally { long finishTimestamp = response.finishTimestamp(); if (finishTimestamp == 0L) { span.finish(); } else { span.finish(finishTimestamp); } } }
Source:
public static double stArea(@SqlType(GEOMETRY_TYPE_NAME) Slice input) { OGCGeometry geometry = deserialize(input); return geometry.getEsriGeometry().calculateArea2D(); }

Target:
public static double stArea(@SqlType(GEOMETRY_TYPE_NAME) Slice input) { OGCGeometry geometry = deserialize(input); GeometryType type = GeometryType.getForEsriGeometryType(geometry.geometryType()); if (type == GeometryType.GEOMETRY_COLLECTION) { double area = 0.0; GeometryCursor cursor = geometry.getEsriGeometryCursor(); while (true) { com.esri.core.geometry.Geometry esriGeometry = cursor.next(); if (esriGeometry == null) { return area; } area += esriGeometry.calculateArea2D(); } } return geometry.getEsriGeometry().calculateArea2D(); }
Source:
private static void init_() { while (aorm == null) { String url = PortalConfiguration.RM_URL.getValueAsString(); String cred_path = PortalConfiguration.RM_CACHE_CREDENTIALS.getValueAsStringOrNull(); try { if (aorm == null) { rm = new RMProxyUserInterface(); aorm = PAActiveObject.turnActive(rm); if (cred_path != null && !(new File(cred_path)).exists()) { logger.error("Credentials path set in " + PortalConfiguration.RM_CACHE_CREDENTIALS.getKey() + " but file " + cred_path + " does not exist"); } if (cred_path != null && new File(cred_path).exists()) { Credentials cred = Credentials.getCredentials(cred_path); aorm.init(url, cred); } else { String login = PortalConfiguration.RM_CACHE_LOGIN.getValueAsString(); String password = PortalConfiguration.RM_CACHE_PASSWORD.getValueAsString(); aorm.init(url, new CredData(login, password)); } } } catch (Exception e) { logger.warn("Could not connect to resource manager at " + url + " retrying in 8 seconds", e); if (aorm != null) { PAActiveObject.terminateActiveObject(aorm, true); aorm = null; } new Sleeper(8 * 1000, logger).sleep(); continue; } } }

Target:
private static void init_() { while (rm == null) { String url = PortalConfiguration.RM_URL.getValueAsString(); String cred_path = PortalConfiguration.RM_CACHE_CREDENTIALS.getValueAsStringOrNull(); try { if (rm == null) { rm = PAActiveObject.newActive(RMProxyUserInterface.class, new Object[] {}); if (cred_path != null && !(new File(cred_path)).exists()) { logger.error("Credentials path set in " + PortalConfiguration.RM_CACHE_CREDENTIALS.getKey() + " but file " + cred_path + " does not exist"); } if (cred_path != null && new File(cred_path).exists()) { Credentials cred = Credentials.getCredentials(cred_path); rm.init(url, cred); } else { String login = PortalConfiguration.RM_CACHE_LOGIN.getValueAsString(); String password = PortalConfiguration.RM_CACHE_PASSWORD.getValueAsString(); rm.init(url, new CredData(login, password)); } } } catch (Exception e) { logger.warn("Could not connect to resource manager at " + url + " retrying in 8 seconds", e); if (rm != null) { PAActiveObject.terminateActiveObject(rm, true); rm = null; } new Sleeper(8 * 1000, logger).sleep(); continue; } } }
Source:
public void addIntermediate(GroupByIdBlock groupIdsBlock, Block block) { checkState(rawInputs != null && blockBuilders == null); checkState(block instanceof ArrayBlock); ArrayBlock arrayBlock = (ArrayBlock) block; ColumnarArray columnarArray = toColumnarArray(block); ColumnarRow columnarRow = toColumnarRow(columnarArray.getElementsBlock()); int newPositionCount = columnarRow.getPositionCount(); long[] newGroupIds = new long[newPositionCount]; boolean[] nulls = new boolean[newPositionCount]; int currentRowBlockIndex = 0; for (int groupIdPosition = 0; groupIdPosition < groupIdsBlock.getPositionCount(); groupIdPosition++) { for (int unused = 0; unused < arrayBlock.getBlock(groupIdPosition).getPositionCount(); unused++) { newGroupIds[currentRowBlockIndex] = groupIdsBlock.getGroupId(groupIdPosition); nulls[currentRowBlockIndex] = groupIdsBlock.isNull(groupIdPosition); currentRowBlockIndex++; } } Block[] blocks = new Block[spillingTypes.size()]; for (int channel = 0; channel < spillingTypes.size(); channel++) { blocks[channel] = columnarRow.getField(channel); } Page page = new Page(blocks); GroupByIdBlock squashedGroupIds = new GroupByIdBlock(groupIdsBlock.getGroupCount(), new LongArrayBlock(newPositionCount, Optional.of(nulls), newGroupIds)); rawInputsSize += page.getSizeInBytes(); rawInputs.add(new GroupIdPage(squashedGroupIds, page)); }

Target:
public void addIntermediate(GroupByIdBlock groupIdsBlock, Block block) { checkState(rawInputs != null && blockBuilders == null); checkState(block instanceof ArrayBlock); ArrayBlock arrayBlock = (ArrayBlock) block; ColumnarArray columnarArray = toColumnarArray(block); ColumnarRow columnarRow = toColumnarRow(columnarArray.getElementsBlock()); int newPositionCount = columnarRow.getPositionCount(); long[] newGroupIds = new long[newPositionCount]; boolean[] nulls = new boolean[newPositionCount]; int currentRowBlockIndex = 0; for (int groupIdPosition = 0; groupIdPosition < groupIdsBlock.getPositionCount(); groupIdPosition++) { for (int unused = 0; unused < arrayBlock.getBlock(groupIdPosition).getPositionCount(); unused++) { newGroupIds[currentRowBlockIndex] = groupIdsBlock.getGroupId(groupIdPosition); nulls[currentRowBlockIndex] = groupIdsBlock.isNull(groupIdPosition); currentRowBlockIndex++; } } Block[] blocks = new Block[spillingTypes.size()]; for (int channel = 0; channel < spillingTypes.size(); channel++) { blocks[channel] = columnarRow.getField(channel); } Page page = new Page(blocks); GroupByIdBlock squashedGroupIds = new GroupByIdBlock(groupIdsBlock.getGroupCount(), new LongArrayBlock(newPositionCount, Optional.of(nulls), newGroupIds)); rawInputs.ensureCapacity(rawInputsLength); rawInputs.set(rawInputsLength, new GroupIdPage(squashedGroupIds, page)); rawInputsLength++; }
Source:
@Override public void onCompleted() { if (!terminated) { subscriber.onCompleted(); } }

Target:
@Override public void onCompleted() { if (!subscriberTerminated) { subscriber.onCompleted(); } }
Source:
private void createPresenterUiHandlers() { if (!presenterConfigModel.isUseAddUihandlers()) { return; } RenderedTemplate renderedTemplate = null; if (presenterConfigModel.getNestedPresenter()) { renderedTemplate = createdNestedPresenterTemplates.getUihandlers(); } else if (presenterConfigModel.getPresenterWidget()) { renderedTemplate = createdPresenterWidgetTemplates.getUihandlers(); } else if (presenterConfigModel.getPopupPresenter()) { renderedTemplate = createdPopupPresenterTemplates.getUihandlers(); } PsiClass createdPsiClass = createPsiClass(createdPresenterPackage, renderedTemplate); createdPsiClass.navigate(true); }

Target:
private void createPresenterUiHandlers() { if (!presenterConfigModel.isUseAddUihandlers()) { return; } RenderedTemplate renderedTemplate = null; if (presenterConfigModel.getNestedPresenter()) { renderedTemplate = createdNestedPresenterTemplates.getUihandlers(); } else if (presenterConfigModel.getPresenterWidget()) { renderedTemplate = createdPresenterWidgetTemplates.getUihandlers(); } else if (presenterConfigModel.getPopupPresenter()) { renderedTemplate = createdPopupPresenterTemplates.getUihandlers(); } PsiClass createdPsiClass = createPsiClass(createdPresenterPackage, renderedTemplate); navigateToClass(createdPsiClass); }
Source:
public void onEditFailure(@NonNull Throwable caught) { showProgressBar(false); if (caught instanceof MwException) { handleEditingException((MwException) caught); L.e(caught); } else { showRetryDialog(caught); L.e(caught); } }

Target:
public void onEditFailure(@NonNull Throwable caught) { showProgressBar(false); if (caught instanceof MwException) { handleEditingException((MwException) caught); } else { showRetryDialog(caught); } L.e(caught); }
Source:
public boolean isCurrentlyRead() { if (!getMarkedReadAt().isPresent()) { return false; } if (getUpdatedAt() == null) { return getMarkedReadAt().get().isAfter(getCreatedAt()); } return getMarkedReadAt().get().isAfter(getUpdatedAt()); }

Target:
public boolean isCurrentlyRead() { if (!getMarkedReadAt().isPresent()) { return false; } return getMarkedReadAt().get().isAfter(getUpdatedAt()); }
Source:
protected void applyReceiveOnlyAdviceChain(Collection<Advice> chain) { if (AopUtils.isAopProxy(this.source)) { Advisor[] advisors = ((Advised) this.source).getAdvisors(); for (Advisor advisor : advisors) { Advice advice = advisor.getAdvice(); if (advice != null && this.appliedAdvices.contains(advice)) { ((Advised) this.source).removeAdvice(advice); } } for (Advice advice : chain) { NameMatchMethodPointcutAdvisor sourceAdvice = new NameMatchMethodPointcutAdvisor(advice); sourceAdvice.addMethodName("receive"); ((Advised) this.source).addAdvice(advice); } } else { ProxyFactory proxyFactory = new ProxyFactory(this.source); for (Advice advice : chain) { proxyFactory.addAdvice(advice); } this.source = (MessageSource<?>) proxyFactory.getProxy(getBeanClassLoader()); } this.appliedAdvices.clear(); this.appliedAdvices.addAll(chain); }

Target:
protected void applyReceiveOnlyAdviceChain(Collection<Advice> chain) { if (AopUtils.isAopProxy(this.source)) { for (Advice advice : this.appliedAdvices) { ((Advised) this.source).removeAdvice(advice); } for (Advice advice : chain) { NameMatchMethodPointcutAdvisor sourceAdvisor = new NameMatchMethodPointcutAdvisor(advice); sourceAdvisor.addMethodName("receive"); ((Advised) this.source).addAdvisor(sourceAdvisor); } } else { ProxyFactory proxyFactory = new ProxyFactory(this.source); for (Advice advice : chain) { proxyFactory.addAdvice(advice); } this.source = (MessageSource<?>) proxyFactory.getProxy(getBeanClassLoader()); } this.appliedAdvices.clear(); this.appliedAdvices.addAll(chain); }
Source:
List<InputRow> readAllRows(InputEntityReader reader) throws IOException { List<InputRow> rows = new ArrayList<>(); try (CloseableIterator<InputRow> iterator = reader.read()) { while (iterator.hasNext()) { rows.add(iterator.next()); } } return rows; }

Target:
List<InputRow> readAllRows(InputEntityReader reader) throws IOException { List<InputRow> rows = new ArrayList<>(); try (CloseableIterator<InputRow> iterator = reader.read()) { iterator.forEachRemaining(rows::add); } return rows; }
Source:
public double interestingness() { if (content.isEmpty() || content instanceof SegmentStringCollapsed) { return 0; } final String uninteresting = "N"; final String rawContent = content.toString(); final String cleanContent = rawContent.replace(uninteresting, ""); double contentScore = (rawContent.length() + cleanContent.length()) / 2.0; return contentScore / sources.size(); }

Target:
public double interestingness() { if (content.isEmpty()) { return 0; } final String uninteresting = "N"; final String rawContent = content.toString(); final String cleanContent = rawContent.replace(uninteresting, ""); double contentScore = (rawContent.length() + cleanContent.length()) / 2.0; return contentScore / sources.size(); }
Source:
public void testDecodeLiteralResponse() throws Exception { final String literalResponse = "* 1 FETCH {10}\r\n" + "abcdefgh\r\n" + "\r\n"; final byte[] responseBytes = literalResponse.getBytes(StandardCharsets.US_ASCII); final ByteBuf buffer = Unpooled.copiedBuffer(responseBytes, 0, responseBytes.length); final ImapClientRespReader respReader = new ImapClientRespReader(Integer.MAX_VALUE); final ByteBuf resultBuf = (ByteBuf) respReader.decode(null, buffer); final String result = resultBuf.toString(StandardCharsets.US_ASCII); Assert.assertEquals(result, literalResponse); }

Target:
public void testDecodeLiteralResponse() throws Exception { final String literalResponse = "* 1 FETCH BODY[HEADER] {10}\r\n" + "he: ader\r\n" + "\r\n"; final byte[] responseBytes = literalResponse.getBytes(StandardCharsets.US_ASCII); final ByteBuf buffer = Unpooled.copiedBuffer(responseBytes, 0, responseBytes.length); final ImapClientRespReader respReader = new ImapClientRespReader(Integer.MAX_VALUE); final ByteBuf resultBuf = (ByteBuf) respReader.decode(null, buffer); final String result = resultBuf.toString(StandardCharsets.US_ASCII); Assert.assertEquals(result, literalResponse); }
Source:
private Map<String, ResourceAssignment> getBaselineAssignment( AssignmentMetadataStore assignmentMetadataStore, CurrentStateOutput currentStateOutput, Set<String> resources) throws HelixRebalanceException { Map<String, ResourceAssignment> currentBaseline = Collections.emptyMap(); if (assignmentMetadataStore != null) { try { _metricCollector.getMetric( WagedRebalancerMetricCollector.WagedRebalancerMetricNames.StateReadLatencyGauge.name(), LatencyMetric.class).startMeasuringLatency(); currentBaseline = assignmentMetadataStore.getBaseline(); _metricCollector.getMetric( WagedRebalancerMetricCollector.WagedRebalancerMetricNames.StateReadLatencyGauge.name(), LatencyMetric.class).endMeasuringLatency(); } catch (HelixException ex) { LOG.error("Failed to get the current baseline assignment.", ex); } catch (Exception ex) { throw new HelixRebalanceException( "Failed to get the current baseline assignment because of unexpected error.", HelixRebalanceException.Type.INVALID_REBALANCER_STATUS, ex); } } if (currentBaseline.isEmpty()) { LOG.warn("The current baseline assignment record is empty. Use the current states instead."); currentBaseline = getCurrentStateAssingment(currentStateOutput, resources); } return currentBaseline; }

Target:
private Map<String, ResourceAssignment> getBaselineAssignment( AssignmentMetadataStore assignmentMetadataStore, CurrentStateOutput currentStateOutput, Set<String> resources) throws HelixRebalanceException { Map<String, ResourceAssignment> currentBaseline = Collections.emptyMap(); if (assignmentMetadataStore != null) { try { LatencyMetric stateReadLatency = _metricCollector.getMetric( WagedRebalancerMetricCollector.WagedRebalancerMetricNames.StateReadLatencyGauge.name(), LatencyMetric.class); stateReadLatency.startMeasuringLatency(); currentBaseline = assignmentMetadataStore.getBaseline(); stateReadLatency.endMeasuringLatency(); } catch (HelixException ex) { LOG.error("Failed to get the current baseline assignment.", ex); } catch (Exception ex) { throw new HelixRebalanceException( "Failed to get the current baseline assignment because of unexpected error.", HelixRebalanceException.Type.INVALID_REBALANCER_STATUS, ex); } } if (currentBaseline.isEmpty()) { LOG.warn("The current baseline assignment record is empty. Use the current states instead."); currentBaseline = getCurrentStateAssingment(currentStateOutput, resources); } return currentBaseline; }
Source:
private DocumentMetadata.Builder handlePersons(Result result, DocumentMetadata.Builder builder) throws IOException { if (CollectionUtils.isNotEmpty(result.getAuthor())) { List<Author> authors = new ArrayList<>(); for (eu.dnetlib.dhp.schema.oaf.Author sourceAuthor : result.getAuthor()) { Author.Builder authorBuilder = Author.newBuilder(); handleName(sourceAuthor.getName(), authorBuilder); handleSurname(sourceAuthor.getSurname(), authorBuilder); handleFullName(sourceAuthor.getFullname(), authorBuilder); if (isDataValid(authorBuilder)) { authors.add(authorBuilder.build()); } } if (!authors.isEmpty()) { builder.setAuthors(authors); } } return builder; }

Target:
private static void handlePersons(Result result, DocumentMetadata.Builder builder) throws IOException { if (CollectionUtils.isNotEmpty(result.getAuthor())) { List<Author> authors = result.getAuthor().stream().map(sourceAuthor -> { Author.Builder authorBuilder = Author.newBuilder(); handleName(sourceAuthor.getName(), authorBuilder); handleSurname(sourceAuthor.getSurname(), authorBuilder); handleFullName(sourceAuthor.getFullname(), authorBuilder); return authorBuilder; }).filter(DocumentMetadataConverter::isDataValid).map(Author.Builder::build).collect(Collectors.toList()); if (!authors.isEmpty()) { builder.setAuthors(authors); } } }
Source:
static ThriftDDL filterThriftDDL(ThriftDDL thriftDDL, List<HiveColumnHandle> columns) { if (thriftDDL == null || thriftDDL.getFields() == null || thriftDDL.getFields().isEmpty()) { return thriftDDL; } Set<String> columnNames = new HashSet<>(); for (HiveColumnHandle column : columns) { columnNames.add(column.getName()); } thriftDDL.setFields(thriftDDL.getFields().stream().filter(field -> columnNames.contains(field.getName())).collect(Collectors.toList())); return thriftDDL; }

Target:
private static ThriftDDL filterThriftDDL(ThriftDDL thriftDDL, List<HiveColumnHandle> columns) { if (thriftDDL == null) { return null; } List<ThriftField> fields = thriftDDL.getFields(); if (fields == null || fields.isEmpty()) { return thriftDDL; } Set<String> columnNames = columns.stream() .map(HiveColumnHandle::getName) .collect(toImmutableSet()); List<ThriftField> filteredFields = fields.stream() .filter(field -> columnNames.contains(field.getName())) .collect(toList()); thriftDDL.setFields(filteredFields); return thriftDDL; }
Source:
public Domain call() throws LibvirtException { long flags = VIR_MIGRATE_LIVE; if (dconn.getLibVirVersion() >= 1000003) { flags += VIR_MIGRATE_COMPRESSED; } if (migrateStorage) { flags += VIR_MIGRATE_NON_SHARED_DISK; } if (autoConvergence && dconn.getLibVirVersion() >= 1002003) { flags += VIR_MIGRATE_AUTO_CONVERGE; } return dm.migrate(dconn, flags, dxml, vmName, "tcp:" + destIp, libvirtComputingResource.getMigrateSpeed()); }

Target:
public Domain call() throws LibvirtException { long flags = VIR_MIGRATE_LIVE; if (dconn.getLibVirVersion() >= LIBVIRT_VERSION_SUPPORTS_MIGRATE_COMPRESSED) { flags += VIR_MIGRATE_COMPRESSED; } if (migrateStorage) { flags += VIR_MIGRATE_NON_SHARED_DISK; } if (autoConvergence && dconn.getLibVirVersion() >= 1002003) { flags += VIR_MIGRATE_AUTO_CONVERGE; } return dm.migrate(dconn, flags, dxml, vmName, "tcp:" + destIp, libvirtComputingResource.getMigrateSpeed()); }
Source:
public CoreGenerator(Path projectRoot) { this.jpCoreSourceRoot = getSourceRootForJpModule(projectRoot, "javaparser-core"); this.jssLogicSourceRoot = getSourceRootForJpModule(projectRoot, "javaparser-symbol-solver-logic"); this.jssModelSourceRoot = getSourceRootForJpModule(projectRoot, "javaparser-symbol-solver-model"); this.jssSourceRoot = getSourceRootForJpModule(projectRoot, "javaparser-symbol-solver-core"); final Path generatedJavaCcRoot = projectRoot.resolve("javaparser-core").resolve("target").resolve("generated-sources").resolve("javacc"); this.generatedJavaCcSourceRoot = new SourceRoot(generatedJavaCcRoot, parserConfiguration); this.sourceRoots = new ArrayList<>(7); this.sourceRoots.add(this.jpCoreSourceRoot); this.sourceRoots.add(this.jssLogicSourceRoot); this.sourceRoots.add(this.jssModelSourceRoot); this.sourceRoots.add(this.jssSourceRoot); this.sourceRoots.add(this.generatedJavaCcSourceRoot); }

Target:
public CoreGenerator(Path projectRoot) { jpCoreSourceRoot = getSourceRootForJpModule(projectRoot, "javaparser-core"); jssLogicSourceRoot = getSourceRootForJpModule(projectRoot, "javaparser-symbol-solver-logic"); jssModelSourceRoot = getSourceRootForJpModule(projectRoot, "javaparser-symbol-solver-model"); jssSourceRoot = getSourceRootForJpModule(projectRoot, "javaparser-symbol-solver-core"); final Path generatedJavaCcRoot = projectRoot.resolve("javaparser-core").resolve("target").resolve("generated-sources").resolve("javacc"); generatedJavaCcSourceRoot = new SourceRoot(generatedJavaCcRoot, parserConfiguration); sourceRoots = new ArrayList<>(7); sourceRoots.add(jpCoreSourceRoot); sourceRoots.add(jssLogicSourceRoot); sourceRoots.add(jssModelSourceRoot); sourceRoots.add(jssSourceRoot); sourceRoots.add(generatedJavaCcSourceRoot); }