auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public boolean areRemindersActive() { ArrayList<Date> activeAlarmsDates = new ArrayList<>(); RealmResults<Reminder> activeRemindersList = realm.where(Reminder.class) .equalTo("active", true) .findAll(); for (int i=0; i<activeRemindersList.size(); i++){ activeAlarmsDates.add(activeRemindersList.get(i).getAlarmTime()); } return activeAlarmsDates.size() > 0; }

Target:
public boolean areRemindersActive() { RealmResults<Reminder> activeRemindersList = realm.where(Reminder.class) .equalTo("active", true) .findAll(); return activeRemindersList.size() > 0; }
Source:
public static String buildMessage(String userInput){ String domain = ReportProblemActivity.getDomain(); String postURL = ReportProblemActivity.getPostURL(); String version= ReportProblemActivity.getVersion(); String username = ReportProblemActivity.getUser(); return "Problem reported via CommCareODK. " + "\n User: " + username + "\n Domain: " + domain + "\n PostURL: " + postURL + "\n CCODK version: " + version + "\n Device Model: " + Build.MODEL + "\n Manufacturer: " + Build.MANUFACTURER + "\n Android Version: " + Build.VERSION.RELEASE + "\n Message: " + userInput; }

Target:
private static String buildMessage(String userInput){ String domain = ReportProblemActivity.getDomain(); String postURL = ReportProblemActivity.getPostURL(); String version= ReportProblemActivity.getVersion(); String username = ReportProblemActivity.getUser(); return "Problem reported via CommCareODK. " + "\n User: " + username + "\n Domain: " + domain + "\n PostURL: " + postURL + "\n CCODK version: " + version + "\n Device Model: " + Build.MODEL + "\n Manufacturer: " + Build.MANUFACTURER + "\n Android Version: " + Build.VERSION.RELEASE + "\n Message: " + userInput; }
Source:
public OmCalendar update(OmCalendar c){ if(c.getId() == null){ em.persist(c); } else c = em.merge(c); return c; }

Target:
public OmCalendar update(OmCalendar c) { if (c.getId() == null) { em.persist(c); } else { c = em.merge(c); } return c; }
Source:
public VideobridgeStatistics() { BundleContext bundleContext = StatsManagerBundleActivator.getBundleContext(); region = Config.region(); unlockedSetStat(BITRATE_DOWNLOAD, 0); unlockedSetStat(BITRATE_UPLOAD, 0); unlockedSetStat(CONFERENCES, 0); unlockedSetStat(PARTICIPANTS, 0); unlockedSetStat(THREADS, 0); unlockedSetStat(RTP_LOSS, 0d); unlockedSetStat(VIDEO_CHANNELS, 0); unlockedSetStat(VIDEO_STREAMS, 0); unlockedSetStat(LOSS_RATE_DOWNLOAD, 0d); unlockedSetStat(LOSS_RATE_UPLOAD, 0d); unlockedSetStat(JITTER_AGGREGATE, 0d); unlockedSetStat(RTT_AGGREGATE, 0d); unlockedSetStat(LARGEST_CONFERENCE, 0); unlockedSetStat(CONFERENCE_SIZES, "[]"); unlockedSetStat(TIMESTAMP, currentTimeMillis()); }

Target:
public VideobridgeStatistics() { BundleContext bundleContext = StatsManagerBundleActivator.getBundleContext(); unlockedSetStat(BITRATE_DOWNLOAD, 0); unlockedSetStat(BITRATE_UPLOAD, 0); unlockedSetStat(CONFERENCES, 0); unlockedSetStat(PARTICIPANTS, 0); unlockedSetStat(THREADS, 0); unlockedSetStat(RTP_LOSS, 0d); unlockedSetStat(VIDEO_CHANNELS, 0); unlockedSetStat(VIDEO_STREAMS, 0); unlockedSetStat(LOSS_RATE_DOWNLOAD, 0d); unlockedSetStat(LOSS_RATE_UPLOAD, 0d); unlockedSetStat(JITTER_AGGREGATE, 0d); unlockedSetStat(RTT_AGGREGATE, 0d); unlockedSetStat(LARGEST_CONFERENCE, 0); unlockedSetStat(CONFERENCE_SIZES, "[]"); unlockedSetStat(TIMESTAMP, currentTimeMillis()); }
Source:
protected Object[] getSortedChildren(Object parentElementOrTreePath) { Object[] result = super.getSortedChildren(parentElementOrTreePath); if (parentElementOrTreePath instanceof Adapter && ((Adapter)parentElementOrTreePath).getTarget() instanceof Conflict) { Iterable<Object> leftSide = Iterables.filter(Lists.newArrayList(result), fromSide(DifferenceSource.LEFT)); Iterable<Object> rightSide = Iterables.filter(Lists.newArrayList(result), fromSide(DifferenceSource.RIGHT)); result = Iterables.toArray(Iterables.concat(leftSide, rightSide), Object.class); } return result; }

Target:
protected Object[] getSortedChildren(Object parentElementOrTreePath) { Object[] result = super.getSortedChildren(parentElementOrTreePath); if (parentElementOrTreePath instanceof Adapter && ((Adapter)parentElementOrTreePath).getTarget() instanceof Conflict) { Collections.sort(Arrays.asList(result), new Comparator<Object>() { public int compare(Object o1, Object o2) { return getValue(o1) - getValue(o2); } public int getValue(Object o) { int value = 0; if (o instanceof Adapter && ((Adapter)o).getTarget() instanceof Diff) { if (((Diff)((Adapter)o).getTarget()).getSource() == DifferenceSource.LEFT) { value = 1; } else { value = 2; } } return value; } }); } return result; }
Source:
public void setFirstParent(boolean enable) { assertNotStarted(); queue = new DateRevQueue(firstParent = enable); pending = new StartGenerator(this); }

Target:
public void setFirstParent(boolean enable) { assertNotStarted(); assertNoCommitsMarkedStart(); firstParent = enable; queue = new DateRevQueue(firstParent); pending = new StartGenerator(this); }
Source:
public String convertSingleParameterToTemplateKey( final String xlsTemplate, final ParameterizedValueBuilder.Part part ) { final StringBuffer result = new StringBuffer(); final Matcher matcherSingleParameter = patternSingleParameter.matcher( xlsTemplate ); while ( matcherSingleParameter.find() ) { matcherSingleParameter.appendReplacement( result, "@{" + PARAMETER_PREFIX + parameterCounter + "}" ); } parameterCounter++; matcherSingleParameter.appendTail( result ); if ( part == ParameterizedValueBuilder.Part.LHS ) { final String expression = addQuotesToTemplateKeys( result ).toString(); final ViabilityVisitor visitor = new ViabilityVisitor( expression ); if ( visitor.isViable() ) { return expression; } } return result.toString(); }

Target:
public String convertSingleParameterToTemplateKey( final String xlsTemplate, final ParameterizedValueBuilder.Part part ) { final StringBuffer result = new StringBuffer(); final Matcher matcherSingleParameter = patternSingleParameter.matcher( xlsTemplate ); while ( matcherSingleParameter.find() ) { matcherSingleParameter.appendReplacement( result, "@{" + PARAMETER_PREFIX + parameterCounter + "}" ); } parameterCounter++; matcherSingleParameter.appendTail( result ); return assertTemplateKeyConversion( result, part ); }
Source:
public static Iterable<Object[]> constructorFeeder() throws IOException { final GroupByQueryConfig defaultConfig = new GroupByQueryConfig(); final GroupByQueryConfig singleThreadedConfig = new GroupByQueryConfig() { @Override public boolean isSingleThreaded() { return true; } }; final GroupByQueryConfig epinephelinaeConfig = new GroupByQueryConfig() { @Override public String getDefaultStrategy() { return "epinephelinae"; } }; defaultConfig.setMaxIntermediateRows(10000); singleThreadedConfig.setMaxIntermediateRows(10000); final List<Object[]> constructors = Lists.newArrayList(); final List<GroupByQueryConfig> configs = ImmutableList.of( defaultConfig, singleThreadedConfig, epinephelinaeConfig ); for (GroupByQueryConfig config : configs) { final GroupByQueryRunnerFactory factory = GroupByQueryRunnerTest.makeQueryRunnerFactory(config); for (QueryRunner<Row> runner : QueryRunnerTestHelper.makeQueryRunners(factory)) { constructors.add(new Object[]{factory, runner}); } } return constructors; }

Target:
public static Iterable<Object[]> constructorFeeder() throws IOException { final GroupByQueryConfig defaultConfig = new GroupByQueryConfig(); final GroupByQueryConfig singleThreadedConfig = new GroupByQueryConfig() { @Override public boolean isSingleThreaded() { return true; } }; final GroupByQueryConfig v2Config = new GroupByQueryConfig() { @Override public String getDefaultStrategy() { return GroupByStrategySelector.STRATEGY_V2; } }; defaultConfig.setMaxIntermediateRows(10000); singleThreadedConfig.setMaxIntermediateRows(10000); final List<Object[]> constructors = Lists.newArrayList(); final List<GroupByQueryConfig> configs = ImmutableList.of( defaultConfig, singleThreadedConfig, v2Config ); for (GroupByQueryConfig config : configs) { final GroupByQueryRunnerFactory factory = GroupByQueryRunnerTest.makeQueryRunnerFactory(config); for (QueryRunner<Row> runner : QueryRunnerTestHelper.makeQueryRunners(factory)) { constructors.add(new Object[]{factory, runner}); } } return constructors; }
Source:
protected void init(final ImmutableMap<String, Object> execEnvVars) throws DbException { if (connectionInfo == null && execEnvVars != null) { connectionInfo = (ConnectionInfo) execEnvVars.get(MyriaConstants.EXEC_ENV_VAR_DATABASE_CONN_INFO); } accessMethod = AccessMethod.of(connectionInfo.getDbms(), connectionInfo, false); accessMethod.createViewIfNotExists(viewName, viewQuery); }

Target:
protected void init(final ImmutableMap<String, Object> execEnvVars) throws DbException { if (connectionInfo == null && execEnvVars != null) { connectionInfo = (ConnectionInfo) execEnvVars.get(MyriaConstants.EXEC_ENV_VAR_DATABASE_CONN_INFO); } accessMethod = AccessMethod.of(connectionInfo.getDbms(), connectionInfo, false); accessMethod.createView(viewName, viewQuery); }
Source:
public boolean getInclusionExists(final String path) { if (UNCPathConverter.isUNC(path)) { final boolean[] exists = new boolean[1]; Job checkJob = new Job(NLS.bind(CCorePlugin.getResourceString("InternalFileContentProvider.checkExistsJob"), path)){ @Override protected IStatus run(IProgressMonitor monitor) { try { IFileStore store = EFS.getStore(UNCPathConverter.getInstance().toURI(path)); exists[0] = store.fetchInfo(EFS.NONE, monitor).exists(); if (monitor.isCanceled()) { return Status.CANCEL_STATUS; } } catch (CoreException e) { return e.getStatus(); } return Status.OK_STATUS; } }; checkJob.schedule(); try { checkJob.join(); } catch (InterruptedException e) { return false; } return checkJob.getResult().isOK(); } return new File(path).exists(); }

Target:
public boolean getInclusionExists(final String path) { if (UNCPathConverter.isUNC(path)) { final boolean[] exists = new boolean[1]; Job checkJob = new Job(NLS.bind(CCorePlugin.getResourceString("InternalFileContentProvider.checkExistsJob"), path)){ @Override protected IStatus run(IProgressMonitor monitor) { try { IFileStore store = EFS.getStore(UNCPathConverter.getInstance().toURI(path)); exists[0] = store.fetchInfo(EFS.NONE, monitor).exists(); if (monitor.isCanceled()) { return Status.CANCEL_STATUS; } } catch (CoreException e) { return e.getStatus(); } return Status.OK_STATUS; } }; checkJob.setSystem(true); checkJob.schedule(); try { checkJob.join(); } catch (InterruptedException e) { return false; } return exists[0]; } return new File(path).exists(); }
Source:
public boolean synchronize(DocumentFile event) throws Exception { if (event == null) { throw new NullArgumentException("Incoming object is null"); } if (config == null) { throw new IllegalStateException("Unable to load configuration"); } else if (!ReadOnlyConfiguration.isReadOnly(config)) { try { GeoServerResourceLoader loader = GeoServerExtensions.bean(GeoServerResourceLoader.class); final String fileName = File.separator + "styles" + File.separator + event.getPath().name(); Resource file = loader.get(fileName); if ( !Resources.exists(file) ) { final String styleAbsolutePath = event.getPath().path(); if ( styleAbsolutePath.indexOf("workspaces") > 0 ) { final String styleFileName = File.separator + styleAbsolutePath.substring(styleAbsolutePath.indexOf("workspaces")); file = loader.get(styleFileName); } } event.writeTo(file); return true; } catch (Exception e) { if (LOGGER.isLoggable(java.util.logging.Level.SEVERE)) LOGGER.severe(this.getClass() + " is unable to synchronize the incoming event: " + event); throw e; } } return true; }

Target:
public boolean synchronize(DocumentFile event) throws Exception { if (event == null) { throw new NullArgumentException("Incoming object is null"); } if (config == null) { throw new IllegalStateException("Unable to load configuration"); } else if (!ReadOnlyConfiguration.isReadOnly(config)) { try { GeoServerResourceLoader loader = GeoServerExtensions.bean(GeoServerResourceLoader.class); Resource file = loader.get("styles").get(event.getPath().name()); if ( !Resources.exists(file) ) { final String styleAbsolutePath = event.getPath().path(); if ( styleAbsolutePath.indexOf("workspaces") > 0 ) { file = loader.get(styleAbsolutePath.substring(styleAbsolutePath.indexOf("workspaces"))); } } event.writeTo(file); return true; } catch (Exception e) { if (LOGGER.isLoggable(java.util.logging.Level.SEVERE)) LOGGER.severe(this.getClass() + " is unable to synchronize the incoming event: " + event); throw e; } } return true; }
Source:
public List<ClusterNode> mapPartitionToPrimaryAndBackupsList(int part) { ctx.gateway().readLock(); try { return cache().assignment().get(part); } catch (IgniteCheckedException e) { throw new IgniteException(e); } finally { ctx.gateway().readUnlock(); } }

Target:
@Override public List<ClusterNode> mapPartitionToPrimaryAndBackupsList(int part) { ctx.gateway().readLock(); try { return cache().assignment().get(part); } catch (IgniteCheckedException e) { throw new IgniteException(e); } finally { ctx.gateway().readUnlock(); } }
Source:
@Override public DeriveMode getDeriveMode() { if (joinType == JoinRelType.FULL || joinType == JoinRelType.RIGHT) { return DeriveMode.PROHIBITED; } return DeriveMode.BOTH; }

Target:
@Override public DeriveMode getDeriveMode() { if (joinType == JoinRelType.FULL || joinType == JoinRelType.RIGHT) { return DeriveMode.PROHIBITED; } return DeriveMode.LEFT_FIRST; }
Source:
public void deleteChannel(Channel channel) { channelMap.remove(channel.getChannelIdentifier()); }

Target:
public boolean deleteChannel(Channel channel) { if (!channelMap.containsKey(channel)){ return false; }else { channelMap.remove(channel.getChannelIdentifier()); return true; } }
Source:
public String submitSearchTransformedNetworkRequest( @ProjectIdentifier @PathVariable("projectUnixName") String projectUnixName, @RequestParam("conceptId") String conceptId, @CheckAccess @InjectProject IProject project, Model model) throws QuadrigaStorageException { String lemma = ""; String searchNodeLabel = ""; IConcept concept = cpCache.getConceptByUri(conceptId); if (concept != null) { searchNodeLabel = concept.getWord(); lemma = concept.getDescription(); } Callable<PublicSearchObject> callable = () -> { PublicSearchObject publicSearchObject = new PublicSearchObject(); ITransformedNetwork transformedNetwork = transformationManager .getSearchTransformedNetwork(project.getProjectId(), conceptId, INetworkStatus.APPROVED); if (transformedNetwork != null) { publicSearchObject.setNodes(jsonCreator.getNodes(transformedNetwork.getNodes())); publicSearchObject.setLinks(jsonCreator.getLinks(transformedNetwork.getLinks())); } if (transformedNetwork == null || transformedNetwork.getNodes().size() == 0) { publicSearchObject.setNetworkEmpty(true); } return publicSearchObject; }; Future<PublicSearchObject> future = executorService.submit(callable); Random randomTokenGenerator = new Random(); Integer randomToken = randomTokenGenerator.nextInt(100); while (searchResultMap.containsKey(randomToken)) { randomToken = randomTokenGenerator.nextInt(100); } searchResultMap.put(randomToken, future); model.addAttribute("token", randomToken); model.addAttribute("unixName", projectUnixName); model.addAttribute("searchNodeLabel", searchNodeLabel); model.addAttribute("description", lemma); model.addAttribute("project",project); return "sites/networks/searchednetwork"; }

Target:
public String submitSearchTransformedNetworkRequest( @ProjectIdentifier @PathVariable("projectUnixName") String projectUnixName, @RequestParam("conceptId") String conceptId, @CheckAccess @InjectProject IProject project, Model model) throws QuadrigaStorageException { String lemma = ""; String searchNodeLabel = ""; IConcept concept = cpCache.getConceptByUri(conceptId); if (concept != null) { searchNodeLabel = concept.getWord(); lemma = concept.getDescription(); } String conceptIdToken = asyncNetworkTransformationService.submitNetworkTransformationRequest(conceptId, project); model.addAttribute("unixName", projectUnixName); model.addAttribute("searchNodeLabel", searchNodeLabel); model.addAttribute("description", lemma); model.addAttribute("project",project); model.addAttribute("conceptIdToken", conceptIdToken); return "sites/networks/searchednetwork"; }
Source:
private boolean checkHeader() { try { String[] firstline = m_listReader.getHeader(false); Set<String> firstset = new HashSet<String>(); BiMap<Integer, String> colNames = HashBiMap.create(m_loader.getColumnNames()); headerlen = firstline.length; for (String name : firstline) { if (name != null) { firstset.add(name.toUpperCase()); } else { return false; } } if (headerlen < m_columnCount) { return false; } else { int matchColCount = 0; for (String name : firstset) { if (colNames.containsValue(name)) { matchColCount++; } } if (matchColCount != m_columnCount) { return false; } } order = new Integer[headerlen]; for (int fileCol = 0; fileCol < headerlen; fileCol++) { String name = firstline[fileCol]; if (colNames.inverse().containsKey(name.toUpperCase())) { int tableCol = colNames.inverse().get(name.toUpperCase()); order[fileCol] = tableCol; } } } catch (IOException ex) { m_log.error("Failed to read CSV line from file: " + ex); } return true; }

Target:
private boolean checkHeader() { try { String[] firstline = m_listReader.getHeader(false); Set<String> firstset = new HashSet<String>(); BiMap<Integer, String> colNames = HashBiMap.create(m_loader.getColumnNames()); headerlen = firstline.length; for (String name : firstline) { if (name != null) { firstset.add(name.toUpperCase()); } else { return false; } } if (headerlen < m_columnCount) { return false; } else { int matchColCount = 0; for (String name : firstset) { if (colNames.containsValue(name)) { matchColCount++; } } if (matchColCount != m_columnCount) { return false; } } order = new Integer[headerlen]; for (int fileCol = 0; fileCol < headerlen; fileCol++) { String name = firstline[fileCol]; Integer tableCol = colNames.inverse().get(name.toUpperCase()); order[fileCol] = tableCol; } } catch (IOException ex) { m_log.error("Failed to read CSV line from file: " + ex); } return true; }
Source:
public static Events downloadEventFeed() { if (StringUtils.isBlank(calendar_name)) { logger.warn("Login aborted no calendar name defined"); return null; } Credential credential = getCredential(); com.google.api.services.calendar.Calendar client = new com.google.api.services.calendar.Calendar.Builder( HTTP_TRANSPORT, JSON_FACTORY, credential).setApplicationName("openHAB").build(); String calendarID = null; if (!calendar_name.equals("primary")) { CalendarList calfeed = null; try { calfeed = client.calendarList().list().execute(); } catch (com.google.api.client.auth.oauth2.TokenResponseException ae) { logger.error("authentication failed: {}", ae.getMessage()); } catch (IOException e1) { logger.error("authentication I/O exception: {}", e1.getMessage()); } if (calfeed != null && calfeed.getItems() != null) { for (CalendarListEntry entry : calfeed.getItems()) { if (entry.getSummary().equals(calendar_name)) { calendarID = entry.getId(); logger.debug("Got calendar CalendarID: {}", calendar_name, calendarID); } } } if (calendarID == null) { logger.error("Calendar not found", calendar_name); return null; } } else { calendarID = calendar_name; } DateTime start = new DateTime(new Date()); DateTime end = new DateTime(start.getValue() + (2 * refreshInterval)); logger.debug("Downloading calendar feed for time interval: to ", start, end); Events feed = null; try { com.google.api.services.calendar.Calendar.Events.List l = client.events().list(calendarID) .setSingleEvents(true).setTimeMin(start).setTimeMax(end); if (StringUtils.isNotBlank(filter)) { l = l.setQ(filter); } feed = l.execute(); } catch (IOException e1) { logger.error("Event fetch failed: {}", e1.getMessage()); } try { if (feed != null) { checkIfFullCalendarFeed(feed.getItems()); } return feed; } catch (Exception e) { logger.error("downloading CalenarEventFeed throws exception: {}", e.getMessage()); } return null; }

Target:
private static Events downloadEventFeed() { if (StringUtils.isBlank(calendar_name)) { logger.warn("Login aborted no calendar name defined"); return null; } CalendarListEntry calendarID = GCalGoogleOAuth.getCalendarId(calendar_name); if (calendarID == null) { return null; } DateTime start = new DateTime(new Date(), TimeZone.getTimeZone(calendarID.getTimeZone())); DateTime end = new DateTime(new Date(start.getValue() + (2 * refreshInterval)), TimeZone.getTimeZone(calendarID.getTimeZone())); logger.debug("Downloading calendar feed for time interval: to ", start, end); Events feed = null; try { Credential credential = GCalGoogleOAuth.getCredential(false); Calendar client = new Calendar.Builder(HTTP_TRANSPORT, JSON_FACTORY, credential) .setApplicationName("openHAB").build(); Calendar.Events.List l = client.events().list(calendarID.getId()).setSingleEvents(true).setTimeMin(start) .setTimeMax(end); if (StringUtils.isNotBlank(filter)) { l = l.setQ(filter); } feed = l.execute(); } catch (IOException e1) { logger.error("Event fetch failed: {}", e1.getMessage()); } try { if (feed != null) { checkIfFullCalendarFeed(feed.getItems()); } return feed; } catch (Exception e) { logger.error("downloading CalendarEventFeed throws exception: {}", e.getMessage()); } return null; }
Source:
public String toString() { if (stringRepn == null) { if (sem == null) return "NoSemanticFunction"; String semStr = sem.toString(); int maxLength = 100; if (semStr.length() > maxLength) semStr = semStr.substring(0,maxLength) + "..."; stringRepn = lhs + " -> " + (rhs == null ? "" : Joiner.on(' ').join(rhs)) + " " + semStr; } return stringRepn; }

Target:
public String toString() { if (stringRepn == null) { String semStr = sem == null? "NullSemanticFn" : sem.toString(); int maxLength = 100; if (semStr.length() > maxLength) semStr = String.format("%s...(%d total)", semStr.substring(0,maxLength), semStr.length()); stringRepn = lhs + " -> " + (rhs == null ? "" : Joiner.on(' ').join(rhs)) + " " + semStr; } return stringRepn; }
Source:
public static Collection<NodeMapping> getAllNodeMappings(ContainerMapping self) { Collection<NodeMapping> allNodeMappings = Stream .concat(new LinkedHashSet<NodeMapping>(self.getSubNodeMappings()).stream(), new LinkedHashSet<NodeMapping>(self.getReusedNodeMappings()).stream()).collect(Collectors.toSet()); return allNodeMappings; }

Target:
public static Collection<NodeMapping> getAllNodeMappings(ContainerMapping self) { LinkedHashSet<NodeMapping> result = Stream.concat(self.getSubNodeMappings().stream(), self.getReusedNodeMappings().stream()).collect(Collectors.toCollection(LinkedHashSet::new)); return result; }
Source:
protected void launchService0(final String[] arguments, final ITransformingClassLoader launchClassLoader) throws Exception { final PluginEnvironment launchPluginEnvironment = SpongeLaunch.pluginEnvironment; Class.forName("org.spongepowered.vanilla.launch.ClientLauncher", true, launchClassLoader.getInstance()).getMethod("launch", String.class, Path.class, List.class, Boolean.class, String[].class).invoke(null, launchPluginEnvironment.getBlackboard().get(PluginKeys.VERSION).orElse(null), launchPluginEnvironment.getBlackboard().get(PluginKeys.BASE_DIRECTORY).orElse(null), launchPluginEnvironment.getBlackboard().get(PluginKeys.PLUGIN_DIRECTORIES).orElse(null), Boolean.TRUE, arguments); }

Target:
protected void launchService0(final String[] arguments, final ITransformingClassLoader launchClassLoader) throws Exception { Class.forName("org.spongepowered.vanilla.launch.ClientLauncher", true, launchClassLoader.getInstance()) .getMethod("launch", PluginLoader.class, Boolean.class, String[].class) .invoke(null, Main.pluginLoader, Boolean.TRUE, arguments ); }
Source:
public void dataPointFieldsMustBeStatic() { assertThat( testResult(DataPointFieldsMustBeStatic.class), CoreMatchers.<PrintableResult>both(failureCountIs(1)) .and( hasFailureContaining("DataPoint field THREE must be static")) .and( hasFailureContaining("DataPoint field FOURS must be static"))); }

Target:
public void dataPointFieldsMustBeStatic() { assertThat( testResult(DataPointFieldsMustBeStatic.class), CoreMatchers.both(hasFailureContaining("DataPoint field THREE must be static")) .and(hasFailureContaining("DataPoint field FOURS must be static"))); }
Source:
public void convertNoteFiles(ZeppelinConfiguration conf, boolean deleteOld) throws IOException { for (int i = 0; i < repos.size(); ++i) { NotebookRepo newNotebookRepo = repos.get(i); OldNotebookRepo oldNotebookRepo = PluginManager.get().loadOldNotebookRepo(newNotebookRepo.getClass().getCanonicalName()); oldNotebookRepo.init(conf); List<OldNoteInfo> oldNotesInfo = oldNotebookRepo.list(AuthenticationInfo.ANONYMOUS); LOGGER.info("Convert old note file to new style, note count: " + oldNotesInfo.size()); LOGGER.info("Delete old note: " + deleteOld); for (OldNoteInfo oldNoteInfo : oldNotesInfo) { Note note = oldNotebookRepo.get(oldNoteInfo.getId(), AuthenticationInfo.ANONYMOUS); note.setPath(note.getName()); note.setVersion(Util.getVersion()); newNotebookRepo.save(note, AuthenticationInfo.ANONYMOUS); if (newNotebookRepo instanceof NotebookRepoWithVersionControl) { ((NotebookRepoWithVersionControl) newNotebookRepo).checkpoint( note.getId(), note.getPath(), "Upgrade note '" + note.getName() + "' from old format to new format", AuthenticationInfo.ANONYMOUS); } if (deleteOld) { oldNotebookRepo.remove(note.getId(), AuthenticationInfo.ANONYMOUS); LOGGER.info("Remote old note: " + note.getId()); } } } }

Target:
public void convertNoteFiles(ZeppelinConfiguration conf, boolean deleteOld) throws IOException { for (int i = 0; i < repos.size(); ++i) { NotebookRepo newNotebookRepo = repos.get(i); OldNotebookRepo oldNotebookRepo = PluginManager.get().loadOldNotebookRepo(newNotebookRepo.getClass().getCanonicalName()); oldNotebookRepo.init(conf); List<OldNoteInfo> oldNotesInfo = oldNotebookRepo.list(AuthenticationInfo.ANONYMOUS); LOGGER.info("Convert old note file to new style, note count: " + oldNotesInfo.size()); LOGGER.info("Delete old note: " + deleteOld); for (OldNoteInfo oldNoteInfo : oldNotesInfo) { Note note = oldNotebookRepo.get(oldNoteInfo.getId(), AuthenticationInfo.ANONYMOUS); note.setPath(note.getName()); note.setVersion(Util.getVersion()); newNotebookRepo.save(note, AuthenticationInfo.ANONYMOUS); if (newNotebookRepo instanceof NotebookRepoWithVersionControl) { ((NotebookRepoWithVersionControl) newNotebookRepo).checkpoint( note.getId(), note.getPath(), "Upgrade note '" + note.getName() + "' to " + Util.getVersion(), AuthenticationInfo.ANONYMOUS); } if (deleteOld) { oldNotebookRepo.remove(note.getId(), AuthenticationInfo.ANONYMOUS); LOGGER.info("Remote old note: " + note.getId()); } } } }
Source:
private static void setContainerInfo(ITmfStateSystemBuilder ssb, int containerQuark, long timestamp, ContainerInfo containerInfo) { assert (ssb.getAttributeName(containerQuark).startsWith(ContainerAttributes.CONTAINER_ID)); try { int containerInfoQuark = ssb.getQuarkRelativeAndAdd(containerQuark, ContainerAttributes.CONTAINER_INFO); int containerPPIDQuark = ssb.getQuarkRelativeAndAdd(containerInfoQuark, ContainerAttributes.PPID); ssb.modifyAttribute(timestamp, TmfStateValue.newValueInt(containerInfo.getContainerParentTID()), containerPPIDQuark); int containerINodeQuark = ssb.getQuarkRelativeAndAdd(containerInfoQuark, ContainerAttributes.CONTAINER_INODE); ssb.modifyAttribute(timestamp, TmfStateValue.newValueInt(containerInfo.getContainerInode()), containerINodeQuark); int containerHostnameQuark = ssb.getQuarkRelativeAndAdd(containerInfoQuark, ContainerAttributes.HOSTNAME); ssb.modifyAttribute(timestamp, TmfStateValue.newValueString(containerInfo.getContainerHostname()), containerHostnameQuark); } catch (AttributeNotFoundException e) { e.printStackTrace(); } }

Target:
private static void setContainerInfo(ITmfStateSystemBuilder ssb, int containerQuark, long timestamp, ContainerInfo containerInfo) { if (!ssb.getAttributeName(containerQuark).startsWith(ContainerAttributes.CONTAINER_ID_PREFIX)) { throw new IllegalStateException("Wrong container ID!"); } try { int containerInfoQuark = ssb.getQuarkRelativeAndAdd(containerQuark, ContainerAttributes.CONTAINER_INFO); int containerPPIDQuark = ssb.getQuarkRelativeAndAdd(containerInfoQuark, ContainerAttributes.PPID); ssb.modifyAttribute(timestamp, TmfStateValue.newValueInt(containerInfo.getContainerParentTID()), containerPPIDQuark); int containerINodeQuark = ssb.getQuarkRelativeAndAdd(containerInfoQuark, ContainerAttributes.CONTAINER_INODE); ssb.modifyAttribute(timestamp, TmfStateValue.newValueInt(containerInfo.getContainerInode()), containerINodeQuark); int containerHostnameQuark = ssb.getQuarkRelativeAndAdd(containerInfoQuark, ContainerAttributes.HOSTNAME); ssb.modifyAttribute(timestamp, TmfStateValue.newValueString(containerInfo.getContainerHostname()), containerHostnameQuark); } catch (AttributeNotFoundException e) { e.printStackTrace(); } }
Source:
public VaultEnvironmentRepositoryFactory(ObjectProvider<HttpServletRequest> request, EnvironmentWatch watch, Optional<VaultRestTemplateFactory> vaultRestTemplateFactory) { this.request = request; this.watch = watch; this.vaultRestTemplateFactory = vaultRestTemplateFactory; this.tokenProvider = null; }

Target:
public VaultEnvironmentRepositoryFactory(ObjectProvider<HttpServletRequest> request, EnvironmentWatch watch, Optional<VaultRestTemplateFactory> vaultRestTemplateFactory) { this.request = request; this.watch = watch; this.vaultRestTemplateFactory = vaultRestTemplateFactory; this.tokenProvider = new HttpRequestConfigTokenProvider(request); }
Source:
public PageCacheLongArray( PagedFile pagedFile, long length, long defaultValue, long base ) throws IOException { super( pagedFile, Long.BYTES, length, defaultValue, base ); }

Target:
PageCacheLongArray( PagedFile pagedFile, long length, long defaultValue, long base ) throws IOException { super( pagedFile, Long.BYTES, length, defaultValue, base ); }
Source:
private void getAllDependentProjects(Map<CDICoreNature, Integer> result, int level) { if(level > 10) return; CDICoreNature[] array = null; synchronized(this) { array = usedBy.toArray(new CDICoreNature[0]); } for (CDICoreNature n: array) { if(!result.containsKey(n) || result.get(n).intValue() < level) { result.put(n, level); n.getAllDependentProjects(result, level + 1); } } }

Target:
private void getAllDependentProjects(Map<CDICoreNature, Integer> result, int level) { if(level > 10) return; for (CDICoreNature n:usedBy) { if(!result.containsKey(n) || result.get(n).intValue() < level) { result.put(n, level); n.getAllDependentProjects(result, level + 1); } } }
Source:
private boolean isJavascriptProject() { return model.getLocation().append("package.json").toFile().exists(); }

Target:
private boolean isJavascriptProject() { return model.getLocation().append(JS_PACKAGE_JSON_FILE).toFile().exists(); }
Source:
private SetParameter getSetParameter() throws ProtocolAdapterException { final AttributeAddress alarmRegisterValue = new AttributeAddress(CLASS_ID, OBIS_CODE, ATTRIBUTE_ID); final DataObject data = DataObject.newUInteger32Data(ALARM_CODE); return new SetParameter(alarmRegisterValue, data); }

Target:
private SetParameter getSetParameter() { final AttributeAddress alarmRegisterValue = new AttributeAddress(CLASS_ID, OBIS_CODE, ATTRIBUTE_ID); final DataObject data = DataObject.newUInteger32Data(ALARM_CODE); return new SetParameter(alarmRegisterValue, data); }
Source:
protected void refNameSelected(String refName) { boolean tagSelected = refName != null && refName.startsWith(Constants.R_TAGS); boolean branchSelected = refName != null && (refName.startsWith(Constants.R_HEADS) || refName .startsWith(Constants.R_REMOTES)); if (((TreeSelection) branchTree.getSelection()).size() > 1) { TreeSelection selection = (TreeSelection) branchTree .getSelection(); boolean onlySelectionAreBranches = onlyBranchesAreSelected(selection); deleteteButton.setEnabled(onlySelectionAreBranches); renameButton.setEnabled(!onlySelectionAreBranches); newButton.setEnabled(!onlySelectionAreBranches); } else { getButton(Window.OK).setEnabled(branchSelected || tagSelected); renameButton.setEnabled(branchSelected && !tagSelected); deleteteButton.setEnabled(branchSelected && !tagSelected); newButton.setEnabled(true); } getButton(Window.OK).setEnabled( refName != null && !refName.equals(currentBranch)); }

Target:
protected void refNameSelected(String refName) { boolean tagSelected = refName != null && refName.startsWith(Constants.R_TAGS); boolean branchSelected = refName != null && (refName.startsWith(Constants.R_HEADS) || refName .startsWith(Constants.R_REMOTES)); if (((TreeSelection) branchTree.getSelection()).size() > 1) { TreeSelection selection = (TreeSelection) branchTree .getSelection(); boolean onlyBranchesAreSelected = onlyBranchesAreSelected(selection); deleteteButton.setEnabled(onlyBranchesAreSelected); renameButton.setEnabled(false); newButton.setEnabled(false); } else { getButton(Window.OK).setEnabled(branchSelected || tagSelected); renameButton.setEnabled(branchSelected && !tagSelected); deleteteButton.setEnabled(branchSelected && !tagSelected); newButton.setEnabled(true); } getButton(Window.OK).setEnabled( refName != null && !refName.equals(currentBranch)); }
Source:
public void run() { try { waypoint = DataStore.loadWaypoint(waypointId); calcState = waypoint.getCalculatorSaveState(); loadWaypointHandler.sendMessage(Message.obtain()); } catch (final Exception e) { Log.e("EditWaypointActivity.loadWaypoint.run", e); } }

Target:
public void run() { try { waypoint = DataStore.loadWaypoint(waypointId); calcState = waypoint.getCalculatorStoredState(); loadWaypointHandler.sendMessage(Message.obtain()); } catch (final Exception e) { Log.e("EditWaypointActivity.loadWaypoint.run", e); } }
Source:
public static int getNumberOfColumns(FormEntryPrompt formEntryPrompt, Context context) { int numColumns = 1; String appearance = getSanitizedAppearanceHint(formEntryPrompt); if (appearance.contains(COLUMNS_N) || appearance.contains(COMPACT_N)) { try { String columnsAppearance = appearance.contains(COLUMNS_N) ? COLUMNS_N : COMPACT_N; try { appearance = appearance.substring(appearance.indexOf(columnsAppearance)); int idx = appearance.indexOf(columnsAppearance); if (idx != -1) { String substringFromNumColumns = appearance.substring(idx + columnsAppearance.length()); numColumns = Integer.parseInt(substringFromNumColumns.substring(0, substringFromNumColumns.contains(" ") ? substringFromNumColumns.indexOf(' ') : substringFromNumColumns.length())); if (numColumns < 1) { numColumns = 1; } else if (numColumns > 10) { numColumns = 10; } } } catch (Exception e) { Timber.e(EXCEPTION_PARSING_COLUMNS); } } catch (Exception e) { Timber.e(EXCEPTION_PARSING_COLUMNS); } } else if (appearance.contains(COLUMNS)) { switch (context.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) { case Configuration.SCREENLAYOUT_SIZE_SMALL: numColumns = 2; break; case Configuration.SCREENLAYOUT_SIZE_NORMAL: numColumns = 3; break; case Configuration.SCREENLAYOUT_SIZE_LARGE: numColumns = 4; break; case Configuration.SCREENLAYOUT_SIZE_XLARGE: numColumns = 5; break; default: numColumns = 3; } } return numColumns; }

Target:
public static int getNumberOfColumns(FormEntryPrompt formEntryPrompt, Context context) { int numColumns = 1; String appearance = getSanitizedAppearanceHint(formEntryPrompt); if (appearance.contains(COLUMNS_N) || appearance.contains(COMPACT_N)) { try { String columnsAppearance = appearance.contains(COLUMNS_N) ? COLUMNS_N : COMPACT_N; try { appearance = appearance.substring(appearance.indexOf(columnsAppearance)); int idx = appearance.indexOf(columnsAppearance); if (idx != -1) { String substringFromNumColumns = appearance.substring(idx + columnsAppearance.length()); numColumns = Integer.parseInt(substringFromNumColumns.substring(0, substringFromNumColumns.contains(" ") ? substringFromNumColumns.indexOf(' ') : substringFromNumColumns.length())); if (numColumns < 1) { numColumns = 1; } } } catch (Exception e) { Timber.e(EXCEPTION_PARSING_COLUMNS); } } catch (Exception e) { Timber.e(EXCEPTION_PARSING_COLUMNS); } } else if (appearance.contains(COLUMNS)) { switch (context.getResources().getConfiguration().screenLayout & Configuration.SCREENLAYOUT_SIZE_MASK) { case Configuration.SCREENLAYOUT_SIZE_SMALL: numColumns = 2; break; case Configuration.SCREENLAYOUT_SIZE_NORMAL: numColumns = 3; break; case Configuration.SCREENLAYOUT_SIZE_LARGE: numColumns = 4; break; case Configuration.SCREENLAYOUT_SIZE_XLARGE: numColumns = 5; break; default: numColumns = 3; } } return numColumns; }
Source:
private static SyncUser createFakeUser(String id) { final Token token = new Token("token_value", id, "path_value", Long.MAX_VALUE, null); try { return SYNC_USER_CONSTRUCTOR.newInstance(token, authUrl); } catch (InstantiationException e) { fail(e.getMessage()); } catch (IllegalAccessException e) { fail(e.getMessage()); } catch (InvocationTargetException e) { fail(e.getMessage()); } return null; }

Target:
private static SyncUser createFakeUser(String id) { final Token token = new Token("token_value", id, "path_value", Long.MAX_VALUE, null); try { return SYNC_USER_CONSTRUCTOR.newInstance(token, authUrl); } catch (InstantiationException | IllegalAccessException | InvocationTargetException e) { fail(e.getMessage()); } return null; }
Source:
public void preCreateTable(Table table) throws MetaException { if (table.getPartitionKeysSize() != 0) { throw new MetaException("PARTITIONED BY may not be specified for Druid"); } if (table.getSd().getBucketColsSize() != 0) { throw new MetaException("CLUSTERED BY may not be specified for Druid"); } String dataSourceName = Preconditions .checkNotNull(table.getParameters().get(Constants.DRUID_DATA_SOURCE), "WTF dataSource name is null !" ); try { connector.createSegmentTable(); } catch (Exception e) { LOG.error("Exception while trying to create druid segments table", e); throw new MetaException(e.getMessage()); } Collection<String> existingDataSources = DruidStorageHandlerUtils .getAllDataSourceNames(connector, druidMetadataStorageTablesConfig); LOG.debug(String.format("pre-create data source with name [%s]", dataSourceName)); if (existingDataSources.contains(dataSourceName)) { throw new MetaException(String.format("Data source [%s] already existing", dataSourceName)); } }

Target:
public void preCreateTable(Table table) throws MetaException { if (MetaStoreUtils.isExternalTable(table) && !StringUtils .isEmpty(table.getSd().getLocation())) { throw new MetaException("LOCATION may not be specified for Druid"); } if (table.getPartitionKeysSize() != 0) { throw new MetaException("PARTITIONED BY may not be specified for Druid"); } if (table.getSd().getBucketColsSize() != 0) { throw new MetaException("CLUSTERED BY may not be specified for Druid"); } String dataSourceName = table.getParameters().get(Constants.DRUID_DATA_SOURCE); if (MetaStoreUtils.isExternalTable(table)) { return; } try { connector.createSegmentTable(); } catch (Exception e) { LOG.error("Exception while trying to create druid segments table", e); throw new MetaException(e.getMessage()); } Collection<String> existingDataSources = DruidStorageHandlerUtils .getAllDataSourceNames(connector, druidMetadataStorageTablesConfig); LOG.debug(String.format("pre-create data source with name [%s]", dataSourceName)); if (existingDataSources.contains(dataSourceName)) { throw new MetaException(String.format("Data source [%s] already existing", dataSourceName)); } }
Source:
public LatexCitationsTab(BibDatabaseContext databaseContext, PreferencesService preferencesService, TaskExecutor taskExecutor) { this.viewModel = new LatexCitationsTabViewModel(databaseContext, preferencesService, taskExecutor); this.searchPane = new StackPane(); this.progressIndicator = new ProgressIndicator(); this.graphicCitationList = FXCollections.observableArrayList(); setText(Localization.lang("LaTeX Citations")); setTooltip(new Tooltip(Localization.lang("Search citations for this entry in LaTeX files"))); setGraphic(IconTheme.JabRefIcons.APPLICATION_TEXSTUDIO.getGraphicNode()); }

Target:
public LatexCitationsTab(BibDatabaseContext databaseContext, PreferencesService preferencesService, TaskExecutor taskExecutor) { this.viewModel = new LatexCitationsTabViewModel(databaseContext, preferencesService, taskExecutor); this.searchPane = new StackPane(); this.progressIndicator = new ProgressIndicator(); setText(Localization.lang("LaTeX Citations")); setTooltip(new Tooltip(Localization.lang("Search citations for this entry in LaTeX files"))); setGraphic(IconTheme.JabRefIcons.LATEX_CITATIONS.getGraphicNode()); setSearchPane(); }
Source:
public List<InterpreterCompletion> completion(String buffer, int cursor) { String lines[] = buffer.split(System.getProperty("line.separator")); if (lines.length > 0 && lines[0].startsWith("%") && cursor <= lines[0].trim().length()) { int idx = lines[0].indexOf(' '); if (idx < 0 || (idx > 0 && cursor <= idx)) { return note.getInterpreterCompletion(); } } this.interpreter = getBindedInterpreter(); String trimmedBuffer = buffer != null ? buffer.trim() : null; cursor = calculateCursorPosition(buffer, trimmedBuffer, cursor); setText(trimmedBuffer); InterpreterContext interpreterContext = getInterpreterContextWithoutRunner(null); try { if (this.interpreter != null) { return this.interpreter.completion(this.scriptText, cursor, interpreterContext); } else { return null; } } catch (InterpreterException e) { throw new RuntimeException("Fail to get completion", e); } }

Target:
public List<InterpreterCompletion> completion(String buffer, int cursor) { String lines[] = buffer.split(System.getProperty("line.separator")); if (lines.length > 0 && lines[0].startsWith("%") && cursor <= lines[0].trim().length()) { int idx = lines[0].indexOf(' '); if (idx < 0 || (idx > 0 && cursor <= idx)) { return note.getInterpreterCompletion(); } } this.interpreter = getBindedInterpreter(); setText(buffer); cursor = calculateCursorPosition(buffer, cursor); InterpreterContext interpreterContext = getInterpreterContextWithoutRunner(null); try { if (this.interpreter != null) { return this.interpreter.completion(this.scriptText, cursor, interpreterContext); } else { return null; } } catch (InterpreterException e) { throw new RuntimeException("Fail to get completion", e); } }
Source:
private boolean isShellValid() { return shell != null && !shell.isDisposed(); }

Target:
private boolean isShellValid() { return Widgets.isAccessible(shell); }
Source:
public void execute(TerminalClient client, Scanner arguments) { if (!arguments.hasNext()) throw new IllegalArgumentException(); String message = arguments.next(); if (arguments.hasNext()) throw new IllegalArgumentException(); Message expectedMessage = Message.get(message); List<Field> expectedFields = expectedMessage.getFields(); while (true) { try { Thread.sleep(WAIT_TIME_MILLIS); Message receivedMessage = getLastMsg(client.getMessages()); if (IGNORED_MESSAGES.contains(receivedMessage.getMsgType())) continue; List<Field> actualFields = receivedMessage.getFields(); if (compareMsgsFields(expectedFields, actualFields)) { printf("%s\n", receivedMessage); break; } } catch (InterruptedException e) { break; } } }

Target:
public void execute(TerminalClient client, Scanner arguments) { if (!arguments.hasNext()) throw new IllegalArgumentException(); String message = arguments.next(); if (arguments.hasNext()) throw new IllegalArgumentException(); Message expectedMessage = Message.get(message); List<Field> expectedFields = expectedMessage.getFields(); int offset = 0; while (true) { try { Thread.sleep(WAIT_TIME_MILLIS); List<Message> collection = client.getMessages().collect(); if (collection.isEmpty() || offset == collection.size() - 1) continue; while (offset < collection.size() - 1) { Message receivedMessage = collection.get(offset); offset++; if (IGNORED_MESSAGES.contains(receivedMessage.getMsgType())) continue; List<Field> actualFields = receivedMessage.getFields(); if (compareMsgsFields(expectedFields, actualFields)) { printf("%s\n", receivedMessage); return; } } } catch (InterruptedException e) { break; } } }
Source:
public Node(T value, List<Node<T>> children) { Objects.requireNonNull(children, "children is null"); this.value = value; this.children = children; this.size = children.size() + 1; }

Target:
public Node(T value, List<Node<T>> children) { Objects.requireNonNull(children, "children is null"); this.value = value; this.children = children; this.size = 1 + this.children.foldLeft(0, (acc, child) -> acc + child.size); }
Source:
private InputStatus emitNextSortedRecord(DataOutput<T> output) throws Exception { if (emittedLast) { return InputStatus.END_OF_INPUT; } Tuple2<byte[], StreamRecord<T>> next = sortedInput.next(); if (next != null) { output.emitRecord(next.f1); return InputStatus.MORE_AVAILABLE; } else { emittedLast = true; output.emitWatermark(Watermark.MAX_WATERMARK); return InputStatus.END_OF_INPUT; } }

Target:
private InputStatus emitNextSortedRecord(DataOutput<T> output) throws Exception { if (emittedLast) { return InputStatus.END_OF_INPUT; } Tuple2<byte[], StreamRecord<T>> next = sortedInput.next(); if (next != null) { output.emitRecord(next.f1); return InputStatus.MORE_AVAILABLE; } else { emittedLast = true; if (watermarkSeen > Long.MIN_VALUE) { output.emitWatermark(new Watermark(watermarkSeen)); } return InputStatus.END_OF_INPUT; } }
Source:
public VanityUrlAPIImpl() { cache404VanityUrl.setInode(VanityUrlAPI.CACHE_404_VANITY_URL); cache404VanityUrl.setIdentifier(VanityUrlAPI.CACHE_404_VANITY_URL); cache404VanityUrl.setAction(404); }

Target:
public VanityUrlAPIImpl() { cache404VanityUrl.setInode(VanityUrlAPI.CACHE_404_VANITY_URL); cache404VanityUrl.setIdentifier(VanityUrlAPI.CACHE_404_VANITY_URL); cache404VanityUrl.setAction(CODE_404_VALUE); }
Source:
public Iterable<Contents> listObjects(final String bucket) throws SignatureException, IOException { final List<Contents> result = new ArrayList<>(); boolean isTruncated = false; String marker = null; do { final GetBucketRequest request = new GetBucketRequest(bucket); if (isTruncated) { request.withNextMarker(marker); } final ListBucketResult response = this.client.getBucket(request).getResult(); isTruncated = response.isTruncated(); marker = response.getNextMarker(); for (final Contents contents : response.getContentsList()) { result.add(contents); } } while (isTruncated); return result; }

Target:
public Iterable<Contents> listObjects(final String bucket) throws SignatureException, IOException { return this.listObjects(bucket, null); }
Source:
public void startThreads() { int nbThreads = this.configuration.getProperty("mentions.poolSize", 1); for (int i = 0; i < nbThreads; i++) { startConsumer(); } }

Target:
public void startThreads() { synchronized (this) { if (!this.threadStarted) { int nbThreads = this.configuration.getProperty("mentions.poolSize", 1); for (int i = 0; i < nbThreads; i++) { startConsumer(); } this.threadStarted = true; } } }