auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testCreateSSLContext_validCustomSSLContextClass() throws X509Exception.SSLContextException { ZKConfig zkConfig = new ZKConfig(); ClientX509Util clientX509Util = new ClientX509Util(); zkConfig.setProperty(clientX509Util.getSslContextSupplierClassProperty(), X509UtilTest.class.getCanonicalName() + "$" + SslContextSupplier.class.getSimpleName()); final SSLContext sslContext = clientX509Util.createSSLContext(zkConfig); assertNotNull(sslContext); }

Target:
public void testCreateSSLContext_validCustomSSLContextClass() throws Exception { ZKConfig zkConfig = new ZKConfig(); ClientX509Util clientX509Util = new ClientX509Util(); zkConfig.setProperty(clientX509Util.getSslContextSupplierClassProperty(), SslContextSupplier.class.getName()); final SSLContext sslContext = clientX509Util.createSSLContext(zkConfig); Assert.assertEquals(SSLContext.getDefault(), sslContext); }
Source:
public void testGetTrackInfo() throws InterruptedException { prepareLooper(); final CountDownLatch latch = new CountDownLatch(1); final List<SessionPlayer.TrackInfo> testTracks = TestUtils.createTrackInfoList(); final ControllerCallback callback = new ControllerCallback() { @Override public void onTrackInfoChanged(MediaController controller, List<SessionPlayer.TrackInfo> trackInfos) { for (int i = 0; i < testTracks.size(); i++) { SessionPlayer.TrackInfo track = testTracks.get(i); SessionPlayer.TrackInfo trackFromController = trackInfos.get(i); assertEquals(track, trackFromController); assertEquals(track.getId(), trackFromController.getId()); assertEquals(track.getLanguage(), trackFromController.getLanguage()); assertEquals(track.getTrackType(), trackFromController.getTrackType()); } } }; MediaController controller = createController(mSession.getToken(), true, null, callback); mPlayer.notifyTrackInfoChanged(testTracks); assertTrue(latch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS)); }

Target:
public void testGetTrackInfo() throws InterruptedException { prepareLooper(); final CountDownLatch latch = new CountDownLatch(1); final List<SessionPlayer.TrackInfo> testTracks = TestUtils.createTrackInfoList(); final ControllerCallback callback = new ControllerCallback() { @Override public void onTrackInfoChanged(MediaController controller, List<SessionPlayer.TrackInfo> trackInfos) { assertEquals(testTracks.size(), trackInfos.size()); for (int i = 0; i < testTracks.size(); i++) { SessionPlayer.TrackInfo track = testTracks.get(i); SessionPlayer.TrackInfo trackFromController = trackInfos.get(i); assertEquals(track, trackFromController); assertEquals(track.getLanguage(), trackFromController.getLanguage()); assertEquals(track.getTrackType(), trackFromController.getTrackType()); } latch.countDown(); } }; MediaController controller = createController(mSession.getToken(), true, null, callback); mPlayer.notifyTrackInfoChanged(testTracks); assertTrue(latch.await(TIMEOUT_MS, TimeUnit.MILLISECONDS)); }
Source:
private StoreFileInfo(final Configuration conf, final FileSystem fs, final FileStatus fileStatus, final Path initialPath, final boolean primaryReplica) throws IOException { assert fs != null; assert initialPath != null; assert conf != null; this.fs = fs; this.conf = conf; this.initialPath = initialPath; this.primaryReplica = primaryReplica; this.noReadahead = this.conf.getBoolean(STORE_FILE_READER_NO_READAHEAD, DEFAULT_STORE_FILE_READER_NO_READAHEAD); Path p = initialPath; if (HFileLink.isHFileLink(p)) { this.reference = null; this.link = HFileLink.buildFromHFileLinkPattern(conf, p); LOG.trace("{} is a link", p); } else if (isReference(p)) { this.reference = Reference.read(fs, p); Path referencePath = getReferredToFile(p); if (HFileLink.isHFileLink(referencePath)) { this.link = HFileLink.buildFromHFileLinkPattern(conf, referencePath); } else { this.link = null; } LOG.trace("{} is a reference to {}", p, reference.getFileRegion(), referencePath); } else if (isHFile(p) || isMobFile(p) || isMobRefFile(p)) { if (fileStatus != null) { this.localStatus = fileStatus; }else{ this.localStatus = loadAndCacheFileStatus(fs); } this.createdTimestamp = localStatus.getModificationTime(); this.size = localStatus.getLen(); this.reference = null; this.link = null; } else { throw new IOException("path=" + p + " doesn't look like a valid StoreFile"); } if(this.localStatus == null ){ this.localStatus = loadAndCacheFileStatus(fs); } }

Target:
private StoreFileInfo(final Configuration conf, final FileSystem fs, final FileStatus fileStatus, final Path initialPath, final boolean primaryReplica) throws IOException { assert fs != null; assert initialPath != null; assert conf != null; this.fs = fs; this.conf = conf; this.initialPath = initialPath; this.primaryReplica = primaryReplica; this.noReadahead = this.conf.getBoolean(STORE_FILE_READER_NO_READAHEAD, DEFAULT_STORE_FILE_READER_NO_READAHEAD); Path p = initialPath; if (HFileLink.isHFileLink(p)) { this.reference = null; this.link = HFileLink.buildFromHFileLinkPattern(conf, p); LOG.trace("{} is a link", p); } else if (isReference(p)) { this.reference = Reference.read(fs, p); Path referencePath = getReferredToFile(p); if (HFileLink.isHFileLink(referencePath)) { this.link = HFileLink.buildFromHFileLinkPattern(conf, referencePath); } else { this.link = null; } LOG.trace("{} is a reference to {}", p, reference.getFileRegion(), referencePath); } else if (isHFile(p) || isMobFile(p) || isMobRefFile(p)) { if (fileStatus != null) { this.localStatus = fileStatus; } else { this.localStatus = loadAndCacheFileStatus(fs); } this.createdTimestamp = localStatus.getModificationTime(); this.size = localStatus.getLen(); this.reference = null; this.link = null; } else { throw new IOException("path=" + p + " doesn't look like a valid StoreFile"); } }
Source:
public static void submitHadoopFSJob( String projectId, String region, String clusterName, String hadoopFSQuery) throws IOException, InterruptedException { String myEndpoint = String.format("%s-dataproc.googleapis.com:443", region); JobControllerSettings jobControllerSettings = JobControllerSettings.newBuilder().setEndpoint(myEndpoint).build(); try (JobControllerClient jobControllerClient = JobControllerClient.create(jobControllerSettings)) { JobPlacement jobPlacement = JobPlacement.newBuilder().setClusterName(clusterName).build(); HadoopJob hadoopJob = HadoopJob.newBuilder() .setMainClass("org.apache.hadoop.fs.FsShell") .addAllArgs(stringToList(hadoopFSQuery)) .build(); Job job = Job.newBuilder().setPlacement(jobPlacement).setHadoopJob(hadoopJob).build(); OperationFuture<Job, JobMetadata> submitJobAsOperationAsyncRequest = jobControllerClient.submitJobAsOperationAsync(projectId, region, job); Job response = submitJobAsOperationAsyncRequest.get(); Matcher matches = Pattern.compile("gs://(.*?)/(.*)").matcher(response.getDriverOutputResourceUri()); matches.matches(); Storage storage = StorageOptions.getDefaultInstance().getService(); Blob blob = storage.get(matches.group(1), String.format("%s.000000000", matches.group(2))); System.out.println(String.format("Job \"%s\" finished: %s", response.getReference().getJobId(), new String(blob.getContent()))); } catch (ExecutionException e) { System.err.println(String.format("submitHadoopFSJob: %s ", e.getMessage())); } }

Target:
public static void submitHadoopFSJob( String projectId, String region, String clusterName, String hadoopFSQuery) throws IOException, InterruptedException { String myEndpoint = String.format("%s-dataproc.googleapis.com:443", region); JobControllerSettings jobControllerSettings = JobControllerSettings.newBuilder().setEndpoint(myEndpoint).build(); try (JobControllerClient jobControllerClient = JobControllerClient.create(jobControllerSettings)) { JobPlacement jobPlacement = JobPlacement.newBuilder().setClusterName(clusterName).build(); HadoopJob hadoopJob = HadoopJob.newBuilder() .setMainClass("org.apache.hadoop.fs.FsShell") .addAllArgs(stringToList(hadoopFSQuery)) .build(); Job job = Job.newBuilder().setPlacement(jobPlacement).setHadoopJob(hadoopJob).build(); OperationFuture<Job, JobMetadata> submitJobAsOperationAsyncRequest = jobControllerClient.submitJobAsOperationAsync(projectId, region, job); Job response = submitJobAsOperationAsyncRequest.get(); Matcher matches = Pattern.compile("gs://(.*?)/(.*)").matcher(response.getDriverOutputResourceUri()); matches.matches(); Storage storage = StorageOptions.getDefaultInstance().getService(); Blob blob = storage.get(matches.group(1), String.format("%s.000000000", matches.group(2))); System.out.println( String.format("Job finished successfully: %s", new String(blob.getContent()))); } catch (ExecutionException e) { System.err.println(String.format("submitHadoopFSJob: %s ", e.getMessage())); } }
Source:
public void addIncludedGroup(final AccountGroup.Id groupId, final String groupName, final AsyncCallback<GroupDetail> callback) { run(callback, new Action<GroupDetail>() { public GroupDetail run(ReviewDb db) throws OrmException, Failure, NoSuchGroupException { final GroupControl control = groupControlFactory.validateFor(groupId); if (control.getAccountGroup().getType() != AccountGroup.Type.INTERNAL) { throw new Failure(new NameAlreadyUsedException()); } final AccountGroup a = findGroup(groupName); if (!control.canAddGroup(a.getId())) { throw new Failure(new NoSuchEntityException()); } final AccountGroupIncludedGroup.Key key = new AccountGroupIncludedGroup.Key(groupId, a.getId()); AccountGroupIncludedGroup m = db.accountGroupIncludedGroups().get(key); if (m == null) { m = new AccountGroupIncludedGroup(key); db.accountGroupIncludedGroupsAudit().insert( Collections.singleton(new AccountGroupIncludedGroupAudit(m, getAccountId()))); db.accountGroupIncludedGroups().insert(Collections.singleton(m)); includedGroupCache.evictGroup(groupId); includedGroupCache.evictIncludedGroup(a.getId()); } return groupDetailFactory.create(groupId).call(); } }); }

Target:
public void addIncludedGroup(final AccountGroup.Id groupId, final String groupName, final AsyncCallback<GroupDetail> callback) { run(callback, new Action<GroupDetail>() { public GroupDetail run(ReviewDb db) throws OrmException, Failure, NoSuchGroupException { final GroupControl control = groupControlFactory.validateFor(groupId); if (control.getAccountGroup().getType() != AccountGroup.Type.INTERNAL) { throw new Failure(new NameAlreadyUsedException()); } final AccountGroup a = findGroup(groupName); if (!control.canAddGroup(a.getId())) { throw new Failure(new NoSuchEntityException()); } final AccountGroupIncludedGroup.Key key = new AccountGroupIncludedGroup.Key(groupId, a.getId()); AccountGroupIncludedGroup m = db.accountGroupIncludedGroups().get(key); if (m == null) { m = new AccountGroupIncludedGroup(key); db.accountGroupIncludedGroupsAudit().insert( Collections.singleton(new AccountGroupIncludedGroupAudit(m, getAccountId()))); db.accountGroupIncludedGroups().insert(Collections.singleton(m)); includedGroupCache.evictIncludedGroup(a.getId()); } return groupDetailFactory.create(groupId).call(); } }); }
Source:
default StreamPriority getStreamPriority() { return StreamPriority.DEFAULT; }

Target:
default StreamPriority getStreamPriority() { return null; }
Source:
public Menu generatePanelMenu() { Menu panelMenu = new Menu("Panels"); Menu autoCreatePanelMenu = new Menu("Auto-create"); List<MenuItem> items = new ArrayList<>(); List<MenuItem> autoCreateItems = new ArrayList<>(); items.add(createLeftPanelMenuItem()); items.add(createRightPanelMenuItem()); items.add(closePanelMenuItem()); for (Map.Entry<String, String> entry : generateCustomizedPanelDetails(prefs.getLastLoginUsername()).entrySet()) { autoCreateItems.add(createCustomizedPanelMenuItem(entry.getKey(), entry.getValue())); } autoCreatePanelMenu.getItems().addAll(autoCreateItems); panelMenu.getItems().addAll(items); panelMenu.getItems().add(autoCreatePanelMenu); return panelMenu; }

Target:
public Menu generatePanelMenu() { Menu panelMenu = new Menu("Panels"); Menu autoCreatePanelMenu = new Menu("Auto-create"); List<MenuItem> items = new ArrayList<>(); List<MenuItem> autoCreateItems = new ArrayList<>(); items.add(createLeftPanelMenuItem()); items.add(createRightPanelMenuItem()); items.add(closePanelMenuItem()); for (Entry<String, String> entry : generatePanelDetails(currentUsername).entrySet()) { autoCreateItems.add(createPanelMenuItem(entry.getKey(), entry.getValue())); } autoCreatePanelMenu.getItems().addAll(autoCreateItems); panelMenu.getItems().addAll(items); panelMenu.getItems().add(autoCreatePanelMenu); return panelMenu; }
Source:
private void createButton(Composite parent) { artifactSelectButton = new Button(parent, SWT.PUSH); artifactSelectButton.setText(String.format("Select " + itemName)); artifactSelectButton.addListener(SWT.Selection, new Listener() { @Override public void handleEvent(Event event) { handleSelectedArtifact(event); notifyListener(event); } }); artifactSelectButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL)); }

Target:
private void createButton(Composite parent) { artifactSelectButton = new Button(parent, SWT.PUSH); artifactSelectButton.setText("Select " + itemName); artifactSelectButton.addListener(SWT.Selection, new Listener() { @Override public void handleEvent(Event event) { handleSelectedArtifact(event); notifyListener(event); } }); artifactSelectButton.setLayoutData(new GridData(GridData.HORIZONTAL_ALIGN_FILL)); }
Source:
protected boolean writeMetsFile(Process process, URI metaFile, Fileformat gdzfile, boolean writeLocalFileGroup) throws PreferencesException, WriteException, IOException, TypeNotAllowedForParentException { MetsModsImportExport mm = new MetsModsImportExport(this.myPrefs); mm.setWriteLocal(writeLocalFileGroup); mm = serviceManager.getSchemaService().tempConvert(gdzfile, this, mm, this.myPrefs, process); User user = (User) Helper.getManagedBeanValue("#{LoginForm.myBenutzer}"); if (user != null) { mm.write(ConfigCore.getParameter("dir_Users") + user.getLogin() + "/" + metaFile.toString()); Helper.setMeldung(null, process.getTitle() + ": ", "ExportFinished"); return true; } Helper.setMeldung(null, process.getTitle() + ": ", "ExportNotFinished"); return false; }

Target:
protected boolean writeMetsFile(Process process, URI metaFile, Fileformat gdzfile, boolean writeLocalFileGroup) throws PreferencesException, WriteException, IOException, TypeNotAllowedForParentException { MetsModsImportExport mm = new MetsModsImportExport(this.myPrefs); mm.setWriteLocal(writeLocalFileGroup); mm = serviceManager.getSchemaService().tempConvert(gdzfile, this, mm, this.myPrefs, process); mm.write(metaFile.toString()); Helper.setMeldung(null, process.getTitle() + ": ", "ExportFinished"); return true; }
Source:
public Module load(String qualifiedName, File file, boolean toplevel, boolean isLifted) { boolean loadingType = file.getName().endsWith(".wyt"); TypedAST ast = null; try { ast = TestUtil.getNewAST(file); } catch (ParseException e) { if (e.getCurrentToken() != null) { ToolError.reportError(ErrorMessage.PARSE_ERROR, new FileLocation(file.getPath(), e.getCurrentToken().beginLine, e.getCurrentToken().beginColumn), e.getMessage()); } else { ToolError.reportError(ErrorMessage.PARSE_ERROR, FileLocation.UNKNOWN, e.getMessage()); } } return loadContinuation(file, qualifiedName, ast, loadingType, toplevel, isLifted); }

Target:
private Module load(String qualifiedName, File file, boolean toplevel, boolean isLifted) { boolean loadingType = file.getName().endsWith(".wyt"); TypedAST ast = null; try { ast = TestUtil.getNewAST(file); } catch (ParseException e) { if (e.getCurrentToken() != null) { ToolError.reportError(ErrorMessage.PARSE_ERROR, new FileLocation(file.getPath(), e.getCurrentToken().beginLine, e.getCurrentToken().beginColumn), e.getMessage()); } else { ToolError.reportError(ErrorMessage.PARSE_ERROR, FileLocation.UNKNOWN, e.getMessage()); } } return loadContinuation(file, qualifiedName, ast, loadingType, toplevel, isLifted); }
Source:
protected void executeVdsBrokerCommand() { GlusterVolumeSnapshotConfig cfgParam = getParameters() .getConfgParam(); String paramValue = cfgParam.getParamValue().endsWith("%") ? StringUtils.removeEnd(cfgParam.getParamValue(), "%") : cfgParam.getParamValue(); if (cfgParam.getVolumeId() != null) { GlusterVolumeEntity volume = DbFacade.getInstance().getGlusterVolumeDao().getById(cfgParam.getVolumeId()); status = getBroker().glusterVolumeSnapshotConfigSet(volume.getName(), cfgParam.getParamName(), paramValue); } else { status = getBroker().glusterSnapshotConfigSet(cfgParam.getParamName(), paramValue); } proceedProxyReturnValue(); }

Target:
protected void executeVdsBrokerCommand() { GlusterVolumeSnapshotConfig cfgParam = getParameters() .getConfgParam(); String paramValue = StringUtils.removeEnd(cfgParam.getParamValue(), "%"); if (cfgParam.getVolumeId() != null) { GlusterVolumeEntity volume = DbFacade.getInstance().getGlusterVolumeDao().getById(cfgParam.getVolumeId()); status = getBroker().glusterVolumeSnapshotConfigSet(volume.getName(), cfgParam.getParamName(), paramValue); } else { status = getBroker().glusterSnapshotConfigSet(cfgParam.getParamName(), paramValue); } proceedProxyReturnValue(); }
Source:
public SecurityWebFilterChain securityWebFilterChain(ServerHttpSecurity http) { return http .x509().authenticationManager(Mono::just) .and() .authorizeExchange().anyExchange().permitAll() .and() .build(); }

Target:
public SecurityWebFilterChain securityWebFilterChain(ServerHttpSecurity http) { http .x509() .and() .authorizeExchange() .anyExchange().authenticated(); return http.build(); }
Source:
public static boolean initBookie(ServerConfiguration conf) throws Exception { try (RegistrationManager rm = RegistrationManager.instantiateRegistrationManager(conf)) { File[] journalDirs = conf.getJournalDirs(); for (File journalDir : journalDirs) { File[] journalDirFiles = journalDir.listFiles(); if ((journalDirFiles != null) && journalDirFiles.length != 0) { LOG.error("JournalDir: is existing and its not empty, try formatting the bookie", journalDir); return false; } } File[] ledgerDirs = conf.getLedgerDirs(); for (File ledgerDir : ledgerDirs) { File[] ledgerDirFiles = ledgerDir.listFiles(); if ((ledgerDirFiles != null) && ledgerDirFiles.length != 0) { LOG.error("Atleast one LedgerDir: is existing and its not empty, try formatting the bookie", ledgerDir); return false; } } File[] indexDirs = conf.getIndexDirs(); if (indexDirs != null) { for (File indexDir : indexDirs) { File[] indexDirFiles = indexDir.listFiles(); if ((indexDirFiles != null) && indexDirFiles.length != 0) { LOG.error("Atleast one IndexDir: is existing and its not empty, try formatting the bookie", indexDir); return false; } } } String bookieId = Bookie.getBookieAddress(conf).toString(); if (rm.isBookieRegistered(bookieId)) { LOG.error("Bookie with bookieId: is still registered, " + "If this node is running bookie process, try stopping it first.", bookieId); return false; } try { rm.readCookie(bookieId); LOG.error("Cookie still exists in the ZK for this bookie: {}, try formatting the bookie", bookieId); return false; } catch (BookieException.CookieNotFoundException nfe) { } return true; } }

Target:
public static boolean initBookie(ServerConfiguration conf) throws Exception { File[] journalDirs = conf.getJournalDirs(); if (!validateDirectoriesAreEmpty(journalDirs, "JournalDir")) { return false; } File[] ledgerDirs = conf.getLedgerDirs(); if (!validateDirectoriesAreEmpty(ledgerDirs, "LedgerDir")) { return false; } File[] indexDirs = conf.getIndexDirs(); if (indexDirs != null) { if (!validateDirectoriesAreEmpty(indexDirs, "IndexDir")) { return false; } } try (RegistrationManager rm = RegistrationManager.instantiateRegistrationManager(conf)) { String bookieId = Bookie.getBookieAddress(conf).toString(); if (rm.isBookieRegistered(bookieId)) { LOG.error("Bookie with bookieId: is still registered, " + "If this node is running bookie process, try stopping it first.", bookieId); return false; } try { rm.readCookie(bookieId); LOG.error("Cookie still exists in the ZK for this bookie: {}, try formatting the bookie", bookieId); return false; } catch (BookieException.CookieNotFoundException nfe) { } return true; } }
Source:
private void updateExtensionField(Entry<String, Extension> extensionEntry, UserEntity userEntity) { String urn = extensionEntry.getKey(); Extension updatedScimExtension = extensionEntry.getValue(); ExtensionEntity extensionEntity = extensionDao.getExtensionByUrn(urn); for (String fieldName : updatedScimExtension.getFields().keySet()) { ExtensionFieldEntity extensionEntitiyField = null; try { extensionEntitiyField = extensionEntity.getFieldForName(fieldName, true); } catch (NoSuchElementException e) { LOGGER.info("Update Extension failed: ", e.getMessage()); throw e; } ExtensionFieldValueEntity extensionFieldValue = findExtensionFieldValue(extensionEntitiyField, userEntity); if (extensionFieldValue == null) { extensionFieldValue = new ExtensionFieldValueEntity(); } String newValue = getNewExtensionValue(extensionEntitiyField, updatedScimExtension, fieldName); if (!Strings.isNullOrEmpty(newValue)) { extensionFieldValue.setValue(newValue); extensionFieldValue.setExtensionField(extensionEntitiyField); userEntity.addOrUpdateExtensionValue(extensionFieldValue); } } }

Target:
private void updateExtensionField(Entry<String, Extension> extensionEntry, UserEntity userEntity) { String urn = extensionEntry.getKey(); Extension updatedScimExtension = extensionEntry.getValue(); ExtensionEntity extensionEntity = extensionDao.getExtensionByUrn(urn); for (String fieldName : updatedScimExtension.getFields().keySet()) { ExtensionFieldEntity extensionEntitiyField = null; try { extensionEntitiyField = extensionEntity.getFieldForName(fieldName, true); } catch (NoSuchElementException e) { LOGGER.warn("Update Extension failed: ", e.getMessage()); throw e; } ExtensionFieldValueEntity extensionFieldValue = findExtensionFieldValue(extensionEntitiyField, userEntity); if (extensionFieldValue == null) { extensionFieldValue = new ExtensionFieldValueEntity(); } String newValue = getNewExtensionValue(extensionEntitiyField, updatedScimExtension, fieldName); if (!Strings.isNullOrEmpty(newValue)) { extensionFieldValue.setValue(newValue); extensionFieldValue.setExtensionField(extensionEntitiyField); userEntity.addOrUpdateExtensionValue(extensionFieldValue); } } }
Source:
private boolean checkQuota() { if (totalBufferUsed.get() > totalBufferQuota) { LOG.warn("Can't read more edits from WAL as buffer usage {}B exceeds limit {}B", totalBufferUsed.get(), totalBufferQuota); Threads.sleep(sleepForRetries); return false; } return true; }

Target:
private boolean checkQuota() { if (totalBufferUsed.get() > totalBufferQuota) { LOG.warn("peer={}, can't read more edits from WAL as buffer usage {}B exceeds limit {}B", this.source.getPeerId(), totalBufferUsed.get(), totalBufferQuota); Threads.sleep(sleepForRetries); return false; } return true; }
Source:
private static List<IndexableAdapter> toIndexableAdapters(List<QueryableIndex> indexes) { return Lists.transform( indexes, new Function<QueryableIndex, IndexableAdapter>() { @Override public IndexableAdapter apply(final QueryableIndex input) { return new QueryableIndexIndexableAdapter(input); } } ); }

Target:
private static List<IndexableAdapter> toIndexableAdapters(List<QueryableIndex> indexes) { return Lists.newArrayList( Iterables.transform( indexes, new Function<QueryableIndex, IndexableAdapter>() { @Override public IndexableAdapter apply(final QueryableIndex input) { return new QueryableIndexIndexableAdapter(input); } } ) ); }
Source:
public List<Tree.Kind> nodesToVisit() { return Arrays.asList(Tree.Kind.METHOD, Tree.Kind.CLASS); }

Target:
public List<Tree.Kind> nodesToVisit() { return Collections.singletonList(Tree.Kind.CLASS); }
Source:
public Block apply(Block block) { BlockBuilder blockBuilder = toType.createBlockBuilder(new BlockBuilderStatus(), block.getPositionCount()); ColumnarMap mapBlock = ColumnarMap.toColumnarMap(block); Block keysBlock = keyCoercer == null ? mapBlock.getKeysBlock() : keyCoercer.apply(mapBlock.getKeysBlock()); Block valuesBlock = valueCoercer == null ? mapBlock.getValuesBlock() : valueCoercer.apply(mapBlock.getValuesBlock()); for (int i = 0; i < mapBlock.getPositionCount(); i++) { if (mapBlock.isNull(i)) { blockBuilder.appendNull(); continue; } BlockBuilder singleMapBuilder = blockBuilder.beginBlockEntry(); if (keysBlock.isNull(i)) { singleMapBuilder.appendNull(); } else { keysBlock.writePositionTo(i, singleMapBuilder); singleMapBuilder.closeEntry(); } if (valuesBlock.isNull(i)) { singleMapBuilder.appendNull(); } else { valuesBlock.writePositionTo(i, singleMapBuilder); singleMapBuilder.closeEntry(); } blockBuilder.closeEntry(); } return blockBuilder.build(); }

Target:
public Block apply(Block block) { ColumnarMap mapBlock = toColumnarMap(block); Block keysBlock = keyCoercer == null ? mapBlock.getKeysBlock() : keyCoercer.apply(mapBlock.getKeysBlock()); Block valuesBlock = valueCoercer == null ? mapBlock.getValuesBlock() : valueCoercer.apply(mapBlock.getValuesBlock()); boolean[] valueIsNull = new boolean[mapBlock.getPositionCount()]; int[] offsets = new int[mapBlock.getPositionCount() + 1]; for (int i = 0; i < mapBlock.getPositionCount(); i++) { valueIsNull[i] = mapBlock.isNull(i); offsets[i + 1] = offsets[i] + mapBlock.getEntryCount(i); } return ((MapType) toType).createBlockFromKeyValue(valueIsNull, offsets, keysBlock, valuesBlock); }
Source:
private void executePrecode(Connection connection, String propertyKey) throws SQLException { String precode = getProperty(String.format(PRECODE_KEY_TEMPLATE, propertyKey)); if (StringUtils.isNotBlank(precode)) { List<String> precodeQueries = splitSqlQueries(precode); try (Statement statement = connection.createStatement()) { for (String precodeQuery : precodeQueries) { logger.info("Run SQL precode '{}'", precodeQuery); statement.execute(precodeQuery); } if (!connection.getAutoCommit()) { connection.commit(); } } } }

Target:
private void executePrecode(Connection connection, String propertyKey) throws SQLException { String precode = getProperty(String.format(PRECODE_KEY_TEMPLATE, propertyKey)); if (StringUtils.isNotBlank(precode)) { precode = StringUtils.trim(precode); logger.info("Run SQL precode '{}'", precode); try (Statement statement = connection.createStatement()) { statement.execute(precode); if (!connection.getAutoCommit()) { connection.commit(); } } } }
Source:
private HttpResponse createTestUser(String appId) throws IOException, URISyntaxException { URL url = new URL(getURLCreateUser(appId)); CloseableHttpClient httpClient = HttpClientBuilder.create().disableAutomaticRetries().build(); HttpPost httpPost = getHttpPost(url); if (getParams() != null) { httpPost.setEntity(new UrlEncodedFormEntity(getParams(), StandardCharsets.UTF_8)); } return httpClient.execute(httpPost); }

Target:
private HttpResponse createTestUser(String appId) throws IOException, URISyntaxException { URL url = new URL(getURLCreateUser(appId)); CloseableHttpClient httpClient = HttpClientBuilder.create().disableAutomaticRetries().build(); HttpPost httpPost = getHttpPost(url); httpPost.setEntity(new UrlEncodedFormEntity(getParams(), StandardCharsets.UTF_8)); return httpClient.execute(httpPost); }
Source:
public ConnectorPartitioningHandle getPartitioningHandleForExchange(ConnectorSession session, int partitionCount, List<Type> partitionTypes) { if (!partitionTypes.isEmpty()) { return createPartitioningHandleWithPrestoType(partitionCount, partitionTypes, OptionalInt.empty()); } else { return createPartitioningHandleWithHiveType(partitionCount, ImmutableList.of(), OptionalInt.empty()); } }

Target:
public ConnectorPartitioningHandle getPartitioningHandleForExchange(ConnectorSession session, int partitionCount, List<Type> partitionTypes) { return createPrestoNativePartitioningHandle(partitionCount, partitionTypes, OptionalInt.empty()); }
Source:
public static IStatus removeXmlFile(File toDelete) { if (!xmlValidate(toDelete).isOK()) { return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "The XML file is not an active XML Analysis"); } File activeXMLFolder = new File(XmlUtils.getXmlFilesPath().toString()); File[] activeXMLs = activeXMLFolder.listFiles(); for (int i = 0; i < activeXMLs.length; i++) { if (activeXMLs[i].getName().equals(toDelete.getName())) { activeXMLs[i].delete(); break; } } return Status.OK_STATUS; }

Target:
public static IStatus removeXmlFile(File toDelete) { if (!xmlValidate(toDelete).isOK()) { return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "The XML file is not an active XML Analysis"); } toDelete.delete(); return Status.OK_STATUS; }
Source:
public void shouldForwardPluginNameOnDisable() { checkDisableHandling(ESSENTIALS, () -> verify(pluginHookService).unhookEssentials()); checkDisableHandling(ESSENTIALS_SPAWN, () -> verify(spawnLoader).unloadEssentialsSpawn()); checkDisableHandling(CMI, () -> { verify(pluginHookService).unhookCMI(); verify(spawnLoader).unloadCMISpawn(); }); checkDisableHandling(MULTIVERSE, () -> verify(pluginHookService).unhookMultiverse()); checkDisableHandling(PROTOCOL_LIB, () -> verify(protocolLibService).disable()); checkDisableHandling("UnknownPlugin", () -> verifyZeroInteractions(pluginHookService, spawnLoader)); }

Target:
public void shouldForwardPluginNameOnDisable() { checkDisableHandling(ESSENTIALS, () -> verify(pluginHookService).unhookEssentials()); checkDisableHandling(ESSENTIALS_SPAWN, () -> verify(spawnLoader).unloadEssentialsSpawn()); checkDisableHandling(CMI, () -> { verify(pluginHookService).unhookCmi(); verify(spawnLoader).unloadCMISpawn(); }); checkDisableHandling(MULTIVERSE, () -> verify(pluginHookService).unhookMultiverse()); checkDisableHandling(PROTOCOL_LIB, () -> verify(protocolLibService).disable()); checkDisableHandling("UnknownPlugin", () -> verifyZeroInteractions(pluginHookService, spawnLoader)); }
Source:
protected boolean canDoAction() { VM vm = getVm(); if (vm == null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_VM_NOT_FOUND); } if (vm.getStatus() == VMStatus.Paused) { return true; } if (!getRunVmValidator().canRunVm(vm, getReturnValue().getCanDoActionMessages(), getDiskDao().getAllForVm(vm.getId(), true), getParameters().getBootSequence(), getStoragePool(), isInternalExecution(), getParameters().getDiskPath(), getParameters().getFloppyPath(), getParameters().getRunAsStateless(), getRunVdssList(), getDestinationVds() != null ? getDestinationVds().getId() : null, getVdsGroup())) { return false; } if (!validateNetworkInterfaces()) { return false; } if (getParameters().getVmPayload() != null) { if (checkPayload(getParameters().getVmPayload(), getParameters().getDiskPath()) && !StringUtils.isEmpty(getParameters().getFloppyPath()) && getParameters().getVmPayload().getType() == VmDeviceType.FLOPPY) { return failCanDoAction(VdcBllMessages.VMPAYLOAD_FLOPPY_EXCEEDED); } getVm().setVmPayload(getParameters().getVmPayload()); } if (!vm.isAutoStartup() && !StringUtils.isEmpty(getVm().getIsoPath()) && getIsoDomainListSyncronizer().findActiveISODomain(getVm().getStoragePoolId()) == null) { return failCanDoAction(VdcBllMessages.VM_CANNOT_RUN_FROM_CD_WITHOUT_ACTIVE_STORAGE_DOMAIN_ISO); } return true; }

Target:
protected boolean canDoAction() { VM vm = getVm(); if (vm == null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_VM_NOT_FOUND); } if (!canRunActionOnNonManagedVm()) { return false; } if (vm.getStatus() == VMStatus.Paused) { return true; } if (!getRunVmValidator().canRunVm(vm, getReturnValue().getCanDoActionMessages(), getDiskDao().getAllForVm(vm.getId(), true), getParameters().getBootSequence(), getStoragePool(), isInternalExecution(), getParameters().getDiskPath(), getParameters().getFloppyPath(), getParameters().getRunAsStateless(), getRunVdssList(), getDestinationVds() != null ? getDestinationVds().getId() : null, getVdsGroup())) { return false; } if (!validateNetworkInterfaces()) { return false; } if (getParameters().getVmPayload() != null) { if (checkPayload(getParameters().getVmPayload(), getParameters().getDiskPath()) && !StringUtils.isEmpty(getParameters().getFloppyPath()) && getParameters().getVmPayload().getType() == VmDeviceType.FLOPPY) { return failCanDoAction(VdcBllMessages.VMPAYLOAD_FLOPPY_EXCEEDED); } getVm().setVmPayload(getParameters().getVmPayload()); } if (!vm.isAutoStartup() && !StringUtils.isEmpty(getVm().getIsoPath()) && getIsoDomainListSyncronizer().findActiveISODomain(getVm().getStoragePoolId()) == null) { return failCanDoAction(VdcBllMessages.VM_CANNOT_RUN_FROM_CD_WITHOUT_ACTIVE_STORAGE_DOMAIN_ISO); } return true; }
Source:
public static boolean configureGlobalTracer(OxdServerConfiguration configuration, String componentName) { String tracerName = configuration.getTracer(); Tracer tracer = null; if (!configuration.getEnableTracing() || Strings.isNullOrEmpty(tracerName)) { tracer = NoopTracerFactory.create(); } else if ("jaeger".equals(tracerName)) { Configuration.SamplerConfiguration samplerConfig = new Configuration.SamplerConfiguration() .withType(ConstSampler.TYPE) .withParam(1); Configuration.SenderConfiguration senderConfig = new Configuration.SenderConfiguration() .withAgentHost(configuration.getTracerHost()) .withAgentPort(configuration.getTracerPort()); Configuration.ReporterConfiguration reporterConfig = new Configuration.ReporterConfiguration() .withLogSpans(true) .withFlushInterval(1000) .withMaxQueueSize(10000) .withSender(senderConfig); tracer = new Configuration(componentName).withSampler(samplerConfig).withReporter(reporterConfig).getTracer(); } else if ("zipkin".equals(tracerName)) { OkHttpSender sender = OkHttpSender.create( "http://" + configuration.getTracerHost() + ":" + configuration.getTracerPort() + "/api/v1/spans"); Reporter<Span> reporter = AsyncReporter.builder(sender).build(); tracer = BraveTracer.create(Tracing.newBuilder() .localServiceName(componentName) .spanReporter(reporter) .build()); } else { tracer = NoopTracerFactory.create(); } GlobalTracer.register(tracer); return true; }

Target:
public static boolean configureGlobalTracer(OxdServerConfiguration configuration, String componentName) { GlobalTracer.register(createTracer(configuration, componentName)); return true; }
Source:
public static List<String> getProperties(String key) { final List<String> v; v = _props.get(key); return v; }

Target:
public static List<String> getProperties(String key) { return _props.get(key); }
Source:
public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof Checkpoint)) return false; Checkpoint that = (Checkpoint) o; return (checkpointId.equals(that.checkpointId)) && (Objects.equals(inputOffsets, that.inputOffsets)) && (Objects.equals(stateCheckpoint, that.stateCheckpoint)); }

Target:
public boolean equals(Object o) { if (this == o) return true; if (!(o instanceof Checkpoint)) return false; Checkpoint that = (Checkpoint) o; return (checkpointId.equals(that.checkpointId)) && (Objects.equals(inputOffsets, that.inputOffsets)) && (Objects.equals(stateCheckpoints, that.stateCheckpoints)); }
Source:
protected Boolean doInBackgroundInternal(final Geocache[] caches) { boolean success = true; for (final IConnector connector : ConnectorFactory.getConnectors()) { if (connector instanceof PersonalNoteCapability) { success &= uploadPersonalNotes((PersonalNoteCapability) connector, caches); } } return success; }

Target:
protected Boolean doInBackgroundInternal(final Geocache[] caches) { try { int i = 0; for (final Geocache cache : caches) { final IConnector connector = ConnectorFactory.getConnector(cache); publishProgress(++i); if (connector instanceof PersonalNoteCapability && StringUtils.isNotBlank(cache.getPersonalNote())) { ((PersonalNoteCapability)connector).uploadPersonalNote(cache); persNotesCount++; } } } catch (final Exception e) { Log.e("PersonalnoteExport.ExportTask uploading personal notes", e); return false; } return true; }
Source:
public void testFormat() { Date novFifth2016 = new Date(17110); DateFields novFifth2016Fields = DateUtils.getFields(novFifth2016, null); Map escapesResults = new HashMap(); escapesResults.put("%a": "Sat"); escapesResults.put("%A": "Saturday"); escapesResults.put("%b": "Nov"); escapesResults.put("%B": "November"); escapesResults.put("%d": "05"); escapesResults.put("%e": "5"); for (String escape : escapesResults.keySet()) { String result = escapesResults.get(escape); String formatted = DateUtils.format(novFifth2016Fields, escape); assertEquals(formatted, result); } }

Target:
public void testFormat() { Date novFifth2016 = new Date(17110); DateFields novFifth2016Fields = DateUtils.getFields(novFifth2016, null); Map escapesResults = new HashMap(); escapesResults.put("%a", "Sat"); escapesResults.put("%A", "Saturday"); escapesResults.put("%b", "Nov"); escapesResults.put("%B", "November"); escapesResults.put("%d", "05"); escapesResults.put("%e", "5"); for (String escape : escapesResults.keySet()) { String result = escapesResults.get(escape); String formatted = DateUtils.format(novFifth2016Fields, escape); assertEquals(formatted, result); } }
Source:
public static File getFile(Object source, String filename) throws IOException { throw new AssertionFailedError("Please use org.eclipse.mylyn.commons.sdk.util.CommonTestUtil"); }

Target:
public static File getFile(Object source, String filename) throws IOException { return org.eclipse.mylyn.commons.sdk.util.CommonTestUtil.getFile(source, filename); }
Source:
private Bitmap getFullSizePhoto(Uri contactUri) { Uri displayPhotoUri = Uri.withAppendedPath(contactUri, Contacts.Photo.DISPLAY_PHOTO); try { AssetFileDescriptor fd = context.getContentResolver().openAssetFileDescriptor(displayPhotoUri, "r"); InputStream input; input = fd.createInputStream(); return BitmapFactory.decodeStream(input); } catch (IOException e) { e.printStackTrace(); } return null; }

Target:
private Bitmap getFullSizePhoto(Uri contactUri) { if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.ICE_CREAM_SANDWICH) { Uri displayPhotoUri = Uri.withAppendedPath(contactUri, Contacts.Photo.DISPLAY_PHOTO); try { AssetFileDescriptor fd = context.getContentResolver().openAssetFileDescriptor(displayPhotoUri, "r"); InputStream input; input = fd.createInputStream(); return BitmapFactory.decodeStream(input); } catch (IOException e) { logger.error("Could not get the photoStream.", e); e.printStackTrace(); } } return null; }
Source:
private void orchestrateStorageMigration(final String vmUuid, final StoragePool destPool) { final VMInstanceVO vm = _vmDao.findByUuid(vmUuid); preStorageMigrationStateCheck(destPool, vm); try { if(s_logger.isDebugEnabled()) { s_logger.debug( String.format("Offline migration of %s vm %s with volumes", vm.getHypervisorType().toString(), vm.getInstanceName())); } migrateThroughHypervisorOrStorage(destPool, vm); } catch (ConcurrentOperationException | InsufficientCapacityException | StorageUnavailableException e) { s_logger.debug("Failed to migration: " + e.toString()); throw new CloudRuntimeException("Failed to migration: " + e.toString()); } finally { try { stateTransitTo(vm, Event.AgentReportStopped, null); } catch (final NoTransitionException e) { s_logger.debug("Failed to change vm state: " + e.toString()); throw new CloudRuntimeException("Failed to change vm state: " + e.toString()); } } }

Target:
private void orchestrateStorageMigration(final String vmUuid, final StoragePool destPool) { final VMInstanceVO vm = _vmDao.findByUuid(vmUuid); preStorageMigrationStateCheck(destPool, vm); try { if(s_logger.isDebugEnabled()) { s_logger.debug(String.format("Offline migration of %s vm %s with volumes", vm.getHypervisorType().toString(), vm.getInstanceName())); } migrateThroughHypervisorOrStorage(destPool, vm); } catch (ConcurrentOperationException | InsufficientCapacityException | StorageUnavailableException e) { String msg = String.format("Failed to migrate VM: %s", vmUuid); s_logger.debug(msg); throw new CloudRuntimeException(msg, e); } finally { try { stateTransitTo(vm, Event.AgentReportStopped, null); } catch (final NoTransitionException e) { String anotherMEssage = String.format("failed to change vm state of VM: %s", vmUuid); s_logger.debug(anotherMEssage); throw new CloudRuntimeException(anotherMEssage, e); } } }
Source:
public void shutdown() { if (m_executionSite != null) { m_executionSite.startShutdown(); } try { if (m_term != null) { m_term.shutdown(); } } catch (Exception e) { tmLog.info("Exception during shutdown.", e ); } try { if (m_initiatorMailbox != null) { m_initiatorMailbox.shutdown(); } } catch (Exception e) { tmLog.info("Exception during shutdown.", e); } if (m_siteThread != null) { try { m_scheduler.getQueue().offer(Scheduler.m_nullTask); m_siteThread.join(); } catch (InterruptedException e) { tmLog.info("Interrupted during shutdown", e); } } }

Target:
public void shutdown() { if (m_executionSite != null) { m_executionSite.startShutdown(); } try { if (m_term != null) { m_term.shutdown(); } } catch (Exception e) { tmLog.info("Exception during shutdown.", e ); } try { if (m_initiatorMailbox != null) { m_initiatorMailbox.shutdown(); } } catch (Exception e) { tmLog.info("Exception during shutdown.", e); } if (m_siteThread != null) { try { m_siteThread.join(); } catch (InterruptedException e) { tmLog.info("Interrupted during shutdown", e); } } }
Source:
public boolean equals(Object o) { InheritedRefRight inheritedRefRight = (InheritedRefRight) o; RefRight refRight = inheritedRefRight.getRight(); if (refRight.getAccountGroupId().equals(this.getRight().getAccountGroupId()) && refRight.getApprovalCategoryId().equals(this.getRight().getApprovalCategoryId()) && refRight.getMinValue() == this.getRight().getMinValue() && refRight.getMaxValue() == this.getRight().getMaxValue() && refRight.getRefPattern().equals(this.getRight().getRefPattern())) { return true; } return false; }

Target:
public boolean equals(Object o) { if (o instanceof InheritedRefRight) { RefRight myRight = getRight(); RefRight otherRight = ((InheritedRefRight)o).getRight(); if (otherRight.getAccountGroupId().equals(myRight.getAccountGroupId()) && otherRight.getApprovalCategoryId().equals(myRight.getApprovalCategoryId()) && otherRight.getMinValue() == myRight.getMinValue() && otherRight.getMaxValue() == myRight.getMaxValue() && otherRight.getRefPattern().equals(myRight.getRefPattern())) { return true; } } return false; }
Source:
public boolean matches(String type, URI uri, String realm) { boolean match = true; match &= AuthScheme.NEGOTIATE.toString().equalsIgnoreCase(type); match &= getServiceUri().getScheme().equalsIgnoreCase(uri.getScheme()); match &= getServiceUri().getHost().equalsIgnoreCase(uri.getHost()); return match; }

Target:
public boolean matches(String type, URI uri, String realm) { return NEGOTIATE.equalsIgnoreCase(type); }
Source:
public void setEndpoints(@NonNull String notify, @NonNull String sessions) throws IllegalArgumentException { boolean invalidNotify = TextUtils.isEmpty(notify); invalidSessionsEndpoint = TextUtils.isEmpty(sessions); if (invalidNotify) { throw new IllegalArgumentException("Notify endpoint cannot be empty or null."); } if (invalidSessionsEndpoint) { Logger.warn("The session tracking endpoint has not been set. " + "Session tracking is disabled"); autoCaptureSessions = false; } this.endpoint = notify; this.sessionEndpoint = sessions; this.autoCaptureSessions = !invalidNotify && !invalidSessionsEndpoint; }

Target:
public void setEndpoints(@NonNull String notify, @NonNull String sessions) throws IllegalArgumentException { if (TextUtils.isEmpty(notify)) { throw new IllegalArgumentException("Notify endpoint cannot be empty or null."); } else { this.endpoint = notify; } boolean invalidSessionsEndpoint = TextUtils.isEmpty(sessions); if (invalidSessionsEndpoint) { Logger.warn("The session tracking endpoint has not been set. " + "Session tracking is disabled"); this.sessionEndpoint = null; this.autoCaptureSessions = false; } else { this.sessionEndpoint = sessions; } }
Source:
public boolean checkMessages(String messageID, String queueName) throws IOException { System.out.println("Checking message id: " + messageID + " in queue: " + queueName); if (DLCQueueUtils.isDeadLetterQueue(queueName)) { DLCBrowsePage dlcBrowsePage = homePage.getDLCBrowsePage(); dlcBrowsePage.getDLCContent(); if (isElementPresent(UIElementMapper.getInstance().getElement("mb.dlc.browse.content.table"))) { return checkMessagesInTable(driver.findElement(By.xpath(UIElementMapper.getInstance(). getElement("mb.dlc.browse.content.table"))), messageID, MESSAGE_ID_COLUMN_IN_DLC); } else { log.debug("No messages in: " + queueName); return false; } } else { QueuesBrowsePage queuesBrowsePage1 = homePage.getQueuesBrowsePage(); queuesBrowsePage1.browseQueue(queueName); if (isElementPresent(UIElementMapper.getInstance().getElement("mb.queue.browse.content.table"))) { return checkMessagesInTable(driver.findElement(By.xpath(UIElementMapper.getInstance(). getElement("mb.queue.browse.content.table"))), messageID, MESSAGE_ID_COLUMN_IN_QUEUE); } else { log.debug("No messages in: " + queueName); return false; } } }

Target:
public boolean checkMessages(String messageID, String queueName) throws IOException { if (DLCQueueUtils.isDeadLetterQueue(queueName)) { homePage.getDLCBrowsePage().getDLCContent(); if (isElementPresent(UIElementMapper.getInstance().getElement(DLC_MESSAGE_CONTENT_TABLE))) { return checkMessagesInTable(driver.findElement(By.xpath(UIElementMapper.getInstance(). getElement(DLC_MESSAGE_CONTENT_TABLE))), messageID, MESSAGE_ID_COLUMN_IN_DLC); } else { log.debug("No messages in: " + queueName); return false; } } else { homePage.getQueuesBrowsePage().browseQueue(queueName); if (isElementPresent(UIElementMapper.getInstance().getElement(QUEUE_MESSAGE_CONTENT_TABLE))) { return checkMessagesInTable(driver.findElement(By.xpath(UIElementMapper.getInstance(). getElement(QUEUE_MESSAGE_CONTENT_TABLE))), messageID, MESSAGE_ID_COLUMN_IN_QUEUE); } else { log.debug("No messages in: " + queueName); return false; } } }
Source:
public void getZeroScore() { HardSoftDoubleScore score = new HardSoftDoubleScoreDefinition().getZeroScore(); assertThat(score.toLevelNumbers()).containsOnly(0d); }

Target:
public void getZeroScore() { HardSoftDoubleScore score = new HardSoftDoubleScoreDefinition().getZeroScore(); assertThat(score).isEqualTo(HardSoftDoubleScore.ZERO); }
Source:
public ZonedDateTime getWhenRun() { return _whenRun; }

Target:
public ZonedDateTime getWhenRun() { return getRunAtAndAfter(); }
Source:
protected Map<String, String> getExclusiveLocks() { if (getVdsGroup().supportsGlusterService() && !isInternalExecution()) { return Collections.singletonMap(getVdsGroupId().toString(), LockingGroup.GLUSTER.name()); } return null; }

Target:
protected Map<String, String> getExclusiveLocks() { VDSGroup cluster = getVdsGroup(); if (cluster != null && cluster.supportsGlusterService() && !isInternalExecution()) { return Collections.singletonMap(cluster.getId().toString(), LockingGroup.GLUSTER.name()); } return null; }
Source:
public void startDefaultWorkbench() { kieSecurityService.call( new RemoteCallback<String>() { public void callback( final String str ) { initializeWorkbench( str ); customSecurityLoadedCallback(); } } ).loadPolicy(); pmas.call().initActivities( activityBeansCache.getActivitiesById() ); }

Target:
public void startDefaultWorkbench() { kieSecurityService.call( new RemoteCallback<String>() { public void callback( final String policy ) { initializeWorkbench( policy ); for ( Callback<String> callback : customSecurityLoadedCallbacks ) { callback.callback( policy ); } } } ).loadPolicy(); pmas.call().initActivities( activityBeansCache.getActivitiesById() ); }
Source:
private static String getUniqueName(Set<String> existingNameList, String nameProposal) { String temp = nameProposal; final String END_IN_NO_PATTERN = "^.*\\d$"; Pattern pattern = Pattern.compile("\\d+$"); while (existingNameList.contains(temp)) { if (temp.matches(END_IN_NO_PATTERN)) { Matcher matchString = pattern.matcher(temp); matchString.find(); Integer number = Integer.valueOf(temp.substring(matchString.start(), matchString.end())) + 1; temp = nameProposal.substring(0, matchString.start()) + number; } else { temp = nameProposal + "_" + 1; } } return temp; }

Target:
private static String getUniqueName(Set<String> existingNameList, String nameProposal) { String temp = nameProposal; while (existingNameList.contains(temp)) { if (END_IN_NUMBER_PATTERN.matcher(temp).matches()) { Matcher matchNumber = GET_LAST_NUMBER_PATTERN.matcher(temp); matchNumber.find(); Integer number = Integer.valueOf(temp.substring(matchNumber.start(), matchNumber.end())) + 1; temp = nameProposal.substring(0, matchNumber.start()) + number; } else { temp = nameProposal + "_" + 1; } } return temp; }