StringBuffer buf= new StringBuffer(""); if ((stateMask & SWT.CTRL) == SWT.CTRL) appendModifierString(buf, SWT.CTRL); if ((stateMask & SWT.ALT) == SWT.ALT) appendModifierString(buf, SWT.ALT); if ((stateMask & SWT.SHIFT) == SWT.SHIFT) appendModifierString(buf, SWT.SHIFT); if ((stateMask & SWT.COMMAND) == SWT.COMMAND) appendModifierString(buf,  SWT.COMMAND); hovers[i].fModifierString= buf.toString();
hovers[i].fModifierString= EditorUtility.getModifierString(stateMask);
	private static void initializeFromPreferences(JavaEditorTextHoverDescriptor[] hovers) {		String compiledTextHoverModifiers= JavaPlugin.getDefault().getPreferenceStore().getString(PreferenceConstants.EDITOR_TEXT_HOVER_MODIFIERS);				StringTokenizer tokenizer= new StringTokenizer(compiledTextHoverModifiers, VALUE_SEPARATOR);		HashMap idToModifier= new HashMap(tokenizer.countTokens() / 2);		while (tokenizer.hasMoreTokens()) {			String id= tokenizer.nextToken();			if (tokenizer.hasMoreTokens())				idToModifier.put(id, tokenizer.nextToken());		}		String compiledTextHoverModifierMasks= JavaPlugin.getDefault().getPreferenceStore().getString(PreferenceConstants.EDITOR_TEXT_HOVER_MODIFIER_MASKS);		tokenizer= new StringTokenizer(compiledTextHoverModifierMasks, VALUE_SEPARATOR);		HashMap idToModifierMask= new HashMap(tokenizer.countTokens() / 2);		while (tokenizer.hasMoreTokens()) {			String id= tokenizer.nextToken();			if (tokenizer.hasMoreTokens())				idToModifierMask.put(id, tokenizer.nextToken());		}		for (int i= 0; i < hovers.length; i++) {			String modifierString= (String)idToModifier.get(hovers[i].getId());			boolean enabled= true;			if (modifierString == null)				modifierString= DISABLED_TAG;						if (modifierString.startsWith(DISABLED_TAG)) {				enabled= false;				modifierString= modifierString.substring(1);			}			if (modifierString.equals(NO_MODIFIER))				modifierString= ""; //$NON-NLS-1$			hovers[i].fModifierString= modifierString;			hovers[i].fIsEnabled= enabled;			hovers[i].fStateMask= computeStateMask(modifierString);			if (hovers[i].fStateMask == -1) {				// Fallback: use stored modifier masks				try {					hovers[i].fStateMask= Integer.parseInt((String)idToModifierMask.get(hovers[i].getId()));				} catch (NumberFormatException ex) {					hovers[i].fStateMask= -1;				}				// Fix modifier string				int stateMask= hovers[i].fStateMask;				if (stateMask == -1)					stateMask= 0;				StringBuffer buf= new StringBuffer(""); //$NON-NLS-1$				if ((stateMask & SWT.CTRL) == SWT.CTRL)					appendModifierString(buf, SWT.CTRL);				if ((stateMask & SWT.ALT) == SWT.ALT)					appendModifierString(buf, SWT.ALT);				if ((stateMask & SWT.SHIFT) == SWT.SHIFT)					appendModifierString(buf, SWT.SHIFT);				if ((stateMask & SWT.COMMAND) == SWT.COMMAND)					appendModifierString(buf,  SWT.COMMAND);				hovers[i].fModifierString= buf.toString();			}		}	}