If non-null, wrap the {@link ViewDeclarationLanguage} returned by the delegate in a new
{@link SeamViewDeclarationLanguage} instance.
974728
@Override
    public ViewDeclarationLanguage getViewDeclarationLanguage(FacesContext context, String viewId) {
        ViewDeclarationLanguage vdl = delegate.getViewDeclarationLanguage(context, viewId);
        if (vdl != null) {
            return new SeamViewDeclarationLanguage(vdl);
        } else {
            return null;
        }
    }
1175788
@SuppressWarnings("unchecked")
  public static void setDefaultHandlerVisualizer() {
    defaultHandlers = new ArrayList<>(1);
    Class<? extends ResultHandler> clz;
    try {
      clz = (Class<? extends ResultHandler>) Thread.currentThread().getContextClassLoader().loadClass(//
          "de.lmu.ifi.dbs.elki.result.AutomaticVisualization");
    }
    catch(ClassNotFoundException e) {
      clz = ResultWriter.class;
    }
    defaultHandlers.add(clz);
  }
1288088
private void addReturnTypeNarrowingDeclarations(AbstractTypeDeclaration node) {
    TypeElement type = node.getTypeElement();

    // No need to run this if the entire class is dead.
    if (deadCodeMap != null && deadCodeMap.containsClass(type, elementUtil)) {
      return;
    }

    Map<String, ExecutablePair> newDeclarations = new HashMap<>();
    Map<String, TypeMirror> resolvedReturnTypes = new HashMap<>();
    for (DeclaredType inheritedType : typeUtil.getObjcOrderedInheritedTypes(type.asType())) {
      TypeElement inheritedElem = (TypeElement) inheritedType.asElement();
      for (ExecutableElement methodElem : ElementUtil.getMethods(inheritedElem)) {
        if (ElementUtil.isPrivate(methodElem)) {
          continue;
        }
        TypeMirror declaredReturnType = typeUtil.erasure(methodElem.getReturnType());
        if (!TypeUtil.isReferenceType(declaredReturnType)) {
          continue;  // Short circuit
        }
        String selector = nameTable.getMethodSelector(methodElem);
        ExecutableType methodType = typeUtil.asMemberOf(inheritedType, methodElem);
        TypeMirror returnType = typeUtil.erasure(methodType.getReturnType());
        TypeMirror resolvedReturnType = resolvedReturnTypes.get(selector);
        if (resolvedReturnType == null) {
          resolvedReturnType = declaredReturnType;
          resolvedReturnTypes.put(selector, resolvedReturnType);
        } else if (!typeUtil.isSubtype(returnType, resolvedReturnType)) {
          continue;
        }
        if (resolvedReturnType != returnType
            && !nameTable.getObjCType(resolvedReturnType).equals(
                nameTable.getObjCType(returnType))) {
          newDeclarations.put(selector, new ExecutablePair(methodElem, methodType));
          resolvedReturnTypes.put(selector, returnType);
        }
      }
    }

    for (Map.Entry<String, ExecutablePair> newDecl : newDeclarations.entrySet()) {
      if (deadCodeMap != null
          && deadCodeMap.containsMethod(newDecl.getValue().element(), typeUtil)) {
        continue;
      }
      node.addBodyDeclaration(newReturnTypeNarrowingDeclaration(
          newDecl.getKey(), newDecl.getValue(), type));
    }
  }
402921
public UI wrapLayout(Layout layout) {
        // TODO: add a header to switch the style, etc
        // TODO: add bookmark to set the style
        if (server.getConfig().isDevelopmentHeader()) {
            final VerticalSplitPanel mainLayout = new VerticalSplitPanel();
            mainLayout.setSizeFull();
            mainLayout.setSplitPosition(SPLIT_POSITION, Sizeable.Unit.PIXELS);
            mainLayout.setLocked(true);

            final DevApplicationHeader header = new DevApplicationHeader(server);
            header.setSpacing(true);
            mainLayout.setFirstComponent(header);

            mainLayout.setSecondComponent(layout);

            return new DevUI(mainLayout);
        } else {
            return new DevUI(layout);
        }
    }
710941
public T withLabel(String text, String languageCode) {
		withLabel(factory.getMonolingualTextValue(text, languageCode));
		return getThis();
	}
513434
public AsciiSequenceView wrap(final DirectBuffer buffer, final int offset, final int length)
    {
        this.buffer = buffer;
        this.offset = offset;
        this.length = length;

        return this;
    }
228595
private void fixDeclaringClass(DeclarationExpression newDeclExpr) {
        if (newDeclExpr.getDeclaringClass() == null && currentMethod != null) {
            newDeclExpr.setDeclaringClass(currentMethod.getDeclaringClass());
        }
    }
905238
@SuppressWarnings("unchecked")
	public static <T> T stripProxy(@Nullable final WrappingProxy<T> wrappingProxy) {
		if (wrappingProxy == null) {
			return null;
		}

		T delegate = wrappingProxy.getWrappedDelegate();

		int numProxiesStripped = 0;
		while (delegate instanceof WrappingProxy) {
			throwIfSafetyNetExceeded(++numProxiesStripped);
			delegate = ((WrappingProxy<T>) delegate).getWrappedDelegate();
		}

		return delegate;
	}
1107560
public void setLanguage(String v) {
    if (Header_Type.featOkTst && ((Header_Type)jcasType).casFeat_language == null)
      jcasType.jcas.throwFeatMissing("language", "de.julielab.jules.types.Header");
    jcasType.ll_cas.ll_setStringValue(addr, ((Header_Type)jcasType).casFeatCode_language, v);}
756750
protected void generateClosureDefinition(XClosure closure, IAppendable it, IExtraLanguageGeneratorContext context) {
		if (!it.hasName(closure)) {
			final LightweightTypeReference closureType0 = getExpectedType(closure);
			LightweightTypeReference closureType = closureType0;
			if (closureType0.isFunctionType()) {
				final FunctionTypeReference fctRef = closureType0.tryConvertToFunctionTypeReference(true);
				if (fctRef != null) {
					closureType = Utils.toLightweightTypeReference(fctRef.getType(), this.typeServices).getRawTypeReference();
				}
			}
			final String closureName = it.declareSyntheticVariable(closure, "__Jclosure_" //$NON-NLS-1$
					+ closureType.getSimpleName());
			final JvmDeclaredType rawType = (JvmDeclaredType) closureType.getType();
			final JvmOperation function = rawType.getDeclaredOperations().iterator().next();
			// Add the object type as super type because of an issue in the Python language.
			final JvmTypeReference objType = getTypeReferences().getTypeForName(Object.class, closure);
			it.openPseudoScope();
			it.append("class ").append(closureName).append("(") //$NON-NLS-1$//$NON-NLS-2$
				.append(closureType).append(",").append(objType.getType()).append("):") //$NON-NLS-1$ //$NON-NLS-2$
				.increaseIndentation().newLine().append("def ") //$NON-NLS-1$
				.append(function.getSimpleName()).append("(") //$NON-NLS-1$
				.append(getExtraLanguageKeywordProvider().getThisKeywordLambda().apply());
			for (final JvmFormalParameter param : closure.getFormalParameters()) {
				it.append(", "); //$NON-NLS-1$
				final String name = it.declareUniqueNameVariable(param, param.getName());
				it.append(name);
			}
			it.append("):"); //$NON-NLS-1$
			it.increaseIndentation().newLine();
			if (closure.getExpression() != null) {
				LightweightTypeReference returnType = closureType0;
				if (returnType.isFunctionType()) {
					final FunctionTypeReference fctRef = returnType.tryConvertToFunctionTypeReference(true);
					if (fctRef != null) {
						returnType = fctRef.getReturnType();
					} else {
						returnType = null;
					}
				} else {
					returnType = null;
				}
				//LightweightTypeReference returnType = getClosureOperationReturnType(type, operation);
				generate(closure.getExpression(), returnType, it, context);
			} else {
				it.append("pass"); //$NON-NLS-1$
			}
			it.decreaseIndentation().decreaseIndentation().newLine();
			it.closeScope();
		}
	}
1362527
@Override
  public final void setLang(final Languages pLang) {
    this.lang = pLang;
    if (this.itsId == null) {
      this.itsId = new IdI18nChooseableSpecifics();
    }
    this.itsId.setLang(this.lang);
  }
545772
private void initLanguageSwitch(Collection<Locale> locales, Locale current) {

        FormLayout languages = new FormLayout();
        languages.setHeight("100%");
        languages.setDefaultComponentAlignment(Alignment.MIDDLE_LEFT);
        ComboBox languageSelect = new ComboBox();
        languageSelect.setCaption(m_messages.key(Messages.GUI_LANGUAGE_SWITCHER_LABEL_0));
        languageSelect.setNullSelectionAllowed(false);

        // set Locales
        for (Locale locale : locales) {
            languageSelect.addItem(locale);
            String caption = locale.getDisplayName(UI.getCurrent().getLocale());
            if (CmsLocaleManager.getDefaultLocale().equals(locale)) {
                caption += " ("
                    + Messages.get().getBundle(UI.getCurrent().getLocale()).key(Messages.GUI_DEFAULT_LOCALE_0)
                    + ")";
            }
            languageSelect.setItemCaption(locale, caption);
        }
        languageSelect.setValue(current);
        languageSelect.setNewItemsAllowed(false);
        languageSelect.setTextInputAllowed(false);
        languageSelect.addValueChangeListener(new ValueChangeListener() {

            private static final long serialVersionUID = 1L;

            public void valueChange(ValueChangeEvent event) {

                m_listener.handleLanguageChange((Locale)event.getProperty().getValue());

            }
        });

        if (locales.size() == 1) {
            languageSelect.setEnabled(false);
        }
        languages.addComponent(languageSelect);
        m_languageSwitch = languages;
    }
206128
public WindowDeclarationDescr windowDeclaration(DeclareDescrBuilder ddb) throws RecognitionException {
        WindowDeclarationDescrBuilder declare = null;
        try {
            declare = helper.start(ddb,
                    WindowDeclarationDescrBuilder.class,
                    null);

            setAnnotationsOn(declare);

            String window = "";

            match(input,
                    DRL6Lexer.ID,
                    DroolsSoftKeywords.WINDOW,
                    null,
                    DroolsEditorType.KEYWORD);
            if (state.failed)
                return null;

            Token id = match(input,
                    DRL6Lexer.ID,
                    null,
                    null,
                    DroolsEditorType.IDENTIFIER);
            if (state.failed)
                return null;
            window = id.getText();

            if (state.backtracking == 0) {
                declare.name(window);
            }

            lhsPatternBind(declare, false);

            match(input,
                    DRL6Lexer.ID,
                    DroolsSoftKeywords.END,
                    null,
                    DroolsEditorType.KEYWORD);

            if (state.failed)
                return null;

        } catch (RecognitionException re) {
            reportError(re);
        } finally {
            helper.end(WindowDeclarationDescrBuilder.class,
                    declare);
        }
        return (declare != null) ? declare.getDescr() : null;
    }
159042
@Override
  public final void setLang(final Languages pLang) {
    this.lang = pLang;
    if (this.itsId == null) {
      this.itsId = new IdI18nServiceToSale();
    }
    this.itsId.setLang(this.lang);
  }
754651
@Nullable
  @CheckForNull
  public String getDescription(String languageCode) {
    String i18nDescription = getString(getI18nAttributeName(DESCRIPTION, languageCode));
    return i18nDescription != null ? i18nDescription : getDescription();
  }
474959
@Override
  public final void setLang(final Languages pLang) {
    this.lang = pLang;
    if (this.itsId == null) {
      this.itsId = new IdI18nCurrency();
    }
    this.itsId.setLang(this.lang);
  }
1143258
private @Nullable
	View resolveViewName(String viewName, Locale locale) throws Exception {
		for (ViewResolver r : resolvers) {
			View view = r.resolveViewName(viewName, locale);
			if (view != null) {
				return view;
			}
		}
		return null;
	}