signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class BasicHttpClient { /** * This is the http request builder for file uploads , using Apache Http Client . In case you want to build * or prepare the requests differently , you can override this method . * Note - * With file uploads you can send more headers too from the testcase to the server , except " Content - Type " because * this is reserved for " multipart / form - data " which the client sends to server during the file uploads . You can * also send more request - params and " boundary " from the test cases if needed . The boundary defaults to an unique * string of local - date - time - stamp if not provided in the request . * You can override this method via @ UseHttpClient ( YourCustomHttpClient . class ) * @ param httpUrl * @ param methodName * @ param reqBodyAsString * @ return * @ throws IOException */ public RequestBuilder createFileUploadRequestBuilder ( String httpUrl , String methodName , String reqBodyAsString ) throws IOException { } }
Map < String , Object > fileFieldNameValueMap = getFileFieldNameValue ( reqBodyAsString ) ; List < String > fileFieldsList = ( List < String > ) fileFieldNameValueMap . get ( FILES_FIELD ) ; MultipartEntityBuilder multipartEntityBuilder = MultipartEntityBuilder . create ( ) ; /* * Allow fileFieldsList to be null . * fileFieldsList can be null if multipart / form - data is sent without any files * Refer Issue # 168 - Raised and fixed by santhoshTpixler */ if ( fileFieldsList != null ) { buildAllFilesToUpload ( fileFieldsList , multipartEntityBuilder ) ; } buildOtherRequestParams ( fileFieldNameValueMap , multipartEntityBuilder ) ; buildMultiPartBoundary ( fileFieldNameValueMap , multipartEntityBuilder ) ; return createUploadRequestBuilder ( httpUrl , methodName , multipartEntityBuilder ) ;
public class StringConvert { /** * Tries to register ThreeTen ThreeTen / JSR - 310 classes v0.6.3 and beyond . */ private void tryRegisterThreeTenOld ( ) { } }
try { tryRegister ( "javax.time.Instant" , "parse" ) ; tryRegister ( "javax.time.Duration" , "parse" ) ; tryRegister ( "javax.time.calendar.LocalDate" , "parse" ) ; tryRegister ( "javax.time.calendar.LocalTime" , "parse" ) ; tryRegister ( "javax.time.calendar.LocalDateTime" , "parse" ) ; tryRegister ( "javax.time.calendar.OffsetDate" , "parse" ) ; tryRegister ( "javax.time.calendar.OffsetTime" , "parse" ) ; tryRegister ( "javax.time.calendar.OffsetDateTime" , "parse" ) ; tryRegister ( "javax.time.calendar.ZonedDateTime" , "parse" ) ; tryRegister ( "javax.time.calendar.Year" , "parse" ) ; tryRegister ( "javax.time.calendar.YearMonth" , "parse" ) ; tryRegister ( "javax.time.calendar.MonthDay" , "parse" ) ; tryRegister ( "javax.time.calendar.Period" , "parse" ) ; tryRegister ( "javax.time.calendar.ZoneOffset" , "of" ) ; tryRegister ( "javax.time.calendar.ZoneId" , "of" ) ; tryRegister ( "javax.time.calendar.TimeZone" , "of" ) ; } catch ( Throwable ex ) { if ( LOG ) { System . err . println ( "tryRegisterThreeTenOld: " + ex ) ; } }
public class ImageSizeUtils { /** * Computes minimal sample size for downscaling image so result image size won ' t exceed max acceptable OpenGL * texture size . < br / > * We can ' t create Bitmap in memory with size exceed max texture size ( usually this is 2048x2048 ) so this method * calculate minimal sample size which should be applied to image to fit into these limits . * @ param srcSize Original image size * @ return Minimal sample size */ public static int computeMinImageSampleSize ( ImageSize srcSize ) { } }
final int srcWidth = srcSize . getWidth ( ) ; final int srcHeight = srcSize . getHeight ( ) ; final int targetWidth = maxBitmapSize . getWidth ( ) ; final int targetHeight = maxBitmapSize . getHeight ( ) ; final int widthScale = ( int ) Math . ceil ( ( float ) srcWidth / targetWidth ) ; final int heightScale = ( int ) Math . ceil ( ( float ) srcHeight / targetHeight ) ; return Math . max ( widthScale , heightScale ) ; // max
public class DeviceImpl { /** * Write some attributes . IDL 4 version * @ param values a container for attribute values . * @ param clIdent the client ID * @ throws DevFailed */ @ Override public void write_attributes_4 ( final AttributeValue_4 [ ] values , final ClntIdent clIdent ) throws MultiDevFailed , DevFailed { } }
MDC . setContextMap ( contextMap ) ; xlogger . entry ( ) ; checkInitialization ( ) ; final String [ ] names = new String [ values . length ] ; for ( int i = 0 ; i < names . length ; i ++ ) { names [ i ] = values [ i ] . name ; } logger . debug ( "writing {}" , Arrays . toString ( names ) ) ; deviceMonitoring . startRequest ( "write_attributes_4 " + Arrays . toString ( names ) , clIdent ) ; clientIdentity . set ( clIdent ) ; if ( ! name . equalsIgnoreCase ( getAdminDeviceName ( ) ) ) { clientLocking . checkClientLocking ( clIdent , names ) ; } final Object lock = deviceLock . getAttributeLock ( ) ; try { synchronized ( lock != null ? lock : new Object ( ) ) { AttributeGetterSetter . setAttributeValue4 ( values , attributeList , stateImpl , aroundInvokeImpl , clIdent ) ; } } catch ( final Exception e ) { deviceMonitoring . addError ( ) ; if ( e instanceof MultiDevFailed ) { throw ( MultiDevFailed ) e ; } else { // with CORBA , the stack trace is not visible by the client if // not inserted in DevFailed . throw DevFailedUtils . newDevFailed ( e ) ; } } xlogger . exit ( ) ;
public class EmoPermission { /** * Override the logic in the parent to meet the requirements for EmoPermission . */ @ Override protected MatchingPart toPart ( List < MatchingPart > leadingParts , String part ) { } }
switch ( leadingParts . size ( ) ) { case 0 : // The first part must either be a constant or a pure wildcard ; expressions such as // < code > if ( or ( " sor " , " blob " ) ) < / code > are not permitted . MatchingPart resolvedPart = createEmoPermissionPart ( part , PartType . CONTEXT ) ; checkArgument ( resolvedPart instanceof ConstantPart || resolvedPart . impliesAny ( ) , "First part must be a constant or pure wildcard" ) ; return resolvedPart ; case 1 : // If the first part was a pure wildcard then there cannot be a second part ; expressions such as // " * | create _ table " are not permitted . checkArgument ( ! MatchingPart . getContext ( leadingParts ) . impliesAny ( ) , "Cannot narrow permission without initial scope" ) ; return createEmoPermissionPart ( part , PartType . ACTION ) ; case 2 : // For sor and blob permissions the third part narrows to a table . Otherwise it narrows to a // named resource such as a queue name or databus subscription . PartType partType ; if ( MatchingPart . contextImpliedBy ( SOR_PART , leadingParts ) ) { partType = PartType . SOR_TABLE ; } else if ( MatchingPart . contextImpliedBy ( BLOB_PART , leadingParts ) ) { partType = PartType . BLOB_TABLE ; } else { partType = PartType . NAMED_RESOURCE ; } return createEmoPermissionPart ( part , partType ) ; case 3 : // Only roles support four parts , where the group is the third part and the role ID is the fourth part . if ( MatchingPart . contextImpliedBy ( ROLE_PART , leadingParts ) ) { return createEmoPermissionPart ( part , PartType . NAMED_RESOURCE ) ; } break ; } throw new IllegalArgumentException ( format ( "Too many parts for EmoPermission in \"%s\" context" , MatchingPart . getContext ( leadingParts ) ) ) ;
public class BoardView { /** * Adds a column at the last index of the board . * @ param adapter Adapter with the items for the column . * @ param header Header view that will be positioned above the column . Can be null . * @ param columnDragView View that will act as handle to drag and drop columns . Can be null . * @ param hasFixedItemSize If the items will have a fixed or dynamic size . * @ return The created DragItemRecyclerView . */ public DragItemRecyclerView addColumn ( final DragItemAdapter adapter , final @ Nullable View header , @ Nullable View columnDragView , boolean hasFixedItemSize ) { } }
final DragItemRecyclerView recyclerView = insertColumn ( adapter , getColumnCount ( ) , header , hasFixedItemSize ) ; setupColumnDragListener ( columnDragView , recyclerView ) ; return recyclerView ;
public class DescribeSessionsRequest { /** * One or more filters to limit the type of sessions returned by the request . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setFilters ( java . util . Collection ) } or { @ link # withFilters ( java . util . Collection ) } if you want to override * the existing values . * @ param filters * One or more filters to limit the type of sessions returned by the request . * @ return Returns a reference to this object so that method calls can be chained together . */ public DescribeSessionsRequest withFilters ( SessionFilter ... filters ) { } }
if ( this . filters == null ) { setFilters ( new com . amazonaws . internal . SdkInternalList < SessionFilter > ( filters . length ) ) ; } for ( SessionFilter ele : filters ) { this . filters . add ( ele ) ; } return this ;
public class ClassDependency { /** * Adds the int to the digest . */ private static long addDigest ( long digest , long v ) { } }
digest = Crc64 . generate ( digest , ( byte ) ( v >> 24 ) ) ; digest = Crc64 . generate ( digest , ( byte ) ( v >> 16 ) ) ; digest = Crc64 . generate ( digest , ( byte ) ( v >> 8 ) ) ; digest = Crc64 . generate ( digest , ( byte ) v ) ; return digest ;
public class CASableTreeFileValueStorage { /** * { @ inheritDoc } */ @ Override public FileIOChannel openIOChannel ( ) throws IOException { } }
return new CASableTreeFileIOChannel ( rootDir , cleaner , getId ( ) , resources , vcas , digestAlgo ) ;
public class DatabasesInner { /** * Creates or updates a database . * @ param resourceGroupName The name of the resource group containing the Kusto cluster . * @ param clusterName The name of the Kusto cluster . * @ param databaseName The name of the database in the Kusto cluster . * @ param parameters The database parameters supplied to the CreateOrUpdate operation . * @ param serviceCallback the async ServiceCallback to handle successful and failed responses . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the { @ link ServiceFuture } object */ public ServiceFuture < DatabaseInner > beginCreateOrUpdateAsync ( String resourceGroupName , String clusterName , String databaseName , DatabaseInner parameters , final ServiceCallback < DatabaseInner > serviceCallback ) { } }
return ServiceFuture . fromResponse ( beginCreateOrUpdateWithServiceResponseAsync ( resourceGroupName , clusterName , databaseName , parameters ) , serviceCallback ) ;
public class LightBulb { /** * Sets the direction of the lightbulb . Use the constants defined in SwingUtilities * SwingUtilities . NORTH * SwingUtilities . EAST * SwingUtiltites . SOUTH * SwingUtilities . WEST * @ param DIRECTION */ public void setDirection ( final int DIRECTION ) { } }
switch ( DIRECTION ) { case SwingUtilities . SOUTH : direction = SwingUtilities . SOUTH ; break ; case SwingUtilities . EAST : direction = SwingUtilities . EAST ; break ; case SwingUtilities . WEST : direction = SwingUtilities . WEST ; break ; case SwingUtilities . NORTH : default : direction = SwingUtilities . NORTH ; break ; } repaint ( getInnerBounds ( ) ) ;
public class DomainControllerData { /** * Read the domain controller ' s data from an input stream . * @ param instream the input stream * @ throws Exception */ public void readFrom ( DataInput instream ) throws Exception { } }
host = S3Util . readString ( instream ) ; port = instream . readInt ( ) ; protocol = S3Util . readString ( instream ) ;
public class MpTransactionState { /** * Kill a transaction - maybe shutdown mid - transaction ? Or a timeout * collecting fragments ? This is a don ' t - know - what - to - do - yet * stub . * TODO : fix this . */ @ Override public void terminateTransaction ( ) { } }
if ( tmLog . isDebugEnabled ( ) ) { tmLog . debug ( "Aborting transaction: " + TxnEgo . txnIdToString ( txnId ) ) ; } FragmentTaskMessage dummy = new FragmentTaskMessage ( 0L , 0L , 0L , 0L , false , false , false , m_nPartTxn , m_restartTimestamp ) ; FragmentResponseMessage poison = new FragmentResponseMessage ( dummy , 0L ) ; TransactionTerminationException termination = new TransactionTerminationException ( "Transaction interrupted." , txnId ) ; poison . setStatus ( FragmentResponseMessage . TERMINATION , termination ) ; offerReceivedFragmentResponse ( poison ) ;
public class PatternToken { /** * Checks whether an exception for a previous token matches all readings of a given token ( in case * the exception had scope = = " previous " ) . * @ param prevToken { @ link AnalyzedTokenReadings } to check matching against . * @ return true if any of the exceptions matches . */ public boolean isMatchedByPreviousException ( AnalyzedTokenReadings prevToken ) { } }
for ( AnalyzedToken analyzedToken : prevToken ) { if ( isMatchedByPreviousException ( analyzedToken ) ) { return true ; } } return false ;
public class JSONObject { /** * Get an optional string associated with a key . It returns the defaultValue * if there is no such key . * @ param key * A key string . * @ param defaultValue * The default . * @ return A string which is the value . */ public String optString ( Enum < ? > key , String defaultValue ) { } }
return optString ( key . name ( ) , defaultValue ) ;
public class CmsPopup { /** * Insert a new child Widget into this Panel at a specified index , attaching * its Element to the specified container Element . The child Element will * either be attached to the container at the same index , or simply appended * to the container , depending on the value of < code > domInsert < / code > . * @ param child the child Widget to be added * @ param container the Element within which < code > child < / code > will be * contained * @ param beforeIndex the index before which < code > child < / code > will be * inserted * @ param domInsert if < code > true < / code > , insert < code > child < / code > into * < code > container < / code > at < code > beforeIndex < / code > ; otherwise * append < code > child < / code > to the end of < code > container < / code > . */ protected void insert ( Widget child , Element container , int beforeIndex , boolean domInsert ) { } }
// Validate index ; adjust if the widget is already a child of this panel . beforeIndex = adjustIndex ( child , beforeIndex ) ; // Detach new child . child . removeFromParent ( ) ; // Logical attach . getChildren ( ) . insert ( child , beforeIndex ) ; // Physical attach . if ( domInsert ) { DOM . insertChild ( container , child . getElement ( ) , beforeIndex ) ; } else { DOM . appendChild ( container , child . getElement ( ) ) ; } // Adopt . adopt ( child ) ;
public class PackageBuildContext { /** * Default constructor */ public void init ( final DroolsAssemblerContext kBuilder , final InternalKnowledgePackage pkg , final BaseDescr parentDescr , final DialectCompiletimeRegistry dialectRegistry , final Dialect defaultDialect , final Dialectable component ) { } }
this . kBuilder = kBuilder ; this . pkg = pkg ; this . parentDescr = parentDescr ; this . dialectRegistry = dialectRegistry ; this . dialect = ( component != null && component . getDialect ( ) != null ) ? this . dialectRegistry . getDialect ( component . getDialect ( ) ) : defaultDialect ; this . typesafe = ( ( MVELDialect ) dialectRegistry . getDialect ( "mvel" ) ) . isStrictMode ( ) ; if ( dialect == null && ( component != null && component . getDialect ( ) != null ) ) { this . errors . add ( new DescrBuildError ( null , parentDescr , component , "Unable to load Dialect '" + component . getDialect ( ) + "'" ) ) ; // dialect is null , but fall back to default dialect so we can attempt to compile rest of rule . this . dialect = defaultDialect ; }
public class OAuth20Service { /** * Start the request to retrieve the access token . The optionally provided callback will be called with the Token * when it is available . * @ param params params * @ param callback optional callback * @ return Future */ public Future < OAuth2AccessToken > getAccessToken ( AccessTokenRequestParams params , OAuthAsyncRequestCallback < OAuth2AccessToken > callback ) { } }
return sendAccessTokenRequestAsync ( createAccessTokenRequest ( params ) , callback ) ;
public class RxSharedPreferences { /** * Create a long preference for { @ code key } with a default of { @ code defaultValue } . */ @ CheckResult @ NonNull public Preference < Long > getLong ( @ NonNull String key , @ NonNull Long defaultValue ) { } }
checkNotNull ( key , "key == null" ) ; checkNotNull ( defaultValue , "defaultValue == null" ) ; return new RealPreference < > ( preferences , key , defaultValue , LongAdapter . INSTANCE , keyChanges ) ;
public class KeenClient { /** * Publishes a single event to the Keen service . * @ param project The project in which to publish the event . * @ param eventCollection The name of the collection in which to publish the event . * @ param event The event to publish . * @ return The response from the server . * @ throws IOException If there was an error communicating with the server . */ private String publish ( KeenProject project , String eventCollection , Map < String , Object > event ) throws IOException { } }
URL url = createURL ( project , eventCollection ) ; if ( url == null ) { throw new IllegalStateException ( "URL address is empty" ) ; } return publishObject ( project , url , event ) ;
public class FeatureInfoBuilder { /** * Build a feature results information message * @ param results feature index results * @ param tolerance distance tolerance * @ return results message or null if no results */ public String buildResultsInfoMessage ( FeatureIndexResults results , double tolerance ) { } }
return buildResultsInfoMessage ( results , tolerance , null , null ) ;
public class Dispatcher { /** * Handles target object registration */ @ MainThread private void handleRegistration ( Object targetObj ) { } }
if ( targetObj == null ) { throw new NullPointerException ( "Target cannot be null" ) ; } for ( EventTarget target : targets ) { if ( target . targetObj == targetObj ) { Utils . logE ( targetObj , "Already registered" ) ; return ; } } EventTarget target = new EventTarget ( targetObj ) ; targets . add ( target ) ; Utils . log ( targetObj , "Registered" ) ; scheduleActiveStatusesUpdates ( target , EventStatus . STARTED ) ; executeTasks ( false ) ;
public class UriUtils { /** * Strips the host from a URI string . This will turn " http : / / host . com / path " * into " / path " . * @ param uri The URI to transform . * @ return A string with the URI stripped . */ public static String stripHost ( final String uri ) { } }
if ( ! uri . startsWith ( "http" ) ) { // It ' s likely a URI path , not the full URI ( i . e . the host is // already stripped ) . return uri ; } final String noHttpUri = StringUtils . substringAfter ( uri , "://" ) ; final int slashIndex = noHttpUri . indexOf ( "/" ) ; if ( slashIndex == - 1 ) { return "/" ; } final String noHostUri = noHttpUri . substring ( slashIndex ) ; return noHostUri ;
public class FromStringConverter { /** * / * ( non - Javadoc ) * @ see org . springframework . ldap . odm . typeconversion . impl . Converter # convert ( java . lang . Object , java . lang . Class ) */ public < T > T convert ( Object source , Class < T > toClass ) throws Exception { } }
Constructor < T > constructor = toClass . getConstructor ( java . lang . String . class ) ; return constructor . newInstance ( source ) ;
public class KerasDepthwiseConvolution2D { /** * Set weights for layer . * @ param weights Map of weights */ @ Override public void setWeights ( Map < String , INDArray > weights ) throws InvalidKerasConfigurationException { } }
this . weights = new HashMap < > ( ) ; INDArray dW ; if ( weights . containsKey ( conf . getLAYER_PARAM_NAME_DEPTH_WISE_KERNEL ( ) ) ) dW = weights . get ( conf . getLAYER_PARAM_NAME_DEPTH_WISE_KERNEL ( ) ) ; else throw new InvalidKerasConfigurationException ( "Keras DepthwiseConvolution2D layer does not contain parameter " + conf . getLAYER_PARAM_NAME_DEPTH_WISE_KERNEL ( ) ) ; this . weights . put ( SeparableConvolutionParamInitializer . DEPTH_WISE_WEIGHT_KEY , dW ) ; if ( hasBias ) { INDArray bias ; if ( kerasMajorVersion == 2 && weights . containsKey ( "bias" ) ) bias = weights . get ( "bias" ) ; else if ( kerasMajorVersion == 1 && weights . containsKey ( "b" ) ) bias = weights . get ( "b" ) ; else throw new InvalidKerasConfigurationException ( "Keras DepthwiseConvolution2D layer does not contain bias parameter" ) ; this . weights . put ( SeparableConvolutionParamInitializer . BIAS_KEY , bias ) ; }
public class CmsUploadButton { /** * Disables the button and changes the button title attribute to the disabled reason . < p > * @ param disabledReason the disabled reason */ public void disable ( String disabledReason ) { } }
m_enabled = false ; // hide the current file input field if ( m_fileInput != null ) { m_fileInput . getElement ( ) . getStyle ( ) . setDisplay ( Display . NONE ) ; } updateState ( "up-disabled" ) ; super . setTitle ( disabledReason ) ;
public class Transition { /** * Whether to add the given id to the list of target ids to exclude from this * transition . The < code > exclude < / code > parameter specifies whether the target * should be added to or removed from the excluded list . * < p > Excluding targets is a general mechanism for allowing transitions to run on * a view hierarchy while skipping target views that should not be part of * the transition . For example , you may want to avoid animating children * of a specific ListView or Spinner . Views can be excluded either by their * id , or by their instance reference , or by the Class of that view * ( eg , { @ link Spinner } ) . < / p > * @ param targetId The id of a target to ignore when running this transition . * @ param exclude Whether to add the target to or remove the target from the * current list of excluded targets . * @ return This transition object . * @ see # excludeChildren ( int , boolean ) * @ see # excludeTarget ( View , boolean ) * @ see # excludeTarget ( Class , boolean ) */ @ NonNull public Transition excludeTarget ( int targetId , boolean exclude ) { } }
if ( targetId >= 0 ) { mTargetIdExcludes = excludeObject ( mTargetIdExcludes , targetId , exclude ) ; } return this ;
public class GeneRegulationTemplate { /** * getter for relation - gets mention of gene regulation relation * @ generated * @ return value of the feature */ public RegulationOfGeneExpression getRelation ( ) { } }
if ( GeneRegulationTemplate_Type . featOkTst && ( ( GeneRegulationTemplate_Type ) jcasType ) . casFeat_relation == null ) jcasType . jcas . throwFeatMissing ( "relation" , "de.julielab.jules.types.bootstrep.GeneRegulationTemplate" ) ; return ( RegulationOfGeneExpression ) ( jcasType . ll_cas . ll_getFSForRef ( jcasType . ll_cas . ll_getRefValue ( addr , ( ( GeneRegulationTemplate_Type ) jcasType ) . casFeatCode_relation ) ) ) ;
public class BsfUtils { /** * Escape special jQuery chars in selector query * @ param selector * @ return */ public static String escapeJQuerySpecialCharsInSelector ( String selector ) { } }
String jQuerySpecialChars = "!\"#$%&'()*+,./:;<=>?@[]^`{|}~;" ; String [ ] jsc = jQuerySpecialChars . split ( "(?!^)" ) ; for ( String c : jsc ) { selector = selector . replace ( c , "\\\\" + c ) ; } return selector ;
public class DcosSpec { /** * Check if json is validated against a schema * @ param json json to be validated against schema * @ param schema schema to be validated against * @ throws Exception exception * */ @ Given ( "^json (.+?) matches schema (.+?)$" ) public void jsonMatchesSchema ( String json , String schema ) throws Exception { } }
JSONObject jsonschema = new JSONObject ( schema ) ; JSONObject jsondeploy = new JSONObject ( json ) ; commonspec . matchJsonToSchema ( jsonschema , jsondeploy ) ;
public class JSON { /** * / * ObjectWriteContext : Serialization */ @ Override public void writeValue ( JsonGenerator g , Object value ) throws IOException { } }
write ( value , g ) ;
public class VdmProject { /** * Get files from a eclipse project * @ param project * the project to scan * @ param iContentType * of the type of files that should be returned * @ return a list of IFile * @ throws CoreException */ public List < IVdmSourceUnit > getFiles ( IContentType iContentType ) throws CoreException { } }
List < IVdmSourceUnit > list = new Vector < IVdmSourceUnit > ( ) ; for ( IContainer container : modelpath . getModelSrcPaths ( ) ) { if ( ! container . exists ( ) || ! container . isAccessible ( ) ) { continue ; } for ( IResource res : container . members ( IContainer . INCLUDE_PHANTOMS | IContainer . INCLUDE_TEAM_PRIVATE_MEMBERS ) ) { list . addAll ( ResourceManager . getInstance ( ) . getFiles ( this , res , iContentType ) ) ; } } return list ;
public class MCF1RGImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public void eUnset ( int featureID ) { } }
switch ( featureID ) { case AfplibPackage . MCF1RG__CF_LID : setCFLid ( CF_LID_EDEFAULT ) ; return ; case AfplibPackage . MCF1RG__SECTID : setSectid ( SECTID_EDEFAULT ) ; return ; case AfplibPackage . MCF1RG__CF_NAME : setCFName ( CF_NAME_EDEFAULT ) ; return ; case AfplibPackage . MCF1RG__CP_NAME : setCPName ( CP_NAME_EDEFAULT ) ; return ; case AfplibPackage . MCF1RG__FCS_NAME : setFCSName ( FCS_NAME_EDEFAULT ) ; return ; case AfplibPackage . MCF1RG__CHAR_ROT : setCharRot ( CHAR_ROT_EDEFAULT ) ; return ; } super . eUnset ( featureID ) ;
public class AmazonRekognitionClient { /** * For a given input face ID , searches for matching faces in the collection the face belongs to . You get a face ID * when you add a face to the collection using the < a > IndexFaces < / a > operation . The operation compares the features * of the input face with faces in the specified collection . * < note > * You can also search faces without indexing faces by using the < code > SearchFacesByImage < / code > operation . * < / note > * The operation response returns an array of faces that match , ordered by similarity score with the highest * similarity first . More specifically , it is an array of metadata for each face match that is found . Along with the * metadata , the response also includes a < code > confidence < / code > value for each face match , indicating the * confidence that the specific face matches the input face . * For an example , see Searching for a Face Using Its Face ID in the Amazon Rekognition Developer Guide . * This operation requires permissions to perform the < code > rekognition : SearchFaces < / code > action . * @ param searchFacesRequest * @ return Result of the SearchFaces operation returned by the service . * @ throws InvalidParameterException * Input parameter violated a constraint . Validate your parameter before calling the API operation again . * @ throws AccessDeniedException * You are not authorized to perform the action . * @ throws InternalServerErrorException * Amazon Rekognition experienced a service issue . Try your call again . * @ throws ThrottlingException * Amazon Rekognition is temporarily unable to process the request . Try your call again . * @ throws ProvisionedThroughputExceededException * The number of requests exceeded your throughput limit . If you want to increase this limit , contact Amazon * Rekognition . * @ throws ResourceNotFoundException * The collection specified in the request cannot be found . * @ sample AmazonRekognition . SearchFaces */ @ Override public SearchFacesResult searchFaces ( SearchFacesRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeSearchFaces ( request ) ;
public class EJSDeployedSupport { /** * Returns the binding context for the currently active extended - scoped * persistence context for the thread of execution . Null will be returned * if an extended - scoped persistence context is not currently active . < p > * @ return binding context for currently active extended - scoped * persistence context . */ public Object getExPcBindingContext ( ) { } }
Object jpaContext = null ; // First , if a new bean instance is being created in this method context , // then the jpa context of that new bean instance is the current active // context . . . even if it is null . if ( ivCreateBeanO != null ) { jpaContext = ivCreateBeanO . ivExPcContext ; } else if ( beanO != null ) { // Second , if the bean the current method was invoked on is NOT // a home ( i . e . it has a home ) then the jpa context is that of // the current bean . . . even if it is null . if ( beanO . home != null ) { if ( beanO instanceof StatefulBeanO ) { jpaContext = ( ( StatefulBeanO ) beanO ) . ivExPcContext ; } } // Finally , if the bean associated with this method context is a // stateful home then the jpa context is that of the calling // bean ( i . e . the bean that called home . create ) . else if ( ivWrapper . bmd . isStatefulSessionBean ( ) && ivCallerContext != null ) { jpaContext = ivCallerContext . getExPcBindingContext ( ) ; } } return jpaContext ;
public class BigRational { /** * Creates a rational number of the specified { @ link BigInteger } value . * @ param value the { @ link BigInteger } value * @ return the rational number */ public static BigRational valueOf ( BigInteger value ) { } }
if ( value . compareTo ( BigInteger . ZERO ) == 0 ) { return ZERO ; } if ( value . compareTo ( BigInteger . ONE ) == 0 ) { return ONE ; } return valueOf ( value , BigInteger . ONE ) ;
public class TelegramBotsApi { /** * Register a bot . The Bot Session is started immediately , and may be disconnected by calling close . * @ param bot the bot to register */ public BotSession registerBot ( LongPollingBot bot ) throws TelegramApiRequestException { } }
bot . clearWebhook ( ) ; BotSession session = ApiContext . getInstance ( BotSession . class ) ; session . setToken ( bot . getBotToken ( ) ) ; session . setOptions ( bot . getOptions ( ) ) ; session . setCallback ( bot ) ; session . start ( ) ; return session ;
public class CompositeQuery { /** * We interpret negation blocks as equivalent to defining a rule with the content of the block being the rule body . * Writing the query in terms of variables it depends on we have : * Q ( x1 , . . . , xn ) : - P1 ( xi , . . . ) , . . . , Pn ( . . . , xj ) , NOT { R1 ( xk , . . . ) , . . . , Rn ( . . . , xm ) } * We can then rewrite the negative part in terms of some unknown relation : * ? ( xk ' , . . . , xm ' ) : - R1 ( xk , . . . ) , . . . , Rn ( . . . , xm ) * Where the sets of variables : * V = { x1 , . . . , xn } * Vp = { xi , . . . , xj } * Vn = { xk , . . . , xm } * Vr = { xk ' , . . . , xm ' } * satisfy : * Vp e V * Vn e V * Vr e Vn * This procedure can follow recursively for multiple nested negation blocks . * Then , for the negation to be safe , we require : * - the set of variables Vr to be non - empty * NB : We do not require the negation blocks to be ground with respect to the positive part as we can rewrite the * negation blocks in terms of a ground relation defined via rule . i . e . : * Q ( x ) : - T ( x ) , ( x , y ) , NOT { ( y , z ) } * can be rewritten as : * Q ( x ) : - T ( x ) , ( x , y ) , NOT { ? ( y ) } * ? ( y ) : - ( y , z ) * @ return true if this composite query is safe to resolve */ private boolean isNegationSafe ( ) { } }
if ( this . isPositive ( ) ) return true ; if ( bindingVariables ( ) . isEmpty ( ) ) return false ; // check nested blocks return getComplementQueries ( ) . stream ( ) . map ( ResolvableQuery :: asComposite ) . allMatch ( CompositeQuery :: isNegationSafe ) ;
public class ContentMacro { /** * Get the parser for the passed Syntax . * @ param syntax the Syntax for which to find the Parser * @ return the matching Parser that can be used to parse content in the passed Syntax * @ throws MacroExecutionException if there ' s no Parser in the system for the passed Syntax */ protected Parser getSyntaxParser ( Syntax syntax ) throws MacroExecutionException { } }
if ( this . componentManager . hasComponent ( Parser . class , syntax . toIdString ( ) ) ) { try { return this . componentManager . getInstance ( Parser . class , syntax . toIdString ( ) ) ; } catch ( ComponentLookupException e ) { throw new MacroExecutionException ( String . format ( "Failed to lookup Parser for syntax [%s]" , syntax . toIdString ( ) ) , e ) ; } } else { throw new MacroExecutionException ( String . format ( "Cannot find Parser for syntax [%s]" , syntax . toIdString ( ) ) ) ; }
public class ServiceLocalCache { /** * Switch online and standby cache * @ throws InterruptedException */ public static void switchCache ( ) throws InterruptedException { } }
// swith between two cache if ( cacheReference == masterCache ) { cacheReference = slaveCache ; masterCache . clear ( ) ; } else { cacheReference = masterCache ; slaveCache . clear ( ) ; }
public class ParseDateSupport { /** * Private utility methods */ private DateFormat createParser ( Locale loc ) throws JspException { } }
DateFormat parser = null ; if ( ( type == null ) || DATE . equalsIgnoreCase ( type ) ) { parser = DateFormat . getDateInstance ( Util . getStyle ( dateStyle , "PARSE_DATE_INVALID_DATE_STYLE" ) , loc ) ; } else if ( TIME . equalsIgnoreCase ( type ) ) { parser = DateFormat . getTimeInstance ( Util . getStyle ( timeStyle , "PARSE_DATE_INVALID_TIME_STYLE" ) , loc ) ; } else if ( DATETIME . equalsIgnoreCase ( type ) ) { parser = DateFormat . getDateTimeInstance ( Util . getStyle ( dateStyle , "PARSE_DATE_INVALID_DATE_STYLE" ) , Util . getStyle ( timeStyle , "PARSE_DATE_INVALID_TIME_STYLE" ) , loc ) ; } else { throw new JspException ( Resources . getMessage ( "PARSE_DATE_INVALID_TYPE" , type ) ) ; } parser . setLenient ( false ) ; return parser ;
public class DrizzleResultSet { /** * Moves the cursor to the first row in this < code > ResultSet < / code > object . * @ return < code > true < / code > if the cursor is on a valid row ; < code > false < / code > if there are no rows in the result * set * @ throws java . sql . SQLException if a database access error occurs ; this method is called on a closed result set or * the result set type is < code > TYPE _ FORWARD _ ONLY < / code > * @ throws java . sql . SQLFeatureNotSupportedException * if the JDBC driver does not support this method * @ since 1.2 */ public boolean first ( ) throws SQLException { } }
if ( queryResult . getResultSetType ( ) == ResultSetType . SELECT && queryResult . getRows ( ) > 0 ) { ( ( SelectQueryResult ) queryResult ) . moveRowPointerTo ( 0 ) ; return true ; } return false ;
public class Types { /** * where */ public List < MethodSymbol > interfaceCandidates ( Type site , MethodSymbol ms ) { } }
Filter < Symbol > filter = new MethodFilter ( ms , site ) ; List < MethodSymbol > candidates = List . nil ( ) ; for ( Symbol s : membersClosure ( site , false ) . getElements ( filter ) ) { if ( ! site . tsym . isInterface ( ) && ! s . owner . isInterface ( ) ) { return List . of ( ( MethodSymbol ) s ) ; } else if ( ! candidates . contains ( s ) ) { candidates = candidates . prepend ( ( MethodSymbol ) s ) ; } } return prune ( candidates ) ;
public class Router { /** * Pops the passed { @ link Controller } from the backstack * @ param controller The controller that should be popped from this Router * @ return Whether or not this Router still has controllers remaining on it after popping . */ @ UiThread public boolean popController ( @ NonNull Controller controller ) { } }
ThreadUtils . ensureMainThread ( ) ; RouterTransaction topTransaction = backstack . peek ( ) ; boolean poppingTopController = topTransaction != null && topTransaction . controller == controller ; if ( poppingTopController ) { trackDestroyingController ( backstack . pop ( ) ) ; performControllerChange ( backstack . peek ( ) , topTransaction , false ) ; } else { RouterTransaction removedTransaction = null ; RouterTransaction nextTransaction = null ; Iterator < RouterTransaction > iterator = backstack . iterator ( ) ; ControllerChangeHandler topPushHandler = topTransaction != null ? topTransaction . pushChangeHandler ( ) : null ; final boolean needsNextTransactionAttach = topPushHandler != null ? ! topPushHandler . removesFromViewOnPush ( ) : false ; while ( iterator . hasNext ( ) ) { RouterTransaction transaction = iterator . next ( ) ; if ( transaction . controller == controller ) { if ( controller . isAttached ( ) ) { trackDestroyingController ( transaction ) ; } iterator . remove ( ) ; removedTransaction = transaction ; } else if ( removedTransaction != null ) { if ( needsNextTransactionAttach && ! transaction . controller . isAttached ( ) ) { nextTransaction = transaction ; } break ; } } if ( removedTransaction != null ) { performControllerChange ( nextTransaction , removedTransaction , false ) ; } } if ( popsLastView ) { return topTransaction != null ; } else { return ! backstack . isEmpty ( ) ; }
public class Partition { /** * Create a list partition on an { @ link AbstractLabel } * @ param sqlgGraph * @ param abstractLabel * @ param name * @ param in * @ return */ static Partition createListPartition ( SqlgGraph sqlgGraph , AbstractLabel abstractLabel , String name , String in ) { } }
Preconditions . checkArgument ( ! abstractLabel . getSchema ( ) . isSqlgSchema ( ) , "createListPartition may not be called for \"%s\"" , Topology . SQLG_SCHEMA ) ; Partition partition = new Partition ( sqlgGraph , abstractLabel , name , in , PartitionType . NONE , null ) ; partition . createListPartitionOnDb ( ) ; if ( abstractLabel instanceof VertexLabel ) { TopologyManager . addVertexLabelPartition ( sqlgGraph , abstractLabel . getSchema ( ) . getName ( ) , abstractLabel . getName ( ) , name , in , PartitionType . NONE , null ) ; } else { TopologyManager . addEdgeLabelPartition ( sqlgGraph , abstractLabel , name , in , PartitionType . NONE , null ) ; } partition . committed = false ; return partition ;
public class L_BFGS { /** * Solve the optimization problem defined by the user - supplied ginfo function using L - BFGS algorithm . * Will result into multiple ( 10s to 100s or even 1000s ) calls of the user - provided ginfo function . * Outside of that it does only limited single threaded computation ( order of number of coefficients ) . * The ginfo is likely to be the most expensive part and key for good perfomance . * @ param gslvr - user ginfo function * @ params coefs - intial solution * @ return Optimal solution ( coefficients ) + ginfo info returned by the user ginfo * function evaluated at the found optmimum . */ public final Result solve ( GradientSolver gslvr , double [ ] coefs ) { } }
return solve ( gslvr , coefs , gslvr . getGradient ( coefs ) , new ProgressMonitor ( ) { @ Override public boolean progress ( double [ ] beta , GradientInfo ginfo ) { return true ; } } ) ;
public class RetryUtil { /** * 重试直到无异常抛出或者超过最大重试次数 ; * 原样抛出原异常 * @ deprecated Do not support asynchronous task */ public static < Return > Return retryUntilNoException ( Callable < Return > callable , int maxTry , Class < ? extends Throwable > exceptionClass ) throws Exception { } }
String errMsg = "连续重试失败" + maxTry + "次。" ; Exception t = null ; while ( maxTry > 0 ) { try { return callable . call ( ) ; } catch ( Exception throwable ) { if ( exceptionClass . isAssignableFrom ( throwable . getClass ( ) ) ) { // 只对指定的异常重试 , 其他异常直接抛出去 maxTry -- ; t = throwable ; } else { throw throwable ; } } } LOG . error ( new RuntimeException ( errMsg , t ) ) ; // 这里是对重试N次后依然抛出指定异常的情况 , 原样抛出 throw t ;
public class AmazonIdentityManagementClient { /** * Updates the name and / or the path of the specified server certificate stored in IAM . * For more information about working with server certificates , see < a * href = " https : / / docs . aws . amazon . com / IAM / latest / UserGuide / id _ credentials _ server - certs . html " > Working with Server * Certificates < / a > in the < i > IAM User Guide < / i > . This topic also includes a list of AWS services that can use the * server certificates that you manage with IAM . * < important > * You should understand the implications of changing a server certificate ' s path or name . For more information , see * < a href = * " https : / / docs . aws . amazon . com / IAM / latest / UserGuide / id _ credentials _ server - certs _ manage . html # RenamingServerCerts " * > Renaming a Server Certificate < / a > in the < i > IAM User Guide < / i > . * < / important > < note > * The person making the request ( the principal ) , must have permission to change the server certificate with the old * name and the new name . For example , to change the certificate named < code > ProductionCert < / code > to * < code > ProdCert < / code > , the principal must have a policy that allows them to update both certificates . If the * principal has permission to update the < code > ProductionCert < / code > group , but not the < code > ProdCert < / code > * certificate , then the update fails . For more information about permissions , see < a * href = " https : / / docs . aws . amazon . com / IAM / latest / UserGuide / access . html " > Access Management < / a > in the < i > IAM User * Guide < / i > . * < / note > * @ param updateServerCertificateRequest * @ return Result of the UpdateServerCertificate operation returned by the service . * @ throws NoSuchEntityException * The request was rejected because it referenced a resource entity that does not exist . The error message * describes the resource . * @ throws EntityAlreadyExistsException * The request was rejected because it attempted to create a resource that already exists . * @ throws LimitExceededException * The request was rejected because it attempted to create resources beyond the current AWS account limits . * The error message describes the limit exceeded . * @ throws ServiceFailureException * The request processing has failed because of an unknown error , exception or failure . * @ sample AmazonIdentityManagement . UpdateServerCertificate * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / iam - 2010-05-08 / UpdateServerCertificate " target = " _ top " > AWS * API Documentation < / a > */ @ Override public UpdateServerCertificateResult updateServerCertificate ( UpdateServerCertificateRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeUpdateServerCertificate ( request ) ;
public class XMLHolidayManager { /** * Validates the content of the provided configuration by checking for * multiple hierarchy entries within one configuration . It traverses down the * configuration tree . */ private static void _validateConfigurationHierarchy ( @ Nonnull final Configuration aConfig ) { } }
final ICommonsSet < String > aHierarchySet = new CommonsHashSet < > ( ) ; for ( final Configuration aSubConfig : aConfig . getSubConfigurations ( ) ) { final String sHierarchy = aSubConfig . getHierarchy ( ) ; if ( ! aHierarchySet . add ( sHierarchy ) ) throw new IllegalArgumentException ( "Configuration for " + aConfig . getHierarchy ( ) + " contains multiple SubConfigurations with the same hierarchy id '" + sHierarchy + "'. " ) ; } for ( final Configuration aSubConfig : aConfig . getSubConfigurations ( ) ) _validateConfigurationHierarchy ( aSubConfig ) ;
public class DeleteNode { /** * Return this object to its original post - construction state . */ void reset ( ) { } }
_deleteNode = null ; _deleteIndex = 0 ; _targetNode = null ; _targetIndex = 0 ; _type = NONE ; _notFound = true ;
public class BoxCollaboration { /** * Used to retrieve all collaborations associated with the item . * @ param api BoxAPIConnection from the associated file . * @ param fileID FileID of the associated file * @ param pageSize page size for server pages of the Iterable * @ param fields the optional fields to retrieve . * @ return An iterable of BoxCollaboration . Info instances associated with the item . */ public static BoxResourceIterable < Info > getAllFileCollaborations ( final BoxAPIConnection api , String fileID , int pageSize , String ... fields ) { } }
QueryStringBuilder builder = new QueryStringBuilder ( ) ; if ( fields . length > 0 ) { builder . appendParam ( "fields" , fields ) ; } return new BoxResourceIterable < BoxCollaboration . Info > ( api , GET_ALL_FILE_COLLABORATIONS_URL . buildWithQuery ( api . getBaseURL ( ) , builder . toString ( ) , fileID ) , pageSize ) { @ Override protected BoxCollaboration . Info factory ( JsonObject jsonObject ) { String id = jsonObject . get ( "id" ) . asString ( ) ; return new BoxCollaboration ( api , id ) . new Info ( jsonObject ) ; } } ;
public class Filtering { /** * Creates an iterator yielding at most first n elements of the passed * iterator . E . g : * < code > take ( 2 , [ 1 , 2 , 3 ] ) - > [ 1 , 2 ] < / code > * < code > take ( 4 , [ 1 , 2 , 3 ] ) - > [ 1 , 2 , 3 ] < / code > * @ param < E > the iterator element type * @ param howMany elements to be consumed ( at most ) * @ param iterator the source iterator * @ return the resulting iterator */ public static < E > Iterator < E > take ( long howMany , Iterator < E > iterator ) { } }
return new TakeUpToIterator < E > ( iterator , howMany ) ;
public class LdapUtils { /** * Returns the value of the first occurence of attributeType from each entry in the cursor . */ public static List < String > extractAttributeEmptyCheck ( SearchCursor cursor , String attributeType ) { } }
List < String > result = new LinkedList < String > ( ) ; try { while ( cursor . next ( ) ) { Entry entry = cursor . getEntry ( ) ; result . add ( extractAttributeEmptyCheck ( entry , attributeType ) ) ; } } catch ( Exception e ) { throw new LdapRuntimeException ( e ) ; } return result ;
public class WebFragmentDescriptorImpl { /** * Returns all < code > message - destination - ref < / code > elements * @ return list of < code > message - destination - ref < / code > */ public List < MessageDestinationRefType < WebFragmentDescriptor > > getAllMessageDestinationRef ( ) { } }
List < MessageDestinationRefType < WebFragmentDescriptor > > list = new ArrayList < MessageDestinationRefType < WebFragmentDescriptor > > ( ) ; List < Node > nodeList = model . get ( "message-destination-ref" ) ; for ( Node node : nodeList ) { MessageDestinationRefType < WebFragmentDescriptor > type = new MessageDestinationRefTypeImpl < WebFragmentDescriptor > ( this , "message-destination-ref" , model , node ) ; list . add ( type ) ; } return list ;
public class PojoSerializerSnapshot { /** * Builds an index of fields to their corresponding serializers for the * new { @ link PojoSerializer } for faster field serializer lookups . */ private static < T > Map < Field , TypeSerializer < ? > > buildNewFieldSerializersIndex ( PojoSerializer < T > newPojoSerializer ) { } }
final Field [ ] newFields = newPojoSerializer . getFields ( ) ; final TypeSerializer < ? > [ ] newFieldSerializers = newPojoSerializer . getFieldSerializers ( ) ; checkState ( newFields . length == newFieldSerializers . length ) ; int numFields = newFields . length ; final Map < Field , TypeSerializer < ? > > index = new HashMap < > ( numFields ) ; for ( int i = 0 ; i < numFields ; i ++ ) { index . put ( newFields [ i ] , newFieldSerializers [ i ] ) ; } return index ;
public class HttpMethodBase { /** * Generates < tt > Host < / tt > request header , as long as no < tt > Host < / tt > request * header already exists . * @ param state the { @ link HttpState state } information associated with this method * @ param conn the { @ link HttpConnection connection } used to execute * this HTTP method * @ throws IOException if an I / O ( transport ) error occurs . Some transport exceptions * can be recovered from . * @ throws HttpException if a protocol exception occurs . Usually protocol exceptions * cannot be recovered from . */ protected void addHostRequestHeader ( HttpState state , HttpConnection conn ) throws IOException , HttpException { } }
LOG . trace ( "enter HttpMethodBase.addHostRequestHeader(HttpState, " + "HttpConnection)" ) ; // Per 19.6.1.1 of RFC 2616 , it is legal for HTTP / 1.0 based // applications to send the Host request - header . // TODO : Add the ability to disable the sending of this header for // HTTP / 1.0 requests . String host = this . params . getVirtualHost ( ) ; if ( host != null ) { LOG . debug ( "Using virtual host name: " + host ) ; } else { host = conn . getHost ( ) ; } int port = conn . getPort ( ) ; // Note : RFC 2616 uses the term " internet host name " for what goes on the // host line . It would seem to imply that host should be blank if the // host is a number instead of an name . Based on the behavior of web // browsers , and the fact that RFC 2616 never defines the phrase " internet // host name " , and the bad behavior of HttpClient that follows if we // send blank , I interpret this as a small misstatement in the RFC , where // they meant to say " internet host " . So IP numbers get sent as host // entries too . - - Eric Johnson 12/13/2002 if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( "Adding Host request header" ) ; } // appends the port only if not using the default port for the protocol if ( conn . getProtocol ( ) . getDefaultPort ( ) != port ) { host += ( ":" + port ) ; } setRequestHeader ( "Host" , host ) ;
public class DiagnosticsInner { /** * Get Detector . * Get Detector . * @ param resourceGroupName Name of the resource group to which the resource belongs . * @ param siteName Site Name * @ param diagnosticCategory Diagnostic Category * @ param detectorName Detector Name * @ param slot Slot Name * @ param serviceCallback the async ServiceCallback to handle successful and failed responses . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the { @ link ServiceFuture } object */ public ServiceFuture < List < DetectorDefinitionInner > > getSiteDetectorSlotAsync ( final String resourceGroupName , final String siteName , final String diagnosticCategory , final String detectorName , final String slot , final ListOperationCallback < DetectorDefinitionInner > serviceCallback ) { } }
return AzureServiceFuture . fromPageResponse ( getSiteDetectorSlotSinglePageAsync ( resourceGroupName , siteName , diagnosticCategory , detectorName , slot ) , new Func1 < String , Observable < ServiceResponse < Page < DetectorDefinitionInner > > > > ( ) { @ Override public Observable < ServiceResponse < Page < DetectorDefinitionInner > > > call ( String nextPageLink ) { return getSiteDetectorSlotNextSinglePageAsync ( nextPageLink ) ; } } , serviceCallback ) ;
public class JKDefaultTableModel { /** * New vector . * @ param size the size * @ return the vector */ private static Vector newVector ( final int size ) { } }
final Vector v = new Vector ( size ) ; v . setSize ( size ) ; return v ;
public class NumberExpression { /** * Create a { @ code floor ( this ) } expression * < p > Returns the largest ( closest to positive infinity ) * { @ code double } value that is less than or equal to the * argument and is equal to a mathematical integer . < / p > * @ return floor ( this ) * @ see java . lang . Math # floor ( double ) */ public NumberExpression < T > floor ( ) { } }
if ( floor == null ) { floor = Expressions . numberOperation ( getType ( ) , MathOps . FLOOR , mixin ) ; } return floor ;
public class SpiceManager { /** * Dumps request processor state . */ public void dumpState ( ) { } }
executorService . execute ( new Runnable ( ) { @ Override public void run ( ) { lockSendRequestsToService . lock ( ) ; try { final StringBuilder stringBuilder = new StringBuilder ( ) ; stringBuilder . append ( "[SpiceManager : " ) ; stringBuilder . append ( "Requests to be launched : \n" ) ; dumpMap ( stringBuilder , mapRequestToLaunchToRequestListener ) ; stringBuilder . append ( "Pending requests : \n" ) ; dumpMap ( stringBuilder , mapPendingRequestToRequestListener ) ; stringBuilder . append ( ']' ) ; waitForServiceToBeBound ( ) ; if ( spiceService == null ) { return ; } spiceService . dumpState ( ) ; } catch ( final InterruptedException e ) { Ln . e ( e , "Interrupted while waiting for acquiring service." ) ; } finally { lockSendRequestsToService . unlock ( ) ; } } } ) ;
public class StringUtils { /** * Creates a random string with a length within the given interval . The string contains only characters that * can be represented as a single code point . * @ param rnd The random used to create the strings . * @ param minLength The minimum string length . * @ param maxLength The maximum string length ( inclusive ) . * @ param minValue The minimum character value to occur . * @ param maxValue The maximum character value to occur . * @ return A random String . */ public static String getRandomString ( Random rnd , int minLength , int maxLength , char minValue , char maxValue ) { } }
int len = rnd . nextInt ( maxLength - minLength + 1 ) + minLength ; char [ ] data = new char [ len ] ; int diff = maxValue - minValue + 1 ; for ( int i = 0 ; i < data . length ; i ++ ) { data [ i ] = ( char ) ( rnd . nextInt ( diff ) + minValue ) ; } return new String ( data ) ;
public class ChargingStationEventListener { /** * Converts a { @ code Set } of { @ code ConfigurationItem } s to a { @ code Map } of { @ code String } and { @ code String } . * @ param configurationItems a { @ code Set } of { @ code ConfigurationItem } s . * @ return a { @ code Map } of { @ code String } and { @ code String } . */ private Map < String , String > toConfigurationItemMap ( Set < ConfigurationItem > configurationItems ) { } }
Map < String , String > map = new HashMap < > ( configurationItems . size ( ) ) ; for ( ConfigurationItem configurationItem : configurationItems ) { map . put ( configurationItem . getKey ( ) , configurationItem . getValue ( ) ) ; } return map ;
public class GeneralPurposeFFT_F32_1D { /** * passfg : Complex FFT ' s forward / backward processing of general factor ; * isign is + 1 for backward and - 1 for forward transforms */ void passfg ( final int nac [ ] , final int ido , final int ip , final int l1 , final int idl1 , final float in [ ] , final int in_off , final float out [ ] , final int out_off , final int offset , final int isign ) { } }
int idij , idlj , idot , ipph , l , jc , lc , idj , idl , inc , idp ; float w1r , w1i , w2i , w2r ; int iw1 ; iw1 = offset ; idot = ido / 2 ; ipph = ( ip + 1 ) / 2 ; idp = ip * ido ; if ( ido >= l1 ) { for ( int j = 1 ; j < ipph ; j ++ ) { jc = ip - j ; int idx1 = j * ido ; int idx2 = jc * ido ; for ( int k = 0 ; k < l1 ; k ++ ) { int idx3 = k * ido ; int idx4 = idx3 + idx1 * l1 ; int idx5 = idx3 + idx2 * l1 ; int idx6 = idx3 * ip ; for ( int i = 0 ; i < ido ; i ++ ) { int oidx1 = out_off + i ; float i1r = in [ in_off + i + idx1 + idx6 ] ; float i2r = in [ in_off + i + idx2 + idx6 ] ; out [ oidx1 + idx4 ] = i1r + i2r ; out [ oidx1 + idx5 ] = i1r - i2r ; } } } for ( int k = 0 ; k < l1 ; k ++ ) { int idxt1 = k * ido ; int idxt2 = idxt1 * ip ; for ( int i = 0 ; i < ido ; i ++ ) { out [ out_off + i + idxt1 ] = in [ in_off + i + idxt2 ] ; } } } else { for ( int j = 1 ; j < ipph ; j ++ ) { jc = ip - j ; int idxt1 = j * l1 * ido ; int idxt2 = jc * l1 * ido ; int idxt3 = j * ido ; int idxt4 = jc * ido ; for ( int i = 0 ; i < ido ; i ++ ) { for ( int k = 0 ; k < l1 ; k ++ ) { int idx1 = k * ido ; int idx2 = idx1 * ip ; int idx3 = out_off + i ; int idx4 = in_off + i ; float i1r = in [ idx4 + idxt3 + idx2 ] ; float i2r = in [ idx4 + idxt4 + idx2 ] ; out [ idx3 + idx1 + idxt1 ] = i1r + i2r ; out [ idx3 + idx1 + idxt2 ] = i1r - i2r ; } } } for ( int i = 0 ; i < ido ; i ++ ) { for ( int k = 0 ; k < l1 ; k ++ ) { int idx1 = k * ido ; out [ out_off + i + idx1 ] = in [ in_off + i + idx1 * ip ] ; } } } idl = 2 - ido ; inc = 0 ; int idxt0 = ( ip - 1 ) * idl1 ; for ( l = 1 ; l < ipph ; l ++ ) { lc = ip - l ; idl += ido ; int idxt1 = l * idl1 ; int idxt2 = lc * idl1 ; int idxt3 = idl + iw1 ; w1r = wtable [ idxt3 - 2 ] ; w1i = isign * wtable [ idxt3 - 1 ] ; for ( int ik = 0 ; ik < idl1 ; ik ++ ) { int idx1 = in_off + ik ; int idx2 = out_off + ik ; in [ idx1 + idxt1 ] = out [ idx2 ] + w1r * out [ idx2 + idl1 ] ; in [ idx1 + idxt2 ] = w1i * out [ idx2 + idxt0 ] ; } idlj = idl ; inc += ido ; for ( int j = 2 ; j < ipph ; j ++ ) { jc = ip - j ; idlj += inc ; if ( idlj > idp ) idlj -= idp ; int idxt4 = idlj + iw1 ; w2r = wtable [ idxt4 - 2 ] ; w2i = isign * wtable [ idxt4 - 1 ] ; int idxt5 = j * idl1 ; int idxt6 = jc * idl1 ; for ( int ik = 0 ; ik < idl1 ; ik ++ ) { int idx1 = in_off + ik ; int idx2 = out_off + ik ; in [ idx1 + idxt1 ] += w2r * out [ idx2 + idxt5 ] ; in [ idx1 + idxt2 ] += w2i * out [ idx2 + idxt6 ] ; } } } for ( int j = 1 ; j < ipph ; j ++ ) { int idxt1 = j * idl1 ; for ( int ik = 0 ; ik < idl1 ; ik ++ ) { int idx1 = out_off + ik ; out [ idx1 ] += out [ idx1 + idxt1 ] ; } } for ( int j = 1 ; j < ipph ; j ++ ) { jc = ip - j ; int idx1 = j * idl1 ; int idx2 = jc * idl1 ; for ( int ik = 1 ; ik < idl1 ; ik += 2 ) { int idx3 = out_off + ik ; int idx4 = in_off + ik ; int iidx1 = idx4 + idx1 ; int iidx2 = idx4 + idx2 ; float i1i = in [ iidx1 - 1 ] ; float i1r = in [ iidx1 ] ; float i2i = in [ iidx2 - 1 ] ; float i2r = in [ iidx2 ] ; int oidx1 = idx3 + idx1 ; int oidx2 = idx3 + idx2 ; out [ oidx1 - 1 ] = i1i - i2r ; out [ oidx2 - 1 ] = i1i + i2r ; out [ oidx1 ] = i1r + i2i ; out [ oidx2 ] = i1r - i2i ; } } nac [ 0 ] = 1 ; if ( ido == 2 ) return ; nac [ 0 ] = 0 ; System . arraycopy ( out , out_off , in , in_off , idl1 ) ; int idx0 = l1 * ido ; for ( int j = 1 ; j < ip ; j ++ ) { int idx1 = j * idx0 ; for ( int k = 0 ; k < l1 ; k ++ ) { int idx2 = k * ido ; int oidx1 = out_off + idx2 + idx1 ; int iidx1 = in_off + idx2 + idx1 ; in [ iidx1 ] = out [ oidx1 ] ; in [ iidx1 + 1 ] = out [ oidx1 + 1 ] ; } } if ( idot <= l1 ) { idij = 0 ; for ( int j = 1 ; j < ip ; j ++ ) { idij += 2 ; int idx1 = j * l1 * ido ; for ( int i = 3 ; i < ido ; i += 2 ) { idij += 2 ; int idx2 = idij + iw1 - 1 ; w1r = wtable [ idx2 - 1 ] ; w1i = isign * wtable [ idx2 ] ; int idx3 = in_off + i ; int idx4 = out_off + i ; for ( int k = 0 ; k < l1 ; k ++ ) { int idx5 = k * ido + idx1 ; int iidx1 = idx3 + idx5 ; int oidx1 = idx4 + idx5 ; float o1i = out [ oidx1 - 1 ] ; float o1r = out [ oidx1 ] ; in [ iidx1 - 1 ] = w1r * o1i - w1i * o1r ; in [ iidx1 ] = w1r * o1r + w1i * o1i ; } } } } else { idj = 2 - ido ; for ( int j = 1 ; j < ip ; j ++ ) { idj += ido ; int idx1 = j * l1 * ido ; for ( int k = 0 ; k < l1 ; k ++ ) { idij = idj ; int idx3 = k * ido + idx1 ; for ( int i = 3 ; i < ido ; i += 2 ) { idij += 2 ; int idx2 = idij - 1 + iw1 ; w1r = wtable [ idx2 - 1 ] ; w1i = isign * wtable [ idx2 ] ; int iidx1 = in_off + i + idx3 ; int oidx1 = out_off + i + idx3 ; float o1i = out [ oidx1 - 1 ] ; float o1r = out [ oidx1 ] ; in [ iidx1 - 1 ] = w1r * o1i - w1i * o1r ; in [ iidx1 ] = w1r * o1r + w1i * o1i ; } } } }
public class CmsModuleTable { /** * Handles the table item clicks . < p > * @ param event the click event */ protected void onItemClick ( ItemClickEvent event ) { } }
if ( ! event . isCtrlKey ( ) && ! event . isShiftKey ( ) ) { Set < String > nameSet = new LinkedHashSet < String > ( ) ; CmsModuleRow moduleRow = ( CmsModuleRow ) ( event . getItemId ( ) ) ; select ( moduleRow ) ; nameSet . add ( moduleRow . getModule ( ) . getName ( ) ) ; if ( event . getButton ( ) . equals ( MouseButton . RIGHT ) || ( event . getPropertyId ( ) == null ) ) { select ( moduleRow ) ; m_menu . setEntries ( m_app . getMenuEntries ( ) , nameSet ) ; m_menu . openForTable ( event , this ) ; } else if ( event . getButton ( ) . equals ( MouseButton . LEFT ) && "name" . equals ( event . getPropertyId ( ) ) ) { m_app . openModuleInfo ( nameSet ) ; } }
public class AbstractArrayJsonDeserializer { /** * { @ inheritDoc } */ @ Override public T doDeserialize ( JsonReader reader , JsonDeserializationContext ctx , JsonDeserializerParameters params ) { } }
if ( JsonToken . BEGIN_ARRAY == reader . peek ( ) ) { return doDeserializeArray ( reader , ctx , params ) ; } else { return doDeserializeNonArray ( reader , ctx , params ) ; }
public class RmiTargetsCleanUp { /** * Iterate RMI Targets Map and remove entries loaded by protected ClassLoader */ @ SuppressWarnings ( "WeakerAccess" ) protected void clearRmiTargetsMap ( ClassLoaderLeakPreventor preventor , Map < ? , ? > rmiTargetsMap ) { } }
try { final Field cclField = preventor . findFieldOfClass ( "sun.rmi.transport.Target" , "ccl" ) ; preventor . debug ( "Looping " + rmiTargetsMap . size ( ) + " RMI Targets to find leaks" ) ; for ( Iterator < ? > iter = rmiTargetsMap . values ( ) . iterator ( ) ; iter . hasNext ( ) ; ) { Object target = iter . next ( ) ; // sun . rmi . transport . Target ClassLoader ccl = ( ClassLoader ) cclField . get ( target ) ; if ( preventor . isClassLoaderOrChild ( ccl ) ) { preventor . warn ( "Removing RMI Target: " + target ) ; iter . remove ( ) ; } } } catch ( Exception ex ) { preventor . error ( ex ) ; }
public class PROXY { public static Class < ? > [ ] toParameterTypes ( Object argument ) { } }
if ( ! ( argument instanceof Object [ ] ) ) { Class < ? > [ ] classArgs = { argument . getClass ( ) } ; return classArgs ; } Object [ ] arguments = ( Object [ ] ) argument ; int len = arguments . length ; Class < ? > [ ] parameterTypes = new Class [ len ] ; // get array of inputs for ( int i = 0 ; i < len ; i ++ ) { parameterTypes [ i ] = arguments [ i ] . getClass ( ) ; } return parameterTypes ;
public class BinaryRow { /** * The bit is 1 when the field is null . Default is 0. */ public boolean anyNull ( ) { } }
// Skip the header . if ( ( segments [ 0 ] . getLong ( 0 ) & FIRST_BYTE_ZERO ) != 0 ) { return true ; } for ( int i = 8 ; i < nullBitsSizeInBytes ; i += 8 ) { if ( segments [ 0 ] . getLong ( i ) != 0 ) { return true ; } } return false ;
public class StateFilter { /** * / * ( non - Javadoc ) * @ see tuwien . auto . calimero . buffer . Configuration . NetworkFilter # init * ( tuwien . auto . calimero . buffer . Configuration ) */ @ Override public void init ( final Configuration c ) { } }
// check if we have a current model which emits change notifications if ( model instanceof ChangeNotifier ) { final ChangeNotifier notifier = ( ChangeNotifier ) model ; notifier . removeChangeListener ( cl ) ; } final DatapointModel < ? > m = c . getDatapointModel ( ) ; if ( m instanceof ChangeNotifier ) { model = m ; final ChangeNotifier notifier = ( ChangeNotifier ) m ; notifier . addChangeListener ( cl ) ; } if ( m != null ) createReferences ( m ) ;
public class JsJmsMapMessageImpl { /** * Set an integer value with the given name , into the Map . * Javadoc description supplied by JsJmsMessage interface . */ public void setInt ( String name , int value ) throws UnsupportedEncodingException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "setInt" , Integer . valueOf ( value ) ) ; getBodyMap ( ) . put ( name , Integer . valueOf ( value ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "setInt" ) ;
public class JoltUtils { /** * Use navigateOrDefault which is a much better name . */ @ Deprecated public static < T > T navigateSafe ( final T defaultValue , final Object source , final Object ... paths ) { } }
return navigateOrDefault ( defaultValue , source , paths ) ;
public class ExposeLinearLayoutManagerEx { /** * { @ inheritDoc } */ @ Override public void onLayoutChildren ( RecyclerView . Recycler recycler , RecyclerView . State state ) { } }
// layout algorithm : // 1 ) by checking children and other variables , find an anchor coordinate and an anchor // item position . // 2 ) fill towards start , stacking from bottom // 3 ) fill towards end , stacking from top // 4 ) scroll to fulfill requirements like stack from bottom . // create layout state if ( DEBUG ) { Log . d ( TAG , "is pre layout:" + state . isPreLayout ( ) ) ; } if ( mCurrentPendingSavedState != null && mCurrentPendingSavedState . getInt ( "AnchorPosition" ) >= 0 ) { mCurrentPendingScrollPosition = mCurrentPendingSavedState . getInt ( "AnchorPosition" ) ; } ensureLayoutStateExpose ( ) ; mLayoutState . mRecycle = false ; // resolve layout direction myResolveShouldLayoutReverse ( ) ; mAnchorInfo . reset ( ) ; mAnchorInfo . mLayoutFromEnd = mShouldReverseLayoutExpose ^ getStackFromEnd ( ) ; // calculate anchor position and coordinate updateAnchorInfoForLayoutExpose ( state , mAnchorInfo ) ; if ( DEBUG ) { Log . d ( TAG , "Anchor info:" + mAnchorInfo ) ; } // LLM may decide to layout items for " extra " pixels to account for scrolling target , // caching or predictive animations . int extraForStart ; int extraForEnd ; final int extra = getExtraLayoutSpace ( state ) ; boolean before = state . getTargetScrollPosition ( ) < mAnchorInfo . mPosition ; if ( before == mShouldReverseLayoutExpose ) { extraForEnd = extra ; extraForStart = 0 ; } else { extraForStart = extra ; extraForEnd = 0 ; } extraForStart += mOrientationHelper . getStartAfterPadding ( ) ; extraForEnd += mOrientationHelper . getEndPadding ( ) ; if ( state . isPreLayout ( ) && mCurrentPendingScrollPosition != RecyclerView . NO_POSITION && mPendingScrollPositionOffset != INVALID_OFFSET ) { // if the child is visible and we are going to move it around , we should layout // extra items in the opposite direction to make sure new items animate nicely // instead of just fading in final View existing = findViewByPosition ( mCurrentPendingScrollPosition ) ; if ( existing != null ) { final int current ; final int upcomingOffset ; if ( mShouldReverseLayoutExpose ) { current = mOrientationHelper . getEndAfterPadding ( ) - mOrientationHelper . getDecoratedEnd ( existing ) ; upcomingOffset = current - mPendingScrollPositionOffset ; } else { current = mOrientationHelper . getDecoratedStart ( existing ) - mOrientationHelper . getStartAfterPadding ( ) ; upcomingOffset = mPendingScrollPositionOffset - current ; } if ( upcomingOffset > 0 ) { extraForStart += upcomingOffset ; } else { extraForEnd -= upcomingOffset ; } } } int startOffset ; int endOffset ; onAnchorReady ( state , mAnchorInfo ) ; detachAndScrapAttachedViews ( recycler ) ; mLayoutState . mIsPreLayout = state . isPreLayout ( ) ; mLayoutState . mOnRefresLayout = true ; if ( mAnchorInfo . mLayoutFromEnd ) { // fill towards start updateLayoutStateToFillStartExpose ( mAnchorInfo ) ; mLayoutState . mExtra = extraForStart ; fill ( recycler , mLayoutState , state , false ) ; startOffset = mLayoutState . mOffset ; if ( mLayoutState . mAvailable > 0 ) { extraForEnd += mLayoutState . mAvailable ; } // fill towards end updateLayoutStateToFillEndExpose ( mAnchorInfo ) ; mLayoutState . mExtra = extraForEnd ; mLayoutState . mCurrentPosition += mLayoutState . mItemDirection ; fill ( recycler , mLayoutState , state , false ) ; endOffset = mLayoutState . mOffset ; } else { // fill towards end updateLayoutStateToFillEndExpose ( mAnchorInfo ) ; mLayoutState . mExtra = extraForEnd ; fill ( recycler , mLayoutState , state , false ) ; endOffset = mLayoutState . mOffset ; if ( mLayoutState . mAvailable > 0 ) { extraForStart += mLayoutState . mAvailable ; } // fill towards start updateLayoutStateToFillStartExpose ( mAnchorInfo ) ; mLayoutState . mExtra = extraForStart ; mLayoutState . mCurrentPosition += mLayoutState . mItemDirection ; fill ( recycler , mLayoutState , state , false ) ; startOffset = mLayoutState . mOffset ; } // changes may cause gaps on the UI , try to fix them . // TODO we can probably avoid this if neither stackFromEnd / reverseLayout / RTL values have // changed if ( getChildCount ( ) > 0 ) { // because layout from end may be changed by scroll to position // we re - calculate it . // find which side we should check for gaps . if ( mShouldReverseLayoutExpose ^ getStackFromEnd ( ) ) { int fixOffset = fixLayoutEndGapExpose ( endOffset , recycler , state , true ) ; startOffset += fixOffset ; endOffset += fixOffset ; fixOffset = fixLayoutStartGapExpose ( startOffset , recycler , state , false ) ; startOffset += fixOffset ; endOffset += fixOffset ; } else { int fixOffset = fixLayoutStartGapExpose ( startOffset , recycler , state , true ) ; startOffset += fixOffset ; endOffset += fixOffset ; fixOffset = fixLayoutEndGapExpose ( endOffset , recycler , state , false ) ; startOffset += fixOffset ; endOffset += fixOffset ; } } layoutForPredictiveAnimationsExpose ( recycler , state , startOffset , endOffset ) ; if ( ! state . isPreLayout ( ) ) { mCurrentPendingScrollPosition = RecyclerView . NO_POSITION ; mPendingScrollPositionOffset = INVALID_OFFSET ; mOrientationHelper . onLayoutComplete ( ) ; } mLastStackFromEnd = getStackFromEnd ( ) ; mCurrentPendingSavedState = null ; // we don ' t need this anymore if ( DEBUG ) { validateChildOrderExpose ( ) ; }
public class GenericPolicyFinderModule { /** * Finds a policy based on a request ' s context . If more than one policy * matches , then this either returns an error or a new policy wrapping the * multiple policies ( depending on which constructor was used to construct * this instance ) . * @ param context * the representation of the request data * @ return the result of trying to find an applicable policy */ @ Override public PolicyFinderResult findPolicy ( EvaluationCtx context ) { } }
try { AbstractPolicy policy = m_policyManager . getPolicy ( context ) ; if ( policy == null ) { return new PolicyFinderResult ( ) ; } return new PolicyFinderResult ( policy ) ; } catch ( TopLevelPolicyException tlpe ) { return new PolicyFinderResult ( tlpe . getStatus ( ) ) ; } catch ( PolicyIndexException pdme ) { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "problem processing policy" , pdme ) ; } List < String > codes = new ArrayList < String > ( ) ; codes . add ( Status . STATUS_PROCESSING_ERROR ) ; return new PolicyFinderResult ( new Status ( codes , pdme . getMessage ( ) ) ) ; }
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getIfcLengthMeasure ( ) { } }
if ( ifcLengthMeasureEClass == null ) { ifcLengthMeasureEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 823 ) ; } return ifcLengthMeasureEClass ;
public class NumberRangesFileFilter { /** * Checks whether a file satisfies the number range selection filter . * The test is evaluated based on the rightmost natural number found in * the filename string ( proper , not including directories in a path ) . * @ param file The file * @ return true If the file is within the ranges filtered for */ public boolean accept ( File file ) { } }
if ( file . isDirectory ( ) ) { return recursively ; } else { String filename = file . getName ( ) ; return accept ( filename ) ; }
public class PropClient { /** * Creates the property adapter to be used with the property client depending on the * supplied user < code > options < / code > . * There are two types of property adapters . One uses KNXnet / IP local device * management to access KNX properties in an interface object , the other type uses * remote property services . The remote adapter needs a KNX network link to access the * KNX network , the link is also created by this method if this adapter type is * requested . * @ param options contains parameters for property adapter creation * @ return the created adapter * @ throws KNXException on adapter creation problem */ private PropertyAdapter create ( Map options ) throws KNXException { } }
// add a log writer for the console ( System . out ) , setting a // user log level , if specified LogManager . getManager ( ) . addWriter ( null , new ConsoleWriter ( options . containsKey ( "verbose" ) ) ) ; // create local and remote socket address for use in adapter final InetSocketAddress local = createLocalSocket ( ( InetAddress ) options . get ( "localhost" ) , ( Integer ) options . get ( "localport" ) ) ; final InetSocketAddress host = new InetSocketAddress ( ( InetAddress ) options . get ( "host" ) , ( ( Integer ) options . get ( "port" ) ) . intValue ( ) ) ; // decide what type of adapter to create if ( options . containsKey ( "localDM" ) ) return createLocalDMAdapter ( local , host , options ) ; return createRemoteAdapter ( local , host , options ) ;
public class HttpDispatcherChannel { /** * @ see com . ibm . wsspi . channelfw . Channel # start ( ) */ @ Override @ Trivial public void start ( ) throws ChannelException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "Start channel: " + this ) ; } stop0Called = false ;
public class responderaction { /** * Use this API to fetch responderaction resource of given name . */ public static responderaction get ( nitro_service service , String name ) throws Exception { } }
responderaction obj = new responderaction ( ) ; obj . set_name ( name ) ; responderaction response = ( responderaction ) obj . get_resource ( service ) ; return response ;
public class AmazonRDSClient { /** * Disassociates an AWS Identity and Access Management ( IAM ) role from a DB instance . * @ param removeRoleFromDBInstanceRequest * @ return Result of the RemoveRoleFromDBInstance operation returned by the service . * @ throws DBInstanceNotFoundException * < i > DBInstanceIdentifier < / i > doesn ' t refer to an existing DB instance . * @ throws DBInstanceRoleNotFoundException * The specified < i > RoleArn < / i > value doesn ' t match the specifed feature for the DB instance . * @ throws InvalidDBInstanceStateException * The DB instance isn ' t in a valid state . * @ sample AmazonRDS . RemoveRoleFromDBInstance * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / rds - 2014-10-31 / RemoveRoleFromDBInstance " target = " _ top " > AWS * API Documentation < / a > */ @ Override public RemoveRoleFromDBInstanceResult removeRoleFromDBInstance ( RemoveRoleFromDBInstanceRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeRemoveRoleFromDBInstance ( request ) ;
public class HeaderParser { /** * Parses the header bytes in the given { @ code buffer } ; only the header * bytes are consumed , therefore when this method returns , the buffer may * contain unconsumed bytes . * @ param buffer the buffer to parse * @ return true if the whole header bytes were parsed , false if not enough * header bytes were present in the buffer */ public boolean parse ( ByteBuffer buffer ) { } }
while ( buffer . hasRemaining ( ) ) { switch ( state ) { case LENGTH : { int octet = buffer . get ( ) & 0xFF ; length = ( length << 8 ) + octet ; if ( ++ cursor == 3 ) { length &= Frame . MAX_MAX_LENGTH ; state = State . TYPE ; } break ; } case TYPE : { type = buffer . get ( ) & 0xFF ; state = State . FLAGS ; break ; } case FLAGS : { flags = buffer . get ( ) & 0xFF ; state = State . STREAM_ID ; break ; } case STREAM_ID : { if ( buffer . remaining ( ) >= 4 ) { streamId = buffer . getInt ( ) ; // Most significant bit MUST be ignored as per specification . streamId &= 0x7F_FF_FF_FF ; return true ; } else { state = State . STREAM_ID_BYTES ; cursor = 4 ; } break ; } case STREAM_ID_BYTES : { int currByte = buffer . get ( ) & 0xFF ; -- cursor ; streamId += currByte << ( 8 * cursor ) ; if ( cursor == 0 ) { // Most significant bit MUST be ignored as per specification . streamId &= 0x7F_FF_FF_FF ; return true ; } break ; } default : { throw new IllegalStateException ( ) ; } } } return false ;
public class HttpSessionsTableModel { /** * Returns the type of column for given column index . * @ param columnIndex the column index * @ return the column class */ @ Override public Class < ? > getColumnClass ( int columnIndex ) { } }
switch ( columnIndex ) { case 0 : return Boolean . class ; case 1 : return String . class ; case 2 : return String . class ; case 3 : return Integer . class ; } return null ;
public class AbstractTraceFactory { /** * ( non - Javadoc ) * @ see com . ibm . ws . objectManager . utils . AbstractTraceFactory # applyActiveTrace ( ) */ void applyActiveTrace ( ) throws java . io . IOException { } }
String [ ] names = activeNames . split ( ":" ) ; // Loop over existing Components . for ( java . util . Iterator traceIterator = activeTrace . values ( ) . iterator ( ) ; traceIterator . hasNext ( ) ; ) { AbstractTrace abstractTrace = ( AbstractTrace ) traceIterator . next ( ) ; int traceLevelToSet = Trace . Level_None ; // Loop over active Components , testing to see if any of them is a match . for ( int i = 0 ; i < names . length ; i ++ ) { String name = names [ i ] ; if ( name . equals ( "*" ) ) name = ".*" ; if ( java . util . regex . Pattern . matches ( name , abstractTrace . getSourceClass ( ) . getName ( ) ) ) traceLevelToSet = traceLevel ; } // for names . . . abstractTrace . setLevel ( traceLevelToSet ) ; } // for . . . activeTrace Map .
public class Group { /** * write _ attribute _ reply _ i - access limited to package Group */ @ Override GroupReplyList write_attribute_reply_i ( final int rid , final int tmo , final boolean fwd ) throws DevFailed { } }
synchronized ( this ) { final GroupReplyList reply = new GroupReplyList ( ) ; GroupReplyList sub_reply ; final Iterator it = elements . iterator ( ) ; while ( it . hasNext ( ) ) { final GroupElement ge = ( GroupElement ) it . next ( ) ; if ( ge instanceof GroupDeviceElement || fwd ) { sub_reply = ge . write_attribute_reply_i ( rid , tmo , fwd ) ; if ( sub_reply . isEmpty ( ) == false ) { reply . addAll ( sub_reply ) ; } if ( sub_reply . has_failed ( ) ) { reply . has_failed = true ; } } } return reply ; }
public class PlainTextEditor { /** * GEN - LAST : event _ buttonLoadActionPerformed */ private void buttonSaveActionPerformed ( java . awt . event . ActionEvent evt ) { } }
// GEN - FIRST : event _ buttonSaveActionPerformed final File home = new File ( System . getProperty ( "user.home" ) ) ; // NOI18N final File toSave = new FileChooserBuilder ( "user-home-dir" ) . setTitle ( java . util . ResourceBundle . getBundle ( "com/igormaznitsa/nbmindmap/i18n/Bundle" ) . getString ( "PlainTextEditor.buttonSaveActionPerformed.saveTitle" ) ) . addFileFilter ( TEXT_FILE_FILTER ) . setFileFilter ( TEXT_FILE_FILTER ) . setFilesOnly ( true ) . setDefaultWorkingDirectory ( home ) . showSaveDialog ( ) ; if ( toSave != null ) { try { final String text = getText ( ) ; FileUtils . writeStringToFile ( toSave , text , "UTF-8" ) ; // NOI18N } catch ( Exception ex ) { LOGGER . error ( "Error during text file saving" , ex ) ; // NOI18N NbUtils . msgError ( null , java . util . ResourceBundle . getBundle ( "com/igormaznitsa/nbmindmap/i18n/Bundle" ) . getString ( "PlainTextEditor.buttonSaveActionPerformed.msgError" ) ) ; } }
public class Router { /** * in CBL _ Router . m * - ( void ) sendResponseHeaders */ private Status sendResponseHeaders ( Status status ) { } }
// NOTE : Line 572-574 of CBL _ Router . m is not in CBL Java Core // This check is in sendResponse ( ) ; connection . getResHeader ( ) . add ( "Server" , String . format ( Locale . ENGLISH , "Couchbase Lite %s" , getVersionString ( ) ) ) ; // When response body is not null , we can assume that the body is JSON : boolean hasJSONBody = connection . getResponseBody ( ) != null ; String contentType = hasJSONBody ? CONTENT_TYPE_JSON : null ; // Check for a mismatch between the Accept request header and the response type : String accept = getRequestHeaderValue ( "Accept" ) ; if ( accept != null && accept . indexOf ( "*/*" ) < 0 ) { String baseContentType = connection . getBaseContentType ( ) ; if ( baseContentType == null ) baseContentType = contentType ; if ( baseContentType != null && accept . indexOf ( baseContentType ) < 0 ) { Log . w ( TAG , "Error 406: Can't satisfy request Accept: %s (Content-Type = %s)" , accept , contentType ) ; // Reset response body : connection . setResponseBody ( null ) ; status = new Status ( Status . NOT_ACCEPTABLE ) ; return status ; } } if ( contentType != null ) { Header resHeader = connection . getResHeader ( ) ; if ( resHeader != null && resHeader . get ( "Content-Type" ) == null ) resHeader . add ( "Content-Type" , contentType ) ; else Log . d ( TAG , "Cannot add Content-Type header because getResHeader() returned null" ) ; } // NOTE : Line 596-607 of CBL _ Router . m is not in CBL Java Core return status ;
public class MorfologikCatalanSpellerRule { /** * Match POS tag with regular expression */ private boolean matchPostagRegexp ( AnalyzedTokenReadings aToken , Pattern pattern ) { } }
for ( AnalyzedToken analyzedToken : aToken ) { String posTag = analyzedToken . getPOSTag ( ) ; if ( posTag == null ) { posTag = "UNKNOWN" ; } final Matcher m = pattern . matcher ( posTag ) ; if ( m . matches ( ) ) { return true ; } } return false ;
public class AbstractConfig { /** * { @ inheritDoc } */ @ Override public Object getValue ( String propertyName , Type propertyType , boolean optional ) { } }
Object value = getValue ( propertyName , propertyType , optional , ConfigProperty . UNCONFIGURED_VALUE ) ; return value ;
public class Sign { /** * 用公钥检验数字签名的合法性 * @ param data 数据 * @ param sign 签名 * @ return 是否验证通过 */ public boolean verify ( byte [ ] data , byte [ ] sign ) { } }
lock . lock ( ) ; try { signature . initVerify ( this . publicKey ) ; signature . update ( data ) ; return signature . verify ( sign ) ; } catch ( Exception e ) { throw new CryptoException ( e ) ; } finally { lock . unlock ( ) ; }
public class LDblToIntFunctionBuilder { /** * One of ways of creating builder . This is possibly the least verbose way where compiler should be able to guess the generic parameters . */ @ Nonnull public static LDblToIntFunction dblToIntFunctionFrom ( Consumer < LDblToIntFunctionBuilder > buildingFunction ) { } }
LDblToIntFunctionBuilder builder = new LDblToIntFunctionBuilder ( ) ; buildingFunction . accept ( builder ) ; return builder . build ( ) ;
public class InputSerializationMarshaller { /** * Marshall the given parameter object . */ public void marshall ( InputSerialization inputSerialization , ProtocolMarshaller protocolMarshaller ) { } }
if ( inputSerialization == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( inputSerialization . getCsv ( ) , CSV_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class DateUtils { /** * 将日期转换成时间 * @ param date { @ link Date } * @ param elseValue 日期为空返回默认时间 * @ return { @ link Time } * @ since 1.1.1 */ public static Time convertDateToTime ( Date date , Time elseValue ) { } }
return Checker . isNull ( date ) ? elseValue : new Time ( date . getTime ( ) ) ;
public class ByteCodeParser { /** * Parses a class constant pool entry . */ private ClassConstant parseClassConstant ( int index ) throws IOException { } }
int nameIndex = readShort ( ) ; return new ClassConstant ( _class . getConstantPool ( ) , index , nameIndex ) ;
public class WebpIO { /** * Convert normal image to webp file * @ param src nomal image path * @ param dest webp file path */ public void toWEBP ( String src , String dest ) { } }
toWEBP ( new File ( src ) , new File ( dest ) ) ;
public class Pair { /** * Makes grabbing the second value out of a collection of Pairs a bit easier , e . g . * given an iterable over Pair . of ( ? , String ) objects : * < br > * < code > * . . . = Iterables . transform ( iterable , Pair . & lt ; String & gt ; snd ( ) ) * < / code > * @ param < T > The expected data type for { @ link Pair # b } . * @ return a Function that returns null or the second value of the Pair , which also may be null */ @ Nonnull public static < T > Function < Pair < ? , ? extends T > , ? extends T > snd ( ) { } }
return new Function < Pair < ? , ? extends T > , T > ( ) { @ Nullable @ Override public T apply ( @ Nullable final Pair < ? , ? extends T > input ) { return ( input == null ) ? null : input . getSecond ( ) ; } } ;
public class Handler { /** * afterCompleted will need to handle COMPLETED event by sending message to the peer */ public void afterCompleted ( Event event ) { } }
ChaincodeMessage message = messageHelper ( event ) ; logger . debug ( String . format ( "[%s]sending COMPLETED to validator for tid" , shortID ( message ) ) ) ; try { serialSend ( message ) ; } catch ( Exception e ) { event . cancel ( new Exception ( "send COMPLETED failed %s" , e ) ) ; }
public class URL { /** * Compares two URLs , excluding the fragment component . < p > * Returns < code > true < / code > if this < code > URL < / code > and the * < code > other < / code > argument are equal without taking the * fragment component into consideration . * @ param other the < code > URL < / code > to compare against . * @ return < code > true < / code > if they reference the same remote object ; * < code > false < / code > otherwise . */ public boolean sameFile ( URL other ) { } }
try { return getDelegate ( ) . sameFile ( this , other ) ; } catch ( MalformedURLException e ) { return file . equals ( other . file ) ; }
public class EmbeddedJCA { /** * Shutdown * @ exception Throwable If an error occurs */ public void shutdown ( ) throws Throwable { } }
if ( ! started ) throw new IllegalStateException ( "Container not started" ) ; if ( shrinkwrapDeployments != null && ! shrinkwrapDeployments . isEmpty ( ) ) { List < File > copy = new ArrayList < File > ( shrinkwrapDeployments ) ; for ( File f : copy ) { removeDeployment ( f ) ; } } if ( fullProfile ) { undeploy ( SecurityActions . getClassLoader ( EmbeddedJCA . class ) , "ds.xml" ) ; undeploy ( SecurityActions . getClassLoader ( EmbeddedJCA . class ) , "jca.xml" ) ; undeploy ( SecurityActions . getClassLoader ( EmbeddedJCA . class ) , "transaction.xml" ) ; undeploy ( SecurityActions . getClassLoader ( EmbeddedJCA . class ) , "stdio.xml" ) ; undeploy ( SecurityActions . getClassLoader ( EmbeddedJCA . class ) , "naming.xml" ) ; } kernel . shutdown ( ) ; started = false ;
public class DRL5Expressions { /** * src / main / resources / org / drools / compiler / lang / DRL5Expressions . g : 672:1 : arguments : LEFT _ PAREN ( expressionList ) ? RIGHT _ PAREN ; */ public final void arguments ( ) throws RecognitionException { } }
Token LEFT_PAREN27 = null ; Token RIGHT_PAREN28 = null ; try { // src / main / resources / org / drools / compiler / lang / DRL5Expressions . g : 673:5 : ( LEFT _ PAREN ( expressionList ) ? RIGHT _ PAREN ) // src / main / resources / org / drools / compiler / lang / DRL5Expressions . g : 673:7 : LEFT _ PAREN ( expressionList ) ? RIGHT _ PAREN { LEFT_PAREN27 = ( Token ) match ( input , LEFT_PAREN , FOLLOW_LEFT_PAREN_in_arguments4069 ) ; if ( state . failed ) return ; if ( state . backtracking == 0 ) { helper . emit ( LEFT_PAREN27 , DroolsEditorType . SYMBOL ) ; } // src / main / resources / org / drools / compiler / lang / DRL5Expressions . g : 674:9 : ( expressionList ) ? int alt87 = 2 ; int LA87_0 = input . LA ( 1 ) ; if ( ( LA87_0 == BOOL || ( LA87_0 >= DECIMAL && LA87_0 <= DECR ) || LA87_0 == FLOAT || LA87_0 == HEX || ( LA87_0 >= ID && LA87_0 <= INCR ) || ( LA87_0 >= LEFT_PAREN && LA87_0 <= LESS ) || LA87_0 == MINUS || LA87_0 == NEGATION || LA87_0 == NULL || LA87_0 == PLUS || ( LA87_0 >= STAR && LA87_0 <= TIME_INTERVAL ) ) ) { alt87 = 1 ; } switch ( alt87 ) { case 1 : // src / main / resources / org / drools / compiler / lang / DRL5Expressions . g : 674:9 : expressionList { pushFollow ( FOLLOW_expressionList_in_arguments4081 ) ; expressionList ( ) ; state . _fsp -- ; if ( state . failed ) return ; } break ; } RIGHT_PAREN28 = ( Token ) match ( input , RIGHT_PAREN , FOLLOW_RIGHT_PAREN_in_arguments4092 ) ; if ( state . failed ) return ; if ( state . backtracking == 0 ) { helper . emit ( RIGHT_PAREN28 , DroolsEditorType . SYMBOL ) ; } } } catch ( RecognitionException re ) { throw re ; } finally { // do for sure before leaving }
public class Variable { /** * Set the value of the typed variable . * @ param value should be an object or wrapped bsh Primitive type . * if value is null the appropriate default value will be set for the * type : e . g . false for boolean , zero for integer types . */ public void setValue ( Object value , int context ) throws UtilEvalError { } }
// prevent final variable re - assign if ( hasModifier ( "final" ) ) { if ( this . value != null ) throw new UtilEvalError ( "Cannot re-assign final variable " + name + "." ) ; if ( value == null ) return ; } // TODO : should add isJavaCastable ( ) test for strictJava // ( as opposed to isJavaAssignable ( ) ) if ( type != null && type != Object . class && value != null ) { this . value = Types . castObject ( value , type , context == DECLARATION ? Types . CAST : Types . ASSIGNMENT ) ; value = this . value ; } this . value = value ; if ( this . value == null && context != DECLARATION ) this . value = Primitive . getDefaultValue ( type ) ; if ( lhs != null ) this . value = lhs . assign ( this . value , false /* strictjava */ ) ;
public class ContainerBase { /** * { @ inheritDoc } * @ see org . jboss . shrinkwrap . api . Archive # addAsDirectories ( org . jboss . shrinkwrap . api . ArchivePath [ ] ) */ @ Override public T addAsDirectories ( ArchivePath ... paths ) throws IllegalArgumentException { } }
this . getArchive ( ) . addAsDirectories ( paths ) ; return covarientReturn ( ) ;