signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class ConvertDMatrixStruct { /** * Converts { @ link DMatrixRMaj } into { @ link DMatrix3x3}
* @ param input Input matrix .
* @ param output Output matrix . If null a new matrix will be declared .
* @ return Converted matrix . */
public static DMatrix3x3 convert ( DMatrixRMaj input , DMatrix3x3 output ) { ... | if ( output == null ) output = new DMatrix3x3 ( ) ; if ( input . getNumRows ( ) != output . getNumRows ( ) ) throw new IllegalArgumentException ( "Number of rows do not match" ) ; if ( input . getNumCols ( ) != output . getNumCols ( ) ) throw new IllegalArgumentException ( "Number of columns do not match" ) ; output . ... |
public class ServerTransportAcceptListener { /** * This method is used to clean up any resources that
* @ param connectionReference */
public void removeAllConversations ( Object connectionReference ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "removeAllConversations" , connectionReference ) ; final ArrayList list ; synchronized ( activeConversations ) { list = ( ArrayList ) activeConversations . remove ( connectionReference ) ; } // Remove the connection r... |
public class ClassUtil { /** * extracts the package from a className , return null , if there is none .
* @ param className
* @ return */
public static String extractPackage ( String className ) { } } | if ( className == null ) return null ; int index = className . lastIndexOf ( '.' ) ; if ( index != - 1 ) return className . substring ( 0 , index ) ; return null ; |
public class CPFriendlyURLEntryPersistenceImpl { /** * Returns all the cp friendly url entries .
* @ return the cp friendly url entries */
@ Override public List < CPFriendlyURLEntry > findAll ( ) { } } | return findAll ( QueryUtil . ALL_POS , QueryUtil . ALL_POS , null ) ; |
public class MatchConditionOnElements { /** * Removes the pseudo class from the given element name . Element names are case - insensitive .
* @ param name the element name
* @ param pseudoClass the pseudo class to be removed */
public void removeMatch ( String name , PseudoClassType pseudoClass ) { } } | if ( names != null ) { Set < PseudoClassType > classes = names . get ( name ) ; if ( classes != null ) classes . remove ( pseudoClass ) ; } |
public class MessageBirdClient { /** * List voice messages
* @ param offset offset for result list
* @ param limit limit for result list
* @ return VoiceMessageList
* @ throws UnauthorizedException if client is unauthorized
* @ throws GeneralException general exception */
public VoiceMessageList listVoiceMess... | if ( offset != null && offset < 0 ) { throw new IllegalArgumentException ( "Offset must be > 0" ) ; } if ( limit != null && limit < 0 ) { throw new IllegalArgumentException ( "Limit must be > 0" ) ; } return messageBirdService . requestList ( VOICEMESSAGESPATH , offset , limit , VoiceMessageList . class ) ; |
public class RegionInstanceGroupManagerClient { /** * Deletes the specified managed instance group and all of the instances in that group .
* < p > Sample code :
* < pre > < code >
* try ( RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient . create ( ) ) {
* Pro... | DeleteRegionInstanceGroupManagerHttpRequest request = DeleteRegionInstanceGroupManagerHttpRequest . newBuilder ( ) . setInstanceGroupManager ( instanceGroupManager ) . build ( ) ; return deleteRegionInstanceGroupManager ( request ) ; |
public class ProtoParser { /** * com / dyuproject / protostuff / parser / ProtoParser . g : 581:1 : rpc _ block [ Proto proto , Service service ] : RPC n = ID LEFTPAREN ( ap = FULL _ ID | a = ( VOID | ID ) ) RIGHTPAREN RETURNS LEFTPAREN ( rp = FULL _ ID | r = ( VOID | ID ) ) RIGHTPAREN ( rpc _ body _ block [ proto , rm... | ProtoParser . rpc_block_return retval = new ProtoParser . rpc_block_return ( ) ; retval . start = input . LT ( 1 ) ; Object root_0 = null ; Token n = null ; Token ap = null ; Token a = null ; Token rp = null ; Token r = null ; Token RPC146 = null ; Token LEFTPAREN147 = null ; Token RIGHTPAREN148 = null ; Token RETURNS1... |
public class DeleteMatchmakingConfigurationRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( DeleteMatchmakingConfigurationRequest deleteMatchmakingConfigurationRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( deleteMatchmakingConfigurationRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( deleteMatchmakingConfigurationRequest . getName ( ) , NAME_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall... |
public class Config { /** * newConfigFromText create an empty configuration representation from text .
* @ param text the model text .
* @ return the constructor of Config . */
public static Config newConfigFromText ( String text ) { } } | Config c = new Config ( ) ; c . parseBuffer ( new BufferedReader ( new StringReader ( text ) ) ) ; return c ; |
public class DexProxyBuilder { /** * Generates dynamic { @ link android . view . View } proxy class . */
@ SuppressWarnings ( "unchecked" ) static < T , G extends T > Class < G > generateProxyClass ( Context context , Class < T > baseClass ) throws IOException { } } | // Cache missed ; generate the proxy class .
final DexMaker dexMaker = new DexMaker ( ) ; final String proxyClassName = getClassNameForProxyOf ( baseClass ) ; final TypeId < G > generatedType = TypeId . get ( "L" + proxyClassName + ";" ) ; final TypeId < T > baseType = TypeId . get ( baseClass ) ; generateConstructorAn... |
public class FileSystemGroupStore { /** * Answers if < code > file < / code > contains < code > member < / code > .
* @ param file
* @ param member
* @ return boolean */
private boolean fileContains ( File file , IGroupMember member ) throws GroupsException { } } | Collection ids = null ; try { ids = member . isGroup ( ) ? getGroupIdsFromFile ( file ) : getEntityIdsFromFile ( file ) ; } catch ( Exception ex ) { throw new GroupsException ( "Error retrieving ids from file" , ex ) ; } return ids . contains ( member . getKey ( ) ) ; |
public class ReflectionUtils { /** * Searches the method methodToFind in given class cls . If the method is found returns it , else return null .
* @ param methodToFind is the method to search
* @ param cls is the class or interface where to search
* @ return method if it is found */
public static Method findMeth... | if ( cls == null ) { return null ; } String methodToSearch = methodToFind . getName ( ) ; Class < ? > [ ] soughtForParameterType = methodToFind . getParameterTypes ( ) ; Type [ ] soughtForGenericParameterType = methodToFind . getGenericParameterTypes ( ) ; for ( Method method : cls . getMethods ( ) ) { if ( method . ge... |
public class JSONUtil { /** * 对所有双引号做转义处理 ( 使用双反斜杠做转义 ) < br >
* 为了能在HTML中较好的显示 , 会将 & lt ; / 转义为 & lt ; \ / < br >
* JSON字符串中不能包含控制字符和未经转义的引号和反斜杠
* @ param string 字符串
* @ param isWrap 是否使用双引号包装字符串
* @ return 适合在JSON中显示的字符串
* @ since 3.3.1 */
public static String quote ( String string , boolean isWrap ) { }... | StringWriter sw = new StringWriter ( ) ; try { return quote ( string , sw , isWrap ) . toString ( ) ; } catch ( IOException ignored ) { // will never happen - we are writing to a string writer
return StrUtil . EMPTY ; } |
public class GridSearch { /** * Start a new grid search job . This is the method that gets called by GridSearchHandler . do _ train ( ) .
* This method launches a " classical " grid search traversing cartesian grid of parameters
* point - by - point , < b > or < / b > a random hyperparameter search , depending on t... | return startGridSearch ( destKey , BaseWalker . WalkerFactory . create ( params , hyperParams , paramsBuilderFactory , searchCriteria ) ) ; |
public class OptionalInt { /** * If a value is present , performs the given action with the value ,
* otherwise performs the empty - based action .
* @ param consumer the consumer function to be executed , if a value is present
* @ param emptyAction the empty - based action to be performed , if no value is presen... | if ( isPresent ) { consumer . accept ( value ) ; } else { emptyAction . run ( ) ; } |
public class ChangedByHandler { /** * Set this cloned listener to the same state at this listener .
* @ param field The field this new listener will be added to .
* @ param The new listener to sync to this .
* @ param Has the init method been called ?
* @ return True if I called init . */
public boolean syncClo... | bInitCalled = super . syncClonedListener ( field , listener , bInitCalled ) ; ( ( ChangedByHandler ) listener ) . setMainFilesFieldSeq ( m_iMainFilesFieldSeq ) ; return bInitCalled ; |
public class SampleSetEQOracle { /** * Adds several query words to the sample set . The expected output is determined by means of the specified
* membership oracle .
* @ param oracle
* the membership oracle used to determine expected outputs
* @ param words
* the words to be added to the sample set
* @ retu... | return addAll ( oracle , Arrays . asList ( words ) ) ; |
public class AWSIotClient { /** * Lists the Device Defender security profile violations discovered during the given time period . You can use
* filters to limit the results to those alerts issued for a particular security profile , behavior or thing
* ( device ) .
* @ param listViolationEventsRequest
* @ return... | request = beforeClientExecution ( request ) ; return executeListViolationEvents ( request ) ; |
public class MaterialAPI { /** * 新增其他类型永久素材
* @ param access _ token access _ token
* @ param mediaType mediaType
* @ param inputStream 多媒体文件有格式和大小限制 , 如下 :
* 图片 ( image ) : 2M , 支持bmp / png / jpeg / jpg / gif格式
* 语音 ( voice ) : 5M , 播放长度不超过60s , 支持AMR \ MP3格式
* 视频 ( video ) : 10MB , 支持MP4格式
* 缩略图 ( thumb... | HttpPost httpPost = new HttpPost ( BASE_URI + "/cgi-bin/material/add_material" ) ; byte [ ] data = null ; try { data = StreamUtils . copyToByteArray ( inputStream ) ; } catch ( IOException e ) { logger . error ( "" , e ) ; } MultipartEntityBuilder multipartEntityBuilder = MultipartEntityBuilder . create ( ) . addBinary... |
public class RebalanceUtils { /** * Prints a stores xml to a file .
* @ param outputDirName
* @ param fileName
* @ param list of storeDefs */
public static void dumpStoreDefsToFile ( String outputDirName , String fileName , List < StoreDefinition > storeDefs ) { } } | if ( outputDirName != null ) { File outputDir = new File ( outputDirName ) ; if ( ! outputDir . exists ( ) ) { Utils . mkdirs ( outputDir ) ; } try { FileUtils . writeStringToFile ( new File ( outputDirName , fileName ) , new StoreDefinitionsMapper ( ) . writeStoreList ( storeDefs ) ) ; } catch ( IOException e ) { logg... |
public class MyMultiSegmentationEvaluator { /** * it ' s bad , but mallet logging is worse */
@ SuppressWarnings ( "rawtypes" ) public void evaluateInstanceList ( TransducerTrainer tt , InstanceList data , String description ) { } } | Transducer model = tt . getTransducer ( ) ; int numCorrectTokens , totalTokens ; int [ ] numTrueSegments , numPredictedSegments , numCorrectSegments ; int allIndex = segmentStartTags . length ; numTrueSegments = new int [ allIndex + 1 ] ; numPredictedSegments = new int [ allIndex + 1 ] ; numCorrectSegments = new int [ ... |
public class SessionUtils { /** * Sets the name of the Dart controller name as defined in the dart file ( @ NGController ' s publishAs attribute ) .
* @ param name the name of the Dart controller */
public static void setControllerName ( String name ) { } } | Map < String , Object > sessionMap = FacesContext . getCurrentInstance ( ) . getExternalContext ( ) . getSessionMap ( ) ; sessionMap . put ( DART_CONTROLLER_NAME , name ) ; |
public class ContainerProperties { /** * The mount points for data volumes in your container . This parameter maps to < code > Volumes < / code > in the < a
* href = " https : / / docs . docker . com / engine / api / v1.23 / # create - a - container " > Create a container < / a > section of the < a
* href = " https... | if ( this . mountPoints == null ) { setMountPoints ( new java . util . ArrayList < MountPoint > ( mountPoints . length ) ) ; } for ( MountPoint ele : mountPoints ) { this . mountPoints . add ( ele ) ; } return this ; |
public class IntegerKeyframeAnimation { /** * Optimization to avoid autoboxing . */
int getIntValue ( Keyframe < Integer > keyframe , float keyframeProgress ) { } } | if ( keyframe . startValue == null || keyframe . endValue == null ) { throw new IllegalStateException ( "Missing values for keyframe." ) ; } if ( valueCallback != null ) { // noinspection ConstantConditions
Integer value = valueCallback . getValueInternal ( keyframe . startFrame , keyframe . endFrame , keyframe . start... |
public class ImageArchiveUtil { /** * Search the manifest for an entry that has the repository and tag provided .
* @ param repoTag the repository and tag to search ( e . g . busybox : latest ) .
* @ param manifest the manifest to be searched
* @ return the entry found , or null if no match . */
public static Ima... | if ( repoTag == null || manifest == null ) { return null ; } for ( ImageArchiveManifestEntry entry : manifest . getEntries ( ) ) { for ( String entryRepoTag : entry . getRepoTags ( ) ) { if ( repoTag . equals ( entryRepoTag ) ) { return entry ; } } } return null ; |
public class DatabaseRecommendedActionsInner { /** * Gets list of Database Recommended Actions .
* @ param resourceGroupName The name of the resource group that contains the resource . You can obtain this value from the Azure Resource Manager API or the portal .
* @ param serverName The name of the server .
* @ p... | return ServiceFuture . fromResponse ( listByDatabaseAdvisorWithServiceResponseAsync ( resourceGroupName , serverName , databaseName , advisorName ) , serviceCallback ) ; |
public class CmsConfigurationCache { /** * Loads the available element views . < p >
* @ return the element views */
protected Map < CmsUUID , CmsElementView > loadElementViews ( ) { } } | List < CmsElementView > views = new ArrayList < CmsElementView > ( ) ; if ( m_cms . existsResource ( "/" ) ) { views . add ( CmsElementView . DEFAULT_ELEMENT_VIEW ) ; try { @ SuppressWarnings ( "deprecation" ) CmsResourceFilter filter = CmsResourceFilter . ONLY_VISIBLE_NO_DELETED . addRequireType ( m_elementViewType . ... |
public class ProductViewDetailMarshaller { /** * Marshall the given parameter object . */
public void marshall ( ProductViewDetail productViewDetail , ProtocolMarshaller protocolMarshaller ) { } } | if ( productViewDetail == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( productViewDetail . getProductViewSummary ( ) , PRODUCTVIEWSUMMARY_BINDING ) ; protocolMarshaller . marshall ( productViewDetail . getStatus ( ) , STATUS_BINDING ) ; p... |
public class ClassUtils { /** * Lookup the setter method for the given property .
* @ param clazz
* type which contains the property .
* @ param propertyName
* name of the property .
* @ param propertyType
* type of the property .
* @ return a Method with write - access for the property . */
public static... | String propertyNameCapitalized = capitalize ( propertyName ) ; try { return clazz . getMethod ( "set" + propertyNameCapitalized , new Class [ ] { propertyType } ) ; } catch ( Exception e ) { return null ; } |
public class PackageManagerUtils { /** * Checks if the device has a GPS location feature .
* @ param context the context .
* @ return { @ code true } if the device has a GPS location feature . */
@ TargetApi ( Build . VERSION_CODES . FROYO ) public static boolean hasGpsLocationFeature ( Context context ) { } } | return hasGpsLocationFeature ( context . getPackageManager ( ) ) ; |
public class CmsJspVfsAccessBean { /** * Returns a map that lazily reads resources from the OpenCms VFS . < p >
* Usage example on a JSP with the EL : < pre >
* Root path of the " / index . html " resource : $ { cms : vfs ( pageContext ) . readResource [ ' / index . html ' ] . rootPath }
* < / pre >
* Usage exa... | if ( m_resources == null ) { // create lazy map only on demand
m_resources = CmsCollectionsGenericWrapper . createLazyMap ( new CmsResourceLoaderTransformer ( ) ) ; } return m_resources ; |
public class HFClient { /** * Query the peer for installed chaincode information
* @ param peer The peer to query .
* @ return List of ChaincodeInfo on installed chaincode @ see { @ link ChaincodeInfo }
* @ throws InvalidArgumentException
* @ throws ProposalException
* @ deprecated See { @ link LifecycleQuery... | clientCheck ( ) ; if ( null == peer ) { throw new InvalidArgumentException ( "peer set to null" ) ; } try { // Run this on a system channel .
Channel systemChannel = Channel . newSystemChannel ( this ) ; return systemChannel . queryInstalledChaincodes ( peer ) ; } catch ( ProposalException e ) { logger . error ( format... |
public class CommerceShipmentItemPersistenceImpl { /** * Returns a range of all the commerce shipment items where commerceShipmentId = & # 63 ; .
* Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and < code > end < / code > are not primary ke... | return findByCommerceShipment ( commerceShipmentId , start , end , null ) ; |
public class BaseAuthenticationProvider { /** * Merges authorities granted ( or revoked ) by the system with those granted by the security
* domain .
* @ param userGrants Authorities granted by the security domain .
* @ param systemGrants Authorities granted by the system .
* @ return A merged set of granted au... | Set < String > authorities = userGrants == null ? new HashSet < > ( ) : new HashSet < > ( userGrants ) ; for ( String grantedAuthority : systemGrantedAuthorities ) { if ( grantedAuthority . startsWith ( "-" ) ) { authorities . remove ( grantedAuthority . substring ( 1 ) ) ; } else { authorities . add ( grantedAuthority... |
public class Bytes { /** * Appends two bytes array into one .
* @ param a A byte [ ] .
* @ param b A byte [ ] .
* @ return A byte [ ] . */
public static byte [ ] append ( byte [ ] a , byte [ ] b ) { } } | byte [ ] z = new byte [ a . length + b . length ] ; System . arraycopy ( a , 0 , z , 0 , a . length ) ; System . arraycopy ( b , 0 , z , a . length , b . length ) ; return z ; |
public class ResourceRecordSets { /** * creates mx set of { @ link denominator . model . rdata . MXData MX } records for the specified name and
* ttl .
* @ param name ex . { @ code denominator . io . }
* @ param mxdata { @ code 1 mx1 . denominator . io . } */
public static ResourceRecordSet < MXData > mx ( String... | return new MXBuilder ( ) . name ( name ) . add ( mxdata ) . build ( ) ; |
public class FormLayout { /** * Inserts the specified column at the specified position . Shifts components that intersect the
* new column to the right and readjusts column groups . < p >
* The component shift works as follows : components that were located on the right hand side of
* the inserted column are shif... | if ( rowIndex < 1 || rowIndex > getRowCount ( ) ) { throw new IndexOutOfBoundsException ( "The row index " + rowIndex + " must be in the range [1, " + getRowCount ( ) + "]." ) ; } rowSpecs . add ( rowIndex - 1 , rowSpec ) ; shiftComponentsVertically ( rowIndex , false ) ; adjustGroupIndices ( rowGroupIndices , rowIndex... |
public class NetworkEndpointGroupClient { /** * Retrieves the list of network endpoint groups and sorts them by zone .
* < p > Sample code :
* < pre > < code >
* try ( NetworkEndpointGroupClient networkEndpointGroupClient = NetworkEndpointGroupClient . create ( ) ) {
* ProjectName project = ProjectName . of ( "... | AggregatedListNetworkEndpointGroupsHttpRequest request = AggregatedListNetworkEndpointGroupsHttpRequest . newBuilder ( ) . setProject ( project ) . build ( ) ; return aggregatedListNetworkEndpointGroups ( request ) ; |
public class CmsSolrQuery { /** * Creates a filter query on the given field name . < p >
* Creates and adds a filter query . < p >
* @ param fieldName the field name to create a filter query on
* @ param vals the values that should match for the given field
* @ param all < code > true < / code > to combine the ... | String filterQuery = null ; if ( ( vals != null ) ) { if ( vals . size ( ) == 1 ) { if ( useQuotes ) { filterQuery = fieldName + ":" + "\"" + vals . get ( 0 ) + "\"" ; } else { filterQuery = fieldName + ":" + vals . get ( 0 ) ; } } else if ( vals . size ( ) > 1 ) { filterQuery = fieldName + ":(" ; for ( int j = 0 ; j <... |
public class AbstractParsedStmt { /** * Lookup or define the shared part of a common table by name . This happens when the
* common table name is first encountered . For example ,
* in the SQL : " with name as ( select * from ttt ) select name as a , name as b "
* the name " name " is a common table name . It ' s... | assert ( m_commonTableSharedMap . get ( tableName ) == null ) ; StmtCommonTableScanShared answer = new StmtCommonTableScanShared ( tableName , stmtId ) ; m_commonTableSharedMap . put ( tableName , answer ) ; return answer ; |
public class SqlValidatorImpl { /** * Checks that all pattern variables within a function are the same ,
* and canonizes expressions such as { @ code PREV ( B . price ) } to
* { @ code LAST ( B . price , 0 ) } . */
private SqlNode navigationInDefine ( SqlNode node , String alpha ) { } } | Set < String > prefix = node . accept ( new PatternValidator ( false ) ) ; Util . discard ( prefix ) ; node = new NavigationExpander ( ) . go ( node ) ; node = new NavigationReplacer ( alpha ) . go ( node ) ; return node ; |
public class PicassoImageLoader { /** * Given a listener passed as argument creates or returns a lazy instance of a Picasso Target .
* This implementation is needed because Picasso doesn ' t keep a strong reference to the target
* passed as parameter . Without this method Picasso looses the reference to the target ... | ListenerTarget target = targets . get ( listener ) ; if ( target == null ) { target = new ListenerTarget ( listener ) ; targets . put ( listener , target ) ; } return target ; |
public class ScopedResponseImpl { /** * Gets the first header with the given name .
* @ return an Object ( String , Integer , Date , Cookie ) that is the first header with the given name ,
* or < code > null < / code > if none is found . */
public Object getFirstHeader ( String name ) { } } | List foundHeaders = ( List ) _headers . get ( name ) ; return ! foundHeaders . isEmpty ( ) ? foundHeaders . get ( 0 ) : null ; |
public class InstrumentedScheduledExecutorService { /** * { @ inheritDoc } */
@ Override public < T > Future < T > submit ( Callable < T > task ) { } } | submitted . mark ( ) ; return delegate . submit ( new InstrumentedCallable < > ( task ) ) ; |
public class Statement { /** * Return an Observable that emits the emissions from one specified
* Observable if a condition evaluates to true , or from another specified
* Observable otherwise .
* < img width = " 640 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / ... | return Observable . create ( new OperatorIfThen < R > ( condition , then , orElse ) ) ; |
public class HeightSpec { /** * Create a height element with an absolute value .
* @ param fValue
* The height to use . Must be & gt ; 0.
* @ return Never < code > null < / code > . */
@ Nonnull public static HeightSpec abs ( @ Nonnegative final float fValue ) { } } | ValueEnforcer . isGT0 ( fValue , "Value" ) ; return new HeightSpec ( EValueUOMType . ABSOLUTE , fValue ) ; |
public class AddOn { /** * Removes the given { @ code extension } from the list of loaded extensions of this add - on .
* The add - on of the given { @ code extension } is set to { @ code null } .
* The call to this method has no effect if the given { @ code extension } does not belong to this add - on .
* @ para... | if ( extension == null ) { throw new IllegalArgumentException ( "Parameter extension must not be null." ) ; } if ( loadedExtensions != null && loadedExtensions . contains ( extension ) ) { loadedExtensions . remove ( extension ) ; extension . setAddOn ( null ) ; } |
public class InfixParser { /** * Parse infix string expression with additional properties
* @ param operationRegister
* @ param properties
* @ param infixExpression
* @ param values
* @ return
* @ throws ParseException */
public CList parse ( UseExtension operationRegister , Properties properties , String i... | pUsedExtensions = null ; this . usedExtensions = operationRegister ; this . properties = properties ; return parse ( infixExpression , values ) ; |
public class AbstractRegionPainter { /** * Gets the rendered image for this painter at the requested size , either
* from cache or create a new one
* @ param config the graphics configuration .
* @ param c the component to paint .
* @ param w the component width .
* @ param h the component height .
* @ para... | ImageCache imageCache = ImageCache . getInstance ( ) ; // get the buffer for this component
VolatileImage buffer = ( VolatileImage ) imageCache . getImage ( config , w , h , this , extendedCacheKeys ) ; int renderCounter = 0 ; // to avoid any potential , though unlikely ,
// infinite loop
do { // validate the buffer so... |
public class LastaPrepareFilter { protected void viaHotdeploy ( HttpServletRequest request , HttpServletResponse response , FilterChain chain ) throws IOException , ServletException { } } | if ( ! ManagedHotdeploy . isHotdeploy ( ) ) { // e . g . production , unit - test
toNextFilter ( request , response , chain ) ; // # to _ action
return ; } final String loaderKey = HOTDEPLOY_CLASSLOADER_KEY ; if ( request . getAttribute ( loaderKey ) != null ) { // check recursive call
final ClassLoader loader = ( Clas... |
public class ESSharedStateComponent { /** * Reads a stored primitive .
* @ param result */
protected Object readPrimitive ( JestResult result ) throws Exception { } } | PrimitiveBean pb = result . getSourceAsObject ( PrimitiveBean . class ) ; String value = pb . getValue ( ) ; Class < ? > c = Class . forName ( pb . getType ( ) ) ; return BackingStoreUtil . readPrimitive ( c , value ) ; |
public class EmailExtensions { /** * Creates an Address from the given the email address as String object .
* @ param address
* The address in RFC822 format .
* @ return The created InternetAddress - object from the given address .
* @ throws UnsupportedEncodingException
* is thrown if the encoding not suppor... | return newAddress ( address , null , null ) ; |
public class MapSubject { /** * Fails if the map contains the given entry . */
public void doesNotContainEntry ( @ NullableDecl Object key , @ NullableDecl Object value ) { } } | checkNoNeedToDisplayBothValues ( "entrySet()" ) . that ( actual ( ) . entrySet ( ) ) . doesNotContain ( immutableEntry ( key , value ) ) ; |
public class MysqlBaseService { /** * This is a utility function to get the names of all
* the tables that ' re in the database supplied
* @ param database the database name
* @ param stmt Statement object
* @ return List \ < String \ >
* @ throws SQLException exception */
static List < String > getAllTables ... | List < String > table = new ArrayList < > ( ) ; ResultSet rs ; rs = stmt . executeQuery ( "SHOW TABLE STATUS FROM `" + database + "`;" ) ; while ( rs . next ( ) ) { table . add ( rs . getString ( "Name" ) ) ; } return table ; |
public class FessMessages { /** * Add the created action message for the key ' constraints . Mod11Check . message ' with parameters .
* < pre >
* message : The check digit for $ { value } is invalid , Modulo 11 checksum failed .
* < / pre >
* @ param property The property name for the message . ( NotNull )
* ... | assertPropertyNotNull ( property ) ; add ( property , new UserMessage ( CONSTRAINTS_Mod11Check_MESSAGE , value ) ) ; return this ; |
public class CompactIntArray { /** * Set the integer at the given index . < b > Warning : < / b > if you attempt to store an integer that
* is wider than the width given to the constructor { @ link # CompactIntArray ( int , int ) } , the integer
* is truncated .
* @ param index The index .
* @ param value The v... | if ( d_bitsPerElem == 0 ) return ; int startIdx = ( index * d_bitsPerElem ) / INT_SIZE ; int startBit = ( index * d_bitsPerElem ) % INT_SIZE ; // Clear data
d_data [ startIdx ] &= ~ ( MASK [ d_bitsPerElem ] << startBit ) ; // And set .
d_data [ startIdx ] |= value << startBit ; // If the integer didn ' t have enough bi... |
public class AssertKripton { /** * Fail incompatible attributes in annotation exception .
* @ param messageFormat
* the message format
* @ param args
* the args */
public static void failIncompatibleAttributesInAnnotationException ( String messageFormat , Object ... args ) { } } | throw ( new IncompatibleAttributesInAnnotationException ( String . format ( messageFormat , args ) ) ) ; |
public class AmazonIdentityManagementWaiters { /** * Builds a PolicyExists waiter by using custom parameters waiterParameters and other parameters defined in the
* waiters specification , and then polls until it determines whether the resource entered the desired state or not ,
* where polling criteria is bound by ... | return new WaiterBuilder < GetPolicyRequest , GetPolicyResult > ( ) . withSdkFunction ( new GetPolicyFunction ( client ) ) . withAcceptors ( new HttpSuccessStatusAcceptor ( WaiterState . SUCCESS ) , new PolicyExists . IsNoSuchEntityMatcher ( ) ) . withDefaultPollingStrategy ( new PollingStrategy ( new MaxAttemptsRetryS... |
public class GraphicalModel { /** * Add a conditional factor , as per a Bayes net .
* Note that unlike the case with other factors , this function takes as input < b > probabilities < / b > and not
* unnormalized factor values .
* In other words , we do not exponentiate the values coming from the assignment funct... | // Create variables for the global factor
int [ ] allDimensions = new int [ antecedentDimensions . length + 1 ] ; System . arraycopy ( antecedentDimensions , 0 , allDimensions , 0 , antecedentDimensions . length ) ; allDimensions [ allDimensions . length - 1 ] = consequentDimension ; int [ ] allNeighbors = new int [ an... |
public class Ifc2x3tc1FactoryImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public IfcPhysicalOrVirtualEnum createIfcPhysicalOrVirtualEnumFromString ( EDataType eDataType , String initialValue ) { } } | IfcPhysicalOrVirtualEnum result = IfcPhysicalOrVirtualEnum . get ( initialValue ) ; if ( result == null ) throw new IllegalArgumentException ( "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType . getName ( ) + "'" ) ; return result ; |
public class CacheManagerBuilder { /** * Adds a default { @ link SizeOfEngine } configuration , that limits the max object graph to
* size , to the returned builder .
* @ param size the max object graph size
* @ return a new builder with the added configuration */
public CacheManagerBuilder < T > withDefaultSizeO... | DefaultSizeOfEngineProviderConfiguration configuration = configBuilder . findServiceByClass ( DefaultSizeOfEngineProviderConfiguration . class ) ; if ( configuration == null ) { return new CacheManagerBuilder < > ( this , configBuilder . addService ( new DefaultSizeOfEngineProviderConfiguration ( DEFAULT_MAX_OBJECT_SIZ... |
public class ContentManager { /** * Gets document stream from WorkDocs .
* If VersionId of GetDocumentStreamRequest is not specified ,
* then the latest version of specified document is retrieved .
* Clients must close the stream once content is read .
* @ param getDocumentStreamRequest Request specifying param... | String versionId = getDocumentStreamRequest . getVersionId ( ) ; if ( versionId == null ) { GetDocumentRequest getDocumentRequest = new GetDocumentRequest ( ) ; getDocumentRequest . setDocumentId ( getDocumentStreamRequest . getDocumentId ( ) ) ; String requestAuthenticationToken = getDocumentStreamRequest . getAuthent... |
public class IPSImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public void setXpsOset ( Integer newXpsOset ) { } } | Integer oldXpsOset = xpsOset ; xpsOset = newXpsOset ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , AfplibPackage . IPS__XPS_OSET , oldXpsOset , xpsOset ) ) ; |
public class SlaveComputer { /** * Obtains a { @ link VirtualChannel } that allows some computation to be performed on the master .
* This method can be called from any thread on the master , or from agent ( more precisely ,
* it only works from the remoting request - handling thread in agents , which means if you ... | if ( Jenkins . getInstanceOrNull ( ) != null ) // check if calling thread is on master or on slave
return FilePath . localChannel ; // if this method is called from within the agent computation thread , this should work
Channel c = Channel . current ( ) ; if ( c != null && Boolean . TRUE . equals ( c . getProperty ( "s... |
public class Kit { /** * Attempt to load the class of the given name . Note that the type parameter
* isn ' t checked . */
public static Class < ? > classOrNull ( ClassLoader loader , String className ) { } } | try { return loader . loadClass ( className ) ; } catch ( ClassNotFoundException ex ) { } catch ( SecurityException ex ) { } catch ( LinkageError ex ) { } catch ( IllegalArgumentException e ) { // Can be thrown if name has characters that a class name
// can not contain
} return null ; |
public class TThreadedSelectorServerWithFix { /** * Helper to create the invoker if one is not specified */
protected static ExecutorService createDefaultExecutor ( Args options ) { } } | return ( options . workerThreads > 0 ) ? Executors . newFixedThreadPool ( options . workerThreads ) : null ; |
public class QueueName { /** * Add this key area description to the Record . */
public KeyArea setupKey ( int iKeyArea ) { } } | KeyArea keyArea = null ; if ( iKeyArea == 0 ) { keyArea = this . makeIndex ( DBConstants . UNIQUE , ID_KEY ) ; keyArea . addKeyField ( ID , DBConstants . ASCENDING ) ; } if ( iKeyArea == 1 ) { keyArea = this . makeIndex ( DBConstants . SECONDARY_KEY , NAME_KEY ) ; keyArea . addKeyField ( NAME , DBConstants . ASCENDING ... |
public class FSDataset { /** * is this block finalized ? Returns true if the block is already
* finalized , otherwise returns false . */
private boolean isBlockFinalizedWithLock ( int namespaceId , Block b ) { } } | lock . readLock ( ) . lock ( ) ; try { return isBlockFinalizedInternal ( namespaceId , b , true ) ; } finally { lock . readLock ( ) . unlock ( ) ; } |
public class Utils { /** * Replies if the given type is an interface .
* @ param type - the type to test .
* @ return < code > true < / code > if the given type is an interface . */
public static boolean isInterface ( LightweightTypeReference type ) { } } | return type . getType ( ) instanceof JvmGenericType && ( ( JvmGenericType ) type . getType ( ) ) . isInterface ( ) ; |
public class IndexByPlaceRenderer { /** * Build the index .
* @ return the complete index */
private Map < String , Set < PersonRenderer > > createWholeIndex ( ) { } } | logger . info ( "In getWholeIndex" ) ; final Map < String , Set < PersonRenderer > > aMap = new TreeMap < > ( ) ; if ( ! getRenderingContext ( ) . isUser ( ) ) { logger . info ( "Leaving getWholeIndex not logged in" ) ; return aMap ; } final Collection < Person > persons = getGedObject ( ) . find ( Person . class ) ; f... |
public class TimeoutHelper { /** * Calls task but ensures it ends .
* @ param description description of task .
* @ param timeout timeout in milliseconds .
* @ param task task to execute . */
public void callWithTimeout ( String description , int timeout , Runnable task ) { } } | Future < ? > callFuture = threadPool . submit ( task ) ; getWithTimeout ( callFuture , timeout , description ) ; |
public class WildcardsCompiler { /** * Compiles wildcard pattern into a regular expression .
* Allowed wildcards : < br >
* < br >
* & nbsp ; & nbsp ; & nbsp ; * - matches any sequence of characters < br >
* & nbsp ; & nbsp ; & nbsp ; $ - matches end of sequence < br >
* @ param patternWithWildcards pattern w... | StringBuilder sb = new StringBuilder ( ) ; for ( int i = 0 ; i < patternWithWildcards . length ( ) ; i ++ ) { char c = patternWithWildcards . charAt ( i ) ; switch ( c ) { case '*' : sb . append ( ".*" ) ; break ; case '$' : if ( i == patternWithWildcards . length ( ) - 1 ) { sb . append ( c ) ; } else { sb . append ( ... |
public class MultipleAlignmentJmol { /** * Generate a Jmol command String that colors the aligned residues of every
* structure . */
public static String getJmolString ( MultipleAlignment multAln , List < Atom [ ] > transformedAtoms , ColorBrewer colorPalette , boolean colorByBlocks ) { } } | // Color by blocks if specified
if ( colorByBlocks ) return getMultiBlockJmolString ( multAln , transformedAtoms , colorPalette , colorByBlocks ) ; Color [ ] colors = colorPalette . getColorPalette ( multAln . size ( ) ) ; StringBuffer j = new StringBuffer ( ) ; j . append ( DEFAULT_SCRIPT ) ; // Color the equivalent r... |
public class PredicatedSubscriber { /** * A method that casts the message and calls the method that uses generics . < br >
* Do not override .
* @ param o
* - The message .
* @ return Returns the same as the applies method .
* @ exception SubscriberTypeMismatchException
* the type the subscriber was bound t... | try { @ SuppressWarnings ( "unchecked" ) T o2 = ( T ) o ; return applies ( o2 ) ; } catch ( ClassCastException e ) { throw new SubscriberTypeMismatchException ( e ) ; } |
public class MultiLayerNetwork { /** * Fit the model for one iteration on the provided data
* @ param examples the examples to classify ( one example in each row )
* @ param labels the labels for each example ( the number of labels must match */
@ Override public void fit ( INDArray examples , int [ ] labels ) { } ... | org . deeplearning4j . nn . conf . layers . OutputLayer layerConf = ( org . deeplearning4j . nn . conf . layers . OutputLayer ) getOutputLayer ( ) . conf ( ) . getLayer ( ) ; // FIXME : int cast
fit ( examples , FeatureUtil . toOutcomeMatrix ( labels , ( int ) layerConf . getNOut ( ) ) ) ; |
public class XMLUtil { /** * Replies the boolean value that corresponds to the specified attribute ' s path .
* < p > The path is an ordered list of tag ' s names and ended by the name of
* the attribute .
* @ param document is the XML document to explore .
* @ param defaultValue is the default value to reply .... | assert document != null : AssertMessages . notNullParameter ( 0 ) ; return getAttributeBooleanWithDefault ( document , true , defaultValue , path ) ; |
public class LuceneQueryFactory { /** * Creates a new query factory which can be used to produce Lucene queries for { @ link org . modeshape . jcr . index . lucene . MultiColumnIndex }
* indexes .
* @ param factories a { @ link ValueFactories } instance ; may not be null
* @ param variables a { @ link Map } insta... | return new LuceneQueryFactory ( factories , variables , propertyTypesByName ) ; |
public class Cron4jNow { @ Override public synchronized void destroy ( ) { } } | if ( JobChangeLog . isEnabled ( ) ) { JobChangeLog . log ( "#job ...Destroying scheduler completely: jobs={} scheduler={}" , jobKeyJobMap . size ( ) , cron4jScheduler ) ; } // not use AsyncManager here , because not frequent call , keep no dependency to core
new Thread ( ( ) -> { // to release synchronized lock to avoi... |
public class CsvReader { public < T > T get ( int row , int col , DataType dataType ) { } } | List < String > rowList = row ( row ) ; if ( rowList == null || rowList . isEmpty ( ) || col >= rowList . size ( ) ) return nullFor ( dataType ) ; String cell = rowList . get ( col ) ; T results = toType ( cell , dataType ) ; return results ; |
public class JolokiaServerConfig { /** * Add detector specific options if given on the command line */
protected void prepareDetectorOptions ( Map < String , String > pConfig ) { } } | StringBuffer detectorOpts = new StringBuffer ( "{" ) ; if ( pConfig . containsKey ( "bootAmx" ) && Boolean . parseBoolean ( pConfig . get ( "bootAmx" ) ) ) { detectorOpts . append ( "\"glassfish\" : { \"bootAmx\" : true }" ) ; } if ( detectorOpts . length ( ) > 1 ) { detectorOpts . append ( "}" ) ; pConfig . put ( Conf... |
public class OWLExistentialReasonerImpl { /** * Gets the fillers of the existential restrictions that are entailed to be superclasses the specified class
* expression and act along the specified property . In essence , this finds bindings for ? x with respect to
* the following template : < code > SubClassOf ( ce O... | return getFillers ( ce , Arrays . asList ( property ) ) ; |
public class PolicyInformation { /** * Get the attribute value . */
public Object get ( String name ) throws IOException { } } | if ( name . equalsIgnoreCase ( ID ) ) { return policyIdentifier ; } else if ( name . equalsIgnoreCase ( QUALIFIERS ) ) { return policyQualifiers ; } else { throw new IOException ( "Attribute name [" + name + "] not recognized by PolicyInformation." ) ; } |
public class JsDocInfoParser { /** * ResultType : = < empty > | ' : ' void | ' : ' TypeExpression */
private Node parseResultType ( ) { } } | skipEOLs ( ) ; if ( ! match ( JsDocToken . COLON ) ) { return newNode ( Token . EMPTY ) ; } next ( ) ; skipEOLs ( ) ; if ( match ( JsDocToken . STRING ) && "void" . equals ( stream . getString ( ) ) ) { next ( ) ; return newNode ( Token . VOID ) ; } else { return parseTypeExpression ( next ( ) ) ; } |
public class DomHelpers { /** * Compare two DOM documents
* @ param d1 First DOM document
* @ param d2 Second DOM document
* @ return true if both are equal
* @ throws MarshalException */
public static boolean compare ( Document d1 , Document d2 ) throws MarshalException { } } | d1 . normalize ( ) ; d2 . normalize ( ) ; return d1 . isEqualNode ( d2 ) ; |
public class TransTypes { /** * Get the instance for this context . */
public static TransTypes instance ( Context context ) { } } | TransTypes instance = context . get ( transTypesKey ) ; if ( instance == null ) instance = new TransTypes ( context ) ; return instance ; |
public class TemplateFaxJob2HTTPRequestConverter { /** * This function initializes the component . */
@ Override protected void initializeImpl ( ) { } } | // init templates map
this . httpRequestTemplateMap = new HashMap < String , String > ( ) ; String [ ] templateNames = new String [ ] { FaxJob2HTTPRequestConverterConfigurationConstants . SUBMIT_FAX_JOB_TEMPLATE_PROPERTY_KEY . toString ( ) , FaxJob2HTTPRequestConverterConfigurationConstants . SUSPEND_FAX_JOB_TEMPLATE_P... |
public class CfgParser { /** * Computes the marginal distribution over CFG parses given terminals .
* @ param terminals
* @ param useSumProduct
* @ return */
public CfgParseChart parseMarginal ( List < ? > terminals , boolean useSumProduct ) { } } | Factor rootDist = TableFactor . unity ( parentVar ) ; return parseMarginal ( terminals , rootDist , useSumProduct ) ; |
public class JPEGImageReader { /** * TODO : Util method ? */
static byte [ ] readFully ( DataInput stream , int len ) throws IOException { } } | if ( len == 0 ) { return null ; } byte [ ] data = new byte [ len ] ; stream . readFully ( data ) ; return data ; |
public class GlobalizationPreferences { /** * Sets the timezone ID . If this has not been set , uses default for territory .
* @ param timezone a valid TZID ( see UTS # 35 ) .
* @ return this , for chaining
* @ hide draft / provisional / internal are hidden on Android */
public GlobalizationPreferences setTimeZon... | if ( isFrozen ( ) ) { throw new UnsupportedOperationException ( "Attempt to modify immutable object" ) ; } this . timezone = ( TimeZone ) timezone . clone ( ) ; // clone for safety ;
return this ; |
public class ProbeMethodAdapter { /** * Generate the instruction sequence needed to " unbox " the boxed data at
* the top of stack .
* @ param type the < code > Type < / code > associated with the unboxed data */
protected void unbox ( final Type type ) { } } | switch ( type . getSort ( ) ) { case Type . BOOLEAN : visitTypeInsn ( CHECKCAST , "java/lang/Boolean" ) ; visitMethodInsn ( INVOKEVIRTUAL , "java/lang/Boolean" , "booleanValue" , "()Z" , false ) ; break ; case Type . BYTE : visitTypeInsn ( CHECKCAST , "java/lang/Byte" ) ; visitMethodInsn ( INVOKEVIRTUAL , "java/lang/By... |
public class Settings { /** * Logs the properties . This will not log any properties that contain
* ' password ' in the key .
* @ param header the header to print with the log message
* @ param properties the properties to log */
private void logProperties ( @ NotNull final String header , @ NotNull final Propert... | if ( LOGGER . isDebugEnabled ( ) ) { final StringWriter sw = new StringWriter ( ) ; try ( final PrintWriter pw = new PrintWriter ( sw ) ) { pw . format ( "%s:%n%n" , header ) ; final Enumeration < ? > e = properties . propertyNames ( ) ; while ( e . hasMoreElements ( ) ) { final String key = ( String ) e . nextElement ... |
public class AuthorizationManager { /** * delete authorizations / / / / / */
public void deleteAuthorizationsByResourceId ( Resource resource , String resourceId ) { } } | if ( resourceId == null ) { throw new IllegalArgumentException ( "Resource id cannot be null" ) ; } if ( isAuthorizationEnabled ( ) ) { Map < String , Object > deleteParams = new HashMap < String , Object > ( ) ; deleteParams . put ( "resourceType" , resource . resourceType ( ) ) ; deleteParams . put ( "resourceId" , r... |
public class EntityClassReader { /** * Wraps the given object in a feature interface . This method will first validate whether the
* class it represents is indeed a feature ( containing exactly one geometry and id ) and will then
* generate a wrapper around the original object that obeys to the Feature interface . ... | if ( objectToTransform == null ) { throw new IllegalArgumentException ( "Given object may not be null" ) ; } if ( objectToTransform . getClass ( ) != entityClass ) { throw new InvalidObjectReaderException ( "Class of target object does not correspond with entityclass of this reader." ) ; } Feature proxy = ( Feature ) P... |
public class RowBuilder { /** * timestamp valued column .
* @ param name the column name */
public RowBuilder timestampCol ( String name ) { } } | Column column = new ColumnTimestamp ( _columns . size ( ) , name , _offset ) ; _offset += column . length ( ) ; _columns . add ( column ) ; return this ; |
public class Parser { /** * Determines if a token stream contains only numeric tokens
* @ param stream
* @ return true if all tokens in the given stream can be parsed as an integer */
private boolean isAllNumeric ( TokenStream stream ) { } } | List < Token > tokens = ( ( NattyTokenSource ) stream . getTokenSource ( ) ) . getTokens ( ) ; for ( Token token : tokens ) { try { Integer . parseInt ( token . getText ( ) ) ; } catch ( NumberFormatException e ) { return false ; } } return true ; |
public class TangoEnv { private static String readFile ( String filename ) throws FileNotFoundException , SecurityException , IOException { } } | FileInputStream fid = new FileInputStream ( filename ) ; int nb = fid . available ( ) ; byte [ ] inStr = new byte [ nb ] ; nb = fid . read ( inStr ) ; fid . close ( ) ; return new String ( inStr ) ; |
public class StructrOAuthClient { /** * Build an OAuth2 server from the configured values for the given name .
* @ param name
* @ return server */
public static StructrOAuthClient getServer ( final String name ) { } } | String configuredOauthServers = Settings . OAuthServers . getValue ( ) ; String [ ] authServers = configuredOauthServers . split ( " " ) ; for ( String authServer : authServers ) { if ( authServer . equals ( name ) ) { String authLocation = Settings . getOrCreateStringSetting ( "oauth" , authServer , "authorization_loc... |
public class FastHDLC { /** * Returns a data character if available , logical OR ' d with zero or more of RETURN _ COMPLETE _ FLAG , RETURN _ DISCARD _ FLAG , and
* RETURN _ EMPTY _ FLAG , signifying a complete frame , a discarded frame , or there is nothing to return . */
public int fasthdlc_rx_run ( HdlcState h ) {... | int next ; int retval = RETURN_EMPTY_FLAG ; while ( ( h . bits >= minbits [ h . state ] ) && ( retval == RETURN_EMPTY_FLAG ) ) { /* * Run until we can no longer be assured that we will have enough bits to continue */
switch ( h . state ) { case FRAME_SEARCH : /* * Look for an HDLC frame , keying from the top byte . */
... |
public class CacheSupport { /** * a generic type at all here , just to be sure */
@ Override public List values ( CacheKeyFilter filter ) throws IOException { } } | if ( CacheUtil . allowAll ( filter ) ) return values ( ) ; List < String > keys = keys ( ) ; List < Object > list = new ArrayList < Object > ( ) ; Iterator < String > it = keys . iterator ( ) ; String key ; while ( it . hasNext ( ) ) { key = it . next ( ) ; if ( filter . accept ( key ) ) { CacheEntry ce = getQuiet ( ke... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.