idx
int64
0
41.2k
question
stringlengths
74
4.21k
target
stringlengths
5
888
29,200
@ GwtIncompatible ( "NavigableMap" ) public static < K , V > NavigableMap < K , V > asMap ( NavigableSet < K > set , Function < ? super K , V > function ) { return new NavigableAsMapView < K , V > ( set , function ) ; }
Returns a view of the navigable set as a map mapping keys from the set according to the specified function .
29,201
public String between ( int leftIndex , int rightIndex ) { String result = this . target4Sub . substring ( reviseL ( leftIndex ) , reviseR ( rightIndex ) ) ; return isResetMode ? result : ( this . target4Sub = result ) ; }
Returns a new string that is a substring of delegate string
29,202
public void encryptFile ( File file , boolean replace ) throws MissingParameterException , IOException { if ( file == null || ! file . exists ( ) ) { throw new MissingParameterException ( "File not specified or file does not exist." ) ; } FileInputStream fis = new FileInputStream ( file ) ; ByteArrayOutputStream baos = new ByteArrayOutputStream ( 1000 ) ; encryptStream ( fis , baos ) ; File tmpEncrypted = File . createTempFile ( "commonsencryption" , RandomStringUtils . randomAlphanumeric ( 10 ) ) ; if ( ! tmpEncrypted . exists ( ) ) { throw new IOException ( "Failed to encrypt file." ) ; } FileOutputStream fos = new FileOutputStream ( tmpEncrypted ) ; IOUtils . write ( baos . toByteArray ( ) , fos ) ; fos . close ( ) ; if ( replace ) { File bkpFile = FileUtils . getFile ( file . getAbsolutePath ( ) + ".bkp" ) ; FileUtils . moveFile ( file , bkpFile ) ; try { FileUtils . moveFile ( tmpEncrypted , FileUtils . getFile ( file . getAbsolutePath ( ) ) ) ; } catch ( IOException e ) { throw new IOException ( "Failed to encrypt file. Existing file saved with \".bkp\": " + e . getMessage ( ) , e ) ; } bkpFile . delete ( ) ; } else { FileUtils . moveFile ( tmpEncrypted , FileUtils . getFile ( file . getAbsolutePath ( ) + ".encrypted" ) ) ; } }
Encrypt a file .
29,203
public void encryptStream ( InputStream clearInputStream , OutputStream encryptedOutputStream ) throws IOException , MissingParameterException { byte [ ] clearBytes = IOUtils . toByteArray ( clearInputStream ) ; byte [ ] cipherBytes = encryptionProvider . encrypt ( clearBytes ) ; encryptedOutputStream . write ( cipherBytes ) ; encryptedOutputStream . flush ( ) ; encryptedOutputStream . close ( ) ; }
Encrypt the contents of an input stream and write the encrypted data to the output stream .
29,204
public ByteArrayInput reset ( int offset , int len ) { if ( len < 0 ) throw new IllegalArgumentException ( "length cannot be negative." ) ; this . offset = offset ; this . limit = offset + len ; return this ; }
Resets the offset and the limit of the internal buffer .
29,205
public void set ( T value ) { if ( logger . isTraceEnabled ( ) ) { logger . trace ( "Name: " + display ( name ) + ": Value: " + display ( value ) , new Throwable ( "Stack trace" ) ) ; } T thisValue = offerInternal ( value ) ; if ( thisValue != null ) { throw new IllegalStateException ( "Value was already set to another value: " + name + " == [" + display ( thisValue ) + "], not: [" + display ( value ) + "]" ) ; } }
Sets the value if possible .
29,206
public Optional < Annotation > getTarget ( HString hString ) { if ( hString == null || hString . document ( ) == null ) { return Optional . empty ( ) ; } return hString . document ( ) . getAnnotation ( target ) ; }
Gets target .
29,207
public static Class < ? > [ ] getClasses ( Class < ? > module ) { HashSet < Class < ? > > result = new HashSet < > ( ) ; ClassLoader classLoader = Modules . class . getClassLoader ( ) ; for ( ClassModel info : Modules . getModuleModel ( module ) . getAllClassDependencies ( ) ) { try { result . add ( classLoader . loadClass ( info . getQualifiedName ( ) ) ) ; } catch ( ClassNotFoundException e ) { Modules . logger . error ( "Error loading class " + info . getQualifiedName ( ) , e ) ; } } return result . toArray ( new Class < ? > [ ] { } ) ; }
Return the names of all classes in the given module .
29,208
void commit ( boolean onePhase ) throws XAException { if ( this . getProgressState ( ) == XAResourceProgressState . COMMITTED ) { return ; } if ( this . hasHeuristicOutcome ( ) ) { throw new XAException ( this . heuristicState ) ; } if ( ! checkTXRequirements ( ) ) { throw new SampleTransactionalException ( "State not transactional " + this ) ; } this . checkRollback ( ) ; if ( this . getProgressState ( ) != XAResourceProgressState . ACTIVE && onePhase ) { throw new XAException ( XAException . XAER_RMFAIL ) ; } else if ( this . getProgressState ( ) != XAResourceProgressState . PREPARED && ! onePhase ) { throw new XAException ( XAException . XAER_RMFAIL ) ; } else if ( this . getProgressState ( ) != XAResourceProgressState . PREPARED && this . getProgressState ( ) != XAResourceProgressState . ACTIVE ) { throw new XAException ( XAException . XAER_RMFAIL ) ; } this . setProgressState ( XAResourceProgressState . COMMITTING ) ; try { this . getManagedConnection ( ) . commit ( onePhase ) ; } catch ( Exception e ) { throwXAException ( XAException . XAER_PROTO , e ) ; } this . setProgressState ( XAResourceProgressState . COMMITTED ) ; }
maintains the state of the transactional branch if a commit is executed .
29,209
public void firePutNotification ( Iterator < RegistryListener < K , V > > listeners , K putKey , V putValue ) { while ( listeners . hasNext ( ) ) { listeners . next ( ) . onPutEntry ( putKey , putValue ) ; } }
Fire notification of a new entry added to the registry .
29,210
public void fireRemoveNotification ( Iterator < RegistryListener < K , V > > listeners , K removeKey , V removeValue ) { while ( listeners . hasNext ( ) ) { listeners . next ( ) . onRemoveEntry ( removeKey , removeValue ) ; } }
Fire notification of an entry that was just removed from the registry .
29,211
public void fireReplaceNotification ( Iterator < RegistryListener < K , V > > listeners , K replaceKey , V oldValue , V newValue ) { while ( listeners . hasNext ( ) ) { listeners . next ( ) . onReplaceEntry ( replaceKey , oldValue , newValue ) ; } }
Fire notification of an entry for which the value was just replaced in the registry .
29,212
public FilterReply decide ( ILoggingEvent event ) { LoggerContext loggerFactory = ( LoggerContext ) LoggerFactory . getILoggerFactory ( ) ; Logger logger = loggerFactory . getLogger ( event . getLoggerName ( ) ) ; if ( event . getLevel ( ) . isGreaterOrEqual ( logger . getEffectiveLevel ( ) ) ) return FilterReply . NEUTRAL ; return FilterReply . DENY ; }
Checks the log level of the event against the effective log level of the Logger referenced in the event .
29,213
public LogRecordWriter writeObject ( Object object ) throws IOException { if ( object == null ) { return this . writeNullObject ( ) ; } ObjectOutputStream out = null ; try { ByteArrayOutputStream byteOutput = new ByteArrayOutputStream ( ) ; out = new ObjectOutputStream ( byteOutput ) ; out . writeObject ( object ) ; out . flush ( ) ; byte [ ] serBytes = byteOutput . toByteArray ( ) ; io . writeInt ( serBytes . length ) ; io . write ( serBytes ) ; } finally { if ( out != null ) { IOUtils . closeQuietly ( out ) ; } } return this ; }
write the object s class name to check the consistency if the restroe fails .
29,214
public Reader requestGet ( ) throws IOException { connection . setRequestMethod ( "GET" ) ; connection . setDoOutput ( false ) ; return new Reader ( connection . getInputStream ( ) ) ; }
Do a HTTP GET request forward specified URL . Creates and return Reader object .
29,215
public Reader requestPost ( String data ) throws IOException { connection . setRequestMethod ( "POST" ) ; connection . setDoOutput ( true ) ; Writer writer = new Writer ( connection . getOutputStream ( ) ) ; writer . write ( data ) ; writer . close ( ) ; return new Reader ( connection . getInputStream ( ) ) ; }
Do a HTTP POST request forward specified URL and data string . Creates and return Reader object .
29,216
public void addOutputPlugin ( OutputPluginModel < ? , ? > outputPlugin ) throws IllegalIDException { if ( ! futureHashMap . containsKey ( outputPlugin . getID ( ) ) ) { outputPlugins . add ( outputPlugin ) ; futureHashMap . put ( outputPlugin . getID ( ) , submit ( outputPlugin ) ) ; } else { if ( futureHashMap . get ( outputPlugin . getID ( ) ) . isDone ( ) ) { futureHashMap . remove ( outputPlugin . getID ( ) ) ; futureHashMap . put ( outputPlugin . getID ( ) , submit ( outputPlugin ) ) ; } } }
adds outputPlugin to outputPluginList starts a new thread for the outputPlugin and stores the future object in a HashMap
29,217
public void removeOutputPlugin ( OutputPluginModel outputPlugin ) { Future future = futureHashMap . remove ( outputPlugin . getID ( ) ) ; if ( future != null ) { future . cancel ( true ) ; } outputPlugins . remove ( outputPlugin ) ; }
removes the OutputPlugin and stops the thread
29,218
public List < Identification > getAssociatedOutputExtension ( OutputPluginModel < ? , ? > outputPlugin ) { IdentifiableSet < OutputExtensionModel < ? , ? > > outputExtensions = this . outputExtensions . get ( outputPlugin . getID ( ) ) ; IdentificationManagerM identificationManager = IdentificationManager . getInstance ( ) ; return filterType ( outputExtensions , outputPlugin ) . stream ( ) . map ( identificationManager :: getIdentification ) . filter ( Optional :: isPresent ) . map ( Optional :: get ) . collect ( Collectors . toList ( ) ) ; }
returns all the associated OutputExtensions
29,219
public < T , X > List < CompletableFuture < X > > generateAllOutputExtensions ( OutputPluginModel < T , X > outputPlugin , T t , EventModel event ) { IdentifiableSet < OutputExtensionModel < ? , ? > > extensions = outputExtensions . get ( outputPlugin . getID ( ) ) ; if ( extensions == null ) return new ArrayList < > ( ) ; return filterType ( extensions , outputPlugin ) . stream ( ) . map ( extension -> { try { return ( OutputExtensionModel < X , T > ) extension ; } catch ( ClassCastException e ) { return null ; } } ) . filter ( Objects :: nonNull ) . filter ( outputExtension -> outputExtension . canRun ( event ) ) . map ( extension -> submit ( ( ) -> extension . generate ( event , t ) ) ) . collect ( Collectors . toList ( ) ) ; }
Starts every associated OutputExtension
29,220
static public VersionString getNextVersion ( VersionString version ) { int length = version . value . length ; int [ ] nextVersion = Arrays . copyOf ( version . value , length ) ; nextVersion [ length - 1 ] ++ ; return new VersionString ( nextVersion ) ; }
This function returns the next version number in the series for the specified version . If the specified version is 1 the next version would be 2 . If the specified version is 2 . 5 . 7 the next version would be 2 . 5 . 8 .
29,221
static public VersionString getNewVersion ( VersionString version , int depth ) { if ( depth < 1 || depth > version . value . length + 1 ) throw new NumberFormatException ( "The depth cannot be less than zero or greater than the depth of the current version number: " + depth ) ; int [ ] newVersion = Arrays . copyOf ( version . value , depth ) ; newVersion [ depth - 1 ] ++ ; return new VersionString ( newVersion ) ; }
This method returns a new version number in the series by incrementing the version at the specified depth and truncating the rest of the version numbers . If the current version is 2 . 5 . 7 and the depth is 2 the next version would be 2 . 6 . If the current version is 1 . 22 and the depth is 3 the next version would be 1 . 22 . 1 .
29,222
private void analyzeModels ( ) { try { do { ExecutorService pool = Executors . newFixedThreadPool ( context . getSettings ( ) . getNbThread ( ) ) ; while ( context . workToDo ( ) ) { pool . execute ( new ModelExecutor ( context ) ) ; } pool . shutdown ( ) ; while ( ! pool . isTerminated ( ) ) { pool . awaitTermination ( TIMEOUT , TimeUnit . MILLISECONDS ) ; } } while ( context . workToDo ( ) ) ; } catch ( InterruptedException e ) { throw new RuntimeException ( "Interrupted " + e . getMessage ( ) ) ; } }
Fill ClassModel type and content parts by java introspection of classes
29,223
private void resolveTypeTemplates ( ) { Collections . sort ( context . getClassesAlreadyDone ( ) , new Comparator < Java4CppType > ( ) { public int compare ( Java4CppType t1 , Java4CppType t2 ) { Class < ? > o1 = t1 . getRawClass ( ) ; Class < ? > o2 = t2 . getRawClass ( ) ; if ( o1 . isArray ( ) && o2 . isArray ( ) ) { int idx1 = o1 . getName ( ) . lastIndexOf ( '[' ) ; int idx2 = o2 . getName ( ) . lastIndexOf ( '[' ) ; if ( idx1 == idx2 ) { return o1 . getName ( ) . compareTo ( o2 . getName ( ) ) ; } return idx1 < idx2 ? - 1 : 1 ; } else if ( o1 . isArray ( ) && ! o2 . isArray ( ) ) { return 1 ; } else if ( ! o1 . isArray ( ) && o2 . isArray ( ) ) { return - 1 ; } return o1 . getName ( ) . compareTo ( o2 . getName ( ) ) ; } } ) ; for ( Java4CppType type : context . getClassesAlreadyDone ( ) ) { context . executeTypeTemplate ( type ) ; } }
Execute type freemarker templates of ClassModel
29,224
private void generateSources ( ) { try { ExecutorService pool = Executors . newFixedThreadPool ( context . getSettings ( ) . getNbThread ( ) ) ; for ( Java4CppType type : context . getClassesAlreadyDone ( ) ) { Class < ? > clazz = type . getRawClass ( ) ; if ( isValid ( clazz ) ) { pool . execute ( new SourceExecutor ( context , type ) ) ; } } pool . shutdown ( ) ; while ( ! pool . isTerminated ( ) ) { pool . awaitTermination ( TIMEOUT , TimeUnit . MILLISECONDS ) ; } } catch ( InterruptedException e ) { throw new RuntimeException ( "Interrupted " + e . getMessage ( ) ) ; } }
Generate proxies source code files
29,225
private void finalization ( ) { Map < String , Object > dataModel = newHashMap ( ) ; dataModel . put ( "cppFormatter" , new SourceFormatter ( ) ) ; Set < ClassModel > dependencies = newHashSet ( ) ; for ( Java4CppType type : context . getClassesAlreadyDone ( ) ) { Class < ? > clazz = type . getRawClass ( ) ; if ( isValid ( clazz ) ) { dependencies . add ( context . getClassModel ( clazz ) ) ; } } dataModel . put ( "classes" , dependencies ) ; dataModel . put ( "symbols" , context . getFileManager ( ) . getSymbols ( ) . getSymbols ( ) ) ; context . getTemplateManager ( ) . processGlobalTemplates ( dataModel ) ; context . getTemplateManager ( ) . copyFiles ( ) ; }
Execute global templates and copy runtime files
29,226
public static void logMeasures ( HLAMeasure [ ] measures , final Logger log ) { log . info ( "\nAvailable measures are:" ) ; log . info ( "======================" ) ; for ( HLAMeasure currMeasure : measures ) { log . info ( " - " + currMeasure . getSonarName ( ) ) ; } LogHelper . moo ( log ) ; }
Log the given array of measure objects in some readable way .
29,227
public static void logCSV ( String csvData , final Logger log ) { log . info ( "" ) ; log . info ( "**** Here we go with CSV:" ) ; log . info ( "" ) ; log . info ( csvData ) ; log . info ( "" ) ; log . info ( "**** End of CSV data. Have a nice day!" ) ; log . info ( "" ) ; LogHelper . moo ( log ) ; }
Log CSV data with some additional information .
29,228
public void setLogger ( Logger logger ) { System . out . println ( "LOGGER set" ) ; this . logger = logger ; System . out . println ( "appender added" ) ; this . logger . addAppender ( this ) ; }
Invoked by injection .
29,229
public void handleThrowable ( Throwable e , Object target ) { try { ExceptionCallback exceptionCallback = ( ExceptionCallback ) target ; if ( e instanceof Exception ) { exceptionCallback . exceptionThrown ( ( Exception ) e ) ; } else { exceptionCallback . exceptionThrown ( new RuntimeException ( e ) ) ; } } catch ( IllegalArgumentException | ClassCastException e1 ) { log . fatal ( "unable to provide callback for: " + target . toString ( ) , e ) ; } }
tries everything to log the exception
29,230
private boolean cleanUp ( Reference < ? > reference ) { Method finalizeReferentMethod = getFinalizeReferentMethod ( ) ; if ( finalizeReferentMethod == null ) { return false ; } do { reference . clear ( ) ; if ( reference == frqReference ) { return false ; } try { finalizeReferentMethod . invoke ( reference ) ; } catch ( Throwable t ) { logger . log ( Level . SEVERE , "Error cleaning up after reference." , t ) ; } } while ( ( reference = queue . poll ( ) ) != null ) ; return true ; }
Cleans up a single reference . Catches and logs all throwables .
29,231
public static Pipe newPipe ( byte [ ] data , int offset , int len ) { final ByteArrayInput byteArrayInput = new ByteArrayInput ( data , offset , len , false ) ; return new Pipe ( ) { protected Input begin ( Pipe . Schema < ? > pipeSchema ) throws IOException { return byteArrayInput ; } protected void end ( Pipe . Schema < ? > pipeSchema , Input input , boolean cleanupOnly ) throws IOException { if ( cleanupOnly ) return ; assert input == byteArrayInput ; } } ; }
Creates a protobuf pipe from a byte array .
29,232
public static void ensureNotEmptyContent ( String name , boolean trim , String [ ] value ) { ensureNotEmpty ( name , value ) ; for ( int i = 0 ; i < value . length ; i ++ ) { ensureNotEmpty ( value [ i ] + "[" + i + "]" , value [ i ] ) ; if ( trim ) { ensureNotEmpty ( value [ i ] + "[" + i + "]" , value [ i ] . trim ( ) ) ; } } }
Ensures that the string array instance is not null and that it has entries that are not null or empty .
29,233
public void sendAttributeChangeNotification ( String msg , String attributeName , String attributeType , Object oldValue , Object newValue ) { LOGGER . debug ( "Sending Notification " + ( attrNotificationSeq + 1 ) + ":" + msg + ":" + attributeName + ":" + attributeType + ":" + oldValue . toString ( ) + ":" + newValue . toString ( ) ) ; Notification n = new AttributeChangeNotification ( this , attrNotificationSeq ++ , System . currentTimeMillis ( ) , msg , attributeName , attributeType , oldValue , newValue ) ; sendNotification ( n ) ; LOGGER . debug ( "Notification Sent " + attrNotificationSeq ) ; }
Sends a notification to registered clients about the change in value of an attribute .
29,234
private static < T extends Number > String toBitMask ( T bitmask , int length ) { StringBuilder buffer = new StringBuilder ( ) ; long bit = 1 ; for ( int i = 0 ; i < length ; ++ i ) { if ( i != 0 && i % 8 == 0 ) { buffer . append ( " " ) ; } else if ( i != 0 && i % 4 == 0 ) { buffer . append ( ":" ) ; } if ( ( bit & bitmask . longValue ( ) ) == bit ) { buffer . append ( "1" ) ; } else { buffer . append ( "0" ) ; } bit = bit << 1 ; } return buffer . reverse ( ) . toString ( ) ; }
Parametric version of the method which dumps any number as bitmask .
29,235
public static final void log ( Class < ? > clazz , String msg ) { if ( DEBUG ) { System . out . println ( "[" + sSdf . format ( new Date ( ) ) + "]" + "-" + "[" + clazz . getSimpleName ( ) + "] " + msg ) ; } }
To output the standard log message to the standard out
29,236
public static final void loge ( Class < ? > clazz , String msg , Exception ... e ) { if ( DEBUG ) { String exceptionStr = "" ; if ( e != null && e . length == 1 ) { StringWriter sw = new StringWriter ( ) ; PrintWriter pw = new PrintWriter ( sw ) ; e [ 0 ] . printStackTrace ( pw ) ; pw . flush ( ) ; exceptionStr = "exception = " + sw . toString ( ) ; } System . err . println ( "[" + sSdf . format ( new Date ( ) ) + "]" + "-" + "[" + clazz . getSimpleName ( ) + "] " + msg + " " + exceptionStr ) ; } }
To output the error log message to the error out
29,237
protected String getMethod ( HttpServletRequest request ) { String uri = request . getRequestURI ( ) ; String q = uri . substring ( ( request . getContextPath ( ) + request . getServletPath ( ) ) . length ( ) + 1 ) ; int i = q . indexOf ( "." ) ; String method = null ; if ( i > 0 ) { method = q . substring ( i + 1 ) ; } return method ; }
Get method from request .
29,238
public static WebOperation getOperationByName ( final String name ) throws WebOperationNotFoundException { if ( ! cache . containsKey ( name ) ) { WebOperation wo = null ; Map < String , Object > cls = Objects . find ( ( List < Map < String , Object > > ) Options . getStorage ( ) . getSystem ( List . class , "webOperations" , new ArrayList ( ) ) , new Closure < Map < String , Object > , Boolean > ( ) { public Boolean call ( Map < String , Object > input ) { return name . equals ( Objects . get ( input , "name" ) ) ; } } ) ; if ( ! Objects . isNullOrEmpty ( cls ) ) { try { wo = ( WebOperation ) Class . forName ( Objects . get ( String . class , cls , "class" ) ) . newInstance ( ) ; wo . setConfig ( Objects . get ( cls , "config" , Objects . newHashMap ( String . class , Object . class ) ) ) ; } catch ( Exception e ) { throw new WebOperationNotFoundException ( "Cannot initialize WebOperation (" + cls + "): " + e . getMessage ( ) , e ) ; } } if ( wo == null ) throw new WebOperationNotFoundException ( "WebOperation " + name + " not found" ) ; cache . put ( name , wo ) ; } return cache . get ( name ) ; }
Get WebOperation by name
29,239
protected WebOperation getOperation ( HttpServletRequest request ) throws WebOperationNotFoundException { String uri = request . getRequestURI ( ) ; String q = uri . substring ( ( request . getContextPath ( ) + request . getServletPath ( ) ) . length ( ) + 1 ) ; int i = q . indexOf ( "." ) ; String name = q ; if ( i > 0 ) { name = q . substring ( 0 , i ) ; } return getOperationByName ( name ) ; }
Get operation from request
29,240
public OverlayIcon withOverlay ( ImageIcon ... overlays ) { if ( overlays != null ) { for ( ImageIcon overlay : overlays ) { this . overlays . add ( overlay ) ; } } return this ; }
Adds an overlay icon to the base icon .
29,241
public static String getClassName ( String resourceName ) { if ( ! resourceName . endsWith ( ".class" ) ) { throw new IllegalArgumentException ( "resourceName does not refer to a class" ) ; } int len = resourceName . length ( ) ; return resourceName . substring ( 0 , len - 6 ) . replace ( '/' , '.' ) ; }
Gets the class name associated with a given resource name . If the full path to the resource is given the fully qualified name is returned .
29,242
public static void getClassDigest ( Class < ? > cl , MessageDigest digest ) { DigestOutputStream out = new DigestOutputStream ( NullOutputStream . getInstance ( ) , digest ) ; try { writeClassToStream ( cl , out ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; throw new UnexpectedException ( e ) ; } }
Computes a digest from a class bytecode .
29,243
private static byte [ ] persist ( String description , Directory rootDir , Blob icon ) { ByteArrayOutputStream arrayOutputStream = new ByteArrayOutputStream ( ) ; DataOutputStream dataOutputStream = new DataOutputStream ( arrayOutputStream ) ; try { dataOutputStream . writeByte ( CURRENT_BINARY_VERSION ) ; dataOutputStream . writeUTF ( rootDir . id ( ) ) ; dataOutputStream . writeUTF ( description ) ; dataOutputStream . writeUTF ( icon != null ? icon . id ( ) : "" ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; } return arrayOutputStream . toByteArray ( ) ; }
Serialisiert den Blueprint
29,244
protected static HashMap getWthData ( HashMap data ) { if ( data . containsKey ( "weather" ) ) { return getObjectOr ( data , "weather" , new HashMap ( ) ) ; } else { return data ; } }
Get weather station data set from data holder .
29,245
protected String getAddress ( HttpServletRequest request ) { String path = request . getScheme ( ) + "://" + request . getServerName ( ) ; if ( request . getScheme ( ) . equals ( "http" ) && request . getServerPort ( ) != 80 ) path += ":" + request . getServerPort ( ) ; if ( request . getScheme ( ) . equals ( "https" ) && request . getServerPort ( ) != 443 ) path += ":" + request . getServerPort ( ) ; path += request . getRequestURI ( ) ; return path ; }
Get current service address
29,246
protected String getAction ( String service , SOAPMessage msg , HttpServletRequest request ) { if ( ! request . getMethod ( ) . equalsIgnoreCase ( "post" ) ) { return null ; } String a = null ; Element action = null ; try { action = XMLFormat . getFirstChildElement ( msg . getSOAPBody ( ) , null , null ) ; } catch ( SOAPException e ) { throw S1SystemError . wrap ( e ) ; } if ( action != null ) a = action . getLocalName ( ) ; return a ; }
Get SOAPAction try to get it from first body child name
29,247
public static String formatException ( Throwable exception ) { StringBuilder buffer = new StringBuilder ( ) ; formatException ( exception , buffer ) ; return buffer . toString ( ) ; }
Formatea una excepcion y las excepciones padre .
29,248
public static StringBuilder formatException ( Throwable exception , StringBuilder buffer ) { StringBuilder ret ; if ( exception == null ) { ret = buffer ; } else { buffer . append ( exception . getClass ( ) . getName ( ) ) ; buffer . append ( ": \"" ) ; buffer . append ( exception . getMessage ( ) ) ; buffer . append ( "\" \n" ) ; StackTraceElement array [ ] = exception . getStackTrace ( ) ; for ( StackTraceElement element : array ) { buffer . append ( "\tat " ) ; printStackTraceElement ( element , buffer ) ; buffer . append ( '\n' ) ; } if ( exception . getCause ( ) != null ) { buffer . append ( "Parent exception: " ) ; ret = formatException ( exception . getCause ( ) , buffer ) ; } else { ret = buffer ; } } return ret ; }
formatela la excepcion .
29,249
public static void printStackTraceElement ( StackTraceElement element , StringBuilder buffer ) { buffer . append ( element . getClassName ( ) ) ; buffer . append ( '.' ) ; buffer . append ( element . getMethodName ( ) ) ; buffer . append ( '(' ) ; buffer . append ( element . getFileName ( ) ) ; if ( element . getLineNumber ( ) > 0 ) { buffer . append ( ':' ) ; buffer . append ( element . getLineNumber ( ) ) ; } buffer . append ( ')' ) ; }
IMprime un stacktrace element .
29,250
public static String toHex ( byte b ) { final char [ ] string = { hexDigits [ ( b >> 4 ) & 0x0f ] , hexDigits [ b & 0x0f ] } ; return new String ( string ) ; }
Converts the specified byte value to a two digit hex string .
29,251
public static String toHex ( byte [ ] bytes ) { final char [ ] string = new char [ 2 * bytes . length ] ; int i = 0 ; for ( byte b : bytes ) { string [ i ++ ] = hexDigits [ ( b >> 4 ) & 0x0f ] ; string [ i ++ ] = hexDigits [ b & 0x0f ] ; } return new String ( string ) ; }
Converts the specified array of bytes to a hex string .
29,252
public static byte [ ] hexToByteArray ( String hex ) { int length = hex . length ( ) ; byte [ ] result = new byte [ ( length / 2 ) + ( length % 2 ) ] ; for ( int i = length , j = result . length - 1 ; i > 0 ; i -= 2 , j -- ) { result [ j ] = hexToByte ( hex . charAt ( i - 1 ) ) ; if ( i > 1 ) { result [ j ] |= ( hexToByte ( hex . charAt ( i - 2 ) ) << 4 ) ; } } return result ; }
Converts a number expressed in hexadecimal to a byte array .
29,253
public static byte hexToByte ( char hex ) { if ( '0' <= hex && hex <= '9' ) { return ( byte ) ( hex - '0' ) ; } else if ( 'A' <= hex && hex <= 'F' ) { return ( byte ) ( 10 + hex - 'A' ) ; } else if ( 'a' <= hex && hex <= 'f' ) { return ( byte ) ( 10 + hex - 'a' ) ; } else { throw new IllegalArgumentException ( String . format ( "'%c' is not a hexadecimal digit." , hex ) ) ; } }
Converts a hexadecimal digit to a byte .
29,254
public static < K extends Enum < K > & Keyed < String > > EnumLookup < K , String > of ( final Class < K > enumClass , final boolean caseSensitive ) { return new EnumLookup < K , String > ( enumClass , - 1 , caseSensitive ) ; }
Creates an EnumLookup instance for the enumerate of the given class
29,255
public static < K extends Enum < K > & MultiKeyed > EnumLookup < K , String > of ( final Class < K > enumClass , final int idx , final boolean caseSensitive ) { return new EnumLookup < K , String > ( enumClass , idx , caseSensitive ) ; }
Creates an EnumLookup instance for the multi - keyed enumerate of the given class
29,256
public K find ( final V id ) { final V keyValue = keyForValue ( id ) ; if ( inverse . containsKey ( keyValue ) ) { return inverse . get ( keyValue ) ; } if ( log . isDebugEnabled ( ) ) { log . debug ( "Enum with value " + id + " not found" ) ; } return null ; }
Finds the given ID and returns the corresponding enumerate value
29,257
public K find ( final V id , final K defaultValue ) { return firstNonNull ( find ( id ) , defaultValue ) ; }
Finds the given ID and returns the corresponding enumerate or defaultValue if null
29,258
public static String [ ] split ( String str , String separator , boolean trim ) { if ( str == null ) { return null ; } char sep = separator . charAt ( 0 ) ; ArrayList < String > strList = new ArrayList < String > ( ) ; StringBuilder split = new StringBuilder ( ) ; int index = 0 ; while ( ( index = StringUtils . findNext ( str , sep , StringUtils . ESCAPE_CHAR , index , split ) ) >= 0 ) { ++ index ; strList . add ( split . toString ( ) ) ; split . setLength ( 0 ) ; } strList . add ( split . toString ( ) ) ; if ( trim ) { int last = strList . size ( ) ; while ( -- last >= 0 && "" . equals ( strList . get ( last ) ) ) { strList . remove ( last ) ; } } return strList . toArray ( new String [ strList . size ( ) ] ) ; }
splits this string around matches of the given separator .
29,259
public static String createInternalJobID ( ) throws NoSuchAlgorithmException { MessageDigest md = MessageDigest . getInstance ( "MD5" ) ; byte [ ] data = UUID . randomUUID ( ) . toString ( ) . getBytes ( ) ; md . update ( data ) ; byte [ ] digest = md . digest ( ) ; StringBuilder sb = new StringBuilder ( ) ; for ( int i = 0 ; i < digest . length ; i ++ ) { sb . append ( Integer . toHexString ( 0xff & digest [ i ] ) ) ; } return JOB_PREFIX + sb . toString ( ) . toUpperCase ( ) ; }
create internal job ID
29,260
public static int getMatchNo ( String [ ] strings , String s ) { for ( int i = 0 ; i < strings . length ; i ++ ) { if ( s . equals ( strings [ i ] ) ) { return i ; } } return - 1 ; }
get match string number
29,261
public static int [ ] getMatchNos ( String [ ] strings , String [ ] s ) { int [ ] nos = new int [ s . length ] ; for ( int i = 0 , j = 0 ; i < strings . length ; i ++ ) { for ( int k = 0 ; k < s . length ; k ++ ) { if ( s [ k ] . equals ( strings [ i ] ) ) { nos [ j ] = i ; j ++ ; } } } return nos ; }
get match string number s
29,262
public static String getXmx ( String option ) { String [ ] args = option . split ( " " ) ; for ( String s : args ) { if ( s . startsWith ( "-Xmx" ) ) { return s ; } } return null ; }
get Xmx option
29,263
private static void getRichText ( Node node , StringBuilder builder ) { Node n = node . getFirstChild ( ) ; while ( n != null ) { if ( n . getNodeType ( ) == Node . TEXT_NODE ) { builder . append ( n . getNodeValue ( ) ) ; } else if ( n . getNodeType ( ) == Node . ELEMENT_NODE ) { builder . append ( '<' ) ; builder . append ( n . getNodeName ( ) ) ; builder . append ( '>' ) ; getRichText ( n , builder ) ; builder . append ( '<' ) ; builder . append ( '/' ) ; builder . append ( n . getNodeName ( ) ) ; builder . append ( '>' ) ; } n = n . getNextSibling ( ) ; } }
Extract rich text content from given node . It is not expected that rich text HTML formatting tags to have attributes and this builder just ignore them . Also ignores all other node types beside text and elements .
29,264
private void addSymbolsFromSettings ( ) { if ( ! Utils . isNullOrEmpty ( context . getSettings ( ) . getImportsFile ( ) ) ) { Symbols imported = new Symbols ( ) ; for ( String name : context . getSettings ( ) . getImportsFile ( ) . split ( ";" ) ) { try { InputStream is = Utils . getFileOrResource ( name ) ; Symbols symbol = JAXB . unmarshal ( is , Symbols . class ) ; is . close ( ) ; imported . getSymbols ( ) . addAll ( symbol . getSymbols ( ) ) ; } catch ( IOException e ) { throw new RuntimeException ( "Failed to read imports: " + e . getMessage ( ) ) ; } } if ( Utils . isNullOrEmpty ( context . getSettings ( ) . getImportFilter ( ) ) ) { imports . getSymbols ( ) . addAll ( imported . getSymbols ( ) ) ; } else { Pattern regex = Pattern . compile ( context . getSettings ( ) . getImportFilter ( ) ) ; for ( String symbol : imported . getSymbols ( ) ) { if ( regex . matcher ( symbol ) . matches ( ) ) { imports . getSymbols ( ) . add ( symbol ) ; } } } } }
Reads the imports files to construct the list of import symbols to use .
29,265
public void stop ( ) { if ( ! Utils . isNullOrEmpty ( context . getSettings ( ) . getExportFile ( ) ) ) { if ( Utils . isNullOrEmpty ( context . getSettings ( ) . getExportFilter ( ) ) ) { JAXB . marshal ( export , new File ( context . getSettings ( ) . getExportFile ( ) ) ) ; } else { Symbols exportFiltered = new Symbols ( ) ; Pattern regexp = Pattern . compile ( context . getSettings ( ) . getExportFilter ( ) ) ; for ( String symbol : export . getSymbols ( ) ) { if ( regexp . matcher ( symbol ) . matches ( ) ) { exportFiltered . getSymbols ( ) . add ( symbol ) ; } } JAXB . marshal ( exportFiltered , new File ( context . getSettings ( ) . getExportFile ( ) ) ) ; } } if ( context . getSettings ( ) . isClean ( ) ) { for ( File file : oldFiles ) { logInfo ( "deleting " + file . getName ( ) ) ; if ( ! file . delete ( ) ) { logInfo ( "failed" ) ; } ++ deleted ; } } try { final BufferedOutputStream out = new BufferedOutputStream ( new FileOutputStream ( java4cppHash ) ) ; newHashes . store ( out , "Generated by java4cpp" ) ; out . close ( ) ; } catch ( IOException e ) { throw new RuntimeException ( "Failed to generate java4cpp.hash " + e . getMessage ( ) ) ; } logInfo ( String . format ( "generated: %d, imported: %d, skipped: %d, deleted: %d" , generated , imported , skipped , deleted ) ) ; }
Called after all the proxies are generated . Delete all the remaining files in the target directory .
29,266
public Bus < M > addObserver ( BusObserver < M > observer ) { if ( observer != null ) { logger . info ( "adding observer of class '{}'" , observer . getClass ( ) . getSimpleName ( ) ) ; observers . add ( observer ) ; } return this ; }
Adds an observer to this message bus .
29,267
public boolean removeObserver ( BusObserver < M > observer ) { logger . trace ( "removing observer {}" , observer . getClass ( ) . getSimpleName ( ) ) ; return observers . remove ( observer ) ; }
Removes the given object from the set of registered observers .
29,268
public Bus < M > broadcast ( M message , Object ... args ) { return broadcast ( null , message , args ) ; }
Broadcasts an event on the bus to all registered observers .
29,269
public static boolean hasSubPrefix ( List < String > tokens ) { return tokens . stream ( ) . anyMatch ( token -> token . toLowerCase ( ) . startsWith ( "sub" ) ) ; }
A case insensitive test of whether any of the supplied tokens begins with sub .
29,270
public static boolean containsSub ( List < String > tokens ) { return tokens . stream ( ) . anyMatch ( token -> isSub ( token ) ) ; }
A case insensitive test of whether any of the supplied tokens is sub .
29,271
public static List < String > process ( List < String > tokens , Policy policy ) { if ( policy == Policy . CONCATENATE ) { return concatenate ( tokens ) ; } else { return expand ( tokens ) ; } }
Process a list of tokens to apply the stated policy to the tokens .
29,272
public static Context createContext ( Collection < PropertyMapping < ? > > mappings ) { IdentityHashMap < ContextProperty < ? > , Object > properties = new IdentityHashMap < ContextProperty < ? > , Object > ( mappings . size ( ) ) ; for ( final PropertyMapping < ? > mapping : mappings ) { properties . put ( mapping . property , mapping . value ) ; } return ImmutableContext . createUnsafe ( properties ) ; }
Creates a new context with the given property mappings .
29,273
private static Object fillSingletonMapFrom ( Input input , Schema < ? > schema , Object owner , IdStrategy strategy , boolean graph , Object map ) throws IOException { switch ( input . readFieldNumber ( schema ) ) { case 0 : return map ; case 1 : { break ; } case 3 : { final Wrapper wrapper = new Wrapper ( ) ; Object v = input . mergeObject ( wrapper , strategy . OBJECT_SCHEMA ) ; if ( ! graph || ! ( ( GraphInput ) input ) . isCurrentMessageReference ( ) ) v = wrapper . value ; try { fSingletonMap_v . set ( map , v ) ; } catch ( IllegalArgumentException e ) { throw new RuntimeException ( e ) ; } catch ( IllegalAccessException e ) { throw new RuntimeException ( e ) ; } if ( 0 != input . readFieldNumber ( schema ) ) throw new ProtostuffException ( "Corrupt input." ) ; return map ; } default : throw new ProtostuffException ( "Corrupt input." ) ; } final Wrapper wrapper = new Wrapper ( ) ; Object k = input . mergeObject ( wrapper , strategy . OBJECT_SCHEMA ) ; if ( ! graph || ! ( ( GraphInput ) input ) . isCurrentMessageReference ( ) ) k = wrapper . value ; switch ( input . readFieldNumber ( schema ) ) { case 0 : try { fSingletonMap_k . set ( map , k ) ; } catch ( IllegalArgumentException e ) { throw new RuntimeException ( e ) ; } catch ( IllegalAccessException e ) { throw new RuntimeException ( e ) ; } return map ; case 3 : break ; default : throw new ProtostuffException ( "Corrupt input." ) ; } Object v = input . mergeObject ( wrapper , strategy . OBJECT_SCHEMA ) ; if ( ! graph || ! ( ( GraphInput ) input ) . isCurrentMessageReference ( ) ) v = wrapper . value ; try { fSingletonMap_k . set ( map , k ) ; fSingletonMap_v . set ( map , v ) ; } catch ( IllegalArgumentException e ) { throw new RuntimeException ( e ) ; } catch ( IllegalAccessException e ) { throw new RuntimeException ( e ) ; } if ( 0 != input . readFieldNumber ( schema ) ) throw new ProtostuffException ( "Corrupt input." ) ; return map ; }
Return true to
29,274
private boolean finishLine ( boolean sawNewline ) throws IOException { handleLine ( line . toString ( ) , sawReturn ? ( sawNewline ? "\r\n" : "\r" ) : ( sawNewline ? "\n" : "" ) ) ; line = new StringBuilder ( ) ; sawReturn = false ; return sawNewline ; }
Called when a line is complete .
29,275
private String getValue ( Class < ? > section , String name ) { if ( section == null || name == null ) { log . warn ( "Section or name is null, Section:'" + section + "' name:'" + name + "'" ) ; return null ; } if ( fildes != null && lastModified != fildes . lastModified ( ) ) { getFileProperties ( filePath ) ; } String propertyName = getPropertyName ( section , name ) ; Object obj = fileProperties . get ( propertyName ) ; if ( obj != null ) { if ( log . isDebugEnabled ( ) ) { log . debug ( "propertyName:'" + propertyName + "' and value:'" + obj + "' from file:'" + filePath + "'" ) ; } if ( ObjectUtils . NULL . equals ( obj ) ) { return null ; } else { return ( String ) obj ; } } String ret = ( String ) fileProperties . get ( name ) ; if ( ret != null ) { return ( String ) ret ; } ret = ( String ) System . getProperty ( propertyName ) ; if ( ret != null ) { if ( log . isDebugEnabled ( ) ) { log . debug ( "Property name:'" + propertyName + "' found in system properties." ) ; } return ret ; } fileProperties . put ( propertyName , ObjectUtils . NULL ) ; return null ; }
This class will try to find the current value name into the System Properties or into the default file . If it can t be found it will use the mother class La propiededd tien eque ser de la fdorma siguiente es . nombre . Clase . nombrePropiedad
29,276
private void getFileProperties ( String fileName ) { fileProperties . clear ( ) ; if ( ! StringUtils . equals ( filePath , fileName ) ) { if ( log . isInfoEnabled ( ) ) { log . info ( "setting the file properties path to :'" + fileName + "'" ) ; } filePath = fileName ; if ( filePath != null ) { fildes = new File ( filePath ) ; } else { fildes = null ; } } else if ( fildes == null ) { if ( filePath != null ) { fildes = new File ( filePath ) ; } else { log . warn ( "The file properties path can't be null." ) ; return ; } } if ( ! fildes . canRead ( ) ) { log . warn ( "The file properties path :'" + filePath + "' can't be readed" ) ; return ; } try { InputStream in = new FileInputStream ( fildes ) ; fileProperties . load ( in ) ; in . close ( ) ; lastModified = fildes . lastModified ( ) ; if ( log . isInfoEnabled ( ) ) { log . info ( "The properties has been actualized from file:'" + fildes . getAbsolutePath ( ) + "'" ) ; } notifyPropertiesChangedListers ( lastModified ) ; } catch ( IOException e ) { log . warn ( "The file:'" + fildes . getName ( ) + "' can't be read." , e ) ; } }
Reads the file and store the new readed properties .
29,277
public String [ ] getAttributes ( ) { if ( attributes == null || attributes . length != 1 || ! attributes [ 0 ] . equals ( ALL_ATTRIBUTES ) ) { boolean found = false ; if ( attributes != null ) { for ( String attribute : attributes ) { if ( attribute . equals ( "distinguishedName" ) ) { found = true ; break ; } } } if ( ! found ) { String [ ] attributesx = new String [ attributes != null ? ( attributes . length + 1 ) : 1 ] ; if ( attributes != null ) { attributesx [ 0 ] = "distinguishedName" ; for ( int i = 0 ; i < attributes . length ; ++ i ) { attributesx [ i + 1 ] = attributes [ i ] ; } } attributes = attributesx ; } } return attributes ; }
Returns the set of attributes to extract for each returned entity .
29,278
public String getCollectionEndpoint ( String entityName , String groupId ) { return connec . getBasePath ( ) + "/" + groupId + "/" + entityName ; }
Return the path to the entity collection endpoint
29,279
public String getCollectionUrl ( String entityName , String groupId ) { return connec . getHost ( ) + getCollectionEndpoint ( entityName , groupId ) ; }
Return the url to the collection endpoint
29,280
public String getInstanceEndpoint ( String entityName , String groupId , String id ) { String edp = getCollectionEndpoint ( entityName , groupId ) ; if ( id != null && ! id . isEmpty ( ) ) { edp += "/" + id ; } return edp ; }
Return the path to the instance endpoint
29,281
public String getInstanceUrl ( String entityName , String groupId , String id ) { return connec . getHost ( ) + getInstanceEndpoint ( entityName , groupId , id ) ; }
Return the url to the instance endpoint
29,282
public Map < String , Object > all ( String entityName , String groupId ) throws MnoException { return all ( entityName , groupId , null , getAuthenticatedClient ( ) ) ; }
Return all the entities
29,283
public Map < String , Object > update ( String entityName , String groupId , String entityId , Map < String , Object > hash , MnoHttpClient httpClient ) throws AuthenticationException , ApiException , InvalidRequestException { Map < String , Object > envelope = new HashMap < String , Object > ( ) ; envelope . put ( entityName , MnoMapHelper . toUnderscoreHash ( hash ) ) ; envelope . put ( "resource" , entityName ) ; String payload = GSON . toJson ( envelope ) ; return update ( entityName , groupId , entityId , payload , httpClient ) ; }
apiService Update an entity remotely
29,284
public static < T > Gather < T > from ( Enumeration < T > enumeration ) { return null == enumeration ? Gather . < T > empty ( ) : from ( Iterators . forEnumeration ( enumeration ) ) ; }
Returns a new gather instance with given Enumeration
29,285
public Gather < T > order ( Ordering < T > ordering ) { Collection < T > sorted = ordering . sortedCopy ( list ( ) ) ; elements = Optional . fromNullable ( sorted ) ; return this ; }
Sort elements by special ordering
29,286
public Gather < T > filter ( Predicate < T > decision ) { predicates . get ( ) . add ( decision ) ; isFiltered = false ; return this ; }
Filter the given elements with special decision
29,287
public Optional < T > tryFind ( Predicate < T > decision ) { return Iterables . tryFind ( result ( ) , decision ) ; }
Returns an Optional containing the first element that satisfies the given decision
29,288
public T find ( Predicate < T > decision , T defaultValue ) { return Iterables . find ( result ( ) , decision , defaultValue ) ; }
Returns the first element that satisfies the given decision or defaultValue if none found .
29,289
public Gather < T > loop ( Predicate < T > decision ) { if ( Decisions . isEmpty ( ) . apply ( result ( ) ) ) { return this ; } Iterables . all ( result ( ) , decision ) ; return this ; }
Applies the special decision to each element
29,290
public < O > int foreach ( Function < ? super T , O > function ) { int count = 0 ; for ( T item : each ( ) ) { function . apply ( item ) ; ++ count ; } return count ; }
Invokes a function on each element of the delegate ignoring the return value ; returns the number of elements that were present .
29,291
public < K > Multimap < K , T > groupBy ( Function < ? super T , K > function ) { return Multimaps . index ( each ( ) , function ) ; }
Treating each element in the delegate as a value applies a function t determine the key and uses the multimap to group all values with the same key .
29,292
public T [ ] asArray ( Class < T > type ) { return Iterators . toArray ( each ( ) . iterator ( ) , type ) ; }
Returns an array of the given type containing the elements of the delegate .
29,293
public Selector append ( Selector tail ) { if ( right == null ) { if ( combinator != null ) { throw new IllegalStateException ( ) ; } return new Selector ( left , null , tail ) ; } else { return new Selector ( left , combinator , right . append ( tail ) ) ; } }
lisp - like list - append
29,294
public void init ( String name , Map < String , Object > config ) { this . name = name ; this . config = config ; this . run = true ; this . stopped = false ; }
Initializing with config
29,295
public void doShutdown ( ) { long t = System . currentTimeMillis ( ) ; LOG . info ( "" + name + " is going down now" ) ; synchronized ( this ) { this . stopped = false ; this . run = false ; } while ( true ) { synchronized ( this ) { if ( stopped ) break ; } try { Thread . sleep ( 1 ) ; } catch ( InterruptedException e ) { break ; } } LOG . info ( "" + name + " stopped in " + ( System . currentTimeMillis ( ) - t ) + " ms." ) ; }
Stopping worker gracefully
29,296
public String getOrElse ( String name , String def ) { String val = get ( name ) ; if ( val == null ) { return def ; } return val ; }
Returns the parameter value for the given name or the given default if not found .
29,297
public String getOrElse ( int i , String def ) { if ( i >= 0 && i < values . size ( ) ) { return values . get ( i ) ; } return def ; }
Returns the unnamed value at a position or the default if the position is not within bounds .
29,298
public static Arguments create ( List < String > values , Map < String , String > params ) { if ( values == null ) { values = emptyList ( ) ; } if ( params == null ) { params = emptyMap ( ) ; } if ( values . isEmpty ( ) && params . isEmpty ( ) ) { return NONE ; } return new Arguments ( values , params ) ; }
Creates a new object with the list of arguments . It checks for the number of argument entries and creates an empty arguments object if necessary .
29,299
private void init ( ) { if ( placeholder == null ) { IdentificationManager . getInstance ( ) . registerIdentification ( this ) ; Optional < Identification > identification = IdentificationManager . getInstance ( ) . getIdentification ( this ) ; if ( ! identification . isPresent ( ) ) { throw new IllegalStateException ( "Unable to obtain Identification" ) ; } else { placeholder = identification . get ( ) ; } } }
initializes some common fields in the Set