auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public static ReviewStatus getReviewStatus(com.google.gerrit.reviewdb.Change.Status gerritStatus) { switch (gerritStatus) { case NEW: return ReviewStatus.NEW; case MERGED: return ReviewStatus.MERGED; case SUBMITTED: return ReviewStatus.SUBMITTED; case ABANDONED: return ReviewStatus.ABANDONED; default: if (gerritStatus != null) { GerritCorePlugin.logError("Internal Error: unexpected change status: " + gerritStatus, new Exception()); } return ReviewStatus.DRAFT; } }

Target:
public static ReviewStatus getReviewStatus(com.google.gerrit.reviewdb.Change.Status gerritStatus) { if (gerritStatus == null) { return ReviewStatus.DRAFT; } switch (gerritStatus) { case NEW: return ReviewStatus.NEW; case MERGED: return ReviewStatus.MERGED; case SUBMITTED: return ReviewStatus.SUBMITTED; case ABANDONED: return ReviewStatus.ABANDONED; default: GerritCorePlugin.logError("Internal Error: unexpected change status: " + gerritStatus, new Exception()); return null; } }
Source:
private void readCSV(File csv, String formHash, String pathHash) { CSVReader reader; ItemsetDbAdapter ida = new ItemsetDbAdapter(); ida.open(); boolean withinTransaction = false; try { reader = new CSVReader(new FileReader(csv)); String[] nextLine; String[] columnHeaders = null; int lineNumber = 0; while ((nextLine = reader.readNext()) != null) { lineNumber++; if (lineNumber == 1) { columnHeaders = nextLine; ida.createTable(formHash, pathHash, columnHeaders, csv.getAbsolutePath()); continue; } if (lineNumber == 2) { withinTransaction = true; ida.beginTransaction(); } ida.addRow(pathHash, columnHeaders, nextLine); } } catch (IOException | SQLiteException e) { warrningMsg = "Exception thrown while reading csv file"; Timber.e(e, warrningMsg); } finally { if (withinTransaction) { ida.commit(); } ida.close(); } }

Target:
private void readCSV(File csv, String formHash, String pathHash) { CSVReader reader; ItemsetDbAdapter ida = new ItemsetDbAdapter(); ida.open(); boolean withinTransaction = false; try { reader = new CSVReader(new FileReader(csv)); String[] nextLine; String[] columnHeaders = null; int lineNumber = 0; while ((nextLine = reader.readNext()) != null) { lineNumber++; if (lineNumber == 1) { columnHeaders = nextLine; ida.createTable(formHash, pathHash, columnHeaders, csv.getAbsolutePath()); continue; } if (lineNumber == 2) { withinTransaction = true; ida.beginTransaction(); } ida.addRow(pathHash, columnHeaders, nextLine); } } catch (IOException | SQLException e) { warningMsg = e.getMessage(); } finally { if (withinTransaction) { ida.commit(); } ida.close(); } }
Source:
public void testGetJobTasksIdsByTagPaginated() throws Throwable { int nbTasks = 50; String jobIdStr = "1"; JobState job = newMockedJob(jobIdStr, nbTasks); when(mockOfScheduler.getJobState(jobIdStr)).thenReturn(job); List<String> res = restInterface.getJobTasksIdsPaginated(sessionId, jobIdStr, 0, nbTasks); assertEquals("Number of tasks is incorrect", nbTasks, res.size()); for (int i = 0; i < nbTasks; i++) { assertEquals("Task readable name is incorrect", generateReadableName(jobIdStr, i, nbTasks), res.get(i)); } }

Target:
public void testGetJobTasksIdsByTagPaginated() throws Throwable { int nbTasks = 50; String jobIdStr = "1"; JobState job = newMockedJob(jobIdStr, nbTasks); when(mockOfScheduler.getJobState(jobIdStr)).thenReturn(job); TaskIdsPage page = restInterface.getTasksNamesPaginated(sessionId, jobIdStr, 0, nbTasks); assertTasks(nbTasks, jobIdStr, page); }
Source:
public void testDirect() { DynamicCacheDescriptor desc1 = new DynamicCacheDescriptor(null, new CacheConfiguration().setName("1111"), CacheType.DATA_STRUCTURES, null, true, null, true, false, null, new QuerySchema(), null); DynamicCacheDescriptor desc2 = new DynamicCacheDescriptor(null, new CacheConfiguration().setName("2222"), CacheType.INTERNAL, null, true, null, true, false, null, new QuerySchema(), null); assertTrue(ClusterCachesInfo.CacheComparators.DIRECT.compare(desc1, desc2) < 0); assertTrue(ClusterCachesInfo.CacheComparators.DIRECT.compare(desc2, desc1) > 0); }

Target:
public void testDirect() { DynamicCacheDescriptor desc1 = new DynamicCacheDescriptor(null, new CacheConfiguration().setName("1111"), CacheType.DATA_STRUCTURES, null, true, null, true, false, null, new QuerySchema(), null); DynamicCacheDescriptor desc2 = new DynamicCacheDescriptor(null, new CacheConfiguration().setName("2222"), CacheType.INTERNAL, null, true, null, true, false, null, new QuerySchema(), null); assertEquals(-1, ClusterCachesInfo.CacheComparators.DIRECT.compare(desc1, desc2)); assertEquals(1, ClusterCachesInfo.CacheComparators.DIRECT.compare(desc2, desc1)); }
Source:
public void checkPipelineCreationAuthorizationAnd403(Request request, Response response) { if (!securityService.isSecurityEnabled() || securityService.isUserAdmin(currentUsername())) { return; } JsonElement group = new JsonParser().parse(request.body()).getAsJsonObject().get("group"); if (group == null) { throw new UnprocessableEntityException("Pipeline group must be specified for creating a pipeline."); } else { String groupName = group.getAsString(); if (StringUtils.isNotBlank(groupName) && (!goConfigService.groups().hasGroup(groupName) || !securityService.isUserAdminOfGroup(currentUsername(), groupName))) { throw renderForbiddenResponse(); } } }

Target:
public void checkPipelineCreationAuthorizationAnd403(Request request, Response response) { if (!securityService.isSecurityEnabled() || securityService.isUserAdmin(currentUsername())) { return; } JsonElement group = new JsonParser().parse(request.body()).getAsJsonObject().get("group"); if (group == null) { throw new UnprocessableEntityException("Pipeline group must be specified for creating a pipeline."); } else { String groupName = group.getAsString(); boolean groupDoesNotExists = !goConfigService.groups().hasGroup(groupName); boolean userNotAdminOfTheGrp = !securityService.isUserAdminOfGroup(currentUsername(), groupName); if (isNotBlank(groupName) && (groupDoesNotExists || userNotAdminOfTheGrp)) { throw renderForbiddenResponse(); } } }
Source:
protected TableRef createTableRef(String alias, String schemaName, String tableName,List<ColumnDef> dyn_columns) throws SQLException { long timeStamp = Math.abs(client.updateCache(schemaName, tableName)); PSchema theSchema = null; try { theSchema = connection.getPMetaData().getSchema(schemaName); } catch (SchemaNotFoundException e) { throw new TableNotFoundException(schemaName, tableName); } PTable theTable = theSchema.getTable(tableName); if(dyn_columns!=null){ int ordinalPosition = theTable.getColumns().size(); List<PColumn> dyn_column_list = new ArrayList<PColumn>(); dyn_column_list.addAll(theTable.getColumns()); for(ColumnDef cdef:dyn_columns){ PColumn pc = this.newColumn(ordinalPosition, cdef, new HashSet(theTable.getPKColumns())); if(pc!=null){ dyn_column_list.add(pc); } ordinalPosition++; } theTable = new PTableImpl(theTable.getName(), theTable.getType(), theTable.getTimeStamp(),theTable.getSequenceNumber(), theTable.getPKName(), dyn_column_list); } TableRef tableRef = new TableRef(alias, theTable, theSchema, timeStamp); return tableRef; }

Target:
protected TableRef createTableRef(String alias, String schemaName, String tableName,List<ColumnDef> dyn_columns) throws SQLException { long timeStamp = Math.abs(client.updateCache(schemaName, tableName)); PSchema theSchema = null; try { theSchema = connection.getPMetaData().getSchema(schemaName); } catch (SchemaNotFoundException e) { throw new TableNotFoundException(schemaName, tableName); } PTable theTable = theSchema.getTable(tableName); if(dyn_columns!=null && !dyn_columns.isEmpty()) { int ordinalPosition = theTable.getColumns().size(); List<PColumn> dyn_column_list = new ArrayList<PColumn>(); dyn_column_list.addAll(theTable.getColumns()); for(ColumnDef cdef:dyn_columns){ dyn_column_list.add(client.newColumn(ordinalPosition, cdef, new HashSet(theTable.getPKColumns()))); ordinalPosition++; } theTable = new PTableImpl(theTable.getName(), theTable.getType(), theTable.getTimeStamp(),theTable.getSequenceNumber(), theTable.getPKName(), dyn_column_list); } TableRef tableRef = new TableRef(alias, theTable, theSchema, timeStamp); return tableRef; }
Source:
public void stateProcessingSeriesStopsOnShutdown() throws InterruptedException { WorkflowInstance instance = executingInstanceBuilder().setType("looping-test").setState("start").build(); when(workflowInstances.getWorkflowInstance(instance.id, INCLUDES, null)).thenReturn(instance); ExecutorService executorService = newSingleThreadExecutor(); executorService.submit(executor); sleep(500); executorService.shutdown(); shutdownRequest.set(true); executorService.awaitTermination(10, SECONDS); assertThat(loopingWf.counter, Matchers.lessThan(20)); }

Target:
public void stateProcessingSeriesStopsOnShutdown() throws InterruptedException { WorkflowInstance instance = executingInstanceBuilder().setType("looping-test").setState("start").build(); when(workflowInstances.getWorkflowInstance(instance.id, INCLUDES, null)).thenReturn(instance); ExecutorService executorService = newSingleThreadExecutor(); executorService.submit(executor); sleep(500); executorService.shutdown(); shutdownRequest.set(true); boolean wasTerminated = executorService.awaitTermination(5, SECONDS); executorService.shutdownNow(); assertTrue(wasTerminated); }
Source:
public void testProxy() throws Exception { ResteasyClient client = getClient(); ResteasyWebTarget target = client.target(generateBaseUrl()); IGZIP proxy = target.proxy(IGZIP.class); ResteasyProviderFactory providerFactory = ResteasyProviderFactory.getInstance(); providerFactory.registerProvider(AcceptEncodingGZIPInterceptor.class); providerFactory.registerProvider(GZIPDecodingInterceptor.class); providerFactory.registerProvider(GZIPEncodingInterceptor.class); Assert.assertEquals("HELLO WORLD", proxy.getText()); Assert.assertEquals("HELLO WORLD", proxy.getGzipText()); try { String error = proxy.getGzipErrorText(); Assert.fail("unreachable"); } catch (WebApplicationException failure) { Assert.assertEquals(500, failure.getResponse().getStatus()); String txt = (String) failure.getResponse().readEntity(String.class); Assert.assertEquals("Hello", txt); } finally { client.close(); } }

Target:
public void testProxy() throws Exception { ResteasyClient client = getClient(); ResteasyWebTarget target = client.target(generateBaseUrl()); IGZIP proxy = target.proxy(IGZIP.class); Assert.assertEquals("HELLO WORLD", proxy.getText()); Assert.assertEquals("HELLO WORLD", proxy.getGzipText()); try { String error = proxy.getGzipErrorText(); Assert.fail("unreachable"); } catch (WebApplicationException failure) { Assert.assertEquals(500, failure.getResponse().getStatus()); String txt = (String) failure.getResponse().readEntity(String.class); Assert.assertEquals("Hello", txt); } finally { client.close(); } }
Source:
protected static double getCellHeight(final int rowIndex, final List<Double> allRowHeights, final GridCell<?> cell) { return IntStream.range(rowIndex, rowIndex + cell.getMergedCellCount()) .mapToDouble(allRowHeights::get) .sum(); }

Target:
protected static double getCellHeight(final int rowIndex, final List<Double> allRowHeights, final GridCell<?> cell) { double height = 0.0; for (int iRowIndex = rowIndex; iRowIndex < rowIndex + cell.getMergedCellCount(); iRowIndex++) { height = height + allRowHeights.get(iRowIndex); } return height; }
Source:
public String editBank(@ModelAttribute BankDto bankDto) { String loginName = LoginUserInfo.getLoginName(); BankModel bankModel = new BankModel(bankDto); bankModel.setUpdatedBy(loginName); bankModel.setUpdatedTime(new Date()); consoleBankService.updateBank(bankModel); String redirectUrl = "redirect:/finance-manage/bank-list"; if (bankDto.getIsBank() != null && (!bankDto.getIsBank())) { redirectUrl += "?isBank=false"; } return redirectUrl; }

Target:
public String editBank(@ModelAttribute BankDto bankDto) { String loginName = LoginUserInfo.getLoginName(); BankModel bankModel = new BankModel(bankDto); bankModel.setUpdatedBy(loginName); bankModel.setUpdatedTime(new Date()); consoleBankService.updateBank(bankModel); String redirectUrl = "redirect:/finance-manage/bank-list?isBank=" + bankDto.getIsBank(); return redirectUrl; }
Source:
Map<String, Object> asMap() { List<VmInitNetwork> vmInitNetworks = vmInit.getNetworks(); List<Map<String, Object>> links = null; List<Map<String, Object>> networks = null; if (vmInitNetworks != null) { links = new LinkedList<>(); networks = new LinkedList<>(); for (VmInitNetwork vmInitNetwork: vmInitNetworks) { boolean addLink = false; Map<String, Object> networkIPv4 = mapIPv4(vmInitNetwork); if (networkIPv4 != null) { networks.add(networkIPv4); addLink = true; } Map<String, Object> networkIPv6 = mapIPv6(vmInitNetwork); if (networkIPv6 != null) { networks.add(networkIPv6); addLink = true; } if (addLink) { links.add(mapVifLink(vmInitNetwork)); } } } List<Map<String, Object>> services = mapServices(); Map<String, Object> networkData = new HashMap<>(); if (links != null && !links.isEmpty()) { networkData.put("links", links); } if (networks != null && !networks.isEmpty()) { networkData.put("networks", networks); } if (services != null && !services.isEmpty()) { networkData.put("services", services); } return networkData; }

Target:
Map<String, Object> asMap() { List<VmInitNetwork> vmInitNetworks = vmInit.getNetworks(); List<Map<String, Object>> links = null; List<Map<String, Object>> networks = null; if (vmInitNetworks != null) { links = new LinkedList<>(); networks = new LinkedList<>(); for (VmInitNetwork vmInitNetwork: vmInitNetworks) { if (vmInitNetwork.getStartOnBoot() == null || !vmInitNetwork.getStartOnBoot()) { throw new IllegalArgumentException("'Start on boot' must be true"); } boolean addLink = false; Map<String, Object> networkIPv4 = mapIPv4(vmInitNetwork); if (networkIPv4 != null) { networks.add(networkIPv4); addLink = true; } Map<String, Object> networkIPv6 = mapIPv6(vmInitNetwork); if (networkIPv6 != null) { networks.add(networkIPv6); addLink = true; } if (addLink) { links.add(mapVifLink(vmInitNetwork)); } } } List<Map<String, Object>> services = mapServices(); Map<String, Object> networkData = new HashMap<>(); if (links != null && !links.isEmpty()) { networkData.put("links", links); } if (networks != null && !networks.isEmpty()) { networkData.put("networks", networks); } if (services != null && !services.isEmpty()) { networkData.put("services", services); } return networkData; }
Source:
public void configure(Object... parameters) { if (parameters != null && parameters.length >= 9) { checkJBSName(); int index = 0; this.javaPath = parameters[index++].toString(); if (this.javaPath == null || this.javaPath.equals("")) { this.javaPath = "java"; } this.sshOptions = parameters[index++].toString(); this.schedulingPath = parameters[index++].toString(); this.javaOptions = parameters[index++].toString(); checkJavaOptions(); try { this.maxNodes = Integer.parseInt(parameters[index++].toString()); } catch (Exception e) { this.maxNodes = 1; } try { this.nodeTimeOut = Integer.parseInt(parameters[index++].toString()); } catch (Exception e) { this.nodeTimeOut = 1000 * 60 * 5; } this.serverName = parameters[index++].toString(); if (parameters[index] == null) { throw new IllegalArgumentException("Credentials must be specified"); } try { persistedInfraVariables.put(CREDENTIALS_KEY, Credentials.getCredentialsBase64((byte[]) parameters[index++])); } catch (KeyException e) { logger.debug("Could not retrieve base64 credentials", e); } if (parameters[index] != null) { this.submitJobOpt = parameters[index++].toString().replaceAll("\"", "\\\""); } } else { throw new IllegalArgumentException("Invalid parameters for IM creation"); } }

Target:
public void configure(Object... parameters) { if (parameters != null && parameters.length >= 9) { checkJBSName(); int index = 0; this.javaPath = parameters[index++].toString(); if (this.javaPath == null || this.javaPath.equals("")) { this.javaPath = "java"; } this.sshOptions = parameters[index++].toString(); this.schedulingPath = parameters[index++].toString(); this.javaOptions = parameters[index++].toString(); checkJavaOptions(); try { this.maxNodes = Integer.parseInt(parameters[index++].toString()); } catch (Exception e) { this.maxNodes = 1; } try { this.nodeTimeOut = Integer.parseInt(parameters[index++].toString()); } catch (Exception e) { this.nodeTimeOut = 1000 * 60 * 5; } this.serverName = parameters[index++].toString(); try { Object possibleCredentials = parameters[index++]; if (possibleCredentials != null) { persistedInfraVariables.put(CREDENTIALS_KEY, Credentials.getCredentialsBase64((byte[]) possibleCredentials)); } } catch (KeyException e) { throw new IllegalArgumentException("Could not retrieve base64 credentials", e); } if (parameters[index] != null) { this.submitJobOpt = parameters[index++].toString().replaceAll("\"", "\\\""); } } else { throw new IllegalArgumentException("Invalid parameters for IM creation"); } }
Source:
public void testImportVMFromConfigurationWhenStorageDomainIsInactive() { initCommand(getOvfEntityData()); StorageDomain storageDomain = createStorageDomain(); storageDomain.setStatus(StorageDomainStatus.Inactive); final StorageDomainDAO dao = mock(StorageDomainDAO.class); when(validator.validateUnregisteredEntity(any(IVdcQueryable.class), any(OvfEntityData.class), any(List.class))).thenReturn(new ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL2)); when(dao.getForStoragePool(storageDomainId, storagePoolId)).thenReturn(storageDomain); CanDoActionTestUtils.runAndAssertCanDoActionFailure(cmd, VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL2); }

Target:
public void testImportVMFromConfigurationWhenStorageDomainIsInactive() { initCommand(getOvfEntityData()); StorageDomain storageDomain = createStorageDomain(); storageDomain.setStatus(StorageDomainStatus.Inactive); final StorageDomainDAO dao = mock(StorageDomainDAO.class); when(validator.validateUnregisteredEntity(any(IVdcQueryable.class), any(OvfEntityData.class), anyList())).thenReturn(new ValidationResult(VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL2)); when(dao.getForStoragePool(storageDomainId, storagePoolId)).thenReturn(storageDomain); CanDoActionTestUtils.runAndAssertCanDoActionFailure(cmd, VdcBllMessages.ACTION_TYPE_FAILED_STORAGE_DOMAIN_STATUS_ILLEGAL2); }
Source:
private Metacard generateMetacard(InputStream message) throws IOException { try { if (message != null) { if (!transformer.isPresent()) { throw new IllegalArgumentException( "Transformation Failed for transformer: " + transformerId); } return transformer.get().transform(message); } else { throw new IllegalArgumentException("Data file is null."); } } catch (CatalogTransformerException e) { throw new IllegalArgumentException( "Transformation Failed for transformer: " + transformerId, e); } }

Target:
private Metacard generateMetacard(InputStream message) throws IOException { try { if (message == null) { throw new IllegalArgumentException("Data file is null."); } if (!transformer.isPresent()) { throw new IllegalArgumentException( "Transformation Failed for transformer: " + transformerId); } return transformer.get().transform(message); } catch (CatalogTransformerException e) { throw new IllegalArgumentException( "Transformation Failed for transformer: " + transformerId, e); } }
Source:
public void onePairVsDoublePair() { String pairOf8 = "2S 8H 6S 8D JH"; String doublePair = "4S 5H 4C 8C 5H"; assertEquals(Arrays.asList(doublePair), new Poker(Arrays.asList(pairOf8, doublePair)).getBestHands()); }

Target:
public void onePairVsDoublePair() { String pairOf8 = "2S 8H 6S 8D JH"; String doublePair = "4S 5H 4C 8C 5C"; assertEquals(Collections.singletonList(doublePair), new Poker(Arrays.asList(pairOf8, doublePair)).getBestHands()); }
Source:
private List<IClasspathEntry> collectGradleSourceFolders() throws JavaModelException { final List<IClasspathEntry> rawClasspath = ImmutableList.copyOf(this.project.getRawClasspath()); List<IClasspathEntry> sourceFolders = FluentIterable.from(this.sourceFolders).transform(new Function<OmniEclipseSourceDirectory, IClasspathEntry>() { @Override public IClasspathEntry apply(OmniEclipseSourceDirectory directory) { IFolder sourceDirectory = SourceFolderUpdater.this.project.getProject().getFolder(Path.fromOSString(directory.getPath())); FileUtils.ensureFolderHierarchyExists(sourceDirectory); final IPackageFragmentRoot root = SourceFolderUpdater.this.project.getPackageFragmentRoot(sourceDirectory); IClasspathAttribute fromGradleModel = JavaCore.newClasspathAttribute(CLASSPATH_ATTRIBUTE_FROM_GRADLE_MODEL, "true"); IPath[] includes = new IPath[] {}; IPath[] excludes = new IPath[] {}; Optional<IClasspathEntry> userDefinedClasspathEntry = FluentIterable.from(rawClasspath).firstMatch(new Predicate<IClasspathEntry>() { @Override public boolean apply(IClasspathEntry entry) { return root.getPath().toString().equals(entry.getPath().toString()); } }); if (userDefinedClasspathEntry.isPresent()) { includes = userDefinedClasspathEntry.get().getInclusionPatterns(); excludes = userDefinedClasspathEntry.get().getExclusionPatterns(); } return JavaCore.newSourceEntry(root.getPath(), includes, excludes, null, new IClasspathAttribute[]{fromGradleModel} ); } }).toList(); return ImmutableSet.copyOf(sourceFolders).asList(); }

Target:
private List<IClasspathEntry> collectGradleSourceFolders() throws JavaModelException { final List<IClasspathEntry> rawClasspath = ImmutableList.copyOf(this.project.getRawClasspath()); List<IClasspathEntry> sourceFolders = FluentIterable.from(this.sourceFolders).transform(new Function<OmniEclipseSourceDirectory, IClasspathEntry>() { @Override public IClasspathEntry apply(OmniEclipseSourceDirectory directory) { IFolder sourceDirectory = SourceFolderUpdater.this.project.getProject().getFolder(Path.fromOSString(directory.getPath())); FileUtils.ensureFolderHierarchyExists(sourceDirectory); final IPackageFragmentRoot root = SourceFolderUpdater.this.project.getPackageFragmentRoot(sourceDirectory); IClasspathAttribute fromGradleModel = JavaCore.newClasspathAttribute(CLASSPATH_ATTRIBUTE_FROM_GRADLE_MODEL, "true"); Optional<IClasspathEntry> userDefinedClasspathEntry = FluentIterable.from(rawClasspath).firstMatch(new Predicate<IClasspathEntry>() { @Override public boolean apply(IClasspathEntry entry) { return root.getPath().equals(entry.getPath()); } }); IPath[] includes = userDefinedClasspathEntry.isPresent() ? userDefinedClasspathEntry.get().getInclusionPatterns() : new IPath[] {}; IPath[] excludes = userDefinedClasspathEntry.isPresent() ? userDefinedClasspathEntry.get().getExclusionPatterns() : new IPath[] {}; return JavaCore.newSourceEntry(root.getPath(), includes, excludes, null, new IClasspathAttribute[]{fromGradleModel} ); } }).toList(); return ImmutableSet.copyOf(sourceFolders).asList(); }
Source:
protected ScrollPane doCreateVisual() { final VBox vBox = new VBox(); vBox.boundsInParentProperty().addListener(boundsListener); final ScrollPane scrollPane = new ScrollPane(vBox); scrollPane.getStylesheets().clear(); scrollPane.getStylesheets().add(URI.createPlatformPluginURI("resources/scrollPane.css", false).toPlatformString(false)); return scrollPane; }

Target:
protected ScrollPane doCreateVisual() { final VBox vBox = new VBox(); vBox.boundsInParentProperty().addListener(boundsListener); final ScrollPane scrollPane = new ScrollPane(vBox); scrollPane.getStylesheets().clear(); scrollPane.getStylesheets().add(URI.createPlatformPluginURI(VisualPartUtil.VIEWPORT_SCROLL_PANE_STYLE, false).toPlatformString(false)); return scrollPane; }
Source:
private void initObserver() { courseDateViewModel.getBannerInfo().observe(this, this::initInfoBanner); courseDateViewModel.getShowLoader().observe(this, flag -> preloadingListener.setLoadingState(flag ? PreLoadingListener.State.MAIN_UNIT_LOADING : PreLoadingListener.State.MAIN_UNIT_LOADED)); courseDateViewModel.getResetCourseDates().observe(this, resetCourseDates -> { if (resetCourseDates != null) { showShiftDateSnackBar(true); canFetchBannerInfo = false; authWebView.loadUrl(true, unit.getBlockUrl()); } }); courseDateViewModel.getErrorMessage().observe(this, errorMessage -> { if (errorMessage != null) { if (errorMessage.getThrowable() instanceof AuthException || errorMessage.getThrowable() instanceof HttpStatusException && ((HttpStatusException) errorMessage.getThrowable()).getStatusCode() == HttpStatus.UNAUTHORIZED) { environment.getRouter().forceLogout(getContextOrThrow(), environment.getAnalyticsRegistry(), environment.getNotificationDelegate()); } else { switch (errorMessage.getErrorCode()) { case ErrorMessage.BANNER_INFO_CODE: initInfoBanner(null); break; case ErrorMessage.COURSE_RESET_DATES_CODE: showShiftDateSnackBar(false); break; } } } }); }

Target:
private void initObserver() { courseDateViewModel = new ViewModelProvider(this, new ViewModelFactory()).get(CourseDateViewModel.class); courseDateViewModel.getBannerInfo().observe(this, this::initInfoBanner); courseDateViewModel.getShowLoader().observe(this, flag -> preloadingListener.setLoadingState(flag ? PreLoadingListener.State.MAIN_UNIT_LOADING : PreLoadingListener.State.MAIN_UNIT_LOADED)); courseDateViewModel.getResetCourseDates().observe(this, resetCourseDates -> { if (resetCourseDates != null) { showShiftDateSnackBar(true); authWebView.loadUrl(true, unit.getBlockUrl()); } }); courseDateViewModel.getErrorMessage().observe(this, errorMessage -> { if (errorMessage != null) { if (errorMessage.getThrowable() instanceof AuthException || errorMessage.getThrowable() instanceof HttpStatusException && ((HttpStatusException) errorMessage.getThrowable()).getStatusCode() == HttpStatus.UNAUTHORIZED) { environment.getRouter().forceLogout(getContextOrThrow(), environment.getAnalyticsRegistry(), environment.getNotificationDelegate()); } else { switch (errorMessage.getErrorCode()) { case ErrorMessage.BANNER_INFO_CODE: initInfoBanner(null); break; case ErrorMessage.COURSE_RESET_DATES_CODE: showShiftDateSnackBar(false); break; } } } }); }
Source:
public void setAsDisplay() { final Network network = (Network) Cloner.clone(getSelectedItem()); network.getCluster().setDisplay(true); final AttachNetworkToVdsGroupParameter attachNetworkToVdcGroupParameter = new AttachNetworkToVdsGroupParameter(getEntity(), network); Frontend.getInstance().runAction(VdcActionType.AttachNetworkToVdsGroup, attachNetworkToVdcGroupParameter); }

Target:
public void setAsDisplay() { final Network network = (Network) Cloner.clone(getSelectedItem()); network.getCluster().setDisplay(true); final NetworkClusterParameters networkClusterParameters = new NetworkClusterParameters(network.getCluster()); Frontend.getInstance().runAction(VdcActionType.UpdateNetworkOnCluster, networkClusterParameters); }
Source:
public boolean isProcessed() { if (getOperatorsToDeploy().size() == 0 && getOperatorsToUndeploy().size() == 0) { return true; } return false; }

Target:
public boolean isProcessed() { return (getOperatorsToDeploy().isEmpty() && getOperatorsToUndeploy().isEmpty()); }
Source:
private File getBackupFile(int age) { List<Long> fileTimes = new ArrayList<Long>(); File folder = new File(file.getParent() + File.separator + BACKUP_EXTENSION); File[] files = folder.listFiles(); if (files != null) { int count = files.length; for (int i = 0; i < count; i++) { if (files[i].isFile()) { String[] parts = files[i].getName().split(SEPARATOR); if (parts.length != 2 || !parts[1].equals(file.getName())) { continue; } long time = Long.parseLong(parts[0]); fileTimes.add(time); } } } Collections.sort(fileTimes); if (fileTimes.size() < age) { return null; } return new File(file.getParent() + File.separator + BACKUP_EXTENSION, fileTimes.get(fileTimes.size() - age) + SEPARATOR + file.getName()); }

Target:
private File getBackupFile(int age) { List<Long> fileTimes = calculateFileTimes(); if (fileTimes.size() < age) { return null; } return new File(file.getParent() + File.separator + BACKUP_EXTENSION, fileTimes.get(fileTimes.size() - age) + SEPARATOR + file.getName()); }
Source:
public void stop() { traces.forEach((name, state) -> { final Deque<String> queue = state.get(); final String previous = checkValue(name, queue.pollLast()); @Nullable final String current = queue.peekLast(); runIf(listeners::onStop, name, previous); runIf(stackedListeners::onStop, name, previous); runIf(listeners::onStart, name, current); }); }

Target:
public void stop() { traces.forEach((name, state) -> { final Deque<String> queue = state.get(); @Nullable final String previous = checkValue(name, queue.pollLast()); @Nullable final String current = queue.peekLast(); runIf(listeners::onStop, name, previous); runIf(stackedListeners::onStop, name, previous); runIf(listeners::onStart, name, current); }); }
Source:
public ScenarioSimulationModel() { simulation = new Simulation(); SimulationDescriptor simulationDescriptor = simulation.getSimulationDescriptor(); simulationDescriptor.addFactMapping(FactIdentifier.DESCRIPTION.getName(), FactIdentifier.DESCRIPTION, ExpressionIdentifier.DESCRIPTION); Scenario scenario = simulation.addScenario(); Random random = new Random(); scenario.setDescription(FactIdentifier.DESCRIPTION.getName() + random.nextInt()); IntStream.range(1, 3).forEach(id -> { ExpressionIdentifier givenExpression = ExpressionIdentifier.create(String.valueOf(random.nextLong()), FactMappingType.GIVEN); FactIdentifier givenFact = FactIdentifier.create(FactMappingType.GIVEN + "FACT-" + id, String.class.getCanonicalName()); simulationDescriptor.addFactMapping(FactMappingType.GIVEN + "-" + id, givenFact, givenExpression); scenario.addMappingValue(givenFact, givenExpression, FactMappingType.GIVEN + "-" + id + random.nextInt()); }); IntStream.range(1, 3).forEach(id -> { ExpressionIdentifier expectedExpression = ExpressionIdentifier.create(String.valueOf(random.nextLong()), FactMappingType.EXPECTED); FactIdentifier expectFact = FactIdentifier.create(FactMappingType.EXPECTED + "FACT-" + id, String.class.getCanonicalName()); simulationDescriptor.addFactMapping(FactMappingType.EXPECTED + "-" + id, expectFact, expectedExpression); scenario.addMappingValue(expectFact, expectedExpression, FactMappingType.EXPECTED + "-" + id + random.nextInt()); }); }

Target:
public ScenarioSimulationModel() { simulation = new Simulation(); SimulationDescriptor simulationDescriptor = simulation.getSimulationDescriptor(); simulationDescriptor.addFactMapping(FactIdentifier.DESCRIPTION.getName(), FactIdentifier.DESCRIPTION, ExpressionIdentifier.DESCRIPTION); Scenario scenario = simulation.addScenario(); int row = simulation.getUnmodifiableScenarios().indexOf(scenario); scenario.setDescription(FactMappingValue.getPlaceHolder(0, 0)); IntStream.range(1, 3).forEach(id -> { ExpressionIdentifier givenExpression = ExpressionIdentifier.create(row + "|" + id, FactMappingType.GIVEN); FactIdentifier givenFact = FactIdentifier.create(FactMappingType.GIVEN + "FACT-" + id, String.class.getCanonicalName()); simulationDescriptor.addFactMapping(FactMapping.getPlaceHolder(FactMappingType.GIVEN, id), givenFact, givenExpression); scenario.addMappingValue(givenFact, givenExpression, FactMappingValue.getPlaceHolder(row, id)); }); IntStream.range(1, 3).forEach(id -> { id += 2; ExpressionIdentifier expectedExpression = ExpressionIdentifier.create(row + "|" + id, FactMappingType.EXPECTED); FactIdentifier expectFact = FactIdentifier.create(FactMappingType.EXPECTED + "FACT-" + id, String.class.getCanonicalName()); simulationDescriptor.addFactMapping(FactMapping.getPlaceHolder(FactMappingType.EXPECTED, id), expectFact, expectedExpression); scenario.addMappingValue(expectFact, expectedExpression, FactMappingValue.getPlaceHolder(row, id)); }); }
Source:
public boolean removeNode(N node) { checkNotNull(node, "node"); if (!nodes().contains(node)) { return false; } for (N nodeToRemove : Graphs.reachableNodes(delegate, node)) { delegate.removeNode(nodeToRemove); depths.remove(nodeToRemove); } root.filter(value -> value.equals(node)).ifPresent(value -> setRoot(Optional.empty())); height = Optional.empty(); return true; }

Target:
public boolean removeNode(N node) { checkNotNull(node, "node"); if (!nodes().contains(node)) { return false; } for (N nodeToRemove : Graphs.reachableNodes(delegate, node)) { delegate.removeNode(nodeToRemove); depths.remove(nodeToRemove); } if (root.isPresent() && root.get().equals(node)) { setRoot(Optional.empty()); } height = Optional.empty(); return true; }
Source:
static Map<String, String> mergeKeyValueMetadata(InitContext context, Schema readerSchema) { Map<String, Set<String>> unmergedKeyValueMetadata = context.getKeyValueMetadata(); Map<String, String> mergedKeyValueMetadata = new HashMap<String, String>(); Iterator<Map.Entry<String, Set<String>>> entryIterator = unmergedKeyValueMetadata.entrySet().iterator(); while (entryIterator.hasNext()) { Map.Entry<String, Set<String>> entry = entryIterator.next(); String key = entry.getKey(); if (key.equals(AVRO_SCHEMA_METADATA_KEY)) { Set<String> writerSchemaStrings = entry.getValue(); Set<Schema> writerSchemas = new HashSet<Schema>(); for (String s : writerSchemaStrings) { Schema.Parser parser = new Schema.Parser(); Schema writerSchema = parser.parse(s); writerSchemas.add(writerSchema); } if (!areSchemasCompatible(readerSchema, writerSchemas)) throw new RuntimeException("could not merge metadata: key " + AVRO_SCHEMA_METADATA_KEY + " contains incompatible schemas"); mergedKeyValueMetadata.put(AVRO_SCHEMA_METADATA_KEY, readerSchema.toString()); } else if (entry.getValue().size() > 1) { throw new RuntimeException("could not merge metadata: key " + key + " has conflicting values"); } else { String value = entry.getValue().iterator().next(); mergedKeyValueMetadata.put(key, value); } } return mergedKeyValueMetadata; }

Target:
static Map<String, String> mergeKeyValueMetadata(InitContext context, Schema readerSchema) { Map<String, Set<String>> unmergedKeyValueMetadata = context.getKeyValueMetadata(); Map<String, String> mergedKeyValueMetadata = new HashMap<String, String>(); Iterator<Map.Entry<String, Set<String>>> entryIterator = unmergedKeyValueMetadata.entrySet().iterator(); while (entryIterator.hasNext()) { Map.Entry<String, Set<String>> entry = entryIterator.next(); String key = entry.getKey(); if (key.equals(AVRO_SCHEMA_METADATA_KEY)) { Set<String> writerSchemaStrings = entry.getValue(); Set<Schema> writerSchemas = new HashSet<Schema>(); for (String s : writerSchemaStrings) { Schema.Parser parser = new Schema.Parser(); Schema writerSchema = parser.parse(s); writerSchemas.add(writerSchema); } if (!areSchemasCompatible(readerSchema, writerSchemas)) { throw new RuntimeException("could not merge metadata: key " + AVRO_SCHEMA_METADATA_KEY + " contains incompatible schemas"); } mergedKeyValueMetadata.put(AVRO_SCHEMA_METADATA_KEY, readerSchema.toString()); } else if (entry.getValue().size() > 1) { throw new RuntimeException("could not merge metadata: key " + key + " has conflicting values"); } else { String value = entry.getValue().iterator().next(); mergedKeyValueMetadata.put(key, value); } } return mergedKeyValueMetadata; }
Source:
private void handleNullTypeArguments( AnnotatedTypeFactory typeFactory, ExecutableElement methodElem, AnnotatedExecutableType methodType, List<AnnotatedTypeMirror> argTypes, AnnotatedTypeMirror assignedTo, Set<TypeVariable> targets, Map<TypeVariable, AnnotatedTypeMirror> inferredArgs) { if (!hasNullType(inferredArgs)) { return; } final Map<TypeVariable, AnnotatedTypeMirror> inferredArgsWithoutNull = infer(typeFactory, argTypes, assignedTo, methodElem, methodType, targets, false); for (AnnotatedTypeVariable atv : methodType.getTypeVariables()) { TypeVariable typeVar = atv.getUnderlyingType(); AnnotatedTypeMirror result = inferredArgs.get(typeVar); if (result == null) { AnnotatedTypeMirror withoutNullResult = inferredArgsWithoutNull.get(typeVar); if (withoutNullResult != null) { inferredArgs.put(typeVar, withoutNullResult); } } else if (result.getKind() == TypeKind.NULL) { AnnotatedTypeMirror withoutNullResult = inferredArgsWithoutNull.get(typeVar); if (withoutNullResult == null) { if (objectWithAnnosFromNull == null) { Elements elements = typeFactory.getProcessingEnv().getElementUtils(); TypeMirror objectTM = elements.getTypeElement("java.lang.Object").asType(); objectWithAnnosFromNull = AnnotatedTypeMirror.createType(objectTM, typeFactory, false); objectWithAnnosFromNull.addAnnotations(result.getAnnotations()); } withoutNullResult = objectWithAnnosFromNull; } AnnotatedTypeMirror lub = AnnotatedTypes.leastUpperBound(typeFactory, withoutNullResult, result); inferredArgs.put(typeVar, lub); } } }

Target:
private void handleNullTypeArguments( AnnotatedTypeFactory typeFactory, ExecutableElement methodElem, AnnotatedExecutableType methodType, List<AnnotatedTypeMirror> argTypes, AnnotatedTypeMirror assignedTo, Set<TypeVariable> targets, Map<TypeVariable, AnnotatedTypeMirror> inferredArgs) { if (!hasNullType(inferredArgs)) { return; } final Map<TypeVariable, AnnotatedTypeMirror> inferredArgsWithoutNull = infer(typeFactory, argTypes, assignedTo, methodElem, methodType, targets, false); for (AnnotatedTypeVariable atv : methodType.getTypeVariables()) { TypeVariable typeVar = atv.getUnderlyingType(); AnnotatedTypeMirror result = inferredArgs.get(typeVar); if (result == null) { AnnotatedTypeMirror withoutNullResult = inferredArgsWithoutNull.get(typeVar); if (withoutNullResult != null) { inferredArgs.put(typeVar, withoutNullResult); } } else if (result.getKind() == TypeKind.NULL) { AnnotatedTypeMirror withoutNullResult = inferredArgsWithoutNull.get(typeVar); if (withoutNullResult == null) { withoutNullResult = atv.getUpperBound().deepCopy(); } AnnotatedTypeMirror lub = AnnotatedTypes.leastUpperBound(typeFactory, withoutNullResult, result); inferredArgs.put(typeVar, lub); } } }
Source:
public void enableWireframe() { boolean refreshTaskList = false; EnableFaceCulling faceCullingStateChange = new EnableFaceCulling(); if (getDesiredStateChanges().contains(faceCullingStateChange)) { removeDesiredStateChange(faceCullingStateChange); refreshTaskList = true; } if (!getDesiredStateChanges().contains(wireframeStateChange)) { addDesiredStateChange(wireframeStateChange); refreshTaskList = true; } if (refreshTaskList) { worldRenderer.requestTaskListRefresh(); } }

Target:
public void enableWireframe() { if (!getDesiredStateChanges().contains(wireframeStateChange)) { removeDesiredStateChange(faceCullingStateChange); addDesiredStateChange(wireframeStateChange); worldRenderer.requestTaskListRefresh(); } }
Source:
public final void remove(int n) throws IOException { try { queueFile.remove(n); if (listener != null) { for (int i = 0; i < n; i++) listener.onRemove(this); } } catch (IOException e) { throw new FileException("Failed to remove.", e, file); } }

Target:
public final void remove(int n) throws IOException { try { queueFile.remove(n); if (listener != null) { for (int i = 0; i < n; i++) { listener.onRemove(this); } } } catch (IOException e) { throw new FileException("Failed to remove.", e, file); } }
Source:
public void testBooleanExplosion() { Stopwatch stopwatch = Stopwatch.createStarted(); String regex = "[0-9]*a[0-9]{50,80}"; int maxExpand = 10; int maxStatesTraced = 10000; int maxDeterminizedStates = 20000; int maxNgramsExtracted = 10000; Automaton automaton = new RegExp( regex.toLowerCase(Locale.ENGLISH), RegExp.ALL ^ RegExp.AUTOMATON ).toAutomaton(maxDeterminizedStates); NGramExtractor extractor = new NGramExtractor(3, maxExpand, maxStatesTraced, maxNgramsExtracted); Expression<String> expression = extractor.extract(automaton); assertTrue(expression.countClauses() == Integer.MAX_VALUE); expression = new ExpressionRewriter<>(expression).degradeAsDisjunction(maxNgramsExtracted); assertTrue(expression.getClass() == Or.class); assertFalse(expression.alwaysFalse()); assertFalse(expression.alwaysTrue()); assertTrue(expression.countClauses() <= maxNgramsExtracted); stopwatch.stop(); assertTrue(stopwatch.elapsed(TimeUnit.MILLISECONDS) < 500); }

Target:
public void testBooleanExplosion() { TestUtils.assertExecTime(500, () -> { String regex = "[0-9]*a[0-9]{50,80}"; int maxExpand = 10; int maxStatesTraced = 10000; int maxDeterminizedStates = 20000; int maxNgramsExtracted = 10000; Automaton automaton = new RegExp( regex.toLowerCase(Locale.ENGLISH), RegExp.ALL ^ RegExp.AUTOMATON ).toAutomaton(maxDeterminizedStates); NGramExtractor extractor = new NGramExtractor(3, maxExpand, maxStatesTraced, maxNgramsExtracted); Expression<String> expression = extractor.extract(automaton); assertTrue(expression.countClauses() == Integer.MAX_VALUE); expression = new ExpressionRewriter<>(expression).degradeAsDisjunction(maxNgramsExtracted); assertTrue(expression.getClass() == Or.class); assertFalse(expression.alwaysFalse()); assertFalse(expression.alwaysTrue()); assertTrue(expression.countClauses() <= maxNgramsExtracted); } ); }
Source:
public void getRegisters(final IDMContext dmc, final DataRequestMonitor<IRegisterDMContext[]> rm) { final MIRegisterGroupDMC groupDmc = DMContexts.getAncestorOfType(dmc, MIRegisterGroupDMC.class); if (groupDmc == null) { rm.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, INVALID_HANDLE, "RegisterGroup context not found", null)); rm.done(); return; } final IContainerDMContext containerDmc = DMContexts.getAncestorOfType(dmc, IContainerDMContext.class); if (containerDmc == null) { rm.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, INVALID_HANDLE, "Container context not found", null)); rm.done(); return; } if (groupDmc.getGroupNo() == 0) { final IFrameDMContext frameDmc = DMContexts.getAncestorOfType(dmc, IFrameDMContext.class); if (frameDmc == null) { IMIExecutionDMContext execDmc = DMContexts.getAncestorOfType(dmc, IMIExecutionDMContext.class); if (execDmc != null) { MIStack stackService = getServicesTracker().getService(MIStack.class); if (stackService != null) { stackService.getTopFrame(execDmc, new DataRequestMonitor<IStack.IFrameDMContext>(getSession() .getExecutor(), rm) { @Override protected void handleSuccess() { getRegisters(getData(), groupDmc, containerDmc, rm); } @Override protected void handleFailure() { getRegisters(null, groupDmc, containerDmc, rm); } }); return; } } } getRegisters(frameDmc, groupDmc, containerDmc, rm); } else { rm.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, INTERNAL_ERROR, "Invalid group = " + groupDmc, null)); rm.done(); } }

Target:
public void getRegisters(final IDMContext dmc, final DataRequestMonitor<IRegisterDMContext[]> rm) { final MIRegisterGroupDMC groupDmc = DMContexts.getAncestorOfType(dmc, MIRegisterGroupDMC.class); if (groupDmc == null) { rm.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, INVALID_HANDLE, "RegisterGroup context not found", null)); rm.done(); return; } final IContainerDMContext containerDmc = DMContexts.getAncestorOfType(dmc, IContainerDMContext.class); if (containerDmc == null) { rm.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, INVALID_HANDLE, "Container context not found", null)); rm.done(); return; } if (groupDmc.getGroupNo() == 0) { final IFrameDMContext frameDmc = DMContexts.getAncestorOfType(dmc, IFrameDMContext.class); if (frameDmc == null) { IMIExecutionDMContext execDmc = DMContexts.getAncestorOfType(dmc, IMIExecutionDMContext.class); if (execDmc != null) { IStack stackService = getServicesTracker().getService(IStack.class); if (stackService != null) { stackService.getTopFrame(execDmc, new ImmediateDataRequestMonitor<IStack.IFrameDMContext>(rm) { @Override protected void handleSuccess() { getRegisters(getData(), groupDmc, containerDmc, rm); } @Override protected void handleFailure() { getRegisters(null, groupDmc, containerDmc, rm); } }); return; } } } getRegisters(frameDmc, groupDmc, containerDmc, rm); } else { rm.setStatus(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, INTERNAL_ERROR, "Invalid group = " + groupDmc, null)); rm.done(); } }
Source:
@Override public TaskResult syncShards() { return periodicShardSyncManager.start(); }

Target:
public TaskResult syncShards() { return periodicShardSyncManager.start(); }
Source:
boolean isInWorkspace(IStorage storage) { final IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); if (root != null) { if (root.getFile(storage.getFullPath()).exists()) { return true; } } return false; }

Target:
boolean isInWorkspace(IStorage storage) { final IWorkspaceRoot root = ResourcesPlugin.getWorkspace().getRoot(); if (root != null) { return root.getFile(storage.getFullPath()).isAccessible(); } return false; }
Source:
public Secret getClientKey() { return clientKey; }

Target:
public String getClientKey() { return Secret.toString(clientKey); }
Source:
private void awaitServerInitializationForJBossModulesBasedContainer(Instrumentation instrumentation) { while (true) { String loggingManagerClassName = System.getProperty("java.util.logging.manager"); if (loggingManagerClassName != null) { if (isClassLoaded(loggingManagerClassName, instrumentation)) { break; } } try { Thread.sleep(200); } catch (InterruptedException e) { throw new RuntimeException(e); } } }

Target:
private void awaitServerInitializationForJBossModulesBasedContainer(Instrumentation instrumentation) { int count = 0; while (count * LOGGING_DETECT_INTERVAL < LOGGING_DETECT_TIMEOUT) { String loggingManagerClassName = System.getProperty("java.util.logging.manager"); if (loggingManagerClassName != null) { if (isClassLoaded(loggingManagerClassName, instrumentation)) { return; } } try { Thread.sleep(LOGGING_DETECT_INTERVAL); count++; } catch (InterruptedException e) { throw new RuntimeException(e); } } throw new IllegalStateException(String.format("Detected JBoss Module loader, but property java.util.logging.manager is not set after %d seconds", LOGGING_DETECT_TIMEOUT / 1000)); }
Source:
private void search() { if (model != null) { int fieldIndex = searchInput.getCmbFilterTypeIndex(); if (fieldIndex != -1) { JournalParameters parameters = new JournalParameters(); final JournalField field = FIELDS[fieldIndex]; parameters.setField(field); if (field == JournalField.RUN_NUMBER) { parameters.setNumbers(searchInput.getRunNumberFrom(), searchInput.getRunNumberTo()); } else if (field == JournalField.START_TIME) { parameters.setTimes(searchInput.getStartTimeFrom(), searchInput.getStartTimeTo()); } else { parameters.setSearchString(searchInput.getActiveSearchText()); } runSearchJob(parameters); } } }

Target:
private void search() { resetPageNumber(); int fieldIndex = searchInput.getCmbFilterTypeIndex(); JournalSearch search = null; final JournalField field = model.getSearchableFields().get(fieldIndex); if (field == JournalField.RUN_NUMBER) { search = new SearchNumber(field, searchInput.getRunNumberFrom(), searchInput.getRunNumberTo()); } else if (field == JournalField.START_TIME) { search = new SearchTime(field, searchInput.getStartTimeFrom(), searchInput.getStartTimeTo()); } else { search = new SearchString(field, searchInput.getActiveSearchText()); } model.setActiveSearch(search); setProgressIndicatorsVisible(true); model.setPageNumber(1).thenAccept(ignored -> setProgressIndicatorsVisible(false)); }
Source:
private void handleException(VDSExceptionBase e, String reason) { final VDSReturnValue vdsReturnValue = getVDSReturnValue(); vdsReturnValue.setSucceeded(false); vdsReturnValue.setExceptionString(e.toString()); vdsReturnValue.setExceptionObject(e); vdsReturnValue.setVdsError(e.getVdsError()); final String msg = MessageFormatter .format("Failed to poll host - {}.", getParameters().getVdsId(), reason) .getMessage(); log.debug(msg, e); }

Target:
private void handleException(VDSExceptionBase e, String reason) { setVdsRuntimeError(e); final String msg = MessageFormatter .format("Failed to poll host - {}.", getParameters().getVdsId(), reason) .getMessage(); log.debug(msg, e); }
Source:
public default Type getCommonType() { return getVariables().stream().map(v -> v.getType()) .sorted((Comparator<Type<?>>) (a, b) -> a.getArrayLevel() - b.getArrayLevel()) .findFirst() .orElse(null); }

Target:
default Type getCommonType() { NodeList<VariableDeclarator> variables = getVariables(); if (variables.isEmpty()) { throw new AssertionError("There is no common type since there are no variables."); } Type type = variables.get(0).getType(); for (int i = 1; i < variables.size(); i++) { if (!variables.get(i).getType().equals(type)) { throw new AssertionError("The variables do not have a common type."); } } return type; }