auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public Timestamp parse(String text) throws TimestampParseException { Temporal tmp = parser.date_strptime(compiledPattern, text); if (tmp == null) { throw new TimestampParseException(); } String zone = tmp.getZone(); DateTimeZone timeZone = defaultTimeZone; if (zone != null) { timeZone = parseDateTimeZone(zone); if (timeZone == null) { throw new TimestampParseException(); } } long localSec = tmp.getSec(); long sec = timeZone.convertLocalToUTC(localSec*1000, false) / 1000; return Timestamp.ofEpochSecond(sec, tmp.getNsec()); }

Target:
public Timestamp parse(String text) throws TimestampParseException { FormatBag bag = parser.parseInternal(compiledPattern, text); if (bag == null) { throw new TimestampParseException("Cannot parse '" + text + "' by '" + format + "'"); } LocalTime local = bag.makeLocalTime(); String zone = local.getZone(); DateTimeZone timeZone = defaultTimeZone; if (zone != null) { timeZone = parseDateTimeZone(zone); if (timeZone == null) { throw new TimestampParseException("Invalid time zone name '" + text + "'"); } } long sec = timeZone.convertLocalToUTC(local.getSeconds()*1000, false) / 1000; return Timestamp.ofEpochSecond(sec, local.getNsecFraction()); }
Source:
private boolean checkAndDisableCliScheduler() { GlusterVolumeEntity metaVolume = getGlusterVolumeDao().getByName(getVdsGroupId(), Config.<String> getValue(ConfigValues.GlusterMetaVolumeName)); VDSGroup cluster = getVdsGroup(); if (metaVolume != null && cluster.isGlusterCliBasedSchedulingOn()) { VdcReturnValueBase returnValue = runInternalAction(VdcActionType.DisableGlusterCliSnapshotScheduleInternal, new GlusterVolumeActionParameters(getGlusterVolumeId(), true)); if (!returnValue.getSucceeded()) { handleVdsErrors(AuditLogType.GLUSTER_CLI_SNAPSHOT_SCHEDULE_DISABLE_FAILED, returnValue.getExecuteFailedMessages()); } else { AuditLogableBase logable = new AuditLogableBase(); logable.setVds(getVds()); logable.setVdsGroupId(getVdsGroupId()); auditLogDirector.log(logable, AuditLogType.GLUSTER_CLI_SNAPSHOT_SCHEDULE_DISABLED); } return returnValue.getSucceeded(); } return true; }

Target:
private boolean checkAndDisableCliScheduler() { GlusterVolumeEntity metaVolume = getGlusterVolumeDao().getByName(getVdsGroupId(), Config.<String> getValue(ConfigValues.GlusterMetaVolumeName)); VDSGroup cluster = getVdsGroup(); if (metaVolume != null && cluster.isGlusterCliBasedSchedulingOn()) { VdcReturnValueBase returnValue = runInternalAction(VdcActionType.DisableGlusterCliSnapshotScheduleInternal, new GlusterVolumeActionParameters(getGlusterVolumeId(), true)); if (!returnValue.getSucceeded()) { handleVdsErrors(AuditLogType.GLUSTER_CLI_SNAPSHOT_SCHEDULE_DISABLE_FAILED, returnValue.getExecuteFailedMessages()); } else { auditLogDirector.log(this, AuditLogType.GLUSTER_CLI_SNAPSHOT_SCHEDULE_DISABLED); } return returnValue.getSucceeded(); } return true; }
Source:
private double[] calculateTranslationFactors(BpmnNode current) { double[] translationFactors = {0, 0}; Bounds bounds; BpmnNode parent = current.getParent(); while(parent != null) { bounds = parent.value().getContent().getBounds(); translationFactors[0] = translationFactors[0] + bounds.getX(); translationFactors[1] = translationFactors[1] + bounds.getY(); parent = parent.getParent(); } return translationFactors; }

Target:
private Point2D calculateTranslationFactors(BpmnNode current) { double xFactor = 0; double yFactor = 0; Bounds bounds; BpmnNode parent = current.getParent(); while (parent != null) { bounds = parent.value().getContent().getBounds(); xFactor += bounds.getX(); yFactor += bounds.getY(); parent = parent.getParent(); } return Point2D.create(xFactor, yFactor); }
Source:
private QuorumServer(long id, InetSocketAddress addr, InetSocketAddress electionAddr, LearnerType type) { this.id = id; this.addr = addr; this.electionAddr = electionAddr; this.type = type; String checkIPReachableValue = System.getProperty("zookeeper.checkIPTimeout"); if(checkIPReachableValue != null){ this.checkIPReachableTO = Integer.parseInt(checkIPReachableValue); } }

Target:
private QuorumServer(long id, InetSocketAddress addr, InetSocketAddress electionAddr, LearnerType type) { this.id = id; this.addr = addr; this.electionAddr = electionAddr; this.type = type; }
Source:
public boolean equals(Object o) { if (o == this) { return true; } if (!(o instanceof TestFilter)) { return false; } TestFilter f = (TestFilter) o; return f.testSizeFilterSet.equals(testSizeFilterSet) && f.testTimeoutFilterSet.equals(testTimeoutFilterSet) && (f.testTagFilter == null && testTagFilter == null || f.testTagFilter != null && f.testTagFilter.equals(testTagFilter)) && f.testLangFilterList.equals(testLangFilterList); }

Target:
public boolean equals(Object o) { if (o == this) { return true; } if (!(o instanceof TestFilter)) { return false; } TestFilter f = (TestFilter) o; return f.testSizeFilterSet.equals(testSizeFilterSet) && f.testTimeoutFilterSet.equals(testTimeoutFilterSet) && Objects.equals(f.testTagFilter, testTagFilter) && f.testLangFilterList.equals(testLangFilterList); }
Source:
boolean cancelJob(String instanceId, String jobId) throws IOException { if (null == jobsUrl) { String restUrl = jstring(credentials, "rest_url"); String resourcesPath = jstring(credentials, "resources_path"); StringBuilder sb = new StringBuilder(restUrl.length() + resourcesPath.length()); sb.append(restUrl); sb.append(resourcesPath); String statusUrl = sb.toString(); JsonObject response = StreamsRestUtils.getGsonResponse(executor, getAuthorization(), statusUrl); JsonElement element = response.get("jobs"); if (null != element) { jobsUrl = element.getAsString(); } else { throw new RESTException("Unable to get jobs URL"); } } Instance instance = getInstance(); if (!instance.getId().equals(instanceId)) { throw new RESTException("Unable to cancel job in instance " + instanceId); } return delete(jobsUrl + "/" + jobId); }

Target:
boolean cancelJob(String instanceId, String jobId) throws IOException { if (null == jobsUrl) { String restUrl = jstring(credentials, "v2_rest_url"); JsonObject response = StreamsRestUtils.getGsonResponse(executor, getAuthorization(), restUrl); JsonElement element = response.get("jobs"); if (null != element) { jobsUrl = element.getAsString(); } else { throw new RESTException("Unable to get jobs URL"); } } Instance instance = getInstance(); if (!instance.getId().equals(instanceId)) { throw new RESTException("Unable to cancel job in instance " + instanceId); } return delete(jobsUrl + "/" + jobId); }
Source:
public void setTimestamp(long timestamp) { this.fTimestamp = timestamp; }

Target:
public void setTimestamp(long timestamp) { fTimestamp = timestamp; }
Source:
public <T> T construct(Class<T> componentType) { if (componentType.equals(ExpirationManager.class)) { return componentType.cast(componentRegistry.getOrCreateComponent(InternalExpirationManager.class)); } CacheMode cacheMode = configuration.clustering().cacheMode(); if (cacheMode.needsStateTransfer()) { if (configuration.transaction().transactionMode().isTransactional()) { return componentType.cast(new TxClusterExpirationManager<>()); } return componentType.cast(new ClusterExpirationManager<>()); } else { return componentType.cast(new ExpirationManagerImpl<>()); } }

Target:
public <T> T construct(Class<T> componentType) { CacheMode cacheMode = configuration.clustering().cacheMode(); if (cacheMode.needsStateTransfer()) { if (configuration.transaction().transactionMode().isTransactional()) { return componentType.cast(new TxClusterExpirationManager<>()); } return componentType.cast(new ClusterExpirationManager<>()); } else { return componentType.cast(new ExpirationManagerImpl<>()); } }
Source:
public Map<NamedKey, byte[]> getBulk(Iterable<NamedKey> keys) { Set<NamedKey> remaining = Sets.newHashSet(keys); Map<NamedKey, byte[]> res1 = level1.getBulk(keys); hitCount.addAndGet(res1.size()); remaining = Sets.difference(remaining, res1.keySet()); if (!remaining.isEmpty()) { Map<NamedKey, byte[]> res2 = level2.getBulk(remaining); int size = res2.size(); hitCount.addAndGet(size); missCount.addAndGet(remaining.size() - size); res1.putAll(res2); } return res1; }

Target:
public Map<NamedKey, byte[]> getBulk(Iterable<NamedKey> keys) { Set<NamedKey> remaining = Sets.newHashSet(keys); Map<NamedKey, byte[]> res = level1.getBulk(keys); hitCount.addAndGet(res.size()); remaining = Sets.difference(remaining, res.keySet()); if (!remaining.isEmpty()) { Map<NamedKey, byte[]> res2 = level2.getBulk(remaining); for(Map.Entry<NamedKey, byte[]> entry : res2.entrySet()) { level1.put(entry.getKey(), entry.getValue()); } int size = res2.size(); hitCount.addAndGet(size); missCount.addAndGet(remaining.size() - size); if (size != 0) { res = Maps.newHashMap(res); res.putAll(res2); } } return res; }
Source:
private void setAllows() { modifyInLock(configuration -> { final Map<String, MutableStorage> storages = configuration.getStorages(); if (storages != null && !storages.isEmpty()) { for (MutableStorage storage : storages.values()) { if (storage.getRepositories() != null && !storage.getRepositories().isEmpty()) { for (Repository repository : storage.getRepositories().values()) { if (repository.getType().equals(RepositoryTypeEnum.GROUP.getType())) { ((MutableRepository)repository).setAllowsDelete(false); ((MutableRepository)repository).setAllowsDeployment(false); ((MutableRepository)repository).setAllowsRedeployment(false); } if (repository.getType().equals(RepositoryTypeEnum.PROXY.getType())) { ((MutableRepository)repository).setAllowsDeployment(false); ((MutableRepository)repository).setAllowsRedeployment(false); } } } } } }, false); }

Target:
private void setAllows() { modifyInLock(configuration -> { final Map<String, MutableStorage> storages = configuration.getStorages(); if (storages != null && !storages.isEmpty()) { for (MutableStorage storage : storages.values()) { if (storage.getRepositories() != null && !storage.getRepositories().isEmpty()) { for (Repository repository : storage.getRepositories().values()) { MutableRepository mutableRepository = (MutableRepository)repository; if (repository.getType().equals(RepositoryTypeEnum.GROUP.getType())) { mutableRepository.setAllowsDelete(false); mutableRepository.setAllowsDeployment(false); mutableRepository.setAllowsRedeployment(false); } if (repository.getType().equals(RepositoryTypeEnum.PROXY.getType())) { mutableRepository.setAllowsDeployment(false); mutableRepository.setAllowsRedeployment(false); } } } } } }, false); }
Source:
private Map<String, ArrayList<CommentInfo>> queryDraftComments(GerritRepository gerritRepository, String change_id, String revision_id, IProgressMonitor monitor) { try { monitor.beginTask("Executing query", IProgressMonitor.UNKNOWN); Gerrit gerrit = gerritRepository.instantiateGerrit(); if (gerrit != null) { ListDraftsCommand command = gerrit.listDraftsComments(change_id, revision_id); Map<String, ArrayList<CommentInfo>> res = null; try { res = command.call(); return res; } catch (EGerritException | ClientProtocolException e) { EGerritCorePlugin.logError(e.getMessage()); } } } catch (UnsupportedClassVersionError e) { return null; } finally { monitor.done(); } return null; }

Target:
private Map<String, ArrayList<CommentInfo>> queryDraftComments(GerritRepository gerritRepository, String change_id, String revision_id, IProgressMonitor monitor) { try { monitor.beginTask("Executing query", IProgressMonitor.UNKNOWN); Gerrit gerrit = gerritRepository.instantiateGerrit(); if (gerrit != null) { ListDraftsCommand command = gerrit.listDraftsComments(change_id, revision_id); Map<String, ArrayList<CommentInfo>> res = null; try { res = command.call(); return res; } catch (EGerritException e) { EGerritCorePlugin.logError(e.getMessage()); } catch (ClientProtocolException e) { UIUtils.displayInformation(null, TITLE, e.getLocalizedMessage() + "\n " + command.formatRequest()); } } } catch (UnsupportedClassVersionError e) { return null; } finally { monitor.done(); } return null; }
Source:
private void setNotFoundBackgroundColor() { patternField.setData(CCS_CLASS_KEY, NO_RESULTS_CLASS); patternField.reskin(SWT.ALL); patternField.update(); noResults = true; }

Target:
private void setNotFoundBackgroundColor() { patternField.setData(CCS_CLASS_KEY, NO_RESULTS_CLASS); patternField.reskin(SWT.ALL); noResults = true; }
Source:
protected @Nullable ISegmentStoreProvider getSegmentStoreProvider(@NonNull ITmfTrace trace) { return TmfTraceUtils.getAnalysisModuleOfClass(trace, CallGraphAnalysis.class, CallGraphViewAnalysis.ID); }

Target:
protected @Nullable ISegmentStoreProvider getSegmentStoreProvider(@NonNull ITmfTrace trace) { return TmfTraceUtils.getAnalysisModuleOfClass(trace, CallGraphAnalysis.class, CallGraphAnalysisUI.ID); }
Source:
public void obtainsAuthor() throws Exception { final User user = NbRule.get(); final Alias alias = user.aliases().iterate().iterator().next(); final Inbox inbox = alias.inbox(); final Bout bout = inbox.bout(inbox.start()); final Attachments attachments = bout.attachments(); final String name = "name"; attachments.create(name); final Attachment attachment = attachments.get(name); MatcherAssert.assertThat( attachment.author(), Matchers.equalTo(alias.name()) ); attachments.delete(name); }

Target:
public void obtainsAuthor() throws Exception { final User user = NbRule.get(); final Alias alias = user.aliases().iterate().iterator().next(); final Inbox inbox = alias.inbox(); final Attachments attachments = inbox.bout(inbox.start()) .attachments(); final String name = "name"; attachments.create(name); final Attachment attachment = attachments.get(name); MatcherAssert.assertThat( attachment.author(), Matchers.equalTo(alias.name()) ); attachments.delete(name); }
Source:
public FindByIndexOptions useIndex(String designDocument, String indexName) { JsonArray index = new JsonArray(); index.add(new JsonPrimitive(designDocument)); index.add(new JsonPrimitive(indexName)); this.useIndex = index; return this; }

Target:
public FindByIndexOptions useIndex(String designDocument, String indexName) { assertNotNull(designDocument, "designDocument"); assertNotNull(indexName, "indexName"); JsonArray index = new JsonArray(); index.add(new JsonPrimitive(designDocument)); index.add(new JsonPrimitive(indexName)); this.useIndex = index; return this; }
Source:
public org.ovirt.engine.core.common.locks.LockInfo getLockInfo(String key) { InternalLockView internalLockView = locks.get(key); if (internalLockView == null) { return null; } Set<String> messages = internalLockView.getMessages(); messages.remove(VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED.name()); if (messages.isEmpty()) { return null; } return new org.ovirt.engine.core.common.locks.LockInfo(internalLockView.getExclusive(), messages); }

Target:
public LockInfo getLockInfo(String key) { InternalLockView internalLockView = locks.get(key); if (internalLockView == null) { return null; } Set<String> messages = internalLockView.getMessages(); messages.remove(VdcBllMessages.ACTION_TYPE_FAILED_OBJECT_LOCKED.name()); if (messages.isEmpty()) { return null; } return new LockInfo(internalLockView.getExclusive(), messages); }
Source:
public void updated(Dictionary<String, ?> config) throws ConfigurationException { if (config != null) { String accessTokenString = (String) config.get("accessToken"); if (isNotBlank(accessTokenString)) { accessToken = accessTokenString; } if (isBlank(accessToken)) { throw new ConfigurationException("ciscospark", "The parameters 'accessToken' is missing! Please refer to your config file."); } String defaultRoomIdString = (String) config.get("defaultRoomId"); if (isNotBlank(defaultRoomIdString)) { defaultRoomId = defaultRoomIdString; } isProperlyConfigured = true; start(); } }

Target:
public void updated(Dictionary<String, ?> config) throws ConfigurationException { if (config != null) { String accessTokenString = Objects.toString(config.get("accessToken")); if (isNotBlank(accessTokenString)) { accessToken = accessTokenString; } if (isBlank(accessToken)) { throw new ConfigurationException("ciscospark", "The parameter 'accessToken' is missing! Please refer to your config file."); } String defaultRoomIdString = Objects.toString(config.get("defaultRoomId")); if (isNotBlank(defaultRoomIdString)) { defaultRoomId = defaultRoomIdString; } isProperlyConfigured = true; start(); } }
Source:
public void successNotOverload(boolean realTime) { pRejected.report(0.0); if(logMINOR) Logger.minor(this, "Success not overload on " + this + " : pRejected=" + pRejected.currentValue()); Peer peer = getPeer(); long now = System.currentTimeMillis(); reportBackoffStatus(now); synchronized(this) { long until; if (true) { if(realTime) routingBackoffLengthRT = INITIAL_ROUTING_BACKOFF_LENGTH; else routingBackoffLengthBulk = INITIAL_ROUTING_BACKOFF_LENGTH; if(logMINOR) Logger.minor(this, "Resetting routing backoff on " + peer); } else { if(logMINOR) Logger.minor(this, "Ignoring successNotOverload: " + (until - now) + "ms remaining on routing backoff on " + peer); return; } } setPeerNodeStatus(now); }

Target:
public void successNotOverload(boolean realTime) { pRejected.report(0.0); if(logMINOR) Logger.minor(this, "Success not overload on " + this + " : pRejected=" + pRejected.currentValue()); Peer peer = getPeer(); long now = System.currentTimeMillis(); reportBackoffStatus(now); synchronized(this) { long until; if(realTime) routingBackoffLengthRT = INITIAL_ROUTING_BACKOFF_LENGTH; else routingBackoffLengthBulk = INITIAL_ROUTING_BACKOFF_LENGTH; if(logMINOR) Logger.minor(this, "Resetting routing backoff on " + peer); } setPeerNodeStatus(now); }
Source:
public void setUp() throws Exception { queryRunner = TpchQueryRunnerBuilder.builder().build(); queryRunner.installPlugin(new Plugin() { @Override public Iterable<ConnectorFactory> getConnectorFactories() { MockConnectorFactory.Builder builder = new MockConnectorFactory.Builder(); MockConnectorFactory connectorFactory = builder.withListSchemaNames(session -> ImmutableList.of("UPPER_CASE_SCHEMA")) .withListTables((session, schemaNameOrNull) -> { throw new UnsupportedOperationException(); }) .withGetViews((session, prefix) -> ImmutableMap.of()) .withGetColumnHandles((session, tableHandle) -> { throw new UnsupportedOperationException(); }) .build(); return ImmutableList.of(connectorFactory); } }); queryRunner.createCatalog("upper_case_schema_catalog", "mock"); metadataManager = (MetadataManager) queryRunner.getMetadata(); }

Target:
public void setUp() throws Exception { queryRunner = TpchQueryRunnerBuilder.builder().build(); queryRunner.installPlugin(new Plugin() { @Override public Iterable<ConnectorFactory> getConnectorFactories() { MockConnectorFactory connectorFactory = MockConnectorFactory.builder() .withListSchemaNames(session -> ImmutableList.of("UPPER_CASE_SCHEMA")) .withListTables((session, schemaNameOrNull) -> { throw new UnsupportedOperationException(); }) .withGetViews((session, prefix) -> ImmutableMap.of()) .withGetColumnHandles((session, tableHandle) -> { throw new UnsupportedOperationException(); }) .build(); return ImmutableList.of(connectorFactory); } }); queryRunner.createCatalog("upper_case_schema_catalog", "mock"); metadataManager = (MetadataManager) queryRunner.getMetadata(); }
Source:
public int hashCode() { int hash = 1; final int prime = 31; hash = hash * prime + (int) (delegate.hashCode()); return hash; }

Target:
public int hashCode() { return this.delegate.hashCode(); }
Source:
public void match(final AbstractInsnNode start, final IFilterOutput output) { if (Opcodes.IFNONNULL != start.getOpcode()) { return; } cursor = start; nextIsNew(KOTLIN_TYPE_CAST_EXCEPTION); nextIs(Opcodes.DUP); nextIs(Opcodes.LDC); if (cursor == null) { return; } final LdcInsnNode ldc = (LdcInsnNode) cursor; if (ldc.cst.getClass() != String.class) { return; } if (!((String) ldc.cst) .startsWith("null cannot be cast to non-null type")) { return; } nextIsInvokeSuper(KOTLIN_TYPE_CAST_EXCEPTION, "(Ljava/lang/String;)V"); nextIs(Opcodes.ATHROW); if (cursor == null) { return; } if (cursor.getNext() != ((JumpInsnNode) start).label) { return; } output.ignore(start, cursor); }

Target:
public void match(final AbstractInsnNode start, final IFilterOutput output) { if (Opcodes.IFNONNULL != start.getOpcode()) { return; } cursor = start; nextIsNew(KOTLIN_TYPE_CAST_EXCEPTION); nextIs(Opcodes.DUP); nextIs(Opcodes.LDC); if (cursor == null) { return; } final LdcInsnNode ldc = (LdcInsnNode) cursor; if (!(ldc.cst instanceof String && ((String) ldc.cst) .startsWith("null cannot be cast to non-null type"))) { return; } nextIsInvokeSuper(KOTLIN_TYPE_CAST_EXCEPTION, "(Ljava/lang/String;)V"); nextIs(Opcodes.ATHROW); if (cursor == null) { return; } if (cursor.getNext() != ((JumpInsnNode) start).label) { return; } output.ignore(start, cursor); }
Source:
void setup(AlertDialog.Builder builder, TriggerType triggerType) { if (triggerType == TriggerType.DIALOG_POSITIVE) { if (isLabelResourceBased) { builder.setPositiveButton(buttonLabelResourceId, new DialogButtonActionPerformer(action)); } else { builder.setPositiveButton(buttonLabel, new DialogButtonActionPerformer(action)); } } else if (triggerType == TriggerType.DIALOG_NEGATIVE) { if (isLabelResourceBased) { builder.setNegativeButton(buttonLabelResourceId, new DialogButtonActionPerformer(action)); } else { builder.setNegativeButton(buttonLabel, new DialogButtonActionPerformer(action)); } } else if (triggerType == TriggerType.DIALOG_NEUTRAL) { if (isLabelResourceBased) { builder.setNegativeButton(buttonLabelResourceId, new DialogButtonActionPerformer(action)); } else { builder.setNegativeButton(buttonLabel, new DialogButtonActionPerformer(action)); } } }

Target:
void setup(AlertDialog.Builder builder, TriggerType triggerType) { if (triggerType == TriggerType.DIALOG_POSITIVE) { if (isLabelResourceBased) { builder.setPositiveButton(buttonLabelResourceId, new DialogButtonActionPerformer(action)); } else { builder.setPositiveButton(buttonLabel, new DialogButtonActionPerformer(action)); } } else if (triggerType == TriggerType.DIALOG_NEGATIVE) { if (isLabelResourceBased) { builder.setNegativeButton(buttonLabelResourceId, new DialogButtonActionPerformer(action)); } else { builder.setNegativeButton(buttonLabel, new DialogButtonActionPerformer(action)); } } else if (triggerType == TriggerType.DIALOG_NEUTRAL) { if (isLabelResourceBased) { builder.setNeutralButton(buttonLabelResourceId, new DialogButtonActionPerformer(action)); } else { builder.setNeutralButton(buttonLabel, new DialogButtonActionPerformer(action)); } } }
Source:
public void addCompletedTransactionTask(CompleteTransactionTask task, Boolean missingTxn) { if (task.getTimestamp() == CompleteTransactionMessage.INITIAL_TIMESTAMP && (hasRestartCompletion(task) || missingTxn)) { return; } if (task.getTimestamp() != CompleteTransactionMessage.INITIAL_TIMESTAMP && m_fragTask != null && m_fragTask.getTxnId() == task.getMsgTxnId()) { m_fragTask = null; } Pair<CompleteTransactionTask, Boolean> pair = m_compTasks.get(task.getMsgTxnId()); if ( pair == null) { m_compTasks.put(task.getMsgTxnId(), Pair.of(task, missingTxn)); } else { if ( task.getTimestamp() > pair.getFirst().getTimestamp() && isComparable(pair.getFirst(), task)) { m_compTasks.remove(task.getMsgTxnId()); m_compTasks.put(task.getMsgTxnId(), Pair.of(task, missingTxn)); } } }

Target:
public void addCompletedTransactionTask(CompleteTransactionTask task, Boolean missingTxn) { if (task.getTimestamp() == CompleteTransactionMessage.INITIAL_TIMESTAMP && (hasRestartCompletion(task) || missingTxn)) { return; } if (task.getTimestamp() != CompleteTransactionMessage.INITIAL_TIMESTAMP && m_fragTask != null && m_fragTask.getTxnId() == task.getMsgTxnId()) { m_fragTask = null; } Pair<CompleteTransactionTask, Boolean> pair = m_compTasks.get(task.getMsgTxnId()); if ( pair == null) { m_compTasks.put(task.getMsgTxnId(), Pair.of(task, missingTxn)); } else { if ( task.getTimestamp() > pair.getFirst().getTimestamp() && isComparable(pair.getFirst(), task)) { m_compTasks.put(task.getMsgTxnId(), Pair.of(task, missingTxn)); } } }
Source:
public void importSources(FolderEntry baseFolder, SourceStorage sourceStorage, LineConsumerFactory lineConsumerFactory) throws ForbiddenException, ConflictException, UnauthorizedException, IOException, ServerException { if (!baseFolder.isFolder()) { throw new IOException("Project cannot be imported into \"" + baseFolder.getName() + "\". " + "It is not a folder."); } this.subversionApi.setOutputLineConsumerFactory(lineConsumerFactory); subversionApi.checkout(newDto(CheckoutRequest.class) .withProjectPath(baseFolder.getVirtualFile().toIoFile().getAbsolutePath()) .withUrl(sourceStorage.getLocation()) .withUserName(sourceStorage.getParameters().remove("userName")) .withPassword(sourceStorage.getParameters().remove("password"))); }

Target:
public void importSources(FolderEntry baseFolder, SourceStorage sourceStorage, LineConsumerFactory lineConsumerFactory) throws ForbiddenException, ConflictException, UnauthorizedException, IOException, ServerException { if (!baseFolder.isFolder()) { throw new IOException("Project cannot be imported into \"" + baseFolder.getName() + "\". " + "It is not a folder."); } this.subversionApi.setOutputLineConsumerFactory(lineConsumerFactory); subversionApi.checkout(newDto(CheckoutRequest.class) .withProjectPath(baseFolder.getVirtualFile().toIoFile().getAbsolutePath()) .withUrl(sourceStorage.getLocation()) .withUsername(sourceStorage.getParameters().remove("username")) .withPassword(sourceStorage.getParameters().remove("password"))); }
Source:
private boolean next(List<Cell> results, boolean raw) throws IOException { boolean hasMore = raw ? delegate.nextRaw(results) : delegate.next(results); if (pageFilter == null) { return hasMore; } if (!hasMore) { if (pageFilter.isStopped()) { delegate.close(); byte[] rowKey = pageFilter.getRowKeyAtStop(); scan.withStartRow(rowKey, true); delegate = region.getScanner(scan); if (results.isEmpty()) { getDummyResult(rowKey, results); } pageFilter.init(); return true; } return false; } else { pageFilter.resetStartTime(); } return true; }

Target:
private boolean next(List<Cell> results, boolean raw) throws IOException { try { boolean hasMore = raw ? delegate.nextRaw(results) : delegate.next(results); if (pageFilter == null) { return hasMore; } if (!hasMore) { if (pageFilter.isStopped()) { delegate.close(); byte[] rowKey = pageFilter.getRowKeyAtStop(); scan.withStartRow(rowKey, true); delegate = region.getScanner(scan); if (results.isEmpty()) { getDummyResult(rowKey, results); } pageFilter.init(); return true; } return false; } else { pageFilter.resetStartTime(); return true; } } catch (Exception e) { pageFilter.init(); throw e; } }
Source:
public OracleQuarterDiffFunction() { super("(select sign(i1) * floor(abs(i1)) from (values (trunc(-months_between(?1, ?2))/3)) as temp(i1))"); }

Target:
public OracleQuarterDiffFunction() { super("trunc(-months_between(?1, ?2)/3)"); }
Source:
public List<DCInputSet> getInputsByCollectionHandle(String collectionHandle) throws DCInputsReaderException { SubmissionConfig config; try { config = new SubmissionConfigReader().getSubmissionConfigByCollection(collectionHandle); String formName = config.getSubmissionName(); if (formName == null) { throw new DCInputsReaderException("No form designated as default"); } List<DCInputSet> results = new ArrayList<DCInputSet>(); for (int idx = 0; idx < config.getNumberOfSteps(); idx++) { SubmissionStepConfig step = config.getStep(idx); if(SubmissionStepConfig.INPUT_FORM_STEP_NAME.equals(step.getType())) { results.add(getInputsByFormName(step.getId())); } } return results; } catch (ServletException e) { throw new DCInputsReaderException("No form designated as default"); } }

Target:
public List<DCInputSet> getInputsByCollectionHandle(String collectionHandle) throws DCInputsReaderException { SubmissionConfig config; try { config = new SubmissionConfigReader().getSubmissionConfigByCollection(collectionHandle); String formName = config.getSubmissionName(); if (formName == null) { throw new DCInputsReaderException("No form designated as default"); } List<DCInputSet> results = new ArrayList<DCInputSet>(); for (int idx = 0; idx < config.getNumberOfSteps(); idx++) { SubmissionStepConfig step = config.getStep(idx); if(SubmissionStepConfig.INPUT_FORM_STEP_NAME.equals(step.getType())) { results.add(getInputsByFormName(step.getId())); } } return results; } catch (SubmissionConfigReaderException e) { throw new DCInputsReaderException("No form designated as default", e); } }
Source:
public List<String> getInvalidityInfo() { FieldValidator validator = new FieldValidator(); List<String> errors = new ArrayList<String>(); String error; error = validator.getInvalidityInfo(FieldValidator.FieldType.GOOGLE_ID, googleId); if (!error.isEmpty()) { errors.add(error); } error = shortName.isEmpty() ? "" : validator.getInvalidityInfo( FieldValidator.FieldType.PERSON_NAME, shortName); if (!error.isEmpty()) { errors.add(error); } error = email.isEmpty() ? "" : validator.getInvalidityInfo( FieldValidator.FieldType.EMAIL, email); if (!error.isEmpty()) { errors.add(error); } error = institute.isEmpty() ? "" : validator.getInvalidityInfo( FieldValidator.FieldType.INSTITUTE_NAME, institute); if (!error.isEmpty()) { errors.add(error); } error = nationality.isEmpty() ? "" : validator.getInvalidityInfo( FieldValidator.FieldType.NATIONALITY, nationality); if (!error.isEmpty()) { errors.add(error); } error = validator.getInvalidityInfo(FieldValidator.FieldType.GENDER, gender); if (!error.isEmpty()) { errors.add(error); } Assumption.assertNotNull(this.pictureKey); return errors; }

Target:
public List<String> getInvalidityInfo() { FieldValidator validator = new FieldValidator(); List<String> errors = new ArrayList<String>(); String error; error = validator.getInvalidityInfo(FieldValidator.FieldType.GOOGLE_ID, googleId); if (!error.isEmpty()) { errors.add(error); } if (!shortName.isEmpty()) { error = validator.getInvalidityInfo(FieldValidator.FieldType.PERSON_NAME, shortName); if (!error.isEmpty()) { errors.add(error); } } if (!email.isEmpty()) { error = validator.getInvalidityInfo(FieldValidator.FieldType.EMAIL, email); if (!error.isEmpty()) { errors.add(error); } } if (!institute.isEmpty()) { error = validator.getInvalidityInfo(FieldValidator.FieldType.INSTITUTE_NAME, institute); if (!error.isEmpty()) { errors.add(error); } } if (!nationality.isEmpty()) { error = validator.getInvalidityInfo(FieldValidator.FieldType.NATIONALITY, nationality); if (!error.isEmpty()) { errors.add(error); } } error = validator.getInvalidityInfo(FieldValidator.FieldType.GENDER, gender); if (!error.isEmpty()) { errors.add(error); } Assumption.assertNotNull(this.pictureKey); return errors; }
Source:
public static void reLogin() throws UnknownHostException, ClassNotFoundException, SQLException{ Login login = new Login(); login.setVisible(true); System.out.println("Got HEre"); }

Target:
public static void reLogin(){ Login login = new Login(); login.setVisible(true); }
Source:
private void fillDropDown(final String value, final String[] enumeratedValues, final boolean isMultipleSelect, final ListBox listBox) { listBox.clear(); final Set<String> currentValues = getCurrentValues(value, isMultipleSelect); int selectedIndexOffset = addItems(listBox); boolean selected = false; for (int i = 0; i < enumeratedValues.length; i++) { String enumeratedValue = enumeratedValues[i]; String val; if (enumeratedValue.indexOf('=') > 0) { final String[] splut = ConstraintValueHelper.splitValue(enumeratedValue); final String realValue = splut[0]; final String display = splut[1]; val = realValue; listBox.addItem(display, realValue); } else { listBox.addItem(enumeratedValue); val = enumeratedValue; } if (value != null && currentValues.contains(val)) { listBox.setItemSelected(i + selectedIndexOffset, true); selected = true; } } if (!selected) { selectItem(listBox); } }

Target:
private void fillDropDown(final String value, final String[] enumeratedValues, final boolean isMultipleSelect, final ListBox listBox) { listBox.clear(); final Set<String> currentValues = getCurrentValues(value, isMultipleSelect); int selectedIndexOffset = addItems(listBox); boolean selected = false; for (int i = 0; i < enumeratedValues.length; i++) { String enumeratedValue = enumeratedValues[i]; String val; if (enumeratedValue.indexOf('=') > 0) { final String[] split = ConstraintValueHelper.splitValue(enumeratedValue); final String realValue = split[0]; final String display = split[1]; val = realValue; listBox.addItem(display, realValue); } else { listBox.addItem(enumeratedValue); val = enumeratedValue; } if (value != null && currentValues.contains(val)) { listBox.setItemSelected(i + selectedIndexOffset, true); selected = true; } } if (!selected) { selectItem(listBox); } }
Source:
public Triple(String[] line) { this.line = line; processTriple(this.line); }

Target:
public Triple(String[] line) { Preconditions.checkArgument(line.length == 3); try { this.leftObjectProperty = line[0].split(":")[0]; this.leftObject = line[0].split(":")[1]; this.relationship = line[1]; this.rightObjectProperty = line[2].split(":")[0]; this.rightObject = line[2].split(":")[1]; } catch (IllegalArgumentException e) { e.printStackTrace(); } }
Source:
synchronized void submitEncryptionTasks() { if (m_hasOutstandingTask.compareAndSet(false, true)) { Runnable task = new Runnable() { @Override public void run() { DBBPool.BBContainer fragCont = null; boolean queuedEncBuffers = false; SettableFuture<Void> sf = null; try { while ((fragCont = writeStream().getWriteBuffer()) != null) { sf = SettableFuture.create(); m_encryptionResults.add(sf); fragCont.b().flip(); int nBytesClear = fragCont.b().remaining(); final DBBPool.BBContainer encCont = m_sslBufferEncrypter.encryptBuffer(fragCont.b().slice()); fragCont.discard(); fragCont = null; m_encryptedBuffers.offer(new EncryptionResult(encCont, nBytesClear, sf)); sf = null; queuedEncBuffers = true; } if (! m_isShuttingDown.get() && queuedEncBuffers) { m_network.addToChangeList(m_port, true); } } catch (IOException ioe) { networkLog.error("Exception wrapping an SSL frame", ioe); return; } finally { if (fragCont != null) { fragCont.discard(); } if (sf != null) { sf.setException(new Throwable("Encryption of buffer failed.")); } m_hasOutstandingTask.set(false); } } }; try { m_sslEncryptionService.submitForEncryption(task); } catch (RejectedExecutionException e) { } } }

Target:
synchronized void submitEncryptionTasks() { if (! m_hasOutstandingTask) { try { m_sslEncryptionService.submitForEncryption(m_encTask); m_hasOutstandingTask = true; } catch (RejectedExecutionException e) { } } }
Source:
public void addToAppsStore(File file) { AndroidApp app = null; try { app = selendroidApkBuilder.resignApp(file); } catch (ShellCommandException e) { throw new SessionNotCreatedException("An error occurred while resigning the app '" + file.getName() + "'. ", e); } catch (AndroidSdkException e) { e.printStackTrace(); } String appId = null; try { appId = app.getAppId(); appsStore.put(appId, app); log.info("App " + appId + " has been added to selendroid standalone server."); } catch (AndroidSdkException e) { log.info("Ignoring app because an error occurred reading the app details: " + file.getAbsolutePath()); log.info(e.getMessage()); } }

Target:
public void addToAppsStore(File file) throws AndroidSdkException { AndroidApp app = null; try { app = selendroidApkBuilder.resignApp(file); } catch (ShellCommandException e) { throw new SessionNotCreatedException( "An error occurred while resigning the app '" + file.getName() + "'. ", e); } String appId = null; try { appId = app.getAppId(); } catch (AndroidSdkException e) { log.info("Ignoring app because an error occurred reading the app details: " + file.getAbsolutePath()); log.info(e.getMessage()); } if (appId != null && !appsStore.containsKey(appId)) { appsStore.put(appId, app); log.info("App " + appId + " has been added to selendroid standalone server."); } }
Source:
public void filter(ContainerRequestContext requestContext) { var chargeEntity = getChargeFromRequest(requestContext); var gatewayAccountEntity = chargeEntity.map(ChargeEntity::getGatewayAccount) .or(() -> getAccountFromRequest(requestContext)); chargeEntity.ifPresent(charge -> MDC.put(PAYMENT_EXTERNAL_ID, charge.getExternalId())); gatewayAccountEntity.ifPresent(gatewayAccount -> { MDC.put(GATEWAY_ACCOUNT_ID, gatewayAccount.getId().toString()); MDC.put(PROVIDER, gatewayAccount.getGatewayName()); MDC.put(GATEWAY_ACCOUNT_TYPE, gatewayAccount.getType()); }); getPathParameterFromRequest("refundId", requestContext) .ifPresent(refund -> MDC.put(REFUND_EXTERNAL_ID, refund)); getPathParameterFromRequest("chargeTokenId", requestContext) .ifPresent(token -> MDC.put(SECURE_TOKEN, token)); getPathParameterFromRequest("gatewayTransactionId", requestContext) .ifPresent(gatewayTxId -> MDC.put("gateway_transaction_id", gatewayTxId)); }

Target:
public void filter(ContainerRequestContext requestContext) { var chargeEntity = getChargeFromRequest(requestContext); var gatewayAccountEntity = chargeEntity.map(ChargeEntity::getGatewayAccount) .or(() -> getAccountFromRequest(requestContext)); chargeEntity.ifPresent(charge -> MDC.put(PAYMENT_EXTERNAL_ID, charge.getExternalId())); gatewayAccountEntity.ifPresent(gatewayAccount -> { MDC.put(GATEWAY_ACCOUNT_ID, gatewayAccount.getId().toString()); MDC.put(PROVIDER, gatewayAccount.getGatewayName()); MDC.put(GATEWAY_ACCOUNT_TYPE, gatewayAccount.getType()); }); getPathParameterFromRequest("refundId", requestContext) .ifPresent(refund -> MDC.put(REFUND_EXTERNAL_ID, refund)); getPathParameterFromRequest("chargeTokenId", requestContext) .ifPresent(token -> MDC.put(SECURE_TOKEN, token)); getPathParameterFromRequest("gatewayTransactionId", requestContext) .ifPresent(gatewayTxId -> MDC.put(PROVIDER_PAYMENT_ID, gatewayTxId)); }
Source:
List<GermplasmList> retrieveAndValidateIfHasGermplasmList(Integer studyId) throws MiddlewareQueryException, CrossingTemplateExportException { List<GermplasmList> crossesList = this.fieldbookMiddlewareService.getGermplasmListsByProjectId(studyId, GermplasmListType.NURSERY); if (crossesList.isEmpty()) { throw new CrossingTemplateExportException("study.export.crosses.no.germplasm.list.available"); } return crossesList; }

Target:
List<GermplasmList> retrieveAndValidateIfHasGermplasmList(Integer studyId) throws CrossingTemplateExportException { List<GermplasmList> crossesList = this.fieldbookMiddlewareService.getGermplasmListsByProjectId(studyId, GermplasmListType.NURSERY); if (crossesList.isEmpty()) { throw new CrossingTemplateExportException("study.export.crosses.no.germplasm.list.available"); } return crossesList; }
Source:
public final void createsStatus() throws Exception { final String sha = "0abcd89jcabitest"; final MkContainer container = new MkGrizzlyContainer().next( new MkAnswer.Simple( HttpURLConnection.HTTP_CREATED, Json.createObjectBuilder().add("state", "failure") .add("target_url", "<LINK_0>") .add("description", "Build has completed successfully") .add("context", "continuous-integration/jenkins") .build().toString() ) ).start(); final Request req = new ApacheRequest(container.home()); final Statuses statuses = new RtStatuses( req, new RtCommit(req, repo(), sha) ); try { final Status status = statuses.create( new RtStatus( Status.State.failure, "<LINK_1>", "description", "ctx" ) ); MatcherAssert.assertThat( status, Matchers.instanceOf(Status.class) ); MatcherAssert.assertThat( container.take().method(), Matchers.equalTo(Request.POST) ); MatcherAssert.assertThat( status.state().name(), Matchers.equalTo(Status.State.failure.name()) ); } finally { container.stop(); } }

Target:
public final void createsStatus() throws Exception { final MkContainer container = new MkGrizzlyContainer().next( new MkAnswer.Simple( HttpURLConnection.HTTP_CREATED, Json.createObjectBuilder().add("state", "failure") .add("target_url", "<LINK_0>") .add("description", "Build has completed successfully") .add("context", "continuous-integration/jenkins") .build().toString() ) ).start(); final Request req = new ApacheRequest(container.home()); final Statuses statuses = new RtStatuses( req, new RtCommit(req, repo(), "0abcd89jcabitest") ); try { statuses.create( new RtStatus( Status.State.Failure, "<LINK_1>", "description", "ctx" ) ); MatcherAssert.assertThat( container.take().method(), Matchers.equalTo(Request.POST) ); Matchers.equalToIgnoringCase(Status.State.Failure.name()); } finally { container.stop(); } }
Source:
public TmfEventsTableHeader(Composite parent, int style, IEventsTableHeaderListener listener) { super(parent, style); fListener = listener; fLayout = new RowLayout(); fLayout.marginTop = 0; fLayout.marginBottom = 0; fLayout.marginLeft = EXPANDED.getBounds().width; setLayout(fLayout); fLabelBackground = new Color(getDisplay(), 255, 255, 192); getParent().addControlListener(new ControlAdapter() { @Override public void controlResized(ControlEvent e) { getParent().layout(); } }); addPaintListener(e -> { if (fCollapsed) { e.gc.drawImage(COLLAPSED, 0, 0); } else { e.gc.drawImage(EXPANDED, 0, 0); } }); addMouseListener(new MouseAdapter() { @Override public void mouseDown(MouseEvent e) { toggle(); } }); }

Target:
public TmfEventsTableHeader(Composite parent, int style, IEventsTableHeaderListener listener) { super(parent, style); fListener = listener; fLayout = new RowLayout(); fLayout.marginTop = 0; fLayout.marginBottom = 0; fLayout.marginLeft = EXPANDED.getBounds().width; setLayout(fLayout); fLabelBackground = new Color(getDisplay(), LABEL_BACKGROUND); getParent().addControlListener(new ControlAdapter() { @Override public void controlResized(ControlEvent e) { getParent().layout(); } }); addPaintListener(e -> { if (fCollapsed) { e.gc.drawImage(COLLAPSED, 0, 0); } else { e.gc.drawImage(EXPANDED, 0, 0); } }); addMouseListener(new MouseAdapter() { @Override public void mouseDown(MouseEvent e) { toggle(); } }); }
Source:
private @CheckForNull CachedRepo cachedSource(Node node, EnvVars env, Launcher launcher, TaskListener listener, boolean useTimeout, StandardUsernameCredentials credentials) { if (!CACHE_LOCAL_REPOS && getSource(env).matches("(file:|[/\\\\]).+")) { return null; } MercurialInstallation inst = findInstallation(installation); if (inst == null || !inst.isUseCaches()) { return null; } try { FilePath cache = Cache.fromURL(getSource(env), credentials).repositoryCache(inst, node, launcher, listener, useTimeout); if (cache != null) { return new CachedRepo(cache.getRemote(), inst.isUseSharing()); } else { listener.error("Failed to use repository cache for " + getSource(env)); return null; } } catch (Throwable x) { x.printStackTrace(listener.error("Failed to use repository cache for " + getSource(env))); return null; } }

Target:
private @CheckForNull CachedRepo cachedSource(Node node, EnvVars env, Launcher launcher, TaskListener listener, boolean useTimeout, StandardUsernameCredentials credentials) throws InterruptedException { if (!CACHE_LOCAL_REPOS && getSource(env).matches("(file:|[/\\\\]).+")) { return null; } MercurialInstallation inst = findInstallation(installation); if (inst == null || !inst.isUseCaches()) { return null; } try { FilePath cache = Cache.fromURL(getSource(env), credentials).repositoryCache(inst, node, launcher, listener, useTimeout); if (cache != null) { return new CachedRepo(cache.getRemote(), inst.isUseSharing()); } else { listener.error("Failed to use repository cache for " + getSource(env)); return null; } } catch (InterruptedException x) { throw x; } catch (Exception x) { x.printStackTrace(listener.error("Failed to use repository cache for " + getSource(env))); return null; } }
Source:
protected void contextDisposed(IPresentationContext context) { List<InputData> removed = new ArrayList<>(1); synchronized (fInputToData) { for (Iterator<Entry<DefaultBreakpointsViewInput, InputData>> itr = fInputToData.entrySet().iterator(); itr.hasNext();) { Map.Entry<DefaultBreakpointsViewInput, InputData> entry = itr.next(); IPresentationContext entryContext = entry.getKey().getContext(); if (context.equals(entryContext)) { removed.add(entry.getValue()); itr.remove(); } } } for (InputData element : removed) { element.dispose(); } }

Target:
protected void contextDisposed(IPresentationContext context) { List<InputData> removed = new ArrayList<>(1); synchronized (fInputToData) { for (Iterator<Entry<DefaultBreakpointsViewInput, InputData>> itr = fInputToData.entrySet().iterator(); itr.hasNext();) { Map.Entry<DefaultBreakpointsViewInput, InputData> entry = itr.next(); IPresentationContext entryContext = entry.getKey().getContext(); if (context.equals(entryContext)) { removed.add(entry.getValue()); itr.remove(); } } } for (InputData inputData : removed) { inputData.dispose(); } }
Source:
private void createServer(final String googleUserName, final String sshPublicKey, final String sshPrivateKey) throws RunNodesException, TimeoutException, IOException { System.out.format("Create Server%n"); Template template = computeService.templateBuilder() .locationId(ZONE) .hardwareId(getHardware().getId()) .imageId(getImage().getId()) .build(); template.getOptions().as(GoogleComputeEngineTemplateOptions.class) .overrideLoginCredentials((new LoginCredentials.Builder()) .user(googleUserName) .privateKey(sshPrivateKey) .build()) .authorizePublicKey(sshPublicKey); Set<? extends NodeMetadata> nodes = computeService.createNodesInGroup(NAME, 1, template); NodeMetadata nodeMetadata = nodes.iterator().next(); String publicAddress = nodeMetadata.getPublicAddresses().iterator().next(); System.out.format(" %s%n", nodeMetadata); System.out.format(" Instance %s started with IP %s%n", nodeMetadata.getName(), publicAddress); }

Target:
private void createServer(final String googleUserName, final String sshPublicKey, final String sshPrivateKey) throws RunNodesException, TimeoutException, IOException { System.out.format("Create Server%n"); Template template = computeService.templateBuilder() .locationId(ZONE) .hardwareId(getHardware().getId()) .imageId(getImage().getId()) .build(); template.getOptions() .overrideLoginCredentials((new LoginCredentials.Builder()) .user(googleUserName) .privateKey(sshPrivateKey) .build()) .authorizePublicKey(sshPublicKey); Set<? extends NodeMetadata> nodes = computeService.createNodesInGroup(NAME, 1, template); NodeMetadata nodeMetadata = nodes.iterator().next(); String publicAddress = nodeMetadata.getPublicAddresses().iterator().next(); System.out.format(" %s%n", nodeMetadata); System.out.format(" Instance %s started with IP %s%n", nodeMetadata.getName(), publicAddress); }
Source:
protected boolean isEnabled() { Eval eval = new Eval(interpreter, variableManager); return eval.get(EefPackage.Literals.EEF_WIDGET_DESCRIPTION__IS_ENABLED_EXPRESSION, getWidgetDescription().getIsEnabledExpression(), Boolean.class); }

Target:
protected boolean isEnabled() { Eval eval = new Eval(interpreter, variableManager); Boolean result = eval.get(EefPackage.Literals.EEF_WIDGET_DESCRIPTION__IS_ENABLED_EXPRESSION, getWidgetDescription().getIsEnabledExpression(), Boolean.class); if (result != null) { return result.booleanValue(); } return true; }
Source:
public void testPushForMasterWithHashtags() throws GitAPIException, OrmException, IOException, RestApiException { String hashtag1 = "tag1"; List<String> expected = Arrays.asList(hashtag1); PushOneCommit.Result r = pushTo("refs/for/master%hashtag=" + hashtag1); r.assertOkStatus(); r.assertChange(Change.Status.NEW, null); String changeId = r.getChangeId(); RestResponse response = adminSession.get("/changes/" + changeId + "/hashtags/"); assertResult(response, expected); String hashtag2 = "tag2"; expected = Arrays.asList(hashtag1, hashtag2); r = pushTo("refs/for/master%hashtag=" + hashtag1 + ",hashtag=" + hashtag2); r.assertOkStatus(); r.assertChange(Change.Status.NEW, null); changeId = r.getChangeId(); response = adminSession.get("/changes/" + changeId + "/hashtags/"); assertResult(response, expected); }

Target:
public void testPushForMasterWithHashtags() throws GitAPIException, OrmException, IOException, RestApiException { String hashtag1 = "tag1"; List<String> expected = Arrays.asList(hashtag1); PushOneCommit.Result r = pushTo("refs/for/master%hashtag=" + hashtag1); r.assertOkStatus(); r.assertChange(Change.Status.NEW, null); String changeId = r.getChangeId(); RestResponse response = adminSession.get("/changes/" + changeId + "/hashtags/"); assertResultList(response, expected); String hashtag2 = "tag2"; expected = Arrays.asList(hashtag1, hashtag2); r = pushTo("refs/for/master%hashtag=" + hashtag1 + ",hashtag=" + hashtag2); r.assertOkStatus(); r.assertChange(Change.Status.NEW, null); changeId = r.getChangeId(); response = adminSession.get("/changes/" + changeId + "/hashtags/"); assertResultList(response, expected); }