auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testSeverityChange() throws Exception { final RestClient restClient = stack.opennms().getRestClient(); restClient.sendEvent(getServiceProblemEvent(42, "Warning")); final AlarmDao alarmDao = stack.postgres().getDaoFactory().getDao(AlarmDaoHibernate.class); final OnmsAlarm onmsAlarm1 = await().atMost(2, MINUTES).pollInterval(10, SECONDS) .until(DaoUtils.findMatchingCallable(alarmDao, new CriteriaBuilder(OnmsAlarm.class) .eq("uei", "uei.opennms.org/bsm/serviceProblem") .toCriteria()), notNullValue()); assertEquals(1L, (long) onmsAlarm1.getCounter()); assertFalse(Strings.isNullOrEmpty(onmsAlarm1.getEventParameter("rootCause"))); assertEquals(OnmsSeverity.WARNING, onmsAlarm1.getSeverity()); restClient.sendEvent(getServiceProblemEvent(42, "Minor")); final OnmsAlarm onmsAlarm2 = await().atMost(2, MINUTES).pollInterval(10, SECONDS) .until(DaoUtils.findMatchingCallable(alarmDao, new CriteriaBuilder(OnmsAlarm.class) .eq("uei", "uei.opennms.org/bsm/serviceProblem") .toCriteria()), notNullValue()); assertEquals(2L, (long) onmsAlarm2.getCounter()); assertFalse(Strings.isNullOrEmpty(onmsAlarm2.getEventParameter("rootCause"))); assertEquals(OnmsSeverity.MINOR, onmsAlarm2.getSeverity()); }

Target:
public void testSeverityChange() throws Exception { final RestClient restClient = stack.opennms().getRestClient(); restClient.sendEvent(getServiceProblemEvent(42, "Warning")); final AlarmDao alarmDao = stack.postgres().getDaoFactory().getDao(AlarmDaoHibernate.class); final OnmsAlarm onmsAlarm1 = await().atMost(2, MINUTES).pollInterval(10, SECONDS) .until(DaoUtils.findMatchingCallable(alarmDao, new CriteriaBuilder(OnmsAlarm.class) .eq("uei", "uei.opennms.org/bsm/serviceProblem") .toCriteria()), notNullValue()); assertEquals(1L, (long) onmsAlarm1.getCounter()); assertEquals(OnmsSeverity.WARNING, onmsAlarm1.getSeverity()); restClient.sendEvent(getServiceProblemEvent(42, "Minor")); final OnmsAlarm onmsAlarm2 = await().atMost(2, MINUTES).pollInterval(10, SECONDS) .until(DaoUtils.findMatchingCallable(alarmDao, new CriteriaBuilder(OnmsAlarm.class) .eq("uei", "uei.opennms.org/bsm/serviceProblem") .toCriteria()), notNullValue()); assertEquals(2L, (long) onmsAlarm2.getCounter()); assertEquals(OnmsSeverity.MINOR, onmsAlarm2.getSeverity()); }
Source:
public void propagate(int evtmask) throws ContradictionException { boolean hasFiltered = true; while(hasFiltered) { hasFiltered = false; if(PropagatorEventType.isFullPropagation(evtmask)) { boxesToCompute.clear(); for (int i = 0; i < n; i++) { boxesToCompute.add(i); for (int j = i + 1; j < n; j++) { if (mayOverlap(i, j)) { overlappingBoxes.addEdge(i, j); if (boxInstantiated(i) && boxInstantiated(j)) { fails(); } } else { overlappingBoxes.removeEdge(i, j); } } } } pruneList.clear(); for(int k = 0; k<boxesToCompute.size(); k++) { int i = boxesToCompute.getQuick(k); energyCheck(i); hasFiltered |= prune(i); } boxesToCompute.clear(); for(int k = 0; k< pruneList.size(); k++) { prop(pruneList.getQuick(k)); } } }

Target:
public void propagate(int evtmask) throws ContradictionException { boolean hasFiltered = true; while(hasFiltered) { hasFiltered = false; if(PropagatorEventType.isFullPropagation(evtmask)) { boxesToCompute.resetQuick(); for (int i = 0; i < n; i++) { boxesToCompute.add(i); for (int j = i + 1; j < n; j++) { if (mayOverlap(i, j)) { overlappingBoxes.addEdge(i, j); if (boxInstantiated(i) && boxInstantiated(j)) { fails(); } } else { overlappingBoxes.removeEdge(i, j); } } } } pruneList.clear(); for(int k = 0; k<boxesToCompute.size(); k++) { int i = boxesToCompute.getQuick(k); energyCheck(i); hasFiltered |= prune(i); } boxesToCompute.clear(); for(int k = 0; k< pruneList.size(); k++) { prop(pruneList.getQuick(k)); } } }
Source:
public ListenableFuture<?> delete(ChangeData cd) { return executor != null ? executor.submit(deleteTask(cd)) : null; }

Target:
public ListenableFuture<?> delete(ChangeData cd) { return executor != null ? executor.submit(deleteTask(cd)) : Futures.immediateFuture(null); }
Source:
public Response getActivityStatistics(@PathParam ("WORKSPACEENTITYID") Long workspaceEntityId, @QueryParam ("userIdentifier") String userId) { WorkspaceEntity workspaceEntity = workspaceEntityController.findWorkspaceEntityById(workspaceEntityId); if (workspaceEntity == null) { return Response.status(Status.BAD_REQUEST).build(); } if (!sessionController.hasWorkspacePermission(MuikkuPermissions.LIST_USER_WORKSPACE_ACTIVITY, workspaceEntity)) { return Response.status(Status.FORBIDDEN).build(); } SchoolDataIdentifier userIdentifier = null; if (StringUtils.isNotBlank(userId)) { userIdentifier = SchoolDataIdentifier.fromId(userId); } if (userIdentifier == null) { return Response.status(Status.NOT_IMPLEMENTED).entity("User does not exist").build(); } UserEntity userEntity = userEntityController.findUserEntityByUserIdentifier(userIdentifier); List<fi.otavanopisto.muikku.plugins.workspace.model.WorkspaceMaterialReply> workspaceMaterialReplies = workspaceMaterialReplyController.listVisibleWorkspaceMaterialRepliesByWorkspaceEntity(workspaceEntity, userEntity); List<WorkspaceActivityRecord> activityStatisitics = new ArrayList<WorkspaceActivityRecord>(); for(fi.otavanopisto.muikku.plugins.workspace.model.WorkspaceMaterialReply workspaceMaterialReply: workspaceMaterialReplies) { WorkspaceActivityRecord workspaceActivityRecord = new WorkspaceActivityRecord(workspaceMaterialReply.getWorkspaceMaterial().getAssignmentType().toString(), workspaceMaterialReply.getCreated()); activityStatisitics.add(workspaceActivityRecord); } return Response.ok(activityStatisitics).build(); }

Target:
public Response getActivityStatistics(@PathParam ("WORKSPACEENTITYID") Long workspaceEntityId, @QueryParam ("userIdentifier") String userId) { WorkspaceEntity workspaceEntity = workspaceEntityController.findWorkspaceEntityById(workspaceEntityId); if (workspaceEntity == null) { return Response.status(Status.BAD_REQUEST).build(); } if (!sessionController.hasWorkspacePermission(MuikkuPermissions.LIST_USER_WORKSPACE_ACTIVITY, workspaceEntity)) { return Response.status(Status.FORBIDDEN).build(); } SchoolDataIdentifier userIdentifier = null; if (StringUtils.isNotBlank(userId)) { userIdentifier = SchoolDataIdentifier.fromId(userId); } if (userIdentifier == null) { return Response.status(Status.NOT_FOUND).entity("User does not exist").build(); } UserEntity userEntity = userEntityController.findUserEntityByUserIdentifier(userIdentifier); List<fi.otavanopisto.muikku.plugins.workspace.model.WorkspaceMaterialReply> workspaceMaterialReplies = workspaceMaterialReplyController.listVisibleWorkspaceMaterialRepliesByWorkspaceEntity(workspaceEntity, userEntity); List<WorkspaceActivityRecord> activityStatisitics = new ArrayList<WorkspaceActivityRecord>(); for(fi.otavanopisto.muikku.plugins.workspace.model.WorkspaceMaterialReply workspaceMaterialReply: workspaceMaterialReplies) { WorkspaceActivityRecord workspaceActivityRecord = new WorkspaceActivityRecord(workspaceMaterialReply.getWorkspaceMaterial().getAssignmentType().toString(), workspaceMaterialReply.getCreated()); activityStatisitics.add(workspaceActivityRecord); } return Response.ok(activityStatisitics).build(); }
Source:
private static OSCoreEndpoint newEndpoint() { OSCoreEndpoint ep = new OSCoreEndpoint(Collections.<String>emptyList()); try { ep.start(); } catch (IOException e) { System.out.println("Could not create endpoint: " + e.getMessage()); } return ep; }

Target:
private static OSCoreEndpoint newEndpoint() { OSCoreEndpoint ep = new OSCoreEndpoint(); try { ep.start(); } catch (IOException e) { LOGGER.error("Could not create endpoint: " + e.getMessage()); } return ep; }
Source:
public Suggestion(String value, String searchTerm) { this.value = value; display = new SpannableString(value); display.setSpan(new ForegroundColorSpan(Color.GRAY), 0, searchTerm.length(), 0); }

Target:
public Suggestion(String value, String searchTerm) { this.value = value; display = new SpannableString(value); final int start = value.toLowerCase().indexOf(searchTerm.toLowerCase()); if (start >= 0) { display.setSpan(COLOR_SPAN, start, searchTerm.length(), 0); } }
Source:
public PIDPropertyManager(String functionName, XPropertyManager propMan, double defaultP, double defaultI, double defaultD, double defaultF) { propP = propMan.createPersistentProperty(functionName + " P", defaultP); propI = propMan.createPersistentProperty(functionName + " I", defaultI); propD = propMan.createPersistentProperty(functionName + " D", defaultD); propF = propMan.createPersistentProperty(functionName + " F", defaultF); propErrorThreshold = propMan.createPersistentProperty(functionName + " Error threshold", -1); propErrorDerivativeThreshold = propMan.createPersistentProperty(functionName + " Derivative threshold", -1); }

Target:
public PIDPropertyManager(String functionName, XPropertyManager propMan, double defaultP, double defaultI, double defaultD, double defaultF) { this(functionName, propMan, defaultP, defaultI, defaultD, defaultF, -1, -1); }
Source:
public void postDrawEvent(@Nullable ITimeEvent event, @Nullable Rectangle bounds, @Nullable GC gc) { if (bounds == null || gc == null) { return; } boolean visible = bounds.width == 0 ? false : true; if (!visible) { return; } if (!(event instanceof TimeEvent)) { return; } TimeEvent ev = (TimeEvent) event; if (ev.hasValue()) { VirtualMachineViewEntry entry = (VirtualMachineViewEntry) event.getEntry(); if (entry.getType() == Type.THREAD) { int value = ev.getValue(); if ((value & VcpuStateValues.VCPU_PREEMPT) != 0) { Color white = Display.getDefault().getSystemColor(SWT.COLOR_RED); int alpha = gc.getAlpha(); Color background = gc.getBackground(); gc.setBackground(white); gc.setAlpha(70); gc.fillRectangle(bounds); gc.setBackground(background); gc.setAlpha(alpha); } } } }

Target:
public void postDrawEvent(@Nullable ITimeEvent event, @Nullable Rectangle bounds, @Nullable GC gc) { if (bounds == null || gc == null) { return; } boolean visible = bounds.width == 0 ? false : true; if (!visible) { return; } if (!(event instanceof TimeEvent)) { return; } TimeEvent ev = (TimeEvent) event; if (ev.hasValue()) { VirtualMachineViewEntry entry = (VirtualMachineViewEntry) event.getEntry(); if (entry.getType() == Type.THREAD) { int value = ev.getValue(); if ((value & VcpuStateValues.VCPU_PREEMPT) != 0) { Color alphaColor = Display.getDefault().getSystemColor(SWT.COLOR_RED); int alpha = gc.getAlpha(); Color background = gc.getBackground(); gc.setBackground(alphaColor); gc.setAlpha(70); gc.fillRectangle(bounds); gc.setBackground(background); gc.setAlpha(alpha); } } } }
Source:
public static void init(Configuration conf) { if (!initDone) { DefaultConfiguration.conf = conf; DefaultConfiguration.initDone = true; } }

Target:
public static synchronized void init(Configuration conf) { if (!initDone) { DefaultConfiguration.conf = conf; DefaultConfiguration.initDone = true; } }
Source:
public Subscriber<? super T> call(final Subscriber<? super R> child) { return new Subscriber<T>(child) { private final R initialValue = initialValueFactory.call(); private R value = initialValue; boolean initialized = false; @SuppressWarnings("unchecked") @Override public void onNext(T currentValue) { emitInitialValueIfNeeded(child); if (this.value == NO_INITIAL_VALUE) { this.value = (R) currentValue; } else { try { this.value = accumulator.call(this.value, currentValue); } catch (Throwable e) { child.onError(OnErrorThrowable.addValueAsLastCause(e, currentValue)); return; } } child.onNext(this.value); } @Override public void onError(Throwable e) { child.onError(e); } @Override public void onCompleted() { emitInitialValueIfNeeded(child); child.onCompleted(); } private void emitInitialValueIfNeeded(final Subscriber<? super R> child) { if (!initialized) { initialized = true; if (initialValue != NO_INITIAL_VALUE) { child.onNext(initialValue); } } } @Override public void setProducer(final Producer producer) { child.setProducer(new Producer() { final AtomicBoolean once = new AtomicBoolean(); final AtomicBoolean excessive = new AtomicBoolean(); @Override public void request(long n) { if (once.compareAndSet(false, true)) { if (initialValue == NO_INITIAL_VALUE || n == Long.MAX_VALUE) { producer.request(n); } else if (n == 1) { excessive.set(true); producer.request(1); } else { producer.request(n - 1); } } else { if (n > 1 && excessive.compareAndSet(true, false) && n != Long.MAX_VALUE) { producer.request(n - 1); } else { producer.request(n); } } } }); } }; }

Target:
public Subscriber<? super T> call(final Subscriber<? super R> child) { return new Subscriber<T>(child) { private final R initialValue = initialValueFactory.call(); private R value = initialValue; boolean initialized = false; @SuppressWarnings("unchecked") @Override public void onNext(T currentValue) { emitInitialValueIfNeeded(child); if (this.value == NO_INITIAL_VALUE) { this.value = (R) currentValue; } else { try { this.value = accumulator.call(this.value, currentValue); } catch (Throwable e) { Exceptions.throwIfFatal(e); child.onError(OnErrorThrowable.addValueAsLastCause(e, currentValue)); return; } } child.onNext(this.value); } @Override public void onError(Throwable e) { child.onError(e); } @Override public void onCompleted() { emitInitialValueIfNeeded(child); child.onCompleted(); } private void emitInitialValueIfNeeded(final Subscriber<? super R> child) { if (!initialized) { initialized = true; if (initialValue != NO_INITIAL_VALUE) { child.onNext(initialValue); } } } @Override public void setProducer(final Producer producer) { child.setProducer(new Producer() { final AtomicBoolean once = new AtomicBoolean(); final AtomicBoolean excessive = new AtomicBoolean(); @Override public void request(long n) { if (once.compareAndSet(false, true)) { if (initialValue == NO_INITIAL_VALUE || n == Long.MAX_VALUE) { producer.request(n); } else if (n == 1) { excessive.set(true); producer.request(1); } else { producer.request(n - 1); } } else { if (n > 1 && excessive.compareAndSet(true, false) && n != Long.MAX_VALUE) { producer.request(n - 1); } else { producer.request(n); } } } }); } }; }
Source:
private void dispatchJobUpdatedFullData(JobState job) { try { if (logger.isDebugEnabled()) { jlogger.debug(job.getJobInfo().getJobId(), " event [" + SchedulerEvent.JOB_UPDATED + "]"); } for (ListeningUser listeningUserId : identifications.values()) { if (listeningUserId.isListening()) { try { UserIdentificationImpl userId = listeningUserId.getUser(); if ((userId.getUserEvents() == null) || userId.getUserEvents().contains(SchedulerEvent.JOB_UPDATED)) { if (!userId.isMyEventsOnly() || (userId.isMyEventsOnly() && userId.getUsername().equals(job.getOwner()))) { listeningUserId.getListener() .addEvent(eventMethods.get("jobUpdatedFullDataEvent"), job); } } } catch (NullPointerException e) { logger.debug("", e); } } } clearListeners(); } catch (SecurityException e) { logger.error("", e); } }

Target:
private void dispatchJobUpdatedFullData(JobState job) { try { if (logger.isDebugEnabled()) { jlogger.debug(job.getJobInfo().getJobId(), " event [" + SchedulerEvent.JOB_UPDATED + "]"); } for (ListeningUser listeningUserId : identifications.values()) { if (listeningUserId.isListening()) { UserIdentificationImpl userId = listeningUserId.getUser(); if ((userId.getUserEvents() == null) || userId.getUserEvents().contains(SchedulerEvent.JOB_UPDATED)) { if (!userId.isMyEventsOnly() || (userId.isMyEventsOnly() && userId.getUsername().equals(job.getOwner()))) { listeningUserId.getListener() .addEvent(eventMethods.get(JOB_UPDATED_FULL_DATA_EVENT_METHOD), job); } } } } clearListeners(); } catch (SecurityException e) { logger.error("", e); } }
Source:
static int countBitstreamMime(Context context, BundleName bundleName, Item item, String mimeList) { int count = 0; for(Bundle bundle: item.getBundles()){ if (!bundle.getName().equals(bundleName.name())){ continue; } for(Bitstream bit: bundle.getBitstreams()) { for(String mime: mimeList.split(",")) { try { if (bit.getFormat(context).getMIMEType().equals(mime)) { count++; } } catch (SQLException e) { log.error("Get format error for bitstream " + bit.getName()); } } } } return count; }

Target:
static int countBitstreamMime(Context context, BundleName bundleName, Item item, String mimeList) { int count = 0; for(Bundle bundle: item.getBundles()){ if (!bundle.getName().equals(bundleName.name())){ continue; } for(Bitstream bit: bundle.getBitstreams()) { for(String mime: mimeList.split(",")) { try { if (bit.getFormat(context).getMIMEType().equals(mime.trim())) { count++; } } catch (SQLException e) { log.error("Get format error for bitstream " + bit.getName()); } } } } return count; }
Source:
public void handlePut(RestRequest restRequest, RestResponseChannel restResponseChannel) { if (shouldProceed(restRequest, restResponseChannel)) { try { BlobProperties blobProperties = RestUtils.buildBlobProperties(restRequest.getArgs()); byte[] usermetadata = RestUtils.buildUsermetadata(restRequest.getArgs()); router.putBlob(blobProperties, usermetadata, restRequest, new MockPutCallback(this, restRequest, restResponseChannel, blobProperties)); } catch (RestServiceException e) { handleResponse(restRequest, restResponseChannel, null, e); } } }

Target:
public void handlePut(RestRequest restRequest, RestResponseChannel restResponseChannel) { Exception exception = new RestServiceException("PUT is not supported", RestServiceErrorCode.UnsupportedHttpMethod); handleResponse(restRequest, restResponseChannel, null, exception); }
Source:
public PinotScatterGatherQueryClient(PinotConfig pinotConfig) { requestIdGenerator = new AtomicLong(0); prestoHostId = getDefaultPrestoId(); registry = new MetricsRegistry(); brokerMetrics = new BrokerMetrics(registry, DEFAULT_EMIT_TABLE_LEVEL_METRICS); brokerMetrics.initializeGlobalMeters(); eventLoopGroup = new NioEventLoopGroup(); final NettyClientMetrics clientMetrics = new NettyClientMetrics(registry, "presto_pinot_client_"); resourceManager = new PooledNettyClientResourceManager(eventLoopGroup, new HashedWheelTimer(), clientMetrics); requestSenderPool = Executors.newFixedThreadPool(pinotConfig.getThreadPoolSize()); poolTimeoutExecutor = new ScheduledThreadPoolExecutor(pinotConfig.getCorePoolSize()); connectionTimeout = pinotConfig.getConnectionTimeout(); connPool = new KeyedPoolImpl<PooledNettyClientResourceManager.PooledClientConnection>(pinotConfig.getMinConnectionsPerServer(), pinotConfig.getMaxConnectionsPerServer(), pinotConfig.getIdleTimeout().toMillis(), pinotConfig.getMaxBacklogPerServer(), resourceManager, poolTimeoutExecutor, requestSenderPool, registry); resourceManager.setPool(connPool); scatterGatherer = new ScatterGatherImpl(connPool, requestSenderPool); }

Target:
public PinotScatterGatherQueryClient(PinotConfig pinotConfig) { requestIdGenerator = new AtomicLong(0); prestoHostId = getDefaultPrestoId(); final MetricsRegistry registry = new MetricsRegistry(); brokerMetrics = new BrokerMetrics(registry, DEFAULT_EMIT_TABLE_LEVEL_METRICS); brokerMetrics.initializeGlobalMeters(); eventLoopGroup = new NioEventLoopGroup(); final NettyClientMetrics clientMetrics = new NettyClientMetrics(registry, "presto_pinot_client_"); PooledNettyClientResourceManager resourceManager = new PooledNettyClientResourceManager(eventLoopGroup, new HashedWheelTimer(), clientMetrics); ExecutorService requestSenderPool = Executors.newFixedThreadPool(pinotConfig.getThreadPoolSize()); ScheduledThreadPoolExecutor poolTimeoutExecutor = new ScheduledThreadPoolExecutor(pinotConfig.getCorePoolSize()); connectionTimeout = pinotConfig.getConnectionTimeout(); KeyedPool<PooledNettyClientResourceManager.PooledClientConnection> connectionPool = new KeyedPoolImpl<>( pinotConfig.getMinConnectionsPerServer(), pinotConfig.getMaxConnectionsPerServer(), pinotConfig.getIdleTimeout().toMillis(), pinotConfig.getMaxBacklogPerServer(), resourceManager, poolTimeoutExecutor, requestSenderPool, registry); resourceManager.setPool(connectionPool); scatterGatherer = new ScatterGatherImpl(connectionPool, requestSenderPool); }
Source:
private void addMapReduceJobState(PigJob pigJob) { JobClient jobClientLocal = getJobClient(); try { String id = pigJob.getId(); RunningJob runningJob = jobClientLocal.getJob(id); Properties jobConfProperties = getJobConfFromFile(runningJob); if (runningJob == null) { log.warn("Couldn't find job status for jobId=" + pigJob.getId()); return; } JobID jobID = runningJob.getID(); TaskReport[] mapTaskReport = jobClientLocal.getMapTaskReports(jobID); TaskReport[] reduceTaskReport = jobClientLocal.getReduceTaskReports(jobID); if (jobConfProperties != null && jobConfProperties.size() > 0) { pigJob.setConfiguration(jobConfProperties); } pigJob.setMapReduceJobState(new MapReduceJobState(runningJob, mapTaskReport, reduceTaskReport)); } catch (IOException e) { log.error("Error getting job info.", e); } }

Target:
private void addMapReduceJobState(PigJob pigJob) { JobClient jobClientLocal = getJobClient(); try { String id = pigJob.getId(); RunningJob runningJob = jobClientLocal.getJob(id); Properties jobConfProperties = getJobConfFromFile(runningJob); if (runningJob == null) { log.warn("Couldn't find job status for jobId=" + pigJob.getId()); return; } JobID jobID = runningJob.getID(); TaskReport[] mapTaskReport = jobClientLocal.getMapTaskReports(jobID); TaskReport[] reduceTaskReport = jobClientLocal.getReduceTaskReports(jobID); if (jobConfProperties != null && jobConfProperties.size() > 0) { pigJob.setConfiguration(jobConfProperties); } pigJob.setMapReduceJobState( new MapReduceJobState(runningJob, mapTaskReport, reduceTaskReport)); } catch (IOException e) { log.warn("Error occurred when retrieving job progress info. ", e); } }
Source:
protected void wakeup() { currentInterval = getRegularInterval(); perClusterSet = Collections.newSetFromMap(new ConcurrentHashMap<AffinityRulesEnforcementPerCluster, Boolean>()); for (VDSGroup vdsGroup : vdsGroupDao.getAll()) { perClusterSet.add(createEnforcementPerCluster(vdsGroup)); } AuditLogableBase logable = new AuditLogableBase(); auditLogDirector.log(logable, AuditLogType.AFFINITY_RULES_ENFORCEMENT_MANAGER_START); scheduleJobs(currentInterval, getInitialInterval()); }

Target:
protected void wakeup() { currentInterval = getRegularInterval(); AuditLogableBase logable = new AuditLogableBase(); auditLogDirector.log(logable, AuditLogType.AFFINITY_RULES_ENFORCEMENT_MANAGER_START); scheduleJobs(currentInterval, getInitialInterval()); }
Source:
private void traceGetCommitTimestamps(@Nullable TableReference tableRef, Set<Long> gets) { if (tableRef != null) { log.trace("Getting commit timestamps for a read", SafeArg.of("numTimestamps", gets.size()), LoggingArgs.tableRef(tableRef)); return; } log.trace("Getting commit timestamps", SafeArg.of("numTimestamps", gets.size())); }

Target:
private void traceGetCommitTimestamps(@Nullable TableReference tableRef, Set<Long> gets) { if (tableRef != null) { log.trace("Getting commit timestamps for a read while reading table.", SafeArg.of("numTimestamps", gets.size()), LoggingArgs.tableRef(tableRef)); return; } log.trace("Getting commit timestamps.", SafeArg.of("numTimestamps", gets.size())); }
Source:
private void initRevisionsAction(ChangeInfo info, String revision, NativeMap<ActionInfo> actions) { int currentPatchSet; if (info.currentRevision() != null && info.revisions().containsKey(info.currentRevision())) { currentPatchSet = info.revision(info.currentRevision())._number(); } else { JsArray<RevisionInfo> revList = info.revisions().values(); RevisionInfo.sortRevisionInfoByNumber(revList); currentPatchSet = revList.get(revList.length() - 1)._number(); } String currentlyViewedPatchSet; boolean isPatchSetCurrent = true; String revisionId = info.revision(revision).id(); if (revisionId.equals("edit")) { currentlyViewedPatchSet = Resources.M.editPatchSet(RevisionInfo.findEditParent(info.revisions() .values())); currentPatchSet = info.revisions().values().length() - 1; } else { currentlyViewedPatchSet = revisionId; if (!currentlyViewedPatchSet.equals(Integer.toString(currentPatchSet))) { isPatchSetCurrent = false; } } patchSetsText.setInnerText(Resources.M.patchSets( currentlyViewedPatchSet, currentPatchSet)); if (isPatchSetCurrent) { patchSetsText.removeClassName(style.notCurrentPatchSet()); } else { patchSetsText.addClassName(style.notCurrentPatchSet()); } patchSetsAction = new PatchSetsAction( info.legacyId(), revision, edit, style, headerLine, patchSets); RevisionInfo revInfo = info.revision(revision); if (revInfo.draft()) { if (actions.containsKey("publish")) { publish.setVisible(true); publish.setTitle(actions.get("publish").title()); } if (actions.containsKey("/")) { deleteRevision.setVisible(true); deleteRevision.setTitle(actions.get("/").title()); } } }

Target:
private void initRevisionsAction(ChangeInfo info, String revision, NativeMap<ActionInfo> actions) { int currentPatchSet; if (info.currentRevision() != null && info.revisions().containsKey(info.currentRevision())) { currentPatchSet = info.revision(info.currentRevision())._number(); } else { JsArray<RevisionInfo> revList = info.revisions().values(); RevisionInfo.sortRevisionInfoByNumber(revList); currentPatchSet = revList.get(revList.length() - 1)._number(); } String currentlyViewedPatchSet; boolean isPatchSetCurrent = true; String revisionId = info.revision(revision).id(); if (revisionId.equals("edit")) { currentlyViewedPatchSet = Resources.M.editPatchSet(RevisionInfo.findEditParent(info.revisions() .values())); currentPatchSet = info.revisions().values().length() - 1; } else { currentlyViewedPatchSet = revisionId; if (!currentlyViewedPatchSet.equals(Integer.toString(currentPatchSet))) { isPatchSetCurrent = false; } } patchSetsText.setInnerText(Resources.M.patchSets( currentlyViewedPatchSet, currentPatchSet)); updatePatchSetsTextStyle(isPatchSetCurrent); patchSetsAction = new PatchSetsAction( info.legacyId(), revision, edit, style, headerLine, patchSets); RevisionInfo revInfo = info.revision(revision); if (revInfo.draft()) { if (actions.containsKey("publish")) { publish.setVisible(true); publish.setTitle(actions.get("publish").title()); } if (actions.containsKey("/")) { deleteRevision.setVisible(true); deleteRevision.setTitle(actions.get("/").title()); } } }
Source:
protected boolean checkTenantAutoUnloading(String tenantDomain) throws LazyLoadingTestException { boolean isTenantUnloaded = false; log.info("Sleeping for " + TENANT_IDLE_TIME + " milliseconds (Tenant idle tome)."); try { Thread.sleep(TENANT_IDLE_TIME); } catch (InterruptedException interruptedException) { String customErrorMessage = "InterruptedException occurs when sleeping for TENANT_IDLE_TIME" + interruptedException.getMessage(); log.error(customErrorMessage); throw new LazyLoadingTestException(customErrorMessage, interruptedException); } long totalSleepTime = 0; long startTime = System.currentTimeMillis(); while (System.currentTimeMillis() - startTime < MAX_THRESHOLD_TIME) { isTenantUnloaded = !getTenantStatus(tenantDomain).isTenantContextLoaded(); totalSleepTime = System.currentTimeMillis() - startTime + TENANT_IDLE_TIME; if (isTenantUnloaded) { log.info("Tenant " + tenantDomain + " is unloaded in " + totalSleepTime + "milliseconds. Tenant idle " + "time is :" + TENANT_IDLE_TIME + "milliseconds."); break; } else { try { Thread.sleep(1000); } catch (InterruptedException interruptedException) { String customErrorMessage = "InterruptedException occurs when sleeping 1000 milliseconds and while" + " waiting for tenant to auto unload" + interruptedException.getMessage(); log.error(customErrorMessage); throw new LazyLoadingTestException(customErrorMessage, interruptedException); } } } if (!isTenantUnloaded) { log.info("Tenant " + tenantDomain + " is not unloaded in " + totalSleepTime + "milliseconds. Tenant idle " + "time is :" + TENANT_IDLE_TIME + "milliseconds."); } return isTenantUnloaded; }

Target:
protected boolean checkTenantAutoUnloading(String tenantDomain) throws LazyLoadingTestException { boolean isTenantUnloaded = false; long totalSleepTime = 0; log.info("Sleeping for " + tenantIdleTime + " milliseconds (Tenant idle time)."); try { Thread.sleep(tenantIdleTime); } catch (InterruptedException interruptedException) { String customErrorMessage = "InterruptedException occurs when sleeping for tenantIdleTime" + interruptedException.getMessage(); log.warn(customErrorMessage, interruptedException); } long startTime = System.currentTimeMillis(); while (System.currentTimeMillis() - startTime < MAX_THRESHOLD_TIME) { isTenantUnloaded = !getTenantStatus(tenantDomain).isTenantContextLoaded(); totalSleepTime = System.currentTimeMillis() - startTime + tenantIdleTime; if (isTenantUnloaded) { log.info("Tenant " + tenantDomain + " is unloaded in " + totalSleepTime + "milliseconds. Tenant idle " + "time is :" + tenantIdleTime + "milliseconds."); break; } else { try { Thread.sleep(1000); } catch (InterruptedException interruptedException) { String customErrorMessage = "InterruptedException occurs when sleeping 1000 milliseconds and while waiting for tenant" + " to auto unload" + interruptedException.getMessage(); log.warn(customErrorMessage, interruptedException); } } } if (!isTenantUnloaded) { log.info("Tenant " + tenantDomain + " is not unloaded in " + totalSleepTime + "milliseconds. Tenant idle " + "time is :" + tenantIdleTime + "milliseconds."); } return isTenantUnloaded; }
Source:
public void createNonNullArray() { return new MetaColumn @NonNull [value]; }

Target:
public Object[] createNonNullArray() { return new Object @NonNull[0]; }
Source:
public void closeTest() { HttpRequest request = createRequestWithHeaders(HttpMethod.GET, TestingUri.Close.toString()); EmbeddedChannel channel = createEmbeddedChannel(); channel.writeInbound(request); while (channel.readOutbound() != null) { ; } assertFalse("Channel should be closed", channel.isOpen()); }

Target:
public void closeTest() { HttpRequest request = createRequestWithHeaders(HttpMethod.GET, TestingUri.Close.toString()); EmbeddedChannel channel = createEmbeddedChannel(); channel.writeInbound(request); while (channel.readOutbound() != null) { } assertFalse("Channel should be closed", channel.isOpen()); }
Source:
public void testParseFile() throws Exception { Depgraph depgraph = parseFile(); assertThat(depgraph.getRoots()) .containsExactly( "my/thing/static/js/annotations/annotations-canvas-controller.js", "blaze-out/blah/my/blaze-out-file.js") .inOrder(); assertThat(depgraph.getNonroots()) .containsExactly("javascript/closure/base.js", "javascript/closure/string/string.js") .inOrder(); assertThat(depgraph.getNonrootExterns()).containsExactly("javascript/common/dom.js").inOrder(); }

Target:
public void testParseFile() throws Exception { Depgraph depgraph = parseFile(); assertThat(depgraph.getRoots()) .containsExactly( "my/thing/static/js/annotations/annotations-canvas-controller.js", "blaze-out/blah/my/blaze-out-file.js") .inOrder(); assertThat(depgraph.getNonroots()) .containsExactly("javascript/closure/base.js", "javascript/closure/string/string.js") .inOrder(); assertThat(depgraph.getRootExterns()).isEmpty(); assertThat(depgraph.getNonrootExterns()).containsExactly("javascript/common/dom.js").inOrder(); }
Source:
public static void teardown() { }

Target:
public static void teardown() { laggards.teardown(); }
Source:
private @Nullable Long getTimeFocusedElapsed() { long timeElapsed = (long)(((SystemClock.elapsedRealtime() - timeFocusedAtMs) / 1_000d) + 0.5d); if (timeElapsed < 1 || timeElapsed > 86_400) return null; return timeElapsed; }

Target:
private @Nullable Long getTimeFocusedElapsed() { if (timeFocusedAtMs == null) return null; long timeElapsed = (long)(((SystemClock.elapsedRealtime() - timeFocusedAtMs) / 1_000d) + 0.5d); if (timeElapsed < 1 || timeElapsed > 86_400) return null; return timeElapsed; }
Source:
protected void writeToFile(IFile iFile) { long time1 = System.currentTimeMillis(); try { writer.writeEndDocument(); writer.close(); outputStream.flush(); outputStream.close(); ByteArrayInputStream inputStream = new ByteArrayInputStream(outputStream.toByteArray()); if (iFile.exists()) { iFile.setContents(inputStream, IResource.KEEP_HISTORY | IResource.FORCE, null); } else { checkAndCreateFolderHierarchy(iFile); iFile.create(inputStream, IResource.KEEP_HISTORY | IResource.FORCE, null); } } catch (CoreException | IOException | XMLStreamException e) { Activator.getDefault().logError(e.getMessage(), e); } long time2 = System.currentTimeMillis(); System.out.println("Saving time for System: " + (time2 - time1) + " ms"); }

Target:
protected void writeToFile(IFile iFile) { long startTime = System.currentTimeMillis(); try { writer.writeEndDocument(); writer.close(); outputStream.flush(); outputStream.close(); ByteArrayInputStream inputStream = new ByteArrayInputStream(outputStream.toByteArray()); if (iFile.exists()) { iFile.setContents(inputStream, IResource.KEEP_HISTORY | IResource.FORCE, null); } else { checkAndCreateFolderHierarchy(iFile); iFile.create(inputStream, IResource.KEEP_HISTORY | IResource.FORCE, null); } } catch (CoreException | IOException | XMLStreamException e) { Activator.getDefault().logError(e.getMessage(), e); } long endTime = System.currentTimeMillis(); System.out.println("Saving time for System: " + (endTime - startTime) + " ms"); }
Source:
private boolean isBlockUpload(String request) { return Regex.simpleMatch("PUT *?*comp=block*", request); }

Target:
private boolean isBlockUpload(String request) { return Regex.simpleMatch("PUT *?*comp=block*", request) && request.contains("blockid=")); }
Source:
public void testValidation() { FlatFileItemWriterProperties properties = new FlatFileItemWriterProperties(); properties.setFormatted(true); properties.setDelimited(true); FlatFileItemWriterAutoConfiguration configuration = new FlatFileItemWriterAutoConfiguration( properties); try { configuration.itemWriter(); } catch (IllegalStateException ise) { assertThat(ise.getMessage()).isEqualTo( "An output file must be either delimited or formatted or a custom " + "LineAggregator must be provided. Your current configuration specifies both delimited and formatted"); } catch (Exception e) { fail("Incorrect exception thrown", e); } properties.setFormatted(true); properties.setDelimited(false); ReflectionTestUtils.setField(configuration, "lineAggregator", new PassThroughLineAggregator<>()); try { configuration.itemWriter(); } catch (IllegalStateException ise) { assertThat(ise.getMessage()) .isEqualTo("A LineAggregator must be configured if the " + "output is not formatted or delimited"); } catch (Exception e) { fail("Incorrect exception thrown", e); } properties.setFormatted(false); properties.setDelimited(true); try { configuration.itemWriter(); } catch (IllegalStateException ise) { assertThat(ise.getMessage()) .isEqualTo("A LineAggregator must be configured if the " + "output is not formatted or delimited"); } catch (Exception e) { fail("Incorrect exception thrown", e); } }

Target:
public void testValidation() { FlatFileItemWriterProperties properties = new FlatFileItemWriterProperties(); properties.setFormatted(true); properties.setDelimited(true); FlatFileItemWriterAutoConfiguration configuration = new FlatFileItemWriterAutoConfiguration( properties); try { configuration.itemWriter(); fail("Exception should have been thrown when both formatted and delimited are selected"); } catch (IllegalStateException ise) { assertThat(ise.getMessage()).isEqualTo( "An output file must be either delimited or formatted or a custom " + "LineAggregator must be provided. Your current configuration specifies both delimited and formatted"); } catch (Exception e) { fail("Incorrect exception thrown", e); } properties.setFormatted(true); properties.setDelimited(false); ReflectionTestUtils.setField(configuration, "lineAggregator", new PassThroughLineAggregator<>()); try { configuration.itemWriter(); fail("Exception should have been thrown when a LineAggregator and one of the autocreated options are selected"); } catch (IllegalStateException ise) { assertThat(ise.getMessage()) .isEqualTo("A LineAggregator must be configured if the " + "output is not formatted or delimited"); } catch (Exception e) { fail("Incorrect exception thrown", e); } properties.setFormatted(false); properties.setDelimited(true); try { configuration.itemWriter(); fail("Exception should have been thrown when a LineAggregator and one of the autocreated options are selected"); } catch (IllegalStateException ise) { assertThat(ise.getMessage()) .isEqualTo("A LineAggregator must be configured if the " + "output is not formatted or delimited"); } catch (Exception e) { fail("Incorrect exception thrown", e); } }
Source:
private void loadExtensions(Wallet wallet, WalletExtension[] extensionsList, Protos.Wallet walletProto) throws UnreadableWalletException { final Map<String, WalletExtension> extensions = new HashMap<String, WalletExtension>(); for (WalletExtension e : extensionsList) extensions.put(e.getWalletExtensionID(), e); extensions.putAll(wallet.getExtensions()); for (Protos.Extension extProto : walletProto.getExtensionList()) { String id = extProto.getId(); WalletExtension extension = extensions.get(id); if (extension == null) { if (extProto.getMandatory()) { if (requireMandatoryExtensions) throw new UnreadableWalletException("Unknown mandatory extension in wallet: " + id); else log.error("Unknown extension in wallet {}, ignoring", id); } } else { log.info("Loading wallet extension {}", id); try { wallet.deserializeWalletExtension(extension, extProto.getData().toByteArray()); wallet.addOrGetExistingExtension(extension); } catch (Exception e) { if (extProto.getMandatory() && requireMandatoryExtensions) { log.error("Error whilst reading extension {}, failing to read wallet", id, e); throw new UnreadableWalletException("Could not parse mandatory extension in wallet: " + id); } else { log.error("Error whilst reading extension {}, ignoring", id, e); } } } } }

Target:
private void loadExtensions(Wallet wallet, WalletExtension[] extensionsList, Protos.Wallet walletProto) throws UnreadableWalletException { final Map<String, WalletExtension> extensions = new HashMap<String, WalletExtension>(); for (WalletExtension e : extensionsList) extensions.put(e.getWalletExtensionID(), e); extensions.putAll(wallet.getExtensions()); for (Protos.Extension extProto : walletProto.getExtensionList()) { String id = extProto.getId(); WalletExtension extension = extensions.get(id); if (extension == null) { if (extProto.getMandatory()) { if (requireMandatoryExtensions) throw new UnreadableWalletException("Unknown mandatory extension in wallet: " + id); else log.error("Unknown extension in wallet {}, ignoring", id); } } else { log.info("Loading wallet extension {}", id); try { wallet.deserializeAndAddExtension(extension, extProto.getData().toByteArray()); } catch (Exception e) { if (extProto.getMandatory() && requireMandatoryExtensions) { log.error("Error whilst reading extension {}, failing to read wallet", id, e); throw new UnreadableWalletException("Could not parse mandatory extension in wallet: " + id); } else { log.error("Error whilst reading extension {}, ignoring", id, e); } } } } }
Source:
private void addJars() { List<IAntClasspathEntry> allEntries = new ArrayList<>(); if (currentParent != null) { allEntries.addAll(Arrays.asList(currentParent.getEntries())); } else { IAntClasspathEntry[] entries = antContentProvider.getModel().getEntries(ClasspathModel.USER); if (entries != null) { allEntries.addAll(Arrays.asList(entries)); } } List<IPath> selectedPaths = new ArrayList<>(allEntries.size()); Iterator<IAntClasspathEntry> iterator = allEntries.iterator(); while (iterator.hasNext()) { IAntClasspathEntry entry = iterator.next(); URL url = entry.getEntryURL(); if (url != null) { String file = url.getFile(); if (file != null && file.length() > 0) { for (IFile file2 : ResourcesPlugin.getWorkspace().getRoot().findFilesForLocationURI(new Path(file).toFile().toURI())) { selectedPaths.add(file2.getFullPath()); } } } } IPath[] paths = BuildPathDialogAccess.chooseJAREntries(treeViewer.getControl().getShell(), null, selectedPaths.toArray(new IPath[selectedPaths.size()])); if (paths != null && paths.length > 0) { AntClasspathContentProvider contentProvider = (AntClasspathContentProvider) treeViewer.getContentProvider(); contentProvider.setRefreshEnabled(false); for (IPath path : paths) { String varExpression = VariablesPlugin.getDefault().getStringVariableManager().generateVariableExpression("workspace_loc", path.toString()); contentProvider.add(currentParent, varExpression); } contentProvider.setRefreshEnabled(true); updateContainer(); } }

Target:
private void addJars() { List<IAntClasspathEntry> allEntries = new ArrayList<>(); if (currentParent != null) { allEntries.addAll(Arrays.asList(currentParent.getEntries())); } else { IAntClasspathEntry[] entries = antContentProvider.getModel().getEntries(ClasspathModel.USER); if (entries != null) { allEntries.addAll(Arrays.asList(entries)); } } List<IPath> selectedPaths = new ArrayList<>(allEntries.size()); Iterator<IAntClasspathEntry> iterator = allEntries.iterator(); while (iterator.hasNext()) { IAntClasspathEntry entry = iterator.next(); URL url = entry.getEntryURL(); if (url != null) { String fileName = url.getFile(); if (fileName != null && fileName.length() > 0) { for (IFile file : ResourcesPlugin.getWorkspace().getRoot().findFilesForLocationURI(new Path(fileName).toFile().toURI())) { selectedPaths.add(file.getFullPath()); } } } } IPath[] paths = BuildPathDialogAccess.chooseJAREntries(treeViewer.getControl().getShell(), null, selectedPaths.toArray(new IPath[selectedPaths.size()])); if (paths != null && paths.length > 0) { AntClasspathContentProvider contentProvider = (AntClasspathContentProvider) treeViewer.getContentProvider(); contentProvider.setRefreshEnabled(false); for (IPath path : paths) { String varExpression = VariablesPlugin.getDefault().getStringVariableManager().generateVariableExpression("workspace_loc", path.toString()); contentProvider.add(currentParent, varExpression); } contentProvider.setRefreshEnabled(true); updateContainer(); } }
Source:
public void basicTest() throws Exception { refreshState(false, true); List<String> segmentsUnderCompaction = getLogSegments(0, 2); reduceValidDataSizeInLogSegments(segmentsUnderCompaction, state.log.getSegmentCapacity() - LogSegment.HEADER_SIZE); long deleteReferenceTimeMs = state.time.milliseconds(); compactAndVerify(segmentsUnderCompaction, deleteReferenceTimeMs, true); }

Target:
public void basicTest() throws Exception { refreshState(false, true); List<String> segmentsUnderCompaction = getLogSegments(0, 2); long deleteReferenceTimeMs = reduceValidDataSizeInLogSegments(segmentsUnderCompaction, state.log.getSegmentCapacity() - LogSegment.HEADER_SIZE); compactAndVerify(segmentsUnderCompaction, deleteReferenceTimeMs, true); }
Source:
public byte[] getSrcPathsHash(String[] srcs) { MessageDigest md; try { md = MessageDigest.getInstance("MD5"); } catch (NoSuchAlgorithmException e) { throw new RuntimeException(e); } for (String src: srcs) { md.update(src.getBytes(Charsets.UTF_8)); } return md.digest(); }

Target:
public byte[] getSrcPathsHash(String[] srcs) { synchronized (digest) { for (String src : srcs) { digest.update(src.getBytes(Charsets.UTF_8)); } byte[] result = digest.digest(); digest.reset(); return result; } }
Source:
public static List<ReviewProcessor> buildProcessors(Configuration configuration) { List<ReviewProcessor> processors = new ArrayList<>(); ServiceLoader<ReviewProcessorFactory> theLoader = ServiceLoader.load(ReviewProcessorFactory.class); Iterator<ReviewProcessorFactory> theIterator = theLoader.iterator(); while (theIterator.hasNext()) { ReviewProcessorFactory theFactory = theIterator.next(); if (theFactory.isEnabled(configuration)) { processors.add(theFactory.create(configuration)); } } return processors; }

Target:
public static List<ReviewProcessor> buildProcessors(Configuration configuration) { List<ReviewProcessor> processors = new ArrayList<>(); ServiceLoader<ReviewProcessorFactory> loader = ServiceLoader.load(ReviewProcessorFactory.class); Iterator<ReviewProcessorFactory> iterator = loader.iterator(); while (iterator.hasNext()) { ReviewProcessorFactory factory = iterator.next(); if (factory.isEnabled(configuration)) { processors.add(factory.create(configuration)); } } return processors; }
Source:
public boolean isExist(byte[] key) throws IOException { try { return db.get(handle, key) != null; } catch (RocksDBException e) { throw toIOException( "Failed to check if given key exists", e); } }

Target:
public boolean isExist(byte[] key) throws IOException { try { return db.get(handle, key) != null; } catch (RocksDBException e) { throw toIOException( "Error in accessing DB. ", e); } }
Source:
private void handleExistingObsWithComplexConcept(Obs obs) { if (null != obs.getConcept() && obs.getConcept().isComplex() && null != obs.getComplexData()) { ComplexObsHandler handler = getHandler(obs); if (null != handler) { handler.saveObs(obs); } else { throw new APIException("unknown.handler", new Object[] { obs.getConcept() }); } } }

Target:
private void handleExistingObsWithComplexConcept(Obs obs) { ComplexData complexData = obs.getComplexData(); Concept concept = obs.getConcept(); if (null != concept && concept.isComplex() && null != complexData && null != complexData.getData()) { ComplexObsHandler handler = getHandler(obs); if (null != handler) { handler.saveObs(obs); } else { throw new APIException("unknown.handler", new Object[] {concept}); } } }
Source:
public void updateFormTitle(Form form, ISelection selection) { if (selection instanceof IStructuredSelection) { IStructuredSelection structuredSelection = (IStructuredSelection) selection; Object element = structuredSelection.getFirstElement(); if (element == null) { return; } SiriusInputDescriptor inputDescriptor = new SiriusInputDescriptor(element); EObject semanticElement = inputDescriptor.getSemanticElement(); if (semanticElement != null) { String text = new SiriusToolServices().eefViewText(semanticElement); if (!Util.isBlank(text)) { String[] result = text.split("\r\n|\r|\n", 2); if (result.length >= 1) { form.setText(result[0]); } } form.setImage(ExtendedImageRegistry.INSTANCE.getImage(new SiriusToolServices().eefViewImage(semanticElement))); } } }

Target:
public void updateFormTitle(Form form, ISelection selection) { if (selection instanceof IStructuredSelection) { IStructuredSelection structuredSelection = (IStructuredSelection) selection; Object element = structuredSelection.getFirstElement(); if (element == null) { return; } SiriusInputDescriptor inputDescriptor = new SiriusInputDescriptor(element); EObject semanticElement = inputDescriptor.getSemanticElement(); if (semanticElement != null) { String text = new SiriusToolServices().eefViewText(semanticElement); if (!Util.isBlank(text)) { String[] result = LINE_SEPARATOR_PATTERN.split(text, 2); if (result.length >= 1) { form.setText(result[0]); } } form.setImage(ExtendedImageRegistry.INSTANCE.getImage(new SiriusToolServices().eefViewImage(semanticElement))); } } }
Source:
public static void validateDeploymentProperties(Map<String, String> properties) { if (properties == null) { return; } for (Entry<String, String> property : properties.entrySet()) { String key = property.getKey(); if (!key.startsWith("app.") && !key.startsWith("deployer.") && !key.startsWith("spring.cloud.scheduler.")) { throw new IllegalArgumentException( "Only deployment property keys starting with 'app.', 'deployer.' or, 'spring.cloud.scheduler.' allowed, got '" + key + "'"); } } }

Target:
public static void validateDeploymentProperties(Map<String, String> properties) { if (properties == null) { return; } for (Entry<String, String> property : properties.entrySet()) { String key = property.getKey(); if (!key.startsWith("app.") && !key.startsWith("deployer.") && !key.startsWith("scheduler.")) { throw new IllegalArgumentException( "Only deployment property keys starting with 'app.', 'deployer.' or, 'scheduler.' allowed, got '" + key + "'"); } } }