Creates and returns the preference store for this Java editor with the
given input.

@param input
The editor input for which to create the preference store
@return the preference store for this editor
@since 3.0
777075
private IPreferenceStore createCombinedPreferenceStore(IEditorInput input) {
		List<IPreferenceStore> stores = new ArrayList<IPreferenceStore>(3);

		// IJavaProject project= EditorUtility.getJavaProject(input);
		// if (project != null) {
		// stores.add(new EclipsePreferencesAdapter(new
		// ProjectScope(project.getProject()), JavaCore.PLUGIN_ID));
		// }

		stores.add(VdmUIPlugin.getDefault().getPreferenceStore());
		// stores.add(new
		// PreferencesAdapter(VdmCore.getDefault().getPluginPreferences()));
		stores.add(EditorsUI.getPreferenceStore());
		stores.add(PlatformUI.getPreferenceStore());
		// stores.get(0).setValue(AbstractDecoratedTextEditorPreferenceConstants.EDITOR_OVERVIEW_RULER,true);

		return new ChainedPreferenceStore(
				(IPreferenceStore[]) stores.toArray(new IPreferenceStore[stores
						.size()]));
	}
1127574
public final static String process(final String input, final Configuration configuration)
    {
        try
        {
            return process(new StringReader(input), configuration);
        }
        catch (final IOException e)
        {
            // This _can never_ happen
            return null;
        }
    }
754763
public static String replaceDataReferencesInString(final String input, final Map<String, Map<String, String>> data) {
        return replaceDataReferencesInString(input, data, null, false);
    }
950273
@Override
    public Object map(Object input) {
        String str = input.toString();
        if (exceptions.contains(str)) {
            return str;
        } else {
            return newValue;
        }
    }
1261985
@SuppressWarnings("unchecked")
    public static InputComponent createUIInput(UIProvider provider, InputComponentFactory factory, ConverterFactory converterFactory, String parentName, String name,
                                               Class inputClazz, String required, String currentValue, String defaultValue, String enums, String description,
                                               boolean promptInInteractiveMode, boolean multiValue, String prefix) {

        // is the current value a property placeholder, then we need to use a regular text based UI
        if (currentValue != null && currentValue.startsWith("{{") && currentValue.endsWith("}}")) {
            // switch over to plain string
            inputClazz = String.class;
            enums = null;
        }

        InputComponent input;
        if (enums != null) {
            UISelectOne ui = factory.createSelectOne(name, inputClazz);
            // the enums are comma separated
            List<String> enumValues = new ArrayList<>();
            String[] values = enums.split(",");
            for (String v : values) {
                enumValues.add(v.trim());
            }
            ui.setValueChoices(enumValues);
            if (defaultValue != null) {
                Object value = defaultValue;
                Converter converter = converterFactory.getConverter(String.class, inputClazz);
                if (converter != null) {
                    value = converter.convert(defaultValue);
                }
                ui.setDefaultValue(value);
            }
            if (currentValue != null) {
                Object value = currentValue;
                Converter converter = converterFactory.getConverter(String.class, inputClazz);
                if (converter != null) {
                    value = converter.convert(currentValue);
                }
                // set the value from the enum choices so the UI can indicate this correctly in the UI
                for (String v : enumValues) {
                    if (v.equalsIgnoreCase((String) value)) {
                        value = v;
                        break;
                    }
                }
                ui.setValue(value);
            }

            if ("true".equals(required) || promptInInteractiveMode) {
                // This will always prompt, regardless if there is a value set
                Iterator it = ui.getFacets().iterator();
                while (it.hasNext()) {
                    Object facet = it.next();
                    if (facet instanceof HintsFacet) {
                        ((HintsFacet) facet).setPromptInInteractiveMode(true);
                    }
                }
            }

            input = ui;
        } else {
            UIInput ui = factory.createInput(name, inputClazz);
            if (defaultValue != null) {
                Object value = defaultValue;
                Converter converter = converterFactory.getConverter(String.class, inputClazz);
                if (converter != null) {
                    value = converter.convert(defaultValue);
                }
                ui.setDefaultValue(value);
            }
            if (currentValue != null) {
                Object value = currentValue;
                Converter converter = converterFactory.getConverter(String.class, inputClazz);
                if (converter != null) {
                    value = converter.convert(currentValue);
                }
                ui.setValue(value);
            }

            if ("true".equals(required) || promptInInteractiveMode) {
                // This will always prompt, regardless if there is a value set
                Iterator it = ui.getFacets().iterator();
                while (it.hasNext()) {
                    Object facet = it.next();
                    if (facet instanceof HintsFacet) {
                        ((HintsFacet) facet).setPromptInInteractiveMode(true);
                    }
                }
            }

            input = ui;
        }

        if (Objects.equals("true", required)) {
            input.setRequired(true);
        }

        // if the name is "expression" then its a placeholder for the parent name to be used instead as label
        String label;
        if (name.equals("expression") && parentName != null) {
            label = asTitleCase(parentName + "Language");
        } else if (name.startsWith("expression_") && parentName != null) {
            // the expression may have a number of extra inputs we need to show as well
            String namePostfix = name.substring(11);
            // upper case the first char
            namePostfix = Character.toTitleCase(namePostfix.charAt(0)) + namePostfix.substring(1);
            label = asTitleCase(parentName + namePostfix);
        } else {
            label = asTitleCase(name);
        }
        if (multiValue) {
            label += " (multivalued)";
        }
        input.setLabel(label);

        if (!provider.isGUI()) {
            // no description in CLI/embedded as that clutters the shell
            input.setDescription("");
        } else {
            if (multiValue) {
                String extra = "This option is multi valued, which means you can provide multiple key/value pairs"
                        + " prefixed with " + prefix + " and separated with &, eg " + prefix + "foo=123&" + prefix + "bar=456";
                if (description == null) {
                    description = extra;
                } else {
                    if (description.endsWith(".")) {
                        description += " " + extra;
                    } else {
                        description += ". " + extra;
                    }
                }
            }
            // must use an empty description otherwise the GUI prints null
            input.setDescription(description != null ? description : "");
        }

        return input;
    }
521846
public static String hyphenOptional(final String input) {
		return input.replaceAll(HYPHEN_MINUS, HYPHEN_MINUS + "?").replaceAll(SOFT_HYPHEN, SOFT_HYPHEN + "?");
	}
501601
protected int[] getConstantKeySet(int input) {
		Operator<?> contract = getPactContract();
		if (contract instanceof AbstractUdfOperator<?, ?>) {
			AbstractUdfOperator<?, ?> abstractPact = (AbstractUdfOperator<?, ?>) contract;
			int[] keyColumns = abstractPact.getKeyColumns(input);
			if (keyColumns != null) {
				if (keyColumns.length == 0) {
					return null;
				}
				for (int keyColumn : keyColumns) {
					if (!isFieldConstant(input, keyColumn)) {
						return null;	
					}
				}
				return keyColumns;
			}
		}
		return null;
	}
1085843
protected String getSubstitutionValue(String input)
   {
      if (input == null || input.trim().equals(""))
         return input;

      while (input.indexOf("${") != -1)
      {
         int from = input.indexOf("${");
         int to = input.indexOf("}");
         int dv = input.indexOf(":", from + 2);

         if (dv != -1 && dv > to)
         {
            dv = -1;
         }
         
         String systemProperty = "";
         String defaultValue = "";
         if (dv == -1)
         {
            String s = input.substring(from + 2, to);
            if ("/".equals(s))
            {
               systemProperty = File.separator;
            }
            else if (":".equals(s))
            {
               systemProperty = File.pathSeparator;
            }
            else
            {
               systemProperty = SecurityActions.getSystemProperty(s);
            }
         }
         else
         {
            systemProperty = SecurityActions.getSystemProperty(input.substring(from + 2, dv));
            defaultValue = input.substring(dv + 1, to);
         }
         String prefix = "";
         String postfix = "";

         if (from != 0)
         {
            prefix = input.substring(0, from);
         }
         
         if (to + 1 < input.length() - 1)
         {
            postfix = input.substring(to + 1);
         }

         if (systemProperty != null && !systemProperty.trim().equals(""))
         {
            input = prefix + systemProperty + postfix;
         }
         else if (!defaultValue.trim().equals(""))
         {
            input = prefix + defaultValue + postfix;
         }
         else
         {
            input = prefix + postfix;
         }
      }
      return input;
   }
1352480
@Deprecated
	public void addInput(Operator<IN>... input) {
		this.input = Operator.createUnionCascade(this.input, input);
	}
1327832
public void setInput(final String input)
		throws DecodingException
	{

		boolean zipFlag = input.charAt(0) == '_';
		if (zipFlag) {
			r = new BitReader(inflateInput(
					Base64.decodeBase64(input.substring(1)), 0));
		}
		else {
			byte[] data = Base64.decodeBase64(input);
			if (data == null) {

				for (int i = 0; i < input.length(); i++) {
					System.err.println(i + ": " + (int) input.charAt(i)
							+ " <> " + input.charAt(i));
				}

				throw new DecodingException("BASE 64 DECODING FAILED: " + input);
			}
			r = new BitReader(data);
		}
	}
838323
public static String getPreference( String preferenceKey, String defaultValue ) {
        Preferences preferences = Preferences.userRoot().node(PREFS_NODE_NAME);
        String preference = preferences.get(preferenceKey, defaultValue);
        return preference;
    }
1367737
public CacheKeyBuilder appendCacheablesIgnoringOrder(Collection<? extends Cacheable> input)
  {
    appendItem(CACHEABLE_LIST_KEY, cacheableCollectionToByteArray(input, false));
    return this;
  }
1134074
public static File searchForGroovyScriptFile(String input) {
        String scriptFileName = input.trim();
        File scriptFile = new File(scriptFileName);
        // TODO: Shouldn't these extensions be kept elsewhere?  What about CompilerConfiguration?
        // This method probably shouldn't be in GroovyMain either.
        String[] standardExtensions = {".groovy",".gvy",".gy",".gsh"};
        int i = 0;
        while (i < standardExtensions.length && !scriptFile.exists()) {
            scriptFile = new File(scriptFileName + standardExtensions[i]);
            i++;
        }
        // if we still haven't found the file, point back to the originally specified filename
        if (!scriptFile.exists()) {
            scriptFile = new File(scriptFileName);
        }
        return scriptFile;
    }
1346590
public static String toConverterPreferenceValue(IExtraLanguageConversionInitializer input) {
		final StringBuilder builder = new StringBuilder();
		input.initializeConversions((baseName, source, target) -> {
			if (builder.length() > 0) {
				builder.append(PREFERENCE_SEPARATOR);
			}
			builder.append(source);
			builder.append(PREFERENCE_SEPARATOR);
			builder.append(target);
		});
		return builder.toString();
	}
881367
public Processor setInput(final URI input) {
        if (!input.isAbsolute()) {
            throw new IllegalArgumentException("Input file URI must be absolute: " + input);
        }
        args.put("args.input", input.toString());
        return this;
    }
605763
public static String[] internInPlace(String[] input) {
        if (input == null) {
            return null;
        } else if (input.length == 0) {
            return EMPTY_STRING_ARRAY;
        }
        for (int i=0; i<input.length; i++) {
            input[i] = Util.intern(input[i]);
        }
        return input;
    }
424893
public static String swapCase(String input) {
        if (input == null || input.length() == 0) {
            return "";
        }
        StringBuilder resultBuilder = new StringBuilder();
        for (char ch : input.toCharArray()) {
            if (Character.isUpperCase(ch)) {
                resultBuilder.append(Character.toLowerCase(ch));
            } else {
                resultBuilder.append(Character.toUpperCase(ch));
            }
        }
        return resultBuilder.toString();
    }