auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private OmVolumeArgs getVolumeInfo(OMMetadataManager omMetadataManager, String volume) throws IOException { omMetadataManager.getLock().acquireVolumeLock(volume); try { String dbVolumeKey = omMetadataManager.getVolumeKey(volume); OmVolumeArgs volumeArgs = omMetadataManager.getVolumeTable().get(dbVolumeKey); if (volumeArgs == null) { LOG.debug("volume:{} does not exist", volume); throw new OMException("Volume " + volume + " is not found", OMException.ResultCodes.VOLUME_NOT_FOUND); } return volumeArgs; } catch (IOException ex) { if (!(ex instanceof OMException)) { LOG.warn("Info volume failed for volume:{}", volume, ex); } throw ex; } finally { omMetadataManager.getLock().releaseVolumeLock(volume); } }

Target:
private OmVolumeArgs getVolumeInfo(OMMetadataManager omMetadataManager, String volume) throws IOException { String dbVolumeKey = omMetadataManager.getVolumeKey(volume); OmVolumeArgs volumeArgs = omMetadataManager.getVolumeTable().get(dbVolumeKey); if (volumeArgs == null) { throw new OMException("Volume " + volume + " is not found", OMException.ResultCodes.VOLUME_NOT_FOUND); } return volumeArgs; }
Source:
public Stream<BlankNodeOrIRI> getGraphNames() { RepositoryConnection conn = getRepositoryConnection(); RepositoryResult<Resource> contexts = conn.getContextIDs(); return Iterations.stream(contexts).map(g -> (BlankNodeOrIRI) rdf4jTermFactory.asRDFTerm(g)); }

Target:
public Stream<BlankNodeOrIRI> getGraphNames() { try (RepositoryConnection conn = getRepositoryConnection()) { RepositoryResult<Resource> contexts = conn.getContextIDs(); return Iterations.stream(contexts).map(g -> (BlankNodeOrIRI) rdf4jTermFactory.asRDFTerm(g)); } }
Source:
EventBus forward(String address, Object message) { forward(address, message, null); return null; }

Target:
EventBus forward(String address, Object message) { return forward(address, message, null); }
Source:
public void afterTestExecution(ExtensionContext context) { Method testMethod = context.getRequiredTestMethod(); long start = getStore(context).remove(testMethod, long.class); long duration = System.currentTimeMillis() - start; System.out.printf("completed in %d ms.%n", duration); }

Target:
public void afterTestExecution(ExtensionContext context) { TestInformation testInformation = getStore(context) .remove(context.getRequiredTestMethod(), TestInformation.class); long duration = System.currentTimeMillis() - testInformation.startMillis; System.out.printf("%s completed in %d ms.%n", testInformation.logPrefix, duration); }
Source:
public String getString(String dataType, BigInteger address, MemoryByte[] data) { StringBuilder strBuffer = new StringBuilder(); String paddedStr = DebugUIPlugin.getDefault().getPreferenceStore().getString(IDebugUIConstants.PREF_PADDED_STR); for (MemoryByte d : data) { if (d.isReadable()) { strBuffer.append(new String(RenderingsUtil.convertByteToCharArray(d.getValue()))); } else { strBuffer.append(paddedStr); } } return strBuffer.toString().toUpperCase(); }

Target:
public String getString(String dataType, BigInteger address, MemoryByte[] data) { StringBuilder strBuffer = new StringBuilder(); String paddedStr = DebugUIPlugin.getDefault().getPreferenceStore().getString(IDebugUIConstants.PREF_PADDED_STR); for (MemoryByte memByte : data) { if (memByte.isReadable()) { strBuffer.append(new String(RenderingsUtil.convertByteToCharArray(memByte.getValue()))); } else { strBuffer.append(paddedStr); } } return strBuffer.toString().toUpperCase(); }
Source:
public Map<Long, Set<TObject>> chronologize(String key, long record, long start, long end, Map<Long, Set<TObject>> context) { Set<TObject> set = Iterables.getLast(context.values(), Sets.<TObject> newLinkedHashSet()); for (Iterator<Write> it = iterator(key, record, end); it.hasNext();) { Write write = it.next(); long writeTimeStamp = write.getVersion(); if(writeTimeStamp >= start) { Text writtenKey = write.getKey(); long writtenRecordId = write.getRecord().longValue(); Action action = write.getType(); if(writtenKey.toString().equals(key) && writtenRecordId == record) { set = Sets.newLinkedHashSet(set); Value newValue = write.getValue(); if(action == Action.ADD) { set.add(newValue.getTObject()); } else if(action == Action.REMOVE) { set.remove(newValue.getTObject()); } context.put(writeTimeStamp, set); } } } return context; }

Target:
public Map<Long, Set<TObject>> chronologize(String key, long record, long start, long end, Map<Long, Set<TObject>> context) { Set<TObject> snapshot = Iterables.getLast(context.values(), Sets.<TObject> newLinkedHashSet()); for (Iterator<Write> it = iterator(key, record, end); it.hasNext();) { Write write = it.next(); long timestamp = write.getVersion(); if(timestamp >= end){ break; } else{ Text writtenKey = write.getKey(); long writtenRecordId = write.getRecord().longValue(); Action action = write.getType(); if(writtenKey.toString().equals(key) && writtenRecordId == record) { snapshot = Sets.newLinkedHashSet(snapshot); Value newValue = write.getValue(); if(action == Action.ADD) { snapshot.add(newValue.getTObject()); } else if(action == Action.REMOVE) { snapshot.remove(newValue.getTObject()); } if(timestamp >= start && !snapshot.isEmpty()) context.put(timestamp, snapshot); } } } return context; }
Source:
@Override public void rebalanceEnabled(boolean rebalanceEnabled) { kernal.context().cache().context().rebalanceEnabled(rebalanceEnabled); }

Target:
@Override public void rebalanceEnabled(boolean rebalanceEnabled) { kernal.rebalanceEnabled(rebalanceEnabled); }
Source:
public static JavaTypeDefinition forClass(TypeDefinitionType type, JavaTypeDefinition... intersectionTypes) { switch (type) { case EXACT: if (intersectionTypes.length == 1) { return intersectionTypes[0]; } else { throw new IllegalArgumentException("Exact intersection types do not exist!"); } case UPPER_BOUND: case UPPER_WILDCARD: return new JavaTypeDefinitionSpecial(type, intersectionTypes); case LOWER_WILDCARD: return new JavaTypeDefinitionLower(intersectionTypes); default: throw new IllegalStateException("Unknow type"); } }

Target:
public static JavaTypeDefinition forClass(TypeDefinitionType type, JavaTypeDefinition... intersectionTypes) { switch (type) { case EXACT: if (intersectionTypes.length == 1) { return intersectionTypes[0]; } else { throw new IllegalArgumentException("Exact intersection types do not exist!"); } case UPPER_BOUND: case UPPER_WILDCARD: return new JavaTypeDefinitionUpper(type, intersectionTypes); case LOWER_WILDCARD: return new JavaTypeDefinitionLower(intersectionTypes); default: throw new IllegalStateException("Unknow type"); } }
Source:
protected void initOperations() { if (opsInitialized) { return; } AutomationService service = Framework.getService(AutomationService.class); if (service == null) { return; } OperationType[] ops = service.getOperations(); List<OperationType> oops = Arrays.asList(ops); Collections.sort(oops, Comparator.comparing(OperationType::getId)); for (OperationType op : oops) { OperationDocumentation documentation; try { documentation = op.getDocumentation(); } catch (OperationException e) { throw new NuxeoException(e); } this.operations.add(new OperationInfoImpl(documentation, getVersion(), op.getType().getCanonicalName(), op.getContributingComponent())); } opsInitialized = true; }

Target:
protected void initOperations() { if (opsInitialized) { return; } AutomationService service = Framework.getService(AutomationService.class); if (service == null) { return; } OperationType[] ops = service.getOperations(); List<OperationType> oops = Arrays.asList(ops); oops.sort(Comparator.comparing(OperationType::getId)); for (OperationType op : oops) { OperationDocumentation documentation; try { documentation = op.getDocumentation(); } catch (OperationException e) { throw new NuxeoException(e); } this.operations.add(new OperationInfoImpl(documentation, getVersion(), op.getType().getCanonicalName(), op.getContributingComponent())); } opsInitialized = true; }
Source:
public void doConfigSubmit(StaplerRequest req, StaplerResponse rsp) throws ServletException, IOException, InterruptedException { Job project = getProject(); if (project == null) { return; } project.checkPermission(Item.BUILD); if (isRebuildAvailable()) { if (!req.getMethod().equals("POST")) { req.getView(this, "index.jelly").forward(req, rsp); return; } build = req.findAncestorObject(Run.class); ParametersDefinitionProperty paramDefProp = build.getParent().getProperty( ParametersDefinitionProperty.class); List<ParameterValue> values = new ArrayList<ParameterValue>(); ParametersAction paramAction = build.getAction(ParametersAction.class); JSONObject formData = req.getSubmittedForm(); if (!formData.isEmpty()) { JSONArray a = JSONArray.fromObject(formData.get("parameter")); for (Object o : a) { JSONObject jo = (JSONObject)o; String name = jo.getString("name"); ParameterValue parameterValue = getParameterValue(paramDefProp, name, paramAction, req, jo); if (parameterValue != null) { values.add(parameterValue); } } } Set<ParameterValue> mergedValues = ImmutableSortedSet.copyOf(new Comparator<ParameterValue>() { @Override public int compare(ParameterValue o1, ParameterValue o2) { return o1.getName().compareTo(o2.getName()); } }, Iterables.concat(values, paramAction.getParameters())); List<Action> actions = constructRebuildCause(build, new ParametersAction(Lists.newArrayList(mergedValues))); Hudson.getInstance().getQueue().schedule((Queue.Task) build.getParent(), 0, actions); rsp.sendRedirect("../../"); } }

Target:
public void doConfigSubmit(StaplerRequest req, StaplerResponse rsp) throws ServletException, IOException, InterruptedException { Job project = getProject(); if (project == null) { return; } project.checkPermission(Item.BUILD); if (isRebuildAvailable()) { if (!req.getMethod().equals("POST")) { req.getView(this, "index.jelly").forward(req, rsp); return; } build = req.findAncestorObject(Run.class); ParametersDefinitionProperty paramDefProp = build.getParent().getProperty( ParametersDefinitionProperty.class); List<ParameterValue> values = new ArrayList<ParameterValue>(); ParametersAction paramAction = build.getAction(ParametersAction.class); JSONObject formData = req.getSubmittedForm(); if (!formData.isEmpty()) { JSONArray a = JSONArray.fromObject(formData.get("parameter")); for (Object o : a) { JSONObject jo = (JSONObject)o; String name = jo.getString("name"); ParameterValue parameterValue = getParameterValue(paramDefProp, name, paramAction, req, jo); if (parameterValue != null) { values.add(parameterValue); } } } Set<ParameterValue> mergedValues = ImmutableSortedSet.copyOf(new Comparator<ParameterValue>() { @Override public int compare(ParameterValue o1, ParameterValue o2) { return o1.getName().compareTo(o2.getName()); } }, Iterables.concat(values, paramAction == null ? new ArrayList<ParameterValue>() : paramAction.getParameters())); List<Action> actions = constructRebuildCause(build, new ParametersAction(Lists.newArrayList(mergedValues))); Hudson.getInstance().getQueue().schedule((Queue.Task) build.getParent(), 0, actions); rsp.sendRedirect("../../"); } }
Source:
public NGuid getStorageDomainId() { Guid storageDomainId = getParameters().getStorageDomainId(); if (Guid.Empty.equals(storageDomainId) && getVm() != null && getVm().getDiskMap() != null && !getVm().getDiskMap().isEmpty()) { return getDisksStorageDomainId(); } return storageDomainId == null ? Guid.Empty : storageDomainId; }

Target:
public NGuid getStorageDomainId() { if (super.getStorageDomainId() == null) { Guid storageDomainId = getParameters().getStorageDomainId(); if (Guid.Empty.equals(storageDomainId) && getVm() != null && getVm().getDiskMap() != null && !getVm().getDiskMap().isEmpty()) { storageDomainId = getDisksStorageDomainId(); } else if (storageDomainId == null) { storageDomainId = Guid.Empty; } setStorageDomainId(storageDomainId); return storageDomainId; } return super.getStorageDomainId(); }
Source:
public void plotPlayerRatingGraph() { OffsetDateTime afterDate = switch (timePeriodComboBox.getValue()) { case LAST_MONTH -> OffsetDateTime.of(LocalDateTime.now().minusMonths(1), ZoneOffset.UTC); case LAST_YEAR -> OffsetDateTime.of(LocalDateTime.now().minusYears(1), ZoneOffset.UTC); case ALL_TIME -> OffsetDateTime.of(LocalDateTime.MIN, ZoneOffset.UTC); }; List<XYChart.Data<Long, Integer>> values = ratingData.stream() .filter(dataPoint -> dataPoint.getInstant().isAfter(afterDate)) .map(dataPoint -> new Data<>(dataPoint.getInstant().toEpochSecond(), RatingUtil.getRating(dataPoint))) .collect(Collectors.toList()); xAxis.setTickLabelFormatter(ratingLabelFormatter()); if (values.size() > 0) { xAxis.setLowerBound(values.get(0).getXValue()); xAxis.setUpperBound(values.get(values.size() - 1).getXValue()); } xAxis.setTickUnit((xAxis.getUpperBound() - xAxis.getLowerBound()) / 10); XYChart.Series<Long, Integer> series = new XYChart.Series<>(observableList(values)); series.setName(i18n.get("userInfo.ratingOverTime")); ratingHistoryChart.setData(FXCollections.observableList(Collections.singletonList(series))); }

Target:
public void plotPlayerRatingGraph() { OffsetDateTime afterDate = OffsetDateTime.of(timePeriodComboBox.getValue().getDate(), ZoneOffset.UTC); List<XYChart.Data<Long, Integer>> values = ratingData.stream() .filter(dataPoint -> dataPoint.getInstant().isAfter(afterDate)) .map(dataPoint -> new Data<>(dataPoint.getInstant().toEpochSecond(), RatingUtil.getRating(dataPoint))) .collect(Collectors.toList()); xAxis.setTickLabelFormatter(ratingLabelFormatter()); if (values.size() > 0) { xAxis.setLowerBound(values.get(0).getXValue()); xAxis.setUpperBound(values.get(values.size() - 1).getXValue()); } xAxis.setTickUnit((xAxis.getUpperBound() - xAxis.getLowerBound()) / 10); XYChart.Series<Long, Integer> series = new XYChart.Series<>(observableList(values)); series.setName(i18n.get("userInfo.ratingOverTime")); ratingHistoryChart.setData(FXCollections.observableList(Collections.singletonList(series))); }
Source:
private Boolean visitDeep(AbstractAbstractFileNode<? extends AbstractFile> node) { boolean hasChildren = node.hasContentChildren(); if (!hasChildren) { return true; } List<Content> derivedChildren = node.getContentChildren(); for (Content childContent : derivedChildren) { if ((childContent instanceof AbstractFile) && ((AbstractFile) childContent).isDir()) { return false; } else { try{ if(0 < Case.getCurrentCase().getSleuthkitCase().getVisibleContentChildrenCount(childContent)){ return false; } } catch (TskCoreException e){ logger.log(Level.SEVERE, "Error checking if file node is leaf.", e); } } } return true; }

Target:
private Boolean visitDeep(AbstractAbstractFileNode<? extends AbstractFile> node) { boolean hasChildren = node.hasContentChildren(); if (!hasChildren) { return true; } List<Content> derivedChildren = node.getContentChildren(); for (Content childContent : derivedChildren) { if ((childContent instanceof AbstractFile) && ((AbstractFile) childContent).isDir()) { return false; } else { if(AbstractContentNode.contentHasVisibleContentChildren(childContent)){ return false; } } } return true; }
Source:
private MacPool decoratePool(MacPool macPool, List<MacPoolDecorator> decorators) { if (decorators == null || decorators.isEmpty()) { log.debug("No MacPoolDecorators passed to decorate pool {}. ", macPool); return macPool; } MacPool result = macPool; log.debug("Decorating MacPool with decorators: {}.", Arrays.toString(decorators.toArray())); for (MacPoolDecorator decorator : decorators) { decorator.setMacPool(result); result = decorator; } return result; }

Target:
private MacPool decoratePool(MacPool macPool, List<MacPoolDecorator> decorators) { if (CollectionUtils.isEmpty(decorators)) { log.debug("No MacPoolDecorators were passed to decorate pool {}. ", macPool); return macPool; } MacPool result = macPool; log.debug("Decorating MacPool with decorators: {}.", Arrays.toString(decorators.toArray())); for (MacPoolDecorator decorator : decorators) { decorator.setMacPool(result); result = decorator; } return result; }
Source:
private static long calculateRetainedSizeWithoutLoading(Page page) { long retainedSizeInBytes = 0; for (int channel = 0; channel < page.getChannelCount(); channel++) { Block block = page.getBlock(channel); if (!isUnloadedLazyBlock(block)) { retainedSizeInBytes += block.getRetainedSizeInBytes(); } } return retainedSizeInBytes; }

Target:
private static long calculateRetainedSizeWithoutLoading(Page page) { long retainedSizeInBytes = Page.INSTANCE_SIZE + SizeOf.sizeOfObjectArray(page.getChannelCount()); for (int channel = 0; channel < page.getChannelCount(); channel++) { Block block = page.getBlock(channel); if (!isUnloadedLazyBlock(block)) { retainedSizeInBytes += block.getRetainedSizeInBytes(); } } return retainedSizeInBytes; }
Source:
public long getAllCount() { return 5; }

Target:
public long getAllCount() { return service.getAllVisits().size(); }
Source:
public JavaScriptDimFilter( @JsonProperty("dimension") String dimension, @JsonProperty("dimensions") String[] dimensions, @JsonProperty("function") String function ) { Preconditions.checkArgument(dimension != null || dimensions != null, "dimension or dimensions must not be null"); Preconditions.checkArgument(!(dimension != null && dimensions != null), "both dimension and dimensions are defined"); Preconditions.checkArgument(function != null, "function must not be null"); this.dimensions = (dimension != null) ? new String[]{dimension} : dimensions; this.function = function; }

Target:
public JavaScriptDimFilter( @JsonProperty("dimension") String dimension, @JsonProperty("dimensions") String[] dimensions, @JsonProperty("function") String function ) { Preconditions.checkArgument(dimension != null ^ dimensions != null, "dimensions(xor dimension) must not be null"); Preconditions.checkArgument(function != null, "function must not be null"); this.dimensions = (dimensions != null) ? dimensions : new String[]{dimension}; this.function = function; }
Source:
public static RelBuilderFactory proto(final Context context) { return new RelBuilderFactory() { public RelBuilder create(RelOptCluster cluster, RelOptSchema schema) { return new VoltPRelBuilder(context, cluster, schema); } }; }

Target:
public static RelBuilderFactory proto(final Context context) { return (cluster, schema) -> new VoltPRelBuilder(context, cluster, schema); }
Source:
public void testSplitterXML() throws Exception { LineSplitter splitter = new LineSplitter(); splitter.setFormat(Format.XML); Stream<StringHandle> contentStream = splitter.split(new FileInputStream(xmlFile)); assertNotNull(contentStream); StringHandle[] result = contentStream.toArray(size -> new StringHandle[size]); assertNotNull(result); assertEquals(result.length, Files.lines(Paths.get(xmlFile)).count()); String[] originalResult = Files.lines(Paths.get(xmlFile)) .toArray(size -> new String[size]); assertEquals(result[0].getFormat(), Format.XML); for (int i = 0; i < result.length && i < originalResult.length; i++) { assertNotNull(result[i].get()); assertEquals(result[i].get(), originalResult[i]); } }

Target:
public void testSplitterXML() throws Exception { LineSplitter splitter = new LineSplitter(); splitter.setFormat(Format.XML); Stream<StringHandle> contentStream = splitter.split(new FileInputStream(xmlFile)); assertNotNull(contentStream); String[] originalResult = Files.lines(Paths.get(xmlFile)) .toArray(size -> new String[size]); checkContent(contentStream, splitter.getFormat(), originalResult); }
Source:
private void bootstrapMachines() throws InfrastructureException, InterruptedException { CompletableFuture<InfrastructureException> firstFailed = new CompletableFuture<>(); List<CompletableFuture> checkMachines = new ArrayList<>(machines.size()); for (OpenShiftMachine machine : machines.values()) { checkMachines.add( CompletableFuture.runAsync( () -> { try { machine.waitRunning(machineStartTimeoutMin); bootstrapMachine(machine); checkMachineServers(machine); } catch (InfrastructureException ex) { sendFailedEvent(machine.getName(), ex.getMessage()); firstFailed.completeExceptionally(ex); throw new CompletionException(ex); } catch (InterruptedException ei) { throw new CompletionException(ei); } }) .thenAccept( a -> { if (!firstFailed.isCompletedExceptionally()) { sendRunningEvent(machine.getName()); } })); } CompletableFuture<Void> allAvailable = CompletableFuture.allOf(checkMachines.toArray(new CompletableFuture[0])); try { CompletableFuture.anyOf(allAvailable, firstFailed).join(); } catch (CompletionException e) { if (firstFailed.isDone()) { throw firstFailed.join(); } else if (e.getCause() instanceof InterruptedException) { throw (InterruptedException) e.getCause(); } else { throw new InfrastructureException(e.getCause().getMessage(), e.getCause()); } } }

Target:
private void bootstrapMachines() throws InfrastructureException, InterruptedException { List<CompletableFuture> checkMachines = new ArrayList<>(machines.size()); List<BootstrapMachineTask> tasks = new ArrayList<>(machines.size()); for (OpenShiftMachine machine : machines.values()) { BootstrapMachineTask task = new BootstrapMachineTask(machine); tasks.add(task); checkMachines.add(pool.runAsync(task)); } try { CompletableFuture.allOf(checkMachines.toArray(new CompletableFuture[checkMachines.size()])) .join(); } catch (CompletionException e) { tasks.forEach(BootstrapMachineTask::interrupt); if (e.getCause() instanceof InterruptedException) { throw (InterruptedException) e.getCause(); } else if (e.getCause() instanceof InfrastructureException) { throw (InfrastructureException) e.getCause(); } else { throw new InternalInfrastructureException(e.getCause().getMessage(), e.getCause()); } } }
Source:
private void setMerged(final Change c, final ChangeMessage msg) throws OrmException { try { db.changes().beginTransaction(c.getId()); CodeReviewCommit commit = commits.get(c.getId()); PatchSet.Id merged = commit.change.currentPatchSetId(); setMergedPatchSet(c.getId(), merged); PatchSetApproval submitter = saveApprovals(c, merged); addMergedMessage(submitter, msg); db.commit(); sendMergedEmail(c, submitter); if (submitter != null) { try { hooks.doChangeMergedHook(c, accountCache.get(submitter.getAccountId()).getAccount(), db.patchSets().get(commit.patchsetId), db); } catch (OrmException ex) { log.error("Cannot run hook for submitted patch set " + c.getId(), ex); } } } finally { db.rollback(); } indexer.indexAsync(c); }

Target:
private void setMerged(final Change c, final ChangeMessage msg) throws OrmException, IOException { try { db.changes().beginTransaction(c.getId()); CodeReviewCommit commit = commits.get(c.getId()); PatchSet.Id merged = commit.change.currentPatchSetId(); setMergedPatchSet(c.getId(), merged); PatchSetApproval submitter = saveApprovals(c, merged); addMergedMessage(submitter, msg); db.commit(); sendMergedEmail(c, submitter); if (submitter != null) { try { hooks.doChangeMergedHook(c, accountCache.get(submitter.getAccountId()).getAccount(), db.patchSets().get(commit.patchsetId), db); } catch (OrmException ex) { log.error("Cannot run hook for submitted patch set " + c.getId(), ex); } } } finally { db.rollback(); } indexer.index(c); }
Source:
protected final String getObjectComparisonString( final SimplePredicate.Op op, final ExpressionOperatorParameter parameters) { if (op == SimplePredicate.Op.LIKE) { return new StringBuilder("(") .append(getLeft().getJavaString(parameters)) .append(".indexOf(") .append(getRight().getJavaString(parameters)) .append(')') .append(">=0") .append(")") .toString(); } else return new StringBuilder("(") .append(getLeft().getJavaString(parameters)) .append(".compareTo(") .append(getRight().getJavaString(parameters)) .append(')') .append(op.toJavaString()) .append(0) .append(")") .toString(); }

Target:
protected final String getObjectComparisonString( final SimplePredicate.Op op, final ExpressionOperatorParameter parameters) { if (op == SimplePredicate.Op.LIKE) { return new StringBuilder("(") .append(getLeft().getJavaString(parameters)) .append(".toLowerCase().matches(") .append(getRight().getJavaString(parameters)) .append( ".toLowerCase().replace(\".\", \"\\.\").replace(\"?\", \".\").replace(\"%\", \".*\")") .append("))") .toString(); } else return new StringBuilder("(") .append(getLeft().getJavaString(parameters)) .append(".compareTo(") .append(getRight().getJavaString(parameters)) .append(')') .append(op.toJavaString()) .append(0) .append(")") .toString(); }
Source:
private OsgpUnit toStandardUnit(final DlmsUnitTypeDto dlmsUnit) { if ("M_3".equals(dlmsUnit.getUnit())) { return OsgpUnit.M3; } else { try { return OsgpUnit.valueOf(dlmsUnit.getUnit()); } catch (IllegalArgumentException e) { return OsgpUnit.UNDEFINED; } } }

Target:
private OsgpUnit toStandardUnit(final DlmsUnitTypeDto dlmsUnit) { if ("M_3".equals(dlmsUnit.getUnit())) { return OsgpUnit.M3; } else { for (OsgpUnit osgpUnit : OsgpUnit.values()) { if (osgpUnit.name().equals(dlmsUnit.getUnit())) { return osgpUnit; } } } return OsgpUnit.UNDEFINED; }
Source:
public void call(final Subscriber<? super Intent> subscriber) { final BroadcastReceiver broadcastReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { subscriber.onNext(intent); } }; final Subscription subscription = AndroidSubscriptions.unsubscribeInUiThread(new Action0() { @Override public void call() { context.unregisterReceiver(broadcastReceiver); } }); subscriber.add(subscription); Intent stickyIntent = context.registerReceiver(broadcastReceiver, intentFilter, broadcastPermission, schedulerHandler); if (stickyIntent != null) { subscriber.onNext(stickyIntent); } }

Target:
public void call(final Subscriber<? super Intent> subscriber) { final BroadcastReceiver broadcastReceiver = new BroadcastReceiver() { @Override public void onReceive(Context context, Intent intent) { subscriber.onNext(intent); } }; final Subscription subscription = Subscriptions.create(new Action0() { @Override public void call() { context.unregisterReceiver(broadcastReceiver); } }); subscriber.add(subscription); Intent stickyIntent = context.registerReceiver(broadcastReceiver, intentFilter, broadcastPermission, schedulerHandler); if (stickyIntent != null) { subscriber.onNext(stickyIntent); } }
Source:
public void onlyConsequenceTypesShouldBeConverted() { ConsequenceType consequenceType = new ConsequenceType("geneName", "ensemblGeneId", "ensemblTranscriptId", "strand", "biotype", 0, 0, 0, "aaChange", "codon", new ArrayList<>(), new ArrayList<>()); List<ConsequenceType> consequenceTypes = Collections.singletonList(consequenceType); VariantAnnotation annotation = new VariantAnnotation("1", 1, 2, "A", "T"); annotation.setConsequenceTypes(consequenceTypes); DBObject dbObject = converter.convert(annotation); assertNotNull(dbObject); LinkedList cts = (LinkedList) dbObject.get(AnnotationFieldNames.CONSEQUENCE_TYPE_FIELD); assertTrue(cts.size() == 1); HashSet<BasicDBObject> xrefs = (HashSet) dbObject.get(AnnotationFieldNames.XREFS_FIELD); assertFalse(isXrefPresent(xrefs, "OS01G0112100", "ensemblGene")); assertTrue(isXrefPresent(xrefs, "ensemblGeneId", "ensemblGene")); assertTrue(isXrefPresent(xrefs, "geneName", "HGNC")); assertTrue(isXrefPresent(xrefs, "ensemblTranscriptId", "ensemblTranscript")); }

Target:
public void onlyConsequenceTypesShouldBeConverted() { ConsequenceType consequenceType = new ConsequenceType("geneName", "ensemblGeneId", "ensemblTranscriptId", "strand", "biotype", 0, 0, 0, "aaChange", "codon", new ArrayList<>(), new ArrayList<>()); List<ConsequenceType> consequenceTypes = Collections.singletonList(consequenceType); VariantAnnotation annotation = new VariantAnnotation("1", 1, 2, "A", "T"); annotation.setConsequenceTypes(consequenceTypes); DBObject dbObject = converter.convert(annotation); assertNotNull(dbObject); LinkedList cts = (LinkedList) dbObject.get(AnnotationFieldNames.CONSEQUENCE_TYPE_FIELD); assertEquals(1, cts.size()); HashSet<BasicDBObject> xrefs = (HashSet) dbObject.get(AnnotationFieldNames.XREFS_FIELD); assertFalse(isXrefPresent(xrefs, "OS01G0112100", "ensemblGene")); assertTrue(isXrefPresent(xrefs, "ensemblGeneId", "ensemblGene")); assertTrue(isXrefPresent(xrefs, "geneName", "HGNC")); assertTrue(isXrefPresent(xrefs, "ensemblTranscriptId", "ensemblTranscript")); }
Source:
public void insertOrUpdateTuple( EntityKey key, Tuple tuple, TupleContext tupleContext) throws TupleAlreadyExistsException { Map<String, Object> map = ( (RedisTupleSnapshot) tuple.getSnapshot() ).getMap(); Map<String, String> entity = new HashMap<>(); List<String> toDelete1 = new ArrayList<>(); for ( TupleOperation action : tuple.getOperations() ) { switch ( action.getType() ) { case PUT: map.put( action.getColumn(), action.getValue() ); if ( action.getValue() instanceof Character ) { entity.put( action.getColumn(), action.getValue().toString() ); } else { entity.put( action.getColumn(), (String) action.getValue() ); } break; case REMOVE: case PUT_NULL: map.remove( action.getColumn() ); toDelete1.add( action.getColumn() ); break; } } String entityId = entityId( key ); Long currentTtl = connection.pttl( entityId( key ) ); if ( !toDelete1.isEmpty() ) { String[] toDelete2 = toDelete1.toArray( new String[toDelete1.size()] ); connection.hdel( entityId, toDelete2 ); } if ( !entity.isEmpty() ) { connection.hmset( entityId, entity ); } setEntityTTL( key, currentTtl, getTTL( tupleContext.getOptionsContext() ) ); }

Target:
public void insertOrUpdateTuple( EntityKey key, Tuple tuple, TupleContext tupleContext) throws TupleAlreadyExistsException { Map<String, Object> map = ( (RedisTupleSnapshot) tuple.getSnapshot() ).getMap(); MapHelpers.applyTupleOpsOnMap( tuple, map ); Map<String, String> entity = getEntityForUpdate( key, tuple ); List<String> toDelete = getKeysForRemoval( tuple ); String entityId = entityId( key ); Long currentTtl = connection.pttl( entityId( key ) ); if ( !toDelete.isEmpty() ) { connection.hdel( entityId, toDelete.toArray( new String[toDelete.size()] ) ); } if ( !entity.isEmpty() ) { connection.hmset( entityId, entity ); } setEntityTTL( key, currentTtl, getTTL( tupleContext.getOptionsContext() ) ); }
Source:
public SaveContentAsDraftActionlet( final ContentletAPI contentletAPI, final CategoryAPI categoryAPI, final PermissionAPI permissionAPI ) { this.contentletAPI = contentletAPI; this.categoryAPI = categoryAPI; this.permissionAPI = permissionAPI; }

Target:
SaveContentAsDraftActionlet( final ContentletAPI contentletAPI, final CategoryAPI categoryAPI, final PermissionAPI permissionAPI ) { super(); this.contentletAPI = contentletAPI; this.categoryAPI = categoryAPI; this.permissionAPI = permissionAPI; }
Source:
void whenWriteAndReadEntriesAsync_thenSuccess() throws Exception { CompletableFuture<Long> f = bk.newCreateLedgerOp() .withDigestType(DigestType.MAC) .withPassword(ledgerPassword) .execute() .thenApply((wh) -> { List<CompletableFuture<Long>> ops = new ArrayList<>(); for( int i = 0; i < 1000 ; i++ ) { byte[] data = String.format("message-%04d", i).getBytes(); ops.add(wh.appendAsync(data)); } return CompletableFuture .allOf(ops.stream().toArray(CompletableFuture[]::new)) .thenCompose((v) -> wh.closeAsync()) .thenApply((v) -> wh.getId()); }) .thenCompose((lf) -> lf); Long ledgerId = f.get(5, TimeUnit.MINUTES); log.info("Ledger created with 1000 entries: ledgerId=" + ledgerId); CompletableFuture<LedgerEntries> ef = bk.newOpenLedgerOp() .withLedgerId(ledgerId) .withPassword(ledgerPassword) .withDigestType(DigestType.MAC) .execute() .thenCompose((rh) -> { return rh.readLastAddConfirmedAsync() .thenCompose((lastId) -> rh.readAsync(0, lastId)); }); LedgerEntries entries = ef.get(5,TimeUnit.MINUTES); long count = 0; Iterator<org.apache.bookkeeper.client.api.LedgerEntry> it = entries.iterator(); while ( it.hasNext()) { org.apache.bookkeeper.client.api.LedgerEntry e = it.next(); String msg = new String(e.getEntryBytes()); assertEquals(String.format("message-%04d", count),msg); count++; } assertEquals(1000,count); log.info("Got entries: count=" + count); }

Target:
void whenWriteAndReadEntriesAsync_thenSuccess() throws Exception { CompletableFuture<Long> f = bk.newCreateLedgerOp() .withDigestType(DigestType.MAC) .withPassword(ledgerPassword) .execute() .thenApply((wh) -> { List<CompletableFuture<Long>> ops = new ArrayList<>(); for (int i = 0; i < 1000; i++) { byte[] data = String.format("message-%04d", i) .getBytes(); ops.add(wh.appendAsync(data)); } return CompletableFuture.allOf(ops.stream() .toArray(CompletableFuture[]::new)) .thenCompose((v) -> wh.closeAsync()) .thenApply((v) -> wh.getId()); }) .thenCompose((lf) -> lf); Long ledgerId = f.get(5, TimeUnit.MINUTES); LOG.info("Ledger created with 1000 entries: ledgerId=" + ledgerId); CompletableFuture<LedgerEntries> ef = bk.newOpenLedgerOp() .withLedgerId(ledgerId) .withPassword(ledgerPassword) .withDigestType(DigestType.MAC) .execute() .thenCompose((rh) -> { return rh.readLastAddConfirmedAsync() .thenCompose((lastId) -> rh.readAsync(0, lastId)); }); LedgerEntries entries = ef.get(5, TimeUnit.MINUTES); long count = 0; Iterator<org.apache.bookkeeper.client.api.LedgerEntry> it = entries.iterator(); while (it.hasNext()) { org.apache.bookkeeper.client.api.LedgerEntry e = it.next(); String msg = new String(e.getEntryBytes()); assertEquals(String.format("message-%04d", count), msg); count++; } assertEquals(1000, count); LOG.info("Got entries: count=" + count); }
Source:
public void testSetWalSegmentSizeShouldBeOkWhenSizeBetween512KbAnd2Gb() throws Exception { final DataStorageConfiguration cfg = new DataStorageConfiguration(); cfg.setWalSegmentSize(512 * 1024); cfg.setWalSegmentSize(Integer.MAX_VALUE); }

Target:
public void testSetWalSegmentSizeShouldBeOkWhenSizeBetween512KbAnd2Gb() throws Exception { final DataStorageConfiguration cfg = new DataStorageConfiguration(); cfg.setWalSegmentSize(512 * 1024); assertEquals(512 * 1024, cfg.getWalSegmentSize()); cfg.setWalSegmentSize(Integer.MAX_VALUE); assertEquals(Integer.MAX_VALUE, cfg.getWalSegmentSize()); }
Source:
public String asyncGet(String argument) throws IOException { String note = StringUtils.EMPTY; InputStreamResponseListener listener = new InputStreamResponseListener(); client.newRequest(zepelinhubUrl + argument) .header(ZEPPELIN_TOKEN_HEADER, token) .send(listener); Response response; try { response = listener.get(30, TimeUnit.SECONDS); } catch (InterruptedException | TimeoutException | ExecutionException e) { LOG.error("Cannot perform Get request to ZeppelinHub", e); throw new IOException("Cannot perform Get request to ZeppelinHub", e); } int code = response.getStatus(); if (code == 200) { InputStream responseContent = listener.getInputStream(); note = IOUtils.toString(responseContent, "UTF-8"); responseContent.close(); } else { LOG.error("ZeppelinHub Get returned with status ", zepelinhubUrl + argument, code); throw new IOException("Cannot perform Get request to ZeppelinHub"); } return note; }

Target:
public String asyncGet(String argument) throws IOException { return sendToZeppelinHub(HttpMethod.GET, zepelinhubUrl + argument); }
Source:
public GestureTypingDetector(int minPointDistance, @NonNull Iterable<Keyboard.Key> keys) { mMinPointDistance = minPointDistance; mKeys = keys; for (Keyboard.Key key : mKeys) { for (int i = 0; i < key.getCodesCount(); ++i) { char c = Character.toLowerCase((char) key.getCodeAtIndex(i, false)); mKeysByCharacter.put(c, key); } } mGenerateStateSubject.onNext(LoadingState.NOT_LOADED); }

Target:
public GestureTypingDetector(int minPointDistance, @NonNull Iterable<Keyboard.Key> keys) { mMinPointDistanceSquared = minPointDistance * minPointDistance; mKeys = keys; mGenerateStateSubject.onNext(LoadingState.NOT_LOADED); }
Source:
private Set<String> computeRoles(U user, T tenant, boolean isSystemTenant) { Set<String> roles = Sets.newTreeSet(); roles.addAll(user.getUserAccountData().getPermissions().getPermissions()); roles.addAll(tenant.getTenantData().getPermissions().getPermissions()); roles.add(UserInfo.PERMISSION_LOGGED_IN); roles.add(tenant.getTenantData().getName()); Set<String> transformedRoles = transformRoles(roles); if (isSystemTenant && transformedRoles.contains(PERMISSION_MANAGE_SYSTEM)) { roles.add(PERMISSION_SYSTEM_TENANT); return transformRoles(roles); } return transformedRoles; }

Target:
private Set<String> computeRoles(U user, T tenant, boolean isSystemTenant) { Set<String> roles = Sets.newTreeSet(); roles.addAll(user.getUserAccountData().getPermissions().getPermissions()); roles.addAll(tenant.getTenantData().getPermissions().getPermissions()); roles.add(UserInfo.PERMISSION_LOGGED_IN); if (Strings.isFilled(tenant.getTenantData().getAccountNumber())){ roles.add("tenant-" + tenant.getTenantData().getAccountNumber()); } Set<String> transformedRoles = transformRoles(roles); if (isSystemTenant && transformedRoles.contains(PERMISSION_MANAGE_SYSTEM)) { roles.add(PERMISSION_SYSTEM_TENANT); return transformRoles(roles); } return transformedRoles; }
Source:
public void testEmptyArray() throws Exception { Schema schema = new Schema.Parser().parse( Resources.getResource("array.avsc").openStream()); List<Integer> emptyArray = new ArrayList<>(); Path file = new Path(createTempFile().getPath()); try(ParquetWriter<GenericRecord> writer = AvroParquetWriter .<GenericRecord>builder(file) .withSchema(schema) .withConf(testConf) .build()) { GenericData.Record record = new GenericRecordBuilder(schema) .set("myarray", emptyArray).build(); writer.write(record); } AvroParquetReader<GenericRecord> reader = new AvroParquetReader<GenericRecord>(testConf, file); GenericRecord nextRecord = reader.read(); assertNotNull(nextRecord); assertEquals(emptyArray, nextRecord.get("myarray")); }

Target:
public void testEmptyArray() throws Exception { Schema schema = new Schema.Parser().parse( Resources.getResource("array.avsc").openStream()); List<Integer> emptyArray = new ArrayList<>(); Path file = new Path(createTempFile().getPath()); try(ParquetWriter<GenericRecord> writer = AvroParquetWriter .<GenericRecord>builder(file) .withSchema(schema) .withConf(testConf) .build()) { GenericData.Record record = new GenericRecordBuilder(schema) .set("myarray", emptyArray).build(); writer.write(record); } try (AvroParquetReader<GenericRecord> reader = new AvroParquetReader<>(testConf, file)) { GenericRecord nextRecord = reader.read(); assertNotNull(nextRecord); assertEquals(emptyArray, nextRecord.get("myarray")); } }
Source:
public void broadcastEvent(AbstractEvent event, boolean isPriorityEvent) throws IOException { try (BufferConsumer eventBufferConsumer = EventSerializer.toBufferConsumer(event)) { for (int targetChannel = 0; targetChannel < numberOfChannels; targetChannel++) { tryFinishCurrentBufferBuilder(targetChannel); if (isPriorityEvent) { targetPartition.addPriorityEvent(event, targetChannel, eventBufferConsumer); } else { targetPartition.addBufferConsumer(eventBufferConsumer.copy(), targetChannel); } } if (flushAlways) { flushAll(); } } }

Target:
public void broadcastEvent(AbstractEvent event, boolean isPriorityEvent) throws IOException { try (BufferConsumer eventBufferConsumer = EventSerializer.toBufferConsumer(event)) { for (int targetChannel = 0; targetChannel < numberOfChannels; targetChannel++) { tryFinishCurrentBufferBuilder(targetChannel); targetPartition.addBufferConsumer(eventBufferConsumer.copy(), targetChannel, isPriorityEvent); } if (flushAlways) { flushAll(); } } }
Source:
private void validateMd5(String currentMd5, CloseableHttpResponse response, String agentContentMd5Header, String what) { final Header md5Header = response.getFirstHeader(agentContentMd5Header); LOGGER.debug("[Agent Upgrade Validate MD5] validating MD5 for {}, currentMD5:{}, responseMD5:{}, headerKey:{}", what, currentMd5, md5Header, agentContentMd5Header); if (md5Header == null) { String message = String.format("[Agent Upgrade Validate MD5] Did not find %s MD5 header in response %s.", agentContentMd5Header, response); LOGGER.debug(message); } if (!"".equals(currentMd5)) { if (!currentMd5.equals(md5Header.getValue())) { jvmExitter.jvmExit(what, currentMd5, md5Header.getValue()); } } }

Target:
private void validateMd5(String currentMd5, CloseableHttpResponse response, String agentContentMd5Header, String what) { final Header md5Header = response.getFirstHeader(agentContentMd5Header); LOGGER.debug("[Agent Upgrade Validate MD5] validating MD5 for {}, currentMD5:{}, responseMD5:{}, headerKey:{}", what, currentMd5, md5Header, agentContentMd5Header); if (md5Header == null) { LOGGER.debug("[Agent Upgrade Validate MD5] Did not find MD5 header in response {}.", agentContentMd5Header, response); } if (!"".equals(currentMd5)) { if (!currentMd5.equals(md5Header.getValue())) { jvmExitter.jvmExit(what, currentMd5, md5Header.getValue()); } } }
Source:
public void setInverted(boolean isInverted) { if (getInverted() != isInverted) { for (CustomSpeedController motor : motors) { motor.setInverted(!motor.getInverted()); } } this.isInverted = isInverted; }

Target:
public void setInverted(boolean isInverted) { if (getInverted() != isInverted) { for (SpeedController motor : motors) { motor.setInverted(!motor.getInverted()); } } this.isInverted = isInverted; }
Source:
private void addAztecAudioShortcodePlugin() { boolean foundAudioShortCodePlugin = false; for (IAztecPlugin plugin : mContent.getPlugins()) { if (plugin instanceof AudioShortcodePlugin) { foundAudioShortCodePlugin = true; break; } } if (!foundAudioShortCodePlugin) { mContent.getPlugins().add(new AudioShortcodePlugin()); } }

Target:
private void addAztecAudioShortcodePlugin() { for (IAztecPlugin plugin : mContent.getPlugins()) { if (plugin instanceof AudioShortcodePlugin) { return; } } mContent.getPlugins().add(new AudioShortcodePlugin()); }
Source:
private void initializeRefreshCallback() { repositoryManager.addCallbacks(categories -> { Platform.runLater(() -> { this.getChildren().remove(this.overlay); this.vBox.setDisable(false); }); }, error -> { }); }

Target:
private void initializeRefreshCallback() { repositoryManager.addCallbacks(categories -> { Platform.runLater(() -> { this.overlay.toBack(); this.vBox.setDisable(false); }); }, error -> { }); }
Source:
private void onSuccess() { if (results.size() < callbacks.size()) { return; } Throwable caught = null; for (Object o : callbacks) { try { Object result = results.get(o); if (o instanceof AsyncCallback) { @SuppressWarnings("unchecked") AsyncCallback<Object> cb = (AsyncCallback<Object>) o; cb.onSuccess(result); } else { @SuppressWarnings("unchecked") com.google.gwtjsonrpc.common.AsyncCallback<Object> cb = (com.google.gwtjsonrpc.common.AsyncCallback<Object>) o; cb.onSuccess(result); } } catch (Throwable t) { if (caught == null) { caught = t; } } } propagate(caught); }

Target:
private void onSuccess() { if (results.size() < callbacks.size()) { return; } for (Object o : callbacks) { Object result = results.get(o); if (o instanceof AsyncCallback) { @SuppressWarnings("unchecked") AsyncCallback<Object> cb = (AsyncCallback<Object>) o; cb.onSuccess(result); } else { @SuppressWarnings("unchecked") com.google.gwtjsonrpc.common.AsyncCallback<Object> cb = (com.google.gwtjsonrpc.common.AsyncCallback<Object>) o; cb.onSuccess(result); } } }
Source:
public void dispose() { ISelectionProvider provider = fSite.getSelectionProvider(); if (provider != null) { ISelectionProvider currentProvider = fSpecialProvider != null ? fSpecialProvider : fSite.getSelectionProvider(); disposeAction(fFindDeclarationsAction, currentProvider); disposeAction(fFindDeclarationsInProjectAction, currentProvider); disposeAction(fFindDeclarationsInHierarchyAction, currentProvider); disposeAction(fFindDeclarationsInWorkingSetAction, currentProvider); } fSpecialProvider = null; fFindDeclarationsAction = null; fFindDeclarationsInProjectAction = null; fFindDeclarationsInHierarchyAction = null; fFindDeclarationsInWorkingSetAction = null; updateGlobalActionHandlers(); super.dispose(); }

Target:
public void dispose() { if (fRegisterInProvider) { unregisterActions(); } fSelectionProvider = null; fFindDeclarationsAction = null; fFindDeclarationsInProjectAction = null; fFindDeclarationsInHierarchyAction = null; fFindDeclarationsInWorkingSetAction = null; updateGlobalActionHandlers(); super.dispose(); }
Source:
public void checkParameters(Command command, ExecutionHandlerContext context) { int numberOfArguments = command.getProcessedCommand().size(); if (numberOfArguments < 2) { throw new RedisParametersMismatchException(command.wrongNumberOfArgumentsErrorMessage()); } else if (numberOfArguments == 2) { confirmKnownSubcommands(command); } else if (numberOfArguments == 3) { confirmArgumentsToGetSubcommand(command); } else if (numberOfArguments > 3) { throw new RedisParametersMismatchException( String.format(ERROR_UNKNOWN_SLOWLOG_SUBCOMMAND, command.getStringKey())); } }

Target:
public void checkParameters(Command command, ExecutionHandlerContext context) { int numberOfArguments = command.getProcessedCommand().size(); if (numberOfArguments < 2) { throw new RedisParametersMismatchException(command.wrongNumberOfArgumentsErrorMessage()); } else if (numberOfArguments == 2) { confirmKnownSubcommands(command); } else if (numberOfArguments == 3) { confirmArgumentsToGetSubcommand(command); } else { throw new RedisParametersMismatchException( String.format(ERROR_UNKNOWN_SLOWLOG_SUBCOMMAND, command.getStringKey())); } }
Source:
private static void checkBoundaries(double value) { if (value < 0 || value > 100) throw new IllegalArgumentException( String.format("The percentage value <%s> should be between zero and hundred.", value)); }

Target:
private static void checkBoundaries(double value) { if (value < 0 || value > 100) throw new IllegalArgumentException( String.format("The percentage value <%s> should be between 0 and 100.", value)); }
Source:
private void checkFilesAreOpened() { try { projectExplorer.waitItem(PROJECT_NAME + "/src/main/webapp/WEB-INF"); } catch (TimeoutException ex) { fail("Known issue <LINK_0>"); } projectExplorer.waitItem(PROJECT_NAME + "/src/main/webapp/WEB-INF/jsp"); projectExplorer.waitItem(PROJECT_NAME + "/src/main/webapp/index.jsp"); projectExplorer.waitItem( PROJECT_NAME + "/src/main/java/org/eclipse/qa/examples/AppController.java"); editor.waitTabIsPresent("index.jsp"); editor.waitTabIsPresent("AppController"); editor.waitTabIsPresent("qa-spring-sample"); }

Target:
private void checkFilesAreOpened() { try { projectExplorer.waitItem(PROJECT_NAME + "/src/main/webapp/WEB-INF"); } catch (TimeoutException ex) { fail("Known random failure <LINK_0>"); } projectExplorer.waitItem(PROJECT_NAME + "/src/main/webapp/WEB-INF/jsp"); projectExplorer.waitItem(PROJECT_NAME + "/src/main/webapp/index.jsp"); projectExplorer.waitItem( PROJECT_NAME + "/src/main/java/org/eclipse/qa/examples/AppController.java"); editor.waitTabIsPresent("index.jsp"); editor.waitTabIsPresent("AppController"); editor.waitTabIsPresent("qa-spring-sample"); }