Java Code Examples for org.eclipse.emf.common.util.EList#iterator()

The following examples show how to use org.eclipse.emf.common.util.EList#iterator() . 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
Source File: RestRequestWrongCallMigrationTask.java    From tesb-studio-se with Apache License 2.0 6 votes vote down vote up
private void addColumn(EList columns, String name) {
	Iterator iterator = columns.iterator();
	while (iterator.hasNext()) {
		Object next = iterator.next();
		if (next instanceof ColumnType && name.equals(((ColumnType) next).getName())) {
			return;
		}
	}
	ColumnType columnType = TalendFileFactory.eINSTANCE.createColumnType();
	columnType.setKey(false);
	columnType.setName(name);
	columnType.setSourceType("");
	columnType.setType("id_String");
	columnType.setLength(255);
	columnType.setPrecision(0);
	columnType.setNullable(true);
	columns.add(columnType);
}
 
Example 2
Source File: ChartUtil.java    From birt with Eclipse Public License 1.0 6 votes vote down vote up
/**
 * Remove all invisible SeriesDefinitions from a EList of SeriesDefinitions.
 * This is a help function of the pruneInvisibleSeries. ( see below )
 * 
 * @param elSed
 *            (will be changed)
 * @since 2.3
 */
private static void pruneInvisibleSedsFromEList(
		EList<SeriesDefinition> elSed )
{
	Iterator<SeriesDefinition> itSed = elSed.iterator( );

	while ( itSed.hasNext( ) )
	{
		SeriesDefinition sed = itSed.next( );
		// Design time series may be null in API test
		Series ds = sed.getDesignTimeSeries( );
		if ( ds != null && !ds.isVisible( ) )
		{
			itSed.remove( );
		}
	}
}
 
Example 3
Source File: ConsumerFaultResponseMigrationTask.java    From tesb-studio-se with Apache License 2.0 6 votes vote down vote up
private void addColumn(EList column, String name) {
	Iterator<?> iterator = column.iterator();
	while (iterator.hasNext()) {
		Object next = iterator.next();
		if (next instanceof ColumnType) {
			ColumnType ct = (ColumnType) next;
			if (name.equals(ct.getName())) {
				return;
			}
		}
	}
	ColumnType columnType = TalendFileFactory.eINSTANCE.createColumnType();
	columnType.setDefaultValue("");
	columnType.setKey(false);
	columnType.setName(name);
	columnType.setSourceType("");
	columnType.setType("id_String");
	columnType.setLength(1024);
	columnType.setPrecision(0);
	columnType.setNullable(true);
	column.add(columnType);
}
 
Example 4
Source File: FormalParameterListComparator.java    From sarl with Apache License 2.0 6 votes vote down vote up
@Override
public int compare(EList<? extends XtendParameter> left, EList<? extends XtendParameter> right) {
	if (left == right) {
		return 0;
	}
	if (left == null) {
		return Integer.MIN_VALUE;
	}
	if (right == null) {
		return Integer.MAX_VALUE;
	}
	int cmp = Integer.compare(left.size(), right.size());
	if (cmp == 0) {
		final Iterator<? extends XtendParameter> i1 = left.iterator();
		final Iterator<? extends XtendParameter> i2 = right.iterator();
		while (cmp == 0 && i1.hasNext() && i2.hasNext()) {
			cmp = compare(i1.next(), i2.next());
		}
	}
	return cmp;
}
 
Example 5
Source File: TypedResourceDescriptionStrategy.java    From statecharts with Eclipse Public License 1.0 6 votes vote down vote up
protected String getOperationSignature(Operation operation) {
	if (operation.getName() == null) {
		return "null";
	}
	StringBuilder builder = new StringBuilder(operation.getName());
	builder.append("(");
	EList<Parameter> parameters = operation.getParameters();
	String sep = "";
	Iterator<Parameter> iterator = parameters.iterator();
	while (iterator.hasNext()) {
		Parameter parameter = iterator.next();
		builder.append(sep);
		builder.append(parameter.getName());
		builder.append(" : ");
		String typeName = getTypeName(parameter.getTypeSpecifier());
		builder.append(typeName);
		sep = ", ";
	}
	builder.append(")");
	if (operation.getType() != null) {
		builder.append(" : ");
		String name = getTypeName(operation.getTypeSpecifier());
		builder.append(name == null ? "void" : name);
	}
	return builder.toString();
}
 
Example 6
Source File: GrammarElementDeclarationOrder.java    From xtext-core with Eclipse Public License 2.0 6 votes vote down vote up
public static GrammarElementDeclarationOrder get(Grammar grammar) {
	for (Adapter a : grammar.eAdapters())
		if (a instanceof GrammarElementDeclarationOrder)
			return (GrammarElementDeclarationOrder) a;
	GrammarElementDeclarationOrder result = new GrammarElementDeclarationOrder(grammar);
	grammar.eAdapters().add(result);
	for (Grammar g : GrammarUtil.allUsedGrammars(grammar)) {
		EList<Adapter> adapters = g.eAdapters();
		Iterator<Adapter> it = adapters.iterator();
		while (it.hasNext())
			if (it.next() instanceof GrammarElementDeclarationOrder)
				it.remove();
		adapters.add(result);
	}
	return result;
}
 
Example 7
Source File: AbstractScopingTest.java    From dsl-devkit with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Checks if the scope of the given reference for the given context contains only the expected objects.
 * In addition, checks that the reference of the given context references at least one of the expected
 * objects. If the reference has multiplicity > 1, then every reference must reference at least
 * one of the expected objects.
 *
 * @param context
 *          {@link EObject} from which the given objects shall be referenced, must not be {@code null}
 * @param reference
 *          the structural feature of {@code context} for which the scope should be asserted, must not be {@code null} and part of the context element
 * @param expectedObjects
 *          the objects expected in the scope, must not be {@code null}
 */
protected void assertScopedObjects(final EObject context, final EReference reference, final Collection<? extends EObject> expectedObjects) {
  Assert.isNotNull(context, PARAMETER_CONTEXT);
  Assert.isNotNull(reference, PARAMETER_REFERENCE);
  Assert.isNotNull(expectedObjects, PARAMETER_EXPECTED_OBJECTS);
  Assert.isTrue(context.eClass().getEAllReferences().contains(reference), String.format("Contract for argument '%s' failed: Parameter is not within specified range (Expected: %s, Actual: %s).", PARAMETER_CONTEXT, "The context object must contain the given reference.", "Reference not contained by the context object!"));
  Set<URI> expectedUriSet = Sets.newHashSet();
  for (EObject object : expectedObjects) {
    expectedUriSet.add(EcoreUtil.getURI(object));
  }
  IScope scope = getScopeProvider().getScope(context, reference);
  Iterable<IEObjectDescription> allScopedElements = scope.getAllElements();
  Set<URI> scopedUriSet = Sets.newHashSet();
  for (IEObjectDescription description : allScopedElements) {
    URI uri = description.getEObjectURI();
    scopedUriSet.add(uri);
  }
  if (!expectedUriSet.equals(scopedUriSet)) {
    fail("The scope must exactly consist of the expected URIs. Missing " + Sets.difference(expectedUriSet, scopedUriSet) + " extra "
        + Sets.difference(scopedUriSet, expectedUriSet));
  }
  // test that link resolving worked
  boolean elementResolved;
  if (reference.isMany()) {
    @SuppressWarnings("unchecked")
    EList<EObject> objects = (EList<EObject>) context.eGet(reference, true);
    elementResolved = !objects.isEmpty(); // NOPMD
    for (Iterator<EObject> objectIter = objects.iterator(); objectIter.hasNext() && elementResolved;) {
      EObject eObject = EcoreUtil.resolve(objectIter.next(), context);
      elementResolved = expectedUriSet.contains(EcoreUtil.getURI(eObject));
    }
  } else {
    EObject resolvedObject = (EObject) context.eGet(reference, true);
    elementResolved = expectedUriSet.contains(EcoreUtil.getURI(resolvedObject));
  }
  assertTrue("Linking must have resolved one of the expected objects.", elementResolved);
}
 
Example 8
Source File: XbaseDeclarativeHoverSignatureProvider.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
protected String getThrowsDeclaration(JvmExecutable executable) {
	String result = "";
	EList<JvmTypeReference> exceptions = executable.getExceptions();
	if (exceptions.size() > 0) {
		result += " throws ";
		Iterator<JvmTypeReference> iterator = exceptions.iterator();
		while (iterator.hasNext()) {
			JvmTypeReference next = iterator.next();
			result += next.getSimpleName();
			if (iterator.hasNext())
				result += ", ";
		}
	}
	return result;
}
 
Example 9
Source File: Ecore2UimaTypeSystem.java    From uima-uimaj with Apache License 2.0 5 votes vote down vote up
/**
 * Contains named element.
 *
 * @param locallyDefinedFeatures the locally defined features
 * @param name the name
 * @return true, if successful
 */
private static boolean containsNamedElement(EList locallyDefinedFeatures, String name) {
  Iterator iter = locallyDefinedFeatures.iterator();
  while (iter.hasNext()) {
    Object obj = iter.next();
    if (obj instanceof ENamedElement) {
      if (name.equals(((ENamedElement) obj).getName())) {
        return true;
      }
    }
  }
  return false;
}
 
Example 10
Source File: CamelFeatureUtil.java    From tesb-studio-se with Apache License 2.0 5 votes vote down vote up
private static void addConnectionsSpecialFeatures(
			Collection<FeatureModel> features, ProcessType processType) {
		EList<?> connections = processType.getConnection();
		Iterator<?> iterator = connections.iterator();
		while(iterator.hasNext()){
			Object next = iterator.next();
			if(!(next instanceof ConnectionType)){
				continue;
			}
			ConnectionType con = (ConnectionType) next;
			if(!EConnectionType.ROUTE_WHEN.getName().equals(con.getConnectorName())){
				continue;
			}
			EList<?> elementParameters = con.getElementParameter();
			Iterator<?> paraIter = elementParameters.iterator();
			while(paraIter.hasNext()){
				Object paraNext = paraIter.next();
				if(!(paraNext instanceof ElementParameterType)){
					continue;
				}
				ElementParameterType ept = (ElementParameterType) paraNext;
				if(!EParameterName.ROUTETYPE.getName().equals(ept.getName())){
					continue;
				}
//	            String[] strList = { "constant", "el", "groovy", "header", "javaScript", "jxpath", "mvel", "ognl", "php", "property",
//	                    "python", "ruby", "simple", "spel", "sql", "xpath", "xquery" };
				if("groovy".equals(ept.getValue())){
					features.add(FEATURE_CAMEL_GROOVY);
				} else if ("javaScript".equals(ept.getValue())) {
					features.add(FEATURE_CAMEL_SCRIPT);
					features.add(FEATURE_CAMEL_SCRIPT_JAVASCRIPT);
				}
			}
		}
	}
 
Example 11
Source File: CamelDesignerUtil.java    From tesb-studio-se with Apache License 2.0 5 votes vote down vote up
public static boolean checkRouteInputExistInJob(ProcessItem pi) {
       if (pi == null || pi.getProcess() == null) {
		return false;
	}
	EList<?> nodes = pi.getProcess().getNode();
	Iterator<?> iterator = nodes.iterator();
	while (iterator.hasNext()) {
		Object next = iterator.next();
		if (!(next instanceof NodeType)) {
			continue;
		}
		NodeType nt = (NodeType) next;
		if(!EmfModelUtils.isComponentActive(nt) && !EmfModelUtils.computeCheckElementValue("ACTIVATE", nt)){
			continue;
		}
		String componentName = nt.getComponentName();
		if ("tRouteInput".equals(componentName)) {
			return true;
		}else if(service != null){
			ProcessType jobletProcess = service.getJobletProcess(nt);
			if(jobletProcess == null){
				continue;
			}
			if(checkRouteInputExistInJoblet(jobletProcess)){
				return true;
			}
		}
	}
	
	return false;
}
 
Example 12
Source File: CamelDesignerUtil.java    From tesb-studio-se with Apache License 2.0 5 votes vote down vote up
public static boolean checkRouteInputExistInJoblet(ProcessType jobletProcess) {
	if(jobletProcess == null){
		return false;
	}
	EList<?> node = jobletProcess.getNode();
	Iterator<?> iterator = node.iterator();
	while(iterator.hasNext()){
		Object next = iterator.next();
		if(!(next instanceof NodeType)){
			continue;
		}
		NodeType nt = (NodeType) next;
		if(!EmfModelUtils.isComponentActive(nt) && !EmfModelUtils.computeCheckElementValue("ACTIVATE", nt)){
			continue;
		}
		String componentName = nt.getComponentName();
		if ("tRouteInput".equals(componentName)) {
			return true;
		}else if(service != null){
			ProcessType subProcess = service.getJobletProcess(nt);
			if(subProcess == null){
				continue;
			}
			if(checkRouteInputExistInJoblet(subProcess)){
				return true;
			}
		}
	}
	return false;
}
 
Example 13
Source File: DomainmodelLabelProvider.java    From xtext-eclipse with Eclipse Public License 2.0 5 votes vote down vote up
protected void append(StringBuilder builder, JvmTypeReference typeRef) {
	if (typeRef instanceof JvmParameterizedTypeReference) {
		JvmType type = ((JvmParameterizedTypeReference) typeRef).getType();
		append(builder, type);
		EList<JvmTypeReference> arguments = ((JvmParameterizedTypeReference) typeRef).getArguments();
		if (!arguments.isEmpty()) {
			builder.append("<");
			Iterator<JvmTypeReference> iterator = arguments.iterator();
			while (iterator.hasNext()) {
				JvmTypeReference jvmTypeReference = iterator.next();
				append(builder, jvmTypeReference);
				if (iterator.hasNext()) {
					builder.append(",");
				}
			}
			builder.append(">");
		}
	} else {
		if (typeRef instanceof JvmWildcardTypeReference) {
			builder.append("?");
			Iterator<JvmTypeConstraint> contraintsIterator = ((JvmWildcardTypeReference) typeRef).getConstraints().iterator();
			while (contraintsIterator.hasNext()) {
				JvmTypeConstraint constraint = contraintsIterator.next();
				if (constraint instanceof JvmUpperBound) {
					builder.append(" extends ");
				} else {
					builder.append(" super ");
				}
				append(builder, constraint.getTypeReference());
				if (contraintsIterator.hasNext()) {
					builder.append(" & ");
				}
			}
		} else {
			if (typeRef instanceof JvmGenericArrayTypeReference) {
				append(builder, ((JvmGenericArrayTypeReference) typeRef).getType());
			}
		}
	}
}
 
Example 14
Source File: ChartBaseQueryHelper.java    From birt with Eclipse Public License 1.0 5 votes vote down vote up
/**
 * Returns queries of series definition.
 * 
 * @param seriesDefinitions
 * @return
 */
private static List<Query> getQueries(
		EList<SeriesDefinition> seriesDefinitions )
{
	List<Query> querys = new ArrayList<Query>( );
	for ( Iterator<SeriesDefinition> iter = seriesDefinitions.iterator( ); iter.hasNext( ); )
	{
		querys.addAll( iter.next( )
				.getDesignTimeSeries( )
				.getDataDefinition( ) );
	}
	return querys;
}
 
Example 15
Source File: TextUMLCompletionProcessor.java    From textuml with Eclipse Public License 1.0 5 votes vote down vote up
private List<Stereotype> getStereotypes() {
    List<Stereotype> result = new ArrayList<Stereotype>();
    Package[] packages = getRepository().getTopLevelPackages(null);
    Profile[] validProfiles = getValidProfiles(packages);
    for (int i = 0; i < validProfiles.length; i++) {
        EList<Element> elements = validProfiles[i].getOwnedElements();
        for (Iterator<Element> iterator = elements.iterator(); iterator.hasNext();) {
            Element element = iterator.next();
            if (element instanceof Stereotype)
                result.add((Stereotype) element);
        }
    }
    return result;
}
 
Example 16
Source File: PhysicalModelInitializer.java    From Knowage-Server with GNU Affero General Public License v3.0 5 votes vote down vote up
public void markAllColumnsAsDeleted(PhysicalTable physicalTable) {
	EList<PhysicalColumn> physicalColumns = physicalTable.getColumns();
	Iterator<PhysicalColumn> iterator = physicalColumns.iterator();
	while (iterator.hasNext()) {
		PhysicalColumn physicalColumn = iterator.next();
		if (physicalColumn.getProperties().get(PhysicalModelPropertiesFromFileInitializer.IS_DELETED) != null) {
			physicalColumn.getProperties().get(PhysicalModelPropertiesFromFileInitializer.IS_DELETED).setValue("true");
		}
	}
}
 
Example 17
Source File: CompatibleExpressionUpdater.java    From birt with Eclipse Public License 1.0 4 votes vote down vote up
private static void updateRowExpressions( ChartWithAxes cwa,
		Map newExpressions )
{
	final Axis axPrimaryBase = cwa.getPrimaryBaseAxes( )[0];
	EList elSD = axPrimaryBase.getSeriesDefinitions( );

	if ( elSD.size( ) == 0 )
	{
		return;
	}

	SeriesDefinition sd = (SeriesDefinition) elSD.get( 0 );
	String sExpression;
	String newExp;

	// PROJECT THE EXPRESSION ASSOCIATED WITH THE BASE SERIES EXPRESSION
	final Series seBase = sd.getDesignTimeSeries( );
	EList elBaseSeries = seBase.getDataDefinition( );

	for ( Iterator itr = elBaseSeries.iterator( ); itr.hasNext( ); )
	{
		final Query qBaseSeries = (Query) itr.next( );
		if ( qBaseSeries == null )
		{
			continue;
		}
		sExpression = qBaseSeries.getDefinition( );
		newExp = (String) newExpressions.get( sExpression );
		if ( newExp != null )
		{
			qBaseSeries.setDefinition( newExp );
		}
	}

	// PROJECT ALL DATA DEFINITIONS ASSOCIATED WITH THE ORTHOGONAL SERIES
	Query qOrthogonalSeriesDefinition, qOrthogonalSeries;
	Series seOrthogonal;
	EList elOrthogonalSeries;
	final Axis[] axaOrthogonal = cwa.getOrthogonalAxes( axPrimaryBase, true );

	for ( int j = 0; j < axaOrthogonal.length; j++ )
	{
		elSD = axaOrthogonal[j].getSeriesDefinitions( );
		for ( int k = 0; k < elSD.size( ); k++ )
		{
			sd = (SeriesDefinition) elSD.get( k );
			qOrthogonalSeriesDefinition = sd.getQuery( );
			if ( qOrthogonalSeriesDefinition == null )
			{
				continue;
			}
			sExpression = qOrthogonalSeriesDefinition.getDefinition( );
			newExp = (String) newExpressions.get( sExpression );
			if ( newExp != null )
			{
				qOrthogonalSeriesDefinition.setDefinition( newExp );
			}

			seOrthogonal = sd.getDesignTimeSeries( );
			elOrthogonalSeries = seOrthogonal.getDataDefinition( );

			for ( int i = 0; i < elOrthogonalSeries.size( ); i++ )
			{
				qOrthogonalSeries = (Query) elOrthogonalSeries.get( i );
				if ( qOrthogonalSeries == null ) // NPE PROTECTION
				{
					continue;
				}
				sExpression = qOrthogonalSeries.getDefinition( );
				newExp = (String) newExpressions.get( sExpression );
				if ( newExp != null )
				{
					qOrthogonalSeries.setDefinition( newExp );
				}
			}

			// Update orthogonal series trigger expressions.
			updateSeriesTriggerExpressions( seOrthogonal, newExpressions );
		}
	}
}
 
Example 18
Source File: ChartUIUtil.java    From birt with Eclipse Public License 1.0 4 votes vote down vote up
/**
 * Restore cached label position to BarSeries in current chart.
 * 
 * @param currentChart
 *            current chart.
 */
public static void restoreLabelPositionFromCache( Chart currentChart )
{
	if ( currentChart == null )
	{
		return;
	}

	SeriesDefinition[] sds = currentChart.getSeriesForLegend( );
	for ( int i = 0; i < sds.length; i++ )
	{
		EList<Series> seriesList = sds[i].getSeries( );
		for ( Iterator<Series> iter = seriesList.iterator( ); iter.hasNext( ); )
		{
			Series series = iter.next( );
			if ( series instanceof BarSeries )
			{
				String stackedCase = ChartUIConstants.NON_STACKED_TYPE;
				if ( series.isStacked( ) )
				{
					stackedCase = ChartUIConstants.STACKED_TYPE;
				}

				Position labelPosition = ChartCacheManager.getInstance( )
						.findLabelPositionWithStackedCase( stackedCase );

				if ( labelPosition != null )
				{
					series.setLabelPosition( labelPosition );
				}
				else
				{
					if ( series.isStacked( ) )
					{
						series.setLabelPosition( Position.INSIDE_LITERAL );
					}
				}
			}
		}
	}
}
 
Example 19
Source File: CamelEditorDropTargetListener.java    From tesb-studio-se with Apache License 2.0 4 votes vote down vote up
private void createContext() {
    if (selectSourceList.size() == 0) {
        return;
    }
    boolean created = false;
    for (Object source : selectSourceList) {
        if (source instanceof RepositoryNode) {
            RepositoryNode sourceNode = (RepositoryNode) source;
            Item item = sourceNode.getObject().getProperty().getItem();
            if (item instanceof ContextItem) {
                ContextItem contextItem = (ContextItem) item;
                EList context = contextItem.getContext();
                Set<String> contextSet = new HashSet<String>();
                Iterator iterator = context.iterator();
                while (iterator.hasNext()) {
                    Object obj = iterator.next();
                    if (obj instanceof ContextTypeImpl) {
                        EList contextParameters = ((ContextTypeImpl) obj).getContextParameter();
                        Iterator contextParas = contextParameters.iterator();
                        while (contextParas.hasNext()) {
                            ContextParameterTypeImpl contextParameterType = (ContextParameterTypeImpl) contextParas.next();
                            String name = contextParameterType.getName();
                            contextSet.add(name);
                        }
                    }
                }
                IEditorInput editorInput = editor.getEditorInput();
                if (editorInput instanceof JobEditorInput) {
                    JobEditorInput jobInput = (JobEditorInput) editorInput;
                    IProcess2 process = jobInput.getLoadedProcess();
                    IContextManager contextManager = process.getContextManager();
                    Map<String, String> renamedMap = ContextUtils
                            .getContextParamterRenamedMap(process.getProperty().getItem());
                    Set<String> addedVars = ConnectionContextHelper.checkAndAddContextVariables(contextItem, contextSet,
                            process.getContextManager(), false, renamedMap);
                    if (addedVars != null && !addedVars.isEmpty()
                            && !ConnectionContextHelper.isAddContextVar(contextItem, contextManager, contextSet)) {
                        // show
                        Map<String, Set<String>> addedVarsMap = new HashMap<String, Set<String>>();
                        addedVarsMap.put(item.getProperty().getLabel(), contextSet);
                        if (ConnectionContextHelper.showContextdialog(process, contextItem, process.getContextManager(),
                                addedVarsMap, contextSet)) {
                            created = true;
                        }
                    } else {
                        MessageDialog.openInformation(editor.getEditorSite().getShell(), "Adding Context", //$NON-NLS-1$
                                "Context \"" + contextItem.getProperty().getDisplayName() + "\" already exist."); //$NON-NLS-1$

                    }
                }
            }
        }
    }
    if (created) {
        RepositoryPlugin.getDefault().getDesignerCoreService().switchToCurContextsView();
    }
}
 
Example 20
Source File: XbaseCompiler.java    From xtext-extras with Eclipse Public License 2.0 4 votes vote down vote up
protected void appendCatchAndFinally(XTryCatchFinallyExpression expr, ITreeAppendable b, boolean isReferenced) {
	final EList<XCatchClause> catchClauses = expr.getCatchClauses();
	final XExpression finallyExp = expr.getFinallyExpression();
	boolean isTryWithResources = !expr.getResources().isEmpty();
	// If Java 7 or better: use Java's try-with-resources
	boolean nativeTryWithResources = isAtLeast(b, JAVA7);
	final String throwablesStore = b.getName(Tuples.pair(expr, "_caughtThrowables"));

	// Catch
	if (!catchClauses.isEmpty()) {
		String variable = b.declareSyntheticVariable(Tuples.pair(expr, "_caughtThrowable"), "_t");
		b.append(" catch (final Throwable ").append(variable).append(") ");
		b.append("{").increaseIndentation().newLine();
		Iterator<XCatchClause> iterator = catchClauses.iterator();
		while (iterator.hasNext()) {
			XCatchClause catchClause = iterator.next();
			ITreeAppendable catchClauseAppendable = b.trace(catchClause);
			appendCatchClause(catchClause, isReferenced, variable, catchClauseAppendable);
			if (iterator.hasNext()) {
				b.append(" else ");
			}
		}
		b.append(" else {");
		b.increaseIndentation().newLine();
		if (isTryWithResources && !nativeTryWithResources) {
			b.append(throwablesStore + ".add(" + variable + ");").newLine();
		}
		appendSneakyThrow(expr, b, variable);
		closeBlock(b);
		closeBlock(b);
	}

	// Finally
	if (finallyExp != null || (!nativeTryWithResources && isTryWithResources)) {
		b.append(" finally {").increaseIndentation();
		if (finallyExp != null)
			internalToJavaStatement(finallyExp, b, false);
		if (!nativeTryWithResources && isTryWithResources)
			appendFinallyWithResources(expr, b);
		b.decreaseIndentation().newLine().append("}");
	}
}