signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class DefaultGroovyMethods { /** * Selects the item in the iterable which when passed as a parameter to the supplied closure returns the * maximum value . A null return value represents the least possible return value , so any item for which * the supplied closure returns null , won ' t be selected ( unless all items return null ) . If more than one item * has the maximum value , an arbitrary choice is made between the items having the maximum value . * If the closure has two parameters * it is used like a traditional Comparator . I . e . it should compare * its two parameters for order , returning a negative integer , * zero , or a positive integer when the first parameter is less than , * equal to , or greater than the second respectively . Otherwise , * the Closure is assumed to take a single parameter and return a * Comparable ( typically an Integer ) which is then used for * further comparison . * < pre class = " groovyTestCase " > assert " hello " = = [ " hello " , " hi " , " hey " ] . max { it . length ( ) } < / pre > * < pre class = " groovyTestCase " > assert " hello " = = [ " hello " , " hi " , " hey " ] . max { a , b - > a . length ( ) < = > b . length ( ) } < / pre > * < pre class = " groovyTestCase " > * def pets = [ ' dog ' , ' elephant ' , ' anaconda ' ] * def longestName = pets . max { it . size ( ) } / / one of ' elephant ' or ' anaconda ' * assert longestName . size ( ) = = 8 * < / pre > * @ param self an Iterable * @ param closure a 1 or 2 arg Closure used to determine the correct ordering * @ return an item from the Iterable having the maximum value returned by calling the supplied closure with that item as parameter or null for an empty Iterable * @ since 2.2.0 */ public static < T > T max ( Iterable < T > self , @ ClosureParams ( FirstParam . FirstGenericType . class ) Closure closure ) { } }
int params = closure . getMaximumNumberOfParameters ( ) ; if ( params != 1 ) { return max ( self , new ClosureComparator < T > ( closure ) ) ; } boolean first = true ; T answer = null ; Object answerValue = null ; for ( T item : self ) { Object value = closure . call ( item ) ; if ( first ) { first = false ; answer = item ; answerValue = value ; } else if ( ScriptBytecodeAdapter . compareLessThan ( answerValue , value ) ) { answer = item ; answerValue = value ; } } return answer ;
public class Validate { /** * Method without varargs to increase performance */ public static < T > Class < T > isAssignableFrom ( final Class < ? > superType , final Class < T > type , final String message ) { } }
return INSTANCE . isAssignableFrom ( superType , type , message ) ;
public class NoteEditor { /** * GEN - LAST : event _ labelWrapModeMouseClicked */ private void updateWrapping ( ) { } }
this . editorPane . setWrapStyleWord ( this . wrapping != Wrapping . CHAR_WRAP ) ; this . editorPane . setLineWrap ( this . wrapping != Wrapping . NONE ) ; updateBottomPanel ( ) ;
public class SenderManager { /** * Mark the message as sent * @ param messageID the message ID * @ return return true if * this * member is in destination set */ public boolean markSent ( MessageID messageID ) { } }
MessageInfo messageInfo = sentMessages . remove ( messageID ) ; return messageInfo != null && messageInfo . toSelfDeliver ;
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link Object } { @ code > } * @ param value * Java instance representing xml element ' s value . * @ return * the new instance of { @ link JAXBElement } { @ code < } { @ link Object } { @ code > } */ @ XmlElementDecl ( namespace = "http://www.opengis.net/citygml/transportation/2.0" , name = "_GenericApplicationPropertyOfRailway" ) public JAXBElement < Object > create_GenericApplicationPropertyOfRailway ( Object value ) { } }
return new JAXBElement < Object > ( __GenericApplicationPropertyOfRailway_QNAME , Object . class , null , value ) ;
public class DataFramePrinter { /** * Returns a whitespace string of the length specified * @ param length the length for whitespace */ private static void whitespace ( StringBuilder text , int length ) { } }
IntStream . range ( 0 , length ) . forEach ( i -> text . append ( " " ) ) ;
public class CmsWorkplace { /** * Sends a http redirect to the specified URI in the OpenCms VFS . < p > * @ param location the location the response is redirected to * @ throws IOException in case redirection fails */ public void sendCmsRedirect ( String location ) throws IOException { } }
// TOOD : IBM Websphere v5 has problems here , use forward instead ( which has other problems ) getJsp ( ) . getResponse ( ) . sendRedirect ( OpenCms . getSystemInfo ( ) . getOpenCmsContext ( ) + location ) ;
public class Validate { /** * Checks if the given file exists and is not a directory . * @ param file The file to validate . * @ return The validated file reference . * @ throws ParameterException if the file exists or is a directory . */ public static File noDirectory ( File file ) { } }
Validate . exists ( file ) ; if ( file . isDirectory ( ) ) throw new ParameterException ( "\"" + file + "\" is a directory!" ) ; return file ;
public class SingleTermDocs { /** * { @ inheritDoc } */ public int read ( int [ ] docs , int [ ] freqs ) throws IOException { } }
if ( next && docs . length > 0 ) { docs [ 0 ] = doc ; freqs [ 0 ] = 1 ; next = false ; return 1 ; } return 0 ;
public class TypeUtils { /** * < p > Gets the type arguments of a class / interface based on a subtype . For * instance , this method will determine that both of the parameters for the * interface { @ link Map } are { @ link Object } for the subtype * { @ link java . util . Properties Properties } even though the subtype does not * directly implement the { @ code Map } interface . < / p > * < p > This method returns { @ code null } if { @ code type } is not assignable to * { @ code toClass } . It returns an empty map if none of the classes or * interfaces in its inheritance hierarchy specify any type arguments . < / p > * < p > A side effect of this method is that it also retrieves the type * arguments for the classes and interfaces that are part of the hierarchy * between { @ code type } and { @ code toClass } . So with the above * example , this method will also determine that the type arguments for * { @ link java . util . Hashtable Hashtable } are also both { @ code Object } . * In cases where the interface specified by { @ code toClass } is * ( indirectly ) implemented more than once ( e . g . where { @ code toClass } * specifies the interface { @ link java . lang . Iterable Iterable } and * { @ code type } specifies a parameterized type that implements both * { @ link java . util . Set Set } and { @ link java . util . Collection Collection } ) , * this method will look at the inheritance hierarchy of only one of the * implementations / subclasses ; the first interface encountered that isn ' t a * subinterface to one of the others in the { @ code type } to * { @ code toClass } hierarchy . < / p > * @ param type the type from which to determine the type parameters of * { @ code toClass } * @ param toClass the class whose type parameters are to be determined based * on the subtype { @ code type } * @ return a { @ code Map } of the type assignments for the type variables in * each type in the inheritance hierarchy from { @ code type } to * { @ code toClass } inclusive . */ public static Map < TypeVariable < ? > , Type > getTypeArguments ( final Type type , final Class < ? > toClass ) { } }
return getTypeArguments ( type , toClass , null ) ;
public class CommandInterceptor { /** * The default behaviour of the visitXXX methods , which is to ignore the call and pass the call up to the next * interceptor in the chain . * @ param ctx invocation context * @ param command command to invoke * @ return return value * @ throws Throwable in the event of problems */ @ Override protected Object handleDefault ( InvocationContext ctx , VisitableCommand command ) throws Throwable { } }
return invokeNextInterceptor ( ctx , command ) ;
public class Ifc2x3tc1FactoryImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public IfcDirectionSenseEnum createIfcDirectionSenseEnumFromString ( EDataType eDataType , String initialValue ) { } }
IfcDirectionSenseEnum result = IfcDirectionSenseEnum . get ( initialValue ) ; if ( result == null ) throw new IllegalArgumentException ( "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType . getName ( ) + "'" ) ; return result ;
public class IteratorPool { /** * Get an instance of the given object in this pool * @ return An instance of the given object */ public synchronized DTMIterator getInstanceOrThrow ( ) throws CloneNotSupportedException { } }
// Check if the pool is empty . if ( m_freeStack . isEmpty ( ) ) { // Create a new object if so . return ( DTMIterator ) m_orig . clone ( ) ; } else { // Remove object from end of free pool . DTMIterator result = ( DTMIterator ) m_freeStack . remove ( m_freeStack . size ( ) - 1 ) ; return result ; }
public class URLRewriterService { /** * This method will return two bits of information that are used by components that want run through * the AJAX facilities . The < code > AjaxUrlInfo < / code > class is returned and specifies this information . Unlike * the other URLRewriter method , this is a true Chain of Responsibility ( CoR ) implementation . The first URLRewriter * to return the AjaxUrlInfo object wins and that is returned from this call . The reason for this is that * the implementation of the Ajax Context is also a true CoR implementation . These must match . * @ param servletContext the current ServletContext . * @ param request the current ServletRequest . * @ param nameable this object that is the target of the Ajax request . Typically it is an INameable . */ public static AjaxUrlInfo getAjaxUrl ( ServletContext servletContext , ServletRequest request , Object nameable ) { } }
ArrayList /* < URLRewriter > */ rewriters = getRewriters ( request ) ; if ( rewriters != null ) { for ( Iterator i = rewriters . iterator ( ) ; i . hasNext ( ) ; ) { URLRewriter rewriter = ( URLRewriter ) i . next ( ) ; AjaxUrlInfo info = rewriter . getAjaxUrl ( servletContext , request , nameable ) ; if ( info != null ) return info ; } } return null ;
public class TrellisHttpResource { /** * Perform an OPTIONS operation on an LDP Resource . * @ param response the async response * @ param uriInfo the URI info * @ param headers the HTTP headers * @ param request the request */ @ OPTIONS @ Timed public void options ( @ Suspended final AsyncResponse response , @ Context final Request request , @ Context final UriInfo uriInfo , @ Context final HttpHeaders headers ) { } }
final TrellisRequest req = new TrellisRequest ( request , uriInfo , headers ) ; final String urlBase = getBaseUrl ( req ) ; final IRI identifier = rdf . createIRI ( TRELLIS_DATA_PREFIX + req . getPath ( ) ) ; final OptionsHandler optionsHandler = new OptionsHandler ( req , trellis , req . getVersion ( ) != null , urlBase ) ; fetchTrellisResource ( identifier , req . getVersion ( ) ) . thenApply ( optionsHandler :: initialize ) . thenApply ( optionsHandler :: ldpOptions ) . thenApply ( ResponseBuilder :: build ) . exceptionally ( this :: handleException ) . thenApply ( response :: resume ) ;
public class Configuration { /** * Creates a configuration with the same content as this instance , but * with the specified identifier . * @ param identifier the new identifier * @ return a new configuration */ Configuration copyWithIdentifier ( String identifier ) { } }
return new Configuration ( details . builder ( ) . identifier ( identifier ) . build ( ) , new HashMap < > ( config ) ) ;
public class GoogleHadoopFileSystem { /** * Sets and validates the root bucket . */ @ Override @ VisibleForTesting protected void configureBuckets ( GoogleCloudStorageFileSystem gcsFs ) throws IOException { } }
rootBucket = initUri . getAuthority ( ) ; checkArgument ( rootBucket != null , "No bucket specified in GCS URI: %s" , initUri ) ; // Validate root bucket name pathCodec . getPath ( rootBucket , /* objectName = */ null , /* allowEmptyObjectName = */ true ) ; logger . atFine ( ) . log ( "GHFS.configureBuckets: GoogleHadoopFileSystem root in bucket: %s" , rootBucket ) ;
public class LambdaDataSourceConfigMarshaller { /** * Marshall the given parameter object . */ public void marshall ( LambdaDataSourceConfig lambdaDataSourceConfig , ProtocolMarshaller protocolMarshaller ) { } }
if ( lambdaDataSourceConfig == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( lambdaDataSourceConfig . getLambdaFunctionArn ( ) , LAMBDAFUNCTIONARN_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class ObjectMappableAnnotatedClass { /** * Scans the class for annotated fields . Also scans inheritance hierarchy . * @ throws ProcessingException */ public void scanForAnnotatedFields ( Types typeUtils , Elements elementUtils ) throws ProcessingException { } }
// Scan inheritance hierarchy recursively to find all annotated fields TypeElement currentClass = typeElement ; TypeMirror superClassType ; Column annotation = null ; PackageElement originPackage = elementUtils . getPackageOf ( typeElement ) ; PackageElement superClassPackage ; Set < VariableElement > annotatedFields = new LinkedHashSet < > ( ) ; Map < String , ExecutableElement > possibleSetterFields = new HashMap < > ( ) ; do { // Scan fields for ( Element e : currentClass . getEnclosedElements ( ) ) { annotation = e . getAnnotation ( Column . class ) ; if ( e . getKind ( ) == ElementKind . FIELD && annotation != null ) { annotatedFields . add ( ( VariableElement ) e ) ; } // Check methods else if ( e . getKind ( ) == ElementKind . METHOD ) { // Save possible setters ExecutableElement methodElement = ( ExecutableElement ) e ; String setterMethodName = methodElement . getSimpleName ( ) . toString ( ) ; if ( setterMethodName . startsWith ( "set" ) ) { ExecutableElement existingSetter = possibleSetterFields . get ( setterMethodName ) ; if ( existingSetter != null ) { // The new setter has better visibility , so pick that one if ( ModifierUtils . compareModifierVisibility ( methodElement , existingSetter ) == - 1 ) { possibleSetterFields . put ( setterMethodName , methodElement ) ; } } else { possibleSetterFields . put ( setterMethodName , methodElement ) ; } } // Is it an annotated setter ? if ( annotation != null ) { ColumnAnnotatedMethod method = new ColumnAnnotatedMethod ( methodElement , annotation ) ; ColumnAnnotateable existingColumnAnnotateable = columnAnnotatedElementsMap . get ( method . getColumnName ( ) ) ; if ( existingColumnAnnotateable != null ) { throw new ProcessingException ( methodElement , "The method %s in class %s is annotated with @%s with column name = \"%s\" but this column name is already used by %s in class %s" , method . getMethodName ( ) , method . getQualifiedSurroundingClassName ( ) , Column . class . getSimpleName ( ) , method . getColumnName ( ) , existingColumnAnnotateable . getElementName ( ) , existingColumnAnnotateable . getQualifiedSurroundingClassName ( ) ) ; } columnAnnotatedElementsMap . put ( method . getColumnName ( ) , method ) ; } } else if ( annotation != null ) { throw new ProcessingException ( e , "%s is of type %s and annotated with @%s, but only Fields or setter Methods can be annotated with @%s" , e . getSimpleName ( ) , e . getKind ( ) . toString ( ) , Column . class . getSimpleName ( ) , Column . class . getSimpleName ( ) ) ; } } superClassType = currentClass . getSuperclass ( ) ; currentClass = ( TypeElement ) typeUtils . asElement ( superClassType ) ; } while ( superClassType . getKind ( ) != TypeKind . NONE ) ; // Check fields for ( VariableElement e : annotatedFields ) { annotation = e . getAnnotation ( Column . class ) ; currentClass = ( TypeElement ) e . getEnclosingElement ( ) ; if ( e . getModifiers ( ) . contains ( Modifier . PRIVATE ) ) { // Private field : Automatically try to detect a setter String fieldName = e . getSimpleName ( ) . toString ( ) ; String perfectSetterName ; if ( fieldName . length ( ) == 1 ) { perfectSetterName = "set" + fieldName . toUpperCase ( ) ; } else { String withoutHungarianNotation = HungarianNotation . removeNotation ( fieldName ) ; perfectSetterName = "set" + Character . toUpperCase ( withoutHungarianNotation . charAt ( 0 ) ) + withoutHungarianNotation . substring ( 1 ) ; } ExecutableElement setterMethod = possibleSetterFields . get ( perfectSetterName ) ; if ( setterMethod != null && isSetterForField ( setterMethod , e ) ) { // valid setter , so use this one ColumnAnnotatedMethod method = new ColumnAnnotatedMethod ( setterMethod , annotation ) ; columnAnnotatedElementsMap . put ( method . getColumnName ( ) , method ) ; continue ; } else { if ( fieldName . startsWith ( "m" ) ) { // setmFoo ( ) if field = = mFoo setterMethod = possibleSetterFields . get ( "set" + fieldName ) ; if ( setterMethod != null && isSetterForField ( setterMethod , e ) ) { // valid setter ColumnAnnotatedMethod method = new ColumnAnnotatedMethod ( setterMethod , annotation ) ; columnAnnotatedElementsMap . put ( method . getColumnName ( ) , method ) ; continue ; } else { // setMFoo if field = = mFoo if ( fieldName . length ( ) > 1 ) { setterMethod = possibleSetterFields . get ( "set" + Character . toUpperCase ( fieldName . charAt ( 0 ) ) + fieldName . substring ( 1 ) ) ; if ( setterMethod != null && isSetterForField ( setterMethod , e ) ) { // valid setter ColumnAnnotatedMethod method = new ColumnAnnotatedMethod ( setterMethod , annotation ) ; columnAnnotatedElementsMap . put ( method . getColumnName ( ) , method ) ; continue ; } } } } } // Kotlin special boolean character treatment if ( fieldName . matches ( "is[A-Z].*" ) ) { String setterName = "set" + fieldName . substring ( 2 ) ; setterMethod = possibleSetterFields . get ( setterName ) ; if ( setterMethod != null && isSetterForField ( setterMethod , e ) ) { // valid setter ColumnAnnotatedMethod method = new ColumnAnnotatedMethod ( setterMethod , annotation ) ; columnAnnotatedElementsMap . put ( method . getColumnName ( ) , method ) ; continue ; } } throw new ProcessingException ( e , "The field '%s' in class %s is private. " + "A corresponding setter method with the name '%s(%s)' is expected but haven't been found. Please add this setter method, " + "If you have another setter method named differently " + "please annotate your setter method with @%s " , fieldName , e . getEnclosingElement ( ) . getSimpleName ( ) . toString ( ) , perfectSetterName , e . asType ( ) . toString ( ) , Column . class . getSimpleName ( ) ) ; } else { // A simple non private field ColumnAnnotatedField field = new ColumnAnnotatedField ( e , annotation ) ; // Check field visibility of super class field if ( currentClass != typeElement && ! field . getField ( ) . getModifiers ( ) . contains ( Modifier . PUBLIC ) ) { superClassPackage = elementUtils . getPackageOf ( currentClass ) ; if ( ( superClassPackage != null && originPackage == null ) || ( superClassPackage == null && originPackage != null ) || ( superClassPackage != null && ! superClassPackage . equals ( originPackage ) ) || ( originPackage != null && ! originPackage . equals ( superClassPackage ) ) ) { throw new ProcessingException ( e , "The field %s in class %s can not be accessed from ObjectMapper because of " + "visibility issue. Either move class %s into the same package " + "as %s or make the field %s public or create and annotate a public setter " + "method for this field with @%s instead of annotating the field itself" , field . getFieldName ( ) , field . getQualifiedSurroundingClassName ( ) , typeElement . getQualifiedName ( ) . toString ( ) , field . getQualifiedSurroundingClassName ( ) , field . getFieldName ( ) , Column . class . getSimpleName ( ) ) ; } } ColumnAnnotateable existingColumnAnnotateable = columnAnnotatedElementsMap . get ( field . getColumnName ( ) ) ; if ( existingColumnAnnotateable != null ) { throw new ProcessingException ( e , "The field %s in class %s is annotated with @%s with column name = \"%s\" but this column name is already used by %s in class %s" , field . getFieldName ( ) , field . getQualifiedSurroundingClassName ( ) , Column . class . getSimpleName ( ) , field . getColumnName ( ) , existingColumnAnnotateable . getElementName ( ) , existingColumnAnnotateable . getQualifiedSurroundingClassName ( ) ) ; } columnAnnotatedElementsMap . put ( field . getColumnName ( ) , field ) ; } }
public class ReentrantLock { /** * Returns a collection containing those threads that may be * waiting on the given condition associated with this lock . * Because the actual set of threads may change dynamically while * constructing this result , the returned collection is only a * best - effort estimate . The elements of the returned collection * are in no particular order . This method is designed to * facilitate construction of subclasses that provide more * extensive condition monitoring facilities . * @ param condition the condition * @ return the collection of threads * @ throws IllegalMonitorStateException if this lock is not held * @ throws IllegalArgumentException if the given condition is * not associated with this lock * @ throws NullPointerException if the condition is null */ protected Collection < Thread > getWaitingThreads ( Condition condition ) { } }
if ( condition == null ) throw new NullPointerException ( ) ; if ( ! ( condition instanceof AbstractQueuedSynchronizer . ConditionObject ) ) throw new IllegalArgumentException ( "not owner" ) ; return sync . getWaitingThreads ( ( AbstractQueuedSynchronizer . ConditionObject ) condition ) ;
public class ParosTableContext { /** * / * ( non - Javadoc ) * @ see org . parosproxy . paros . db . paros . TableContext # getAllData ( ) */ @ Override public List < RecordContext > getAllData ( ) throws DatabaseException { } }
try { List < RecordContext > result = new ArrayList < > ( ) ; try ( ResultSet rs = psGetAllData . executeQuery ( ) ) { while ( rs . next ( ) ) { result . add ( new RecordContext ( rs . getLong ( DATAID ) , rs . getInt ( CONTEXTID ) , rs . getInt ( TYPE ) , rs . getString ( DATA ) ) ) ; } } return result ; } catch ( SQLException e ) { throw new DatabaseException ( e ) ; }
public class MaterialAPI { /** * 获取素材列表 * @ param type 素材类型 * @ param offset 从全部素材的该偏移位置开始返回 , 0表示从第一个素材 返回 * @ param count 返回素材的数量 , 取值在1到20之间 * @ return 素材列表结果 */ public GetMaterialListResponse batchGetMaterial ( MaterialType type , int offset , int count ) { } }
if ( offset < 0 ) offset = 0 ; if ( count > 20 ) count = 20 ; if ( count < 1 ) count = 1 ; GetMaterialListResponse response = null ; String url = BASE_API_URL + "cgi-bin/material/batchget_material?access_token=#" ; final Map < String , Object > params = new HashMap < String , Object > ( 4 , 1 ) ; params . put ( "type" , type . toString ( ) ) ; params . put ( "offset" , offset ) ; params . put ( "count" , count ) ; BaseResponse r = executePost ( url , JSONUtil . toJson ( params ) ) ; String resultJson = isSuccess ( r . getErrcode ( ) ) ? r . getErrmsg ( ) : r . toJsonString ( ) ; response = JSONUtil . toBean ( resultJson , GetMaterialListResponse . class ) ; return response ;
public class CmsResourceTypeJsp { /** * Returns a set of root paths of files that are including the given resource using the ' link . strong ' macro . < p > * @ param cms the current cms context * @ param resource the resource to check * @ return the set of referencing paths * @ throws CmsException if something goes wrong */ protected Set < String > getReferencingStrongLinks ( CmsObject cms , CmsResource resource ) throws CmsException { } }
Set < String > references = new HashSet < String > ( ) ; if ( m_jspLoader == null ) { return references ; } m_jspLoader . getReferencingStrongLinks ( cms , resource , references ) ; return references ;
public class JsonRequestLog { /** * Provides a hook whereby an alternate source can be provided for grabbing the requestId */ protected UUID getRequestIdFrom ( Request request , Response response ) { } }
return optUuid ( response . getHeader ( OTHeaders . REQUEST_ID ) ) ;
public class Get { /** * A map of attribute names to < code > AttributeValue < / code > objects that specifies the primary key of the item to * retrieve . * @ param key * A map of attribute names to < code > AttributeValue < / code > objects that specifies the primary key of the item * to retrieve . * @ return Returns a reference to this object so that method calls can be chained together . */ public Get withKey ( java . util . Map < String , AttributeValue > key ) { } }
setKey ( key ) ; return this ;
public class BackupController { /** * Set client server configuration and overrides according to backup * @ param fileData File containing profile overrides and server configuration * @ param profileIdentifier Profile to update for client * @ param clientUUID Client to apply overrides to * @ param odoImport Param to determine if an odo config will be imported with the overrides import * @ return * @ throws Exception */ @ RequestMapping ( value = "/api/backup/profile/{profileIdentifier}/{clientUUID}" , method = RequestMethod . POST ) public @ ResponseBody ResponseEntity < String > processSingleProfileBackup ( @ RequestParam ( "fileData" ) MultipartFile fileData , @ PathVariable String profileIdentifier , @ PathVariable String clientUUID , @ RequestParam ( value = "odoImport" , defaultValue = "true" ) boolean odoImport ) throws Exception { } }
int profileID = ControllerUtils . convertProfileIdentifier ( profileIdentifier ) ; if ( ! fileData . isEmpty ( ) ) { try { // Read in file InputStream inputStream = fileData . getInputStream ( ) ; BufferedReader bufferedReader = new BufferedReader ( new InputStreamReader ( inputStream ) ) ; String singleLine ; String fullFileString = "" ; while ( ( singleLine = bufferedReader . readLine ( ) ) != null ) { fullFileString += singleLine ; } JSONObject fileBackup = new JSONObject ( fullFileString ) ; if ( odoImport ) { JSONObject odoBackup = fileBackup . getJSONObject ( "odoBackup" ) ; byte [ ] bytes = odoBackup . toString ( ) . getBytes ( ) ; // Save to second file to be used in importing odo configuration BufferedOutputStream stream = new BufferedOutputStream ( new FileOutputStream ( new File ( "backup-uploaded.json" ) ) ) ; stream . write ( bytes ) ; stream . close ( ) ; File f = new File ( "backup-uploaded.json" ) ; BackupService . getInstance ( ) . restoreBackupData ( new FileInputStream ( f ) ) ; } // Get profile backup if json contained both profile backup and odo backup if ( fileBackup . has ( "profileBackup" ) ) { fileBackup = fileBackup . getJSONObject ( "profileBackup" ) ; } // Import profile overrides BackupService . getInstance ( ) . setProfileFromBackup ( fileBackup , profileID , clientUUID ) ; } catch ( Exception e ) { try { JSONArray errorArray = new JSONArray ( e . getMessage ( ) ) ; return new ResponseEntity < > ( errorArray . toString ( ) , HttpStatus . BAD_REQUEST ) ; } catch ( Exception k ) { // Catch for exceptions other than ones defined in backup service return new ResponseEntity < > ( "[{\"error\" : \"Upload Error\"}]" , HttpStatus . BAD_REQUEST ) ; } } } return new ResponseEntity < > ( HttpStatus . OK ) ;
public class Journal { /** * Recover the local journal storage . */ private void recoverJournal ( StartupOption startOpt ) throws IOException { } }
LOG . info ( "Recovering journal " + this . getJournalId ( ) ) ; journalStorage . recover ( startOpt ) ;
public class FastDateFormat { /** * 获得 { @ link FastDateFormat } 实例 < br > * 支持缓存 * @ param style time style : FULL , LONG , MEDIUM , or SHORT * @ param timeZone optional time zone , overrides time zone of formatted time * @ return 本地化 { @ link FastDateFormat } */ public static FastDateFormat getTimeInstance ( final int style , final TimeZone timeZone ) { } }
return cache . getTimeInstance ( style , timeZone , null ) ;
public class ClusterSampling { /** * Calculate the mean from the sample * @ param sampleDataCollection * @ return */ public static double mean ( TransposeDataCollection sampleDataCollection ) { } }
double mean = 0.0 ; int totalSampleN = 0 ; for ( Map . Entry < Object , FlatDataCollection > entry : sampleDataCollection . entrySet ( ) ) { mean += Descriptives . sum ( entry . getValue ( ) ) ; totalSampleN += entry . getValue ( ) . size ( ) ; } mean /= totalSampleN ; return mean ;
public class NetworkClient { /** * Patches the specified network with the data included in the request . Only the following fields * can be modified : routingConfig . routingMode . * < p > Sample code : * < pre > < code > * try ( NetworkClient networkClient = NetworkClient . create ( ) ) { * ProjectGlobalNetworkName network = ProjectGlobalNetworkName . of ( " [ PROJECT ] " , " [ NETWORK ] " ) ; * Network networkResource = Network . newBuilder ( ) . build ( ) ; * List & lt ; String & gt ; fieldMask = new ArrayList & lt ; & gt ; ( ) ; * Operation response = networkClient . patchNetwork ( network , networkResource , fieldMask ) ; * < / code > < / pre > * @ param network Name of the network to update . * @ param networkResource Represents a Network resource . Read Virtual Private Cloud ( VPC ) Network * Overview for more information . ( = = resource _ for v1 . networks = = ) ( = = resource _ for * beta . networks = = ) * @ param fieldMask The fields that should be serialized ( even if they have empty values ) . If the * containing message object has a non - null fieldmask , then all the fields in the field mask * ( and only those fields in the field mask ) will be serialized . If the containing object does * not have a fieldmask , then only non - empty fields will be serialized . * @ throws com . google . api . gax . rpc . ApiException if the remote call fails */ @ BetaApi public final Operation patchNetwork ( ProjectGlobalNetworkName network , Network networkResource , List < String > fieldMask ) { } }
PatchNetworkHttpRequest request = PatchNetworkHttpRequest . newBuilder ( ) . setNetwork ( network == null ? null : network . toString ( ) ) . setNetworkResource ( networkResource ) . addAllFieldMask ( fieldMask ) . build ( ) ; return patchNetwork ( request ) ;
public class EmoTableAllTablesReportDAO { /** * Updates the metadata associated with the report . */ @ Override public void updateReport ( AllTablesReportDelta delta ) { } }
checkNotNull ( delta , "delta" ) ; updateMetadata ( delta ) ; if ( delta . getTable ( ) . isPresent ( ) ) { updateTableData ( delta , delta . getTable ( ) . get ( ) ) ; }
public class OidcAuthorizationRequestSupport { /** * Is authentication profile available ? . * @ param context the context * @ return the optional user profile */ public static Optional < CommonProfile > isAuthenticationProfileAvailable ( final J2EContext context ) { } }
val manager = new ProfileManager < > ( context , context . getSessionStore ( ) ) ; return manager . get ( true ) ;
public class ConfigClient { /** * Gets a sink . * < p > Sample code : * < pre > < code > * try ( ConfigClient configClient = ConfigClient . create ( ) ) { * SinkName sinkName = ProjectSinkName . of ( " [ PROJECT ] " , " [ SINK ] " ) ; * LogSink response = configClient . getSink ( sinkName ) ; * < / code > < / pre > * @ param sinkName Required . The resource name of the sink : * < p > " projects / [ PROJECT _ ID ] / sinks / [ SINK _ ID ] " * " organizations / [ ORGANIZATION _ ID ] / sinks / [ SINK _ ID ] " * " billingAccounts / [ BILLING _ ACCOUNT _ ID ] / sinks / [ SINK _ ID ] " * " folders / [ FOLDER _ ID ] / sinks / [ SINK _ ID ] " * < p > Example : ` " projects / my - project - id / sinks / my - sink - id " ` . * @ throws com . google . api . gax . rpc . ApiException if the remote call fails */ public final LogSink getSink ( SinkName sinkName ) { } }
GetSinkRequest request = GetSinkRequest . newBuilder ( ) . setSinkName ( sinkName == null ? null : sinkName . toString ( ) ) . build ( ) ; return getSink ( request ) ;
public class PipelineApi { /** * Get single pipelines in a project . * < pre > < code > GitLab Endpoint : GET / projects / : id / pipelines / : pipeline _ id < / code > < / pre > * @ param projectIdOrPath the project in the form of an Integer ( ID ) , String ( path ) , or Project instance * @ param pipelineId the pipeline ID to get * @ return a single pipelines for the specified project ID * @ throws GitLabApiException if any exception occurs during execution */ public Pipeline getPipeline ( Object projectIdOrPath , int pipelineId ) throws GitLabApiException { } }
Response response = get ( Response . Status . OK , null , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "pipelines" , pipelineId ) ; return ( response . readEntity ( Pipeline . class ) ) ;
public class StaticFieldELResolver { /** * < p > Inquires whether the static field is writable . < / p > * < p > If the base object is an instance of < code > ELClass < / code > and the * property is a String , * the < code > propertyResolved < / code > property of the * < code > ELContext < / code > object must be set to < code > true < / code > * by the resolver , before returning . If this property is not * < code > true < / code > after this method is called , the caller can * safely assume no value has been set . < / p > * < p > Always returns a < code > true < / code > because writing to a static field * is not allowed . < / p > * @ param context The context of this evaluation . * @ param base An < code > ELClass < / code > . * @ param property The name of the bean . * @ return < code > true < / code > * @ throws NullPointerException if context is < code > null < / code > . */ @ Override public boolean isReadOnly ( ELContext context , Object base , Object property ) { } }
if ( context == null ) { throw new NullPointerException ( ) ; } if ( base instanceof ELClass && property instanceof String ) { Class < ? > klass = ( ( ELClass ) base ) . getKlass ( ) ; context . setPropertyResolved ( true ) ; } return true ;
public class LBiObjDblConsumerBuilder { /** * One of ways of creating builder . This might be the only way ( considering all _ functional _ builders ) that might be utilize to specify generic params only once . */ @ Nonnull public static < T1 , T2 > LBiObjDblConsumerBuilder < T1 , T2 > biObjDblConsumer ( Consumer < LBiObjDblConsumer < T1 , T2 > > consumer ) { } }
return new LBiObjDblConsumerBuilder ( consumer ) ;
public class FrameDataflowAnalysis { /** * Get the dataflow fact representing the point just before given Location . * Note " before " is meant in the logical sense , so for backward analyses , * before means after the location in the control flow sense . * @ return the fact at the point just before the location */ public FrameType getFactBeforeExceptionCheck ( CFG cfg , int pc ) throws DataflowAnalysisException { } }
FrameType result = createFact ( ) ; makeFactTop ( result ) ; for ( Location loc : cfg . getLocationsContainingInstructionWithOffset ( pc ) ) { BasicBlock b = loc . getBasicBlock ( ) ; BasicBlock b2 = null ; if ( b . getFirstInstruction ( ) != null && b . getFirstInstruction ( ) . getPosition ( ) == pc ) { b2 = cfg . getPredecessorWithEdgeType ( b , EdgeTypes . FALL_THROUGH_EDGE ) ; } if ( b2 != null && b2 . isExceptionThrower ( ) ) { for ( Iterator < Edge > i = cfg . incomingEdgeIterator ( b2 ) ; i . hasNext ( ) ; ) { Edge e = i . next ( ) ; FrameType fact = getFactOnEdge ( e ) ; if ( isFactValid ( fact ) ) { mergeInto ( fact , result ) ; } } } else { FrameType fact = getFactAtLocation ( loc ) ; if ( isFactValid ( fact ) ) { mergeInto ( fact , result ) ; } } } return result ;
public class AtomicBiInteger { /** * Sets the hi value into the given encoded value . * @ param encoded the encoded value * @ param hi the hi value * @ return the new encoded value */ public static long encodeHi ( long encoded , int hi ) { } }
long h = ( ( long ) hi ) & 0xFFFF_FFFFL ; long l = encoded & 0xFFFF_FFFFL ; return ( h << 32 ) + l ;
public class SelfExtractor { /** * Release the jar file and null instance so that it can be deleted */ public String close ( ) { } }
if ( instance == null ) { return null ; } try { container . close ( ) ; instance = null ; } catch ( IOException e ) { return e . getMessage ( ) ; } return null ;
public class RaygunClient { /** * Sends an exception - type object to Raygun with a list of tags you specify , and a set of * custom data . * @ param throwable The Throwable object that occurred in your application that will be sent to Raygun . * @ param tags A list of data that will be attached to the Raygun message and visible on the error in the dashboard . * This could be a build tag , lifecycle state , debug / production version etc . * @ param userCustomData A set of custom key - value pairs relating to your application and its current state . This is a bucket * where you can attach any related data you want to see to the error . */ public static void send ( Throwable throwable , List tags , Map userCustomData ) { } }
RaygunMessage msg = buildMessage ( throwable ) ; if ( msg == null ) { RaygunLogger . e ( "Failed to send RaygunMessage - due to invalid message being built" ) ; return ; } msg . getDetails ( ) . setTags ( RaygunUtils . mergeLists ( RaygunClient . tags , tags ) ) ; msg . getDetails ( ) . setUserCustomData ( RaygunUtils . mergeMaps ( RaygunClient . userCustomData , userCustomData ) ) ; if ( RaygunClient . onBeforeSend != null ) { msg = RaygunClient . onBeforeSend . onBeforeSend ( msg ) ; if ( msg == null ) { return ; } } enqueueWorkForCrashReportingService ( RaygunClient . apiKey , new Gson ( ) . toJson ( msg ) ) ; postCachedMessages ( ) ;
public class SimpleBeanBoundTableDataModel { /** * { @ inheritDoc } */ @ Override public Object getValueAt ( final int row , final int col ) { } }
Object data = getBean ( ) ; Object bean = null ; if ( data instanceof Object [ ] ) { bean = ( ( Object [ ] ) data ) [ row ] ; } else if ( data instanceof List ) { bean = ( ( List ) data ) . get ( row ) ; } String property = properties [ col ] ; if ( bean != null ) { if ( "." . equals ( property ) ) { return bean ; } else { try { return PropertyUtils . getProperty ( bean , property ) ; } catch ( Exception e ) { LOG . error ( "Failed to read bean property " + property + " from " + bean , e ) ; } } } return null ;
public class DwgArc { /** * Read an Arc in the DWG format Version 15 * @ param data Array of unsigned bytes obtained from the DWG binary file * @ param offset The current bit offset where the value begins * @ throws Exception If an unexpected bit value is found in the DWG file . Occurs * when we are looking for LwPolylines . */ public void readDwgArcV15 ( int [ ] data , int offset ) throws Exception { } }
// System . out . println ( " readDwgArc ( ) executed . . . " ) ; int bitPos = offset ; bitPos = readObjectHeaderV15 ( data , bitPos ) ; Vector v = DwgUtil . getBitDouble ( data , bitPos ) ; bitPos = ( ( Integer ) v . get ( 0 ) ) . intValue ( ) ; double x = ( ( Double ) v . get ( 1 ) ) . doubleValue ( ) ; v = DwgUtil . getBitDouble ( data , bitPos ) ; bitPos = ( ( Integer ) v . get ( 0 ) ) . intValue ( ) ; double y = ( ( Double ) v . get ( 1 ) ) . doubleValue ( ) ; v = DwgUtil . getBitDouble ( data , bitPos ) ; bitPos = ( ( Integer ) v . get ( 0 ) ) . intValue ( ) ; double z = ( ( Double ) v . get ( 1 ) ) . doubleValue ( ) ; double [ ] coord = new double [ ] { x , y , z } ; center = coord ; v = DwgUtil . getBitDouble ( data , bitPos ) ; bitPos = ( ( Integer ) v . get ( 0 ) ) . intValue ( ) ; double val = ( ( Double ) v . get ( 1 ) ) . doubleValue ( ) ; radius = val ; v = DwgUtil . testBit ( data , bitPos ) ; bitPos = ( ( Integer ) v . get ( 0 ) ) . intValue ( ) ; boolean flag = ( ( Boolean ) v . get ( 1 ) ) . booleanValue ( ) ; if ( flag ) { val = 0.0 ; } else { v = DwgUtil . getBitDouble ( data , bitPos ) ; bitPos = ( ( Integer ) v . get ( 0 ) ) . intValue ( ) ; val = ( ( Double ) v . get ( 1 ) ) . doubleValue ( ) ; } thickness = val ; v = DwgUtil . testBit ( data , bitPos ) ; bitPos = ( ( Integer ) v . get ( 0 ) ) . intValue ( ) ; flag = ( ( Boolean ) v . get ( 1 ) ) . booleanValue ( ) ; if ( flag ) { x = y = 0.0 ; z = 1.0 ; } else { v = DwgUtil . getBitDouble ( data , bitPos ) ; bitPos = ( ( Integer ) v . get ( 0 ) ) . intValue ( ) ; x = ( ( Double ) v . get ( 1 ) ) . doubleValue ( ) ; v = DwgUtil . getBitDouble ( data , bitPos ) ; bitPos = ( ( Integer ) v . get ( 0 ) ) . intValue ( ) ; y = ( ( Double ) v . get ( 1 ) ) . doubleValue ( ) ; v = DwgUtil . getBitDouble ( data , bitPos ) ; bitPos = ( ( Integer ) v . get ( 0 ) ) . intValue ( ) ; z = ( ( Double ) v . get ( 1 ) ) . doubleValue ( ) ; } coord = new double [ ] { x , y , z } ; extrusion = coord ; v = DwgUtil . getBitDouble ( data , bitPos ) ; bitPos = ( ( Integer ) v . get ( 0 ) ) . intValue ( ) ; val = ( ( Double ) v . get ( 1 ) ) . doubleValue ( ) ; initAngle = val ; v = DwgUtil . getBitDouble ( data , bitPos ) ; bitPos = ( ( Integer ) v . get ( 0 ) ) . intValue ( ) ; val = ( ( Double ) v . get ( 1 ) ) . doubleValue ( ) ; endAngle = val ; bitPos = readObjectTailV15 ( data , bitPos ) ;
public class FragmentBuilder { /** * This method returns the data associated with the out * buffer and resets the buffer to be inactive . * @ param hashCode The hash code , or - 1 to ignore the hash code * @ return The data */ public byte [ ] getOutData ( int hashCode ) { } }
if ( outStream != null && ( hashCode == - 1 || hashCode == outHashCode ) ) { try { outStream . close ( ) ; } catch ( IOException e ) { log . severe ( "Failed to close out data stream: " + e ) ; } byte [ ] b = outStream . toByteArray ( ) ; outStream = null ; return b ; } return null ;
public class BaseWindowedBolt { /** * define a sliding count window * @ param size count size * @ param slide slide size */ public BaseWindowedBolt < T > countWindow ( long size , long slide ) { } }
ensurePositiveTime ( size , slide ) ; ensureSizeGreaterThanSlide ( size , slide ) ; setSizeAndSlide ( size , slide ) ; this . windowAssigner = SlidingCountWindows . create ( size , slide ) ; return this ;
public class TemplatingManager { /** * Updates the template watcher after a change in the templating manager configuration . */ private void resetWatcher ( ) { } }
// Stop the current watcher . stopWatcher ( ) ; // Update the template & target directories , based on the provided configuration directory . if ( this . templatesDIR == null ) { this . logger . warning ( "The templates directory was not specified. DM templating is temporarily disabled." ) ; } else if ( this . outputDIR == null ) { this . logger . warning ( "The templates directory was not specified. DM templating is temporarily disabled." ) ; } else { this . templateWatcher = new TemplateWatcher ( this , this . templatesDIR , this . pollInterval ) ; this . templateWatcher . start ( ) ; }
public class JDlgDBConnection { /** * GEN - LAST : event _ pbCancelActionPerformed */ private void pbConnectActionPerformed ( java . awt . event . ActionEvent evt ) // GEN - FIRST : event _ pbConnectActionPerformed { } }
// GEN - HEADEREND : event _ pbConnectActionPerformed // Add your handling code here : mainFrame . setProperty ( JFrmMainFrame . JDBC_DRIVER , tfJDBCDriver . getText ( ) ) ; mainFrame . setProperty ( JFrmMainFrame . JDBC_URL , tfJDBCURL . getText ( ) ) ; mainFrame . setProperty ( JFrmMainFrame . JDBC_USER , tfUsername . getText ( ) ) ; mainFrame . setProperty ( JFrmMainFrame . JDBC_PASSWORD , new String ( this . tfPassword . getPassword ( ) ) ) ; new org . apache . ojb . tools . mapping . reversedb . gui . actions . DBConnectAction ( mainFrame ) . actionPerformed ( null ) ; dispose ( ) ;
public class JsJmsMapMessageImpl { /** * Provide an estimate of encoded length of the payload */ int guessPayloadLength ( ) { } }
int length = 0 ; // Total guess at average size of map entry try { Map < String , Object > payload = getBodyMap ( ) ; length = payload . size ( ) * 60 ; } catch ( UnsupportedEncodingException e ) { // No FFDC code needed // hmm . . . how do we figure out a reasonable length } return length ;
public class JobConfigurationUtils { /** * Put all configuration properties in a given { @ link Properties } object into a given * { @ link Configuration } object . * @ param properties the given { @ link Properties } object * @ param configuration the given { @ link Configuration } object */ public static void putPropertiesIntoConfiguration ( Properties properties , Configuration configuration ) { } }
for ( String name : properties . stringPropertyNames ( ) ) { configuration . set ( name , properties . getProperty ( name ) ) ; }
public class ClientEntry { /** * Convenience method to get first content object in content collection . Atom 1.0 allows only * one content element per entry . */ public Content getContent ( ) { } }
if ( getContents ( ) != null && ! getContents ( ) . isEmpty ( ) ) { final Content c = getContents ( ) . get ( 0 ) ; return c ; } return null ;
public class WhiteboxImpl { /** * Create a new instance of a class without invoking its constructor . * No byte - code manipulation is needed to perform this operation and thus * it ' s not necessary use the { @ code PowerMockRunner } or * { @ code PrepareForTest } annotation to use this functionality . * @ param < T > The type of the instance to create . * @ param classToInstantiate The type of the instance to create . * @ return A new instance of type T , created without invoking the * constructor . */ @ SuppressWarnings ( "unchecked" ) public static < T > T newInstance ( Class < T > classToInstantiate ) { } }
int modifiers = classToInstantiate . getModifiers ( ) ; final Object object ; if ( Modifier . isInterface ( modifiers ) ) { object = Proxy . newProxyInstance ( WhiteboxImpl . class . getClassLoader ( ) , new Class < ? > [ ] { classToInstantiate } , new InvocationHandler ( ) { @ Override public Object invoke ( Object proxy , Method method , Object [ ] args ) throws Throwable { return TypeUtils . getDefaultValue ( method . getReturnType ( ) ) ; } } ) ; } else if ( classToInstantiate . isArray ( ) ) { object = Array . newInstance ( classToInstantiate . getComponentType ( ) , 0 ) ; } else if ( Modifier . isAbstract ( modifiers ) ) { throw new IllegalArgumentException ( "Cannot instantiate an abstract class. Please use the ConcreteClassGenerator in PowerMock support to generate a concrete class first." ) ; } else { Objenesis objenesis = new ObjenesisStd ( ) ; ObjectInstantiator thingyInstantiator = objenesis . getInstantiatorOf ( classToInstantiate ) ; object = thingyInstantiator . newInstance ( ) ; } return ( T ) object ;
public class PluralRulesLoader { /** * Returns the plural rules for the the locale . If we don ' t have data , * android . icu . text . PluralRules . DEFAULT is returned . */ public PluralRules forLocale ( ULocale locale , PluralRules . PluralType type ) { } }
String rulesId = getRulesIdForLocale ( locale , type ) ; if ( rulesId == null || rulesId . trim ( ) . length ( ) == 0 ) { return PluralRules . DEFAULT ; } PluralRules rules = getRulesForRulesId ( rulesId ) ; if ( rules == null ) { rules = PluralRules . DEFAULT ; } return rules ;
public class FSAConfiguration { /** * check validation for appPath property , first check if the path is exist and then if this path is not a directory */ private boolean checkAppPathsForVia ( Set < String > keySet , List < String > errors ) { } }
for ( String key : keySet ) { if ( ! key . equals ( "defaultKey" ) ) { File file = new File ( key ) ; if ( ! file . exists ( ) ) { errors . add ( "Effective Usage Analysis will not run if the -appPath parameter references an invalid file path. Check that the -appPath parameter specifies a valid path" ) ; return false ; } else if ( ! file . isFile ( ) ) { errors . add ( "Effective Usage Analysis will not run if the -appPath parameter references an invalid file path. Check that the -appPath parameter specifies a valid path" ) ; return false ; } else { return true ; } } } return false ;
public class FeatureScopes { /** * Create a composite scope that returns description from multiple other scopes without applying shadowing semantics to then . */ protected CompositeScope createCompositeScope ( EObject featureCall , IScope parent , IFeatureScopeSession session ) { } }
return new CompositeScope ( parent , session , asAbstractFeatureCall ( featureCall ) ) ;
public class A_CmsListDialog { /** * A convenient method to throw a list unsupported * action runtime exception . < p > * Should be triggered if your list implementation does not * support the < code > { @ link # getParamListAction ( ) } < / code > * action . < p > * @ throws CmsRuntimeException always to signal that this operation is not supported */ protected void throwListUnsupportedActionException ( ) throws CmsRuntimeException { } }
throw new CmsRuntimeException ( Messages . get ( ) . container ( Messages . ERR_LIST_UNSUPPORTED_ACTION_2 , getList ( ) . getName ( ) . key ( getLocale ( ) ) , getParamListAction ( ) ) ) ;
public class Preconditions { /** * Tests the supplied object to see if it is not a type of the supplied class . * @ param type the type that is not of the supplied class . * @ param object the object tested against the type . * @ param errorMessage the errorMessage * @ return the object argument . * @ throws java . lang . IllegalArgumentException if the object is an instance of the type that is not of the expected class . */ public static < E > E checkNotInstanceOf ( Class type , E object , String errorMessage ) { } }
isNotNull ( type , "type" ) ; if ( type . isInstance ( object ) ) { throw new IllegalArgumentException ( errorMessage ) ; } return object ;
public class ReadFileExtFunction { /** * / * ( non - Javadoc ) * @ see com . ibm . jaggr . core . config . IConfigListener # configLoaded ( com . ibm . jaggr . core . config . IConfig , long ) */ @ Override public void configLoaded ( IConfig config , long sequence ) { } }
final String sourceMethod = "configLoaded" ; // $ NON - NLS - 1 $ final boolean isTraceLogging = log . isLoggable ( Level . FINER ) ; if ( isTraceLogging ) { log . entering ( sourceClass , sourceMethod , new Object [ ] { aggregator } ) ; } // update the config property isIncludeAMDPaths = TypeUtil . asBoolean ( config . getProperty ( CSSModuleBuilder . INCLUDEAMDPATHS_CONFIGPARAM , Boolean . class ) ) ; if ( isTraceLogging ) { log . exiting ( sourceClass , sourceMethod ) ; }
public class TracerFactory { /** * Takes the tracer from the head of the deque . If the deque is empty the methods blocks until a tracer will become available . By default a * QueueTracer wrapping a NullTracer will be ( non - blocking ) delivered . * @ return the tracer from the head of the deque */ public QueueTracer < ? > takeTracer ( ) { } }
this . queueReadLock . lock ( ) ; try { QueueTracer < ? > tracer ; if ( this . queueConfig . enabled ) { try { tracer = this . queueConfig . blockingTracerDeque . takeFirst ( ) ; // this . queueConfig . tracerMap . put ( Thread . currentThread ( ) , tracer ) ; this . queueConfig . currentTracer . set ( tracer ) ; } catch ( InterruptedException ex ) { System . err . printf ( "Interrupted when waiting for a QueueTracer... %n" ) ; tracer = this . queueConfig . queueNullTracer ; } } else { tracer = this . queueConfig . queueNullTracer ; } return tracer ; } finally { this . queueReadLock . unlock ( ) ; }
public class BoundingBox { /** * give max rectangle */ public Rectangle getMaxRectabgle ( ) { } }
return new Rectangle ( ( int ) xLB . max , ( int ) yLB . max , ( int ) ( xUB . max - xLB . max ) , ( int ) ( yUB . max - yLB . max ) ) ;
public class InternalXbaseWithAnnotationsParser { /** * InternalXbaseWithAnnotations . g : 533:1 : entryRuleXAdditiveExpression : ruleXAdditiveExpression EOF ; */ public final void entryRuleXAdditiveExpression ( ) throws RecognitionException { } }
try { // InternalXbaseWithAnnotations . g : 534:1 : ( ruleXAdditiveExpression EOF ) // InternalXbaseWithAnnotations . g : 535:1 : ruleXAdditiveExpression EOF { if ( state . backtracking == 0 ) { before ( grammarAccess . getXAdditiveExpressionRule ( ) ) ; } pushFollow ( FOLLOW_1 ) ; ruleXAdditiveExpression ( ) ; state . _fsp -- ; if ( state . failed ) return ; if ( state . backtracking == 0 ) { after ( grammarAccess . getXAdditiveExpressionRule ( ) ) ; } match ( input , EOF , FOLLOW_2 ) ; if ( state . failed ) return ; } } catch ( RecognitionException re ) { reportError ( re ) ; recover ( input , re ) ; } finally { } return ;
public class DDLStatement { /** * Is DDL statement . * @ param primaryTokenType primary token type * @ param secondaryTokenType secondary token type * @ return is DDL or not */ public static boolean isDDL ( final TokenType primaryTokenType , final TokenType secondaryTokenType ) { } }
return PRIMARY_STATEMENT_PREFIX . contains ( primaryTokenType ) && ! NOT_SECONDARY_STATEMENT_PREFIX . contains ( secondaryTokenType ) ;
public class Searcher { /** * Links the given listener to the Searcher , which will forward new search results to it . * @ param resultListener an object implementing { @ link AlgoliaResultsListener } . */ public Searcher registerResultListener ( @ NonNull AlgoliaResultsListener resultListener ) { } }
if ( ! resultListeners . contains ( resultListener ) ) { resultListeners . add ( resultListener ) ; } return this ;
public class LayoutInflater { /** * Resolve ids for given name in each package ( android and application ) and then call { @ link # register ( int , int ) } */ public static void register ( Context context , String name ) { } }
final Resources res = context . getResources ( ) ; int androidId = res . getIdentifier ( name , "layout" , "android" ) ; int appId = res . getIdentifier ( name , "layout" , context . getPackageName ( ) ) ; if ( androidId != 0 && appId != 0 ) { register ( androidId , appId ) ; } else { HoloEverywhere . warn ( "Failed to register layout remapping:\n" + " Android ID: 0x%8x\n" + " Application ID: 0x%8x" , androidId , appId ) ; }
public class AjaxBehavior { /** * a String [ ] ( multiple elements . */ private static Object saveList ( List < String > list ) { } }
if ( ( list == null ) || list . isEmpty ( ) ) { return null ; } int size = list . size ( ) ; if ( size == 1 ) { return list . get ( 0 ) ; } return list . toArray ( new String [ size ] ) ;
public class PreferenceActivity { /** * Returns a listener , which allows to finish the last step , when the activity is used as a * wizard . * @ return The listener , which has been created , as an instance of the type { @ link * View . OnClickListener } . The listener may not be null */ @ NonNull private View . OnClickListener createFinishButtonListener ( ) { } }
return new View . OnClickListener ( ) { @ Override public void onClick ( final View v ) { notifyOnFinish ( ) ; } } ;
public class CheckSideEffects { /** * Protect side - effect free nodes by making them parameters * to a extern function call . This call will be removed * after all the optimizations passes have run . */ private void protectSideEffects ( ) { } }
if ( ! problemNodes . isEmpty ( ) ) { if ( ! preserveFunctionInjected ) { addExtern ( compiler ) ; } for ( Node n : problemNodes ) { Node name = IR . name ( PROTECTOR_FN ) . srcref ( n ) ; name . putBooleanProp ( Node . IS_CONSTANT_NAME , true ) ; Node replacement = IR . call ( name ) . srcref ( n ) ; replacement . putBooleanProp ( Node . FREE_CALL , true ) ; n . replaceWith ( replacement ) ; replacement . addChildToBack ( n ) ; compiler . reportChangeToEnclosingScope ( replacement ) ; } }
public class GeneratorRegistry { /** * Returns the variant types for a generated resource * @ param path * the path * @ return he variant types for a generated resource */ public Set < String > getGeneratedResourceVariantTypes ( String path ) { } }
Set < String > variantTypes = new HashSet < > ( ) ; ResourceGenerator generator = resolveResourceGenerator ( path ) ; if ( generator != null ) { if ( generator instanceof VariantResourceGenerator ) { Set < String > tempResult = ( ( VariantResourceGenerator ) generator ) . getAvailableVariants ( generator . getResolver ( ) . getResourcePath ( path ) ) . keySet ( ) ; if ( tempResult != null ) { variantTypes = tempResult ; } } else if ( generator instanceof LocaleAwareResourceGenerator ) { variantTypes = new HashSet < > ( ) ; variantTypes . add ( JawrConstant . LOCALE_VARIANT_TYPE ) ; } } return variantTypes ;
public class HazelcastClient { /** * Shuts down all the client HazelcastInstance created in this JVM . * To be more precise it shuts down the HazelcastInstances loaded using the same classloader this HazelcastClient has been * loaded with . * This method is mostly used for testing purposes . * @ see # getAllHazelcastClients ( ) */ public static void shutdownAll ( ) { } }
for ( HazelcastClientProxy proxy : CLIENTS . values ( ) ) { HazelcastClientInstanceImpl client = proxy . client ; if ( client == null ) { continue ; } proxy . client = null ; try { client . shutdown ( ) ; } catch ( Throwable ignored ) { EmptyStatement . ignore ( ignored ) ; } } OutOfMemoryErrorDispatcher . clearClients ( ) ; CLIENTS . clear ( ) ;
public class SymbolizerFilterVisitor { /** * Overridden to skip some symbolizers . */ @ Override public void visit ( Rule rule ) { } }
Rule copy = null ; Filter filterCopy = null ; if ( rule . getFilter ( ) != null ) { Filter filter = rule . getFilter ( ) ; filterCopy = copy ( filter ) ; } List < Symbolizer > symsCopy = new ArrayList < Symbolizer > ( ) ; for ( Symbolizer sym : rule . symbolizers ( ) ) { if ( ! skipSymbolizer ( sym ) ) { Symbolizer symCopy = copy ( sym ) ; symsCopy . add ( symCopy ) ; } } Graphic [ ] legendCopy = rule . getLegendGraphic ( ) ; for ( int i = 0 ; i < legendCopy . length ; i ++ ) { legendCopy [ i ] = copy ( legendCopy [ i ] ) ; } Description descCopy = rule . getDescription ( ) ; descCopy = copy ( descCopy ) ; copy = sf . createRule ( ) ; copy . symbolizers ( ) . addAll ( symsCopy ) ; copy . setDescription ( descCopy ) ; copy . setLegendGraphic ( legendCopy ) ; copy . setName ( rule . getName ( ) ) ; copy . setFilter ( filterCopy ) ; copy . setElseFilter ( rule . isElseFilter ( ) ) ; copy . setMaxScaleDenominator ( rule . getMaxScaleDenominator ( ) ) ; copy . setMinScaleDenominator ( rule . getMinScaleDenominator ( ) ) ; if ( STRICT && ! copy . equals ( rule ) ) { throw new IllegalStateException ( "Was unable to duplicate provided Rule:" + rule ) ; } pages . push ( copy ) ;
public class VisibleMemberMap { /** * Return the visible members of the class being mapped . Also append at the * end of the list members that are inherited by inaccessible parents . We * document these members in the child because the parent is not documented . * @ param configuration the current configuration of the doclet . */ public List < ProgramElementDoc > getLeafClassMembers ( Configuration configuration ) { } }
List < ProgramElementDoc > result = getMembersFor ( classdoc ) ; result . addAll ( getInheritedPackagePrivateMethods ( configuration ) ) ; return result ;
public class WindowedStream { /** * Applies the given window function to each window . The window function is called for each * evaluation of the window for each key individually . The output of the window function is * interpreted as a regular non - windowed stream . * < p > Arriving data is incrementally aggregated using the given fold function . * @ param initialValue The initial value of the fold . * @ param foldFunction The fold function that is used for incremental aggregation . * @ param function The window function . * @ return The data stream that is the result of applying the window function to the window . * @ deprecated use { @ link # aggregate ( AggregateFunction , WindowFunction ) } instead */ @ PublicEvolving @ Deprecated public < ACC , R > SingleOutputStreamOperator < R > fold ( ACC initialValue , FoldFunction < T , ACC > foldFunction , WindowFunction < ACC , R , K , W > function ) { } }
TypeInformation < ACC > foldAccumulatorType = TypeExtractor . getFoldReturnTypes ( foldFunction , input . getType ( ) , Utils . getCallLocationName ( ) , true ) ; TypeInformation < R > resultType = getWindowFunctionReturnType ( function , foldAccumulatorType ) ; return fold ( initialValue , foldFunction , function , foldAccumulatorType , resultType ) ;
public class AppServiceEnvironmentsInner { /** * Get all worker pools of an App Service Environment . * Get all worker pools of an App Service Environment . * @ param resourceGroupName Name of the resource group to which the resource belongs . * @ param name Name of the App Service Environment . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the PagedList & lt ; WorkerPoolResourceInner & gt ; object */ public Observable < ServiceResponse < Page < WorkerPoolResourceInner > > > listWorkerPoolsWithServiceResponseAsync ( final String resourceGroupName , final String name ) { } }
return listWorkerPoolsSinglePageAsync ( resourceGroupName , name ) . concatMap ( new Func1 < ServiceResponse < Page < WorkerPoolResourceInner > > , Observable < ServiceResponse < Page < WorkerPoolResourceInner > > > > ( ) { @ Override public Observable < ServiceResponse < Page < WorkerPoolResourceInner > > > call ( ServiceResponse < Page < WorkerPoolResourceInner > > page ) { String nextPageLink = page . body ( ) . nextPageLink ( ) ; if ( nextPageLink == null ) { return Observable . just ( page ) ; } return Observable . just ( page ) . concatWith ( listWorkerPoolsNextWithServiceResponseAsync ( nextPageLink ) ) ; } } ) ;
public class SM2 { /** * 设置加密类型 * @ param mode { @ link SM2Mode } * @ return this */ public SM2 setMode ( SM2Mode mode ) { } }
this . mode = mode ; if ( null != this . engine ) { this . engine . setMode ( mode ) ; } return this ;
public class GenClassCompiler { /** * Handles initializer , constructor and other common annotation compilations . * < p > Common handled annotations are : @ GenRegex * @ throws IOException */ @ Override public void compile ( ) throws IOException { } }
compileInitializers ( ) ; compileConstructors ( ) ; for ( ExecutableElement method : ElementFilter . methodsIn ( El . getAllMembers ( superClass ) ) ) { MathExpression mathExpression = method . getAnnotation ( MathExpression . class ) ; if ( mathExpression != null ) { compileMathExpression ( method , mathExpression ) ; } }
public class ExtendedProperties { /** * Looks up a property . Recursively checks the defaults if necessary . Internally , * { @ code get ( key , true ) } is called to look up the value . * @ param key * The property key * @ param defaultValue * The value returned if the property is not found * @ return The property value , or the specified default value if the property is not found */ public String get ( final Object key , final String defaultValue ) { } }
String val = get ( key , true ) ; return val == null ? defaultValue : val ;
public class ClosableBlockingQueue { /** * Gets all the elements found in the list , or blocks until at least one element * was added . If the queue is empty when this method is called , it blocks until * at least one element is added . * < p > This method always returns a list with at least one element . * < p > The method throws an { @ code IllegalStateException } if the queue is closed . * Checking whether the queue is open and removing the next element is one atomic operation . * @ return A list with all elements in the queue , always at least one element . * @ throws IllegalStateException Thrown , if the queue is closed . * @ throws InterruptedException Throw , if the thread is interrupted while waiting for an * element to be added . */ public List < E > getBatchBlocking ( ) throws InterruptedException { } }
lock . lock ( ) ; try { while ( open && elements . isEmpty ( ) ) { nonEmpty . await ( ) ; } if ( open ) { ArrayList < E > result = new ArrayList < > ( elements ) ; elements . clear ( ) ; return result ; } else { throw new IllegalStateException ( "queue is closed" ) ; } } finally { lock . unlock ( ) ; }
public class Matrix4d { /** * / * ( non - Javadoc ) * @ see org . joml . Matrix4dc # invertFrustum ( org . joml . Matrix4d ) */ public Matrix4d invertFrustum ( Matrix4d dest ) { } }
double invM00 = 1.0 / m00 ; double invM11 = 1.0 / m11 ; double invM23 = 1.0 / m23 ; double invM32 = 1.0 / m32 ; dest . set ( invM00 , 0 , 0 , 0 , 0 , invM11 , 0 , 0 , 0 , 0 , 0 , invM32 , - m20 * invM00 * invM23 , - m21 * invM11 * invM23 , invM23 , - m22 * invM23 * invM32 ) ; return dest ;
public class NgramsExtractor { /** * This method gets as input a string and returns as output a map with the * extracted keywords along with the number of their scores in the text . Their * scores are a combination of occurrences and proximity metrics . * @ param text * @ return */ @ Override public Map < String , Double > extract ( final String text ) { } }
Map < Integer , String > ID2word = new HashMap < > ( ) ; // ID = > Kwd Map < Integer , Double > ID2occurrences = new HashMap < > ( ) ; // ID = > counts / scores Map < Integer , Integer > position2ID = new LinkedHashMap < > ( ) ; // word position = > ID maintain the order of insertation int numberOfWordsInDoc = buildInternalArrays ( text , ID2word , ID2occurrences , position2ID ) ; int maxCombinations = parameters . getMaxCombinations ( ) ; Map < String , Double > keywordsMap = new HashMap < > ( ) ; // move the " window " across the document by 1 word at each time for ( Map . Entry < Integer , Integer > entry : position2ID . entrySet ( ) ) { Integer wordID = entry . getValue ( ) ; if ( ! useThisWord ( wordID , ID2word , ID2occurrences ) ) { continue ; } Integer position = entry . getKey ( ) ; // Build all the combinations of the current word with other words within the window and estimate the scores Map < LinkedList < Integer > , Double > positionCombinationsWithScores = getPositionCombinationsWithinWindow ( position , maxCombinations , ID2word , ID2occurrences , position2ID , numberOfWordsInDoc ) ; // Convert the positions into words and aggregate over their scores . for ( Map . Entry < LinkedList < Integer > , Double > entry2 : positionCombinationsWithScores . entrySet ( ) ) { LinkedList < Integer > positionCombination = entry2 . getKey ( ) ; StringBuilder sb = new StringBuilder ( positionCombination . size ( ) * 6 ) ; for ( Integer pos : positionCombination ) { sb . append ( ID2word . get ( position2ID . get ( pos ) ) ) . append ( " " ) ; } if ( sb . length ( ) > 0 ) { String key = sb . toString ( ) . trim ( ) ; double score = entry2 . getValue ( ) ; keywordsMap . put ( key , keywordsMap . getOrDefault ( key , 0.0 ) + score ) ; } } } // remove any word that has score less than the min occurrence double minScore = parameters . getMinWordOccurrence ( ) ; Iterator < Map . Entry < String , Double > > it = keywordsMap . entrySet ( ) . iterator ( ) ; while ( it . hasNext ( ) ) { Map . Entry < String , Double > entry = it . next ( ) ; if ( entry . getValue ( ) < minScore ) { it . remove ( ) ; } } return keywordsMap ;
public class LeaderCache { /** * Update a modified child and republish a new snapshot . This may indicate * a deleted child or a child with modified data . */ private void processChildEvent ( WatchedEvent event ) throws Exception { } }
HashMap < Integer , LeaderCallBackInfo > cacheCopy = new HashMap < Integer , LeaderCallBackInfo > ( m_publicCache ) ; ByteArrayCallback cb = new ByteArrayCallback ( ) ; m_zk . getData ( event . getPath ( ) , m_childWatch , cb , null ) ; try { // cb . getData ( ) and cb . getPath ( ) throw KeeperException byte payload [ ] = cb . get ( ) ; String data = new String ( payload , "UTF-8" ) ; LeaderCallBackInfo info = LeaderCache . buildLeaderCallbackFromString ( data ) ; Integer partitionId = getPartitionIdFromZKPath ( cb . getPath ( ) ) ; cacheCopy . put ( partitionId , info ) ; } catch ( KeeperException . NoNodeException e ) { // rtb : I think result ' s path is the same as cb . getPath ( ) ? Integer partitionId = getPartitionIdFromZKPath ( event . getPath ( ) ) ; cacheCopy . remove ( partitionId ) ; } m_publicCache = ImmutableMap . copyOf ( cacheCopy ) ; if ( m_cb != null ) { m_cb . run ( m_publicCache ) ; }
public class ListBillingGroupsResult { /** * The list of billing groups . * @ param billingGroups * The list of billing groups . */ public void setBillingGroups ( java . util . Collection < GroupNameAndArn > billingGroups ) { } }
if ( billingGroups == null ) { this . billingGroups = null ; return ; } this . billingGroups = new java . util . ArrayList < GroupNameAndArn > ( billingGroups ) ;
public class Sentence { /** * Adds a { @ link Token } to this { @ link Sentence } . Normally called by instances of { @ link Tokenizer } . * @ param token */ public void addToken ( Token token ) { } }
// Add verification of no token overlap if ( ! token . getSentence ( ) . equals ( this ) ) throw new IllegalArgumentException ( ) ; tokens . add ( token ) ;
public class DualPivotQuicksort { /** * Sorts the specified range of the array . * @ param a the array to be sorted * @ param left the index of the first element , inclusive , to be sorted * @ param right the index of the last element , inclusive , to be sorted */ static void sort ( byte [ ] a , int left , int right ) { } }
// Use counting sort on large arrays if ( right - left > COUNTING_SORT_THRESHOLD_FOR_BYTE ) { int [ ] count = new int [ NUM_BYTE_VALUES ] ; for ( int i = left - 1 ; ++ i <= right ; count [ a [ i ] - Byte . MIN_VALUE ] ++ ) ; for ( int i = NUM_BYTE_VALUES , k = right + 1 ; k > left ; ) { while ( count [ -- i ] == 0 ) ; byte value = ( byte ) ( i + Byte . MIN_VALUE ) ; int s = count [ i ] ; do { a [ -- k ] = value ; } while ( -- s > 0 ) ; } } else { // Use insertion sort on small arrays for ( int i = left , j = i ; i < right ; j = ++ i ) { byte ai = a [ i + 1 ] ; while ( ai < a [ j ] ) { a [ j + 1 ] = a [ j ] ; if ( j -- == left ) { break ; } } a [ j + 1 ] = ai ; } }
public class Slider { /** * An EL expression referring to a server side UIComponent instance in a backing bean . < P > * @ return Returns the value of the attribute , or null , if it hasn ' t been set by the JSF file . */ public javax . faces . component . UIComponent getBinding ( ) { } }
return ( javax . faces . component . UIComponent ) getStateHelper ( ) . eval ( PropertyKeys . binding ) ;
public class SubscriptionUsagesInner { /** * Gets a subscription usage metric . * @ param locationName The name of the region where the resource is located . * @ param usageName Name of usage metric to return . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the SubscriptionUsageInner object */ public Observable < SubscriptionUsageInner > getAsync ( String locationName , String usageName ) { } }
return getWithServiceResponseAsync ( locationName , usageName ) . map ( new Func1 < ServiceResponse < SubscriptionUsageInner > , SubscriptionUsageInner > ( ) { @ Override public SubscriptionUsageInner call ( ServiceResponse < SubscriptionUsageInner > response ) { return response . body ( ) ; } } ) ;
public class CmsObjectWrapper { /** * Delegate method for { @ link CmsObject # readResource ( CmsUUID , CmsResourceFilter ) } . < p > * @ see CmsObject # readResource ( CmsUUID , CmsResourceFilter ) * @ param structureID the ID of the structure to read * @ param filter the resource filter to use while reading * @ return the resource that was read * @ throws CmsException if the resource could not be read for any reason */ public CmsResource readResource ( CmsUUID structureID , CmsResourceFilter filter ) throws CmsException { } }
return m_cms . readResource ( structureID , filter ) ;
public class ServiceRegistry { /** * Returns a Set of all property name String ( s ) in { @ link ServicePropertyNames } * @ return a set of all { @ link ServicePropertyNames } String values */ protected static Set < String > getAllServicePropertyNames ( ) { } }
/* Not clear it adds value to expose this publicly , especially with the odd * J2SE _ MODE in here . */ HashSet < String > retVal = new HashSet < String > ( ) ; retVal . add ( ServicePropertyNames . BATCH_THREADPOOL_SERVICE ) ; retVal . add ( ServicePropertyNames . CONTAINER_ARTIFACT_FACTORY_SERVICE ) ; retVal . add ( ServicePropertyNames . DELEGATING_ARTIFACT_FACTORY_SERVICE ) ; retVal . add ( ServicePropertyNames . DELEGATING_JOBXML_LOADER_SERVICE ) ; retVal . add ( ServicePropertyNames . J2SE_MODE ) ; retVal . add ( ServicePropertyNames . JOBXML_LOADER_SERVICE ) ; retVal . add ( ServicePropertyNames . TRANSACTION_SERVICE ) ; return retVal ;
public class WRepeater { /** * Retrieves the row id for the given row . * @ param rowBean the row ' s data . * @ return the id for the given row . Defaults to the row data . */ protected Object getRowId ( final Object rowBean ) { } }
String rowIdProperty = getComponentModel ( ) . rowIdProperty ; if ( rowIdProperty == null || rowBean == null ) { return rowBean ; } try { return PropertyUtils . getProperty ( rowBean , rowIdProperty ) ; } catch ( Exception e ) { LOG . error ( "Failed to read row property \"" + rowIdProperty + "\" on " + rowBean , e ) ; return rowBean ; }
public class GRLINERGImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public boolean eIsSet ( int featureID ) { } }
switch ( featureID ) { case AfplibPackage . GRLINERG__XOSSF : return XOSSF_EDEFAULT == null ? xossf != null : ! XOSSF_EDEFAULT . equals ( xossf ) ; case AfplibPackage . GRLINERG__YOFFS : return YOFFS_EDEFAULT == null ? yoffs != null : ! YOFFS_EDEFAULT . equals ( yoffs ) ; } return super . eIsSet ( featureID ) ;
public class UsersWriter { /** * Append the core fields of the user to the string . * @ param builder the string builder * @ param user the user whose core fields we ' ll add to the string */ private void appendUserInfoFields ( final StringBuilder builder , final User user ) { } }
append ( builder , user . getUsername ( ) , "," ) ; append ( builder , user . getFirstname ( ) , "," ) ; append ( builder , user . getLastname ( ) , "," ) ; append ( builder , user . getEmail ( ) , "," ) ; append ( builder , user . getPassword ( ) , "" ) ;
public class SocketFactory { /** * Set the server socket configuration to our required * QOS values . * A small experiment shows that setting either ( want , need ) parameter to either true or false sets the * other parameter to false . * @ param serverSocket * The newly created SSLServerSocket . * @ param sslConfigName name of the sslConfig used to select cipher suites * @ param options supported / required flags * @ throws IOException if server socket can ' t be configured * @ throws SSLException */ private void configureServerSocket ( SSLServerSocket serverSocket , SSLServerSocketFactory serverSocketFactory , String sslConfigName , OptionsKey options ) throws IOException { } }
try { String [ ] cipherSuites = sslConfig . getCipherSuites ( sslConfigName , serverSocketFactory . getSupportedCipherSuites ( ) ) ; serverSocket . setEnabledCipherSuites ( cipherSuites ) ; // set the SSL protocol on the server socket String protocol = sslConfig . getSSLProtocol ( sslConfigName ) ; if ( protocol != null ) serverSocket . setEnabledProtocols ( new String [ ] { protocol } ) ; boolean clientAuthRequired = ( ( options . requires & EstablishTrustInClient . value ) == EstablishTrustInClient . value ) ; boolean clientAuthSupported = ( ( options . supports & EstablishTrustInClient . value ) == EstablishTrustInClient . value ) ; if ( clientAuthRequired ) { serverSocket . setNeedClientAuth ( true ) ; } else if ( clientAuthSupported ) { serverSocket . setWantClientAuth ( true ) ; } else { serverSocket . setNeedClientAuth ( false ) ; // could set want with the same effect } serverSocket . setSoTimeout ( 60 * 1000 ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . debug ( tc , "Created SSL server socket on port " + serverSocket . getLocalPort ( ) ) ; Tr . debug ( tc , " client authentication " + ( clientAuthSupported ? "SUPPORTED" : "UNSUPPORTED" ) ) ; Tr . debug ( tc , " client authentication " + ( clientAuthRequired ? "REQUIRED" : "OPTIONAL" ) ) ; Tr . debug ( tc , " cipher suites:" ) ; for ( int i = 0 ; i < cipherSuites . length ; i ++ ) { Tr . debug ( tc , " " + cipherSuites [ i ] ) ; } } } catch ( SSLException e ) { throw new IOException ( "Could not configure server socket" , e ) ; }
public class ImageClient { /** * Retrieves the list of custom images available to the specified project . Custom images are * images you create that belong to your project . This method does not get any images that belong * to other projects , including publicly - available images , like Debian 8 . If you want to get a * list of publicly - available images , use this method to make a request to the respective image * project , such as debian - cloud or windows - cloud . * < p > Sample code : * < pre > < code > * try ( ImageClient imageClient = ImageClient . create ( ) ) { * ProjectName project = ProjectName . of ( " [ PROJECT ] " ) ; * for ( Image element : imageClient . listImages ( project . toString ( ) ) . iterateAll ( ) ) { * / / doThingsWith ( element ) ; * < / code > < / pre > * @ param project Project ID for this request . * @ throws com . google . api . gax . rpc . ApiException if the remote call fails */ @ BetaApi public final ListImagesPagedResponse listImages ( String project ) { } }
ListImagesHttpRequest request = ListImagesHttpRequest . newBuilder ( ) . setProject ( project ) . build ( ) ; return listImages ( request ) ;
public class VecmathUtil { /** * Sum the components of two vectors , the input is not modified . * @ param a first vector * @ param b second vector * @ return scaled vector */ static Vector2d sum ( final Tuple2d a , final Tuple2d b ) { } }
return new Vector2d ( a . x + b . x , a . y + b . y ) ;
public class AstFactory { /** * Creates a statement declaring a const alias for " this " to be used in the given function node . * < p > e . g . ` const aliasName = this ; ` */ Node createThisAliasDeclarationForFunction ( String aliasName , Node functionNode ) { } }
return createSingleConstNameDeclaration ( aliasName , createThis ( getTypeOfThisForFunctionNode ( functionNode ) ) ) ;
public class FileUtil { /** * Copy FileSystem files to local files . */ public static boolean copy ( FileSystem srcFS , Path src , File dst , boolean deleteSource , Configuration conf ) throws IOException { } }
return copy ( srcFS , src , dst , deleteSource , conf , false , 0L ) ;
public class Compiler { /** * Compiles multiple sources file and loads the classes . * @ param sourceFiles the source files to compile . * @ param parentLoader the parent class loader to use when loading classes . * @ return a map of compiled classes . This maps class names to * Class objects . * @ throws Exception */ private Class < ? > compileSource0 ( String className , String sourceCode ) throws Exception { } }
List < MemorySourceJavaFileObject > compUnits = new ArrayList < MemorySourceJavaFileObject > ( 1 ) ; compUnits . add ( new MemorySourceJavaFileObject ( className + ".java" , sourceCode ) ) ; DiagnosticCollector < JavaFileObject > diag = new DiagnosticCollector < JavaFileObject > ( ) ; Boolean result = compiler . getTask ( null , fileManager , diag , compilerOptions , null , compUnits ) . call ( ) ; if ( result . equals ( Boolean . FALSE ) ) { throw new RuntimeException ( diag . getDiagnostics ( ) . toString ( ) ) ; } try { String classDotName = className . replace ( '/' , '.' ) ; return Class . forName ( classDotName , true , loader ) ; } catch ( ClassNotFoundException e ) { throw e ; }
public class ClassServiceUtility { /** * Create this object given the class name . * @ param className * @ return */ public Object makeObjectFromClassName ( String className , String version , boolean bErrorIfNotFound ) throws RuntimeException { } }
if ( className == null ) return null ; className = ClassServiceUtility . getFullClassName ( className ) ; Class < ? > clazz = null ; try { clazz = Class . forName ( className ) ; } catch ( ClassNotFoundException e ) { if ( this . getClassFinder ( null ) != null ) clazz = this . getClassFinder ( null ) . findClass ( className , version ) ; // Try to find this class in the obr repos if ( clazz == null ) if ( bErrorIfNotFound ) throw new RuntimeException ( e . getMessage ( ) ) ; } Object object = null ; try { if ( clazz != null ) object = clazz . newInstance ( ) ; } catch ( InstantiationException e ) { if ( bErrorIfNotFound ) throw new RuntimeException ( e . getMessage ( ) ) ; } catch ( IllegalAccessException e ) { if ( bErrorIfNotFound ) throw new RuntimeException ( e . getMessage ( ) ) ; } catch ( Exception e ) { if ( bErrorIfNotFound ) throw new RuntimeException ( e . getMessage ( ) ) ; } return object ;
public class ResourceServlet { /** * Reconfigures default welcome pages with ones provided externally * @ param welcomePages */ public void configureWelcomeFiles ( List < String > welcomePages ) { } }
this . welcomePages = welcomePages ; ( ( ResourceHandler ) handler ) . setWelcomeFiles ( ) ; ( ( ResourceHandler ) handler ) . addWelcomeFiles ( welcomePages . toArray ( new String [ welcomePages . size ( ) ] ) ) ;
public class ESIndexer { /** * Builds the result map . * @ param esResponseReader * the es response reader * @ param response * the response * @ param query * the query * @ param m * the m * @ param metaModel * the meta model * @ return the map */ private Map < String , Object > buildResultMap ( SearchResponse response , KunderaQuery query , EntityMetadata m , MetamodelImpl metaModel ) { } }
Map < String , Object > map = new LinkedHashMap < > ( ) ; ESResponseWrapper esResponseReader = new ESResponseWrapper ( ) ; for ( SearchHit hit : response . getHits ( ) ) { Object id = PropertyAccessorHelper . fromSourceToTargetClass ( ( ( AbstractAttribute ) m . getIdAttribute ( ) ) . getBindableJavaType ( ) , String . class , hit . getId ( ) ) ; map . put ( hit . getId ( ) , id ) ; } Map < String , Object > aggMap = esResponseReader . parseAggregations ( response , query , metaModel , m . getEntityClazz ( ) , m ) ; ListIterable < Expression > selectExpressionOrder = esResponseReader . getSelectExpressionOrder ( query ) ; Map < String , Object > resultMap = new HashMap < > ( ) ; resultMap . put ( Constants . AGGREGATIONS , aggMap ) ; resultMap . put ( Constants . PRIMARY_KEYS , map ) ; resultMap . put ( Constants . SELECT_EXPRESSION_ORDER , selectExpressionOrder ) ; return resultMap ;
public class IslamicChronology { /** * Serialization singleton . */ private Object readResolve ( ) { } }
Chronology base = getBase ( ) ; return base == null ? getInstanceUTC ( ) : getInstance ( base . getZone ( ) ) ;
public class RecordingReader { /** * Make the request to the Twilio API to perform the read . * @ param client TwilioRestClient with which to make the request * @ return Recording ResourceSet */ @ Override public ResourceSet < Recording > read ( final TwilioRestClient client ) { } }
return new ResourceSet < > ( this , client , firstPage ( client ) ) ;
public class BasicWebsite { /** * Remove the ' / ' at the beginning and ending . * @ param target target string . * @ return rule result . */ protected String trimSlash ( @ NonNull String target ) { } }
target = trimStartSlash ( target ) ; target = trimEndSlash ( target ) ; return target ;