<s> package org . eclipse . jdt . internal . codeassist . impl ; import java . util . Map ; import org . eclipse . jdt . core . compiler . CharOperation ; public class AssistOptions { public static final String OPTION_PerformVisibilityCheck = "" ; public static final String OPTION_PerformDeprecationCheck = "" ; public static final String OPTION_ForceImplicitQualification = "" ; public static final String OPTION_FieldPrefixes = "" ; public static final String OPTION_StaticFieldPrefixes = "" ; public static final String OPTION_StaticFinalFieldPrefixes = "" ; public static final String OPTION_LocalPrefixes = "" ; public static final String OPTION_ArgumentPrefixes = "" ; public static final String OPTION_FieldSuffixes = "" ; public static final String OPTION_StaticFieldSuffixes = "" ; public static final String OPTION_StaticFinalFieldSuffixes = "" ; public static final String OPTION_LocalSuffixes = "" ; public static final String OPTION_ArgumentSuffixes = "" ; public static final String OPTION_PerformForbiddenReferenceCheck = "" ; public static final String OPTION_PerformDiscouragedReferenceCheck = "" ; public static final String OPTION_CamelCaseMatch = "" ; public static final String OPTION_SuggestStaticImports = "" ; public static final String ENABLED = "enabled" ; public static final String DISABLED = "disabled" ; public boolean checkVisibility = false ; public boolean checkDeprecation = false ; public boolean checkForbiddenReference = false ; public boolean checkDiscouragedReference = false ; public boolean forceImplicitQualification = false ; public boolean camelCaseMatch = true ; public boolean suggestStaticImport = true ; public char [ ] [ ] fieldPrefixes = null ; public char [ ] [ ] staticFieldPrefixes = null ; public char [ ] [ ] staticFinalFieldPrefixes = null ; public char [ ] [ ] localPrefixes = null ; public char [ ] [ ] argumentPrefixes = null ; public char [ ] [ ] fieldSuffixes = null ; public char [ ] [ ] staticFieldSuffixes = null ; public char [ ] [ ] staticFinalFieldSuffixes = null ; public char [ ] [ ] localSuffixes = null ; public char [ ] [ ] argumentSuffixes = null ; public AssistOptions ( ) { } public AssistOptions ( Map settings ) { if ( settings == null ) return ; set ( settings ) ; } public void set ( Map optionsMap ) { Object optionValue ; if ( ( optionValue = optionsMap . get ( OPTION_PerformVisibilityCheck ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . checkVisibility = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . checkVisibility = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_ForceImplicitQualification ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . forceImplicitQualification = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . forceImplicitQualification = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_FieldPrefixes ) ) != null ) { if ( optionValue instanceof String ) { String stringValue = ( String ) optionValue ; if ( stringValue . length ( ) > 0 ) { this . fieldPrefixes = splitAndTrimOn ( ',' , stringValue . toCharArray ( ) ) ; } else { this . fieldPrefixes = null ; } } } if ( ( optionValue = optionsMap . get ( OPTION_StaticFieldPrefixes ) ) != null ) { if ( optionValue instanceof String ) { String stringValue = ( String ) optionValue ; if ( stringValue . length ( ) > 0 ) { this . staticFieldPrefixes = splitAndTrimOn ( ',' , stringValue . toCharArray ( ) ) ; } else { this . staticFieldPrefixes = null ; } } } if ( ( optionValue = optionsMap . get ( OPTION_StaticFinalFieldPrefixes ) ) != null ) { if ( optionValue instanceof String ) { String stringValue = ( String ) optionValue ; if ( stringValue . length ( ) > 0 ) { this . staticFinalFieldPrefixes = splitAndTrimOn ( ',' , stringValue . toCharArray ( ) ) ; } else { this . staticFinalFieldPrefixes = null ; } } } if ( ( optionValue = optionsMap . get ( OPTION_LocalPrefixes ) ) != null ) { if ( optionValue instanceof String ) { String stringValue = ( String ) optionValue ; if ( stringValue . length ( ) > 0 ) { this . localPrefixes = splitAndTrimOn ( ',' , stringValue . toCharArray ( ) ) ; } else { this . localPrefixes = null ; } } } if ( ( optionValue = optionsMap . get ( OPTION_ArgumentPrefixes ) ) != null ) { if ( optionValue instanceof String ) { String stringValue = ( String ) optionValue ; if ( stringValue . length ( ) > 0 ) { this . argumentPrefixes = splitAndTrimOn ( ',' , stringValue . toCharArray ( ) ) ; } else { this . argumentPrefixes = null ; } } } if ( ( optionValue = optionsMap . get ( OPTION_FieldSuffixes ) ) != null ) { if ( optionValue instanceof String ) { String stringValue = ( String ) optionValue ; if ( stringValue . length ( ) > 0 ) { this . fieldSuffixes = splitAndTrimOn ( ',' , stringValue . toCharArray ( ) ) ; } else { this . fieldSuffixes = null ; } } } if ( ( optionValue = optionsMap . get ( OPTION_StaticFieldSuffixes ) ) != null ) { if ( optionValue instanceof String ) { String stringValue = ( String ) optionValue ; if ( stringValue . length ( ) > 0 ) { this . staticFieldSuffixes = splitAndTrimOn ( ',' , stringValue . toCharArray ( ) ) ; } else { this . staticFieldSuffixes = null ; } } } if ( ( optionValue = optionsMap . get ( OPTION_StaticFinalFieldSuffixes ) ) != null ) { if ( optionValue instanceof String ) { String stringValue = ( String ) optionValue ; if ( stringValue . length ( ) > 0 ) { this . staticFinalFieldSuffixes = splitAndTrimOn ( ',' , stringValue . toCharArray ( ) ) ; } else { this . staticFinalFieldSuffixes = null ; } } } if ( ( optionValue = optionsMap . get ( OPTION_LocalSuffixes ) ) != null ) { if ( optionValue instanceof String ) { String stringValue = ( String ) optionValue ; if ( stringValue . length ( ) > 0 ) { this . localSuffixes = splitAndTrimOn ( ',' , stringValue . toCharArray ( ) ) ; } else { this . localSuffixes = null ; } } } if ( ( optionValue = optionsMap . get ( OPTION_ArgumentSuffixes ) ) != null ) { if ( optionValue instanceof String ) { String stringValue = ( String ) optionValue ; if ( stringValue . length ( ) > 0 ) { this . argumentSuffixes = splitAndTrimOn ( ',' , stringValue . toCharArray ( ) ) ; } else { this . argumentSuffixes = null ; } } } if ( ( optionValue = optionsMap . get ( OPTION_PerformForbiddenReferenceCheck ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . checkForbiddenReference = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . checkForbiddenReference = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_PerformDiscouragedReferenceCheck ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . checkDiscouragedReference = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . checkDiscouragedReference = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_CamelCaseMatch ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . camelCaseMatch = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . camelCaseMatch = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_PerformDeprecationCheck ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . checkDeprecation = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . checkDeprecation = false ; } } if ( ( optionValue = optionsMap . get ( OPTION_SuggestStaticImports ) ) != null ) { if ( ENABLED . equals ( optionValue ) ) { this . suggestStaticImport = true ; } else if ( DISABLED . equals ( optionValue ) ) { this . suggestStaticImport = false ; } } } private char [ ] [ ] splitAndTrimOn ( char divider , char [ ] arrayToSplit ) { char [ ] [ ] result = CharOperation . splitAndTrimOn ( ',' , arrayToSplit ) ; int length = result . length ; int resultCount = 0 ; for ( int i = 0 ; i < length ; i ++ ) { if ( result [ i ] . length != 0 ) { result [ resultCount ++ ] = result [ i ] ; } } if ( resultCount != length ) { System . arraycopy ( result , 0 , result = new char [ resultCount ] [ ] , 0 , resultCount ) ; } return result ; } } </s>