idx int64 0 41.2k | question stringlengths 74 4.04k | target stringlengths 7 750 |
|---|---|---|
22,900 | private static HttpBuilder defaults ( HttpBuilder builder ) { if ( defaultTimeout != null ) { builder . timeout ( defaultTimeout ) ; } if ( defaultTimeoutConnection != null ) { builder . timeoutConnection ( defaultTimeoutConnection ) ; } if ( defaultTimeoutRead != null ) { builder . timeoutRead ( defaultTimeoutRead ) ; } if ( defaultHeader != null ) { builder . headers ( defaultHeader ) ; } return builder ; } | Setting the static defaults before returning the builder |
22,901 | public static void printBox ( String title , String message ) { printBox ( title , Splitter . on ( LINEBREAK ) . splitToList ( message ) ) ; } | Prints a box with the given title and message to the logger the title can be omitted . |
22,902 | public static void printBox ( String title , List < String > messageLines ) { Say . info ( "{message}" , generateBox ( title , messageLines ) ) ; } | Prints a box with the given title and message lines to the logger the title can be omitted . |
22,903 | public static void setUtc ( Date time ) { setClock ( Clock . fixed ( time . toInstant ( ) , ZoneId . of ( "UTC" ) ) ) ; } | Creates a fixed Clock . |
22,904 | public synchronized static void addShutdownHook ( Runnable task ) { if ( task != null ) { Runtime . getRuntime ( ) . addShutdownHook ( new Thread ( ( ) -> { try { task . run ( ) ; } catch ( RuntimeException rex ) { Say . warn ( "Exception while processing shutdown-hook" , rex ) ; } } ) ) ; } } | Null - safe shortcut to Runtime method catching RuntimeExceptions . |
22,905 | public void finish ( ) { if ( startMeasure == null ) { Say . info ( "No invokations are measured" ) ; } else { long total = System . currentTimeMillis ( ) - startMeasure ; double average = 1d * total / counter ; logFinished ( total , average ) ; } } | This method can be called to print the total amount of time taken until that point in time . |
22,906 | public void run ( ExceptionalRunnable runnable ) throws Exception { initStartTotal ( ) ; long startInvokation = System . currentTimeMillis ( ) ; runnable . run ( ) ; invoked ( System . currentTimeMillis ( ) - startInvokation ) ; } | Measure the invokation time of the given ExceptionalRunnable . |
22,907 | public < V > V call ( Callable < V > callable ) throws Exception { initStartTotal ( ) ; long startInvokation = System . currentTimeMillis ( ) ; V result = callable . call ( ) ; invoked ( System . currentTimeMillis ( ) - startInvokation ) ; return result ; } | Measure the invokation time of the given Callable . |
22,908 | public static void sleep ( long millis ) { try { Thread . sleep ( millis ) ; } catch ( InterruptedException ex ) { Thread . currentThread ( ) . interrupt ( ) ; } } | Sleep the given milliseconds swallowing the exception |
22,909 | public < T > T fallback ( T val , T fallback ) { return val != null ? val : fallback ; } | Returns the given value or the fallback if the value is null . |
22,910 | public Iterator < String > getMessages ( ) { Iterator < SmtpMessage > it = server . getReceivedEmail ( ) ; List < String > msgs = new ArrayList < > ( ) ; while ( it . hasNext ( ) ) { SmtpMessage msg = it . next ( ) ; msgs . add ( msg . toString ( ) ) ; } return msgs . iterator ( ) ; } | Returns an iterator of messages that were received by this server . |
22,911 | public static void registerMBean ( String packageName , String type , String name , Object mbean ) { try { String pkg = defaultString ( packageName , mbean . getClass ( ) . getPackage ( ) . getName ( ) ) ; MBeanServer server = ManagementFactory . getPlatformMBeanServer ( ) ; ObjectName on = new ObjectName ( pkg + ":type=" + type + ",name=" + name ) ; if ( server . isRegistered ( on ) ) { Say . debug ( "MBean with type {type} and name {name} for {package} has already been defined, ignoring" , type , name , pkg ) ; } else { server . registerMBean ( mbean , on ) ; } } catch ( Exception ex ) { Say . warn ( "MBean could not be registered" , ex ) ; } } | Will register the given mbean using the given packageName type and name . If no packageName has been given the package of the mbean will be used . |
22,912 | public static Long dehumanize ( String time ) { Long result = getHumantimeCache ( ) . get ( time ) ; if ( result == null ) { if ( isNotBlank ( time ) ) { String input = time . trim ( ) ; if ( NumberUtils . isDigits ( input ) ) { result = NumberUtils . toLong ( input ) ; } else { Matcher matcher = PATTERN_HUMAN_TIME . matcher ( input ) ; if ( matcher . matches ( ) ) { long sum = 0L ; sum += dehumanizeUnit ( matcher . group ( 1 ) , MS_WEEK ) ; sum += dehumanizeUnit ( matcher . group ( 2 ) , MS_DAY ) ; sum += dehumanizeUnit ( matcher . group ( 3 ) , MS_HOUR ) ; sum += dehumanizeUnit ( matcher . group ( 4 ) , MS_MINUTE ) ; sum += dehumanizeUnit ( matcher . group ( 5 ) , MS_SECOND ) ; sum += dehumanizeUnit ( matcher . group ( 6 ) , MS_MILLISECOND ) ; result = sum ; } } getHumantimeCache ( ) . put ( time , result ) ; } } return result ; } | Converts a human readable duration in the format Xd Xh Xm Xs Xms to miliseconds . |
22,913 | public final V computeIfPresent ( K key , BiFunction < ? super K , ? super V , ? extends V > remappingFunction ) { if ( remappingFunction == null ) throw new NullPointerException ( ) ; long hash ; return segment ( segmentIndex ( hash = keyHashCode ( key ) ) ) . computeIfPresent ( this , hash , key , remappingFunction ) ; } | If the value for the specified key is present and non - null attempts to compute a new mapping given the key and its current mapped value . |
22,914 | private long nextSegmentIndex ( long segmentIndex , Segment segment ) { long segmentsTier = this . segmentsTier ; segmentIndex <<= - segmentsTier ; segmentIndex = Long . reverse ( segmentIndex ) ; int numberOfArrayIndexesWithThisSegment = 1 << ( segmentsTier - segment . tier ) ; segmentIndex += numberOfArrayIndexesWithThisSegment ; if ( segmentIndex > segmentsMask ) return - 1 ; segmentIndex = Long . reverse ( segmentIndex ) ; segmentIndex >>>= - segmentsTier ; return segmentIndex ; } | Extension rules make order of iteration of segments a little weird avoiding visiting the same segment twice |
22,915 | public final void replaceAll ( BiFunction < ? super K , ? super V , ? extends V > function ) { Objects . requireNonNull ( function ) ; int mc = this . modCount ; Segment < K , V > segment ; for ( long segmentIndex = 0 ; segmentIndex >= 0 ; segmentIndex = nextSegmentIndex ( segmentIndex , segment ) ) { ( segment = segment ( segmentIndex ) ) . replaceAll ( function ) ; } if ( mc != modCount ) throw new ConcurrentModificationException ( ) ; } | Replaces each entry s value with the result of invoking the given function on that entry until all entries have been processed or the function throws an exception . Exceptions thrown by the function are relayed to the caller . |
22,916 | public final boolean removeIf ( BiPredicate < ? super K , ? super V > filter ) { Objects . requireNonNull ( filter ) ; if ( isEmpty ( ) ) return false ; Segment < K , V > segment ; int mc = this . modCount ; int initialModCount = mc ; for ( long segmentIndex = 0 ; segmentIndex >= 0 ; segmentIndex = nextSegmentIndex ( segmentIndex , segment ) ) { mc = ( segment = segment ( segmentIndex ) ) . removeIf ( this , filter , mc ) ; } if ( mc != modCount ) throw new ConcurrentModificationException ( ) ; return mc != initialModCount ; } | Removes all of the entries of this map that satisfy the given predicate . Errors or runtime exceptions thrown during iteration or by the predicate are relayed to the caller . |
22,917 | private String getJustifiedText ( String text ) { String [ ] words = text . split ( NORMAL_SPACE ) ; for ( String word : words ) { boolean containsNewLine = ( word . contains ( "\n" ) || word . contains ( "\r" ) ) ; if ( fitsInSentence ( word , currentSentence , true ) ) { addWord ( word , containsNewLine ) ; } else { sentences . add ( fillSentenceWithSpaces ( currentSentence ) ) ; currentSentence . clear ( ) ; addWord ( word , containsNewLine ) ; } } if ( currentSentence . size ( ) > 0 ) { sentences . add ( getSentenceFromList ( currentSentence , true ) ) ; } return getSentenceFromList ( sentences , false ) ; } | Retrieves a String with appropriate spaces to justify the text in the TextView . |
22,918 | private void addWord ( String word , boolean containsNewLine ) { currentSentence . add ( word ) ; if ( containsNewLine ) { sentences . add ( getSentenceFromListCheckingNewLines ( currentSentence ) ) ; currentSentence . clear ( ) ; } } | Adds a word into sentence and starts a new one if new line is part of the string . |
22,919 | private String getSentenceFromList ( List < String > strings , boolean addSpaces ) { StringBuilder stringBuilder = new StringBuilder ( ) ; for ( String string : strings ) { stringBuilder . append ( string ) ; if ( addSpaces ) { stringBuilder . append ( NORMAL_SPACE ) ; } } return stringBuilder . toString ( ) ; } | Creates a string using the words in the list and adds spaces between words if required . |
22,920 | private String getSentenceFromListCheckingNewLines ( List < String > strings ) { StringBuilder stringBuilder = new StringBuilder ( ) ; for ( String string : strings ) { stringBuilder . append ( string ) ; if ( ! string . contains ( "\n" ) && ! string . contains ( "\r" ) ) { stringBuilder . append ( NORMAL_SPACE ) ; } } return stringBuilder . toString ( ) ; } | Creates a string using the words in the list and adds spaces between words taking new lines in consideration . |
22,921 | private String fillSentenceWithSpaces ( List < String > sentence ) { sentenceWithSpaces . clear ( ) ; if ( sentence . size ( ) > 1 ) { for ( String word : sentence ) { sentenceWithSpaces . add ( word ) ; sentenceWithSpaces . add ( NORMAL_SPACE ) ; } while ( fitsInSentence ( HAIR_SPACE , sentenceWithSpaces , false ) ) { sentenceWithSpaces . add ( getRandomNumber ( sentenceWithSpaces . size ( ) - 2 ) , HAIR_SPACE ) ; } } return getSentenceFromList ( sentenceWithSpaces , false ) ; } | Fills sentence with appropriate amount of spaces . |
22,922 | private boolean fitsInSentence ( String word , List < String > sentence , boolean addSpaces ) { String stringSentence = getSentenceFromList ( sentence , addSpaces ) ; stringSentence += word ; float sentenceWidth = getPaint ( ) . measureText ( stringSentence ) ; return sentenceWidth < viewWidth ; } | Verifies if word to be added will fit into the sentence |
22,923 | final String writeManifest ( final TreeLogger logger , final Set < String > staticResources , final Map < String , String > fallbackResources , final Set < String > cacheResources ) throws UnableToCompleteException { final ManifestDescriptor descriptor = new ManifestDescriptor ( ) ; final List < String > cachedResources = Stream . concat ( staticResources . stream ( ) , cacheResources . stream ( ) ) . sorted ( ) . distinct ( ) . collect ( Collectors . toList ( ) ) ; descriptor . getCachedResources ( ) . addAll ( cachedResources ) ; descriptor . getFallbackResources ( ) . putAll ( fallbackResources ) ; descriptor . getNetworkResources ( ) . add ( "*" ) ; try { return descriptor . toString ( ) ; } catch ( final Exception e ) { logger . log ( Type . ERROR , "Error generating manifest: " + e , e ) ; throw new UnableToCompleteException ( ) ; } } | Write a manifest file for the given set of artifacts and return it as a string |
22,924 | final Permutation calculatePermutation ( final TreeLogger logger , final LinkerContext context , final ArtifactSet artifacts ) throws UnableToCompleteException { Permutation permutation = null ; for ( final SelectionInformation result : artifacts . find ( SelectionInformation . class ) ) { final String strongName = result . getStrongName ( ) ; if ( null != permutation && ! permutation . getPermutationName ( ) . equals ( strongName ) ) { throw new UnableToCompleteException ( ) ; } if ( null == permutation ) { permutation = new Permutation ( strongName ) ; final Set < String > artifactsForCompilation = getArtifactsForCompilation ( context , artifacts ) ; permutation . getPermutationFiles ( ) . addAll ( artifactsForCompilation ) ; } final List < BindingProperty > list = new ArrayList < > ( ) ; for ( final SelectionProperty property : context . getProperties ( ) ) { if ( ! property . isDerived ( ) ) { final String name = property . getName ( ) ; final String value = result . getPropMap ( ) . get ( name ) ; if ( null != value ) { list . add ( new BindingProperty ( name , value ) ) ; } } } final SelectionDescriptor selection = new SelectionDescriptor ( strongName , list ) ; final List < SelectionDescriptor > selectors = permutation . getSelectors ( ) ; if ( ! selectors . contains ( selection ) ) { selectors . add ( selection ) ; } } if ( null != permutation ) { logger . log ( Type . DEBUG , "Calculated Permutation: " + permutation . getPermutationName ( ) + " Selectors: " + permutation . getSelectors ( ) ) ; } return permutation ; } | Return the permutation for a single link step . |
22,925 | protected boolean handleUnmatchedRequest ( final HttpServletRequest request , final HttpServletResponse response , final String moduleName , final String baseUrl , final List < BindingProperty > computedBindings ) throws ServletException , IOException { return false ; } | Sub - classes can override this method to perform handle the inability to find a matching permutation . In which case the method should return true if the response has been handled . |
22,926 | protected final String loadAndMergeManifests ( final String baseUrl , final String moduleName , final String ... permutationNames ) throws ServletException { final String cacheKey = toCacheKey ( baseUrl , moduleName , permutationNames ) ; if ( isCacheEnabled ( ) ) { final String manifest = _cache . get ( cacheKey ) ; if ( null != manifest ) { return manifest ; } } final ManifestDescriptor descriptor = new ManifestDescriptor ( ) ; for ( final String permutationName : permutationNames ) { final String manifest = loadManifest ( baseUrl , moduleName , permutationName ) ; final ManifestDescriptor other = ManifestDescriptor . parse ( manifest ) ; descriptor . merge ( other ) ; } Collections . sort ( descriptor . getCachedResources ( ) ) ; Collections . sort ( descriptor . getNetworkResources ( ) ) ; final String manifest = descriptor . toString ( ) ; if ( isCacheEnabled ( ) ) { _cache . put ( cacheKey , manifest ) ; } return manifest ; } | Utility method that loads and merges the cache files for multiple permutations . This is useful when it is not possible to determine the exact permutation required for a client on the server . This defers the decision to the client but may result in extra files being downloaded . |
22,927 | protected final void reduceToMatchingDescriptors ( final List < BindingProperty > bindings , final List < SelectionDescriptor > descriptors ) { final Iterator < BindingProperty > iterator = bindings . iterator ( ) ; while ( iterator . hasNext ( ) ) { final BindingProperty property = iterator . next ( ) ; boolean matched = false ; for ( final SelectionDescriptor selection : descriptors ) { final BindingProperty candidate = findMatchingBindingProperty ( selection . getBindingProperties ( ) , property ) ; if ( null != candidate ) { matched = true ; break ; } } if ( matched ) { iterator . remove ( ) ; final Iterator < SelectionDescriptor > selections = descriptors . iterator ( ) ; while ( selections . hasNext ( ) ) { final SelectionDescriptor selection = selections . next ( ) ; if ( null == findSatisfiesBindingProperty ( selection . getBindingProperties ( ) , property ) ) { selections . remove ( ) ; } } } } } | This method will restrict the list of descriptors so that it only contains selections valid for specified bindings . Bindings will be removed from the list as they are matched . Unmatched bindings will remain in the bindings list after the method completes . |
22,928 | private BindingProperty findMatchingBindingProperty ( final List < BindingProperty > bindings , final BindingProperty requirement ) { for ( final BindingProperty candidate : bindings ) { if ( requirement . getName ( ) . equals ( candidate . getName ( ) ) ) { return candidate ; } } return null ; } | Return the binding property in the bindings list that matches specified requirement . |
22,929 | private BindingProperty findSatisfiesBindingProperty ( final List < BindingProperty > bindings , final BindingProperty requirement ) { final BindingProperty property = findMatchingBindingProperty ( bindings , requirement ) ; if ( null != property && property . matches ( requirement . getValue ( ) ) ) { return property ; } return null ; } | Return the binding property in the bindings list that satisfies specified requirement . Satisfies means that the property name matches and the value matches . |
22,930 | protected final String [ ] selectPermutations ( final String baseUrl , final String moduleName , final List < BindingProperty > computedBindings ) throws ServletException { try { final List < SelectionDescriptor > descriptors = new ArrayList < > ( ) ; descriptors . addAll ( getPermutationDescriptors ( baseUrl , moduleName ) ) ; final List < BindingProperty > bindings = new ArrayList < > ( ) ; bindings . addAll ( computedBindings ) ; reduceToMatchingDescriptors ( bindings , descriptors ) ; if ( 0 == bindings . size ( ) ) { if ( 1 == descriptors . size ( ) ) { return new String [ ] { descriptors . get ( 0 ) . getPermutationName ( ) } ; } else { final ArrayList < String > permutations = new ArrayList < > ( ) ; for ( final SelectionDescriptor descriptor : descriptors ) { if ( descriptor . getBindingProperties ( ) . size ( ) == computedBindings . size ( ) ) { permutations . add ( descriptor . getPermutationName ( ) ) ; } else { for ( final BindingProperty property : descriptor . getBindingProperties ( ) ) { if ( null == findMatchingBindingProperty ( computedBindings , property ) ) { if ( canMergeManifestForSelectionProperty ( property . getName ( ) ) ) { permutations . add ( descriptor . getPermutationName ( ) ) ; } } } } } if ( 0 == permutations . size ( ) ) { return null ; } else { return permutations . toArray ( new String [ permutations . size ( ) ] ) ; } } } return null ; } catch ( final Exception e ) { throw new ServletException ( "can not read permutation information" , e ) ; } } | Return an array of permutation names that are selected based on supplied properties . |
22,931 | public static < E > Collector < E , ? , Optional < E > > getOnly ( ) { return Collector . of ( AtomicReference < E > :: new , ( ref , e ) -> { if ( ! ref . compareAndSet ( null , e ) ) { throw new IllegalArgumentException ( "Multiple values" ) ; } } , ( ref1 , ref2 ) -> { if ( ref1 . get ( ) == null ) { return ref2 ; } else if ( ref2 . get ( ) != null ) { throw new IllegalArgumentException ( "Multiple values" ) ; } else { return ref1 ; } } , ref -> Optional . ofNullable ( ref . get ( ) ) , Collector . Characteristics . UNORDERED ) ; } | Can be replaced with MoreCollectors . onlyElement as soon as we can upgrade to the newest Guava version . |
22,932 | public static Object getSingleResultOrNull ( Query query ) { List results = query . getResultList ( ) ; if ( results . isEmpty ( ) ) { return null ; } else if ( results . size ( ) == 1 ) { return results . get ( 0 ) ; } throw new NonUniqueResultException ( ) ; } | Executes the query and ensures that either a single result is returned or null . |
22,933 | public char [ ] hash ( char [ ] password , byte [ ] salt ) { checkNotNull ( password ) ; checkArgument ( password . length != 0 ) ; checkNotNull ( salt ) ; checkArgument ( salt . length != 0 ) ; try { SecretKeyFactory f = SecretKeyFactory . getInstance ( "PBKDF2WithHmacSHA1" ) ; SecretKey key = f . generateSecret ( new PBEKeySpec ( password , salt , ITERATIONS , DESIRED_KEY_LENGTH ) ) ; return Base64 . encodeBase64String ( key . getEncoded ( ) ) . toCharArray ( ) ; } catch ( NoSuchAlgorithmException | InvalidKeySpecException e ) { throw new IllegalStateException ( "Could not hash the password of the user." , e ) ; } } | Hashes the password using pbkdf2 and the given salt . |
22,934 | public boolean check ( char [ ] plain , char [ ] database , byte [ ] salt ) { checkNotNull ( plain ) ; checkArgument ( plain . length != 0 , "Plain must not be empty." ) ; checkNotNull ( database ) ; checkArgument ( database . length != 0 , "Database must not be empty." ) ; checkNotNull ( salt ) ; checkArgument ( salt . length != 0 , "Salt must not be empty." ) ; char [ ] hashedPlain = this . hash ( plain , salt ) ; return Arrays . equals ( hashedPlain , database ) ; } | Checks if the given plain password matches the given password hash |
22,935 | public static double mean ( double [ ] a ) { if ( a . length == 0 ) return Double . NaN ; double sum = sum ( a ) ; return sum / a . length ; } | Returns the average value in the specified array . |
22,936 | public static double stdDev ( double [ ] a ) { if ( a == null || a . length == 0 ) return - 1 ; return Math . sqrt ( varp ( a ) ) ; } | Returns the population standard deviation in the specified array . |
22,937 | public void writeFile ( String aFileName , String aData ) throws IOException { Object lock = retrieveLock ( aFileName ) ; synchronized ( lock ) { IO . writeFile ( aFileName , aData , IO . CHARSET ) ; } } | Write string file data |
22,938 | private Object retrieveLock ( String key ) { Object lock = this . lockMap . get ( key ) ; if ( lock == null ) { lock = key ; this . lockMap . put ( key , lock ) ; } return lock ; } | Retrieve the lock object for a given key |
22,939 | protected void formatMessage ( String aID , Map < Object , Object > aBindValues ) { Presenter presenter = Presenter . getPresenter ( this . getClass ( ) ) ; message = presenter . getText ( aID , aBindValues ) ; } | Format the exception message using the presenter getText method |
22,940 | @ SuppressWarnings ( { "rawtypes" , "unchecked" } ) protected DirContext setupKerberosContext ( Hashtable < String , Object > env ) throws NamingException { LoginContext lc = null ; try { lc = new LoginContext ( getClass ( ) . getName ( ) , new JXCallbackHandler ( ) ) ; lc . login ( ) ; } catch ( LoginException ex ) { throw new NamingException ( "login problem: " + ex ) ; } DirContext ctx = ( DirContext ) Subject . doAs ( lc . getSubject ( ) , new JndiAction ( env ) ) ; if ( ctx == null ) throw new NamingException ( "another problem with GSSAPI" ) ; else return ctx ; } | Initial LDAP for kerberos support |
22,941 | public Principal authenicate ( String uid , char [ ] password ) throws SecurityException { String rootDN = Config . getProperty ( ROOT_DN_PROP ) ; int timeout = Config . getPropertyInteger ( TIMEOUT_SECS_PROP ) . intValue ( ) ; Debugger . println ( LDAP . class , "timeout=" + timeout ) ; String uidAttributeName = Config . getProperty ( UID_ATTRIB_NM_PROP ) ; String groupAttributeName = Config . getProperty ( GROUP_ATTRIB_NM_PROP , "" ) ; String memberOfAttributeName = Config . getProperty ( MEMBEROF_ATTRIB_NM_PROP , "" ) ; return authenicate ( uid , password , rootDN , uidAttributeName , memberOfAttributeName , groupAttributeName , timeout ) ; } | Authenticate user ID and password against the LDAP server |
22,942 | public GenericField [ ] getFields ( ) { Collection < GenericField > values = fieldMap . values ( ) ; if ( values == null || values . isEmpty ( ) ) return null ; GenericField [ ] fieldMirrors = new GenericField [ values . size ( ) ] ; values . toArray ( fieldMirrors ) ; return fieldMirrors ; } | List all fields |
22,943 | public void sortRows ( Comparator < List < String > > comparator ) { if ( data . isEmpty ( ) ) return ; Collections . sort ( data , comparator ) ; } | Sort the rows by comparator |
22,944 | public JavaBeanGeneratorCreator < T > randomizeProperty ( String property ) { if ( property == null || property . length ( ) == 0 ) return this ; this . randomizeProperties . add ( property ) ; return this ; } | Setup property to generate a random value |
22,945 | public JavaBeanGeneratorCreator < T > fixedProperties ( String ... fixedPropertyNames ) { if ( fixedPropertyNames == null || fixedPropertyNames . length == 0 ) { return this ; } HashSet < String > fixSet = new HashSet < > ( Arrays . asList ( fixedPropertyNames ) ) ; Map < Object , Object > map = null ; if ( this . prototype != null ) { map = JavaBean . toMap ( this . prototype ) ; } else map = JavaBean . toMap ( ClassPath . newInstance ( this . creationClass ) ) ; if ( map == null || map . isEmpty ( ) ) return this ; String propertyName = null ; for ( Object propertyNameObject : map . keySet ( ) ) { propertyName = String . valueOf ( propertyNameObject ) ; if ( ! fixSet . contains ( propertyName ) ) { this . randomizeProperty ( propertyName ) ; } } return this ; } | Randomized to records that are not in fixed list |
22,946 | public void setPrimaryKey ( int primaryKey ) throws IllegalArgumentException { if ( primaryKey <= NULL ) { this . primaryKey = Data . NULL ; } else { this . primaryKey = primaryKey ; return ; } } | Set primary key |
22,947 | public T lookup ( String text ) { if ( text == null ) return null ; for ( Entry < String , T > entry : lookupMap . entrySet ( ) ) { if ( Text . matches ( text , entry . getKey ( ) ) ) return lookupMap . get ( entry . getKey ( ) ) ; } return null ; } | Lookup a value of the dictionary |
22,948 | @ SuppressWarnings ( { "unchecked" , "rawtypes" } ) public static final < T > Collection < DataRow > constructDataRows ( Iterator < T > iterator , QuestCriteria questCriteria , DataRowCreator visitor ) { if ( iterator == null ) return null ; ArrayList < DataRow > dataRows = new ArrayList < DataRow > ( BATCH_SIZE ) ; boolean usePaging = false ; boolean savePagination = false ; int pageSize = 0 ; PageCriteria pageCriteria = questCriteria . getPageCriteria ( ) ; Pagination pagination = null ; if ( pageCriteria != null ) { pageSize = pageCriteria . getSize ( ) ; if ( pageSize > 0 ) { usePaging = true ; savePagination = pageCriteria . isSavePagination ( ) ; if ( savePagination ) pagination = Pagination . getPagination ( pageCriteria ) ; } } if ( usePaging ) { T item ; DataRow dataRow ; while ( iterator . hasNext ( ) ) { item = iterator . next ( ) ; JavaBean . acceptVisitor ( item , visitor ) ; dataRow = visitor . getDataRow ( ) ; dataRows . add ( dataRow ) ; if ( savePagination ) pagination . store ( dataRow , pageCriteria ) ; visitor . clear ( ) ; if ( dataRows . size ( ) >= pageSize ) { if ( savePagination && iterator . hasNext ( ) ) { pagination . constructPaging ( iterator , pageCriteria , ( RowObjectCreator ) visitor ) ; } break ; } } } else { Object item ; while ( iterator . hasNext ( ) ) { item = iterator . next ( ) ; JavaBean . acceptVisitor ( item , visitor ) ; dataRows . add ( visitor . getDataRow ( ) ) ; visitor . clear ( ) ; } } dataRows . trimToSize ( ) ; PagingCollection < DataRow > pagingCollection = new PagingCollection < DataRow > ( dataRows , questCriteria . getPageCriteria ( ) ) ; return pagingCollection ; } | Process results with support for paging |
22,949 | public void rebind ( Remote [ ] remotes ) { String rmiUrl = null ; for ( int i = 0 ; i < remotes . length ; i ++ ) { if ( remotes [ i ] instanceof Identifier && ! Text . isNull ( ( ( Identifier ) remotes [ i ] ) . getId ( ) ) ) { rmiUrl = ( ( Identifier ) remotes [ i ] ) . getId ( ) ; } else { rmiUrl = Config . getProperty ( remotes [ i ] . getClass ( ) , "bind.rmi.url" ) ; } rebind ( rmiUrl , remotes [ i ] ) ; } } | Bind all object . Note that the rmiUrl in located in the config . properties |
22,950 | public static Registry getRegistry ( ) throws RemoteException { return LocateRegistry . getRegistry ( Config . getProperty ( RMI . class , "host" ) , Config . getPropertyInteger ( RMI . class , "port" ) . intValue ( ) ) ; } | Create a new local registry on a local port |
22,951 | public Object restore ( String savePoint , Class < ? > objClass ) { String location = whereIs ( savePoint , objClass ) ; Object cacheObject = CacheFarm . getCache ( ) . get ( location ) ; if ( cacheObject != null ) return cacheObject ; cacheObject = IO . deserialize ( new File ( location ) ) ; CacheFarm . getCache ( ) . put ( location , cacheObject ) ; return cacheObject ; } | Retrieve the de - serialized object |
22,952 | public void store ( String savePoint , Object obj ) { if ( savePoint == null ) throw new RequiredException ( "savePoint" ) ; if ( obj == null ) throw new RequiredException ( "obj" ) ; String location = whereIs ( savePoint , obj . getClass ( ) ) ; Debugger . println ( this , "Storing in " + location ) ; IO . serializeToFile ( obj , new File ( location ) ) ; } | Store the serialized object |
22,953 | static int requireValidExponent ( final int exponent ) { if ( exponent < MIN_EXPONENT ) { throw new IllegalArgumentException ( "exponent(" + exponent + ") < " + MIN_EXPONENT ) ; } if ( exponent > MAX_EXPONENT ) { throw new IllegalArgumentException ( "exponent(" + exponent + ") > " + MAX_EXPONENT ) ; } return exponent ; } | Validates given exponent . |
22,954 | public void setLookupTable ( Map < String , Map < K , V > > lookupTable ) { this . lookupTable = new TreeMap < String , Map < K , V > > ( lookupTable ) ; } | The key of the lookup table is a regular expression |
22,955 | @ SuppressWarnings ( "unchecked" ) public static < T > T getProperty ( Object bean , String name ) throws SystemException { try { return ( T ) getNestedProperty ( bean , name ) ; } catch ( Exception e ) { throw new SystemException ( "Get property \"" + name + "\" ERROR:" + e . getMessage ( ) , e ) ; } } | Retrieve the bean property |
22,956 | public static Collection < Object > getCollectionProperties ( Collection < ? > collection , String name ) throws Exception { if ( collection == null ) throw new IllegalArgumentException ( "collection, name" ) ; ArrayList < Object > list = new ArrayList < Object > ( collection . size ( ) ) ; for ( Object bean : collection ) { list . add ( getNestedProperty ( bean , name ) ) ; } return list ; } | Retrieve the list of properties that exists in a given collection |
22,957 | public String getText ( ) { StringText stringText = new StringText ( ) ; stringText . setText ( this . target . getText ( ) ) ; TextDecorator < Textable > textDecorator = null ; for ( Iterator < TextDecorator < Textable > > i = textables . iterator ( ) ; i . hasNext ( ) ; ) { textDecorator = i . next ( ) ; textDecorator . setTarget ( stringText ) ; stringText . setText ( textDecorator . getText ( ) ) ; } return stringText . getText ( ) ; } | Get the target text and execute each text decorator on its results |
22,958 | public static < T > Collection < T > sortByCriteria ( Collection < T > aVOs ) { final List < T > list ; if ( aVOs instanceof List ) list = ( List < T > ) aVOs ; else list = new ArrayList < T > ( aVOs ) ; Collections . sort ( list , new CriteriaComparator ( ) ) ; return list ; } | Sort a list |
22,959 | public void bag ( Date unBaggedObject ) { if ( unBaggedObject == null ) this . time = 0 ; else this . time = unBaggedObject . getTime ( ) ; } | Wraps a given date in a format that can be easily unbagged |
22,960 | public static Method findMethod ( Class < ? > objClass , String methodName , Class < ? > [ ] parameterTypes ) throws NoSuchMethodException { try { return objClass . getDeclaredMethod ( methodName , parameterTypes ) ; } catch ( NoSuchMethodException e ) { if ( Object . class . equals ( objClass ) ) throw e ; try { return findMethod ( objClass . getSuperclass ( ) , methodName , parameterTypes ) ; } catch ( NoSuchMethodException parentException ) { throw e ; } } } | Find the method for a target of its parent |
22,961 | public String getText ( ) { if ( this . target == null ) return null ; try { if ( ( this . template == null || this . template . length ( ) == 0 ) && this . templateName != null ) { try { this . template = Text . loadTemplate ( templateName ) ; } catch ( Exception e ) { throw new SetupException ( "Cannot load template:" + templateName , e ) ; } } Map < Object , Object > faultMap = JavaBean . toMap ( this . target ) ; if ( this . argumentTextDecorator != null ) { this . argumentTextDecorator . setTarget ( this . target . getArgument ( ) ) ; faultMap . put ( this . argumentKeyName , this . argumentTextDecorator . getText ( ) ) ; } return Text . format ( this . template , faultMap ) ; } catch ( FormatException e ) { throw new FormatFaultException ( this . template , e ) ; } } | Converts the target fault into a formatted text . |
22,962 | public static void addCells ( StringBuilder builder , String ... cells ) { if ( builder == null || cells == null || cells . length == 0 ) return ; for ( String cell : cells ) { addCell ( builder , cell ) ; } } | Add formatted CSV cells to a builder |
22,963 | public static String toCSV ( String ... cells ) { if ( cells == null || cells . length == 0 ) return null ; StringBuilder builder = new StringBuilder ( ) ; addCells ( builder , cells ) ; return builder . toString ( ) ; } | Create a CSV line |
22,964 | public String encryptText ( String text ) throws Exception { return toByteText ( this . encrypt ( text . getBytes ( IO . CHARSET ) ) ) ; } | The text to encrypt |
22,965 | public static void main ( String [ ] args ) { try { if ( args . length == 0 ) { System . err . println ( "Usage java " + Cryption . class . getName ( ) + " <text>" ) ; return ; } final String decryptedPassword ; if ( args [ 0 ] . equals ( "-d" ) ) { if ( args . length > 2 ) { StringBuilder p = new StringBuilder ( ) ; for ( int i = 1 ; i < args . length ; i ++ ) { if ( i > 1 ) p . append ( ' ' ) ; p . append ( args [ i ] ) ; } decryptedPassword = p . toString ( ) ; } else { decryptedPassword = args [ 1 ] ; } System . out . println ( getCanonical ( ) . decryptText ( decryptedPassword ) ) ; } else System . out . println ( CRYPTION_PREFIX + getCanonical ( ) . encryptText ( args [ 0 ] ) ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } } | Encrypt a given values |
22,966 | public int compareTo ( Object object ) { if ( ! ( object instanceof User ) ) { return - 1 ; } User user = ( User ) object ; return getLastName ( ) . compareTo ( user . getLastName ( ) ) ; } | Compare user s by last name |
22,967 | public static Object executeMethod ( Object object , MethodCallFact methodCallFact ) throws Exception { if ( object == null ) throw new RequiredException ( "object" ) ; if ( methodCallFact == null ) throw new RequiredException ( "methodCallFact" ) ; return executeMethod ( object , methodCallFact . getMethodName ( ) , methodCallFact . getArguments ( ) ) ; } | Execute the method call on a object |
22,968 | public synchronized void setUp ( ) { if ( initialized ) return ; String className = null ; Map < Object , Object > properties = settings . getProperties ( ) ; String key = null ; Object serviceObject = null ; for ( Map . Entry < Object , Object > entry : properties . entrySet ( ) ) { key = String . valueOf ( entry . getKey ( ) ) ; if ( key . startsWith ( PROP_PREFIX ) ) { try { className = ( String ) entry . getValue ( ) ; serviceObject = ClassPath . newInstance ( className ) ; factoryMap . put ( key , serviceObject ) ; } catch ( Throwable e ) { throw new SetupException ( "CLASS:" + className + " ERROR:" + e . getMessage ( ) , e ) ; } } } initialized = true ; } | Setup the factory beans |
22,969 | private String getValidURL ( String url ) { if ( url != null && url . length ( ) > 0 ) { return url . replaceAll ( "[%]" , "%25" ) . replaceAll ( " " , "%20" ) . replaceAll ( "[<]" , "%3c" ) . replaceAll ( "[>]" , "%3e" ) . replaceAll ( "[\"]" , "%3f" ) . replaceAll ( "[#]" , "%23" ) . replaceAll ( "[{]" , "%7b" ) . replaceAll ( "[}]" , "%7d" ) . replaceAll ( "[|]" , "%7c" ) . replaceAll ( "[\\\\]" , "%5c" ) . replaceAll ( "[\\^]" , "%5e" ) . replaceAll ( "[~]" , "%7e" ) . replaceAll ( "[\\[]" , "%5b" ) . replaceAll ( "[\\]]" , "%5d" ) . replaceAll ( "[']" , "%27" ) . replaceAll ( "[?]" , "%3f" ) ; } return url ; } | Returns valid LDAP URL for the specified URL . |
22,970 | private static void setupSimpleSecurityProperties ( Hashtable < String , Object > env , String userDn , char [ ] pwd ) { env . put ( Context . SECURITY_AUTHENTICATION , "simple" ) ; env . put ( Context . SECURITY_PRINCIPAL , userDn ) ; env . put ( Context . SECURITY_CREDENTIALS , new String ( pwd ) ) ; } | Sets the environment properties needed for a simple username + password authenticated jndi connection . |
22,971 | private Hashtable < ? , ? > setupBasicProperties ( Hashtable < String , Object > env ) throws NamingException { return setupBasicProperties ( env , this . fullUrl ) ; } | Sets basic LDAP connection properties in env . |
22,972 | public static String getProperty ( Class < ? > aClass , String key , ResourceBundle resourceBundle ) { return getSettings ( ) . getProperty ( aClass , key , resourceBundle ) ; } | Get the property |
22,973 | public static String getProperty ( String key , String aDefault ) { return getSettings ( ) . getProperty ( key , aDefault ) ; } | Retrieves a configuration property as a String object . |
22,974 | public static Integer getPropertyInteger ( Class < ? > aClass , String key , int defaultValue ) { return getSettings ( ) . getPropertyInteger ( key , defaultValue ) ; } | Get a configuration property as an Integer object . |
22,975 | public static Character getPropertyCharacter ( Class < ? > aClass , String key , char defaultValue ) { return getSettings ( ) . getPropertyCharacter ( aClass , key , defaultValue ) ; } | Get a configuration property as an c object . |
22,976 | public static char [ ] getPropertyPassword ( Class < ? > aClass , String key , char [ ] defaultPassword ) { return getSettings ( ) . getPropertyPassword ( aClass , key , defaultPassword ) ; } | Retrieve the password |
22,977 | public static < T > void addAll ( Collection < T > pagingResults , Collection < T > paging , BooleanExpression < T > filter ) { if ( pagingResults == null || paging == null ) return ; if ( filter != null ) { for ( T obj : paging ) { if ( filter . apply ( obj ) ) pagingResults . add ( obj ) ; } } else { for ( T obj : paging ) { pagingResults . add ( obj ) ; } } } | Add all collections |
22,978 | public static Object findMapValueByKey ( Object key , Map < ? , ? > map , Object defaultValue ) { if ( key == null || map == null ) return defaultValue ; Object value = map . get ( key ) ; if ( value == null ) return defaultValue ; return value ; } | Find the value with a given key in the map . |
22,979 | public static void addAll ( Collection < Object > list , Object [ ] objects ) { list . addAll ( Arrays . asList ( objects ) ) ; } | Add object to a list |
22,980 | public static void copyToArray ( Collection < Object > collection , Object [ ] objects ) { System . arraycopy ( collection . toArray ( ) , 0 , objects , 0 , objects . length ) ; } | Copy collection objects to a given array |
22,981 | public static < K , V > void addMappableCopiesToMap ( Collection < Mappable < K , V > > aMappables , Map < K , V > aMap ) { if ( aMappables == null || aMap == null ) return ; Mappable < K , V > mappable = null ; Copier previous = null ; for ( Iterator < Mappable < K , V > > i = aMappables . iterator ( ) ; i . hasNext ( ) ; ) { mappable = i . next ( ) ; previous = ( Copier ) aMap . get ( mappable . getKey ( ) ) ; if ( previous != null ) { previous . copy ( ( Copier ) mappable ) ; } else { aMap . put ( ( K ) mappable . getKey ( ) , ( V ) mappable . getValue ( ) ) ; } } } | Add mappable to map |
22,982 | public static < T , K > Collection < T > findMapValuesByKey ( Collection < K > aKeys , Map < K , T > aMap ) { if ( aKeys == null || aMap == null ) return null ; Object key = null ; ArrayList < T > results = new ArrayList < T > ( aMap . size ( ) ) ; for ( Iterator < K > i = aKeys . iterator ( ) ; i . hasNext ( ) ; ) { key = i . next ( ) ; results . add ( aMap . get ( key ) ) ; } results . trimToSize ( ) ; return results ; } | Find values in map that match a given key |
22,983 | public static < T > void addAll ( Collection < T > aFrom , Collection < T > aTo ) { if ( aFrom == null || aTo == null ) return ; T object = null ; for ( Iterator < T > i = aFrom . iterator ( ) ; i . hasNext ( ) ; ) { object = i . next ( ) ; if ( object != null ) { aTo . add ( object ) ; } } } | All object to a given collection |
22,984 | public static Map < String , Criteria > constructCriteriaMap ( Collection < Criteria > aCriterias ) { if ( aCriterias == null ) return null ; Map < String , Criteria > map = new HashMap < String , Criteria > ( aCriterias . size ( ) ) ; Criteria criteria = null ; for ( Iterator < Criteria > i = aCriterias . iterator ( ) ; i . hasNext ( ) ; ) { criteria = ( Criteria ) i . next ( ) ; map . put ( criteria . getId ( ) , criteria ) ; } return map ; } | construct map for collection of criteria object wher the key is Criteria . getId |
22,985 | public static Map < Integer , PrimaryKey > constructPrimaryKeyMap ( Collection < PrimaryKey > aPrimaryKeys ) { if ( aPrimaryKeys == null ) return null ; Map < Integer , PrimaryKey > map = new HashMap < Integer , PrimaryKey > ( aPrimaryKeys . size ( ) ) ; PrimaryKey primaryKey = null ; for ( Iterator < PrimaryKey > i = aPrimaryKeys . iterator ( ) ; i . hasNext ( ) ; ) { primaryKey = ( PrimaryKey ) i . next ( ) ; map . put ( Integer . valueOf ( primaryKey . getPrimaryKey ( ) ) , primaryKey ) ; } return map ; } | construct map for collection of criteria object where the key is Criteria . getId |
22,986 | public static < K > void makeAuditableCopies ( Map < K , Copier > aFormMap , Map < K , Copier > aToMap , Auditable aAuditable ) { if ( aFormMap == null || aToMap == null ) return ; K fromKey = null ; Copier to = null ; Copier from = null ; for ( Map . Entry < K , Copier > entry : aFormMap . entrySet ( ) ) { fromKey = entry . getKey ( ) ; if ( aToMap . keySet ( ) . contains ( fromKey ) ) { to = ( Copier ) aToMap . get ( fromKey ) ; to . copy ( ( Copier ) entry . getValue ( ) ) ; if ( aAuditable != null && to instanceof Auditable ) { AbstractAuditable . copy ( aAuditable , ( Auditable ) to ) ; } } else { from = ( Copier ) aFormMap . get ( fromKey ) ; if ( aAuditable != null && from instanceof Auditable ) { AbstractAuditable . copy ( aAuditable , ( Auditable ) from ) ; } aToMap . put ( fromKey , from ) ; } } } | Copy value form one map to another |
22,987 | public static Object [ ] toArray ( Object obj ) { if ( obj instanceof Object [ ] ) return ( Object [ ] ) obj ; else { Object [ ] returnArray = { obj } ; return returnArray ; } } | Cast into an array of objects or create a array with a single entry |
22,988 | public static < StoredObjectType , ResultSetType > Pagination createPagination ( PageCriteria pageCriteria ) { String id = pageCriteria . getId ( ) ; if ( id == null || id . length ( ) == 0 ) { return null ; } Pagination pagination = ClassPath . newInstance ( paginationClassName , String . class , pageCriteria . getId ( ) ) ; paginationMap . put ( id , pagination ) ; return pagination ; } | Create a pagination instance |
22,989 | public void loadJar ( File fileJar ) throws IOException { JarFile jar = null ; try { jar = new JarFile ( fileJar ) ; Enumeration < JarEntry > enumerations = jar . entries ( ) ; JarEntry entry = null ; byte [ ] classByte = null ; ByteArrayOutputStream byteStream = null ; String fileName = null ; String className = null ; Class < ? > jarClass = null ; while ( enumerations . hasMoreElements ( ) ) { entry = ( JarEntry ) enumerations . nextElement ( ) ; if ( entry . isDirectory ( ) ) continue ; fileName = entry . getName ( ) ; if ( ! fileName . endsWith ( ".class" ) ) continue ; InputStream is = jar . getInputStream ( entry ) ; byteStream = new ByteArrayOutputStream ( ) ; IO . write ( byteStream , is ) ; classByte = byteStream . toByteArray ( ) ; className = formatClassName ( fileName ) ; Debugger . println ( this , "className=" + className ) ; jarClass = defineClass ( className , classByte , 0 , classByte . length , null ) ; classes . put ( className , jarClass ) ; classByte = null ; byteStream = null ; } } finally { if ( jar != null ) { try { jar . close ( ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } } } } | Load all classes in the fileJar |
22,990 | public Class < ? > findClass ( String className ) { Class < ? > result = null ; result = ( Class < ? > ) classes . get ( className ) ; if ( result != null ) { return result ; } try { return findSystemClass ( className ) ; } catch ( Exception e ) { Debugger . printWarn ( e ) ; } try { URL resourceURL = ClassLoader . getSystemResource ( className . replace ( '.' , File . separatorChar ) + ".class" ) ; if ( resourceURL == null ) return null ; String classPath = resourceURL . getFile ( ) ; classPath = classPath . substring ( 1 ) ; return loadClass ( className , new File ( classPath ) ) ; } catch ( Exception e ) { Debugger . printError ( e ) ; return null ; } } | Find the class by it name |
22,991 | private byte [ ] loadClassBytes ( File classFile ) throws IOException { int size = ( int ) classFile . length ( ) ; byte buff [ ] = new byte [ size ] ; FileInputStream fis = new FileInputStream ( classFile ) ; DataInputStream dis = null ; try { dis = new DataInputStream ( fis ) ; dis . readFully ( buff ) ; } finally { if ( dis != null ) dis . close ( ) ; } return buff ; } | Load the class name |
22,992 | public int compareTo ( Day object ) { if ( object == null ) throw new IllegalArgumentException ( "day cannot be null" ) ; Day day = ( Day ) object ; return localDate . compareTo ( day . localDate ) ; } | Compare this day to the specified day . If object is not of type Day a ClassCastException is thrown . |
22,993 | public boolean isAfter ( Day day ) { if ( day == null ) throw new IllegalArgumentException ( "day cannot be null" ) ; return localDate . isAfter ( day . localDate ) ; } | Return true if this day is after the specified day . |
22,994 | public boolean isBefore ( Day day ) { if ( day == null ) throw new IllegalArgumentException ( "day cannot be null" ) ; return localDate . isBefore ( day . localDate ) ; } | Return true if this day is before the specified day . |
22,995 | public boolean isSameDay ( Day compared ) { if ( compared == null ) return false ; return this . getMonth ( ) == compared . getMonth ( ) && this . getDayOfMonth ( ) == compared . getDayOfMonth ( ) && this . getYear ( ) == compared . getYear ( ) ; } | Compare based on month day year |
22,996 | public synchronized String lookup ( String id ) { if ( this . properties == null ) this . setUp ( ) ; String associated = this . properties . getProperty ( id ) ; if ( associated == null ) { associated = this . next ( ) ; register ( id , associated ) ; } return associated ; } | Lookup the location of a key |
22,997 | public void manage ( int workersCount ) { this . workers . clear ( ) ; WorkerThread worker = null ; for ( int i = 0 ; i < workersCount ; i ++ ) { worker = new WorkerThread ( this ) ; this . manage ( worker ) ; } } | Manage a number of default worker threads |
22,998 | String getMatchingJavaEncoding ( String javaEncoding ) { if ( javaEncoding != null && this . javaEncodingsUc . contains ( javaEncoding . toUpperCase ( Locale . ENGLISH ) ) ) { return javaEncoding ; } return this . javaEncodingsUc . get ( 0 ) ; } | If javaEncoding parameter value is one of available java encodings for this charset then returns javaEncoding value as is . Otherwise returns first available java encoding name . |
22,999 | public UserProfile convert ( String text ) { if ( text == null || text . trim ( ) . length ( ) == 0 ) return null ; String [ ] lines = text . split ( "\\\n" ) ; BiConsumer < String , UserProfile > strategy = null ; UserProfile userProfile = null ; String lineUpper = null ; for ( String line : lines ) { int index = line . indexOf ( ";" ) ; if ( index < 0 ) continue ; String term = line . substring ( 0 , index ) ; strategy = strategies . get ( term . toLowerCase ( ) ) ; lineUpper = line . toUpperCase ( ) ; if ( strategy == null ) { if ( lineUpper . startsWith ( "N:" ) ) strategy = strategies . get ( "n" ) ; else if ( lineUpper . startsWith ( "FN:" ) ) strategy = strategies . get ( "fn" ) ; else if ( lineUpper . contains ( "EMAIL;" ) ) strategy = strategies . get ( "email" ) ; else continue ; } if ( userProfile == null ) { userProfile = ClassPath . newInstance ( this . userProfileClass ) ; } strategy . accept ( line , userProfile ) ; } return userProfile ; } | Convert from text from user profile |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.