auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public List<DocumentModel> getDocumentsForComment(DocumentModel comment) { return CoreInstance.doPrivileged(comment.getRepositoryName(), session -> { Map<String, Object> ctxMap = Collections.<String, Object> singletonMap( ResourceAdapter.CORE_SESSION_CONTEXT_KEY, session); RelationManager relationManager = Framework.getService(RelationManager.class); Graph graph = relationManager.getGraph(config.graphName, session); Resource commentResource = relationManager.getResource(config.commentNamespace, comment, ctxMap); if (commentResource == null) { throw new NuxeoException("Could not adapt document model to relation resource ; " + "check the service relation adapters configuration"); } Resource predicate = new ResourceImpl(config.predicateNamespace); List<Statement> statementList = graph.getStatements(commentResource, predicate, null); if (graph instanceof JenaGraph) { Resource oldDocResource = new QNameResourceImpl(config.commentNamespace, comment.getId()); statementList.addAll(graph.getStatements(oldDocResource, predicate, null)); } List<DocumentModel> docList = new ArrayList<DocumentModel>(); for (Statement stmt : statementList) { QNameResourceImpl subject = (QNameResourceImpl) stmt.getObject(); DocumentModel docModel = (DocumentModel) relationManager.getResourceRepresentation( config.documentNamespace, subject, ctxMap); if (docModel == null) { log.warn("Could not adapt comment relation subject to a document " + "model; check the service relation adapters configuration"); continue; } docModel.detach(true); docList.add(docModel); } return docList; }); }

Target:
public List<DocumentModel> getDocumentsForComment(DocumentModel comment) { return doPrivileged(comment.getCoreSession(), comment.getRepositoryName(), session -> { Map<String, Object> ctxMap = Collections.<String, Object>singletonMap(ResourceAdapter.CORE_SESSION_CONTEXT_KEY, session); RelationManager relationManager = Framework.getService(RelationManager.class); Graph graph = relationManager.getGraph(config.graphName, session); Resource commentResource = relationManager.getResource(config.commentNamespace, comment, ctxMap); if (commentResource == null) { throw new NuxeoException("Could not adapt document model to relation resource ; " + "check the service relation adapters configuration"); } Resource predicate = new ResourceImpl(config.predicateNamespace); List<Statement> statementList = graph.getStatements(commentResource, predicate, null); if (graph instanceof JenaGraph) { Resource oldDocResource = new QNameResourceImpl(config.commentNamespace, comment.getId()); statementList.addAll(graph.getStatements(oldDocResource, predicate, null)); } List<DocumentModel> docList = new ArrayList<DocumentModel>(); for (Statement stmt : statementList) { QNameResourceImpl subject = (QNameResourceImpl) stmt.getObject(); DocumentModel docModel = (DocumentModel) relationManager.getResourceRepresentation(config.documentNamespace, subject, ctxMap); if (docModel == null) { log.warn("Could not adapt comment relation subject to a document " + "model; check the service relation adapters configuration"); continue; } docModel.detach(true); docList.add(docModel); } return docList; }); }
Source:
private String getFirstRevision(String fullpath) throws IOException { String[] argv = { ensureCommand(CMD_PROPERTY_KEY, CMD_FALLBACK), "rev-list", "--reverse", "HEAD", "--", fullpath }; Executor executor = new Executor(Arrays.asList(argv), new File(getDirectoryName()), RuntimeEnvironment.getInstance().getInteractiveCommandTimeout()); int status = executor.exec(); try (BufferedReader in = new BufferedReader( new InputStreamReader(executor.getOutputStream()))) { String line; if ((line = in.readLine()) != null) { return line.trim(); } } if (status != 0) { LOGGER.log(Level.WARNING, "Failed to get first revision for: \"{0}\" Exit code: {1}", new Object[]{fullpath, String.valueOf(status)}); return null; } return null; }

Target:
private String getFirstRevision(String fullpath) throws IOException { String[] argv = { ensureCommand(CMD_PROPERTY_KEY, CMD_FALLBACK), "rev-list", "--reverse", "HEAD", "--", fullpath }; Executor executor = new Executor(Arrays.asList(argv), new File(getDirectoryName()), RuntimeEnvironment.getInstance().getInteractiveCommandTimeout()); HeadHandler headHandler = new HeadHandler(1); int status = executor.exec(false, headHandler); String line; if (headHandler.count() > 0 && (line = headHandler.get(0)) != null) { return line.trim(); } LOGGER.log(Level.WARNING, "Failed to get first revision for: \"{0}\" Exit code: {1}", new Object[]{fullpath, String.valueOf(status)}); return null; }
Source:
protected CoordinatorStreamSystemConsumer initializeCoordinatorStreamConsumer(JobInstance jobInstance) { CoordinatorStreamSystemFactory coordinatorStreamSystemFactory = new CoordinatorStreamSystemFactory(); Config coordinatorSystemConfig = getCoordinatorSystemConfig(jobInstance); LOG.info("Using config: to create coordinatorStream consumer.", coordinatorSystemConfig); CoordinatorStreamSystemConsumer consumer = coordinatorStreamSystemFactory.getCoordinatorStreamSystemConsumer(coordinatorSystemConfig, METRICS_REGISTRY); LOG.info("Registering coordinator system stream consumer."); consumer.register(); LOG.debug("Starting coordinator system stream consumer."); consumer.start(); LOG.debug("Bootstrapping coordinator system stream consumer."); consumer.bootstrap(); return consumer; }

Target:
protected CoordinatorStreamSystemConsumer initializeCoordinatorStreamConsumer(JobInstance jobInstance) { CoordinatorStreamSystemFactory coordinatorStreamSystemFactory = new CoordinatorStreamSystemFactory(); Config coordinatorSystemConfig = getCoordinatorSystemConfig(jobInstance); LOG.debug("Using config: to create coordinatorStream consumer.", coordinatorSystemConfig); CoordinatorStreamSystemConsumer consumer = coordinatorStreamSystemFactory.getCoordinatorStreamSystemConsumer(coordinatorSystemConfig, METRICS_REGISTRY); LOG.debug("Registering coordinator system stream consumer."); consumer.register(); LOG.debug("Starting coordinator system stream consumer."); consumer.start(); LOG.debug("Bootstrapping coordinator system stream consumer."); consumer.bootstrap(); return consumer; }
Source:
public void supplyVanillaManipulators(List<DataManipulator<?, ?>> manipulators) { super.supplyVanillaManipulators(manipulators); get(DyeableData.class) .ifPresent( manipulators::add); }

Target:
public void supplyVanillaManipulators(List<DataManipulator<?, ?>> manipulators) { super.supplyVanillaManipulators(manipulators); if (this.color != null) { manipulators.add(new SpongeDyeableData((DyeColor) (Object) this.color)); } }
Source:
private List<String> listFiles(String prefix, File[] files) { File dir = worldEdit.getWorkingDirectoryFile(prefix); if (prefix == null) prefix = ""; List<String> result = new ArrayList<String>(); for (File file : files) { StringBuilder build = new StringBuilder(); build.append("\u00a72"); ClipboardFormat format = ClipboardFormat.findByFile(file); boolean inRoot = file.getParentFile().getName().equals(prefix); if (inRoot) { build.append(file.getName()); } else { String relative = dir.toURI().relativize(file.toURI()).getPath(); String[] split = file.getPath().split(Pattern.quote(prefix + File.separator)); build.append(relative); } build.append(": ").append(format == null ? "Unknown" : format.name()); result.add(build.toString()); } return result; }

Target:
private List<String> listFiles(String prefix, File[] files) { File dir = worldEdit.getWorkingDirectoryFile(prefix); if (prefix == null) prefix = ""; List<String> result = new ArrayList<String>(); for (File file : files) { StringBuilder build = new StringBuilder(); build.append("\u00a72"); ClipboardFormat format = ClipboardFormat.findByFile(file); boolean inRoot = file.getParentFile().getName().equals(prefix); if (inRoot) { build.append(file.getName()); } else { String relative = dir.toURI().relativize(file.toURI()).getPath(); build.append(relative); } build.append(": ").append(format == null ? "Unknown" : format.name()); result.add(build.toString()); } return result; }
Source:
public long srem(Collection<ByteArrayWrapper> membersToRemove) { AtomicLong removedCount = new AtomicLong(); region().computeIfPresent(key, (_unusedKey_, oldValue) -> { Set<ByteArrayWrapper> newValue = createSet(oldValue); newValue.removeAll(membersToRemove); removedCount.set(oldValue.size() - newValue.size()); return newValue; }); if (members().isEmpty()) { RedisDataType type = context.getKeyRegistrar().getType(key); context.getRegionProvider().removeKey(key, type); } return removedCount.longValue(); }

Target:
public long srem(Collection<ByteArrayWrapper> membersToRemove) { AtomicLong removedCount = new AtomicLong(); region().computeIfPresent(key, (_unusedKey_, oldValue) -> { Set<ByteArrayWrapper> newValue = createSet(oldValue); newValue.removeAll(membersToRemove); removedCount.set(oldValue.size() - newValue.size()); return newValue; }); if (members().isEmpty()) { RedisDataType type = context.getKeyRegistrar().getType(key); if (type == RedisDataType.REDIS_SET) { context.getRegionProvider().removeKey(key, type); } } return removedCount.longValue(); }
Source:
public static void printMetrics(Nimbus.Iface client, String name) throws Exception { TopologySummary ts = client.getTopologySummaryByName(name); if (ts == null) { throw new Exception("Could not find a topology named " + name); } String id = ts.get_id(); TopologyInfo info = client.getTopologyInfo(id); int uptime = info.get_uptime_secs(); long acked = 0; long failed = 0; double weightedAvgTotal = 0.0; for (ExecutorSummary exec : info.get_executors()) { if ("spout".equals(exec.get_component_id())) { SpoutStats stats = exec.get_stats().get_specific().get_spout(); Map<String, Long> failedMap = stats.get_failed().get(":all-time"); Map<String, Long> ackedMap = stats.get_acked().get(":all-time"); Map<String, Double> avgLatMap = stats.get_complete_ms_avg().get(":all-time"); for (String key : ackedMap.keySet()) { if (failedMap != null) { Long tmp = failedMap.get(key); if (tmp != null) { failed += tmp; } } long ackVal = ackedMap.get(key); double latVal = avgLatMap.get(key) * ackVal; acked += ackVal; weightedAvgTotal += latVal; } } } double avgLatency = weightedAvgTotal / acked; System.out.println("uptime: " + uptime + " acked: " + acked + " avgLatency: " + avgLatency + " acked/sec: " + (((double) acked) / uptime + " failed: " + failed)); }

Target:
public static void printMetrics(Nimbus.Iface client, String name) throws Exception { TopologyInfo info = client.getTopologyInfoByName(name); int uptime = info.get_uptime_secs(); long acked = 0; long failed = 0; double weightedAvgTotal = 0.0; for (ExecutorSummary exec : info.get_executors()) { if ("spout".equals(exec.get_component_id())) { SpoutStats stats = exec.get_stats().get_specific().get_spout(); Map<String, Long> failedMap = stats.get_failed().get(":all-time"); Map<String, Long> ackedMap = stats.get_acked().get(":all-time"); Map<String, Double> avgLatMap = stats.get_complete_ms_avg().get(":all-time"); for (String key : ackedMap.keySet()) { if (failedMap != null) { Long tmp = failedMap.get(key); if (tmp != null) { failed += tmp; } } long ackVal = ackedMap.get(key); double latVal = avgLatMap.get(key) * ackVal; acked += ackVal; weightedAvgTotal += latVal; } } } double avgLatency = weightedAvgTotal / acked; System.out.println("uptime: " + uptime + " acked: " + acked + " avgLatency: " + avgLatency + " acked/sec: " + (((double) acked) / uptime + " failed: " + failed)); }
Source:
private static void failWithCorruptionException(boolean failOnCorruptedParquetStatistics, String column, ParquetDataSourceId id, Statistics statistics) { if (failOnCorruptedParquetStatistics) { throw new ParquetCorruptionException(format("Corrupted statistics for column %s in Parquet file %s: %s", column, id, statistics)); } }

Target:
private static void failWithCorruptionException(boolean failOnCorruptedParquetStatistics, String column, ParquetDataSourceId id, Statistics statistics) throws ParquetCorruptionException { if (failOnCorruptedParquetStatistics) { throw new ParquetCorruptionException(format("Corrupted statistics for column \"%s\" in Parquet file \"%s\": [%s]", column, id, statistics)); } }
Source:
public <T> void putList(final String dataType, final List<Long> ids, final List<T> values) { if (ids.size() != values.size()) { throw new RuntimeException("Different list sizes: ids " + ids.size() + ", values " + values.size()); } readWriteLock.writeLock().lock(); try { if (!dataMap.containsKey(dataType)) { dataMap.put(dataType, new TreeMap<Long, Object>()); } for (int index = 0; index < ids.size(); index++) { dataMap.get(dataType).put(ids.get(index), values.get(index)); } } finally { readWriteLock.writeLock().unlock(); } }

Target:
public <T> void putList(final String dataType, final List<Long> ids, final List<T> values) { if (ids.size() != values.size()) { throw new RuntimeException("Different list sizes: ids " + ids.size() + ", values " + values.size()); } readWriteLock.writeLock().lock(); try { if (!dataMap.containsKey(dataType)) { dataMap.put(dataType, new TreeMap<Long, Object>()); } final Map<Long, Object> innerMap = dataMap.get(dataType); for (int index = 0; index < ids.size(); index++) { innerMap.put(ids.get(index), values.get(index)); } } finally { readWriteLock.writeLock().unlock(); } }
Source:
public static Version parseVersion(String text) { Version version = new Version(); String parts[] = text.split("\\.", -1); version.setFullVersion(text); version.setMajor(Integer.parseInt(parts[0])); version.setMinor(Integer.parseInt(parts[1])); if (parts[2].contains("-")) { version.setBuild(Integer.parseInt(parts[2].split("-")[0])); } else { version.setBuild(Integer.parseInt(parts[2])); } version.setRevision(Integer.parseInt(parts[3])); return version; }

Target:
public static Version parseVersion(String text) { Version version = new Version(); String parts[] = text.split("\\.", -1); switch (parts.length) { case 4: version.setRevision(Integer.parseInt(parts[3])); case 3: version.setBuild(Integer.parseInt(parts[2])); case 2: version.setMinor(Integer.parseInt(parts[1])); case 1: version.setMajor(Integer.parseInt(parts[0])); } return version; }
Source:
private NetworkFilter resolveVnicProfileDefaultNetworkFilter() { final Version dataCenterVersion = resolveDataCenterVersion(); NetworkFilter networkFilter = null; if (FeatureSupported.antiMacSpoofing(dataCenterVersion) && Config.<Boolean> getValue(ConfigValues.EnableMACAntiSpoofingFilterRules)) { networkFilter = networkFilterDao.getNetworkFilterByName(NetworkFilter.VDSM_NO_MAC_SPOOFING); } return networkFilter; }

Target:
private NetworkFilter resolveVnicProfileDefaultNetworkFilter() { if (Config.<Boolean> getValue(ConfigValues.EnableMACAntiSpoofingFilterRules)) { return networkFilterDao.getNetworkFilterByName(NetworkFilter.VDSM_NO_MAC_SPOOFING); } return null; }
Source:
public Map<String, String> toMap() { return ImmutableMap.of("account_id", accountId); }

Target:
public Map<String, String> toMap() { return ImmutableMap.of("stripe_account_id", accountId); }
Source:
public void providerMapped(RepositoryProvider provider) { Object[] allListeners = listeners.getListeners(); for (Object allListener : allListeners) { IRepositoryProviderListener listener = (IRepositoryProviderListener) allListener; listener.providerMapped(provider); } }

Target:
public void providerMapped(RepositoryProvider provider) { Object[] allListeners = listeners.getListeners(); for (Object l : allListeners) { IRepositoryProviderListener listener = (IRepositoryProviderListener) l; listener.providerMapped(provider); } }
Source:
public void testCache() { final ICache<Object, Object> cache = hz.getCacheManager().getCache(CACHE_NAME); Random random = new Random(); for (int i = 0; i < EVENT_COUNTER; i++) { int key = random.nextInt(Integer.MAX_VALUE); cache.putAsync(key, 23); cache.removeAsync(key); } assertHasStatsEventually("/hz/" + CACHE_NAME, "cache."); }

Target:
public void testCache() { final ICache<Object, Object> cache = hz.getCacheManager().getCache(CACHE_NAME); Random random = new Random(); for (int i = 0; i < EVENT_COUNTER; i++) { int key = random.nextInt(Integer.MAX_VALUE); cache.putAsync(key, 23); cache.removeAsync(key); } assertHasStatsEventually(getDistributedObjectName(CACHE_NAME), "cache."); }
Source:
public Authentication authenticate(Authentication authentication) throws AuthenticationException { BearerTokenAuthenticationToken bearer = (BearerTokenAuthenticationToken) authentication; Jwt jwt; try { jwt = this.jwtDecoder.decode(bearer.getToken()); } catch (JwtException failed) { OAuth2Error invalidToken = invalidToken(failed.getMessage()); throw new OAuth2AuthenticationException(invalidToken); } OAuth2TokenValidatorResult<OAuth2Error> result = this.jwtValidator.validate(jwt); if ( !result.isSuccess() ) { Collection<OAuth2Error> details = result.getDetails(); if ( details.size() == 1 ) { throw new OAuth2AuthenticationException(details.iterator().next()); } else { throw new OAuth2DetailedAuthenticationException(details.iterator().next(), details); } } JwtAuthenticationToken token = this.jwtConverter.convert(jwt); token.setDetails(bearer.getDetails()); return token; }

Target:
public Authentication authenticate(Authentication authentication) throws AuthenticationException { BearerTokenAuthenticationToken bearer = (BearerTokenAuthenticationToken) authentication; Jwt jwt; try { jwt = this.jwtDecoder.decode(bearer.getToken()); } catch (JwtException failed) { OAuth2Error invalidToken = invalidToken(failed.getMessage()); throw new OAuth2AuthenticationException(invalidToken, invalidToken.getDescription(), failed); } JwtAuthenticationToken token = this.jwtConverter.convert(jwt); token.setDetails(bearer.getDetails()); return token; }
Source:
@Override public void process() throws IOException { try { HRegion region = (HRegion)this.rss.getRegion(this.regionInfo.getEncodedName()); if (region == null) { LOG.warn("Received CLOSE for but not ONLINE; ignoring CLOSE request", this.regionInfo.getRegionNameAsString()); return; } if (region.getCoprocessorHost() != null) { region.getCoprocessorHost().preClose(abort); } if (region.close(abort) == null) { LOG.warn("Can't close {}, already closed; split? (Unexpected state - investigate)", this.regionInfo.getRegionNameAsString()); return; } this.rss.removeRegion(region, destination); boolean b = reportRegionStateTransition(); LOG.debug("Closed (notified master={})", this.regionInfo.getRegionNameAsString(), b); } finally { this.rss.getRegionsInTransitionInRS().remove(this.regionInfo.getEncodedNameAsBytes(), Boolean.FALSE); } }

Target:
public void process() { try { String name = regionInfo.getEncodedName(); LOG.trace("Processing close of {}", name); String encodedRegionName = regionInfo.getEncodedName(); HRegion region = (HRegion)rsServices.getRegion(encodedRegionName); if (region == null) { LOG.warn("Received CLOSE for region but currently not serving - ignoring", name); return; } try { if (region.close(abort) == null) { LOG.warn("Can't close region {}, was already closed during close()", name); return; } } catch (IOException ioe) { server.abort("Unrecoverable exception while closing region " + regionInfo.getRegionNameAsString() + ", still finishing close", ioe); throw new RuntimeException(ioe); } this.rsServices.removeRegion(region, destination); rsServices.reportRegionStateTransition(new RegionStateTransitionContext(TransitionCode.CLOSED, HConstants.NO_SEQNUM, Procedure.NO_PROC_ID, -1, regionInfo)); LOG.debug("Closed " + region.getRegionInfo().getRegionNameAsString()); } finally { this.rsServices.getRegionsInTransitionInRS(). remove(this.regionInfo.getEncodedNameAsBytes(), Boolean.FALSE); } }
Source:
private List<AppInfo> fetchAppInfosAndStatistics() { List<AppInfo> apps = fetchAppInfos(); int total = apps.size(); final Object lock = new Object(); fetchAppInfoCounter = 0; for (final AppInfo app : apps) { new Thread(new Runnable() { @Override public void run() { AppStats stats = app.getLatestStats(); fetchRatings(app, stats); stats.setNumberOfComments(fetchCommentsCount(app, Utils.getDisplayLocale())); RevenueSummary revenue = fetchRevenueSummary(app); app.setTotalRevenueSummary(revenue); if (revenue != null) { stats.setTotalRevenue(revenue.getLastDay()); } synchronized (lock) { fetchAppInfoCounter++; lock.notify(); } } }).start(); } synchronized (lock) { while (fetchAppInfoCounter < total) { try { lock.wait(); } catch (InterruptedException e) { } } } return apps; }

Target:
private List<AppInfo> fetchAppInfosAndStatistics() { ExecutorService executor = Executors.newFixedThreadPool(10); List<AppInfo> apps = fetchAppInfos(); fetchAppInfoCounter = new CountDownLatch(apps.size()); for (final AppInfo app : apps) { Thread thread = new Thread(new Runnable() { @Override public void run() { try { Log.d("start app", app.getName()); AppStats stats = app.getLatestStats(); fetchRatings(app, stats); stats.setNumberOfComments(fetchCommentsCount(app, Utils.getDisplayLocale())); RevenueSummary revenue = fetchRevenueSummary(app); app.setTotalRevenueSummary(revenue); if (revenue != null) { stats.setTotalRevenue(revenue.getLastDay()); } Log.d("end app", app.getName()); } finally { Log.w("finally app", app.getName()); synchronized (fetchAppInfoCounter) { Log.e("fetch counter", String.valueOf(fetchAppInfoCounter.getCount())); fetchAppInfoCounter.countDown(); Log.w("finally count", String.valueOf(fetchAppInfoCounter.getCount())); } } } }); executor.execute(thread); } try { Log.e("Waiting", "waiting..."); fetchAppInfoCounter.await(); } catch (InterruptedException e) { } Log.e("Waiting", "DONE!"); return apps; }
Source:
public void cleanUpEnvironment() { fTrace.dispose(); fScriptingMarkerSource.dispose(); fScriptingMarkerSource = null; fScriptingMarkerSourceFactory.dispose(); fTraceMarkerScriptingModule = null; }

Target:
public void cleanUpEnvironment() { if (fTrace != null) { fTrace.dispose(); fTrace = null; } if (fScriptingMarkerSource != null) { fScriptingMarkerSource.dispose(); fScriptingMarkerSource = null; } if (fScriptingMarkerSourceFactory != null) { fScriptingMarkerSourceFactory.dispose(); fScriptingMarkerSourceFactory = null; } }
Source:
public void testLargeMessagePutWithDropLargeMessageDisabled() { LargeMessageSafeStore largeMessageSafeKeyValueStore = new LargeMessageSafeStore(store, storeName, false, maxMessageSize); byte[] key1 = new byte[16]; byte[] smallMessage = new byte[32]; largeMessageSafeKeyValueStore.put(key1, smallMessage); Mockito.verify(store).put(Matchers.eq(key1), Matchers.eq(smallMessage)); byte[] key2 = new byte[16]; byte[] largeMessage = new byte[maxMessageSize + 1]; try { largeMessageSafeKeyValueStore.put(key2, largeMessage); Assert.fail("The test case should have failed due to a large message being passed to the changelog, but it didn't."); } catch (SamzaException e) { Mockito.verifyZeroInteractions(store); } }

Target:
public void testLargeMessagePutWithDropLargeMessageDisabled() { LargeMessageSafeStore largeMessageSafeKeyValueStore = new LargeMessageSafeStore(store, storeName, false, maxMessageSize); byte[] key = new byte[16]; byte[] largeMessage = new byte[maxMessageSize + 1]; try { largeMessageSafeKeyValueStore.put(key, largeMessage); Assert.fail("The test case should have failed due to a large message being passed to the changelog, but it didn't."); } catch (RecordTooLargeException e) { Mockito.verifyZeroInteractions(store); } }
Source:
public String toString() { return String.format("RaftJournalSystem, in quorum: {%s}", mConf.getClusterAddresses().stream() .map(Object::toString).collect(Collectors.joining(","))); }

Target:
public String toString() { return MoreObjects.toStringHelper(this) .add("Quorum-Members", mConf.getClusterAddresses().stream() .map(Object::toString).collect(Collectors.joining(", "))) .toString(); }
Source:
public boolean hasCoverage() { CoverageResult result = getCoverageResult(); if (result == null) { return false; } return result.getCoverage(CoverageMetric.LINE) != null; }

Target:
public boolean hasCoverage() { CoverageResult result = getCoverageResult(); return result != null && result.getCoverage(CoverageMetric.LINE) != null; }
Source:
public WorkspaceDto updateEnvironment(@ApiParam("The workspace id") @PathParam("id") String id, @ApiParam("The name of the environment") @PathParam("name") String envName, @ApiParam(value = "The environment update", required = true) EnvironmentDto update, @ApiParam("New name of the environment") @QueryParam("new-name") String newEnvName) throws ServerException, BadRequestException, NotFoundException, ConflictException, ForbiddenException { requiredNotNull(update, "Environment description"); relativizeRecipeLinks(update); final WorkspaceImpl workspace = workspaceManager.getWorkspace(id); EnvironmentImpl previous = workspace.getConfig().getEnvironments().remove(envName); if (previous == null) { throw new NotFoundException(format("Workspace '%s' doesn't contain environment '%s'", id, envName)); } if (newEnvName != null && !"".equals(newEnvName)) { if (workspace.getConfig().getEnvironments().containsKey(newEnvName)) { throw new ConflictException(format("Environment '%s' already exists", newEnvName)); } envName = newEnvName; } workspace.getConfig().getEnvironments().put(envName, new EnvironmentImpl(update)); validator.validateConfig(workspace.getConfig()); return linksInjector.injectLinks(asDto(workspaceManager.updateWorkspace(id, workspace)), getServiceContext()); }

Target:
public WorkspaceDto updateEnvironment(@ApiParam("The workspace id") @PathParam("id") String id, @ApiParam("The name of the environment") @PathParam("name") String envName, @ApiParam(value = "The environment update", required = true) EnvironmentDto update, @ApiParam("New name of the environment") @QueryParam("new-name") String newEnvName) throws ServerException, BadRequestException, NotFoundException, ConflictException, ForbiddenException { requiredNotNull(update, "Environment description"); relativizeRecipeLinks(update); final WorkspaceImpl workspace = workspaceManager.getWorkspace(id); EnvironmentImpl previous = workspace.getConfig().getEnvironments().remove(envName); if (previous == null) { throw new NotFoundException(format("Workspace '%s' doesn't contain environment '%s'", id, envName)); } if (!isNullOrEmpty(newEnvName)) { if (workspace.getConfig().getEnvironments().containsKey(newEnvName)) { throw new ConflictException(format("Environment '%s' already exists in '%s' workspace", newEnvName, workspace.getId())); } envName = newEnvName; } workspace.getConfig().getEnvironments().put(envName, new EnvironmentImpl(update)); validator.validateConfig(workspace.getConfig()); return linksInjector.injectLinks(asDto(workspaceManager.updateWorkspace(id, workspace)), getServiceContext()); }
Source:
public boolean isResolved() { for (Dependency dep : dependencies) { if (!dep.isResolved()) return false; } return true; }

Target:
public boolean isResolved() { return dependencies.isResolved(); }
Source:
public void testRemoveLocalStorage() throws Exception { setUpGetConnection(2); setUpGetEntityExpectations(GUIDS[0], 2, getEntity(0, StorageType.LOCALFS)); setUriInfo(setUpActionExpectations(VdcActionType.RemoveStorageDomain, RemoveStorageDomainParameters.class, new String[] { "StorageDomainId"}, new Object[] { GUIDS[0] }, true, true)); collection.remove(GUIDS[0].toString()); }

Target:
public void testRemoveLocalStorage() throws Exception { setUpGetConnection(2); setUpGetEntityExpectations(GUIDS[0], 2, getEntity(0, StorageType.LOCALFS)); setUriInfo(setUpActionExpectations(VdcActionType.RemoveStorageDomain, RemoveStorageDomainParameters.class, new String[] { "StorageDomainId"}, new Object[] { GUIDS[0] }, true, true)); verifyRemove(collection.remove(GUIDS[0].toString())); }
Source:
public CloseableIterator<NodeItem> getFirehose(int limit, String afterItemId, boolean isAdmin) throws NodeStoreException { PreparedStatement stmt = null; Date beforeDate = null; if (afterItemId != null) { beforeDate = getNodeItem(GlobalItemIDImpl.fromBuddycloudString( afterItemId)).getUpdated(); } else { beforeDate = new Date(); } if (limit < 0) { throw new IllegalArgumentException( "Invalid value for parameter count: " + limit); } String accessModel = "open"; if (true == isAdmin) accessModel = "%"; try { stmt = conn.prepareStatement(dialect .selectItemsForLocalNodesBeforeDate()); stmt.setTimestamp(1, new java.sql.Timestamp(beforeDate.getTime())); stmt.setString(2, Conf.ACCESS_MODEL); stmt.setString(3, accessModel); String serverDomain = Configuration.getInstance().getProperty( Configuration.CONFIGURATION_SERVER_DOMAIN); String serverTopicsDomain = Configuration.getInstance().getProperty( Configuration.CONFIGURATION_SERVER_TOPICS_DOMAIN); stmt.setString(4, serverDomain == null ? "%" : "%@" + serverDomain + "%"); stmt.setString(5, serverTopicsDomain == null ? "%" : "%@" + serverTopicsDomain + "%"); stmt.setInt(6, limit); java.sql.ResultSet rs = stmt.executeQuery(); LinkedList<NodeItem> results = new LinkedList<NodeItem>(); while (rs.next()) { results.push(new NodeItemImpl(rs.getString(1), rs.getString(2), rs.getTimestamp(3), rs.getString(4), rs.getString(5), rs.getTimestamp(6))); } return new ClosableIteratorImpl<NodeItem>(results.iterator()); } catch (SQLException e) { throw new NodeStoreException(e); } finally { close(stmt); } }

Target:
public CloseableIterator<NodeItem> getFirehose(int limit, String afterItemId, boolean isAdmin) throws NodeStoreException { PreparedStatement stmt = null; Date beforeDate = null; if (afterItemId != null) { beforeDate = getNodeItem(GlobalItemIDImpl.fromBuddycloudString( afterItemId)).getUpdated(); } else { beforeDate = new Date(); } if (limit < 0) { throw new IllegalArgumentException( "Invalid value for parameter count: " + limit); } String accessModel = "open"; if (true == isAdmin) accessModel = "%"; try { stmt = conn.prepareStatement(dialect .selectItemsForLocalNodesBeforeDate()); stmt.setTimestamp(1, new java.sql.Timestamp(beforeDate.getTime())); stmt.setString(2, Conf.ACCESS_MODEL); stmt.setString(3, accessModel); String serverDomain = Configuration.getInstance().getServerDomain(); String serverTopicsDomain = Configuration.getInstance().getServerTopicsDomain(); stmt.setString(4, serverDomain == null ? "%" : "%@" + serverDomain + "%"); stmt.setString(5, serverTopicsDomain == null ? "%" : "%@" + serverTopicsDomain + "%"); stmt.setInt(6, limit); java.sql.ResultSet rs = stmt.executeQuery(); LinkedList<NodeItem> results = new LinkedList<NodeItem>(); while (rs.next()) { results.push(new NodeItemImpl(rs.getString(1), rs.getString(2), rs.getTimestamp(3), rs.getString(4), rs.getString(5), rs.getTimestamp(6))); } return new ClosableIteratorImpl<NodeItem>(results.iterator()); } catch (SQLException e) { throw new NodeStoreException(e); } finally { close(stmt); } }
Source:
public void abort(String reason, Throwable cause) { if (isAborted()) { LOG.info("Abort called but server already aborted; by-passing; abort invoked because {}", reason, cause); return; } String msg = "***** ABORTING region server " + this + ": " + reason + " *****"; if (cause != null) { LOG.error(HBaseMarkers.FATAL, msg, cause); } else { LOG.error(HBaseMarkers.FATAL, msg); } setAbortRequested(); LOG.error(HBaseMarkers.FATAL, "RegionServer abort: loaded coprocessors are: " + CoprocessorHost.getLoadedCoprocessors()); try { LOG.info("Dump of metrics as JSON on abort: " + DumpRegionServerMetrics.dumpMetrics()); } catch (MalformedObjectNameException | IOException e) { LOG.warn("Failed dumping metrics", e); } try { if (cause != null) { msg += "\nCause:\n" + Throwables.getStackTraceAsString(cause); } RegionServerStatusService.BlockingInterface rss = rssStub; if (rss != null && this.serverName != null) { ReportRSFatalErrorRequest.Builder builder = ReportRSFatalErrorRequest.newBuilder(); builder.setServer(ProtobufUtil.toServerName(this.serverName)); builder.setErrorMessage(msg); rss.reportRSFatalError(null, builder.build()); } } catch (Throwable t) { LOG.warn("Unable to report fatal error to master", t); } scheduleAbortTimer(); stop(reason, true, null); }

Target:
public void abort(String reason, Throwable cause) { String msg = "***** ABORTING region server " + this + ": " + reason + " *****"; if (cause != null) { LOG.error(HBaseMarkers.FATAL, msg, cause); } else { LOG.error(HBaseMarkers.FATAL, msg); } setAbortRequested(); LOG.error(HBaseMarkers.FATAL, "RegionServer abort: loaded coprocessors are: " + CoprocessorHost.getLoadedCoprocessors()); try { LOG.info("Dump of metrics as JSON on abort: " + DumpRegionServerMetrics.dumpMetrics()); } catch (MalformedObjectNameException | IOException e) { LOG.warn("Failed dumping metrics", e); } try { if (cause != null) { msg += "\nCause:\n" + Throwables.getStackTraceAsString(cause); } RegionServerStatusService.BlockingInterface rss = rssStub; if (rss != null && this.serverName != null) { ReportRSFatalErrorRequest.Builder builder = ReportRSFatalErrorRequest.newBuilder(); builder.setServer(ProtobufUtil.toServerName(this.serverName)); builder.setErrorMessage(msg); rss.reportRSFatalError(null, builder.build()); } } catch (Throwable t) { LOG.warn("Unable to report fatal error to master", t); } scheduleAbortTimer(); stop(reason, true, null); }
Source:
private void electLeaders() { try { LOG.debug("Started leader election: " + System.currentTimeMillis()); List<KinesisClientLease> leases = leaseManager.listLeases(); List<String> uniqueHosts = leases.stream().map(KinesisClientLease::getLeaseOwner) .filter(owner -> owner != null).distinct().sorted().collect(Collectors.toList()); Collections.shuffle(uniqueHosts, new Random(DETERMINISTIC_SHUFFLE_SEED)); int numShardSyncWorkers = Math.min(uniqueHosts.size(), numPeriodicShardSyncWorkers); readWriteLock.writeLock().lock(); leaders = new HashSet<>(uniqueHosts.subList(0, numShardSyncWorkers)); LOG.debug("Elected leaders: " + String.join(", ", leaders)); LOG.debug("Completed leader election: " + System.currentTimeMillis()); } catch (DependencyException | InvalidStateException | ProvisionedThroughputException e) { LOG.error("Exception occurred while trying to fetch all leases for leader election", e); } catch (Throwable t) { LOG.error("Unknown exception during leader election.", t); } finally { readWriteLock.writeLock().unlock(); } }

Target:
private void electLeaders() { try { LOG.debug("Started leader election at: " + Instant.now()); List<KinesisClientLease> leases = leaseManager.listLeases(); List<String> uniqueHosts = leases.stream().map(KinesisClientLease::getLeaseOwner) .filter(owner -> owner != null).distinct().sorted().collect(Collectors.toList()); Collections.shuffle(uniqueHosts, new Random(DETERMINISTIC_SHUFFLE_SEED)); int numShardSyncWorkers = Math.min(uniqueHosts.size(), numPeriodicShardSyncWorkers); readWriteLock.writeLock().lock(); leaders = new HashSet<>(uniqueHosts.subList(0, numShardSyncWorkers)); LOG.info("Elected leaders: " + String.join(", ", leaders)); LOG.debug("Completed leader election at: " + System.currentTimeMillis()); } catch (DependencyException | InvalidStateException | ProvisionedThroughputException e) { LOG.error("Exception occurred while trying to fetch all leases for leader election", e); } catch (Throwable t) { LOG.error("Unknown exception during leader election.", t); } finally { readWriteLock.writeLock().unlock(); } }
Source:
public static void waitForFxEvents(int attemptsCount, int pulses) { if (Platform.isFxApplicationThread()) { throw new RuntimeException("Waiting for FxEvents on the Fx-Thread is just not possible. " + "Call the root on the test Thread!"); } FxConditionWaiter waiter = new FxConditionWaiter( new FxEventCounter(attemptsCount), new FxRenderCounter(pulses)); waiter.waitFor(); }

Target:
public static void waitForFxEvents(int attemptsCount, int pulses) { waitForFxEvents(attemptsCount, SEMAPHORE_SLEEP_IN_MILLIS, pulses, FX_TIMEOUT_CONDITION); }
Source:
public void clickOnTool(String toolName) { jQueryClick( waitForElementByCss(toolbarTool.replace(toolNameReplacement, toolName)) ); PageObjectLogging.log("clickOnTool", toolName + " clicked on customized toolbar", true); }

Target:
public void clickOnTool(String toolName) { jQueryClick( waitForElementByCss(String.format(toolbarToolCss, toolName)) ); PageObjectLogging.log("clickOnTool", toolName + " clicked on customized toolbar", true); }
Source:
protected PrepareStoreCopyResponse unmarshal0( ReadableChannel channel ) throws IOException, EndOfStreamException { int ordinal = channel.getInt(); Status status = Status.values()[ordinal]; Long transactionId = channel.getLong(); File[] files = unmarshalFiles( channel ); SchemaIndexProvider.Descriptor[] indexDescriptors = unmarshalIndexDescriptors( channel ); return new PrepareStoreCopyResponse( files, indexDescriptors, transactionId, status ); }

Target:
protected PrepareStoreCopyResponse unmarshal0( ReadableChannel channel ) throws IOException { int ordinal = channel.getInt(); Status status = Status.values()[ordinal]; Long transactionId = channel.getLong(); File[] files = unmarshalFiles( channel ); IndexDescriptor[] indexDescriptors = unmarshalIndexProviderDescriptors( channel ); return new PrepareStoreCopyResponse( files, indexDescriptors, transactionId, status ); }
Source:
protected Map<DyeColor, Boolean> calculateRedstoneOutputs() { Map<DyeColor, Boolean> map = new EnumMap<>(DyeColor.class); for(int slot = 0; slot < 9; slot++) if(!inventory.get(slot).isEmpty()) { DyeColor dye = redstoneColors.get(slot); Boolean ex = map.get(dye); map.put(dye, ex!=null?ex && isFilterMatched(slot): isFilterMatched(slot)); } return map; }

Target:
protected Set<DyeColor> calculateRedstoneOutputs() { Map<DyeColor, Boolean> map = new EnumMap<>(DyeColor.class); for(int slot = 0; slot < 9; slot++) if(!inventory.get(slot).isEmpty()) { DyeColor dye = redstoneColors.get(slot); Boolean ex = map.get(dye); map.put(dye, ex!=null?ex&&isFilterMatched(slot): isFilterMatched(slot)); } return map.keySet().stream().filter(map::get).collect(Collectors.toSet()); }
Source:
public void stop() throws Throwable { try { serverChannel.close().sync(); } finally { bossGroup.shutdownGracefully(); workerGroup.shutdownGracefully(); } }

Target:
public void stop() throws Throwable { workerGroup.shutdownGracefully().sync(); }
Source:
private int getEndBucketPosition(final double position) { return Math.min(model.getBucketCache().getNumberBuckets(), model .getBucketCache().bucketPercentageStartPosition(position)); }

Target:
private int getEndBucketPosition(final double position) { return Math.min(model.getBucketCache().getNumberBuckets(), model .getBucketCache().getBucketPosition(position)); }
Source:
public String toString() { if (object != null && StringUtils.isNotEmpty(object.toString())) { return StringEscapeUtils.escapeHtml(object.toString().replace('\n', '_').replace('\r', '_')); } return ""; }

Target:
public String toString() { if (object == null) { return ""; } final String objStr = object.toString(); if (StringUtils.isEmpty(objStr)) { return ""; } return StringEscapeUtils.escapeHtml(objStr.replace('\n', '_').replace('\r', '_')); }
Source:
protected URI getDedicatedRepResourceURI(DRepresentation representation, Resource airdResource) { int count = 0; ResourceSet resourceSet = airdResource.getResourceSet(); URI repUri = createRepURI(airdResource, representation, count++); while (resourceSet.getResource(repUri, false) != null) { repUri = createRepURI(airdResource, representation, count++); } return repUri; }

Target:
protected URI getDedicatedRepResourceURI(DRepresentation representation, Resource airdResource) { int count = 0; ResourceSet resourceSet = airdResource.getResourceSet(); URI repUri = createRepURI(airdResource, representation, count++); while (resourceSet.getResource(repUri, false) != null || existsResource(repUri, resourceSet)) { repUri = createRepURI(airdResource, representation, count++); } return repUri; }
Source:
public Map<String, String> getTraceProperties() { Map<String, String> properties = new HashMap<>(); properties.putAll(fTrace.getEnvironment()); properties.put(CLOCK_OFFSET, Long.toUnsignedString(fTrace.getOffset())); properties.put(Messages.CtfTmfTrace_HostID, getHostId()); return properties; }

Target:
public Map<String, String> getTraceProperties() { Map<String, String> properties = new HashMap<>(); properties.putAll(fTrace.getEnvironment()); properties.put(CLOCK_OFFSET, Long.toString(fTrace.getOffset())); properties.put(Messages.CtfTmfTrace_HostID, getHostId()); return properties; }
Source:
final ImageReaderProxy setupImageReader(Size resolution) { if (mCaptureProcessor != null) { ProcessingImageReader processingImageReader = new ProcessingImageReader( resolution.getWidth(), resolution.getHeight(), getImageFormat(), MAX_IMAGES, mHandler, mCaptureBundle, mCaptureProcessor); mMetadataMatchingCaptureCallback = processingImageReader.getCameraCaptureCallback(); mImageReader = processingImageReader; } else { MetadataImageReader metadataImageReader = new MetadataImageReader( resolution.getWidth(), resolution.getHeight(), getImageFormat(), MAX_IMAGES, mHandler); mMetadataMatchingCaptureCallback = metadataImageReader.getCameraCaptureCallback(); mImageReader = metadataImageReader; } mImageReader.setOnImageAvailableListener( new ImageReaderProxy.OnImageAvailableListener() { @Override public void onImageAvailable(ImageReaderProxy imageReader) { ImageCaptureRequest imageCaptureRequest = mImageCaptureRequests.peek(); if (imageCaptureRequest != null) { ImageProxy image = null; try { image = imageReader.acquireLatestImage(); } catch (IllegalStateException e) { Log.e(TAG, "Failed to acquire latest image.", e); } finally { if (image != null) { mImageCaptureRequests.poll(); imageCaptureRequest.dispatchImage(image); ImageCapture.this .issueImageCaptureRequests(); } } } else { ImageProxy image = null; try { image = imageReader.acquireLatestImage(); } catch (IllegalStateException e) { Log.e(TAG, "Failed to acquire latest image.", e); } finally { if (image != null) { image.close(); } } } } }, mMainHandler); return mImageReader; }

Target:
ImageReaderProxy setupImageReader(Size resolution) { if (mCaptureProcessor != null) { ProcessingImageReader processingImageReader = new ProcessingImageReader( resolution.getWidth(), resolution.getHeight(), getImageFormat(), MAX_IMAGES, mHandler, mCaptureBundle, mCaptureProcessor); mMetadataMatchingCaptureCallback = processingImageReader.getCameraCaptureCallback(); mImageReader = processingImageReader; } else { MetadataImageReader metadataImageReader = new MetadataImageReader(resolution.getWidth(), resolution.getHeight(), getImageFormat(), MAX_IMAGES, mHandler); mMetadataMatchingCaptureCallback = metadataImageReader.getCameraCaptureCallback(); mImageReader = metadataImageReader; } mImageReader.setOnImageAvailableListener( new ImageReaderProxy.OnImageAvailableListener() { @Override public void onImageAvailable(ImageReaderProxy imageReader) { ImageCaptureRequest imageCaptureRequest = mImageCaptureRequests.peek(); if (imageCaptureRequest != null) { ImageProxy image = null; try { image = imageReader.acquireLatestImage(); } catch (IllegalStateException e) { Log.e(TAG, "Failed to acquire latest image.", e); } finally { if (image != null) { mImageCaptureRequests.poll(); imageCaptureRequest.dispatchImage(image); ImageCapture.this.issueImageCaptureRequests(); } } } else { ImageProxy image = null; try { image = imageReader.acquireLatestImage(); } catch (IllegalStateException e) { Log.e(TAG, "Failed to acquire latest image.", e); } finally { if (image != null) { image.close(); } } } } }, mMainHandler); return mImageReader; }
Source:
static ShowSourceForm pull(String action) { return new ShowSourceForm(action, Operation.PULL); }

Target:
static ShowSourceForm pull(String action) { return new ShowSourceForm(action, true); }
Source:
public void handleEvent(ITmfEvent ev) { String eventName = ev.getName(); IKernelAnalysisEventLayout eventLayout = getProvider().getEventLayout(ev.getTrace()); if (eventName.equals(eventLayout.eventSchedSwitch())) { handleSchedSwitch(ev); } else if (eventName.equals(eventLayout.eventSoftIrqEntry())) { handleSoftirqEntry(ev); } else if (eventName.equals(TcpEventStrings.INET_SOCK_LOCAL_IN) || eventLayout.eventsNetworkReceive().contains(eventName)) { handleInetSockLocalIn(ev); } else if (eventName.equals(TcpEventStrings.INET_SOCK_LOCAL_OUT) || eventLayout.eventsNetworkSend().contains(eventName)) { handleInetSockLocalOut(ev); } else if (isWakeupEvent(ev)) { handleSchedWakeup(ev); } }

Target:
public void handleEvent(ITmfEvent ev) { String eventName = ev.getName(); IKernelAnalysisEventLayout eventLayout = getProvider().getEventLayout(ev.getTrace()); if (eventName.equals(eventLayout.eventSchedSwitch())) { handleSchedSwitch(ev); } else if (eventName.equals(eventLayout.eventSoftIrqEntry())) { handleSoftirqEntry(ev); } else if (eventLayout.eventsNetworkReceive().contains(eventName) || eventName.equals(TcpEventStrings.INET_SOCK_LOCAL_IN)) { handleInetSockLocalIn(ev); } else if (eventLayout.eventsNetworkSend().contains(eventName) || eventName.equals(TcpEventStrings.INET_SOCK_LOCAL_OUT)) { handleInetSockLocalOut(ev); } else if (isWakeupEvent(ev)) { handleSchedWakeup(ev); } }
Source:
protected AbstractSerializationService(AbstractSerializationService prototype) { this.version = prototype.version; this.inputOutputFactory = prototype.inputOutputFactory; this.classLoader = prototype.classLoader; this.managedContext = prototype.managedContext; this.globalPartitioningStrategy = prototype.globalPartitioningStrategy; this.outputBufferSize = prototype.outputBufferSize; this.nullSerializerAdapter = prototype.nullSerializerAdapter; this.bufferPoolThreadLocal = new BufferPoolThreadLocal(this, new BufferPoolFactoryImpl(), HazelcastInstanceNotActiveException::new); }

Target:
protected AbstractSerializationService(AbstractSerializationService prototype) { this.inputOutputFactory = prototype.inputOutputFactory; this.version = prototype.version; this.classLoader = prototype.classLoader; this.managedContext = prototype.managedContext; this.globalPartitioningStrategy = prototype.globalPartitioningStrategy; this.outputBufferSize = prototype.outputBufferSize; this.notActiveExceptionSupplier = prototype.notActiveExceptionSupplier; this.bufferPoolThreadLocal = new BufferPoolThreadLocal(this, new BufferPoolFactoryImpl(), prototype.notActiveExceptionSupplier); this.nullSerializerAdapter = prototype.nullSerializerAdapter; }
Source:
@Override public PropertyArgs parseArguments0(CommandArgIterator argIter) { String name = null; while (argIter.hasNextSubArg() && name == null) { String optName = argIter.nextArg("Expecting " + PropertyArgs.NAME); if (PropertyArgs.NAME.equals(optName)) name = argIter.nextArg("property name"); } if (name == null) { throw new IllegalArgumentException("Property name is not specified. " + "Please the option: --name <property_name>"); } return new PropertyArgs(name, null, PropertyArgs.Action.GET); }

Target:
@Override public PropertyArgs parseArguments0(CommandArgIterator argIter) { String name = null; while (argIter.hasNextSubArg() && name == null) { String optName = argIter.nextArg("Expecting " + PropertyArgs.NAME); if (PropertyArgs.NAME.equals(optName)) name = argIter.nextArg("property name"); } if (name == null) { throw new IllegalArgumentException("Property name is not specified. " + "Please use the option: --name <property_name>"); } return new PropertyArgs(name, null, PropertyArgs.Action.GET); }
Source:
public ModelAccessor getModelAccessor() { ModelAccessor modelAccessor = null; if (Platform.isRunning()) { modelAccessor = SiriusPlugin.getDefault().getModelAccessorRegistry().getModelAccessor(transactionalEditingDomain.getResourceSet()); } return modelAccessor; }

Target:
public ModelAccessor getModelAccessor() { return SiriusPlugin.getDefault().getModelAccessorRegistry().getModelAccessor(transactionalEditingDomain.getResourceSet()); }
Source:
public boolean isLeader() { HazelcastInstance hazelcastInstance = BPELServiceComponent.getHazelcastInstance(); Member leader = hazelcastInstance.getCluster().getMembers().iterator().next(); if (leader.localMember()) { log.debug("ODEClusterImpl#isLeader: true"); return true; } log.debug("#ODEClusterImpl#isLeader: false"); return false; }

Target:
public boolean isLeader() { HazelcastInstance hazelcastInstance = BPELServiceComponent.getHazelcastInstance(); Member leader = hazelcastInstance.getCluster().getMembers().iterator().next(); if (leader.localMember()) { if (log.isDebugEnabled()) { log.debug("ODEClusterImpl#isLeader: true"); } return true; } if (log.isDebugEnabled()) { log.debug("#ODEClusterImpl#isLeader: false"); } return false; }