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 "...
Map < String , Object > fileFieldNameValueMap = getFileFieldNameValue ( reqBodyAsString ) ; List < String > fileFieldsList = ( List < String > ) fileFieldNameValueMap . get ( FILES_FIELD ) ; MultipartEntityBuilder multipartEntityBuilder = MultipartEntityBuilder . create ( ) ; /* * Allow fileFieldsList to be null . * ...
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.calen...
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 ...
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 ) ...
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 , DevFai...
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 . startReq...
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 ...
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...
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 . Collec...
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 data...
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 ;...
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...
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 . */ p...
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 defaultVa...
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 > do...
// 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 ( containe...
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 = ( ( MVELDia...
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 ( Acce...
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 . * @...
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...
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 ...
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 parame...
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 tr...
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...
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 sche...
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 C...
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_PRIV...
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_...
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 ...
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 ext...
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 ) { /...
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 , . . . ) ...
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 */ p...
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 synta...
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 ...
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 ...
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 ( ! ...
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 Controlle...
ThreadUtils . ensureMainThread ( ) ; RouterTransaction topTransaction = backstack . peek ( ) ; boolean poppingTopController = topTransaction != null && topTransaction . controller == controller ; if ( poppingTopController ) { trackDestroyingController ( backstack . pop ( ) ) ; performControllerChange ( backstack . peek...
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 ...
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 nu...
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 . ...
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 -...
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 " + aConfi...
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 retr...
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...
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 ...
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 MessageDestin...
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 = n...
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 ...
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...
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...
return AzureServiceFuture . fromPageResponse ( getSiteDetectorSlotSinglePageAsync ( resourceGroupName , siteName , diagnosticCategory , detectorName , slot ) , new Func1 < String , Observable < ServiceResponse < Page < DetectorDefinitionInner > > > > ( ) { @ Override public Observable < ServiceResponse < Page < Detecto...
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...
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 , m...
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 ...
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 { @ co...
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 ...
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 < l...
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 ( MouseBut...
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 ( )...
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 ++ ) { pa...
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 ; ...
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...
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 * t...
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 ...
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 w...
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 ty...
// 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 ...
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 > DBInstanceIden...
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...
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 ; }...
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...
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_r...
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 ( "PlainTextEdi...
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 : boole...
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 ( )...
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 ex...
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 >...
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 ( Secu...
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 ( expressi...
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 co...
// 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...
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 ( ) ;