auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private Map<Locator, MetricData> getEnumMetricDataForRangeForLocatorList(final List<Locator> locators, final Range range, final String columnFamily) { if (range.getStart() > range.getStop()) { throw new IllegalArgumentException(String.format("invalid range: ", range.toString())); } Future<Table<Locator, Long, String>> enumHashValuesFuture = taskExecutor.submit(new Callable() { @Override public Table<Locator, Long, String> call() throws Exception { return enumReader.getEnumHashValuesForLocators(locators); } }); Future<Table<Locator, Long, Object>> enumHashRollupFuture = taskExecutor.submit(new Callable() { @Override public Table<Locator, Long, Object> call() throws Exception { return enumReader.getEnumRollupsForLocators(locators, columnFamily, range); } }); Map<Locator, MetricData> resultMap = new HashMap<Locator, MetricData>(); try { Table<Locator, Long, String> enumHashValues = enumHashValuesFuture.get(); Table<Locator, Long, Object> enumHashRollup = enumHashRollupFuture.get(); for (Locator locator : locators) { populateEnumValueToCountMap(enumHashRollup.row(locator), enumHashValues.row(locator)); Points points = convertToPoints(enumHashRollup.row(locator)); MetricData metricData = new MetricData(points, getUnitString(locator), MetricData.Type.ENUM); resultMap.put(locator, metricData); } } catch (InterruptedException e) { LOG.error("Interrupted while reading Enum metrics for locators " + locators, e); } catch (ExecutionException e) { LOG.error("Execution error while reading Enum metrics for locators " + locators, e); } return resultMap; }

Target:
private Map<Locator, MetricData> getEnumMetricDataForRangeForLocatorList(final List<Locator> locators, final Range range, final String columnFamily) { if (range.getStart() > range.getStop()) { throw new IllegalArgumentException(String.format("invalid range: ", range.toString())); } Future<Table<Locator, Long, String>> enumHashValuesFuture = taskExecutor.submit(new Callable() { @Override public Table<Locator, Long, String> call() throws Exception { return enumReader.getEnumHashValuesForLocators(locators); } }); Future<Table<Locator, Long, BluefloodEnumRollup>> enumHashRollupFuture = taskExecutor.submit(new Callable() { @Override public Table<Locator, Long, BluefloodEnumRollup> call() throws Exception { return enumReader.getEnumRollupsForLocators(locators, columnFamily, range); } }); Map<Locator, MetricData> resultMap = new HashMap<Locator, MetricData>(); try { Table<Locator, Long, String> enumHashValues = enumHashValuesFuture.get(); Table<Locator, Long, BluefloodEnumRollup> enumHashRollup = enumHashRollupFuture.get(); for (Locator locator : locators) { populateEnumValueToCountMap(enumHashRollup.row(locator), enumHashValues.row(locator)); Points points = convertToPoints(enumHashRollup.row(locator)); MetricData metricData = new MetricData(points, getUnitString(locator), MetricData.Type.ENUM); resultMap.put(locator, metricData); } } catch (InterruptedException e) { LOG.error("Interrupted while reading Enum metrics for locators " + locators, e); } catch (ExecutionException e) { LOG.error("Execution error while reading Enum metrics for locators " + locators, e); } return resultMap; }
Source:
public Configuration getConfiguration(GraphContext context) { return ConfigurationBuilder .begin() .addRule() .perform(new GraphOperation() { @Override public void perform(GraphRewrite event, EvaluationContext context) { TagService tagService = tagServiceHolder.getTagService(); System.out.println("TagService: " + tagService); ReportService reportService = new ReportService(event.getGraphContext()); Path outputDir = Paths.get(reportService.getReportDirectory()); File tagsDataFile = outputDir.resolve("resources/tagsData.js").toFile(); try { FileUtils.forceMkdir(tagsDataFile.getParentFile()); } catch (IOException ex) { LOG.severe("Error creating a directory: " + tagsDataFile.getParentFile().getPath()); return; } try(FileWriter writer = new FileWriter(tagsDataFile)) { tagService.dumpTagsToJavaScript(writer); LOG.info("Exporting tags data to file: " + tagsDataFile.getPath()); } catch (IOException e) { LOG.severe("Error exporting tags data to: " + tagsDataFile.getPath()); return; } } }); }

Target:
public Configuration getConfiguration(GraphContext context) { return ConfigurationBuilder .begin() .addRule() .perform(new GraphOperation() { @Override public void perform(GraphRewrite event, EvaluationContext context) { TagService tagService = tagServiceHolder.getTagService(); ReportService reportService = new ReportService(event.getGraphContext()); Path outputDir = Paths.get(reportService.getReportDirectory()); File tagsDataFile = outputDir.resolve("resources/tagsData.js").toFile(); try { FileUtils.forceMkdir(tagsDataFile.getParentFile()); } catch (IOException ex) { LOG.severe("Error creating a directory: " + tagsDataFile.getParentFile().getPath()); return; } try(FileWriter writer = new FileWriter(tagsDataFile)) { tagService.dumpTagsToJavaScript(writer); LOG.info("Exporting tags data to file: " + tagsDataFile.getPath()); } catch (IOException e) { LOG.severe("Error exporting tags data to: " + tagsDataFile.getPath()); return; } } }); }
Source:
private void setFrameTitle() { String title = Messages.getString("BoardEditor.title"); if (curfile != null) { title = Messages.getString("BoardEditor.title") + curfile; } boolean isChanged = !undoStack.isEmpty(); frame.setTitle(title + (isChanged ? "*" : "")); }

Target:
private void setFrameTitle() { String title = Messages.getString("BoardEditor.title"); if (curfile != null) { title = Messages.getString("BoardEditor.title0", curfile); } frame.setTitle(title + (hasChanges ? "*" : "")); }
Source:
public PRowImpl(ImmutableBytesWritable key, long ts, Integer bucketNum) { this.ts = ts; if (bucketNum != null) { this.key = SaltingUtil.getSaltedKey(key, bucketNum); } else { this.key = key.copyBytes(); } this.setValues = new Put(this.key); this.unsetValues = new Delete(this.key); }

Target:
public PRowImpl(ImmutableBytesWritable key, long ts, Integer bucketNum) { this.ts = ts; if (bucketNum != null) { this.key = SaltingUtil.getSaltedKey(key, bucketNum); } else { this.key = ByteUtil.copyKeyBytesIfNecessary(key); } this.setValues = new Put(this.key); this.unsetValues = new Delete(this.key); }
Source:
public boolean performNextOperation(int completedChildCount) { if (getParameters().getNextPhase() == ImportRepoImageParameters.Phase.DOWNLOAD) { Backend.getInstance().runInternalAction(VdcActionType.DownloadImage, createDownloadImageParameters(), ExecutionHandler.createDefaultContextForTasks(getContext())); getParameters().setNextPhase(ImportRepoImageParameters.Phase.END); persistCommand(getParameters().getParentCommand(), true); return true; } return false; }

Target:
public boolean performNextOperation(int completedChildCount) { if (getParameters().getNextPhase() == ImportRepoImageParameters.Phase.DOWNLOAD) { getParameters().setNextPhase(ImportRepoImageParameters.Phase.END); persistCommand(getParameters().getParentCommand(), true); Backend.getInstance().runInternalAction(VdcActionType.DownloadImage, createDownloadImageParameters(), ExecutionHandler.createDefaultContextForTasks(getContext())); return true; } return false; }
Source:
public JSONObject validateVariant(String id) { String url = null; try { url = SERVICE_URL + URLEncoder.encode(id, "UTF-8"); } catch (UnsupportedEncodingException e) { e.printStackTrace(); } HttpGet method = new HttpGet(url); method.setHeader(HttpHeaders.ACCEPT, ContentType.APPLICATION_JSON.getMimeType()); try (CloseableHttpResponse httpResponse = this.client.execute(method)) { String response = IOUtils.toString(httpResponse.getEntity().getContent(), Consts.UTF_8); JSONObject responseJSON = (JSONObject) JSONSerializer.toJSON(response); return responseJSON; } catch (IOException | JSONException ex) { this.logger.warn("Failed to validate HGVS variant symbol id: {}", ex.getMessage()); } return new JSONObject(true); }

Target:
public JSONObject validateVariant(String id) { String safeID; try { safeID = URLEncoder.encode(id, Consts.UTF_8.name()); } catch (UnsupportedEncodingException e) { safeID = id.replaceAll("\\s", ""); this.logger.warn("Could not find the encoding: {}", Consts.UTF_8.name()); } HttpGet method = new HttpGet(SERVICE_URL + safeID); method.setHeader(HttpHeaders.ACCEPT, ContentType.APPLICATION_JSON.getMimeType()); try (CloseableHttpResponse httpResponse = this.client.execute(method)) { String response = IOUtils.toString(httpResponse.getEntity().getContent(), Consts.UTF_8); JSONObject responseJSON = (JSONObject) JSONSerializer.toJSON(response); return responseJSON; } catch (IOException | JSONException ex) { this.logger.warn("Failed to validate HGVS variant symbol id: {}", ex.getMessage()); } return new JSONObject(true); }
Source:
private GlusterVolumeTaskStatus getAggregateStatus(Map<String, Object> aggregateStatus) { GlusterVolumeTaskStatus status = new GlusterVolumeTaskStatus(); status.setFilesScanned(Integer.parseInt((String)aggregateStatus.get(FILES_SCANNED))); status.setFilesMoved(Integer.parseInt((String)aggregateStatus.get(FILES_MOVED))); status.setFilesSkipped(Integer.parseInt((String)aggregateStatus.get(FILES_SKIPPED))); status.setFilesFailed(Integer.parseInt((String)aggregateStatus.get(FILES_FAILED))); status.setTotalSizeMoved(Long.parseLong((String)aggregateStatus.get(TOTAL_SIZE_MOVED))); status.setStatus(JobExecutionStatus.valueOf((String)aggregateStatus.get(STATUS))); return status; }

Target:
private GlusterVolumeTaskStatus getAggregateStatus(Map<String, Object> aggregateStatus) { GlusterVolumeTaskStatus status = new GlusterVolumeTaskStatus(); status.setFilesScanned(Integer.parseInt((String)aggregateStatus.get(FILES_SCANNED))); status.setFilesMoved(Integer.parseInt((String)aggregateStatus.get(FILES_MOVED))); status.setFilesFailed(Integer.parseInt((String)aggregateStatus.get(FILES_FAILED))); status.setTotalSizeMoved(Long.parseLong((String)aggregateStatus.get(TOTAL_SIZE_MOVED))); status.setStatus(JobExecutionStatus.valueOf((String)aggregateStatus.get(STATUS))); return status; }
Source:
public void testFindDockerConnection() { MockCDKDockerUtility util = new MockCDKDockerUtility("name1"); try { ADBInfo adb = createADB(); ADBInfo wrongHost = createADB("10.1.2.3"); ADBInfo wrongPort = createADB("10.1.2.2", "500"); assertFalse(util.dockerConnectionExists(adb)); IDockerConnection con = util.createDockerConnection(null, adb); assertTrue(util.dockerConnectionExists(adb)); assertFalse(util.dockerConnectionExists(wrongHost)); assertFalse(util.dockerConnectionExists(wrongPort)); DockerConnectionManager mgr = org.eclipse.linuxtools.docker.core.DockerConnectionManager.getInstance(); mgr.removeConnection(con); assertFalse(util.dockerConnectionExists(adb)); } catch(URISyntaxException urise) { fail(urise.getMessage()); } catch(DockerException de) { fail(de.getMessage()); } }

Target:
public void testFindDockerConnection() throws Exception { DockerConnectionManager mgr = org.eclipse.linuxtools.docker.core.DockerConnectionManager.getInstance(); IDockerConnection con = null; try { MockCDKDockerUtility util = new MockCDKDockerUtility("name1"); ADBInfo adb = createADB(); ADBInfo wrongHost = createADB("10.1.2.3"); ADBInfo wrongPort = createADB("10.1.2.2", "500"); assertTrue(mgr.getConnections().length == 0); assertFalse(util.dockerConnectionExists(adb)); con = util.createDockerConnection(null, adb); assertTrue(util.dockerConnectionExists(adb)); assertFalse(util.dockerConnectionExists(wrongHost)); assertFalse(util.dockerConnectionExists(wrongPort)); mgr.removeConnection(con); assertFalse(util.dockerConnectionExists(adb)); assertTrue(mgr.getConnections().length == 0); } finally { if( con != null ) { mgr.removeConnection(con); } } }
Source:
public void setMemoryPool(MemoryPool pool) { synchronized (queryMemoryContext) { synchronized (this) { requireNonNull(pool, "pool is null"); if (memoryPool == pool) { return; } MemoryPool originalPool = memoryPool; long originalReserved = queryMemoryContext.getUserMemory(); long originalRevocableReserved = queryMemoryContext.getRevocableMemory(); memoryPool = pool; ListenableFuture<?> future = pool.reserve(queryId, originalReserved); originalPool.free(queryId, originalReserved); pool.reserveRevocable(queryId, originalRevocableReserved); originalPool.freeRevocable(queryId, originalRevocableReserved); future.addListener(() -> { taskContexts.values().forEach(TaskContext::moreMemoryAvailable); }, directExecutor()); } } }

Target:
public synchronized void setMemoryPool(MemoryPool pool) { requireNonNull(pool, "pool is null"); if (memoryPool == pool) { return; } MemoryPool originalPool = memoryPool; long originalReserved = originalPool.getQueryUserMemoryReservation(queryId); long originalRevocableReserved = originalPool.getQueryRevocableMemoryReservation(queryId); memoryPool = pool; ListenableFuture<?> future = pool.reserve(queryId, originalReserved); originalPool.free(queryId, originalReserved); pool.reserveRevocable(queryId, originalRevocableReserved); originalPool.freeRevocable(queryId, originalRevocableReserved); future.addListener(() -> { taskContexts.values().forEach(TaskContext::moreMemoryAvailable); }, directExecutor()); }
Source:
public static Group deserialize(JsonArray jsonArray, JsonDeserializationContext context) { Group.Builder builder = new Group.Builder(); for (JsonElement item : jsonArray) { Component component = context.deserialize(item, ComponentsTypeProvider .getClassOfComponentType(getTypeFromJsonElement(item))); if (!(component instanceof Undefined)) { builder.addItem(component); } } return builder.create(); }

Target:
public static Group deserialize(JsonArray jsonArray, JsonDeserializationContext context) { Group.Builder builder = new Group.Builder(); for (JsonElement item : jsonArray) { Component component = deserializeComponent(item, context); if (component != null) { builder.addItem(component); } } return builder.create(); }
Source:
private void setColorForBatDuration(IFactionPlayer player) { float batPercentage = ((IVampirePlayer) player).getActionHandler().getPercentageForAction(VampireActions.bat); if (batPercentage < 0.1F && batPercentage > 0.0F) { screenBottomColor = 0xcc7067f9; screenBottomPercentage = (int) (0.1F - batPercentage * 10); fullScreen = false; } else { screenBottomColor = 0; screenBottomPercentage = 0; } }

Target:
private void setColorForBatDuration(IFactionPlayer player) { float batPercentage = ((IVampirePlayer) player).getActionHandler().getPercentageForAction(VampireActions.bat); if (batPercentage < 0.2F && batPercentage > 0.0F) { screenBottomColor = 0xcc7067f9; screenBottomPercentage = (int) ((0.2F - batPercentage) * 1000); fullScreen = false; } else { screenBottomColor = 0; screenBottomPercentage = 0; } }
Source:
public void testCaseWhenRound() throws Exception { ResultSet res = executeString( "select * from (select n_nationkey as key, " + "case when n_nationkey > 6 then round((n_nationkey * 100 / 2.123) / (n_regionkey * 50 / 2.123), 2) else 100.0 end as val " + "from nation where n_regionkey > 0 and n_nationkey > 0) a " + "order by a.key" ); String expected = "key,val\n" + "-------------------------------\n" + "1,100.0\n" + "2,100.0\n" + "3,100.0\n" + "4,100.0\n" + "6,100.0\n" + "7,4.67\n" + "8,8.0\n" + "9,9.0\n" + "10,5.0\n" + "11,5.5\n" + "12,12.0\n" + "13,6.5\n" + "17,34.0\n" + "18,18.0\n" + "19,12.67\n" + "20,10.0\n" + "21,21.0\n" + "22,14.67\n" + "23,15.33\n" + "24,48.0\n"; assertEquals(expected, resultSetToString(res)); res.close(); }

Target:
public void testCaseWhenRound() throws Exception { ResultSet res = executeQuery(); assertResultSet(res); cleanupQuery(res); }
Source:
public models.internal.reports.Report toInternal() { final Collection<RecipientGroup> groups = recipientGroups .stream() .map(ReportRecipientGroup::toInternal) .collect(Collectors.collectingAndThen(Collectors.toSet(), ImmutableSet::copyOf)); return new DefaultReport.Builder() .setId(uuid) .setName(name) .setRecipientGroups(ImmutableSet.copyOf(groups)) .setSchedule(schedule.toInternal()) .setReportSource(reportSource.toInternal()) .build(); }

Target:
public models.internal.reports.Report toInternal() { final ImmutableSetMultimap<models.internal.reports.ReportFormat, models.internal.reports.Recipient> internalRecipients = recipientAssocs .stream() .collect(ImmutableSetMultimap.toImmutableSetMultimap(this::assocToFormat, this::assocToRecipient)); return new DefaultReport.Builder() .setId(uuid) .setName(name) .setRecipients(internalRecipients) .setSchedule(schedule.toInternal()) .setReportSource(reportSource.toInternal()) .build(); }
Source:
public NetworkStats getNetworkStatsDetail() { mContext.enforceCallingOrSelfPermission(CONNECTIVITY_INTERNAL, TAG); try { return mStatsFactory.readNetworkStatsDetail(UID_ALL, null, TAG_ALL); } catch (IOException e) { throw new IllegalStateException(e); } }

Target:
public NetworkStats getNetworkStatsDetail() { mContext.enforceCallingOrSelfPermission(CONNECTIVITY_INTERNAL, TAG); try { return mStatsFactory.readNetworkStatsDetail(); } catch (IOException e) { throw new IllegalStateException(e); } }
Source:
public void cleanUp(MMenu menuModel) { ContributionRecord record = getContributionRecord(menuModel); if (record != null) { if (record.menuModel == menuModel) { record.dispose(); for (MMenuElement copy : record.generatedElements) { cleanUpCopy(record, copy); } for (MMenuElement copy : record.sharedElements) { cleanUpCopy(record, copy); } record.generatedElements.clear(); record.sharedElements.clear(); removeContributionRecord(menuModel); } } }

Target:
public void cleanUp(MMenu menuModel) { Collection<ContributionRecord> vals = getList(menuModel); List<ContributionRecord> disposedRecords = new ArrayList<ContributionRecord>(); for (ContributionRecord record : vals .toArray(new ContributionRecord[vals.size()])) { if (record.menuModel == menuModel) { record.dispose(); for (MMenuElement copy : record.generatedElements) { cleanUpCopy(record, copy); } for (MMenuElement copy : record.sharedElements) { cleanUpCopy(record, copy); } record.generatedElements.clear(); record.sharedElements.clear(); disposedRecords.add(record); } } Iterator<ContributionRecord> iterator = vals.iterator(); for (; iterator.hasNext();) { ContributionRecord record = iterator.next(); if (disposedRecords.contains(record)) { iterator.remove(); } } }
Source:
public void init() { if (isConfigured()) { String[] parts = endpoint.split(":"); if (parts.length < 1 || parts.length > 2) { throw new IllegalArgumentException("altus.audit.endpoint must be in host or host:port format."); } host = parts[0]; port = parts.length == 2 ? Integer.parseInt(parts[1]) : DEFAULT_AUDIT_PORT; } else { if (structuredEventEnablementConfig.isAuditServiceEnabled()) { throw new IllegalStateException("Audit service is enabled, but altus.audit.endpoint is not configured"); } } }

Target:
public void init() { if (isConfigured()) { String[] parts = endpoint.split(":"); if (parts.length < 1 || parts.length > 2) { throw new IllegalArgumentException("altus.audit.endpoint must be in host or host:port format."); } host = parts[0]; port = parts.length == 2 ? Integer.parseInt(parts[1]) : DEFAULT_AUDIT_PORT; } else if (structuredEventEnablementConfig.isAuditServiceEnabled()) { throw new IllegalStateException("Audit service is enabled, but altus.audit.endpoint is not configured"); } }
Source:
public boolean isRubricRadioChecked(int qnIndex, int respIndex, int row, int col) { WebElement radio = browser.driver.findElement(By.id(Const.ParamsNames.FEEDBACK_QUESTION_RUBRIC_CHOICE + "-" + qnIndex + "-" + respIndex + "-" + row + "-" + col)); String isChecked = radio.getAttribute("checked"); return isChecked != null && "true".equals(isChecked); }

Target:
public boolean isRubricRadioChecked(int qnIndex, int respIndex, int row, int col) { WebElement radio = browser.driver.findElement(By.id(Const.ParamsNames.FEEDBACK_QUESTION_RUBRIC_CHOICE + "-" + qnIndex + "-" + respIndex + "-" + row + "-" + col)); String isChecked = radio.getAttribute("checked"); return "true".equals(isChecked); }
Source:
public Object[] getChildren(Object parent) { if (parent instanceof IDebugTarget) { IJavaDebugTarget target = ((IDebugTarget)parent).getAdapter(IJavaDebugTarget.class); if (target != null) { try { return ((IJavaDebugTarget)parent).getThreads(); } catch (DebugException e) { JDIDebugUIPlugin.log(e); } } } if (parent instanceof ILaunchManager) { List<IJavaDebugTarget> children= new ArrayList<>(); ILaunch[] launches= ((ILaunchManager) parent).getLaunches(); IDebugTarget[] targets; IJavaDebugTarget target; for (ILaunch launche : launches) { targets= launche.getDebugTargets(); for (IDebugTarget target2 : targets) { target= target2.getAdapter(IJavaDebugTarget.class); if (target != null && !target.isDisconnected() && !target.isTerminated()) { children.add(target); } } } return children.toArray(); } return new Object[0]; }

Target:
public Object[] getChildren(Object parent) { if (parent instanceof IDebugTarget) { IJavaDebugTarget target = ((IDebugTarget)parent).getAdapter(IJavaDebugTarget.class); if (target != null) { try { return ((IJavaDebugTarget)parent).getThreads(); } catch (DebugException e) { JDIDebugUIPlugin.log(e); } } } if (parent instanceof ILaunchManager) { List<IJavaDebugTarget> children= new ArrayList<>(); ILaunch[] launches= ((ILaunchManager) parent).getLaunches(); IDebugTarget[] targets; IJavaDebugTarget target; for (ILaunch launch : launches) { targets= launch.getDebugTargets(); for (IDebugTarget debugTarget : targets) { target= debugTarget.getAdapter(IJavaDebugTarget.class); if (target != null && !target.isDisconnected() && !target.isTerminated()) { children.add(target); } } } return children.toArray(); } return new Object[0]; }
Source:
void reset(boolean isShutdown) { logger.info("Resetting CallbackHandler: {}. Is resetting for shutdown: {}.", this.toString(), isShutdown); try { _ready = false; synchronized (this) { if (_batchCallbackProcessor != null) { if (isShutdown) { _batchCallbackProcessor.shutdown(); _batchCallbackProcessor = null; if (_periodicRefreshExecutor != null) { _periodicRefreshExecutor.shutdownNow(); } } else { _batchCallbackProcessor.resetEventQueue(); if (_periodicRefreshExecutor != null) { _periodicRefreshExecutor.shutdownNow(); initRefreshTask(); } } } } NotificationContext changeContext = new NotificationContext(_manager); changeContext.setType(NotificationContext.Type.FINALIZE); changeContext.setChangeType(_changeType); invoke(changeContext); } catch (Exception e) { String msg = "Exception while resetting the listener:" + _listener; ZKExceptionHandler.getInstance().handle(msg, e); } }

Target:
void reset(boolean isShutdown) { logger.info("Resetting CallbackHandler: {}. Is resetting for shutdown: {}.", this.toString(), isShutdown); try { shutDownTriggerTask(); _ready = false; synchronized (this) { if (_batchCallbackProcessor != null) { if (isShutdown) { _batchCallbackProcessor.shutdown(); _batchCallbackProcessor = null; } else { _batchCallbackProcessor.resetEventQueue(); } } } NotificationContext changeContext = new NotificationContext(_manager); changeContext.setType(NotificationContext.Type.FINALIZE); changeContext.setChangeType(_changeType); invoke(changeContext); } catch (Exception e) { String msg = "Exception while resetting the listener:" + _listener; ZKExceptionHandler.getInstance().handle(msg, e); } }
Source:
static void send(List<Event> events) { Map<String, ArrayList<Event>> eventsByStream = new HashMap<>(); for (Event event : events) { String stream = event.getStream(); if (!eventsByStream.containsKey(stream) || eventsByStream.get(stream) == null) { eventsByStream.put(stream, new ArrayList<>()); } eventsByStream.get(stream).add(event); } for (String stream : eventsByStream.keySet()) { postEvents(getStreamConfig(stream), eventsByStream.get(stream)); } }

Target:
static void send(List<Event> events) { Map<String, ArrayList<Event>> eventsByStream = new HashMap<>(); for (Event event : events) { String stream = event.getStream(); if (!eventsByStream.containsKey(stream) || eventsByStream.get(stream) == null) { eventsByStream.put(stream, new ArrayList<>()); } eventsByStream.get(stream).add(event); } for (String stream : eventsByStream.keySet()) { if (isEventLoggingEnabled()) { postEvents(getStreamConfig(stream), eventsByStream.get(stream)); } } }
Source:
private ModuleDataModelOracle getModuleOracle(String typeName) { Class<?> clazz = null; try { clazz = classLoader.loadClass(typeName); if (clazz == null) { clazz = getClass().forName(typeName); } } catch (ClassNotFoundException e) { logger.error("Unable to extract model for class '{}'.", typeName); throw new IllegalStateException("Unable to extract model for class '" + typeName + "'"); } if (clazz == null) { logger.error("Unable to extract model for class '{}'.", typeName); throw new IllegalStateException("Unable to extract model for class '" + typeName + "'"); } try { final ModuleDataModelOracleBuilder builder = ModuleDataModelOracleBuilder.newModuleOracleBuilder(evaluator); final ClassFactBuilder modelFactBuilder = new ClassFactBuilder(builder, clazz, false, type -> TypeSource.JAVA_PROJECT); ModuleDataModelOracle oracle = modelFactBuilder.getDataModelBuilder().build(); Map<String, FactBuilder> builders = new HashMap<>(); for (FactBuilder factBuilder : modelFactBuilder.getInternalBuilders().values()) { if (factBuilder instanceof ClassFactBuilder) { builders.put(((ClassFactBuilder) factBuilder).getType(), factBuilder); factBuilder.build((ModuleDataModelOracleImpl) oracle); } } builders.put(modelFactBuilder.getType(), modelFactBuilder); modelFactBuilder.build((ModuleDataModelOracleImpl) oracle); return oracle; } catch (IOException ex) { } return null; }

Target:
private ModuleDataModelOracle getModuleOracle(String typeName) { Class<?> clazz = null; try { clazz = classLoader.loadClass(typeName); if (clazz == null) { clazz = getClass().forName(typeName); } } catch (ClassNotFoundException e) { logger.error("Unable to extract model for class '{}'.", typeName); throw new IllegalStateException("Unable to extract model for class '" + typeName + "'"); } if (clazz == null) { logger.error("Unable to extract model for class '{}'.", typeName); throw new IllegalStateException("Unable to extract model for class '" + typeName + "'"); } try { final ModuleDataModelOracleBuilder builder = ModuleDataModelOracleBuilder.newModuleOracleBuilder(evaluator); final ClassFactBuilder modelFactBuilder = new ClassFactBuilder(builder, clazz, false, type -> TypeSource.JAVA_PROJECT); ModuleDataModelOracle oracle = modelFactBuilder.getDataModelBuilder().build(); Map<String, FactBuilder> builders = new HashMap<>(); for (FactBuilder factBuilder : modelFactBuilder.getInternalBuilders().values()) { if (factBuilder instanceof ClassFactBuilder) { builders.put(((ClassFactBuilder) factBuilder).getType(), factBuilder); factBuilder.build((ModuleDataModelOracleImpl) oracle); } } builders.put(modelFactBuilder.getType(), modelFactBuilder); modelFactBuilder.build((ModuleDataModelOracleImpl) oracle); return oracle; } catch (IOException ex) { logger.warn("Couldn't inspect model due to: {}", typeName, ex); } return null; }
Source:
protected String[] getFilesToIncludes(File baseDir, String[] includes, String[] excludes) { final DirectoryScanner scanner = new DirectoryScanner(); scanner.setBasedir(baseDir); if (excludes != null) { scanner.setExcludes(excludes); } scanner.addDefaultExcludes(); if (includes != null && includes.length > 0) { scanner.setIncludes(includes); } else { scanner.setIncludes(DEFAULT_INCLUDES); } scanner.scan(); final String[] includedFiles = scanner.getIncludedFiles(); for (int i = 0; i < includedFiles.length; i++) { includedFiles[i] = "/" + includedFiles[i].replace("\\", "/"); } return includedFiles; }

Target:
protected String[] getFilesToIncludes(File baseDir, String[] includes, String[] excludes) { final DirectoryScanner scanner = new DirectoryScanner(); scanner.setBasedir(baseDir); if (excludes != null) { scanner.setExcludes(excludes); } scanner.addDefaultExcludes(); if (includes != null && includes.length > 0) { scanner.setIncludes(includes); } else { scanner.setIncludes(DEFAULT_INCLUDES); } scanner.scan(); final String[] includedFiles = scanner.getIncludedFiles(); for (int i = 0; i < includedFiles.length; i++) { includedFiles[i] = "/" + includedFiles[i].replace(File.separator, "/"); } return includedFiles; }
Source:
public Object loadByUniqueKey( String entityName, String uniqueKeyPropertyName, Object key, SharedSessionContractImplementor session) throws HibernateException { final SessionFactoryImplementor factory = session.getFactory(); UniqueKeyLoadable persister = (UniqueKeyLoadable) factory.getMetamodel().entityPersister( entityName ); EntityUniqueKey euk = new EntityUniqueKey( entityName, uniqueKeyPropertyName, key, getIdentifierOrUniqueKeyType( factory ), persister.getEntityMode(), session.getFactory() ); final PersistenceContext persistenceContext = session.getPersistenceContext(); Object result = persistenceContext.getEntity( euk ); if ( result == null ) { result = persister.loadByUniqueKey( uniqueKeyPropertyName, key, session ); } if (result != null) { persistenceContext.addEntity(euk, result); } return result == null ? null : persistenceContext.proxyFor( result ); }

Target:
public Object loadByUniqueKey( String entityName, String uniqueKeyPropertyName, Object key, SharedSessionContractImplementor session) throws HibernateException { final SessionFactoryImplementor factory = session.getFactory(); UniqueKeyLoadable persister = (UniqueKeyLoadable) factory.getMetamodel().entityPersister( entityName ); EntityUniqueKey euk = new EntityUniqueKey( entityName, uniqueKeyPropertyName, key, getIdentifierOrUniqueKeyType( factory ), persister.getEntityMode(), session.getFactory() ); final PersistenceContext persistenceContext = session.getPersistenceContext(); Object result = persistenceContext.getEntity( euk ); if ( result == null ) { result = persister.loadByUniqueKey( uniqueKeyPropertyName, key, session ); if (result != null) { persistenceContext.addEntity(euk, result); } } return result == null ? null : persistenceContext.proxyFor( result ); }
Source:
public boolean equals(Object obj) { boolean equals = false; if (obj instanceof MergeStrategySection && useContentMerge == ((MergeStrategySection) obj).useContentMerge && submitType.equals(((MergeStrategySection) obj).submitType)) { equals = true; } return equals; }

Target:
public boolean equals(Object obj) { boolean equals = false; if (obj instanceof MergeStrategySection && ((name == null && ((MergeStrategySection) obj).name == null) || (name != null && name.equals(name))) && ((useContentMerge == null && ((MergeStrategySection) obj).useContentMerge == null) || (useContentMerge != null && useContentMerge .equals(((MergeStrategySection) obj).useContentMerge))) && ((submitType == null && ((MergeStrategySection) obj).submitType == null) || (submitType != null && submitType .equals(((MergeStrategySection) obj).submitType)))) { equals = true; } return equals; }
Source:
public void onResponse(Map<String, Object> response) { try { processRefreshVdsStatsResponse((VDSReturnValue) response.get("result")); if (!isVdsUpOrGoingToMaintenance) { vdsManager.setStatus(VDSStatus.Up, vds); } refreshVdsRunTimeInfo(isVdsUpOrGoingToMaintenance); } catch(Throwable t) { onFailure(t); } }

Target:
public void onResponse(Map<String, Object> response) { try { processRefreshVdsStatsResponse((VDSReturnValue) response.get("result")); if (!vdsUpOrGoingToMaintenance) { vdsManager.setStatus(VDSStatus.Up, vds); } refreshVdsRunTimeInfo(vdsUpOrGoingToMaintenance); } catch(Throwable t) { onFailure(t); } }
Source:
static <T> T buildSqlObject(final Class<T> sqlObjectType, final HandleDing handle) { Factory f; if (factories.containsKey(sqlObjectType)) { f = factories.get(sqlObjectType); } else { Enhancer e = new Enhancer(); e.setClassLoader(sqlObjectType.getClassLoader()); List<Class<?>> interfaces = new ArrayList<>(); interfaces.add(CloseInternalDoNotUseThisClass.class); if (sqlObjectType.isInterface()) { interfaces.add(sqlObjectType); } else { e.setSuperclass(sqlObjectType); } e.setInterfaces(interfaces.toArray(new Class[interfaces.size()])); final SqlObject so = new SqlObject(buildHandlersFor(sqlObjectType), handle); e.setCallbackFilter(new CallbackFilter() { @Override public int accept(Method method) { return method.isDefault() ? 1 : 0; } }); e.setCallbacks(new Callback[] {new MethodInterceptor() { @Override public Object intercept(Object o, Method method, Object[] objects, MethodProxy methodProxy) throws Throwable { return so.invoke(o, method, objects, methodProxy); } }, NoOp.INSTANCE }); T t = (T) e.create(); T actual = (T) factories.putIfAbsent(sqlObjectType, (Factory) t); if (actual == null) { return t; } f = (Factory) actual; } final SqlObject so = new SqlObject(buildHandlersFor(sqlObjectType), handle); return (T) f.newInstance(new Callback[] {new MethodInterceptor() { @Override public Object intercept(Object o, Method method, Object[] objects, MethodProxy methodProxy) throws Throwable { return so.invoke(o, method, objects, methodProxy); } }, NoOp.INSTANCE }); }

Target:
static <T> T buildSqlObject(final Class<T> sqlObjectType, final HandleDing handle) { Factory f; if (factories.containsKey(sqlObjectType)) { f = factories.get(sqlObjectType); } else { Enhancer e = new Enhancer(); e.setClassLoader(sqlObjectType.getClassLoader()); List<Class<?>> interfaces = new ArrayList<>(); interfaces.add(CloseInternalDoNotUseThisClass.class); if (sqlObjectType.isInterface()) { interfaces.add(sqlObjectType); } else { e.setSuperclass(sqlObjectType); } e.setInterfaces(interfaces.toArray(new Class[interfaces.size()])); final SqlObject so = new SqlObject(buildHandlersFor(sqlObjectType), handle); e.setCallbackFilter(m -> m.isDefault() ? 1 : 0); e.setCallbacks(new Callback[] { (MethodInterceptor) so::invoke, NoOp.INSTANCE }); T t = (T) e.create(); T actual = (T) factories.putIfAbsent(sqlObjectType, (Factory) t); if (actual == null) { return t; } f = (Factory) actual; } final SqlObject so = new SqlObject(buildHandlersFor(sqlObjectType), handle); return (T) f.newInstance(new Callback[] { (MethodInterceptor) so::invoke, NoOp.INSTANCE }); }
Source:
protected void renameTo(final String newName) throws IOException { if (!isNameEditable()) { throw new IOException("Trying to rename an item that has not editable name."); } final ItemGroup parent = getParent(); String oldName = this.name; String oldFullName = getFullName(); synchronized (parent) { synchronized (this) { if (newName == null) throw new IllegalArgumentException("New name is not given"); if (this.name.equals(newName)) return; Items.verifyItemDoesNotAlreadyExist(parent, newName, this); File oldRoot = this.getRootDir(); doSetName(newName); File newRoot = this.getRootDir(); boolean success = false; try { boolean interrupted = false; boolean renamed = false; for (int retry = 0; retry < 5; retry++) { if (oldRoot.renameTo(newRoot)) { renamed = true; break; } try { Thread.sleep(500); } catch (InterruptedException e) { interrupted = true; } } if (interrupted) Thread.currentThread().interrupt(); if (!renamed) { Copy cp = new Copy(); cp.setProject(new org.apache.tools.ant.Project()); cp.setTodir(newRoot); FileSet src = new FileSet(); src.setDir(oldRoot); cp.addFileset(src); cp.setOverwrite(true); cp.setPreserveLastModified(true); cp.setFailOnError(false); cp.execute(); try { Util.deleteRecursive(oldRoot); } catch (IOException e) { e.printStackTrace(); } } success = true; } finally { if (!success) doSetName(oldName); } parent.onRenamed(this, oldName, newName); } } ItemListener.fireLocationChange(this, oldFullName); }

Target:
protected void renameTo(final String newName) throws IOException { if (!isNameEditable()) { throw new IOException("Trying to rename an item that does not support this operation."); } final ItemGroup parent = getParent(); String oldName = this.name; String oldFullName = getFullName(); synchronized (parent) { synchronized (this) { if (newName == null) throw new IllegalArgumentException("New name is not given"); if (this.name.equals(newName)) return; Items.verifyItemDoesNotAlreadyExist(parent, newName, this); File oldRoot = this.getRootDir(); doSetName(newName); File newRoot = this.getRootDir(); boolean success = false; try { boolean interrupted = false; boolean renamed = false; for (int retry = 0; retry < 5; retry++) { if (oldRoot.renameTo(newRoot)) { renamed = true; break; } try { Thread.sleep(500); } catch (InterruptedException e) { interrupted = true; } } if (interrupted) Thread.currentThread().interrupt(); if (!renamed) { Copy cp = new Copy(); cp.setProject(new org.apache.tools.ant.Project()); cp.setTodir(newRoot); FileSet src = new FileSet(); src.setDir(oldRoot); cp.addFileset(src); cp.setOverwrite(true); cp.setPreserveLastModified(true); cp.setFailOnError(false); cp.execute(); try { Util.deleteRecursive(oldRoot); } catch (IOException e) { e.printStackTrace(); } } success = true; } finally { if (!success) doSetName(oldName); } parent.onRenamed(this, oldName, newName); } } ItemListener.fireLocationChange(this, oldFullName); }
Source:
LedgerMetadata(int metadataFormatVersion, int ensembleSize, int writeQuorumSize, int ackQuorumSize, LedgerMetadataFormat.State state, Optional<Long> lastEntryId, Optional<Long> length, Map<Long, List<BookieSocketAddress>> ensembles, DigestType digestType, Optional<byte[]> password, long ctime, boolean storeCtime, Map<String, byte[]> customMetadata) { checkArgument(ensembles.size() > 0, "There must be at least one ensemble in the ledger"); this.metadataFormatVersion = metadataFormatVersion; this.ensembleSize = ensembleSize; this.writeQuorumSize = writeQuorumSize; this.ackQuorumSize = ackQuorumSize; this.state = state; if (lastEntryId.isPresent()) { this.lastEntryId = lastEntryId.get(); } else { this.lastEntryId = LedgerHandle.INVALID_ENTRY_ID; } length.ifPresent((l) -> this.length = l); setEnsembles(ensembles); if (state != LedgerMetadataFormat.State.CLOSED) { currentEnsemble = this.ensembles.lastEntry().getValue(); } this.digestType = digestType.equals(DigestType.MAC) ? LedgerMetadataFormat.DigestType.HMAC : LedgerMetadataFormat.DigestType.valueOf(digestType.toString()); if (password.isPresent()) { this.password = password.get(); this.hasPassword = true; } else { this.password = new byte[0]; this.hasPassword = false; } this.ctime = ctime; this.storeCtime = storeCtime; this.customMetadata.putAll(customMetadata); }

Target:
LedgerMetadata(int metadataFormatVersion, int ensembleSize, int writeQuorumSize, int ackQuorumSize, LedgerMetadataFormat.State state, Optional<Long> lastEntryId, Optional<Long> length, Map<Long, List<BookieSocketAddress>> ensembles, DigestType digestType, Optional<byte[]> password, long ctime, boolean storeCtime, Map<String, byte[]> customMetadata) { checkArgument(ensembles.size() > 0, "There must be at least one ensemble in the ledger"); this.metadataFormatVersion = metadataFormatVersion; this.ensembleSize = ensembleSize; this.writeQuorumSize = writeQuorumSize; this.ackQuorumSize = ackQuorumSize; this.state = state; if (lastEntryId.isPresent()) { this.lastEntryId = lastEntryId.get(); } else { this.lastEntryId = LedgerHandle.INVALID_ENTRY_ID; } length.ifPresent((l) -> this.length = l); setEnsembles(ensembles); if (state != LedgerMetadataFormat.State.CLOSED) { currentEnsemble = this.ensembles.lastEntry().getValue(); } this.digestType = digestType.equals(DigestType.MAC) ? LedgerMetadataFormat.DigestType.HMAC : LedgerMetadataFormat.DigestType.valueOf(digestType.toString()); if (password.isPresent()) { this.password = password.get(); this.hasPassword = true; } else { this.password = null; this.hasPassword = false; } this.ctime = ctime; this.storeCtime = storeCtime; this.customMetadata.putAll(customMetadata); }
Source:
public synchronized void registerDeviceStatusListener(DeviceStatusListener deviceStatusListener) { if (this.devStatMan != null) { if (deviceStatusListener == null) { throw new NullPointerException("It's not allowed to pass a null DeviceStatusListener."); } if (deviceStatusListener.getID() != null) { devStatMan.registerDeviceListener(deviceStatusListener); } else { throw new NullPointerException("It's not allowed to pass a null ID."); } } else { devListener = new LinkedList<DeviceStatusListener>(); devListener.add(deviceStatusListener); } }

Target:
public synchronized void registerDeviceStatusListener(DeviceStatusListener deviceStatusListener) { if (this.devStatMan != null) { if (deviceStatusListener == null) { throw new IllegalArgumentException("It's not allowed to pass null."); } if (deviceStatusListener.getDeviceStatusListenerID() != null) { devStatMan.registerDeviceListener(deviceStatusListener); } else { throw new IllegalArgumentException("It's not allowed to pass a DeviceStatusListener with ID = null."); } } else { devListener = new LinkedList<DeviceStatusListener>(); devListener.add(deviceStatusListener); } }
Source:
public void visitClass(ClassTree tree) { State oldState = currentState; currentState = new State(null); super.visitClass(tree); currentState = oldState; }

Target:
public void visitClass(ClassTree tree) { State oldState = currentState; currentState = new State(); scan(tree.members()); currentState = oldState; }
Source:
public static LiteralArgumentBuilder<CommandSource> register() { return Commands.literal("give").requires(PermLevel.ADMIN) .then(Commands.argument("bee", EnumArgument.enumArgument(BeeDefinition.class)) .then(Commands.argument("type", EnumArgument.enumArgument(EnumBeeType.class)) .then(Commands.argument("player", EntityArgument.player()) .executes(a -> execute(a.getSource(), a.getArgument("bee", BeeDefinition.class), a.getArgument("type", EnumBeeType.class), EntityArgument.getPlayer(a, "player")))) .executes(a -> execute(a.getSource(), a.getArgument("bee", BeeDefinition.class), a.getArgument("type", EnumBeeType.class), a.getSource().asPlayer()))) .executes(a -> execute(a.getSource(), a.getArgument("bee", BeeDefinition.class), EnumBeeType.QUEEN, a.getSource().asPlayer()))) .executes(a -> execute(a.getSource(), BeeDefinition.FOREST, EnumBeeType.QUEEN, a.getSource().asPlayer())); }

Target:
public static LiteralArgumentBuilder<CommandSource> register() { return Commands.literal("give").requires(PermLevel.ADMIN) .then(Commands.argument("bee", BeeArgument.beeArgument()) .then(Commands.argument("type", EnumArgument.enumArgument(EnumBeeType.class)) .then(Commands.argument("player", EntityArgument.player()) .executes(a -> execute(a.getSource(), a.getArgument("bee", IBee.class), a.getArgument("type", EnumBeeType.class), EntityArgument.getPlayer(a, "player")))) .executes(a -> execute(a.getSource(), a.getArgument("bee", IBee.class), a.getArgument("type", EnumBeeType.class), a.getSource().asPlayer()))) .executes(a -> execute(a.getSource(), a.getArgument("bee", IBee.class), EnumBeeType.QUEEN, a.getSource().asPlayer()))) .executes(a -> execute(a.getSource(), BeeDefinition.FOREST.createIndividual(), EnumBeeType.QUEEN, a.getSource().asPlayer())); }
Source:
public int cancelIfNotRunning(List<String> jobIds) { if (CollectionUtils.isEmpty(jobIds)) { return 0; } String hql = "update JobStatus j " + "set j.state = :canceled " + "where j.id in (:jobids) and j.state in (:created, :pending)"; Query query = this.currentSession().createQuery(hql) .setParameterList("jobids", jobIds) .setInteger("canceled", JobState.CANCELED.ordinal()) .setInteger("created", JobState.CREATED.ordinal()) .setInteger("pending", JobState.PENDING.ordinal()); return query.executeUpdate(); }

Target:
public int cancelIfNotRunning(List<String> jobIds) { int cancelled = 0; if (CollectionUtils.isEmpty(jobIds)) { return cancelled; } String hql = "update JobStatus j " + "set j.state = :canceled " + "where j.id in (:jobids) and j.state in (:created, :pending)"; Query query = this.currentSession() .createQuery(hql) .setInteger("canceled", JobState.CANCELED.ordinal()) .setInteger("created", JobState.CREATED.ordinal()) .setInteger("pending", JobState.PENDING.ordinal()); Iterable<List<String>> blocks = Iterables.partition(jobIds, AbstractHibernateCurator.IN_OPERATOR_BLOCK_SIZE); for (List<String> block : blocks) { cancelled += query.setParameterList("jobids", block).executeUpdate(); } return cancelled; }
Source:
public void testCommitFailure() throws Exception { setUp(); String key = "key"; Schema schema = createSchema(); Struct record = createRecord(schema); Collection<SinkRecord> sinkRecords = new ArrayList<>(); for (long offset = 0; offset < 7; offset++) { SinkRecord sinkRecord = new SinkRecord(TOPIC, PARTITION, Schema.STRING_SCHEMA, key, schema, record, offset); sinkRecords.add(sinkRecord); } DataWriter hdfsWriter = new DataWriter(connectorConfig, context, avroData); MemoryStorage storage = (MemoryStorage) hdfsWriter.getStorage(); storage.setFailure(MemoryStorage.Failure.appendFailure); hdfsWriter.write(sinkRecords); assertEquals(context.timeout(), (long) connectorConfig.getLong(HdfsSinkConnectorConfig.RETRY_BACKOFF_CONFIG)); Map<String, List<Object>> data = Data.getData(); String logFile = FileUtils.logFileName(url, logsDir, TOPIC_PARTITION); List<Object> content = data.get(logFile); assertEquals(null, content); hdfsWriter.write(new ArrayList<SinkRecord>()); content = data.get(logFile); assertEquals(null, content); Thread.sleep(context.timeout()); hdfsWriter.write(new ArrayList<SinkRecord>()); content = data.get(logFile); assertEquals(6, content.size()); hdfsWriter.close(); hdfsWriter.stop(); }

Target:
public void testCommitFailure() throws Exception { String key = "key"; Schema schema = createSchema(); Struct record = createRecord(schema); Collection<SinkRecord> sinkRecords = new ArrayList<>(); for (long offset = 0; offset < 7; offset++) { SinkRecord sinkRecord = new SinkRecord(TOPIC, PARTITION, Schema.STRING_SCHEMA, key, schema, record, offset); sinkRecords.add(sinkRecord); } DataWriter hdfsWriter = new DataWriter(connectorConfig, context, avroData); MemoryStorage storage = (MemoryStorage) hdfsWriter.getStorage(); storage.setFailure(MemoryStorage.Failure.appendFailure); hdfsWriter.write(sinkRecords); assertEquals(context.timeout(), (long) connectorConfig.getLong(HdfsSinkConnectorConfig.RETRY_BACKOFF_CONFIG)); Map<String, List<Object>> data = Data.getData(); String logFile = FileUtils.logFileName(url, logsDir, TOPIC_PARTITION); List<Object> content = data.get(logFile); assertEquals(null, content); hdfsWriter.write(new ArrayList<SinkRecord>()); content = data.get(logFile); assertEquals(null, content); Thread.sleep(context.timeout()); hdfsWriter.write(new ArrayList<SinkRecord>()); content = data.get(logFile); assertEquals(6, content.size()); hdfsWriter.close(); hdfsWriter.stop(); }
Source:
public Model create() { return getModel(); }

Target:
public Resource create() { return getResource(); }
Source:
public List<CloudCatSubscription> getSecondCloudClientDataSubscriptions() { return this.secondloudClientDataSubscriptions; }

Target:
public List<CloudCatSubscription> getSecondCloudClientDataSubscriptions() { return this.secondCloudClientDataSubscriptions; }
Source:
private static List<String> coursierPart(){ return Arrays.asList("launch", "org.scalameta:fastpass_2.12:latest.stable", "--main", "scala.meta.internal.fastpass.pantsbuild.BloopPants", "--" ); }

Target:
private static List<String> coursierPart(){ return Arrays.asList("launch", "org.scalameta:fastpass_2.12:latest.stable", "--main", "scala.meta.fastpass.Fastpass", "--" ); }
Source:
private void setManagedVideoDevices(VmBase vmBase) { Map<Guid, VmDevice> managedDeviceMap = vmBase.getManagedDeviceMap(); if (managedDeviceMap == null) { managedDeviceMap = new HashMap<Guid, VmDevice>(); } List<VmDevice> devices = DbFacade.getInstance() .getVmDeviceDao() .getVmDeviceByVmIdAndType(vmBase.getId(), VmDeviceGeneralType.VIDEO); for (VmDevice device : devices) { if (device.getType() == VmDeviceGeneralType.VIDEO) { managedDeviceMap.put(device.getDeviceId(), device); } } }

Target:
private void setManagedVideoDevices(VmBase vmBase) { Map<Guid, VmDevice> managedDeviceMap = vmBase.getManagedDeviceMap(); if (managedDeviceMap == null) { managedDeviceMap = new HashMap<Guid, VmDevice>(); } List<VmDevice> devices = DbFacade.getInstance() .getVmDeviceDao() .getVmDeviceByVmIdAndType(vmBase.getId(), VmDeviceGeneralType.VIDEO); for (VmDevice device : devices) { managedDeviceMap.put(device.getDeviceId(), device); } }
Source:
public static Boolean isNumerical(Schema.Type type) { return Schema.Type.INT.equals(type) || Schema.Type.LONG.equals(type) || Schema.Type.DOUBLE.equals(type) || Schema.Type.FLOAT.equals(type); }

Target:
public static boolean isNumerical(Schema.Type type) { return Schema.Type.INT.equals(type) || Schema.Type.LONG.equals(type) || Schema.Type.DOUBLE.equals(type) || Schema.Type.FLOAT.equals(type); }