auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected void contributeButtons(Composite parent) { ((GridLayout) parent.getLayout()).numColumns++; Button button = new Button(parent, SWT.NONE); button.setText("&Import a theme..."); button.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent event) { FileDialog dialog = new FileDialog(getShell()); String file = dialog.open(); FileInputStream fileStream = null; BufferedInputStream bufferedFileStream = null; try { fileStream = new FileInputStream(file); bufferedFileStream = new BufferedInputStream(fileStream); colorThemeManager.saveTheme(bufferedFileStream); } catch (CharConversionException e) { showErrorMessage("Invalid file encoding."); return; } catch (Exception e) { showErrorMessage("This is not a valid theme file."); return; } finally { try { if(bufferedFileStream != null) bufferedFileStream.close(); if(fileStream != null) fileStream.close(); } catch (IOException e) { e.printStackTrace(); } } reloadThemeSelectionList(); } }); }

Target:
protected void contributeButtons(Composite parent) { ((GridLayout) parent.getLayout()).numColumns++; Button button = new Button(parent, SWT.NONE); button.setText("&Import a theme..."); button.addSelectionListener(new SelectionAdapter() { @Override public void widgetSelected(SelectionEvent event) { FileDialog dialog = new FileDialog(getShell()); String file = dialog.open(); BufferedInputStream bufferedFileStream = null; try { bufferedFileStream = new BufferedInputStream(new FileInputStream(file)); colorThemeManager.saveTheme(bufferedFileStream); } catch (CharConversionException e) { showErrorMessage("Invalid file encoding."); return; } catch (Exception e) { showErrorMessage("This is not a valid theme file."); return; } finally { try { if(bufferedFileStream != null) bufferedFileStream.close(); } catch (IOException e) { e.printStackTrace(); } } reloadThemeSelectionList(); } }); }
Source:
private ReaderPostAdapter getPostAdapter() { if (mPostAdapter == null) { AppLog.d(T.READER, "reader post list > creating post adapter"); Context context = WPActivityUtils.getThemedContext(getActivity()); mPostAdapter = new ReaderPostAdapter(context, getPostListType(), mImageManager, new NewsCardListener() { @Override public void onItemClicked(@NotNull String url) { Activity activity = getActivity(); if (activity != null) { WPWebViewActivity.openURL(activity, url); } } @Override public void onDismissClicked(NewsItem item) { mViewModel.onDismissClicked(item); } }); mPostAdapter.setOnFollowListener(this); mPostAdapter.setOnPostSelectedListener(this); mPostAdapter.setOnPostPopupListener(this); mPostAdapter.setOnDataLoadedListener(mDataLoadedListener); mPostAdapter.setOnDataRequestedListener(mDataRequestedListener); mPostAdapter.setOnPostBookmarkedListener(mOnPostBookmarkedListener); if (getActivity() instanceof ReaderSiteHeaderView.OnBlogInfoLoadedListener) { mPostAdapter.setOnBlogInfoLoadedListener((ReaderSiteHeaderView.OnBlogInfoLoadedListener) getActivity()); } mViewModel.getNewsDataSource().removeObserver(mNewsItemObserver); if (getPostListType().isTagType()) { mPostAdapter.setCurrentTag(getCurrentTag()); mViewModel.getNewsDataSource().observe((FragmentActivity) getActivity(), mNewsItemObserver); } else if (getPostListType() == ReaderPostListType.BLOG_PREVIEW) { mPostAdapter.setCurrentBlogAndFeed(mCurrentBlogId, mCurrentFeedId); } else if (getPostListType() == ReaderPostListType.SEARCH_RESULTS) { ReaderTag searchTag = ReaderUtils.getTagForSearchQuery(mCurrentSearchQuery); mPostAdapter.setCurrentTag(searchTag); } } return mPostAdapter; }

Target:
private ReaderPostAdapter getPostAdapter() { if (mPostAdapter == null) { AppLog.d(T.READER, "reader post list > creating post adapter"); Context context = WPActivityUtils.getThemedContext(getActivity()); mPostAdapter = new ReaderPostAdapter(context, getPostListType(), mImageManager); mPostAdapter.setOnFollowListener(this); mPostAdapter.setOnPostSelectedListener(this); mPostAdapter.setOnPostPopupListener(this); mPostAdapter.setOnDataLoadedListener(mDataLoadedListener); mPostAdapter.setOnDataRequestedListener(mDataRequestedListener); mPostAdapter.setOnPostBookmarkedListener(mOnPostBookmarkedListener); mPostAdapter.setOnNewsCardListener(mNewsCardListener); if (getActivity() instanceof ReaderSiteHeaderView.OnBlogInfoLoadedListener) { mPostAdapter.setOnBlogInfoLoadedListener((ReaderSiteHeaderView.OnBlogInfoLoadedListener) getActivity()); } mViewModel.getNewsDataSource().removeObserver(mNewsItemObserver); if (getPostListType().isTagType()) { mPostAdapter.setCurrentTag(getCurrentTag()); mViewModel.getNewsDataSource().observe((FragmentActivity) getActivity(), mNewsItemObserver); } else if (getPostListType() == ReaderPostListType.BLOG_PREVIEW) { mPostAdapter.setCurrentBlogAndFeed(mCurrentBlogId, mCurrentFeedId); } else if (getPostListType() == ReaderPostListType.SEARCH_RESULTS) { ReaderTag searchTag = ReaderUtils.getTagForSearchQuery(mCurrentSearchQuery); mPostAdapter.setCurrentTag(searchTag); } } return mPostAdapter; }
Source:
public void testLogCleanup() throws ExecutorManagerException { final File logDir = ExecutionsTestUtil.getFlowDir(LOG_TEST_DIR_NAME); final File[] largelog = {new File(logDir, "largeLog1.log"), new File(logDir, "largeLog2.log"), new File(logDir, "largeLog3.log")}; this.executionLogsDao.uploadLogFile(1, "largeFiles", 0, largelog); final LogData logsResult = this.executionLogsDao.fetchLogs(1, "largeFiles", 0, 0, 64000); assertThat(logsResult).isNotNull(); assertThat(logsResult.getLength()).isEqualTo(64000); final LogData logsResult2 = this.executionLogsDao.fetchLogs(1, "largeFiles", 0, 1000, 64000); assertThat(logsResult2).isNotNull(); assertThat(logsResult2.getLength()).isEqualTo(64000); final LogData logsResult3 = this.executionLogsDao.fetchLogs(1, "largeFiles", 0, 150000, 250000); assertThat(logsResult3).isNotNull(); assertThat(logsResult3.getLength()).isEqualTo(185493); final long currentTimeMillis = System.currentTimeMillis(); int totalRemovedRecords = executionLogsDao.removeExecutionLogsByTime(currentTimeMillis, 3); assertThat(totalRemovedRecords).isEqualTo(7); }

Target:
public void testLogCleanup() throws ExecutorManagerException { final File logDir = ExecutionsTestUtil.getFlowDir(LOG_TEST_DIR_NAME); final File[] largeLog1 = {new File(logDir, "largeLog1.log")}; this.executionLogsDao.uploadLogFile(1, "largeFiles", 0, largeLog1); final long currentTimeMillis = System.currentTimeMillis() + 1000; int totalRemovedRecords = executionLogsDao.removeExecutionLogsByTime(currentTimeMillis, 2); assertThat(totalRemovedRecords).isEqualTo(3); final File[] largeLog2 = {new File(logDir, "largeLog2.log")}; this.executionLogsDao.uploadLogFile(2, "largeFiles", 0, largeLog2); final long currentTimeMillisSecond = System.currentTimeMillis() + 1000; totalRemovedRecords = executionLogsDao.removeExecutionLogsByTime(currentTimeMillisSecond, 3); assertThat(totalRemovedRecords).isEqualTo(1); final File[] largeLogMultiple = {new File(logDir, "largeLog2.log")}; this.executionLogsDao.uploadLogFile(3, "largeFiles", 0, largeLogMultiple); final File[] largeLog4 = {new File(logDir, "largeLog1.log")}; this.executionLogsDao.uploadLogFile(4, "largeFiles", 0, largeLog4); final long currentTimeMillis2 = System.currentTimeMillis() + 1000; totalRemovedRecords = executionLogsDao.removeExecutionLogsByTime(currentTimeMillis2, 2); assertThat(totalRemovedRecords).isEqualTo(4); }
Source:
public SingleInputNode(ReteContainer reteContainer) { super(reteContainer); mailbox = new DefaultMailbox(this); reteContainer.registerClearable(mailbox); parent = null; }

Target:
public SingleInputNode(ReteContainer reteContainer) { super(reteContainer); mailbox = instantiateMailbox(); reteContainer.registerClearable(mailbox); parent = null; }
Source:
public void setSelectionRange(int beginIndex, int endIndex) { if (fTableItemCount > 0) { fSelectedBeginRank = beginIndex; fSelectedEventRank = endIndex; if ((beginIndex < fTableTopEventRank + fFrozenRowCount && beginIndex >= fFrozenRowCount) || (beginIndex >= fTableTopEventRank + fFullyVisibleRows)) { int lastPageTopEntryRank = Math.max(0, fTableItemCount - fFullyVisibleRows); fTableTopEventRank = Math.max(0, Math.min(lastPageTopEntryRank, beginIndex - fFrozenRowCount - fFullyVisibleRows / 2)); } if (fFullyVisibleRows < fTableItemCount) { fSlider.setSelection(fTableTopEventRank); } refreshTable(); } }

Target:
public void setSelectionRange(int beginIndex, int endIndex) { if (fTableItemCount > 0) { int begin = Math.min(beginIndex, fTableItemCount - 1); begin = Math.max(begin, 0); int end = Math.min(endIndex, fTableItemCount - 1); end = Math.max(end, 0); fSelectedBeginRank = begin; fSelectedEventRank = end; if ((begin < fTableTopEventRank + fFrozenRowCount && begin >= fFrozenRowCount) || (begin >= fTableTopEventRank + fFullyVisibleRows)) { int lastPageTopEntryRank = Math.max(0, fTableItemCount - fFullyVisibleRows); fTableTopEventRank = Math.max(0, Math.min(lastPageTopEntryRank, begin - fFrozenRowCount - fFullyVisibleRows / 2)); } if (fFullyVisibleRows < fTableItemCount) { fSlider.setSelection(fTableTopEventRank); } refreshTable(); } }
Source:
private SearchResult parseToSearchResult(@Nonnull final IMAPResponse[] ir) throws ImapAsyncClientException { if (ir.length < 1) { throw new ImapAsyncClientException(FailureType.INVALID_INPUT); } final Response taggedResponse = ir[ir.length - 1]; if (!taggedResponse.isOK()) { throw new ImapAsyncClientException(FailureType.INVALID_INPUT); } final List<Long> v = new ArrayList<Long>(); Long modSeq = null; long num; for (final IMAPResponse sr : ir) { if (sr.keyEquals("SEARCH")) { while ((num = sr.readLong()) != -1) { v.add(num); } if (sr.readByte() == '(') { final String s = sr.readAtom(); if (s.equalsIgnoreCase("MODSEQ")) { modSeq = sr.readLong(); } } } } return new SearchResult(v, modSeq); }

Target:
private SearchResult parseToSearchResult(@Nonnull final IMAPResponse[] ir) throws ImapAsyncClientException { if (ir.length < 1) { throw new ImapAsyncClientException(FailureType.INVALID_INPUT); } final Response taggedResponse = ir[ir.length - 1]; if (!taggedResponse.isOK()) { throw new ImapAsyncClientException(FailureType.INVALID_INPUT); } final List<Long> v = new ArrayList<Long>(); Long modSeq = null; long num; for (final IMAPResponse sr : ir) { if (sr.keyEquals("SEARCH")) { while ((num = sr.readLong()) != -1) { v.add(Long.valueOf(num)); } if (sr.readByte() == L_PAREN) { final String s = sr.readAtom(); if (MODSEQ.equals(s)) { modSeq = sr.readLong(); } } } } return new SearchResult(v, modSeq); }
Source:
public boolean shouldUseNativeIO(VM vm, DiskImage diskImage, VmDevice device) { StorageType storageType = diskImage.getStorageTypes().get(0); String diskType = getDiskType(vm, diskImage, device); boolean isNativeIO = !"file".equals(diskType) || (storageType == StorageType.GLUSTERFS && FeatureSupported.useNativeIOForGluster(vm.getCompatibilityVersion())); if (device.getSnapshotId() != null) { isNativeIO = false; } return isNativeIO; }

Target:
public boolean shouldUseNativeIO(VM vm, DiskImage diskImage, VmDevice device) { StorageType storageType = diskImage.getStorageTypes().get(0); String diskType = getDiskType(vm, diskImage, device); return (!"file".equals(diskType) || (storageType == StorageType.GLUSTERFS && FeatureSupported.useNativeIOForGluster(vm.getCompatibilityVersion()))) && device.getSnapshotId() == null; }
Source:
void printUsageInfo() { StringBuffer usage = new StringBuffer(); usage.append(SEPARATOR); usage.append("To use SeLion Grid"); usage.append(SEPARATOR); usage.append("\n"); usage.append("Usage: java [system properties] -jar SeLion-Grid.jar [options] \n"); usage.append(" [driver options] \n"); usage.append("\n"); usage.append(" Options:\n"); usage.append(" " + SELION_CONFIG_ARG + " <config file name>: \n"); usage.append(" A SeLion Grid configuration JSON file \n"); usage.append(" " + SELION_NOCONTINUOS_ARG + "\n"); usage.append(" Disable continuous restarting of node/hub sub-process \n"); usage.append("\n"); usage.append(" Driver Options: \n"); usage.append(" Any valid driver (appium, selendroid, or ios-driver) dash option(s). \n"); usage.append("\n"); usage.append(" System Properties: \n"); usage.append(" -DselionHome=<folderPath>: \n"); usage.append(" Path of SeLion home directory. Defaults to \n"); usage.append(" <user.home>/.selion/ \n"); usage.append(" -D[property]=[value]: \n"); usage.append(" Any other System Property you wish to pass to the JVM \n"); System.out.print(usage.toString()); }

Target:
void printUsageInfo() { StringBuilder usage = new StringBuilder(); usage.append(SEPARATOR); usage.append("To use SeLion Grid"); usage.append(SEPARATOR); usage.append("\n"); usage.append("Usage: java [system properties] -jar SeLion-Grid.jar [options] \n"); usage.append(" [driver options] \n"); usage.append("\n"); usage.append(" Options:\n"); usage.append(" " + SELION_CONFIG_ARG + " <config file name>: \n"); usage.append(" A SeLion Grid configuration JSON file \n"); usage.append(" " + SELION_NOCONTINUOUS_ARG + "\n"); usage.append(" Disable continuous restarting of node/hub sub-process \n"); usage.append("\n"); usage.append(" Driver Options: \n"); usage.append(" Any valid driver (appium, selendroid, or ios-driver) dash option(s). \n"); usage.append("\n"); usage.append(" System Properties: \n"); usage.append(" -DselionHome=<folderPath>: \n"); usage.append(" Path of SeLion home directory. Defaults to \n"); usage.append(" <user.home>/.selion/ \n"); usage.append(" -D[property]=[value]: \n"); usage.append(" Any other System Property you wish to pass to the JVM \n"); System.out.print(usage.toString()); }
Source:
public int hashCode() { int result = super.hashCode(); result = 31 * result + (host != null ? host.hashCode() : 0); return result; }

Target:
public int hashCode() { int result = super.hashCode(); result = 31 * result + Objects.hashCode(host); return result; }
Source:
public int getUnhealthy() { return unhealthy ? 1 : 0; }

Target:
public int getUnhealthy() { return unhealthy; }
Source:
public static void initMarkerSets() { if (!MARKER_CONFIG_FILE.exists()) { try { File defaultConfigFile = new File(FileLocator.toFileURL(DEFAULT_MARKER_CONFIG_URL).toURI()); Files.copy(defaultConfigFile.toPath(), MARKER_CONFIG_FILE.toPath(), StandardCopyOption.REPLACE_EXISTING); } catch (URISyntaxException | IOException e) { Activator.logError("Error copying " + DEFAULT_MARKER_CONFIG_URL + " to " + MARKER_CONFIG_FILE.getAbsolutePath(), e); } } if (!MARKER_CONFIG_SCHEMA_FILE.exists()) { try { File schemaFile = new File(FileLocator.toFileURL(MARKER_CONFIG_SCHEMA_URL).toURI()); Files.copy(schemaFile.toPath(), MARKER_CONFIG_SCHEMA_FILE.toPath(), StandardCopyOption.REPLACE_EXISTING); } catch (URISyntaxException | IOException e) { Activator.logError("Error copying " + MARKER_CONFIG_SCHEMA_URL + " to " + MARKER_CONFIG_SCHEMA_FILE.getAbsolutePath(), e); } } if (!MARKER_CONFIG_DIR.exists()) { MARKER_CONFIG_DIR.mkdir(); } Collection<String> extensionPoint = getExtensionDefinitionsPaths(); for (String extensionBookmark : extensionPoint) { try { Path path = Paths.get(extensionBookmark); Files.copy(path, Paths.get(MARKER_CONFIG_DIR.getPath(), path.getFileName().toString()), StandardCopyOption.REPLACE_EXISTING); } catch (IOException e) { Activator.logError("Error copying " + extensionBookmark + " to " + MARKER_CONFIG_FILE.getAbsolutePath(), e); } } }

Target:
public static void initMarkerSets() { if (!MARKER_CONFIG_FILE.exists()) { try { File defaultConfigFile = new File(FileLocator.toFileURL(DEFAULT_MARKER_CONFIG_URL).toURI()); Files.copy(defaultConfigFile.toPath(), MARKER_CONFIG_FILE.toPath(), StandardCopyOption.REPLACE_EXISTING); } catch (URISyntaxException | IOException e) { Activator.logError("Error copying " + DEFAULT_MARKER_CONFIG_URL + " to " + MARKER_CONFIG_FILE.getAbsolutePath(), e); } } if (!MARKER_CONFIG_SCHEMA_FILE.exists()) { try { File schemaFile = new File(FileLocator.toFileURL(MARKER_CONFIG_SCHEMA_URL).toURI()); Files.copy(schemaFile.toPath(), MARKER_CONFIG_SCHEMA_FILE.toPath(), StandardCopyOption.REPLACE_EXISTING); } catch (URISyntaxException | IOException e) { Activator.logError("Error copying " + MARKER_CONFIG_SCHEMA_URL + " to " + MARKER_CONFIG_SCHEMA_FILE.getAbsolutePath(), e); } } }
Source:
public void populateEntityDictionary(EntityDictionary dictionary) { ClassScanner.getAllClasses(Table.class.getPackage().getName()).stream().forEach(cls -> { dictionary.bindEntity(cls); }); }

Target:
public void populateEntityDictionary(EntityDictionary dictionary) { ClassScanner.getAllClasses(META_DATA_PACKAGE.getName()).stream().forEach(cls -> { dictionary.bindEntity(cls); }); }
Source:
public void process(WatchedEvent event) { if (log.isTraceEnabled()) { log.trace("{}", event); } setWatcherForTableConfigVersion(event); switch (event.getType()) { case NodeDataChanged: if (event.getPath().endsWith(Constants.ZTABLE_CONFIG_VERSION)) { processTableConfigurationItem(event); break; } case NodeChildrenChanged: case NodeCreated: case NodeDeleted: remove(event.getPath()); break; case None: switch (event.getState()) { case Disconnected: if (log.isTraceEnabled()) { log.trace("Zoo keeper connection disconnected, clearing cache"); } clear(); break; case SyncConnected: break; case Expired: if (log.isTraceEnabled()) { log.trace("Zoo keeper connection expired, clearing cache"); } clear(); break; default: log.warn("Unhandled: {}", event); break; } break; default: log.warn("Unhandled: {}", event); break; } if (externalWatcher != null) { externalWatcher.process(event); } }

Target:
public void process(WatchedEvent event) { if (log.isTraceEnabled()) { log.trace("{}", event); } setWatcherForTableConfigVersion(event.getPath()); switch (event.getType()) { case NodeDataChanged: if (event.getPath().endsWith(Constants.ZTABLE_CONFIG_VERSION)) { try { processTableConfigurationItem(event); } catch (KeeperException | InterruptedException e) { log.error( "ZCacheWatcher::processTableConfigurationItem failed to process a table configuration change"); updateAllTableConfigurations(); tableConfigWatcherSet = false; setWatcherForTableConfigVersion(event.getPath()); } break; } case NodeChildrenChanged: if (event.getPath().endsWith("conf") && event.getType().equals(Event.EventType.NodeChildrenChanged)) { try { clear(event.getPath()); getZooKeeper().exists(event.getPath(), watcher); if (log.isTraceEnabled()){ log.trace("NodeChildrenChanged: resetting watcher for " + event.getPath()); if (externalWatcher != null) log.trace("external watcher with process this zpath also " + event.getPath()); } } catch (KeeperException | InterruptedException e) { log.error("could not reset watcher on parent node: " + event.getPath()); } } case NodeCreated: case NodeDeleted: remove(event.getPath()); break; case None: switch (event.getState()) { case Disconnected: if (log.isTraceEnabled()) { log.trace("Zoo keeper connection disconnected, clearing cache"); } clear(); break; case SyncConnected: break; case Expired: if (log.isTraceEnabled()) { log.trace("Zoo keeper connection expired, clearing cache"); } clear(); break; default: log.warn("Unhandled: {}", event); break; } break; default: log.warn("Unhandled: {}", event); break; } if (externalWatcher != null) { externalWatcher.process(event); } }
Source:
public static CryptoService newDefaultInstance() { return newInstance(DefaultConfiguration.getInstance(), false); }

Target:
public static CryptoService newDefaultInstance() { return newInstance(DefaultConfiguration.getInstance(), ClassloaderType.JAVA); }
Source:
public Response isAdmin(@FormParam("user") String username, @FormParam("token") String token, @Context UriInfo uriInfo) { User user = spawn.getPermissionsManager().authenticate(username, token); boolean isamdin = spawn.getPermissionsManager().isamdin(user); Response.ResponseBuilder builder; if (!isamdin) { builder = Response.ok(Boolean.toString(false)); } else { builder = Response.ok(Boolean.toString(true)); } builder.header("Access-Control-Allow-Origin", "http://" + uriInfo.getAbsolutePath().getHost() + ":" + configuration.webPort); builder.header("Access-Control-Allow-Methods", "POST"); return builder.build(); }

Target:
public Response isAdmin(@FormParam("user") String username, @FormParam("token") String token, @Context UriInfo uriInfo) { User user = spawn.getPermissionsManager().authenticate(username, token); boolean isAmdin = spawn.getPermissionsManager().isAdmin(user); Response.ResponseBuilder builder; builder = Response.ok(Boolean.toString(isAmdin)); builder.header("Access-Control-Allow-Origin", "http://" + uriInfo.getAbsolutePath().getHost() + ":" + configuration.webPort); builder.header("Access-Control-Allow-Methods", "POST"); return builder.build(); }
Source:
public void testEntryMemTableParallelFlush() throws Exception { int gcWaitTime = 1000; ServerConfiguration conf = TestBKConfiguration.newServerConfiguration(); conf.setGcWaitTime(gcWaitTime); conf.setLedgerDirNames(createAndGetLedgerDirs(1)); conf.setLedgerStorageClass(FlushTestSortedLedgerStorage.class.getName()); conf.setEntryLogPerLedgerEnabled(true); Bookie bookie = new Bookie(conf); FlushTestSortedLedgerStorage flushTestSortedLedgerStorage = (FlushTestSortedLedgerStorage) bookie.ledgerStorage; EntryMemTable memTable = flushTestSortedLedgerStorage.memTable; bookie.addEntry(generateEntry(1, 1), false, new Bookie.NopWriteCallback(), null, "passwd".getBytes()); bookie.addEntry(generateEntry(2, 1), false, new Bookie.NopWriteCallback(), null, "passwd".getBytes()); bookie.addEntry(generateEntry(3, 1), false, new Bookie.NopWriteCallback(), null, "passwd".getBytes()); flushTestSortedLedgerStorage.addEntry(generateEntry(1, 2)); flushTestSortedLedgerStorage.addEntry(generateEntry(2, 2)); flushTestSortedLedgerStorage.addEntry(generateEntry(3, 2)); assertTrue("EntryMemTable SnapShot is expected to be empty", memTable.snapshot.isEmpty()); assertFalse("EntryMemTable is not expected to be empty", memTable.isEmpty()); flushTestSortedLedgerStorage.setInjectMemTableSizeLimitReached(true); flushTestSortedLedgerStorage.addEntry(generateEntry(1, 3)); Thread.sleep(1000); assertTrue("EntryMemTable SnapShot is expected to be empty", memTable.snapshot.isEmpty()); assertEquals("Flusher called", 1, flushTestSortedLedgerStorage.getNumOfTimesFlushSnapshotCalled()); }

Target:
public void testEntryMemTableParallelFlush() throws Exception { int gcWaitTime = 1000; ServerConfiguration conf = TestBKConfiguration.newServerConfiguration(); conf.setGcWaitTime(gcWaitTime); conf.setLedgerDirNames(createAndGetLedgerDirs(1)); conf.setLedgerStorageClass(FlushTestSortedLedgerStorage.class.getName()); conf.setEntryLogPerLedgerEnabled(true); Bookie bookie = new Bookie(conf); FlushTestSortedLedgerStorage flushTestSortedLedgerStorage = (FlushTestSortedLedgerStorage) bookie.ledgerStorage; EntryMemTable memTable = flushTestSortedLedgerStorage.memTable; bookie.addEntry(generateEntry(1, 1), false, new Bookie.NopWriteCallback(), null, "passwd".getBytes()); bookie.addEntry(generateEntry(2, 1), false, new Bookie.NopWriteCallback(), null, "passwd".getBytes()); bookie.addEntry(generateEntry(3, 1), false, new Bookie.NopWriteCallback(), null, "passwd".getBytes()); flushTestSortedLedgerStorage.addEntry(generateEntry(1, 2)); flushTestSortedLedgerStorage.addEntry(generateEntry(2, 2)); flushTestSortedLedgerStorage.addEntry(generateEntry(3, 2)); assertTrue("EntryMemTable SnapShot is expected to be empty", memTable.snapshot.isEmpty()); assertFalse("EntryMemTable is not expected to be empty", memTable.isEmpty()); flushTestSortedLedgerStorage.setInjectMemTableSizeLimitReached(true); flushTestSortedLedgerStorage.addEntry(generateEntry(1, 3)); assertTrue("EntryMemTable SnapShot is expected to be empty", memTable.snapshot.isEmpty()); assertEquals("Flusher called", 1, flushTestSortedLedgerStorage.getNumOfTimesFlushSnapshotCalled()); }
Source:
private void validate() { assertThat(discoveryClient, Objects::nonNull, () -> new AxonConfigurationException( "The DiscoveryClient is a hard requirement and should be provided")); assertThat(localServiceInstance, Objects::nonNull, () -> new AxonConfigurationException( "The Registration is a hard requirement and should be provided")); assertThat(routingStrategy, Objects::nonNull, () -> new AxonConfigurationException( "The RoutingStrategy is a hard requirement and should be provided")); assertThat(serviceInstanceFilter, Objects::nonNull, () -> new AxonConfigurationException( "The ServiceInstanceFilter is a hard requirement and should be provided")); assertThat(consistentHashChangeListener, Objects::nonNull, () -> new AxonConfigurationException( "The ConsistentHashChangeListener is a hard requirement and should be provided")); }

Target:
protected void validate() { assertNonNull(discoveryClient, "The DiscoveryClient is a hard requirement and should be provided"); assertNonNull(localServiceInstance, "The Registration is a hard requirement and should be provided"); assertNonNull(routingStrategy, "The RoutingStrategy is a hard requirement and should be provided"); assertNonNull(serviceInstanceFilter, "The ServiceInstanceFilter is a hard requirement and should be provided"); assertNonNull(consistentHashChangeListener, "The ConsistentHashChangeListener is a hard requirement and should be provided"); }
Source:
static <T1, T2> Tuple2<Seq<T1>, Seq<T2>> sequence2(Iterable<? extends Tuple2<? extends T1, ? extends T2>> tuples) { Objects.requireNonNull(tuples, "tuples is null"); return new Tuple2<>(Stream.narrow(Iterator.ofAll(tuples).map(Tuple2::_1).toStream()), Stream.narrow(Iterator.ofAll(tuples).map(Tuple2::_2).toStream())); }

Target:
static <T1, T2> Tuple2<Seq<T1>, Seq<T2>> sequence2(Iterable<? extends Tuple2<? extends T1, ? extends T2>> tuples) { Objects.requireNonNull(tuples, "tuples is null"); final Stream<Tuple2<? extends T1, ? extends T2>> s = Stream.ofAll(tuples); return new Tuple2<>(s.map(Tuple2::_1), s.map(Tuple2::_2)); }
Source:
public Map<SchemaTableName, List<ColumnMetadata>> listTableColumns(ConnectorSession session, SchemaTablePrefix prefix) { requireNonNull(prefix, "prefix is null"); if (prefix.getSchemaName() != null && !prefix.getSchemaName().equals(JMX_SCHEMA_NAME) && !prefix.getSchemaName().equals(HISTORY_SCHEMA_NAME)) { return ImmutableMap.of(); } List<SchemaTableName> tableNames; if (prefix.getTableName() == null) { tableNames = listTables(session, prefix.getSchemaName()); } else { tableNames = ImmutableList.of(new SchemaTableName(prefix.getSchemaName(), prefix.getTableName())); } return tableNames.stream() .collect(toImmutableMap(tableName -> tableName, tableName -> getTableHandle(session, tableName).getTableMetadata().getColumns())); }

Target:
public Map<SchemaTableName, List<ColumnMetadata>> listTableColumns(ConnectorSession session, SchemaTablePrefix prefix) { requireNonNull(prefix, "prefix is null"); if (prefix.getSchemaName() != null && !prefix.getSchemaName().equals(JMX_SCHEMA_NAME) && !prefix.getSchemaName().equals(HISTORY_SCHEMA_NAME)) { return ImmutableMap.of(); } List<SchemaTableName> tableNames; if (prefix.getTableName() == null) { tableNames = listTables(session, prefix.getSchemaName()); } else { tableNames = ImmutableList.of(new SchemaTableName(prefix.getSchemaName(), prefix.getTableName())); } return tableNames.stream() .collect(toImmutableMap(Function.identity(), tableName -> getTableHandle(session, tableName).getTableMetadata().getColumns())); }
Source:
public static Features<VersionLevelRange> emptyFinalizedFeatures() { return new Features<>(new HashMap<>()); }

Target:
public static Features<FinalizedVersionRange> emptyFinalizedFeatures() { return new Features<>(new HashMap<>()); }
Source:
public int hashCode() { return Objects.hash(url, tableName, driverName, username, password, dialect, connectionCheckTimeoutSeconds); }

Target:
public int hashCode() { return Objects.hash(url, tableName, driverName, username, password, dialect.getClass().getName(), parallelism, connectionCheckTimeoutSeconds); }
Source:
public boolean renew() { if (!this.delegate.isHeldByCurrentThread()) { throw new IllegalMonitorStateException("You do not own mutex at " + this.path); } while (true) { try { boolean renewed = this.mutex.renew(this.path); if (renewed) { this.lastUsed = System.currentTimeMillis(); } return renewed; } catch (TransientDataAccessException e) { } catch (Exception e) { throw new DataAccessResourceFailureException("Failed to renew mutex at " + this.path, e); } } }

Target:
public boolean renew() { if (!this.delegate.isHeldByCurrentThread()) { throw new IllegalMonitorStateException("The current thread doesn't own mutex at " + this.path); } while (true) { try { boolean renewed = this.mutex.renew(this.path); if (renewed) { this.lastUsed = System.currentTimeMillis(); } return renewed; } catch (TransientDataAccessException | TransactionTimedOutException e) { } catch (Exception e) { throw new DataAccessResourceFailureException("Failed to renew mutex at " + this.path, e); } } }
Source:
public Configuration getConfiguration(final GraphContext grCtx) { return ConfigurationBuilder.begin() .addRule() .perform(new AddSortedFileIndexOperation()) .addRule() .perform(new AddLuceneFileIndexOperation()); }

Target:
public Configuration getConfiguration(final GraphContext grCtx) { return ConfigurationBuilder.begin() .addRule() .perform(new AddDelimitedFileIndexOperation()) .addRule() .perform(new AddLuceneFileIndexOperation()); }
Source:
public void allTests() throws Exception { testNavLinkToPage(); testContent(); }

Target:
public void allTests() throws Exception { testContent(); }
Source:
private long download(T object, File outFile) throws IOException { try { return RetryUtils.retry( () -> { try (final InputStream is = openObjectFunction.open(object); final OutputStream os = new FileOutputStream(outFile)) { return IOUtils.copyLarge(is, os, buffer); } }, retryCondition, maxFetchRetry + 1, StringUtils.format("Failed to download object[%s]", object) ); } catch (Exception e) { throw new IOException(e); } }

Target:
private long download(T object, File outFile) throws IOException { try { return RetryUtils.retry( () -> { try (final InputStream is = openObjectFunction.open(object); final OutputStream os = new FileOutputStream(outFile)) { return IOUtils.copyLarge(is, os, buffer); } }, retryCondition, outFile::delete, maxFetchRetry + 1, StringUtils.format("Failed to download object[%s]", object) ); } catch (Exception e) { throw new IOException(e); } }
Source:
protected void doBeginRead() throws Exception { if (!tempInboundMessages().isEmpty()) { Object msg; while ((msg = tempInboundMessages().poll()) != null) { ChannelPipeline p = pipeline(); p.fireChannelRead(msg); } tempInboundMessages().clear(); flushInbound(false, voidPromise()); } }

Target:
protected void doBeginRead() throws Exception { if (isNotEmpty(tempInboundMessages)) { for (;;) { AbstractMap.SimpleEntry<Object, ChannelPromise> pair = tempInboundMessages.poll(); if (pair == null) { break; } Object msg = pair.getKey(); if (msg != null) { pipeline().fireChannelRead(msg); } ChannelPromise promise = pair.getValue(); if (promise != null) { checkException(promise); } } flushInbound(false, voidPromise()); } }
Source:
public Schema getSchemaForDependency(String PackageName, String SchemaName) { String FullName = PackageName + "." + SchemaName; Schema S = _Dependencies.get(FullName); if (S == null) LOG.debug("Schema "+ FullName +" has been found in the schema dependency list."); return S; }

Target:
public Schema getSchemaForDependency(String PackageName, String SchemaName) { String FullName = PackageName + "." + SchemaName; Schema S = _Dependencies.get(FullName); if (S == null) LOG.debug("Schema "+ FullName +" has not been found in the schema dependency list."); return S; }
Source:
public boolean doCuration(Context c, BasicWorkflowItem wfi) throws AuthorizeException, IOException, SQLException { FlowStep step = getFlowStep(wfi); if (step != null) { Curator curator = new Curator(); if (step.queue != null) { for (Task task : step.tasks) { curator.addTask(task.name); } curator.queue(c, String.valueOf(wfi.getID()), step.queue); basicWorkflowItemService.update(c, wfi); return false; } else { Date now = GregorianCalendar.getInstance().getTime(); SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddThhmmssSSS"); String filename = String.format("curation-%s.log", sdf.format(now)); Path logPath = Paths.get( configurationService.getProperty("dspace.dir"), "logs", filename); try (PrintWriter reporter = new PrintWriter(logPath.toFile())) { curator.setReporter(reporter); return curate(curator, c, wfi); } } } return true; }

Target:
public boolean doCuration(Context c, BasicWorkflowItem wfi) throws AuthorizeException, IOException, SQLException { FlowStep step = getFlowStep(wfi); if (step != null) { Curator curator = new Curator(); if (step.queue != null) { for (Task task : step.tasks) { curator.addTask(task.name); } curator.queue(c, String.valueOf(wfi.getID()), step.queue); basicWorkflowItemService.update(c, wfi); return false; } else { PluginService plugins = CoreServiceFactory.getInstance() .getPluginService(); try (Reporter reporter = (Reporter) plugins .getSinglePlugin(Reporter.class);) { curator.setReporter(reporter); boolean status = curate(curator, c, wfi); reporter.close(); return status; } catch (Exception e) { log.error("Failed to close report", e); } } } return true; }
Source:
public void sendOreonSpawnEvent(Prefab prefabToSpawn) { setPortalEntity(); if(portalEntity.hasComponent(LocationComponent.class)) { localPlayer.getCharacterEntity().send(new OreonSpawnEvent(prefabToSpawn, portalEntity.getComponent(LocationComponent.class).getWorldPosition())); } }

Target:
private void sendOreonSpawnEvent(Prefab prefabToSpawn) { setPortalEntity(); LocationComponent portalLocation = portalEntity.getComponent(LocationComponent.class); if (portalLocation != null) { localPlayer.getCharacterEntity().send(new OreonSpawnEvent(prefabToSpawn, portalLocation.getWorldPosition())); } }
Source:
public static void writeRegistry(CompoundNBT data) { data.putInt("version", 1); List<SavedEntry> list = new ArrayList<>(); for (DimensionType type : REGISTRY) { if (type.getModType() == null){ list.add(new SavedEntry(type)); }else{ if (type.getModType().saveToLevelDat()) { list.add(new SavedEntry(type)); } } } savedEntries.values().forEach(list::add); Collections.sort(list, (a, b) -> a.id - b.id); ListNBT lst = new ListNBT(); list.forEach(e -> lst.add(e.write())); data.put("entries", lst); }

Target:
public static void writeRegistry(CompoundNBT data) { data.putInt("version", 1); List<SavedEntry> list = new ArrayList<>(); for (DimensionType type : REGISTRY) { if (type.getModType() == null) { list.add(new SavedEntry(type)); } else { if (type.getModType().persistToLevelDat()) { list.add(new SavedEntry(type)); } } } savedEntries.values().forEach(list::add); Collections.sort(list, (a, b) -> a.id - b.id); ListNBT lst = new ListNBT(); list.forEach(e -> lst.add(e.write())); data.put("entries", lst); }
Source:
public JobScheduler(final CoordinatorRegistryCenter regCenter, final String elasticJobType, final JobConfiguration jobConfig, final TracingConfiguration<?> tracingConfig) { this.regCenter = regCenter; this.elasticJobType = elasticJobType; final Collection<ElasticJobListener> elasticJobListeners = jobConfig.getJobListenerTypes().stream() .map(type -> ElasticJobListenerFactory.getListener(type)).collect(Collectors.toList()); setUpFacade = new SetUpFacade(regCenter, jobConfig.getJobName(), elasticJobListeners); schedulerFacade = new SchedulerFacade(regCenter, jobConfig.getJobName()); jobFacade = new LiteJobFacade(regCenter, jobConfig.getJobName(), elasticJobListeners, tracingConfig); jobExecutor = new ElasticJobExecutor(elasticJobType, jobConfig, jobFacade); this.jobConfig = setUpFacade.setUpJobConfiguration(elasticJobType, jobConfig); setGuaranteeServiceForElasticJobListeners(regCenter, elasticJobListeners); jobScheduleController = createJobScheduleController(); }

Target:
public JobScheduler(final CoordinatorRegistryCenter regCenter, final String elasticJobType, final JobConfiguration jobConfig, final TracingConfiguration<?> tracingConfig) { this.regCenter = regCenter; this.elasticJobType = elasticJobType; final Collection<ElasticJobListener> elasticJobListeners = jobConfig.getJobListenerTypes().stream() .map(ElasticJobListenerFactory::getListener).collect(Collectors.toList()); setUpFacade = new SetUpFacade(regCenter, jobConfig.getJobName(), elasticJobListeners); schedulerFacade = new SchedulerFacade(regCenter, jobConfig.getJobName()); jobFacade = new LiteJobFacade(regCenter, jobConfig.getJobName(), elasticJobListeners, tracingConfig); jobExecutor = new ElasticJobExecutor(elasticJobType, jobConfig, jobFacade); this.jobConfig = setUpFacade.setUpJobConfiguration(elasticJobType, jobConfig); setGuaranteeServiceForElasticJobListeners(regCenter, elasticJobListeners); jobScheduleController = createJobScheduleController(); }
Source:
public void generate() throws IOException { Log.info("Running %s", () -> getClass().getSimpleName()); File root = sourceRoot.getRoot().toFile(); visit(root, ""); List<String> sortedPackages = new ArrayList<>(packages); sortedPackages.sort(String::compareTo); File projectRoot = root.getParentFile().getParentFile().getParentFile(); File template = new File(projectRoot, "bnd.bnd.template"); File output = new File(projectRoot, "bnd.bnd"); String lineSeparator = System.getProperty("line.separator"); StringBuilder packagesList = new StringBuilder("\\" + lineSeparator); boolean first = true; for(String pkg : sortedPackages) { if(!first) { packagesList.append(", \\").append(lineSeparator); } packagesList.append(" ").append(pkg); first = false; } try(BufferedReader reader = new BufferedReader(new FileReader(template))) { try(PrintWriter writer = new PrintWriter(new FileWriter(output))) { reader.lines().forEach(l -> writer.println(l.replace("{exportedPackages}", packagesList))); } } Log.info("Written " + output.getAbsolutePath()); }

Target:
public void generate() throws IOException { Log.info("Running %s", () -> getClass().getSimpleName()); Path root = sourceRoot.getRoot(); Path projectRoot = root.getParent().getParent().getParent(); String lineSeparator = System.getProperty("line.separator"); String packagesList = Files.walk(root) .filter(Files::isRegularFile) .map(path -> getPackageName(root, path)) .distinct() .sorted() .reduce(null, (packageList, packageName) -> concatPackageName(packageName, packageList, lineSeparator)); Path output = projectRoot.resolve("bnd.bnd"); try(Writer writer = Files.newBufferedWriter(output)) { Path templateFile = projectRoot.resolve("bnd.bnd.template"); String template = new String(Files.readAllBytes(templateFile), StandardCharsets.UTF_8); writer.write(template.replace("{exportedPackages}", packagesList)); } Log.info("Written " + output); }
Source:
public static Map.Entry<String, Map<String, ?>> pushFileCommand(String remotePath, byte[] base64Data) { String[] parameters = new String[] {"path", "data"}; String data; try { data = new String(base64Data, "UTF-8"); } catch (UnsupportedEncodingException e) { throw new IllegalArgumentException(e); } Object[] values = new Object[]{remotePath, data}; return new AbstractMap.SimpleEntry<>(PUSH_FILE, prepareArguments(parameters, values)); }

Target:
public static Map.Entry<String, Map<String, ?>> pushFileCommand(String remotePath, byte[] base64Data) { String[] parameters = new String[] {"path", "data"}; Object[] values = new Object[]{remotePath, new String(base64Data, StandardCharsets.UTF_8)}; return new AbstractMap.SimpleEntry<>(PUSH_FILE, prepareArguments(parameters, values)); }
Source:
private void initializeTimerEventListenerJobDeclaration(CmmnElement element, CmmnActivity activity, CmmnHandlerContext context) { TimerEventListenerJobDeclaration timerEventListenerJobDeclaration = parseTimerExpression(element,context); activity.setProperty(ItemHandler.PROPERTY_TIMERVEVENTLISTENER_JOBDECLARATION, timerEventListenerJobDeclaration); CaseDefinitionEntity caseDefinition = (CaseDefinitionEntity) context.getCaseDefinition(); if(caseDefinition.getTimerJobDeclarationMap()==null) caseDefinition.setTimerJobDeclarationMap(new HashMap<String, TimerJobDeclaration<?>>()); caseDefinition.getTimerJobDeclarationMap().put(element.getId(),timerEventListenerJobDeclaration); }

Target:
private void initializeTimerEventListenerJobDeclaration(CmmnElement element, CmmnActivity activity, CmmnHandlerContext context) { TimerEventListenerJobDeclaration timerEventListenerJobDeclaration = parseTimerExpression(element,context); timerEventListenerJobDeclaration.setActivity(activity); activity.setProperty(ItemHandler.PROPERTY_TIMERVEVENTLISTENER_JOBDECLARATION, timerEventListenerJobDeclaration); context.addJobDeclaration(timerEventListenerJobDeclaration); }
Source:
public synchronized void deserialize(InputArchive ia) throws IOException { clear(); int i = ia.readInt("map"); while (i > 0) { Long val = ia.readLong("long"); if (aclIndex < val) { aclIndex = val; } List<ACL> aclList = new ArrayList<ACL>(); Index j = ia.startVector("acls"); if (j != null) { while (!j.done()) { ACL acl = new ACL(); acl.deserialize(ia, "acl"); aclList.add(acl); j.incr(); } longKeyMap.put(val, aclList); aclKeyMap.put(aclList, val); referenceCounter.put(val, new AtomicLongWithEquals(0)); i--; } } }

Target:
public synchronized void deserialize(InputArchive ia) throws IOException { clear(); int i = ia.readInt("map"); while (i > 0) { Long val = ia.readLong("long"); if (aclIndex < val) { aclIndex = val; } List<ACL> aclList = new ArrayList<ACL>(); Index j = ia.startVector("acls"); if (j == null) { throw new RuntimeException("Incorrent format of InputArchive when deserialize DataTree - missing acls"); } while (!j.done()) { ACL acl = new ACL(); acl.deserialize(ia, "acl"); aclList.add(acl); j.incr(); } longKeyMap.put(val, aclList); aclKeyMap.put(aclList, val); referenceCounter.put(val, new AtomicLongWithEquals(0)); i--; } }
Source:
private short Y(short y) { if (y == -1) return (short) (height - 1); if (y == height) return (short) 0; return y; }

Target:
private short Y(short y) { if (y == -1) { return (short) (height - 1); } if (y == height) { return (short) 0; } return y; }
Source:
public void testMarkRequestExceptionWithRegex() { DropwizardRequestMetrics.Context context = requestMetrics.startLockRequest("lockcommand", "domain"); context.markRequestException(new NullPointerException("this@tests$the_regex#pattern")); Meter exceptionMeter = metricsRegistry.meter("api.lock.domain.lockcommand.requests.exception.NullPointerException.this.tests.the.regex.pattern"); Assert.assertEquals(1, exceptionMeter.getCount()); }

Target:
public void testMarkRequestExceptionWithRegex() { DropwizardRequestMetrics.Context errorContext1 = requestMetrics.startLockRequest("lockcommand", "domain"); errorContext1.markRequestException(Error.get("(just-checking@some#regex!replace$in%action^)")); Meter exceptionMeter1 = metricsRegistry.meter("api.lock.domain.lockcommand.requests.exception.Error._just_checking_some_regex_replace_in_action__"); Assert.assertEquals(1, exceptionMeter1.getCount()); Assert.assertNotNull(exceptionMeter1.getOneMinuteRate()); DropwizardRequestMetrics.Context errorContext2 = requestMetrics.startEntityRequest("find", "name", null); errorContext2.markRequestException(Error.get("{testing&some*more+regex~replace=in;action'}")); Meter exceptionMeter2 = metricsRegistry.meter("api.find.name.default.requests.exception.Error._testing_some_more_regex_replace_in_action__"); Assert.assertEquals(1, exceptionMeter2.getCount()); Assert.assertNotNull(exceptionMeter2.getMeanRate()); DropwizardRequestMetrics.Context errorContext3 = requestMetrics.startEntityRequest("delete", "name", "version"); errorContext3.markRequestException(Error.get("\\yet<more>regex?replace,action\"in here\\")); Meter exceptionMeter3 = metricsRegistry.meter("api.delete.name.version.requests.exception.Error._yet_more_regex_replace_action_in_here_"); Assert.assertEquals(1, exceptionMeter3.getCount()); Assert.assertNotNull(exceptionMeter3.getMeanRate()); }
Source:
public HttpRequestBuilder setMethod(Method method) { this.javaMethod = method; RequestLine requestLine = RequestLine.fromMethod(method); this.originalRelativePath = requestLine.getRelativePath(); this.httpMethod = requestLine.getHttpMethod(); return this; }

Target:
HttpRequestBuilder setMethod(Method method) { this.javaMethod = method; requestLine = RequestLine.fromMethod(method); return this; }
Source:
public InMemoryYamlConfig(String yaml, Properties properties) { LOGGER.info("Configuring Hazelcast from 'in-memory YAML'."); if (yaml == null || "".equals(yaml.trim())) { throw new IllegalArgumentException("YAML configuration is null or empty! Please use a well-structured YAML."); } if (properties == null) { throw new IllegalArgumentException("properties can't be null"); } InputStream in = new ByteArrayInputStream(stringToBytes(yaml)); new YamlConfigBuilder(in).setProperties(properties).build(this); }

Target:
public InMemoryYamlConfig(String yaml, Properties properties) { LOGGER.info("Configuring Hazelcast from 'in-memory YAML'."); if (isNullOrEmptyAfterTrim(yaml)) { throw new IllegalArgumentException("YAML configuration is null or empty! Please use a well-structured YAML."); } if (properties == null) { throw new IllegalArgumentException("properties can't be null"); } InputStream in = new ByteArrayInputStream(stringToBytes(yaml)); new YamlConfigBuilder(in).setProperties(properties).build(this); }
Source:
private void finishBundle(Bundle bundle) { queue.remove(bundle); finishedBundles.add(bundle); registerReadyMarker(bundle); Set<Bundle> remainingBundles = getRemainingBundles(); if (!remainingBundles.isEmpty()) { logger.trace("Remaining bundles with {}: {}", xmlDirectory, remainingBundles); } else { logger.debug("Finished loading bundles with {}", xmlDirectory); loadingCompleted(); } }

Target:
private void finishBundle(Bundle bundle) { queue.remove(bundle); finishedBundles.add(bundle); registerReadyMarker(bundle); Set<Bundle> remainingBundles = getRemainingBundles(); if (!remainingBundles.isEmpty()) { logger.trace("Remaining bundles with {}: {}", xmlDirectory, remainingBundles); } else { logger.trace("Finished loading bundles with {}", xmlDirectory); loadingCompleted(); } }
Source:
public boolean test(Object receiver, String property, Object[] args, Object expectedValue) { Repository repository = (Repository) receiver; if (repository == null) { return false; } GitFlowRepository gitFlowRepository = new GitFlowRepository(repository); try { if (IS_INITIALIZED.equals(property)) { return gitFlowRepository.getConfig().isInitialized(); } else if (IS_FEATURE.equals(property)) { return gitFlowRepository.isFeature(); } else if (IS_RELEASE.equals(property)) { return gitFlowRepository.isRelease(); } else if (IS_HOTFIX.equals(property)) { return gitFlowRepository.isHotfix(); } else if (IS_DEVELOP.equals(property)) { return gitFlowRepository.isDevelop(); } else if (IS_MASTER.equals(property)) { return gitFlowRepository.isMaster(); } else if (HAS_DEFAULT_REMOTE.equals(property)) { return gitFlowRepository.getConfig().hasDefaultRemote(); } } catch (IOException e) { Activator.getDefault().getLog().log(error(e.getMessage(), e)); } return false; }

Target:
public boolean test(Object receiver, String property, Object[] args, Object expectedValue) { if (receiver == null || !(receiver instanceof Repository)) { return false; } Repository repository = (Repository) receiver; GitFlowRepository gitFlowRepository = new GitFlowRepository(repository); try { if (IS_INITIALIZED.equals(property)) { return gitFlowRepository.getConfig().isInitialized(); } else if (IS_FEATURE.equals(property)) { return gitFlowRepository.isFeature(); } else if (IS_RELEASE.equals(property)) { return gitFlowRepository.isRelease(); } else if (IS_HOTFIX.equals(property)) { return gitFlowRepository.isHotfix(); } else if (IS_DEVELOP.equals(property)) { return gitFlowRepository.isDevelop(); } else if (IS_MASTER.equals(property)) { return gitFlowRepository.isMaster(); } else if (HAS_DEFAULT_REMOTE.equals(property)) { return gitFlowRepository.getConfig().hasDefaultRemote(); } } catch (IOException e) { Activator.getDefault().getLog().log(error(e.getMessage(), e)); } return false; }