auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void doDistributeCentersHorizontally(Collection<SWTBotGefEditPart> editPartsToDistribute, ZoomLevel zoomLevel, boolean horizontalScrollbar) { editor.select(editPartsToDistribute); SWTBotUtils.waitAllUiEvents(); editor.clickContextMenu(HORIZONTALLY_GAP_CENTER); List<SWTBotGefEditPart> orderedEditParts = centersHorizontallyOrderEditParts(editPartsToDistribute); boolean uniformGaps = true; int i = 0; int expectedGap; if (horizontalScrollbar) { expectedGap = SCROLLBAR_HORIZONTALLY_GAP_CENTER_VALUE; } else { expectedGap = HORIZONTALLY_GAP_CENTER_VALUE; } while (i < orderedEditParts.size() - 1 && uniformGaps) { int gap = editor.getAbsoluteBounds(orderedEditParts.get(i + 1)).getCenter().x - editor.getAbsoluteBounds(orderedEditParts.get(i)).getCenter().x; if (gap != expectedGap) { uniformGaps = false; if (!orderedEditParts.get(i + 1).equals(getLastShape(orderedEditParts, DistributeAction.CENTERS_HORIZONTALLY))) { assertEquals("Not uniform centers horizontally gap", expectedGap, gap); } else { assertEquals("Incorrect centers horizontally gap between the second to last shape and the last shape", gap < expectedGap + (orderedEditParts.size() - 1), gap > expectedGap - (orderedEditParts.size() - 1)); } } i++; } }

Target:
private void doDistributeCentersHorizontally(Collection<SWTBotGefEditPart> editPartsToDistribute, ZoomLevel zoomLevel, boolean horizontalScrollbar) { editor.select(editPartsToDistribute); SWTBotUtils.waitAllUiEvents(); editor.clickContextMenu(HORIZONTALLY_CENTERS_GAPS_LABEL); List<SWTBotGefEditPart> orderedEditParts = centersHorizontallyOrderEditParts(editPartsToDistribute); boolean uniformGaps = true; int expectedGap; if (horizontalScrollbar) { expectedGap = SCROLLBAR_HORIZONTALLY_CENTER_GAP_VALUE; } else { expectedGap = HORIZONTALLY_CENTER_GAP_VALUE; } String messsageDetails = " (distribute action=" + HORIZONTALLY_CENTERS_GAPS_LABEL + ", zoomLevel=" + zoomLevel.getLevel() + ", horizontalScrollbar=" + horizontalScrollbar + ")"; for (int i = 0; i < orderedEditParts.size() - 1 && uniformGaps; i++) { int gap = editor.getAbsoluteBounds(orderedEditParts.get(i + 1)).getCenter().x - editor.getAbsoluteBounds(orderedEditParts.get(i)).getCenter().x; if (gap != expectedGap) { uniformGaps = false; if ((i + 1) != (orderedEditParts.size() - 1)) { assertEquals("Not uniform center horizontal gap" + messsageDetails, expectedGap, gap); } else { assertEquals("Incorrect center horizontal gap between the second to last shape and the last shape" + messsageDetails, gap < expectedGap + (orderedEditParts.size() - 1), gap > expectedGap - (orderedEditParts.size() - 1)); } } } }
Source:
public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; AbstractProject other = (AbstractProject) obj; return new EqualsBuilder() .append(alias, other.alias) .append(description, other.description) .append(progress, other.progress) .append(referenceGenome.getId(), other.referenceGenome.getId()) .append(shortName, other.shortName) .isEquals(); }

Target:
public boolean equals(Object obj) { if (this == obj) return true; if (obj == null) return false; if (getClass() != obj.getClass()) return false; AbstractProject other = (AbstractProject) obj; return new EqualsBuilder() .append(alias, other.alias) .append(description, other.description) .append(progress, other.progress) .append(referenceGenome, other.referenceGenome) .append(shortName, other.shortName) .isEquals(); }
Source:
public void testCreateStrategiesWithNoDarkClusters() { ClusterInfoProvider clusterInfoProvider = new MockClusterInfoProvider(); Facilities facilities = new MockFacilities(clusterInfoProvider); DarkClusterDispatcher darkClusterDispatcher = new DefaultDarkClusterDispatcherImpl(new MockClient(false)); DarkClusterStrategyFactory strategyFactory = new DarkClusterStrategyFactoryImpl(facilities, SOURCE_CLUSTER_NAME, darkClusterDispatcher, new DoNothingNotifier(), new Random(SEED), new CountingVerifierManager()); strategyFactory.start(); DarkClusterStrategy strategy = strategyFactory.getOrCreate(DARK_CLUSTER_NAME, new DarkClusterConfig()); RestRequest dummyRestRequest = new RestRequestBuilder(URI.create("foo")).build(); boolean requestSent = strategy.handleRequest(dummyRestRequest, dummyRestRequest, new RequestContext()); Assert.assertTrue(strategy instanceof NoOpDarkClusterStrategy); Assert.assertFalse(requestSent, "default empty strategy should not send request"); }

Target:
public void testCreateStrategiesWithNoDarkClusters() { DarkClusterStrategy strategy = _strategyFactory.getOrCreate(DARK_CLUSTER_NAME, new DarkClusterConfig()); RestRequest dummyRestRequest = new RestRequestBuilder(URI.create("foo")).build(); boolean requestSent = strategy.handleRequest(dummyRestRequest, dummyRestRequest, new RequestContext()); Assert.assertTrue(strategy instanceof NoOpDarkClusterStrategy); Assert.assertFalse(requestSent, "default empty strategy should not send request"); }
Source:
protected void setActionMessageParameters() { addCanDoActionMessage(VdcBllMessages.VAR__ACTION__ADD); addCanDoActionMessage(VdcBllMessages.VAR__TYPE__VM_DISK); }

Target:
protected void setActionMessageParameters() { addCanDoActionMessage(VdcBllMessages.VAR__ACTION__UPDATE); addCanDoActionMessage(VdcBllMessages.VAR__TYPE__VM_DISK); }
Source:
public void addKeyListener(KeyListener listener) { if (this.text != null && !this.text.isDisposed()) this.text.addKeyListener(listener); if (this.dropdownTableViewer != null && !this.dropdownTable.isDisposed()) this.dropdownTable.addKeyListener(listener); }

Target:
public void addKeyListener(KeyListener listener) { if (this.text != null && !this.text.isDisposed()) this.text.addKeyListener(listener); if (this.dropdownTable != null && !this.dropdownTable.isDisposed()) this.dropdownTable.addKeyListener(listener); }
Source:
public Response onGet( @QueryParam(value = "dump") @RestDocParam(description = "If given, a dump of the repository is sent") String dump, @QueryParam(value = "reset") @RestDocParam(description = "Resets the repository to the last &ldquo;official&rdquo; known state") String reset, @QueryParam(value = "commit") @RestDocParam(description = "Commits the current state to the repository and pushes it upstream") String commit ) { if (dump != null) { return this.dumpRepository(); } else if (reset != null) { try { ((GitBasedRepository) Prefs.INSTANCE.getRepository()).cleanAndResetHard(); } catch (Exception e) { Response res; res = Response.serverError().entity(e.getMessage()).build(); return res; } return Response.noContent().build(); } else if (commit != null) { try { ((GitBasedRepository) Prefs.INSTANCE.getRepository()).addCommit(null); } catch (Exception e) { Response res; res = Response.serverError().entity(e.getMessage()).build(); return res; } return Response.noContent().build(); } else { Viewable viewable = new Viewable("/jsp/admin/repository.jsp", this); return Response.ok().entity(viewable).build(); } }

Target:
public Response onGet( @QueryParam(value = "dump") @RestDocParam(description = "If given, a dump of the repository is sent") String dump, @QueryParam(value = "reset") @RestDocParam(description = "Resets the repository to the last &ldquo;official&rdquo; known state") String reset, @QueryParam(value = "commit") @RestDocParam(description = "Commits the current state to the repository and pushes it upstream") String commit ) { if (dump != null) { return this.dumpRepository(); } else if (reset != null) { try { ((GitBasedRepository) Prefs.INSTANCE.getRepository()).cleanAndResetHard(); } catch (Exception e) { Response res; res = Response.serverError().entity(e.getMessage()).build(); return res; } return Response.noContent().build(); } else if (commit != null) { try { ((GitBasedRepository) Prefs.INSTANCE.getRepository()).addCommit("Files changed externally"); } catch (Exception e) { Response res; res = Response.serverError().entity(e.getMessage()).build(); return res; } return Response.noContent().build(); } else { Viewable viewable = new Viewable("/jsp/admin/repository.jsp", this); return Response.ok().entity(viewable).build(); } }
Source:
public void put(Collection<SinkRecord> records) { if (records.isEmpty()) { return; } final SinkRecord first = records.iterator().next(); final int recordsCount = records.size(); log.trace( "Received records. First record kafka coordinates:({}-{}-{}). Writing them to the " + "database...", recordsCount, first.topic(), first.kafkaPartition(), first.kafkaOffset() ); try { writer.write(records); } catch (SQLException sqle) { log.warn(sqle.getNextException().getMessage()); log.warn( "Write of records failed, remainingRetries={}", records.size(), remainingRetries, sqle ); if (remainingRetries == 0) { throw new ConnectException(sqle); } else { writer.closeQuietly(); initWriter(); remainingRetries--; context.timeout(config.retryBackoffMs); throw new RetriableException(sqle); } } remainingRetries = config.maxRetries; }

Target:
public void put(Collection<SinkRecord> records) { if (records.isEmpty()) { return; } final SinkRecord first = records.iterator().next(); final int recordsCount = records.size(); log.trace( "Received records. First record kafka coordinates:({}-{}-{}). Writing them to the " + "database...", recordsCount, first.topic(), first.kafkaPartition(), first.kafkaOffset() ); try { writer.write(records); } catch (SQLException sqle) { log.warn( "Write of records failed, remainingRetries={}", records.size(), remainingRetries ); for (Throwable e: sqle) { log.warn(e.getMessage()); } if (remainingRetries == 0) { throw new ConnectException(sqle); } else { writer.closeQuietly(); initWriter(); remainingRetries--; context.timeout(config.retryBackoffMs); throw new RetriableException(sqle); } } remainingRetries = config.maxRetries; }
Source:
public ResponseEntity<?> getSubscriptionStats(@PathVariable("id") final String subscriptionId, final NativeWebRequest request) { try { final Subscription subscription = subscriptionRepository.getSubscription(subscriptionId); final List<SubscriptionEventTypeStats> subscriptionStat = subscriptionService.createSubscriptionStat(subscription); return status(OK).body(new ItemsWrapper(subscriptionStat)); } catch (final NoSuchSubscriptionException e) { LOG.debug("Failed to find subscription: " + subscriptionId, e); return create(e.asProblem(), request); } catch (final ServiceUnavailableException e) { LOG.error("Error occurred when trying to get subscription stat: " + subscriptionId, e); return create(e.asProblem(), request); } }

Target:
public ResponseEntity<?> getSubscriptionStats(@PathVariable("id") final String subscriptionId, final NativeWebRequest request) { try { final Subscription subscription = subscriptionRepository.getSubscription(subscriptionId); final List<SubscriptionEventTypeStats> subscriptionStat = subscriptionService.createSubscriptionStat(subscription); return status(OK).body(new ItemsWrapper(subscriptionStat)); } catch (final NoSuchSubscriptionException e) { LOG.debug("Failed to find subscription: {}", subscriptionId, e); return create(e.asProblem(), request); } catch (final ServiceUnavailableException e) { LOG.error("Error occurred when trying to get subscription stat: {}" + subscriptionId, e); return create(e.asProblem(), request); } }
Source:
protected void doChangeDefautlHost(Guid hostGuid) { if (hostGuid != null && firstRun) { Guid vdsId = hostGuid; if (getModel().getDefaultHost().getItems() != null) { getModel().getDefaultHost().setSelectedItem(Linq.firstOrDefault(getModel().getDefaultHost().getItems(), new Linq.HostPredicate(vdsId))); } getModel().getIsAutoAssign().setEntity(false); } else { getModel().getIsAutoAssign().setEntity(true); } firstRun = false; }

Target:
protected void doChangeDefautlHost(Guid hostGuid) { getModel().getIsAutoAssign().setEntity(true); if (hostGuid != null) { Guid vdsId = hostGuid; if (getModel().getDefaultHost().getItems() != null) { getModel().getDefaultHost().setSelectedItem(Linq.firstOrDefault(getModel().getDefaultHost().getItems(), new Linq.HostPredicate(vdsId))); if (getModel().getDefaultHost().getSelectedItem() != null && getModel().getDefaultHost().getSelectedItem().getId().equals(vdsId)) { getModel().getIsAutoAssign().setEntity(false); } } } }
Source:
public void editProviderLoaderAttributesTest() throws Exception { String providerLoaderName = randomAlphanumeric(5); Address providerLoaderAddress = elyOps.getElytronAddress(PROVIDER_LOADER, providerLoaderName); page.navigateToApplication().selectResource(PROVIDER_LOADER_LABEL); try { ops.add(providerLoaderAddress, Values.of(MODULE, BC_MODULE_NAME) .and(CLASS_NAMES, new ModelNodeListBuilder(new ModelNode(BC_CLASS_NAME)).build())); page.navigateToApplication().selectResource(PROVIDER_LOADER_LABEL).getResourceManager() .selectByName(providerLoaderName); page.switchToConfigAreaTab(ATTRIBUTES_LABEL); new ConfigChecker.Builder(client, providerLoaderAddress).configFragment(page.getConfigFragment()) .edit(TEXT, CLASS_NAMES, "") .edit(TEXT, MODULE, ELYTRON_MODULE_NAME) .andSave().verifyFormSaved() .verifyAttributeIsUndefined(CLASS_NAMES) .verifyAttribute(MODULE, ELYTRON_MODULE_NAME); } finally { ops.removeIfExists(providerLoaderAddress); adminOps.reloadIfRequired(); } }

Target:
public void editProviderLoaderAttributesTest() throws Exception { String providerLoaderName = randomAlphanumeric(5); Address providerLoaderAddress = elyOps.getElytronAddress(PROVIDER_LOADER, providerLoaderName); try { ops.add(providerLoaderAddress, Values.of(MODULE, BC_MODULE_NAME) .and(CLASS_NAMES, new ModelNodeListBuilder(new ModelNode(BC_CLASS_NAME)).build())); page.navigateToApplication().selectResource(PROVIDER_LOADER_LABEL).getResourceManager() .selectByName(providerLoaderName); page.switchToConfigAreaTab(ATTRIBUTES_LABEL); new ConfigChecker.Builder(client, providerLoaderAddress).configFragment(page.getConfigFragment()) .edit(TEXT, CLASS_NAMES, "") .edit(TEXT, MODULE, ELYTRON_MODULE_NAME) .andSave().verifyFormSaved() .verifyAttributeIsUndefined(CLASS_NAMES) .verifyAttribute(MODULE, ELYTRON_MODULE_NAME); } finally { ops.removeIfExists(providerLoaderAddress); adminOps.reloadIfRequired(); } }
Source:
public boolean isMobileTopLeaderboardVisible() { try { waitForElementVisibleByElement(mobileTopLeaderboard, 5, 1000); } catch (TimeoutException e) { return false; } return true; }

Target:
public boolean isMobileTopLeaderboardVisible() { try { waitForElementVisibleByElement(mobileTopLeaderboard, Settings.TIME_OUT_IN_SEC.value, Settings.CHECK_OUT_IN_MILLI_SEC.value); } catch (TimeoutException e) { return false; } return true; }
Source:
public File getDataDir() { if (StringUtils.isBlank(path)) { File transienStoreHome = new File(Environment.getDefault().getData(), "transientstores"); return new File(transienStoreHome, getName()); } else { return new File(path); } }

Target:
public String getDataDir() { return path; }
Source:
public void addRemoteReplicaToLagMetrics(final RemoteReplicaInfo remoteReplicaInfo) { String metricName = remoteReplicaInfo.getReplicaId().getDataNodeId().getHostname() + "-" + remoteReplicaInfo.getReplicaId().getDataNodeId().getPort() + "-" + remoteReplicaInfo.getReplicaId().getReplicaPath() + "-replicaLagInBytes"; Gauge<Long> replicaLag = new Gauge<Long>() { @Override public Long getValue() { return remoteReplicaInfo.getReplicaLagInBytes(); } }; registry.register(MetricRegistry.name(ReplicationMetrics.class, metricName), replicaLag); replicaLagInBytes.add(replicaLag); }

Target:
public void addRemoteReplicaToLagMetrics(final RemoteReplicaInfo remoteReplicaInfo) { final String metricName = remoteReplicaInfo.getReplicaId().getDataNodeId().getHostname() + "-" + remoteReplicaInfo.getReplicaId().getDataNodeId().getPort() + "-" + remoteReplicaInfo.getReplicaId().getReplicaPath() + "-replicaLagInBytes"; Gauge<Long> replicaLag = new Gauge<Long>() { @Override public Long getValue() { return remoteReplicaInfo.getReplicaLagInBytes(); } }; registry.register(MetricRegistry.name(ReplicationMetrics.class, metricName), replicaLag); replicaLagInBytes.add(replicaLag); }
Source:
private boolean localRecoveryNeeded(GridDhtPartitionsExchangeFuture fut) { for (CacheGroupContext grp : fut.sharedContext().cache().cacheGroups()) { if (grp.isLocal()) continue; GridAffinityAssignmentCache aff = grp.affinity(); Set<Integer> failedPrimaries = aff.primaryPartitions(fut.exchangeId().eventNode().id(), aff.lastVersion()); Set<Integer> loc = grp.topology().localPartitionMap().keySet(); for (int part : failedPrimaries) { if (loc.contains(part)) return true; } } return false; }

Target:
private boolean localRecoveryNeeded(GridDhtPartitionsExchangeFuture fut) { for (CacheGroupContext grp : fut.sharedContext().cache().cacheGroups()) { if (grp.isLocal()) continue; GridAffinityAssignmentCache aff = grp.affinity(); Set<Integer> failedPrimaries = aff.primaryPartitions(fut.exchangeId().eventNode().id(), aff.lastVersion()); Set<Integer> locBackups = aff.backupPartitions(fut.sharedContext().localNodeId(), aff.lastVersion()); for (int part : failedPrimaries) { if (locBackups.contains(part)) return true; } } return false; }
Source:
private Anchor createDownloadLink() { if (Patch.COMMIT_MSG.equals(path) || emptyFile) { return null; } PatchSet.Id id = (idActive == null) ? other.idActive : idActive; String sideURL = (idActive == null) ? "1" : "0"; String base = GWT.getHostPageBaseURL() + "cat/"; Image image = new Image(Gerrit.RESOURCES.downloadIcon()); Anchor anchor = new Anchor(); anchor.setHref( base + KeyUtil.encode(id.toString() + "," + path) + "^" + sideURL); anchor.setTitle(PatchUtil.C.download()); DOM.insertBefore(anchor.getElement(), image.getElement(), DOM.getFirstChild(anchor.getElement())); return anchor; }

Target:
private Anchor createDownloadLink() { PatchSet.Id id = (idActive == null) ? other.idActive : idActive; String sideURL = (idActive == null) ? "1" : "0"; String base = GWT.getHostPageBaseURL() + "cat/"; Anchor anchor = new Anchor( new ImageResourceRenderer().render(Gerrit.RESOURCES.downloadIcon()), base + KeyUtil.encode(id.toString() + "," + path) + "^" + sideURL); anchor.setTitle(PatchUtil.C.download()); return anchor; }
Source:
private void clearGraphSelection() { canvasClearSelectionEventEvent.fire(new CanvasClearSelectionEvent(graphUtils.getCanvasHandler())); }

Target:
private void clearGraphSelection() { canvasClearSelectionEventEvent.fire(new CanvasClearSelectionEvent(getCanvasHandler())); domainObjectSelectionEvent.fire(new DomainObjectSelectionEvent(getCanvasHandler(), new NOPDomainObject())); }
Source:
private static RecyclerView getRecyclerView() { ViewPager pager = getCurrentActivity().findViewById(R.id.postPager); return (RecyclerView) ((ViewGroup) ((ViewGroup) (pager.getChildAt(pager.getCurrentItem())) .findViewById(R.id.ptr_layout)).getChildAt(0)).getChildAt(0); }

Target:
private static RecyclerView getRecyclerView() { ViewPager pager = getCurrentActivity().findViewById(R.id.postPager); RecyclerView recyclerView = (RecyclerView) pager.getChildAt(pager.getCurrentItem()) .findViewById(R.id.recycler_view); if (recyclerView == null) { recyclerView = (RecyclerView) ((ViewGroup) ((ViewGroup) (pager.getChildAt(pager.getCurrentItem())) .findViewById(R.id.ptr_layout)).getChildAt(0)).getChildAt(0); } return recyclerView; }
Source:
public ArrayList<String[]> getAvailableApplications() { if (availableApplications == null) { availableApplications = new ArrayList<>(); try { InputStream is = new BufferedInputStream( new HttpRequestGenerator().simpleGet(new URL(mRoot + "/apps/manifest"))); byte[] manifest = StreamsUtil.getStreamAsBytes(is); JSONObject object = new JSONObject(new String(manifest)); JSONArray array = object.getJSONArray("applications"); for (int i = 0; i < array.length(); ++i) { JSONObject app = array.getJSONObject(i); String[] appRecord = new String[]{app.getString("name"), app.getString("profile_url")}; availableApplications.add(appRecord); } } catch (IOException | JSONException e) { e.printStackTrace(); } } return availableApplications; }

Target:
public ArrayList<Pair<String, String>> getAvailableApplications() { if (availableApplications == null) { availableApplications = new ArrayList<>(); try { InputStream is = new BufferedInputStream( new HttpRequestGenerator().simpleGet(new URL(serviceUrlRoot + "/apps/manifest"))); byte[] manifest = StreamsUtil.getStreamAsBytes(is); JSONObject object = new JSONObject(new String(manifest)); JSONArray array = object.getJSONArray("applications"); for (int i = 0; i < array.length(); ++i) { JSONObject app = array.getJSONObject(i); Pair<String, String> appRecord = new Pair<>(app.getString("name"), app.getString("profile_url")); availableApplications.add(appRecord); } } catch (IOException | JSONException e) { e.printStackTrace(); } } return availableApplications; }
Source:
Builder(Picasso picasso) { context = picasso.context; callFactory = picasso.callFactory; service = picasso.dispatcher.service; cache = picasso.cache; listener = picasso.listener; requestTransformers.addAll(picasso.requestTransformers); requestHandlers.addAll(picasso.requestHandlers); defaultBitmapConfig = picasso.defaultBitmapConfig; indicatorsEnabled = picasso.indicatorsEnabled; loggingEnabled = picasso.loggingEnabled; isChild = true; }

Target:
Builder(Picasso picasso) { context = picasso.context; callFactory = picasso.callFactory; service = picasso.dispatcher.service; cache = picasso.cache; listener = picasso.listener; requestTransformers.addAll(picasso.requestTransformers); int numRequestHandlers = picasso.requestHandlers.size(); requestHandlers.addAll(picasso.requestHandlers.subList(2, numRequestHandlers - 6)); defaultBitmapConfig = picasso.defaultBitmapConfig; indicatorsEnabled = picasso.indicatorsEnabled; loggingEnabled = picasso.loggingEnabled; }
Source:
synchronized void register( LuceneFulltext fulltextIndex ) throws IOException { fulltextIndex.open(); if ( fulltextIndex.getType() == FulltextIndexType.NODES ) { nodeIndices.put( fulltextIndex.getIdentifier(), fulltextIndex ); writableNodeIndices.add( new WritableFulltext( fulltextIndex ) ); nodeProperties.addAll( fulltextIndex.getProperties() ); } else { relationshipIndices.put( fulltextIndex.getIdentifier(), fulltextIndex ); writableRelationshipIndices.add( new WritableFulltext( fulltextIndex ) ); relationshipProperties.addAll( fulltextIndex.getProperties() ); } }

Target:
void register( LuceneFulltext fulltextIndex ) throws IOException { fulltextIndex.open(); if ( fulltextIndex.getType() == FulltextIndexType.NODES ) { nodeIndices.put( fulltextIndex.getIdentifier(), fulltextIndex ); writableNodeIndices.add( new WritableFulltext( fulltextIndex ) ); nodeProperties.addAll( fulltextIndex.getProperties() ); } else { relationshipIndices.put( fulltextIndex.getIdentifier(), fulltextIndex ); writableRelationshipIndices.add( new WritableFulltext( fulltextIndex ) ); relationshipProperties.addAll( fulltextIndex.getProperties() ); } }
Source:
public void start() { scheduler.scheduleAtFixedRate(new Runnable() { @Override public void run() { synchronized (BookieInfoReader.this) { if (LOG.isDebugEnabled()) { LOG.debug("Running periodic BookieInfo scan"); } try { Collection<BookieSocketAddress> updatedBookies = bk.bookieWatcher.getBookies(); bookieInfoMap.updateBookies(updatedBookies); } catch (BKException e) { LOG.info("Got exception while querying bookies from watcher, rerunning after {}s", e, conf.getGetBookieInfoRetryIntervalSeconds()); scheduler.schedule(this, conf.getGetBookieInfoRetryIntervalSeconds(), TimeUnit.SECONDS); return; } if (instanceState.tryStartFull()) { getReadWriteBookieInfo(); } } } }, 0, conf.getGetBookieInfoIntervalSeconds(), TimeUnit.SECONDS); }

Target:
public void start() { scheduler.scheduleAtFixedRate(new Runnable() { @Override public void run() { synchronized (BookieInfoReader.this) { if (LOG.isDebugEnabled()) { LOG.debug("Running periodic BookieInfo scan"); } try { Collection<BookieSocketAddress> updatedBookies = bk.bookieWatcher.getBookies(); bookieInfoMap.updateBookies(updatedBookies); } catch (BKException e) { LOG.info("Got exception while querying bookies from watcher, rerunning after {}s", conf.getGetBookieInfoRetryIntervalSeconds(), e); scheduler.schedule(this, conf.getGetBookieInfoRetryIntervalSeconds(), TimeUnit.SECONDS); return; } if (instanceState.tryStartFull()) { getReadWriteBookieInfo(); } } } }, 0, conf.getGetBookieInfoIntervalSeconds(), TimeUnit.SECONDS); }
Source:
public void makeBucket(String bucketName) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, RegionConflictException, XmlParserException { this.makeBucket(new MakeBucketArgs().builder().bucket(bucketName).build()); }

Target:
public void makeBucket(String bucketName) throws ErrorResponseException, IllegalArgumentException, InsufficientDataException, InternalException, InvalidBucketNameException, InvalidKeyException, InvalidResponseException, IOException, NoSuchAlgorithmException, RegionConflictException, XmlParserException { this.makeBucket(MakeBucketArgs.builder().bucket(bucketName).build()); }
Source:
public BlockCompressedIndexedFastaSequenceFile(final Path path, final FastaSequenceIndex index) { super(path, index); if (!canCreateBlockCompresedIndexedFastaSequence(path)) { throw new SAMException("Invalid block-compressed Fasta file"); } try { stream = new BlockCompressedInputStream(new SeekablePathStream(path)); gzindex = GZIIndex.loadIndex(GZIIndex.resolveIndexNameForBgzipFile(path)); } catch (IOException e) { throw new SAMException("Fasta file should be readable but is not: " + path, e); } }

Target:
public BlockCompressedIndexedFastaSequenceFile(final Path path, final FastaSequenceIndex index) { this(path, index, loadFastaGziIndex(path)); }
Source:
public void preview(IReport report, IStatus status, String serverName, List<IProcessorDescriptor> descriptors, IEclipseContext context, Shell parent) { StringBuilder text = new StringBuilder(); text.append("The following will be send to: ").append(serverName).append(LF + LF); List<StyleRange> styleRanges = new ArrayList<>(); for (SectionsProvider sectionsProvider : sectionProviders) { for (Section section : sectionsProvider.createSections(report, status, serverName, descriptors, context, parent)) { if (text.length() > 0) { text.append(LF); } if (section.getHeadlineStyleRanges().isEmpty()) { section.getHeadlineStyleRanges().add(createHeadlineStyleRange(section.getHeadline())); } section.getHeadlineStyleRanges().forEach(x -> x.start += text.length()); styleRanges.addAll(section.getHeadlineStyleRanges()); text.append(section.getHeadline()).append(LF + LF); section.getTextStyleRanges().forEach(x -> x.start += text.length()); styleRanges.addAll(section.getTextStyleRanges()); text.append(section.getText().trim()).append(LF + LF); } } styledText.setText(text.toString()); styledText.setStyleRanges(styleRanges.toArray(new StyleRange[0])); }

Target:
public void preview(IReport report, IStatus status, String serverName, List<IProcessorDescriptor> descriptors, IEclipseContext context, Shell parent) { StringBuilder text = new StringBuilder(); text.append("The following will be send to: ").append(serverName).append(LINE_SEPARATOR).append(LINE_SEPARATOR); List<StyleRange> styleRanges = new ArrayList<>(); for (SectionsProvider sectionsProvider : sectionProviders) { for (Section section : sectionsProvider.createSections(report, status, serverName, descriptors, context, parent)) { if (text.length() > 0) { text.append(LINE_SEPARATOR); } if (section.getHeadlineStyleRanges().isEmpty()) { section.getHeadlineStyleRanges().add(createHeadlineStyleRange(section.getHeadline())); } section.getHeadlineStyleRanges().forEach(x -> x.start += text.length()); styleRanges.addAll(section.getHeadlineStyleRanges()); text.append(section.getHeadline()).append(LINE_SEPARATOR).append(LINE_SEPARATOR); section.getTextStyleRanges().forEach(x -> x.start += text.length()); styleRanges.addAll(section.getTextStyleRanges()); text.append(section.getText().trim()).append(LINE_SEPARATOR).append(LINE_SEPARATOR); } } styledText.setText(text.toString()); styledText.setStyleRanges(styleRanges.toArray(new StyleRange[0])); }
Source:
public RuleResult validate(final PasswordData passwordData) { final RuleResult result = new RuleResult(); final Set<Character> matches = new HashSet<>(); final String text = passwordData.getPassword(); for (char c : text.toCharArray()) { if (Arrays.binarySearch(allowedCharacters, c) < 0 && !matches.contains(c)) { if (MatchBehavior.Contains.equals(matchBehavior) || matchBehavior.match(text, c)) { if (enhancedErrorMessages) { result.addError(ERROR_CODE + "." + (int) c, createRuleResultDetailParameters(c)); } else { result.addError(ERROR_CODE, createRuleResultDetailParameters(c)); } if (!reportAllFailures) { break; } matches.add(c); } } } result.setMetadata(createRuleResultMetadata(passwordData)); return result; }

Target:
public RuleResult validate(final PasswordData passwordData) { final RuleResult result = new RuleResult(); final Set<Character> matches = new HashSet<>(); final String text = passwordData.getPassword(); for (char c : text.toCharArray()) { if (Arrays.binarySearch(allowedCharacters, c) < 0 && !matches.contains(c)) { if (MatchBehavior.Contains.equals(matchBehavior) || matchBehavior.match(text, c)) { final String[] codes = {ERROR_CODE + "." + (int) c, ERROR_CODE}; result.addError(codes, createRuleResultDetailParameters(c)); if (!reportAllFailures) { break; } matches.add(c); } } } result.setMetadata(createRuleResultMetadata(passwordData)); return result; }
Source:
private void connectAndRefreshAllUpHosts(final boolean commandSucceeded) { try { for (VDS vds : getAllRunningVdssInPool()) { try { if (!_isLastMaster && commandSucceeded) { VDSReturnValue returnValue = executeRefreshStoragePoolCommand(vds); if (!returnValue.getSucceeded() && VdcBllErrors.StoragePoolUnknown.equals(returnValue.getVdsError().getCode())) { returnValue = executeConnectStoragePoolCommand(vds); } if (!returnValue.getSucceeded()) { log.errorFormat("Post reconstruct actions (connectPool) did not complete on host {0} in the pool. error {1}", vds.getId(), returnValue.getVdsError().getMessage()); } } if (getParameters().isInactive()) { StorageHelperDirector.getInstance() .getItem(getStorageDomain().getstorage_type()) .DisconnectStorageFromDomainByVdsId(getStorageDomain(), vds.getId()); } } catch (Exception e) { log.errorFormat("Post reconstruct actions (connectPool,refreshPool,disconnect storage)" + " did not complete on host {0} in the pool. error {1}", vds.getId(), e.getMessage()); } } } catch (Exception ex) { log.errorFormat("Post reconstruct actions (connectPool,refreshPool,disconnect storage)" + " did not complete on all up hosts in the pool. error {0}", ex.getMessage()); } }

Target:
private void connectAndRefreshAllUpHosts(final boolean commandSucceeded) { for (VDS vds : getAllRunningVdssInPool()) { try { if (!_isLastMaster && commandSucceeded) { try { Backend.getInstance() .getResourceManager() .RunVdsCommand( VDSCommandType.RefreshStoragePool, new RefreshStoragePoolVDSCommandParameters(vds.getId(), getStoragePool().getId(), _newMasterStorageDomainId, getStoragePool().getmaster_domain_version())); } catch (VDSExceptionBase ex) { if (VdcBllErrors.StoragePoolUnknown.equals(ex.getVdsError().getCode())) { VDSReturnValue returnVal = Backend.getInstance() .getResourceManager() .RunVdsCommand( VDSCommandType.ConnectStoragePool, new ConnectStoragePoolVDSCommandParameters(vds.getId(), getStoragePool().getId(), vds.getvds_spm_id(), _newMasterStorageDomainId, getStoragePool() .getmaster_domain_version())); if (!returnVal.getSucceeded()) { log.errorFormat("Post reconstruct actions (connectPool) did not complete on host {0} in the pool. error {1}", vds.getId(), returnVal.getVdsError().getMessage()); } } else { log.errorFormat("Post reconstruct actions (refreshPool)" + " did not complete on host {0} in the pool. error {1}", vds.getId(), ex.getMessage()); } } } if (!getParameters().isInactive()) { StorageHelperDirector.getInstance() .getItem(getStorageDomain().getstorage_type()) .DisconnectStorageFromDomainByVdsId(getStorageDomain(), vds.getId()); } } catch (Exception e) { log.errorFormat("Post reconstruct actions (connectPool,refreshPool,disconnect storage)" + " did not complete on host {0} in the pool. error {1}", vds.getId(), e.getMessage()); } } }
Source:
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); CoordinatorLayout coordinatorLayout = (CoordinatorLayout) getActivity().findViewById(R.id.coordinatorLayout); snackbar = Snackbar.make(coordinatorLayout,R.string.no_new_messages,Snackbar.LENGTH_SHORT) .setDuration(1000); }

Target:
public void onViewCreated(View view, @Nullable Bundle savedInstanceState) { super.onViewCreated(view, savedInstanceState); CoordinatorLayout coordinatorLayout = (CoordinatorLayout) getActivity().findViewById(R.id.coordinatorLayout); snackbar = Snackbar.make(coordinatorLayout, R.string.no_new_messages, Snackbar.LENGTH_SHORT) .setDuration(1000); FloatingActionButton floatingActionButton = (FloatingActionButton) coordinatorLayout.findViewById(R.id.fab); CoordinatorLayout.LayoutParams params = (CoordinatorLayout.LayoutParams) floatingActionButton.getLayoutParams(); params.setBehavior(new ShrinkBehaviorOfFab()); }
Source:
protected IDocument acquireDocument(IProgressMonitor pm) throws CoreException { SubMonitor subMonitor= SubMonitor.convert(pm, 2); fCUnit.becomeWorkingCopy(subMonitor.newChild(1)); Assert.isTrue(fCUnit.isWorkingCopy(), fCUnit.toString()); return super.acquireDocument(subMonitor.newChild(1)); }

Target:
protected IDocument acquireDocument(IProgressMonitor pm) throws CoreException { SubMonitor subMonitor= SubMonitor.convert(pm, 2); fCUnit.becomeWorkingCopy(subMonitor.split(1)); Assert.isTrue(fCUnit.isWorkingCopy(), fCUnit.toString()); return super.acquireDocument(subMonitor.split(1)); }
Source:
public void testRepairMove() { localSession.closeAndDiscardChanges(); UIResource sessionAirdResource = new UIResource(designerProject, REPRESENTATION_MODEL); String repairActionLabel = SiriusEditPlugin.getPlugin().getString("repairActionLabel"); designerProject.mouseRigthClickOnResource(sessionAirdResource, repairActionLabel); SWTBotUtils.waitProgressMonitorClose(OpenRepresentationsFileJob.JOB_LABEL); localSession = designerPerspective.openSessionFromFile(sessionAirdResource, true); openDiagram(REPRESENTATION_NAME); SWTBotGefConnectionEditPart swtBotGefEditPart1 = (SWTBotGefConnectionEditPart) editor.getEditPart("edge1", DEdgeEditPart.class); SWTBotGefConnectionEditPart swtBotGefEditPart2 = (SWTBotGefConnectionEditPart) editor.getEditPart("edge2", DEdgeEditPart.class); assertEdgeHasExpectedSrcAnchor(swtBotGefEditPart1, new PrecisionPoint(0.5, 0.5)); assertEdgeHasExpectedTgtAnchor(swtBotGefEditPart1, new PrecisionPoint(0.5, 0.5)); assertEdgeHasExpectedSrcAnchor(swtBotGefEditPart2, new PrecisionPoint(0.5, 0.5)); assertEdgeHasExpectedTgtAnchor(swtBotGefEditPart2, new PrecisionPoint(0.5, 0.5)); }

Target:
public void testRepairMove() { UIResource sessionAirdResource = new UIResource(designerProject, REPRESENTATION_MODEL); String repairActionLabel = SiriusEditPlugin.getPlugin().getString("repairActionLabel"); designerProject.mouseRigthClickOnResource(sessionAirdResource, repairActionLabel); SWTBotUtils.waitProgressMonitorClose(OpenRepresentationsFileJob.JOB_LABEL); localSession = designerPerspective.openSessionFromFile(sessionAirdResource, true); openDiagram(REPRESENTATION_NAME); SWTBotGefConnectionEditPart swtBotGefEditPart1 = (SWTBotGefConnectionEditPart) editor.getEditPart("edge1", DEdgeEditPart.class); SWTBotGefConnectionEditPart swtBotGefEditPart2 = (SWTBotGefConnectionEditPart) editor.getEditPart("edge2", DEdgeEditPart.class); assertEdgeHasExpectedSrcAnchor(swtBotGefEditPart1, new PrecisionPoint(0.5, 0.5)); assertEdgeHasExpectedTgtAnchor(swtBotGefEditPart1, new PrecisionPoint(0.5, 0.5)); assertEdgeHasExpectedSrcAnchor(swtBotGefEditPart2, new PrecisionPoint(0.5, 0.5)); assertEdgeHasExpectedTgtAnchor(swtBotGefEditPart2, new PrecisionPoint(0.5, 0.5)); }
Source:
private boolean ifaceMacCannotBeAddedToMacPool(VmNetworkInterface iface) { return !macPool.isDuplicateMacAddressesAllowed() && !shouldReassignMac(iface) && macPool.isMacInUse(iface.getMacAddress()); }

Target:
private boolean ifaceMacCannotBeAddedToMacPool(VmNetworkInterface iface) { return iface.getMacAddress() != null && !macPool.isDuplicateMacAddressesAllowed() && !shouldReassignMac(iface) && macPool.isMacInUse(iface.getMacAddress()); }
Source:
public Response toResponse(DataException e) { LOGGER.error("Hibernate error", e); String message = e.getCause().getMessage().contains("EMAIL") ? "Wrong email" : "Wrong input"; return Response.status(Response.Status.BAD_REQUEST) .entity(ImmutableMap.of("error", message)) .build(); }

Target:
public Response toResponse(DataException e) { LOGGER.error("Hibernate error", e); String message = e.getCause().getMessage().contains("EMAIL") ? "Wrong email" : "Wrong input"; return Response.status(Response.Status.BAD_REQUEST) .entity(new ErrorMessage(Response.Status.BAD_REQUEST.getStatusCode(), message)) .build(); }
Source:
public void testGet() throws Exception { Map<String, ? extends NodeMetadata> metadataMap = newLinkedHashMap(uniqueIndex( filter(client.listNodesDetailsMatching(all()), and(inGroup(group), not(TERMINATED))), new Function<NodeMetadata, String>() { @Override public String apply(NodeMetadata from) { return from.getId(); } })); for (NodeMetadata node : nodes) { metadataMap.remove(node.getId()); NodeMetadata metadata = client.getNodeMetadata(node.getId()); assertEquals(metadata.getProviderId(), node.getProviderId()); assertEquals(metadata.getGroup(), node.getGroup()); assertLocationSameOrChild(checkNotNull(metadata.getLocation(), "location of %s", metadata), template.getLocation()); checkImageIdMatchesTemplate(metadata); checkOsMatchesTemplate(metadata); if(metadata.getStatus() == Status.PENDING){Thread.sleep(60000); metadata = client.getNodeMetadata(node.getId());} assert (metadata.getStatus() == Status.RUNNING) : metadata; assertEquals(metadata.getPrivateAddresses().size(), node.getPrivateAddresses().size(), format( "[%s] didn't match: [%s]", metadata.getPrivateAddresses(), node.getPrivateAddresses().size())); assertEquals(metadata.getPublicAddresses().size(), node.getPublicAddresses().size(), format( "[%s] didn't match: [%s]", metadata.getPublicAddresses(), node.getPublicAddresses().size())); } assertNodeZero(metadataMap.values()); }

Target:
public void testGet() throws Exception { Map<String, ? extends NodeMetadata> metadataMap = newLinkedHashMap(uniqueIndex( filter(client.listNodesDetailsMatching(all()), and(inGroup(group), not(TERMINATED))), new Function<NodeMetadata, String>() { @Override public String apply(NodeMetadata from) { return from.getId(); } })); for (NodeMetadata node : nodes) { metadataMap.remove(node.getId()); NodeMetadata metadata = client.getNodeMetadata(node.getId()); assertEquals(metadata.getProviderId(), node.getProviderId()); assertEquals(metadata.getGroup(), node.getGroup()); assertLocationSameOrChild(checkNotNull(metadata.getLocation(), "location of %s", metadata), template.getLocation()); checkImageIdMatchesTemplate(metadata); checkOsMatchesTemplate(metadata); assert (metadata.getStatus() == Status.RUNNING) : metadata; assertEquals(metadata.getPrivateAddresses().size(), node.getPrivateAddresses().size(), format( "[%s] didn't match: [%s]", metadata.getPrivateAddresses(), node.getPrivateAddresses().size())); assertEquals(metadata.getPublicAddresses().size(), node.getPublicAddresses().size(), format( "[%s] didn't match: [%s]", metadata.getPublicAddresses(), node.getPublicAddresses().size())); } assertNodeZero(metadataMap.values()); }
Source:
public void awaitCompletion() { try { if (getQueue() == null) return; while (getQueue() != null && !getQueue().isEmpty()) { processInput(); } getCallerThreadPoolExecutor().awaitTermination(); } catch (Throwable throwable) { throw new RuntimeException("Error occurred while awaiting termination "+throwable.getMessage()); } }

Target:
public void awaitCompletion() { try { if (getInputQueue() == null) return; while (!getInputQueue().isEmpty()) { processInput(); } if(getCallerThreadPoolExecutor() != null) getCallerThreadPoolExecutor().awaitTermination(); } catch (Throwable throwable) { throw new RuntimeException("Error occurred while awaiting termination "+throwable.getMessage()); } }
Source:
private void loadValueExtractorsFromServiceLoader() { List<ValueExtractor<?>> valueExtractors; if ( externalClassLoader != null ) { final ClassLoader originalContextClassLoader = run( GetClassLoader.fromContext() ); try { run( SetContextClassLoader.action( externalClassLoader ) ); valueExtractors = run( GetValueExtractorsFromServiceLoader.action() ); } finally { run( SetContextClassLoader.action( originalContextClassLoader ) ); } } else { valueExtractors = run( GetValueExtractorsFromServiceLoader.action() ); } for ( ValueExtractor<?> valueExtractor : valueExtractors ) { validationBootstrapParameters.addValueExtractorDescriptor( new ValueExtractorDescriptor( valueExtractor ) ); } }

Target:
private void loadValueExtractorsFromServiceLoader() { List<ValueExtractor> valueExtractors = run( GetInstancesFromServiceLoader.action( externalClassLoader != null ? externalClassLoader : run( GetClassLoader.fromContext() ), ValueExtractor.class ) ); for ( ValueExtractor<?> valueExtractor : valueExtractors ) { validationBootstrapParameters.addValueExtractorDescriptor( new ValueExtractorDescriptor( valueExtractor ) ); } }
Source:
public void shouldNotGenerateCreateDecimalFormatMethod() { Class clz = BigIntegerMapper.INSTANCE.getClass(); try { Method method = clz.getDeclaredMethod( "createDecimalFormat", String.class ); assertThat( method ).isNull(); } catch ( NoSuchMethodException ex ) { } catch ( SecurityException ex ) { } }

Target:
public void shouldNotGenerateCreateDecimalFormatMethod() { getGeneratedSource().forMapper( BigIntegerMapper.class ).content().doesNotContain( "createDecimalFormat" ); }
Source:
private void waitForConfirm(Message<?> requestMessage, CorrelationData correlationData) { try { Confirm confirm = correlationData.getFuture().get(getConfirmTimeout().toMillis(), TimeUnit.MILLISECONDS); if (!confirm.isAck()) { throw new MessageHandlingException(requestMessage, "Negative publisher confirm received: " + confirm); } if (correlationData.getReturnedMessage() != null) { throw new MessageHandlingException(requestMessage, "Message was returned by the broker"); } } catch (@SuppressWarnings("unused") InterruptedException e) { Thread.currentThread().interrupt(); } catch (ExecutionException e) { throw new MessageHandlingException(requestMessage, "Failed to get publisher confirm", e); } catch (TimeoutException e) { throw new MessageTimeoutException(requestMessage, "Timed out awaiting publisher confirm", e); } }

Target:
private void waitForConfirm(Message<?> requestMessage, CorrelationData correlationData) { try { Confirm confirm = correlationData.getFuture().get(this.waitForConfirmTimeout.toMillis(), TimeUnit.MILLISECONDS); if (!confirm.isAck()) { throw new AmqpException("Negative publisher confirm received: " + confirm); } if (correlationData.getReturnedMessage() != null) { throw new AmqpException("Message was returned by the broker"); } } catch (@SuppressWarnings("unused") InterruptedException e) { Thread.currentThread().interrupt(); } catch (ExecutionException e) { throw new AmqpException("Failed to get publisher confirm", e); } catch (TimeoutException e) { throw new MessageTimeoutException(requestMessage, this + ": Timed out awaiting publisher confirm", e); } }
Source:
public Response export(Action action) { org.ovirt.engine.core.common.businessentities.VM vm = getEntity( org.ovirt.engine.core.common.businessentities.VM.class, QueryType.GetVmByVmId, new IdQueryParameters(guid), "VM: id=" + guid); String clonedVmName = action.getExportedVmName(); if (StringUtils.isEmpty(action.getExportedVmName())) { clonedVmName = String.format("%s-cloned", vm.getName()); } CloneVmParameters params = new CloneVmParameters(vm, clonedVmName); params.setDestStorageDomainId(getStorageDomainId(action)); ActionType actionType = ActionType.CloneVmNoCollapse; if (action.isSetDiscardSnapshots() && action.isDiscardSnapshots()) { actionType = ActionType.CloneVm; } return doAction(actionType, params, action); }

Target:
public Response export(Action action) { org.ovirt.engine.core.common.businessentities.VM vm = getEntity( org.ovirt.engine.core.common.businessentities.VM.class, QueryType.GetVmByVmId, new IdQueryParameters(guid), "VM: id=" + guid); String clonedVmName = action.getExportedVmName(); if (StringUtils.isEmpty(action.getExportedVmName())) { clonedVmName = String.format("%s-export", vm.getName()); } CloneVmParameters params = new CloneVmParameters(vm, clonedVmName); params.setDestStorageDomainId(getStorageDomainId(action)); ActionType actionType = action.isSetDiscardSnapshots() && action.isDiscardSnapshots() ? ActionType.CloneVm: ActionType.CloneVmNoCollapse; return doAction(actionType, params, action); }
Source:
public List<SelectItem> getBatchOptions() { List<SelectItem> result = new ArrayList<SelectItem>(); if (granularity == null) { result.add(new SelectItem("null", Helper.getTranslation("granularity.batches.noData"))); } else if (granularity == Granularity.YEARS) { result.add(new SelectItem("null", Helper.getTranslation("granularity.batches.notAvailable"))); } else { result.add(new SelectItem("null", Helper.getTranslation("granularity.null"))); switch (granularity) { case ISSUES: result.add(new SelectItem("issues", Helper.getTranslation("granularity.issues"))); case DAYS: result.add(new SelectItem("weeks", Helper.getTranslation("granularity.weeks"))); case WEEKS: result.add(new SelectItem("months", Helper.getTranslation("granularity.months"))); case MONTHS: result.add(new SelectItem("quarters", Helper.getTranslation("granularity.quarters"))); case QUARTERS: result.add(new SelectItem("years", Helper.getTranslation("granularity.years"))); break; default: break; } } return result; }

Target:
public List<SelectItem> getBatchOptions() { List<SelectItem> result = new ArrayList<SelectItem>(); if (granularity == null) { result.add(new SelectItem("null", Helper.getTranslation("granularity.batches.noData"))); } else if (granularity == Granularity.YEARS) { result.add(new SelectItem("null", Helper.getTranslation("granularity.batches.notAvailable"))); } else { result.add(new SelectItem("null", Helper.getTranslation("granularity.null"))); switch (granularity) { case ISSUES: result.add(new SelectItem("issues", Helper.getTranslation("granularity.issues"))); case DAYS: result.add(new SelectItem("weeks", Helper.getTranslation("granularity.weeks"))); case WEEKS: result.add(new SelectItem("months", Helper.getTranslation("granularity.months"))); case MONTHS: result.add(new SelectItem("quarters", Helper.getTranslation("granularity.quarters"))); case QUARTERS: result.add(new SelectItem("years", Helper.getTranslation("granularity.years"))); break; default: assert false : granularity; } } return result; }
Source:
public static void endTaskStep(Guid stepId, JobExecutionStatus exitStatus) { try { if (stepId != null) { Step step = JobRepositoryFactory.getJobRepository().getStep(stepId); if (step != null) { step.markStepEnded(exitStatus); JobRepositoryFactory.getJobRepository().updateStep(step); } } } catch (Exception e) { log.error("Failed to terminate step '{}' with status '{}'", stepId, exitStatus); log.error("Exception", e); } }

Target:
public static void endTaskStep(Guid stepId, JobExecutionStatus exitStatus) { try { if (stepId != null) { Step step = JobRepositoryFactory.getJobRepository().getStep(stepId); if (step != null) { step.markStepEnded(exitStatus); JobRepositoryFactory.getJobRepository().updateStep(step); } } } catch (Exception e) { log.error("Failed to terminate step '{}' with status '{}': {}", stepId, exitStatus, e.getMessage()); log.debug("Exception", e); } }