private void checkContextGroupSource() {
   IContextManager contextManager = getContextManager();
   if (helper == null) {
     return;
   }
   if (contextManager != null) {
     helper.initHelper(contextManager);
     Map<String, Item> items = new HashMap<String, Item>();
     boolean needRefresh = false;
     for (IContextParameter param : contextManager.getDefaultContext().getContextParameterList()) {
       if (!param.isBuiltIn()) {
         String source = param.getSource();
         Item sourceItem = items.get(source);
         if (sourceItem == null) {
           sourceItem = ContextUtils.getRepositoryContextItemById(source);
         }
         if (sourceItem == null) { // source not found
           needRefresh = true;
           param.setSource(IContextParameter.BUILT_IN);
           propagateType(contextManager, param);
         } else {
           items.put(source, sourceItem);
         }
       }
     }
     if (needRefresh) {
       setModifiedFlag(contextManager);
       modelManager.refresh();
     }
   }
 }
 private void initExistedParametersMap() {
   if (!isValid(manager)) {
     return;
   }
   itemNameToParametersMap.clear();
   for (IContextParameter param : manager.getDefaultContext().getContextParameterList()) {
     if (!param.isBuiltIn()) {
       final String source = param.getSource();
       Set<String> paramSet = itemNameToParametersMap.get(source);
       if (paramSet == null) {
         paramSet = new HashSet<String>();
         itemNameToParametersMap.put(source, paramSet);
       }
       paramSet.add(param.getName());
     }
   }
 }
  /**
   * ggu Comment method "checkAndSetDefaultValue".
   *
   * <p>if value is null or empty. will return the undef value (bug 4420).
   */
  public static void checkAndSetDefaultValue(final IContextParameter param) {
    if (param == null) {
      return;
    }
    final String value = param.getValue();
    final String type = param.getType();

    if (param.isBuiltIn() && (value == null || "".equals(value.trim()))) { // $NON-NLS-1$
      final ECodeLanguage codeLanguage = LanguageManager.getCurrentLanguage();
      switch (codeLanguage) {
        case JAVA:
          //
          break;
        case PERL:
        default:
          param.setValue("undef"); // $NON-NLS-1$
      }
    }
    return;
  }