Java Code Examples for org.eclipse.xtext.util.Triple

The following examples show how to use org.eclipse.xtext.util.Triple. These examples are extracted from open source projects. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
@Test
public void testBug470766_01() {
  boolean _isJava12OrLater = AbstractXtendTestCase.isJava12OrLater();
  if (_isJava12OrLater) {
    Pair<String, VarianceInfo> _mappedTo = Pair.<String, VarianceInfo>of("void", VarianceInfo.OUT);
    Triple<String, VarianceInfo, VarianceInfo> _mappedTo_1 = this.operator_mappedTo(_mappedTo, VarianceInfo.INVARIANT);
    Pair<String, VarianceInfo> _mappedTo_2 = Pair.<String, VarianceInfo>of("Integer", VarianceInfo.OUT);
    Triple<String, VarianceInfo, VarianceInfo> _mappedTo_3 = this.operator_mappedTo(_mappedTo_2, VarianceInfo.INVARIANT);
    Pair<String, VarianceInfo> _mappedTo_4 = Pair.<String, VarianceInfo>of("Long", VarianceInfo.OUT);
    Triple<String, VarianceInfo, VarianceInfo> _mappedTo_5 = this.operator_mappedTo(_mappedTo_4, VarianceInfo.INVARIANT);
    this.to(this.merge(_mappedTo_1, _mappedTo_3, _mappedTo_5), "Number & Comparable<?> & Constable & ConstantDesc", VarianceInfo.INVARIANT);
  } else {
    Pair<String, VarianceInfo> _mappedTo_6 = Pair.<String, VarianceInfo>of("void", VarianceInfo.OUT);
    Triple<String, VarianceInfo, VarianceInfo> _mappedTo_7 = this.operator_mappedTo(_mappedTo_6, VarianceInfo.INVARIANT);
    Pair<String, VarianceInfo> _mappedTo_8 = Pair.<String, VarianceInfo>of("Integer", VarianceInfo.OUT);
    Triple<String, VarianceInfo, VarianceInfo> _mappedTo_9 = this.operator_mappedTo(_mappedTo_8, VarianceInfo.INVARIANT);
    Pair<String, VarianceInfo> _mappedTo_10 = Pair.<String, VarianceInfo>of("Long", VarianceInfo.OUT);
    Triple<String, VarianceInfo, VarianceInfo> _mappedTo_11 = this.operator_mappedTo(_mappedTo_10, VarianceInfo.INVARIANT);
    this.to(this.merge(_mappedTo_7, _mappedTo_9, _mappedTo_11), "Number & Comparable<?>", VarianceInfo.INVARIANT);
  }
}
 
Example 2
Source Project: statecharts   Source File: AbstractSCTResource.java    License: Eclipse Public License 1.0 6 votes vote down vote up
@Override
public EObject getEObject(String uriFragment) {
	if (encoder.isCrossLinkFragment(this, uriFragment)) {
		Triple<EObject, EReference, INode> triple = encoder.decode(this, uriFragment);
		List<EObject> linkedObjects = null;
		linkedObjects = linkingService.getLinkedObjects(triple.getFirst(), triple.getSecond(), triple.getThird());
		if (!linkedObjects.isEmpty()) {
			return linkedObjects.get(0);
		} else {
			createDiagnostic(triple);
			return null;
		}
	}
	if (uriFragment != null && uriFragment.startsWith(SCT_PREFIX)) {
		return super.getEObject(uriFragment.substring(SCT_PREFIX.length()));
	}
	return super.getEObject(uriFragment);
}
 
Example 3
@Override
protected EObject handleCyclicResolution(Triple<EObject, EReference, INode> triple) throws AssertionError {
	if (!isValidationDisabled()) {
		EObject context = triple.getFirst();
		if (context.eClass() == TypesPackage.Literals.JVM_PARAMETERIZED_TYPE_REFERENCE) {
			// here we may end up with cyclic resolution requests in rare situations, e.g. for input types
			// like :
			/*
			 * package p;
			 * class C extends p.C.Bogus {}
			 */
			return null;
		}
		DiagnosticMessage message = new DiagnosticMessage("Cyclic linking detected : " + getReferences(triple, resolving), Severity.ERROR, "cyclic-resolution");
		List<Diagnostic> list = getDiagnosticList(message);
		Diagnostic diagnostic = createDiagnostic(triple, message);
		if (!list.contains(diagnostic))
			list.add(diagnostic);
	}
	return null;
}
 
Example 4
Source Project: xtext-extras   Source File: ErrorTreeAppendable.java    License: Eclipse Public License 2.0 6 votes vote down vote up
@Override
public TreeAppendable append(JvmType type) {
	if(type.eIsProxy()) {
		String fragment = ((InternalEObject)type).eProxyURI().fragment();
		Triple<EObject, EReference, INode> unresolvedLink = encoder.decode(getState().getResource(), fragment);
		if(unresolvedLink != null) {
			INode linkNode = unresolvedLink.getThird();
			if(linkNode != null) {
				append(NodeModelUtils.getTokenText(linkNode));
				return this;
			}
		}
		append("unresolved type");
		return this;
	}
	return super.append(type);
}
 
Example 5
Source Project: xtext-extras   Source File: TestErrorAcceptor.java    License: Eclipse Public License 2.0 6 votes vote down vote up
private boolean compareTriple(Triple<TransformationErrorCode, String, EObject> one,
		Triple<TransformationErrorCode, String, EObject> other) {
	if (one.equals(other))
		return true;
	if (other == null)
		return false;
	if (other == one)
		return true;

	TransformationErrorCode first = one.getFirst();
	boolean isFirstEqual = ((first == null) ? other.getFirst() == null : first.equals(other.getFirst()));
	if (!isFirstEqual)
		return false;

	String second = one.getSecond();
	boolean isSecondEqual = second == ANY_STRING
			|| ((second == null) ? other.getSecond() == null : second.equals(other.getSecond()));
	if (!isSecondEqual)
		return false;

	EObject third = one.getThird();
	boolean isThirdEqual = third == ANY_EOBJECT
			|| (third == null ? other.getThird() == null : one.getThird().equals(other.getThird()));
	return isThirdEqual;
}
 
Example 6
@Test
public void testMergeMultiType_02() {
  boolean _isJava11OrLater = AbstractXtendTestCase.isJava11OrLater();
  if (_isJava11OrLater) {
    Pair<String, VarianceInfo> _mappedTo = Pair.<String, VarianceInfo>of("StringBuilder", VarianceInfo.OUT);
    Triple<String, VarianceInfo, VarianceInfo> _mappedTo_1 = this.operator_mappedTo(_mappedTo, VarianceInfo.OUT);
    Pair<String, VarianceInfo> _mappedTo_2 = Pair.<String, VarianceInfo>of("StringBuffer", VarianceInfo.OUT);
    Triple<String, VarianceInfo, VarianceInfo> _mappedTo_3 = this.operator_mappedTo(_mappedTo_2, VarianceInfo.OUT);
    Pair<String, VarianceInfo> _mappedTo_4 = Pair.<String, VarianceInfo>of("StringBuilder", VarianceInfo.OUT);
    Triple<String, VarianceInfo, VarianceInfo> _mappedTo_5 = this.operator_mappedTo(_mappedTo_4, VarianceInfo.OUT);
    this.to(this.mergeSuccessive(_mappedTo_1, _mappedTo_3, _mappedTo_5), "AbstractStringBuilder & Serializable & Comparable<?>", VarianceInfo.INVARIANT);
  } else {
    Pair<String, VarianceInfo> _mappedTo_6 = Pair.<String, VarianceInfo>of("StringBuilder", VarianceInfo.OUT);
    Triple<String, VarianceInfo, VarianceInfo> _mappedTo_7 = this.operator_mappedTo(_mappedTo_6, VarianceInfo.OUT);
    Pair<String, VarianceInfo> _mappedTo_8 = Pair.<String, VarianceInfo>of("StringBuffer", VarianceInfo.OUT);
    Triple<String, VarianceInfo, VarianceInfo> _mappedTo_9 = this.operator_mappedTo(_mappedTo_8, VarianceInfo.OUT);
    Pair<String, VarianceInfo> _mappedTo_10 = Pair.<String, VarianceInfo>of("StringBuilder", VarianceInfo.OUT);
    Triple<String, VarianceInfo, VarianceInfo> _mappedTo_11 = this.operator_mappedTo(_mappedTo_10, VarianceInfo.OUT);
    this.to(this.mergeSuccessive(_mappedTo_7, _mappedTo_9, _mappedTo_11), "AbstractStringBuilder & Serializable", VarianceInfo.INVARIANT);
  }
}
 
Example 7
Source Project: dsl-devkit   Source File: AbstractTypeProvider.java    License: Eclipse Public License 1.0 6 votes vote down vote up
/**
 * Gets the containing info for an expression.
 * <p>
 * The containing info for an expression consists of
 * <ul>
 * <li>the EObject that contains the expression,
 * <li>the containment EReference of that containing EObject
 * <li>if the multiplicity is > 1, the index of the expression in the containing EReference; else -1
 * </ul>
 *
 * @param expression
 *          the expression to get the containing info for
 * @return the containing info for {@code expression}
 */
protected Triple<EObject, EReference, Integer> getContainingInfo(final IExpression expression) {
  if (expression == null) {
    return null;
  }
  if (expression.eIsProxy()) {
    return null;
  }
  EReference containmentReference = expression.eContainmentFeature();
  if (containmentReference == null) {
    return null;
  }
  EObject container = expression.eContainer();
  int index = (containmentReference.isMany()) ? ((List<?>) container.eGet(containmentReference)).indexOf(expression) : -1;
  return Tuples.create(container, containmentReference, index);
}
 
Example 8
@Test
public void testMergeMultiType_01() {
  boolean _isJava11OrLater = AbstractXtendTestCase.isJava11OrLater();
  if (_isJava11OrLater) {
    Pair<String, VarianceInfo> _mappedTo = Pair.<String, VarianceInfo>of("StringBuilder", VarianceInfo.OUT);
    Triple<String, VarianceInfo, VarianceInfo> _mappedTo_1 = this.operator_mappedTo(_mappedTo, VarianceInfo.OUT);
    Pair<String, VarianceInfo> _mappedTo_2 = Pair.<String, VarianceInfo>of("StringBuffer", VarianceInfo.OUT);
    Triple<String, VarianceInfo, VarianceInfo> _mappedTo_3 = this.operator_mappedTo(_mappedTo_2, VarianceInfo.OUT);
    this.to(this.merge(_mappedTo_1, _mappedTo_3), "AbstractStringBuilder & Serializable & Comparable<?>", VarianceInfo.INVARIANT);
  } else {
    Pair<String, VarianceInfo> _mappedTo_4 = Pair.<String, VarianceInfo>of("StringBuilder", VarianceInfo.OUT);
    Triple<String, VarianceInfo, VarianceInfo> _mappedTo_5 = this.operator_mappedTo(_mappedTo_4, VarianceInfo.OUT);
    Pair<String, VarianceInfo> _mappedTo_6 = Pair.<String, VarianceInfo>of("StringBuffer", VarianceInfo.OUT);
    Triple<String, VarianceInfo, VarianceInfo> _mappedTo_7 = this.operator_mappedTo(_mappedTo_6, VarianceInfo.OUT);
    this.to(this.merge(_mappedTo_5, _mappedTo_7), "AbstractStringBuilder & Serializable", VarianceInfo.INVARIANT);
  }
}
 
Example 9
@Test
public void testArgumentTypeUsedTwice_08_c() {
  Pair<String, VarianceInfo> _mappedTo = Pair.<String, VarianceInfo>of("String", VarianceInfo.OUT);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_1 = this.operator_mappedTo(_mappedTo, VarianceInfo.IN);
  Pair<String, VarianceInfo> _mappedTo_2 = Pair.<String, VarianceInfo>of("String", VarianceInfo.IN);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_3 = this.operator_mappedTo(_mappedTo_2, VarianceInfo.INVARIANT);
  this.to(this.merge(_mappedTo_1, _mappedTo_3), "String", null);
}
 
Example 10
@Test
public void testCircularTypeParams_11() {
  Map<JvmTypeParameter, List<LightweightBoundTypeArgument>> _mappedBy = this.mappedBy("T extends (Object)=>T", "T", "Object");
  Pair<String, VarianceInfo> _mappedTo = Pair.<String, VarianceInfo>of("Object", VarianceInfo.OUT);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_1 = this.operator_mappedTo(_mappedTo, VarianceInfo.OUT);
  this.assertMapping(_mappedBy, "T", _mappedTo_1);
}
 
Example 11
@Test
public void testArgumentTypeUsedTwice_05_i() {
  Pair<String, VarianceInfo> _mappedTo = Pair.<String, VarianceInfo>of("String", VarianceInfo.IN);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_1 = this.operator_mappedTo(_mappedTo, VarianceInfo.IN);
  Pair<String, VarianceInfo> _mappedTo_2 = Pair.<String, VarianceInfo>of("String", VarianceInfo.INVARIANT);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_3 = this.operator_mappedTo(_mappedTo_2, VarianceInfo.IN);
  this.to(this.merge(_mappedTo_1, _mappedTo_3), "String", null);
}
 
Example 12
Source Project: n4js   Source File: N4JSResource.java    License: Eclipse Public License 1.0 5 votes vote down vote up
@Override
public Triple<EObject, EReference, INode> getLazyProxyInformation(int idx) {
	// note: following line was copied from the old index-URI implementation (the one that used field "uris")
	// to make the new implementation behave as the old one; whether doing a demand load here actually
	// makes sense remains to be reconsidered (see IDEBUG-257 and IDEBUG-233) ...
	contents.get(0); // trigger demand load if necessary
	return super.getLazyProxyInformation(idx);
}
 
Example 13
Source Project: dsl-devkit   Source File: AbstractTypeProvider.java    License: Eclipse Public License 1.0 5 votes vote down vote up
@Override
protected IType doComputation(final IExpression expression) {
  Triple<EObject, EReference, Integer> triple = getContainingInfo(expression);
  if (triple != null) {
    return expectedType(triple.getFirst(), triple.getSecond(), triple.getThird());
  } else {
    return null;
  }
}
 
Example 14
@Test
public void testCircularTypeParams_06() {
  Map<JvmTypeParameter, List<LightweightBoundTypeArgument>> _mappedBy = this.mappedBy("T extends Iterable<T>", "CharSequence", "String");
  Pair<String, VarianceInfo> _mappedTo = Pair.<String, VarianceInfo>of("Iterable<Object>", VarianceInfo.OUT);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_1 = this.operator_mappedTo(_mappedTo, VarianceInfo.OUT);
  this.assertMapping(_mappedBy, "T", _mappedTo_1);
}
 
Example 15
Source Project: statecharts   Source File: AbstractSCTResource.java    License: Eclipse Public License 1.0 5 votes vote down vote up
protected void createDiagnostic(Triple<EObject, EReference, INode> triple) {
	SpecificationElement specificationElement = EcoreUtil2.getContainerOfType(triple.getFirst(),
			SpecificationElement.class);
	DiagnosticMessage message = createDiagnosticMessage(triple);
	Diagnostic diagnostic = new XtextLinkingDiagnostic(triple.getThird(), message.getMessage(),
			message.getIssueCode(), message.getIssueData());
	linkingDiagnostics.put(specificationElement, diagnostic);

}
 
Example 16
Source Project: xtext-extras   Source File: TestErrorAcceptor.java    License: Eclipse Public License 2.0 5 votes vote down vote up
@Override
public void acceptError(TransformationErrorCode errorCode, String message, EObject element) {
	Triple<TransformationErrorCode, String, EObject> create = Tuples.create(errorCode, message, element);
	//		System.out.println((write ? "Write>" : "Read>") + " errorCode: " + (errorCode != null ? errorCode : "")
	//				+ ", message: " + (message != null ? message : "") + ", element: " + (element != null ? element : ""));
	if (write) {
		flugschreiber.push(create);
	} else {
		Triple<TransformationErrorCode, String, EObject> pop = flugschreiber.removeLast();
		assertNotNull("Queue is empty", pop);
		boolean equals = compareTriple(pop, create);
		assertTrue("Verified", equals);
	}
}
 
Example 17
@Test
public void testBestEffortMapping_03() {
  Map<JvmTypeParameter, List<LightweightBoundTypeArgument>> _mappedBy = this.mappedBy("T", "java.util.ArrayList<T>", "Iterable<String>");
  Pair<String, VarianceInfo> _mappedTo = Pair.<String, VarianceInfo>of("String", VarianceInfo.INVARIANT);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_1 = this.operator_mappedTo(_mappedTo, VarianceInfo.INVARIANT);
  this.assertMapping(_mappedBy, "T", _mappedTo_1);
}
 
Example 18
@Test
public void testUpperBound_04() {
  Map<JvmTypeParameter, List<LightweightBoundTypeArgument>> _mappedBy = this.mappedBy("T", "Iterable<T>", "Iterable<? extends String>");
  Pair<String, VarianceInfo> _mappedTo = Pair.<String, VarianceInfo>of("String", VarianceInfo.INVARIANT);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_1 = this.operator_mappedTo(_mappedTo, VarianceInfo.OUT);
  this.assertMapping(_mappedBy, "T", _mappedTo_1);
}
 
Example 19
@Test
public void testArgumentTypeUsedTwice_07_g() {
  Pair<String, VarianceInfo> _mappedTo = Pair.<String, VarianceInfo>of("String", VarianceInfo.IN);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_1 = this.operator_mappedTo(_mappedTo, VarianceInfo.INVARIANT);
  Pair<String, VarianceInfo> _mappedTo_2 = Pair.<String, VarianceInfo>of("String", VarianceInfo.OUT);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_3 = this.operator_mappedTo(_mappedTo_2, VarianceInfo.IN);
  this.to(this.merge(_mappedTo_1, _mappedTo_3), "String", null);
}
 
Example 20
@Test
public void testMappedGenericType_01() {
  Map<JvmTypeParameter, List<LightweightBoundTypeArgument>> _mappedBy = this.mappedBy("T", "Iterable<T>", "Iterable<Iterable<String>>");
  Pair<String, VarianceInfo> _mappedTo = Pair.<String, VarianceInfo>of("Iterable<String>", VarianceInfo.INVARIANT);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_1 = this.operator_mappedTo(_mappedTo, VarianceInfo.INVARIANT);
  this.assertMapping(_mappedBy, "T", _mappedTo_1);
}
 
Example 21
@Test
public void testLowerBound_04() {
  Map<JvmTypeParameter, List<LightweightBoundTypeArgument>> _mappedBy = this.mappedBy("T, T2 extends T", "Iterable<? super T>", "Iterable<? extends String>");
  Pair<String, VarianceInfo> _mappedTo = Pair.<String, VarianceInfo>of("String", VarianceInfo.IN);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_1 = this.operator_mappedTo(_mappedTo, VarianceInfo.OUT);
  Map<JvmTypeParameter, List<LightweightBoundTypeArgument>> _assertMapping = this.assertMapping(_mappedBy, "T", _mappedTo_1);
  Pair<String, VarianceInfo> _mappedTo_2 = Pair.<String, VarianceInfo>of("String", VarianceInfo.IN);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_3 = this.operator_mappedTo(_mappedTo_2, VarianceInfo.OUT);
  this.assertMapping(_assertMapping, "T2", _mappedTo_3);
}
 
Example 22
Source Project: xtext-core   Source File: LazyLinkingResource.java    License: Eclipse Public License 2.0 5 votes vote down vote up
protected void removeDiagnostic(Triple<EObject, EReference, INode> triple) {
	// return early if there's nothing to remove
	if (getErrors().isEmpty() && getWarnings().isEmpty())
		return;
	DiagnosticMessage message = createDiagnosticMessage(triple);
	List<Diagnostic> list = getDiagnosticList(message);
	if (!list.isEmpty()) {
		Diagnostic diagnostic = createDiagnostic(triple, message);
		list.remove(diagnostic);
	}
}
 
Example 23
@Test
public void testCircularTypeParams_12() {
  Map<JvmTypeParameter, List<LightweightBoundTypeArgument>> _mappedBy = this.mappedBy("T extends (Object)=>T", "T", "(Object)=>Object");
  Pair<String, VarianceInfo> _mappedTo = Pair.<String, VarianceInfo>of("(Object)=>Object", VarianceInfo.OUT);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_1 = this.operator_mappedTo(_mappedTo, VarianceInfo.OUT);
  this.assertMapping(_mappedBy, "T", _mappedTo_1);
}
 
Example 24
@Test
public void testLowerBound_01() {
  Map<JvmTypeParameter, List<LightweightBoundTypeArgument>> _mappedBy = this.mappedBy("T", "Iterable<? super T>", "Iterable<String>");
  Pair<String, VarianceInfo> _mappedTo = Pair.<String, VarianceInfo>of("String", VarianceInfo.IN);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_1 = this.operator_mappedTo(_mappedTo, VarianceInfo.INVARIANT);
  this.assertMapping(_mappedBy, "T", _mappedTo_1);
}
 
Example 25
@Test
public void testBestEffortMapping_04() {
  Map<JvmTypeParameter, List<LightweightBoundTypeArgument>> _mappedBy = this.mappedBy("T", "java.util.HashMap<java.util.ArrayList<T>, java.util.ArrayList<T>>", "java.util.Map<Iterable<String>, java.util.HashSet<Integer>>");
  Pair<String, VarianceInfo> _mappedTo = Pair.<String, VarianceInfo>of("String", VarianceInfo.INVARIANT);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_1 = this.operator_mappedTo(_mappedTo, VarianceInfo.INVARIANT);
  Pair<String, VarianceInfo> _mappedTo_2 = Pair.<String, VarianceInfo>of("Integer", VarianceInfo.INVARIANT);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_3 = this.operator_mappedTo(_mappedTo_2, VarianceInfo.INVARIANT);
  this.assertMapping(_mappedBy, "T", _mappedTo_1, _mappedTo_3);
}
 
Example 26
@Test
public void testDirectUnboundExpectation() {
  List<LightweightBoundTypeArgument> _hasHintsFor = this.hasHintsFor(this.in("T", "T", "String"), "T");
  Pair<String, VarianceInfo> _mappedTo = Pair.<String, VarianceInfo>of("String", VarianceInfo.OUT);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_1 = this.operator_mappedTo(_mappedTo, VarianceInfo.OUT);
  this.like(_hasHintsFor, _mappedTo_1);
}
 
Example 27
@Test
public void testUnusedParams_01() {
  Map<JvmTypeParameter, List<LightweightBoundTypeArgument>> _mappedBy = this.mappedBy("T, T2", "CharSequence", "String");
  Pair<String, VarianceInfo> _mappedTo = Pair.<String, VarianceInfo>of("Object", VarianceInfo.OUT);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_1 = this.operator_mappedTo(_mappedTo, VarianceInfo.OUT);
  Map<JvmTypeParameter, List<LightweightBoundTypeArgument>> _assertMapping = this.assertMapping(_mappedBy, "T", _mappedTo_1);
  Pair<String, VarianceInfo> _mappedTo_2 = Pair.<String, VarianceInfo>of("Object", VarianceInfo.OUT);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_3 = this.operator_mappedTo(_mappedTo_2, VarianceInfo.OUT);
  this.assertMapping(_assertMapping, "T2", _mappedTo_3);
}
 
Example 28
@Test
public void testArgumentTypeUsedTwice_05_g() {
  Pair<String, VarianceInfo> _mappedTo = Pair.<String, VarianceInfo>of("String", VarianceInfo.IN);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_1 = this.operator_mappedTo(_mappedTo, VarianceInfo.INVARIANT);
  Pair<String, VarianceInfo> _mappedTo_2 = Pair.<String, VarianceInfo>of("String", VarianceInfo.INVARIANT);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_3 = this.operator_mappedTo(_mappedTo_2, VarianceInfo.IN);
  this.to(this.merge(_mappedTo_1, _mappedTo_3), "String", null);
}
 
Example 29
@Test
public void testUsedTwice() {
  List<LightweightBoundTypeArgument> _hasHintsFor = this.hasHintsFor(this.in("T", "java.util.Map<T, T>", "com.google.common.collect.BiMap<CharSequence, Integer>"), "T");
  Pair<String, VarianceInfo> _mappedTo = Pair.<String, VarianceInfo>of("CharSequence", VarianceInfo.INVARIANT);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_1 = this.operator_mappedTo(_mappedTo, VarianceInfo.INVARIANT);
  Pair<String, VarianceInfo> _mappedTo_2 = Pair.<String, VarianceInfo>of("Integer", VarianceInfo.INVARIANT);
  Triple<String, VarianceInfo, VarianceInfo> _mappedTo_3 = this.operator_mappedTo(_mappedTo_2, VarianceInfo.INVARIANT);
  this.like(_hasHintsFor, _mappedTo_1, _mappedTo_3);
}
 
Example 30
Source Project: xtext-core   Source File: LazyURIEncoder.java    License: Eclipse Public License 2.0 5 votes vote down vote up
/**
 * @since 2.7
 */
protected Triple<EObject, EReference, INode> getLazyProxyInformation(Resource res, String uriFragment) {
	if (!(res instanceof LazyLinkingResource)) {
		throw new IllegalArgumentException("Given resource not a LazyLinkingResource");
	}
	int idx = getIndex(uriFragment);
	LazyLinkingResource lazyResource = (LazyLinkingResource) res;
	return lazyResource.getLazyProxyInformation(idx);
}