auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void addReplicatedInstance(WorkflowExecutionContext context) throws FalconException { String feedName = context.getOutputFeedNames(); String feedInstanceDataPath = context.getOutputFeedInstancePaths(); String targetClusterName = context.getClusterName(); LOG.info("Computing feed instance for : name= path= {}, in cluster: {}", feedName, feedInstanceDataPath, targetClusterName); String feedInstanceName = getFeedInstanceName(feedName, targetClusterName, feedInstanceDataPath, context.getNominalTimeAsISO8601()); Vertex feedInstanceVertex = addFeedInstance( feedInstanceName, context, feedName, context.getSrcClusterName()); Map<RelationshipProperty, String> properties = new HashMap<RelationshipProperty, String>(); properties.put(RelationshipProperty.TIMESTAMP, context.getTimeStampAsISO8601()); addInstanceToEntity(feedInstanceVertex, targetClusterName, RelationshipType.CLUSTER_ENTITY, RelationshipLabel.FEED_CLUSTER_REPLICATED_EDGE, properties); addCounters(feedInstanceVertex, context); }

Target:
public void addReplicatedInstance(WorkflowExecutionContext context) throws FalconException { String feedName = context.getOutputFeedNames(); String feedInstanceDataPath = context.getOutputFeedInstancePaths(); String targetClusterName = context.getClusterName(); LOG.info("Computing feed instance for : name= path= {}, in cluster: {}", feedName, feedInstanceDataPath, targetClusterName); String feedInstanceName = getFeedInstanceName(feedName, targetClusterName, feedInstanceDataPath, context.getNominalTimeAsISO8601()); Vertex feedInstanceVertex = addFeedInstance( feedInstanceName, context, feedName, context.getSrcClusterName()); Map<RelationshipProperty, String> properties = edgePropertiesForIndexing(context); properties.put(RelationshipProperty.TIMESTAMP, context.getTimeStampAsISO8601()); addInstanceToEntity(feedInstanceVertex, targetClusterName, RelationshipType.CLUSTER_ENTITY, RelationshipLabel.FEED_CLUSTER_REPLICATED_EDGE, properties); addCounters(feedInstanceVertex, context); }
Source:
void readLogFile() { final Display display = getSite().getShell().getDisplay(); setContentDescription(Messages.LogView_readLog_loading); CompletableFuture.supplyAsync(() -> { List<LogEntry> result = new ArrayList<>(); LogSession lastLogSession = LogReader.parseLogFile(this.fInputFile, getLogMaxTailSize(), result, this.fMemento); if (lastLogSession != null && (lastLogSession.getDate() == null || isEclipseStartTime(lastLogSession.getDate()))) { currentSession = lastLogSession; } else { currentSession = null; } return result; }).thenAccept(entries -> { elements.clear(); groups.clear(); group(entries); limitEntriesCount(); display.asyncExec(() -> { setContentDescription(getTitleSummary()); fFilteredTree.getViewer().refresh(); fFilteredTree.setEnabled(true); }); }); }

Target:
void readLogFile() { final Display display = getSite().getShell().getDisplay(); display.asyncExec(() -> setContentDescription(Messages.LogView_readLog_loading)); fetchLogEntries().thenAccept(this::updateLogViewer); }
Source:
public CoreNode(HTConfig config, int seqNumber, int parentSeqNumber, long start) { super(config, seqNumber, parentSeqNumber, start); this.nbChildren = 0; int size = config.getMaxChildren(); this.children = new int[size]; this.childStart = new long[size]; this.childEnd = new long[size]; for(int i = 0; i<size; i++){ this.childEnd[i] = Long.MAX_VALUE; } }

Target:
public CoreNode(HTConfig config, int seqNumber, int parentSeqNumber, long start) { super(config, seqNumber, parentSeqNumber, start); this.nbChildren = 0; int size = config.getMaxChildren(); this.children = new int[size]; this.childStart = new long[size]; this.childEnd = new long[size]; for (int i = 0; i < size; i++) { childEnd[i] = Long.MAX_VALUE; } }
Source:
private boolean matchesPattern(String projectName, String pattern) { boolean match = false; switch (getPatternType(pattern)) { case REGEX: match = projectName.matches(pattern); break; case WILDCARD: match = projectName.startsWith(pattern.substring(0, pattern.length() - 1)); break; default: match = projectName.equals(pattern); } return match; }

Target:
private boolean matchesPattern(String projectName, String pattern) { boolean match = false; switch (getPatternType(pattern)) { case REGEX: match = projectName.matches(pattern); break; case WILDCARD: match = projectName.startsWith(pattern.substring(0, pattern.length() - 1)); break; case EXACT_MATCH: match = projectName.equals(pattern); } return match; }
Source:
public void setSiteIconMediaId(int siteIconMediaId) { if (mSettings.siteIconMediaId != siteIconMediaId) { mSettings.siteIconMediaId = siteIconMediaId; } }

Target:
public void setSiteIconMediaId(int siteIconMediaId) { mSettings.siteIconMediaId = siteIconMediaId; }
Source:
public void testVariousServerErrorCodesForThreeParallelism() throws Exception { initialize(3, true); ServerErrorCode[] serverErrorCodes = new ServerErrorCode[9]; serverErrorCodes[0] = ServerErrorCode.Blob_Not_Found; serverErrorCodes[1] = ServerErrorCode.Data_Corrupt; serverErrorCodes[2] = ServerErrorCode.IO_Error; serverErrorCodes[3] = ServerErrorCode.Partition_Unknown; serverErrorCodes[4] = ServerErrorCode.Disk_Unavailable; serverErrorCodes[5] = ServerErrorCode.No_Error; serverErrorCodes[6] = ServerErrorCode.Data_Corrupt; serverErrorCodes[7] = ServerErrorCode.Unknown_Error; serverErrorCodes[8] = ServerErrorCode.Disk_Unavailable; writeBlobRecordToServers(serverErrorCodes); future = router.deleteBlob(blobIdString, new ClientCallback()); try { future.get(); fail("Deletion should be unsuccessful. Exception is expected."); } catch (Exception e) { assertEquals("RouterErrorCode should be AmbryUnavailable", RouterErrorCode.AmbryUnavailable, ((RouterException) e.getCause()).getErrorCode()); } assertCloseCleanup(); }

Target:
public void testVariousServerErrorCodesForThreeParallelism() throws Exception { assertCloseCleanup(); Properties props = getNonBlockingRouterProperties(); props.setProperty("router.delete.request.parallelism", "3"); VerifiableProperties vProps = new VerifiableProperties(props); router = new NonBlockingRouter(new RouterConfig(vProps), new NonBlockingRouterMetrics(new MetricRegistry()), new MockNetworkClientFactory(vProps, mockSelectorState, MAX_PORTS_PLAIN_TEXT, MAX_PORTS_SSL, CHECKOUT_TIMEOUT_MS, serverLayout, mockTime), new LoggingNotificationSystem(), clusterMap, mockTime); ServerErrorCode[] serverErrorCodes = new ServerErrorCode[9]; serverErrorCodes[0] = ServerErrorCode.Blob_Not_Found; serverErrorCodes[1] = ServerErrorCode.Data_Corrupt; serverErrorCodes[2] = ServerErrorCode.IO_Error; serverErrorCodes[3] = ServerErrorCode.Partition_Unknown; serverErrorCodes[4] = ServerErrorCode.Disk_Unavailable; serverErrorCodes[5] = ServerErrorCode.No_Error; serverErrorCodes[6] = ServerErrorCode.Data_Corrupt; serverErrorCodes[7] = ServerErrorCode.Unknown_Error; serverErrorCodes[8] = ServerErrorCode.Disk_Unavailable; presetServerErrorCode(serverErrorCodes); future = router.deleteBlob(blobIdString, new ClientCallback()); try { future.get(); fail("Deletion should be unsuccessful. Exception is expected."); } catch (Exception e) { assertEquals("RouterErrorCode should be AmbryUnavailable", RouterErrorCode.AmbryUnavailable, ((RouterException) e.getCause()).getErrorCode()); } }
Source:
public boolean configure(final String name, final Map<String, Object> xmlParams) throws ConfigurationException { _serverId = _msServer.getId(); Map<String, String> params = new HashMap<String, String>(); params = _configDao.getConfiguration(Long.toHexString(_serverId), xmlParams); String value = params.get(Config.HAWorkers.key()); final int count = NumbersUtil.parseInt(value, 1); _workers = new WorkerThread[count]; for (int i = 0; i < _workers.length; i++) { _workers[i] = new WorkerThread("HA-Worker-" + i); } value = params.get("force.ha"); _forceHA = Boolean.parseBoolean(value); _timeToSleep = TimeToSleep.value() * SECONDS_TO_MILLISECONDS_FACTOR; _maxRetries = MaxRetries.value(); _timeBetweenFailures = TimeBetweenFailures.value() * SECONDS_TO_MILLISECONDS_FACTOR; _timeBetweenCleanups = TimeBetweenCleanup.value(); value = params.get("stop.retry.interval"); _stopRetryInterval = NumbersUtil.parseInt(value, STOP_RETRY_INTERVAL_SECONDS); value = params.get("restart.retry.interval"); _restartRetryInterval = NumbersUtil.parseInt(value, RESTART_RETRY_INTERVAL_SECONDS); value = params.get("investigate.retry.interval"); _investigateRetryInterval = NumbersUtil.parseInt(value, INVESTIGATE_RETRY_INTERVAL_SECONDS); value = params.get("migrate.retry.interval"); _migrateRetryInterval = NumbersUtil.parseInt(value, MIGRATE_RETRY_INTERVAL_SECONDS); _instance = params.get("instance"); if (_instance == null) { _instance = "VMOPS"; } _haTag = params.get("ha.tag"); _haDao.releaseWorkItems(_serverId); _stopped = true; _executor = Executors.newScheduledThreadPool(count, new NamedThreadFactory("HA")); return true; }

Target:
public boolean configure(final String name, final Map<String, Object> xmlParams) throws ConfigurationException { _serverId = _msServer.getId(); final Map<String, String> params = _configDao.getConfiguration(Long.toHexString(_serverId), xmlParams); final int count = HAWorkers.value(); _workers = new WorkerThread[count]; for (int i = 0; i < _workers.length; i++) { _workers[i] = new WorkerThread("HA-Worker-" + i); } _forceHA = ForceHA.value(); _timeToSleep = TimeToSleep.value() * SECONDS_TO_MILLISECONDS_FACTOR; _maxRetries = MaxRetries.value(); _timeBetweenFailures = TimeBetweenFailures.value() * SECONDS_TO_MILLISECONDS_FACTOR; _timeBetweenCleanups = TimeBetweenCleanup.value(); _stopRetryInterval = StopRetryInterval.value(); _restartRetryInterval = RestartRetryInterval.value(); _investigateRetryInterval = InvestigateRetryInterval.value(); _migrateRetryInterval = MigrateRetryInterval.value(); _instance = params.get("instance"); if (_instance == null) { _instance = "VMOPS"; } _haTag = params.get("ha.tag"); _haDao.releaseWorkItems(_serverId); _stopped = true; _executor = Executors.newScheduledThreadPool(count, new NamedThreadFactory("HA")); return true; }
Source:
private void initExhibitor() throws Exception { final RetryPolicy retryPolicy = new ExponentialBackoffRetry(EXHIBITOR_RETRY_TIME, EXHIBITOR_RETRY_MAX); final Collection<String> exhibitorHosts = Arrays.asList(exhibitorAddresses.split("\\s*,\\s*")); final Exhibitors exhibitors = new Exhibitors(exhibitorHosts, exhibitorPort, () -> zookeeperBrokers + zookeeperKafkaNamespace); final ExhibitorRestClient exhibitorRestClient = new DefaultExhibitorRestClient(); final ExhibitorEnsembleProvider ensembleProvider = new ExhibitorEnsembleProvider(exhibitors, exhibitorRestClient, "/exhibitor/v1/cluster/list", EXHIBITOR_POLLING_MS, retryPolicy); ensembleProvider.pollForInitialEnsemble(); zooKeeper = CuratorFrameworkFactory.builder() .ensembleProvider(ensembleProvider) .retryPolicy(retryPolicy) .build(); zooKeeper.start(); }

Target:
private void initExhibitor() throws Exception { final RetryPolicy retryPolicy = new ExponentialBackoffRetry(EXHIBITOR_RETRY_TIME, EXHIBITOR_RETRY_MAX); final EnsembleProvider ensembleProvider; if (exhibitorAddresses != null) { final Collection<String> exhibitorHosts = Arrays.asList(exhibitorAddresses.split("\\s*,\\s*")); final Exhibitors exhibitors = new Exhibitors(exhibitorHosts, exhibitorPort, () -> zookeeperBrokers + zookeeperKafkaNamespace); final ExhibitorRestClient exhibitorRestClient = new DefaultExhibitorRestClient(); ensembleProvider = new ExhibitorEnsembleProvider(exhibitors, exhibitorRestClient, "/exhibitor/v1/cluster/list", EXHIBITOR_POLLING_MS, retryPolicy); ((ExhibitorEnsembleProvider) ensembleProvider).pollForInitialEnsemble(); } else { ensembleProvider = new FixedEnsembleProvider(zookeeperBrokers + zookeeperKafkaNamespace); } zooKeeper = CuratorFrameworkFactory.builder() .ensembleProvider(ensembleProvider) .retryPolicy(retryPolicy) .build(); zooKeeper.start(); }
Source:
public boolean apply(Game game, Ability source) { List<Permanent> permanents = game.getBattlefield().getActivePermanents(source.getControllerId(), game); for (Permanent p : permanents) { if (p.isLand()) { p.sacrifice(source.getSourceId(), game); } } return true; }

Target:
public boolean apply(Game game, Ability source) { Iterator<Permanent> permanents = game.getBattlefield().getActivePermanents(source.getControllerId(), game).iterator(); while (permanents.hasNext()) { Permanent p = permanents.next(); if (p.isLand()) { p.sacrifice(source.getSourceId(), game); } } return true; }
Source:
protected Collection<String> defaultSuppressionAnnotations() { Collection<String> defaultValues = new HashSet<>(); defaultValues.add("javax.inject.Inject"); return defaultValues; }

Target:
protected Collection<String> defaultSuppressionAnnotations() { return Arrays.asList("javax.inject.Inject"); }
Source:
public abstract FoundIndication scan(Run build) throws IOException; public abstract FoundIndication scan(Run build, PrintStream buildLog); protected FoundIndication scanOneFile(Run build, BufferedReader reader, String currentFile) throws IOException { TimerThread timerThread = new TimerThread(Thread.currentThread(), TIMEOUT_LINE); FoundIndication foundIndication = null; boolean found = false; final Pattern pattern = indication.getPattern(); String line; int currentLine = 1; timerThread.start(); try { long startTime = System.currentTimeMillis(); while ((line = reader.readLine()) != null) { try { if (pattern.matcher(new InterruptibleCharSequence(line)).matches()) { found = true; break; } } catch (RuntimeException e) { if (e.getCause() instanceof InterruptedException) { logger.warning("Timeout scanning for indication '" + indication.toString() + "' for file " + currentFile + ":" + currentLine); } else { throw e; } } currentLine++; timerThread.touch(); if (System.currentTimeMillis() - startTime > TIMEOUT_FILE) { logger.warning("File timeout scanning for indication '" + indication.toString() + "' for file " + currentFile); break; } } if (found) { String cleanLine = ConsoleNote.removeNotes(line); foundIndication = new FoundIndication(build, pattern.toString(), currentFile, cleanLine); } return foundIndication; } finally { timerThread.requestStop(); timerThread.interrupt(); try { timerThread.join(); } catch (InterruptedException eIgnore) { } Thread.interrupted(); } }

Target:
public FoundIndication scan(Run build) throws IOException { if (Util.isOverridden(FailureReader.class, getClass(), "scan", AbstractBuild.class)) { return scan((AbstractBuild) build); } return null; }
Source:
private Configuration getShuffleTaskConfiguration(final int stageSequence, final String computeTaskId) { if (!stageInfoList.get(stageSequence).isShuffleUsed()) { return Tang.Factory.getTang().newConfigurationBuilder().build(); } final JavaConfigurationBuilder shuffleConfBuilder = Tang.Factory.getTang() .newConfigurationBuilder(shuffleManagerList.get(stageSequence).get().getShuffleConfiguration(computeTaskId)); return shuffleConfBuilder .bindNamedParameter(DataShuffle.class, DataShuffle.getShuffleName(stageSequence)) .build(); }

Target:
private Configuration getShuffleTaskConfiguration(final int stageSequence, final String computeTaskId) { final JavaConfigurationBuilder shuffleConfBuilder = Tang.Factory.getTang().newConfigurationBuilder(); if (stageInfoList.get(stageSequence).isPreRunShuffleUsed()) { shuffleConfBuilder.addConfiguration( preRunShuffleManagerList.get(stageSequence).get().getShuffleConfiguration(computeTaskId)); shuffleConfBuilder.bindNamedParameter(DataPreRunShuffle.class, getPreRunShuffleName(stageSequence)); } if (stageInfoList.get(stageSequence).isPostRunShuffleUsed()) { shuffleConfBuilder.addConfiguration( postRunShuffleManagerList.get(stageSequence).get().getShuffleConfiguration(computeTaskId)); shuffleConfBuilder.bindNamedParameter(DataPostRunShuffle.class, getPostRunShuffleName(stageSequence)); } return shuffleConfBuilder.build(); }
Source:
public MetaDataApplicationRestServiceImpl metaDataApplicationRestService(Environment environment){ return new MetaDataApplicationRestServiceImpl(environment); }

Target:
public MetaDataService metaDataApplicationRestService(Environment environment){ return new MetaDataRestServiceImpl(environment); }
Source:
private KerberosRealm getKerberosRealm() { Collection<Realm> realmsList = (Collection<Realm>) authenticationService.getRealmsList(); if (realmsList != null) { for (Realm realm : realmsList) { String name = realm.getClass().getName(); LOG.debug("RealmClass.getName: {}", name); if (name.equals("org.apache.zeppelin.realm.kerberos.KerberosRealm")) { return (KerberosRealm) realm; } } } return null; }

Target:
private KerberosRealm getKerberosRealm() { Collection<Realm> realmsList = authenticationService.getRealmsList(); if (realmsList != null) { for (Realm realm : realmsList) { String name = realm.getClass().getName(); LOG.debug("RealmClass.getName: {}", name); if (name.equals("org.apache.zeppelin.realm.kerberos.KerberosRealm")) { return (KerberosRealm) realm; } } } return null; }
Source:
public void setApiKey(@NonNull String apiKey) { if (apiKey != null) { impl.setApiKey(apiKey); } else { error("apiKey"); } }

Target:
public void setApiKey(@NonNull String apiKey) { validateApiKey(apiKey); impl.setApiKey(apiKey); }
Source:
Pair<String, File> encryptSegmentIfNeeded(File tempDecryptedFile, File tempEncryptedFile, boolean isUploadedSegmentEncrypted, String crypterUsedInUploadedSegment, String crypterClassNameInTableConfig, String segmentName, String tableName) { boolean segmentNeedsEncryption = !Strings.isNullOrEmpty(crypterClassNameInTableConfig); File finalSegmentFile = (isUploadedSegmentEncrypted || segmentNeedsEncryption) ? tempEncryptedFile : tempDecryptedFile; String crypterClassName = Strings.isNullOrEmpty(crypterClassNameInTableConfig) ? crypterUsedInUploadedSegment : crypterClassNameInTableConfig; ImmutablePair<String, File> out = ImmutablePair.of(crypterClassName, finalSegmentFile); if (!segmentNeedsEncryption) { return out; } if (isUploadedSegmentEncrypted && !crypterClassNameInTableConfig.equals(crypterUsedInUploadedSegment)) { throw new ControllerApplicationException(LOGGER, String .format("Uploaded segment is encrypted with '%s' while table config requires '%s' as crypter " + "(segment name = '%s', table name = '%s').", crypterUsedInUploadedSegment, crypterClassNameInTableConfig, segmentName, tableName), Response.Status.INTERNAL_SERVER_ERROR); } PinotCrypter pinotCrypter = PinotCrypterFactory.create(crypterClassNameInTableConfig); LOGGER.info("Using crypter class for encrypting to {}.", crypterClassNameInTableConfig, tempDecryptedFile, tempEncryptedFile); pinotCrypter.encrypt(tempDecryptedFile, tempEncryptedFile); return out; }

Target:
Pair<String, File> encryptSegmentIfNeeded(File tempDecryptedFile, File tempEncryptedFile, boolean isUploadedSegmentEncrypted, String crypterUsedInUploadedSegment, String crypterClassNameInTableConfig, String segmentName, String tableName) { boolean segmentNeedsEncryption = !Strings.isNullOrEmpty(crypterClassNameInTableConfig); File finalSegmentFile = (isUploadedSegmentEncrypted || segmentNeedsEncryption) ? tempEncryptedFile : tempDecryptedFile; String crypterClassName = Strings.isNullOrEmpty(crypterClassNameInTableConfig) ? crypterUsedInUploadedSegment : crypterClassNameInTableConfig; ImmutablePair<String, File> out = ImmutablePair.of(crypterClassName, finalSegmentFile); if (!segmentNeedsEncryption) { return out; } if (isUploadedSegmentEncrypted && !crypterClassNameInTableConfig.equals(crypterUsedInUploadedSegment)) { throw new ControllerApplicationException(LOGGER, String.format( "Uploaded segment is encrypted with '%s' while table config requires '%s' as crypter " + "(segment name = '%s', table name = '%s').", crypterUsedInUploadedSegment, crypterClassNameInTableConfig, segmentName, tableName), Response.Status.INTERNAL_SERVER_ERROR); } PinotCrypter pinotCrypter = PinotCrypterFactory.create(crypterClassNameInTableConfig); LOGGER.info("Using crypter class '{}' for encrypting '{}' to '{}' (segment name = '{}', table name = '{}').", crypterClassNameInTableConfig, tempDecryptedFile, tempEncryptedFile, segmentName, tableName); pinotCrypter.encrypt(tempDecryptedFile, tempEncryptedFile); return out; }
Source:
private void addDefaultGraphicsDevice() { VmDevice device = VmDeviceCommonUtils.findVmDeviceByGeneralType( vmBase.getManagedDeviceMap(), VmDeviceGeneralType.GRAPHICS); if (device == null) { VmDeviceType deviceType = vmBase.getDefaultDisplayType() == DisplayType.vga ? VmDeviceType.VNC : VmDeviceType.SPICE; device = new GraphicsDevice(deviceType); device.setId(new VmDeviceId(Guid.newGuid(), vmBase.getId())); addManagedVmDevice(device); } }

Target:
private void addDefaultGraphicsDevice() { VmDevice device = VmDeviceCommonUtils.findVmDeviceByGeneralType( vmBase.getManagedDeviceMap(), VmDeviceGeneralType.GRAPHICS); if (device != null) { return; } List<Pair<GraphicsType, DisplayType>> graphicsAndDisplays = osRepository.getGraphicsAndDisplays(vmBase.getOsId(), new Version(getVersion())); GraphicsType graphicsType = vmBase.getDefaultDisplayType() == DisplayType.vga ? GraphicsType.VNC : GraphicsType.SPICE; GraphicsType supportedGraphicsType = null; for (Pair<GraphicsType, DisplayType> pair : graphicsAndDisplays) { if (pair.getSecond() == vmBase.getDefaultDisplayType()) { if (pair.getFirst() == graphicsType) { supportedGraphicsType = graphicsType; break; } if (supportedGraphicsType == null) { supportedGraphicsType = pair.getFirst(); } } } if (supportedGraphicsType != null) { device = new GraphicsDevice(supportedGraphicsType.getCorrespondingDeviceType()); device.setId(new VmDeviceId(Guid.newGuid(), vmBase.getId())); addManagedVmDevice(device); } }
Source:
private Response processResult(Object result, Class<?> resultType, String type) { Response.ResponseBuilder builder = Response.status(Response.Status.OK); if (resultType.equals(Void.TYPE) || resultType.equals(Void.class)) { builder.entity(type.equals(COMPLETE) ? ParticipantStatus.Completed.name() : ParticipantStatus.Compensated.name()); } else if (result == null) { builder.status(Response.Status.NOT_FOUND); } else if (result instanceof ParticipantStatus) { ParticipantStatus status = (ParticipantStatus) result; if (status == ParticipantStatus.Compensating || status == ParticipantStatus.Completing) { return builder.status(Response.Status.ACCEPTED).build(); } else { builder.entity(status.name()); } } else if (result instanceof Response) { return (Response) result; } else if (result instanceof Throwable) { builder.entity(processThrowable((Throwable) result, type)); } else { throw new IllegalStateException("Invalid type of returned object: " + result.getClass()); } return builder.build(); }

Target:
private Response processResult(Object result, Class<?> resultType, String type) { Response.ResponseBuilder builder = Response.status(Response.Status.OK); if (resultType.equals(Void.TYPE) || resultType.equals(Void.class)) { builder.entity(type.equals(COMPLETE) ? ParticipantStatus.Completed.name() : ParticipantStatus.Compensated.name()); } else if (result == null) { builder.status(Response.Status.NOT_FOUND); } else if (result instanceof ParticipantStatus) { ParticipantStatus status = (ParticipantStatus) result; if (status == ParticipantStatus.Compensating || status == ParticipantStatus.Completing) { return builder.status(Response.Status.ACCEPTED).build(); } else { builder.entity(status.name()); } } else if (result instanceof Response) { return (Response) result; } else { builder.entity(processThrowable((Throwable) result, type)); } return builder.build(); }
Source:
public void finish() { blocked.set(null); if (pageSource != null) { recordPageSourceRawInputStats(); try { pageSource.close(); } catch (IOException e) { throw new UncheckedIOException(e); } } else if (cursor != null) { recordCursorInputStats(0); cursor.close(); } finishing = true; mergingOutput.finish(); }

Target:
public void finish() { blocked.set(null); if (pageSource != null) { try { pageSource.close(); } catch (IOException e) { throw new UncheckedIOException(e); } } else if (cursor != null) { cursor.close(); } finishing = true; mergingOutput.finish(); }
Source:
@Override public DataContainer toContainer() { final DataContainer container = new MemoryDataContainer(); container.set(Queries.CONTENT_VERSION, this.getContentVersion()) .set(DataQuery.of("BaseColor"), this.baseColor.toContainer()) .set(DataQuery.of("Shade"), this.shade.getId()); return container; }

Target:
public DataContainer toContainer() { final DataContainer container = DataContainer.createNew(); container.set(Queries.CONTENT_VERSION, this.getContentVersion()) .set(DataQueries.MAP_BASE_COLOR, this.baseColor) .set(DataQueries.MAP_SHADE, this.shade.getId()); return container; }
Source:
public void setSystemProperty(CoreSession session, List<String> ids, Boolean value) { List<DocumentRef> updatedRefs = new ArrayList<>(ids.size()); String query = String.format(SYSPROP_QUERY_TEMPLATE, value ? "0" : "1", String.join("', '", ids)); try (IterableQueryResult res = session.queryAndFetch(query, NXQL.NXQL)) { for (Map<String, Serializable> map : res) { DocumentRef ref = new IdRef((String) map.get(NXQL.ECM_UUID)); try { session.setDocumentSystemProp(ref, "isTrashed", value); updatedRefs.add(ref); } catch (NuxeoException e) { getLog().warn("Cannot set system property: isTrashed on: " + ref.toString(), e); } } } try { session.save(); if (!updatedRefs.isEmpty()) { fireEvent(session, value ? DOCUMENT_TRASHED : DOCUMENT_UNTRASHED, updatedRefs); } } catch (PropertyException e) { getLog().warn("Cannot save session", e); } }

Target:
public void setSystemProperty(CoreSession session, List<String> ids, Boolean value) { List<DocumentRef> updatedRefs = new ArrayList<>(ids.size()); String query = String.format(SYSPROP_QUERY_TEMPLATE, value ? "0" : "1", String.join("', '", ids)); try (IterableQueryResult res = session.queryAndFetch(query, NXQL.NXQL)) { for (Map<String, Serializable> map : res) { DocumentRef ref = new IdRef((String) map.get(NXQL.ECM_UUID)); try { session.setDocumentSystemProp(ref, "isTrashed", value); updatedRefs.add(ref); } catch (NuxeoException e) { log.warn("Cannot set system property: isTrashed on: " + ref.toString(), e); } } } try { session.save(); if (!updatedRefs.isEmpty()) { fireEvent(session, value ? DOCUMENT_TRASHED : DOCUMENT_UNTRASHED, updatedRefs); } } catch (PropertyException e) { log.warn("Cannot save session", e); } }
Source:
public Class<String> getDatumClass() { return null; }

Target:
public Class<String> getDatumClass() { return String.class; }
Source:
Software(String imageId, boolean cachedImage, Map<String, String> files, List<String> packages, List<Repository> repositories, Map<String, String> options) { super(options); this.imageId = processImageId(imageId); this.cachedImage = cachedImage; this.files = ImmutableMap.copyOf(files); this.packages = ImmutableList.copyOf(packages); this.repositories = ImmutableList.copyOf(repositories); }

Target:
Software(String imageId, boolean cachedImage, Map<String, String> files, List<String> packages, List<Repository> repositories, Map<String, String> options) { super(options); this.imageId = checkNotNull(imageId, "The supplied imageId was null"); this.cachedImage = cachedImage; this.files = ImmutableMap.copyOf(files); this.packages = ImmutableList.copyOf(packages); this.repositories = ImmutableList.copyOf(repositories); }
Source:
public @Nullable SerialPortIdentifier getPortIdentifier(URI port) { CommPortIdentifier ident = null; try { ident = CommPortIdentifier.getPortIdentifier(port.getPath()); } catch (javax.comm.NoSuchPortException e) { logger.info("No SerialPortIdentifier found for: {}", port.getPath()); return null; } return new SerialPortIdentifierImpl(ident); }

Target:
public @Nullable SerialPortIdentifier getPortIdentifier(URI port) { CommPortIdentifier ident = null; try { ident = CommPortIdentifier.getPortIdentifier(port.getPath()); } catch (javax.comm.NoSuchPortException e) { logger.debug("No SerialPortIdentifier found for: {}", port.getPath()); return null; } return new SerialPortIdentifierImpl(ident); }
Source:
public ActionResult execute() { Intent intent = Intent.valueOf(getNonNullRequestParamValue(Const.ParamsNames.INTENT)); switch (intent) { case INSTRUCTOR_SUBMISSION: String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); InstructorAttributes instructorAttributes = getInstructorOfCourseFromRequest(courseId); if (instructorAttributes == null) { throw new EntityNotFoundException(new EntityDoesNotExistException("Instructor could not be found for " + "this course")); } return new JsonResult(new InstructorData(instructorAttributes)); case FULL_DETAIL: return null; default: throw new InvalidHttpParameterException("Unknown intent " + intent); } }

Target:
public ActionResult execute() { Intent intent = Intent.valueOf(getNonNullRequestParamValue(Const.ParamsNames.INTENT)); switch (intent) { case INSTRUCTOR_SUBMISSION: String courseId = getNonNullRequestParamValue(Const.ParamsNames.COURSE_ID); InstructorAttributes instructorAttributes = getInstructorOfCourseFromRequest(courseId); if (instructorAttributes == null) { return new JsonResult("Instructor could not be found for this course", HttpStatus.SC_NOT_FOUND); } return new JsonResult(new InstructorData(instructorAttributes)); case FULL_DETAIL: return null; default: throw new InvalidHttpParameterException("Unknown intent " + intent); } }
Source:
public String getJMXUrl() { ServerDelegate sd = (ServerDelegate)server.loadAdapter(ServerDelegate.class, null); int port = -1; if( !(sd instanceof IManagementPortProvider)) port = IJBossToolingConstants.WILDFLY8_MANAGEMENT_PORT_DEFAULT_PORT; else { port = ((IManagementPortProvider)sd).getManagementPort(); } String url = "service:jmx:http-remoting-jmx://" + server.getHost() + ":" + port; return url; }

Target:
public String getJMXUrl() { return getJMXUrl(IJBossToolingConstants.WILDFLY8_MANAGEMENT_PORT_DEFAULT_PORT, "service:jmx:http-remoting-jmx"); }
Source:
private JLoadTest getExecutionLoadTest(String id, Iterable queryProvider, List<ResponseValidatorProvider> validators, JLoadProfile standardGroupLoad, JTerminationCriteria standardTermination) { JTestDefinition definition = JTestDefinition.builder(Id.of(id + "def"), Collections.singletonList(new JHttpEndpoint(TestContext.getEndpointUri()))) .withQueryProvider(queryProvider) .withInvoker(DefaultInvokerProvider.of(ExecutionManipulateInvoker.class)) .addValidators(validators) .withLoadBalancer(new OneByOneLoadBalancer()) .build(); return JLoadTest.builder(Id.of(id), definition, standardGroupLoad, standardTermination) .withLimits(JLimitVsRefValue.builder("successRate-Success rate", RefValue.of(1.0)).build()) .build(); }

Target:
private JLoadTest getExecutionLoadTest(String id, Iterable queryProvider, List<ResponseValidatorProvider> validators, JLoadProfile standardGroupLoad, JTerminationCriteria standardTermination) { JTestDefinition definition = JTestDefinition.builder(Id.of(id + "def"), Collections.singletonList(new JHttpEndpoint(TestContext.getEndpointUri()))) .withQueryProvider(queryProvider) .withInvoker(DefaultInvokerProvider.of(ExecutionManipulateInvoker.class)) .addValidators(validators) .withLoadBalancer(JLoadBalancer.builder(JLoadBalancer.DefaultLoadBalancer.ONE_BY_ONE).build()) .build(); return JLoadTest.builder(Id.of(id), definition, standardGroupLoad, standardTermination) .withLimits(JLimitVsRefValue.builder("successRate-Success rate", RefValue.of(1.0)).build()) .build(); }
Source:
public Builder jobs(List<Job> jobs) { this.jobs = jobs; return this; }

Target:
public Builder jobs(List<Job> jobs) { this.jobs = ImmutableList.copyOf(jobs); return this; }
Source:
protected final synchronized StageClient connect() throws RESTLightClientException { final String url = formatUrl( getNexusUrl() ); setAndValidateProxy(); getLog().info( "Logging into Nexus: " + url ); getLog().info( "User: " + getUsername() ); ProxyConfig proxyConfig = null; if ( getProxyHost() != null ) { getLog().info( "Proxying nexus through: " + getProxyHost() + ":" + getProxyPort() ); proxyConfig = new ProxyConfig( getProxyHost(), getProxyPort(), getProxyUsername(), getProxyPassword() ); } client = new StageClient( url, getUsername(), getPassword(), proxyConfig ); return client; }

Target:
protected final synchronized StageClient connect() throws RESTLightClientException { final String url = formatUrl( getNexusUrl() ); setAndValidateProxy(); getLog().info( "Logging into Nexus: " + url ); getLog().info( "User: " + getUsername() ); ProxyConfig proxyConfig = null; final String proxyHost = getProxyHost(); if ( proxyHost != null ) { final int proxyPort = getProxyPort(); getLog().info( "Proxying nexus through: " + proxyHost + ":" + proxyPort ); proxyConfig = new ProxyConfig( proxyHost, proxyPort, getProxyUsername(), getProxyPassword() ); } client = new StageClient( url, getUsername(), getPassword(), proxyConfig ); return client; }
Source:
public static <T extends BitmapDataProvider> T randomBitmap(int maxKeys, double rleLimit, double denseLimit, RoaringBitmapWriter<T> writer) { int[] keys = createSorted16BitInts(ThreadLocalRandom.current().nextInt(1, maxKeys)); IntStream.of(keys) .forEach(key -> { double choice = ThreadLocalRandom.current().nextDouble(); final IntStream stream; if (choice < rleLimit) { stream = rleRegion(); } else if (choice < rleLimit+ denseLimit) { stream = denseRegion(); } else { stream = sparseRegion(); } stream.map(i -> (key << 16) | i).forEach(writer::add); }); return writer.get(); }

Target:
public static <T extends BitmapDataProvider> T randomBitmap(int maxKeys, double rleLimit, double denseLimit, RoaringBitmapWriter<T> writer) { int[] keys = createSorted16BitInts(ThreadLocalRandom.current().nextInt(1, maxKeys)); IntStream.of(keys) .forEach(key -> { double choice = ThreadLocalRandom.current().nextDouble(); final IntStream stream; if (choice < rleLimit) { stream = rleRegion(); } else if (choice < denseLimit) { stream = denseRegion(); } else { stream = sparseRegion(); } stream.map(i -> (key << 16) | i).forEach(writer::add); }); return writer.get(); }
Source:
public static TestCase makeTestCaseFromK(CmdArg cmdArgs) throws InvalidConfigError { Annotated<String, LocationData> targetFile = new Annotated<>(cmdArgs.getTargetFile(), new LocationData()); List<Annotated<String, LocationData>> programs = new LinkedList<>(); programs.add(new Annotated<>(cmdArgs.getResults(), new LocationData())); List<Annotated<String,LocationData>> results = new LinkedList<>(); results.add(new Annotated<>(cmdArgs.getResults(), new LocationData())); List<PgmArg> emptyOpts = new ArrayList<>(0); HashMap<String, List<PgmArg>> emptyOptsMap = new HashMap<>(0); return new TestCase(targetFile, programs, cmdArgs.getExtensions(), cmdArgs.getExcludes(), results, emptyOpts, emptyOpts, emptyOptsMap, new HashSet<KTestStep>(), ""); }

Target:
public static TestCase makeTestCaseFromK(CmdArg cmdArgs) throws InvalidConfigError { Annotated<String, LocationData> targetFile = new Annotated<>(cmdArgs.getTargetFile(), new LocationData()); List<Annotated<String, LocationData>> programs = new LinkedList<>(); programs.add(new Annotated<>(cmdArgs.getResults(), new LocationData())); List<Annotated<String,LocationData>> results = new LinkedList<>(); results.add(new Annotated<>(cmdArgs.getResults(), new LocationData())); List<PgmArg> emptyOpts = new ArrayList<>(0); HashMap<String, List<PgmArg>> emptyOptsMap = new HashMap<>(0); return new TestCase(targetFile, programs, cmdArgs.getExtensions(), cmdArgs.getExcludes(), results, emptyOpts, emptyOpts, emptyOptsMap, new HashSet<KTestStep>()); }
Source:
public long getAvailable() { long availableMemory = 0; long pageSize = 4096; try { int machPort = SystemB.INSTANCE.mach_host_self(); LongByReference pPageSize = new LongByReference(); int ret = SystemB.INSTANCE.host_page_size(machPort, pPageSize); if (ret == 0) { pageSize = pPageSize.getValue(); } VM_STATISTICS64 vmStats = new VM_STATISTICS64(); ret = SystemB.INSTANCE.host_statistics64(machPort, SystemB.HOST_VM_INFO64, vmStats, new IntByReference( SystemB.HOST_VM_INFO64_COUNT)); if (ret == 0) { availableMemory = (vmStats.free_count + vmStats.inactive_count) * pageSize; totalMemory = (vmStats.free_count + vmStats.inactive_count + vmStats.wire_count + vmStats.active_count + vmStats.compressor_page_count) * pageSize; } } catch (UnsatisfiedLinkError e) { for (String line : ExecutingCommand.runNative("vm_stat")) { if (line.matches("\\D+(page size of \\d+ bytes)\\D+")) { pageSize = new Long(line.replaceAll("\\D", "")); } else if (line.startsWith("Pages free:") || line.startsWith("Pages speculative:") || line.startsWith("Pages inactive:")) { String[] memorySplit = line.split(":\\s+"); if (memorySplit.length > 1) { availableMemory += new Long(memorySplit[1].replace(".", "")); } } } availableMemory *= pageSize; } return availableMemory; }

Target:
public long getAvailable() { long availableMemory = 0; long pageSize = 4096; int machPort = SystemB.INSTANCE.mach_host_self(); LongByReference pPageSize = new LongByReference(); if (0 != SystemB.INSTANCE.host_page_size(machPort, pPageSize)) throw new LastErrorException("Error code: " + Native.getLastError()); pageSize = pPageSize.getValue(); VMStatistics vmStats = new VMStatistics(); if (0 != SystemB.INSTANCE.host_statistics(machPort, SystemB.HOST_VM_INFO, vmStats, new IntByReference(vmStats.size() / SystemB.INT_SIZE))) throw new LastErrorException("Error code: " + Native.getLastError()); availableMemory = (vmStats.free_count + vmStats.inactive_count) * pageSize; return availableMemory; }
Source:
public static List<String> getDefaultDNS(Context context) { SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); String vpnDns = prefs.getString("dns", null); boolean ignoresysdns = prefs.getBoolean("ignoresysdns", false); List<String> listDns = new ArrayList<>(); if (!ignoresysdns) { String dns1 = jni_getprop("net.dns1"); String dns2 = jni_getprop("net.dns2"); if (!TextUtils.isEmpty(dns1)) listDns.add(dns1); if (!TextUtils.isEmpty(dns2)) listDns.add(dns2); if (TextUtils.isEmpty(dns1) && TextUtils.isEmpty(dns2)) listDns.add("8.8.8.8"); } else if (TextUtils.isEmpty(vpnDns)) listDns.add("8.8.8.8"); return listDns; }

Target:
public static List<String> getDefaultDNS(Context context) { SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); String vpnDns = prefs.getString("dns", null); boolean ignoresysdns = prefs.getBoolean("ignoresysdns", false); List<String> listDns = new ArrayList<>(); if (ignoresysdns) if (TextUtils.isEmpty(vpnDns)) listDns.add("8.8.8.8"); else { String dns1 = jni_getprop("net.dns1"); String dns2 = jni_getprop("net.dns2"); if (!TextUtils.isEmpty(dns1)) listDns.add(dns1); if (!TextUtils.isEmpty(dns2)) listDns.add(dns2); if (TextUtils.isEmpty(dns1) && TextUtils.isEmpty(dns2)) listDns.add("8.8.8.8"); } return listDns; }
Source:
public <V> DataSet<LocatedRow> readTextFile(SpliceOperation op, String location, String characterDelimiter, String columnDelimiter, int[] baseColumnMap, OperationContext context, Qualifier[][] qualifiers, DataValueDescriptor probeValue, ExecRow execRow) throws StandardException { try { Dataset<Row> table = null; try { table = SpliceSpark.getSession().read().csv(location); List<Column> correctSchemaSelection = new ArrayList<>(); int fieldIndex = 0; for( int index = 0; index< baseColumnMap.length; index++){ if(baseColumnMap[index]!=-1){ StructField ft = table.schema().fields()[index]; Column cl = new Column(ft.name()).cast(execRow.schema().fields()[baseColumnMap[index]].dataType()); table = table.withColumn(ft.name(),cl); } } } catch (Exception e) { return handleExceptionInCaseOfEmptySet(e,location); } table = processExternalDataset(table,baseColumnMap,qualifiers,probeValue); return new SparkDataSet(table .rdd().toJavaRDD() .map(new RowToLocatedRowFunction(context,execRow))); } catch (Exception e) { throw StandardException.newException( SQLState.EXTERNAL_TABLES_READ_FAILURE,e.getMessage()); } }

Target:
public <V> DataSet<LocatedRow> readTextFile(SpliceOperation op, String location, String characterDelimiter, String columnDelimiter, int[] baseColumnMap, OperationContext context, Qualifier[][] qualifiers, DataValueDescriptor probeValue, ExecRow execRow) throws StandardException { try { Dataset<Row> table = null; try { table = SpliceSpark.getSession().read().csv(location); for( int index = 0; index< baseColumnMap.length; index++){ if(baseColumnMap[index]!=-1){ StructField ft = table.schema().fields()[index]; Column cl = new Column(ft.name()).cast(execRow.schema().fields()[baseColumnMap[index]].dataType()); table = table.withColumn(ft.name(),cl); } } } catch (Exception e) { return handleExceptionInCaseOfEmptySet(e,location); } table = processExternalDataset(table,baseColumnMap,qualifiers,probeValue); return new SparkDataSet(table .rdd().toJavaRDD() .map(new RowToLocatedRowFunction(context,execRow))); } catch (Exception e) { throw StandardException.newException( SQLState.EXTERNAL_TABLES_READ_FAILURE,e.getMessage()); } }
Source:
public DruidMasterRuntimeParams run(DruidMasterRuntimeParams params) { MasterStats stats = new MasterStats(); DruidCluster cluster = params.getDruidCluster(); if (cluster.isEmpty()) { log.warn("Uh... I have no servers. Not assigning anything..."); return params; } DatabaseRuleManager databaseRuleManager = params.getDatabaseRuleManager(); for (DataSegment segment : params.getAvailableSegments()) { List<Rule> rules = databaseRuleManager.getRulesWithDefault(segment.getDataSource()); boolean foundMatchingRule = false; for (Rule rule : rules) { if (rule.appliesTo(segment)) { stats.accumulate(rule.run(master, params, segment)); foundMatchingRule = true; break; } } if (!foundMatchingRule) { log.makeAlert("Unable to find a matching rule for segment[%s]", segment.getIdentifier()).emit(); } } return params.buildFromExisting() .withMasterStats(stats) .build(); }

Target:
public DruidMasterRuntimeParams run(DruidMasterRuntimeParams params) { MasterStats stats = new MasterStats(); DruidCluster cluster = params.getDruidCluster(); if (cluster.isEmpty()) { log.warn("Uh... I have no servers. Not assigning anything..."); return params; } DatabaseRuleManager databaseRuleManager = params.getDatabaseRuleManager(); for (DataSegment segment : params.getAvailableSegments()) { List<Rule> rules = databaseRuleManager.getRulesWithDefault(segment.getDataSource()); boolean foundMatchingRule = false; for (Rule rule : rules) { if (rule.appliesTo(segment)) { stats.accumulate(rule.run(master, params, segment)); foundMatchingRule = true; break; } } if (!foundMatchingRule) { log.makeAlert( "Unable to find a matching rule for dataSource[%s]", segment.getDataSource() ) .addData("segment", segment.getIdentifier()) .emit(); } } return params.buildFromExisting() .withMasterStats(stats) .build(); }
Source:
public static void swallowChildrenFailures() { TaskQueueingContext qc = DynamicTasks.getTaskQueuingContext(); if (qc!=null) { qc.swallowChildrenFailures(); } }

Target:
public static void swallowChildrenFailures() { Preconditions.checkNotNull(DynamicTasks.getTaskQueuingContext(), "Task queueing context required here"); Tasks.swallowChildrenFailures(); }
Source:
public void releaseResources() throws Exception{ consumer.shutdown(); }

Target:
private void releaseResources() throws Exception { consumer.shutdown(); }
Source:
public synchronized void evictAll() throws IOException { Util.deleteContents(directory); redundantOpCount = 0; size = 0; nextSequenceNumber = 0; lruEntries.clear(); rebuildJournal(); }

Target:
public synchronized void evictAll() throws IOException { Util.deleteContents(directory); for (Editor editor : activeEditors.keySet()) { editor.invalidate(); } activeEditors.clear(); redundantOpCount = 0; size = 0; lruEntries.clear(); rebuildJournal(); }
Source:
protected static String dockerMachineCertsDirectoryPath(@NotNull Map<String, String> env) { String certPath = env.get(DOCKER_CERT_PATH_PROPERTY); if (certPath != null) { if (new File(certPath).exists()) { return certPath; } else { LOG.error(String.format("The directory provided by property %s doesn't exists. Returning default value", certPath)); } } return DEFAULT_DOCKER_MACHINE_CERTS_DIR; }

Target:
protected static String dockerMachineCertsDirectoryPath(@NotNull Map<String, String> env) { Objects.requireNonNull(env, "Required non-null env variables"); String certPath = env.get(DOCKER_CERT_PATH_PROPERTY); if (certPath != null) { if (new File(certPath).exists()) { return certPath; } else { LOG.error(String.format("The directory provided by property %s doesn't exists. Returning default value", certPath)); } } return DEFAULT_DOCKER_MACHINE_CERTS_DIR; }
Source:
public void kickAfkPlayers() { if (lastPlayerActivity.size() < 1) { return; } if (plugin.getServer().getOnlinePlayers().length < playerCountThreshold) { return; } long activityWindow = System.currentTimeMillis() - kickTimeout; for (String name : lastPlayerActivity.keySet()) { Player player = plugin.getServer().getPlayer(name); if (player == null) { continue; } if (player.hasPermission(PERMISSION_EXEMPT) || (exemptPlayers.contains(name.toLowerCase()))) { continue; } if (lastPlayerActivity.get(name) == null) { continue; } long lastActivity = lastPlayerActivity.get(name); if (lastActivity < activityWindow) { kickIdlePlayer(player); } } }

Target:
public void kickAfkPlayers() { if (lastPlayerActivity.size() < 1) { return; } if (plugin.getServer().getOnlinePlayers().length < playerCountThreshold) { return; } long activityWindow = System.currentTimeMillis() - kickTimeout; for (String name : lastPlayerActivity.keySet()) { Player player = plugin.getServer().getPlayer(name); if (player == null) { continue; } if (player.hasPermission(PERMISSION_EXEMPT) || (exemptPlayers.contains(name.toLowerCase()))) { continue; } Long tmpLong = lastPlayerActivity.get(name); if (tmpLong == null) { continue; } long lastActivity = tmpLong.longValue(); if (lastActivity < activityWindow) { kickIdlePlayer(player); } } }
Source:
public IStatus validate(IValidationContext ctx) { IStatus status = null; EObject target = ctx.getTarget(); for (EObject content : target.eContents()) { if (content instanceof IdentifiedElement) { String elementName = ((IdentifiedElement) content).getName(); if (StringUtil.isEmpty(elementName)) { status = ctx.createFailureStatus(getPath(content) + ERROR_MESSAGE); } } } if (status == null) { status = ctx.createSuccessStatus(); } return status; }

Target:
public IStatus validate(IValidationContext ctx) { IStatus status = null; EObject target = ctx.getTarget(); if (target instanceof IdentifiedElement) { String elementName = ((IdentifiedElement) target).getName(); if (StringUtil.isEmpty(elementName)) { status = ctx.createFailureStatus(getPath(target) + ERROR_MESSAGE); } } if (status == null) { status = ctx.createSuccessStatus(); } return status; }