signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class ExampleTaggableEntities { @ MemberOrder ( sequence = "2" ) public ExampleTaggableEntity create ( final @ ParameterLayout ( named = "Name" ) String name , final @ ParameterLayout ( named = "Brand" ) String brand , final @ ParameterLayout ( named = "Sector" ) String sector ) { } } | final ExampleTaggableEntity obj = container . newTransientInstance ( ExampleTaggableEntity . class ) ; obj . setName ( name ) ; obj . setBrand ( brand ) ; obj . setSector ( sector ) ; container . persistIfNotAlready ( obj ) ; return obj ; |
public class CreateResolverRuleRequest { /** * The IPs that you want Resolver to forward DNS queries to . You can specify only IPv4 addresses . Separate IP
* addresses with a comma .
* @ param targetIps
* The IPs that you want Resolver to forward DNS queries to . You can specify only IPv4 addresses . Separate IP ... | if ( targetIps == null ) { this . targetIps = null ; return ; } this . targetIps = new java . util . ArrayList < TargetAddress > ( targetIps ) ; |
public class BasePartial { /** * Sets the values of all fields .
* In version 2.0 and later , this method copies the array into the original .
* This is because the instance variable has been changed to be final to satisfy the Java Memory Model .
* This only impacts subclasses that are mutable .
* @ param value... | getChronology ( ) . validate ( this , values ) ; System . arraycopy ( values , 0 , iValues , 0 , iValues . length ) ; |
public class InMemoryLinkedDataStore { /** * ( non - Javadoc )
* @ see net . timewalker . ffmq4 . utils . store . LinkedObjectStore # retrieve ( int ) */
@ Override public Object retrieve ( int handle ) throws DataStoreException { } } | if ( SAFE_MODE ) checkHandle ( handle ) ; return data [ handle ] ; |
public class HadoopStoreBuilder { /** * Persists a * . metadata file to a specific directory in HDFS .
* @ param directoryPath where to write the metadata file .
* @ param outputFs { @ link org . apache . hadoop . fs . FileSystem } where to write the file
* @ param metadataFileName name of the file ( including ex... | Path metadataPath = new Path ( directoryPath , metadataFileName ) ; FSDataOutputStream metadataStream = outputFs . create ( metadataPath ) ; outputFs . setPermission ( metadataPath , new FsPermission ( HADOOP_FILE_PERMISSION ) ) ; metadataStream . write ( metadata . toJsonString ( ) . getBytes ( ) ) ; metadataStream . ... |
public class PasswordUtil { /** * Encode the provided string with the specified algorithm and the crypto key
* If the decoded _ string is already encoded , the string will be decoded and then encoded by using the specified crypto algorithm .
* Use this method for encoding the string by using the AES encryption with... | HashMap < String , String > props = new HashMap < String , String > ( ) ; if ( crypto_key != null ) { props . put ( PROPERTY_CRYPTO_KEY , crypto_key ) ; } return encode ( decoded_string , crypto_algorithm , props ) ; |
public class SteeringBehavior { /** * If this behavior is enabled calculates the steering acceleration and writes it to the given steering output . If it is
* disabled the steering output is set to zero .
* @ param steering the steering acceleration to be calculated .
* @ return the calculated steering accelerati... | return isEnabled ( ) ? calculateRealSteering ( steering ) : steering . setZero ( ) ; |
public class JNvrtc { /** * Compiles the given program . See the
* < a href = " http : / / docs . nvidia . com / cuda / nvrtc / index . html # group _ _ options "
* target = " _ blank " > Supported Compile Options ( external site ) < / a >
* @ param prog CUDA Runtime Compilation program .
* @ param numOptions T... | return checkResult ( nvrtcCompileProgramNative ( prog , numOptions , options ) ) ; |
public class ResponseWritePerformer { protected PrintWriter createPrintWriter ( HttpServletResponse response , String encoding ) throws IOException { } } | return newPrintWriter ( createOutputStreamWriter ( response , encoding ) ) ; |
public class ListEndpointsResult { /** * An array or endpoint objects .
* @ param endpoints
* An array or endpoint objects . */
public void setEndpoints ( java . util . Collection < EndpointSummary > endpoints ) { } } | if ( endpoints == null ) { this . endpoints = null ; return ; } this . endpoints = new java . util . ArrayList < EndpointSummary > ( endpoints ) ; |
public class CommerceNotificationTemplatePersistenceImpl { /** * Returns an ordered range of all the commerce notification templates that the user has permissions to view where groupId = & # 63 ; and type = & # 63 ; and enabled = & # 63 ; .
* Useful when paginating results . Returns a maximum of < code > end - start ... | if ( ! InlineSQLHelperUtil . isEnabled ( groupId ) ) { return findByG_T_E ( groupId , type , enabled , start , end , orderByComparator ) ; } StringBundler query = null ; if ( orderByComparator != null ) { query = new StringBundler ( 5 + ( orderByComparator . getOrderByFields ( ) . length * 2 ) ) ; } else { query = new ... |
public class Period { /** * Set the unit ' s internal value , converting from float to int . */
private Period setTimeUnitValue ( TimeUnit unit , float value ) { } } | if ( value < 0 ) { throw new IllegalArgumentException ( "value: " + value ) ; } return setTimeUnitInternalValue ( unit , ( int ) ( value * 1000 ) + 1 ) ; |
public class EditText { /** * < p > Converts the selected item from the drop down list into a sequence
* of character that can be used in the edit box . < / p >
* @ param selectedItem the item selected by the user for completion
* @ return a sequence of characters representing the selected suggestion */
protected... | switch ( mAutoCompleteMode ) { case AUTOCOMPLETE_MODE_SINGLE : return ( ( InternalAutoCompleteTextView ) mInputView ) . superConvertSelectionToString ( selectedItem ) ; case AUTOCOMPLETE_MODE_MULTI : return ( ( InternalMultiAutoCompleteTextView ) mInputView ) . superConvertSelectionToString ( selectedItem ) ; default :... |
public class ScriptMarshaller { /** * Marshall the given parameter object . */
public void marshall ( Script script , ProtocolMarshaller protocolMarshaller ) { } } | if ( script == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( script . getScriptId ( ) , SCRIPTID_BINDING ) ; protocolMarshaller . marshall ( script . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( script . getVersion ( ) , ... |
public class ActiveConnectTask { /** * Override this to implement authentication */
protected SocketBox openSocket ( ) throws Exception { } } | SocketBox sBox = new SimpleSocketBox ( ) ; SocketFactory factory = SocketFactory . getDefault ( ) ; Socket mySocket = factory . createSocket ( this . hostPort . getHost ( ) , this . hostPort . getPort ( ) ) ; sBox . setSocket ( mySocket ) ; return sBox ; |
public class Engine { /** * Configures the engine with the given operators
* @ param conjunction is a TNorm registered in the TNormFactory
* @ param disjunction is an SNorm registered in the SNormFactory
* @ param implication is an TNorm registered in the TNormFactory
* @ param aggregation is an SNorm registere... | TNormFactory tnormFactory = FactoryManager . instance ( ) . tnorm ( ) ; SNormFactory snormFactory = FactoryManager . instance ( ) . snorm ( ) ; TNorm conjunctionObject = tnormFactory . constructObject ( conjunction ) ; SNorm disjunctionObject = snormFactory . constructObject ( disjunction ) ; TNorm implicationObject = ... |
public class Parse { /** * Designates that the specified punctuation follows this parse .
* @ param punct
* The punctuation set . */
public void addNextPunctuation ( final Parse punct ) { } } | if ( this . nextPunctSet == null ) { this . nextPunctSet = new TreeSet < Parse > ( ) ; } this . nextPunctSet . add ( punct ) ; |
public class BladeTemplate { /** * in this case it is obtained by calling recursively the methods on the last obtained object */
private void appendParamValue ( StringBuilder param , StringBuilder result ) { } } | if ( param == null ) throw UncheckedTemplateException . invalidArgumentName ( param ) ; // Object name is the parameter that should be found in the map .
// If it ' s followed by points , the points remain in the " param " buffer .
final String objectName = takeUntilDotOrEnd ( param ) ; final Object objectValue = argum... |
public class DateCaster { /** * converts a Object to a DateTime Object ( Advanced but slower )
* @ param str String to Convert
* @ param timezone
* @ return Date Time Object
* @ throws PageException */
public static DateTime toDateAdvanced ( String str , TimeZone timezone ) throws PageException { } } | DateTime dt = toDateAdvanced ( str , timezone , null ) ; if ( dt == null ) throw new ExpressionException ( "can't cast [" + str + "] to date value" ) ; return dt ; |
public class CPMeasurementUnitPersistenceImpl { /** * Returns the first cp measurement unit in the ordered set where groupId = & # 63 ; and primary = & # 63 ; and type = & # 63 ; .
* @ param groupId the group ID
* @ param primary the primary
* @ param type the type
* @ param orderByComparator the comparator to ... | CPMeasurementUnit cpMeasurementUnit = fetchByG_P_T_First ( groupId , primary , type , orderByComparator ) ; if ( cpMeasurementUnit != null ) { return cpMeasurementUnit ; } StringBundler msg = new StringBundler ( 8 ) ; msg . append ( _NO_SUCH_ENTITY_WITH_KEY ) ; msg . append ( "groupId=" ) ; msg . append ( groupId ) ; m... |
public class CuckooFilter { /** * Puts an element into this { @ code CuckooFilter } . Ensures that subsequent
* invocations of { @ link # mightContain ( Object ) } with the same element will
* always return { @ code true } .
* Note that the filter should be considered full after insertion failure .
* Further in... | BucketAndTag pos = hasher . generate ( item ) ; long curTag = pos . tag ; long curIndex = pos . index ; long altIndex = hasher . altIndex ( curIndex , curTag ) ; bucketLocker . lockBucketsWrite ( curIndex , altIndex ) ; try { if ( table . insertToBucket ( curIndex , curTag ) || table . insertToBucket ( altIndex , curTa... |
public class Protocols { /** * Return a new , empty single - use { @ code Protocol . Builder } with
* the given name .
* @ param name not null .
* @ param < F > the type of the returned Builder
* @ return an empty { @ code Protocol . Builder } , never null . */
public static < F > Protocol . Builder < F > build... | return new ProtocolImpl < F > ( name ) ; |
public class Tokenizer { /** * Gets the next token from a tokenizer and decodes it as hex .
* @ return The byte array containing the decoded string .
* @ throws TextParseException The input was invalid .
* @ throws IOException An I / O error occurred . */
public byte [ ] getHexString ( ) throws IOException { } } | String next = _getIdentifier ( "a hex string" ) ; byte [ ] array = base16 . fromString ( next ) ; if ( array == null ) throw exception ( "invalid hex encoding" ) ; return array ; |
public class OperationBuilder { /** * Associate a file with the operation . This will create a { @ code FileInputStream }
* and add it as attachment .
* @ param file the file
* @ return the operation builder */
public OperationBuilder addFileAsAttachment ( final File file ) { } } | Assert . checkNotNullParam ( "file" , file ) ; try { FileStreamEntry entry = new FileStreamEntry ( file ) ; if ( inputStreams == null ) { inputStreams = new ArrayList < InputStream > ( ) ; } inputStreams . add ( entry ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; } return this ; |
public class CommerceAvailabilityEstimateLocalServiceWrapper { /** * Returns a range of all the commerce availability estimates .
* Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and < code > end < / code > are not primary keys , they are in... | return _commerceAvailabilityEstimateLocalService . getCommerceAvailabilityEstimates ( start , end ) ; |
public class DataPointParser { /** * Takes a string that is a delimited list of values all of a particular type ( integer , long ,
* float , double , or string ) and parses them into a List of DataPoints all with the same
* timestamp .
* @ param points Delimited string containing points to be parsed .
* @ param... | String [ ] items = points . split ( splitRegex ) ; List < DataPoint > ret = new ArrayList < DataPoint > ( ) ; for ( String i : items ) { if ( i . length ( ) == 0 ) { continue ; } if ( type == Long . class || type == Integer . class ) { ret . add ( new DataPoint ( ts , Long . parseLong ( i ) ) ) ; } else if ( type == Fl... |
public class DeleteServiceActionRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( DeleteServiceActionRequest deleteServiceActionRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( deleteServiceActionRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( deleteServiceActionRequest . getId ( ) , ID_BINDING ) ; protocolMarshaller . marshall ( deleteServiceActionRequest . getAcceptLanguage ( ) , ACCEPTLANGUAGE_BI... |
public class SqsManager { /** * Given a list of raw SQS message parse each of them , and return a list of CloudTrailSource .
* @ param sqsMessages list of SQS messages .
* @ return list of CloudTrailSource . */
public List < CloudTrailSource > parseMessage ( List < Message > sqsMessages ) { } } | List < CloudTrailSource > sources = new ArrayList < > ( ) ; for ( Message sqsMessage : sqsMessages ) { boolean parseMessageSuccess = false ; ProgressStatus parseMessageStatus = new ProgressStatus ( ProgressState . parseMessage , new BasicParseMessageInfo ( sqsMessage , parseMessageSuccess ) ) ; final Object reportObjec... |
public class BasicFilter { /** * make sure that state is stored in the session ,
* delete it from session - should be used only once
* @ param session
* @ param state
* @ throws Exception */
private StateData validateState ( HttpSession session , String state ) throws Exception { } } | if ( StringUtils . isNotEmpty ( state ) ) { StateData stateDataInSession = removeStateFromSession ( session , state ) ; if ( stateDataInSession != null ) { return stateDataInSession ; } } throw new Exception ( FAILED_TO_VALIDATE_MESSAGE + "could not validate state" ) ; |
public class ArrayEquals { /** * Suggests replacing with Arrays . equals ( a , b ) . Also adds the necessary import statement for
* java . util . Arrays . */
@ Override public Description matchMethodInvocation ( MethodInvocationTree t , VisitorState state ) { } } | String arg1 ; String arg2 ; if ( instanceEqualsMatcher . matches ( t , state ) ) { arg1 = state . getSourceForNode ( ( ( JCFieldAccess ) t . getMethodSelect ( ) ) . getExpression ( ) ) ; arg2 = state . getSourceForNode ( t . getArguments ( ) . get ( 0 ) ) ; } else if ( staticEqualsMatcher . matches ( t , state ) ) { ar... |
public class RequestPathParamAnalyzer { protected String urlDecode ( String value ) { } } | final String encoding = requestManager . getCharacterEncoding ( ) . get ( ) ; // should be already set
try { return URLDecoder . decode ( value , encoding ) ; } catch ( UnsupportedEncodingException e ) { String msg = "Unsupported encoding: value=" + value + ", encoding=" + encoding ; throw new IllegalStateException ( m... |
public class SourceModel { /** * Package output */
public void writePackage ( OutputStream output , String group , String name , String version ) throws IOException , RepositoryException { } } | String root = "jcr_root" ; ZipOutputStream zipStream = new ZipOutputStream ( output ) ; writeProperties ( zipStream , group , name , version ) ; writeFilter ( zipStream ) ; writeParents ( zipStream , root , resource . getParent ( ) ) ; writeZip ( zipStream , root , true ) ; zipStream . flush ( ) ; zipStream . close ( )... |
public class RuleBasedNumberFormat { /** * Adjust capitalization of formatted result for display context */
private String adjustForContext ( String result ) { } } | if ( result != null && result . length ( ) > 0 && UCharacter . isLowerCase ( result . codePointAt ( 0 ) ) ) { DisplayContext capitalization = getContext ( DisplayContext . Type . CAPITALIZATION ) ; if ( capitalization == DisplayContext . CAPITALIZATION_FOR_BEGINNING_OF_SENTENCE || ( capitalization == DisplayContext . C... |
public class CpoStatementFactory { /** * Called by the CPO Framework . Binds all the attibutes from the class for the CPO meta parameters and the parameters
* from the dynamic where . */
public void setBindValues ( Collection < BindAttribute > bindValues ) throws CpoException { } } | if ( bindValues != null ) { int index = getStartingIndex ( ) ; // runs through the bind attributes and binds them to the prepared statement
// They must be in correct order .
for ( BindAttribute bindAttr : bindValues ) { Object bindObject = bindAttr . getBindObject ( ) ; CpoAttribute cpoAttribute = bindAttr . getCpoAtt... |
public class Hash { /** * Keccak - 256 hash function .
* @ param hexInput hex encoded input data with optional 0x prefix
* @ return hash value as hex encoded string */
public static String sha3 ( String hexInput ) { } } | byte [ ] bytes = Numeric . hexStringToByteArray ( hexInput ) ; byte [ ] result = sha3 ( bytes ) ; return Numeric . toHexString ( result ) ; |
public class UnicodeSet { /** * Make this object represent the same set as < code > other < / code > .
* @ param other a < code > UnicodeSet < / code > whose value will be
* copied to this object */
public UnicodeSet set ( UnicodeSet other ) { } } | checkFrozen ( ) ; list = other . list . clone ( ) ; len = other . len ; pat = other . pat ; strings = new TreeSet < String > ( other . strings ) ; return this ; |
public class BindingConverter { /** * { @ inheritDoc } */
public boolean matches ( TypeDescriptor sourceType , TypeDescriptor targetType ) { } } | try { BINDING . findConverter ( sourceType . getObjectType ( ) , targetType . getObjectType ( ) , matchAnnotationToScope ( targetType . getAnnotations ( ) ) ) ; return true ; } catch ( IllegalStateException e ) { return false ; } |
public class DeleteDocumentationPartRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( DeleteDocumentationPartRequest deleteDocumentationPartRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( deleteDocumentationPartRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( deleteDocumentationPartRequest . getRestApiId ( ) , RESTAPIID_BINDING ) ; protocolMarshaller . marshall ( deleteDocumentationPartRequest . getDocumentatio... |
public class xen_health_resource_sw { /** * Use this API to fetch filtered set of xen _ health _ resource _ sw resources .
* filter string should be in JSON format . eg : " vm _ state : DOWN , name : [ a - z ] + " */
public static xen_health_resource_sw [ ] get_filtered ( nitro_service service , String filter ) throw... | xen_health_resource_sw obj = new xen_health_resource_sw ( ) ; options option = new options ( ) ; option . set_filter ( filter ) ; xen_health_resource_sw [ ] response = ( xen_health_resource_sw [ ] ) obj . getfiltered ( service , option ) ; return response ; |
public class Expressions { /** * Create a new Path expression
* @ param type type of expression
* @ param variable variable name
* @ return path expression */
public static < T extends Number & Comparable < ? > > NumberPath < T > numberPath ( Class < ? extends T > type , String variable ) { } } | return new NumberPath < T > ( type , PathMetadataFactory . forVariable ( variable ) ) ; |
public class GroupTemplate { /** * 判断是否加载过模板
* @ param key
* @ return */
public boolean hasTemplate ( String key ) { } } | Program program = ( Program ) this . programCache . get ( key ) ; return program != null ; |
public class SyncGroupsInner { /** * Gets a collection of sync database ids .
* @ param nextPageLink The NextLink from the previous successful call to List operation .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ throws CloudException thrown if the request is rejected by server... | ServiceResponse < Page < SyncDatabaseIdPropertiesInner > > response = listSyncDatabaseIdsNextSinglePageAsync ( nextPageLink ) . toBlocking ( ) . single ( ) ; return new PagedList < SyncDatabaseIdPropertiesInner > ( response . body ( ) ) { @ Override public Page < SyncDatabaseIdPropertiesInner > nextPage ( String nextPa... |
public class Dictionary { /** * Gets a property ' s value as a Blob .
* Returns null if the value doesn ' t exist , or its value is not a Blob .
* @ param key the key
* @ return the Blob value or null . */
@ Override public Blob getBlob ( @ NonNull String key ) { } } | if ( key == null ) { throw new IllegalArgumentException ( "key cannot be null." ) ; } synchronized ( lock ) { final Object obj = getMValue ( internalDict , key ) . asNative ( internalDict ) ; return obj instanceof Blob ? ( Blob ) obj : null ; } |
public class WebappConfigs { /** * Config loaded from a file located at
* { @ code [ path ] / [ servlet context path ] } .
* < ul >
* < li > { @ code [ path ] } is determined by a { @ link PathSpecification } < / li >
* < li > { @ code [ servlet context path ] } is the
* { @ link ServletContextPath } from the... | return new BaseFileConfigSourceStep ( ) { @ Override public NamedConfigSource by ( PathSpecification pathSpecification ) { checkNotNull ( pathSpecification ) ; return new ServletContextDirectoryConfigSource ( pathSpecification ) . named ( String . format ( "servlet context directory %s" , pathSpecification . name ( ) )... |
public class CommerceNotificationTemplateLocalServiceBaseImpl { /** * Returns a range of commerce notification templates matching the UUID and company .
* @ param uuid the UUID of the commerce notification templates
* @ param companyId the primary key of the company
* @ param start the lower bound of the range of... | return commerceNotificationTemplatePersistence . findByUuid_C ( uuid , companyId , start , end , orderByComparator ) ; |
public class RedBlackTree { /** * Returns the smallest key in the symbol table greater than or equal to
* < code > key < / code > .
* @ param key
* the key
* @ return the smallest key in the symbol table greater than or equal to
* < code > key < / code >
* @ throws NoSuchElementException
* if there is no ... | if ( isEmpty ( ) ) { return null ; } RedBlackTreeNode < Key , Value > x = ceiling ( root , key ) ; if ( x == null ) { return null ; } else { return x ; } |
public class ServerSideEncryption { /** * Create a new server - side - encryption object for encryption with customer
* provided keys ( a . k . a . SSE - C ) .
* @ param key The secret AES - 256 key .
* @ return An instance of ServerSideEncryption implementing SSE - C .
* @ throws InvalidKeyException if the pro... | if ( ! isCustomerKeyValid ( key ) ) { throw new InvalidKeyException ( "The secret key is not a 256 bit AES key" ) ; } return new ServerSideEncryptionWithCustomerKey ( key , MessageDigest . getInstance ( ( "MD5" ) ) ) ; |
public class Roster { /** * Reloads the entire roster from the server . This is an asynchronous operation ,
* which means the method will return immediately , and the roster will be
* reloaded at a later point when the server responds to the reload request .
* @ throws NotLoggedInException If not logged in .
* ... | final XMPPConnection connection = getAuthenticatedConnectionOrThrow ( ) ; RosterPacket packet = new RosterPacket ( ) ; if ( rosterStore != null && isRosterVersioningSupported ( ) ) { packet . setVersion ( rosterStore . getRosterVersion ( ) ) ; } rosterState = RosterState . loading ; SmackFuture < IQ , Exception > futur... |
public class IfcFillAreaStyleTilesImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ SuppressWarnings ( "unchecked" ) public EList < IfcFillAreaStyleTileShapeSelect > getTiles ( ) { } } | return ( EList < IfcFillAreaStyleTileShapeSelect > ) eGet ( Ifc2x3tc1Package . Literals . IFC_FILL_AREA_STYLE_TILES__TILES , true ) ; |
public class Bytes { /** * Iterate over keys within the passed range , splitting at an [ a , b ) boundary . */
public static Iterable < byte [ ] > iterateOnSplits ( final byte [ ] a , final byte [ ] b , final int num ) { } } | return iterateOnSplits ( a , b , false , num ) ; |
public class MavenUtil { /** * Uses the aether to resolve a plugin dependency and returns the file for further processing .
* @ param d the dependency to resolve .
* @ param pluginRepos the plugin repositories to use for dependency resolution .
* @ param resolver the resolver for aether access .
* @ param repoS... | Artifact a = new DefaultArtifact ( d . getGroupId ( ) , d . getArtifactId ( ) , d . getClassifier ( ) , d . getType ( ) , d . getVersion ( ) ) ; ArtifactRequest artifactRequest = new ArtifactRequest ( ) ; artifactRequest . setArtifact ( a ) ; artifactRequest . setRepositories ( pluginRepos ) ; try { ArtifactResult arti... |
public class JobCatalogBase { /** * { @ inheritDoc } */
@ Override public synchronized void addListener ( JobCatalogListener jobListener ) { } } | Preconditions . checkNotNull ( jobListener ) ; this . listeners . addListener ( jobListener ) ; if ( state ( ) == State . RUNNING ) { Iterator < JobSpec > jobSpecItr = getJobSpecsWithTimeUpdate ( ) ; while ( jobSpecItr . hasNext ( ) ) { JobSpec jobSpec = jobSpecItr . next ( ) ; if ( jobSpec != null ) { JobCatalogListen... |
public class BaasDocument { /** * Synchronously fetches a document from the server
* @ param collection the collection to retrieve the document from . Not < code > null < / code >
* @ param id the id of the document to retrieve . Not < code > null < / code >
* @ param withAcl if true will fetch acl
* @ return t... | if ( collection == null ) throw new IllegalArgumentException ( "collection cannot be null" ) ; if ( id == null ) throw new IllegalArgumentException ( "id cannot be null" ) ; BaasDocument doc = new BaasDocument ( collection ) ; doc . id = id ; return doc . refreshSync ( withAcl ) ; |
public class ColumnListOutputHandler { /** * Converts specified ( via constructor ) column into List
* @ param outputList Query output
* @ return Query output column as List
* @ throws org . midao . jdbc . core . exception . MjdbcException */
public List < T > handle ( List < QueryParameters > outputList ) throws... | List < T > result = new ArrayList < T > ( ) ; String parameterName = null ; Object parameterValue = null ; for ( int i = 1 ; i < outputList . size ( ) ; i ++ ) { if ( this . columnName == null ) { parameterName = outputList . get ( i ) . getNameByPosition ( this . columnIndex ) ; parameterValue = outputList . get ( i )... |
public class EndpointServices { /** * dump parameter map for trace . */
@ Trivial private String dumpMap ( Map < String , String [ ] > m ) { } } | StringBuffer sb = new StringBuffer ( ) ; sb . append ( " --- request parameters: ---\n" ) ; Iterator < String > it = m . keySet ( ) . iterator ( ) ; while ( it . hasNext ( ) ) { String key = it . next ( ) ; String [ ] values = m . get ( key ) ; sb . append ( key + ": " ) ; for ( String s : values ) { sb . append ( "[" ... |
public class AbstractStaticSourceCompiler { /** * Recursive method that searches the SuperSource for the current Instance
* identified by the oid .
* @ param _ instance Instance the Super Instance will be searched
* @ return List of SuperSources in reverse order
* @ throws EFapsException error */
protected List... | final List < Instance > ret = new ArrayList < > ( ) ; final QueryBuilder queryBldr = new QueryBuilder ( getClassName4Type2Type ( ) ) ; queryBldr . addWhereAttrEqValue ( CIAdminProgram . Program2Program . From , _instance . getId ( ) ) ; final MultiPrintQuery multi = queryBldr . getPrint ( ) ; multi . addAttribute ( CIA... |
public class DateTimePatternGenerator { /** * { @ inheritDoc } */
@ Override public DateTimePatternGenerator cloneAsThawed ( ) { } } | DateTimePatternGenerator result = ( DateTimePatternGenerator ) ( this . clone ( ) ) ; frozen = false ; return result ; |
public class UsagePlanMarshaller { /** * Marshall the given parameter object . */
public void marshall ( UsagePlan usagePlan , ProtocolMarshaller protocolMarshaller ) { } } | if ( usagePlan == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( usagePlan . getId ( ) , ID_BINDING ) ; protocolMarshaller . marshall ( usagePlan . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( usagePlan . getDescription ( ... |
public class GeometryConverter { /** * Takes in a DTO geometry , and converts it into a GWT geometry .
* @ param geometry
* The DTO geometry to convert into a GWT geometry .
* @ return Returns a GWT geometry . */
public static org . geomajas . gwt . client . spatial . geometry . Geometry toGwt ( Geometry geometry... | if ( geometry == null ) { return null ; } GeometryFactory factory = new GeometryFactory ( geometry . getSrid ( ) , geometry . getPrecision ( ) ) ; org . geomajas . gwt . client . spatial . geometry . Geometry gwt ; String geometryType = geometry . getGeometryType ( ) ; if ( Geometry . POINT . equals ( geometryType ) ) ... |
public class DetailedStatistics { /** * Return the histogram of the { @ link # getValues ( ) values } . This method is capable of creating two kinds of histograms . The
* first kind is a histogram where all of the buckets are distributed normally and all have the same width . In this case , the
* ' numSigmas ' shou... | Lock lock = this . getLock ( ) . writeLock ( ) ; lock . lock ( ) ; try { Histogram < T > hist = new Histogram < T > ( this . math , this . values ) ; if ( numSigmas > 0 ) { // The ' getMediaValue ( ) ' method will reset the current histogram , so don ' t set it . . .
hist . setStrategy ( this . getMedianValue ( ) , thi... |
public class SyncStage { /** * Invokes the handler for the event .
* @ param value the event */
@ Override @ SuppressWarnings ( "checkstyle:illegalcatch" ) public void onNext ( final T value ) { } } | beforeOnNext ( ) ; try { handler . onNext ( value ) ; } catch ( final Throwable t ) { if ( errorHandler != null ) { errorHandler . onNext ( t ) ; } else { LOG . log ( Level . SEVERE , name + " Exception from event handler" , t ) ; throw t ; } } afterOnNext ( ) ; |
public class Help { /** * / * ( non - Javadoc )
* @ see org . eiichiro . ash . Command # run ( org . eiichiro . ash . Line ) */
@ Override public void run ( Line line ) { } } | List < String > args = line . args ( ) ; if ( args . isEmpty ( ) ) { shell . console ( ) . println ( usage ( ) . toString ( ) ) ; return ; } String command = line . args ( ) . get ( 0 ) ; Command c = shell . commands ( ) . get ( command ) ; if ( c == null ) { shell . console ( ) . println ( "no help topic for '" + comm... |
public class EndpointService { /** * { @ inheritDoc } */
public void start ( final StartContext context ) throws StartException { } } | final Endpoint endpoint ; final EndpointBuilder builder = Endpoint . builder ( ) ; builder . setEndpointName ( endpointName ) ; builder . setXnioWorker ( worker . getValue ( ) ) ; try { endpoint = builder . build ( ) ; } catch ( IOException e ) { throw RemotingLogger . ROOT_LOGGER . couldNotStart ( e ) ; } // Reuse the... |
public class CommerceWishListUtil { /** * Returns the first commerce wish list in the ordered set where userId = & # 63 ; and createDate & lt ; & # 63 ; .
* @ param userId the user ID
* @ param createDate the create date
* @ param orderByComparator the comparator to order the set by ( optionally < code > null < /... | return getPersistence ( ) . findByU_LtC_First ( userId , createDate , orderByComparator ) ; |
public class LambdaIterators { /** * Creates an { @ link java . util . Iterator } checked has an internal count of how many times it has been called .
* The current index1 is passed to the lambda expressions .
* @ param hasNext used to implement { @ link java . util . Iterator # hasNext ( ) }
* @ param next used ... | Objects . requireNonNull ( hasNext , "hasNext" ) ; Objects . requireNonNull ( next , "next" ) ; class IndexIterator extends BaseIterator < E > { private int index ; @ Override public boolean hasNext ( ) { return hasNext . test ( index ) ; } @ Override protected E nextElement ( ) { return next . apply ( index ++ ) ; } }... |
public class ListApplicationVersionsResult { /** * An array of version summaries for the application .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setVersions ( java . util . Collection ) } or { @ link # withVersions ( java . util . Collection ) } if you ... | if ( this . versions == null ) { setVersions ( new java . util . ArrayList < VersionSummary > ( versions . length ) ) ; } for ( VersionSummary ele : versions ) { this . versions . add ( ele ) ; } return this ; |
public class ReadabilityStatistics { /** * Returns the Flesch - Kincaid Reading Ease of text entered rounded to one digit .
* @ param strText Text to be checked
* @ return */
public static double fleschKincaidReadingEase ( String strText ) { } } | strText = cleanText ( strText ) ; return PHPMethods . round ( ( 206.835 - ( 1.015 * averageWordsPerSentence ( strText ) ) - ( 84.6 * averageSyllablesPerWord ( strText ) ) ) , 1 ) ; |
public class SetupWizard { /** * Indicates a generated password should be used - e . g . this is a new install , no security realm set up */
@ SuppressWarnings ( "unused" ) // used by jelly
public boolean isUsingSecurityToken ( ) { } } | try { return ! Jenkins . get ( ) . getInstallState ( ) . isSetupComplete ( ) && isUsingSecurityDefaults ( ) ; } catch ( Exception e ) { // ignore
} return false ; |
public class AbstractPathElement3F { /** * Create an instance of path element .
* @ param type is the type of the new element .
* @ param lastX is the coordinate of the last point .
* @ param lastY is the coordinate of the last point .
* @ param lastZ is the coordinate of the last point .
* @ param coords are... | switch ( type ) { case MOVE_TO : return new MovePathElement3f ( coords [ 0 ] , coords [ 1 ] , coords [ 2 ] ) ; case LINE_TO : return new LinePathElement3f ( lastX , lastY , lastZ , coords [ 0 ] , coords [ 1 ] , coords [ 2 ] ) ; case QUAD_TO : return new QuadPathElement3f ( lastX , lastY , lastZ , coords [ 0 ] , coords ... |
public class BaseMonetaryRoundingsSingletonSpi { /** * Access a { @ link javax . money . MonetaryRounding } for rounding { @ link javax . money . MonetaryAmount }
* instances given a currency .
* @ param currencyUnit The currency , which determines the required precision . As
* { @ link java . math . RoundingMode... | MonetaryRounding op = getRounding ( RoundingQueryBuilder . of ( ) . setProviderNames ( providers ) . setCurrency ( currencyUnit ) . build ( ) ) ; if ( op == null ) { throw new MonetaryException ( "No rounding provided for CurrencyUnit: " + currencyUnit . getCurrencyCode ( ) ) ; } return op ; |
public class TerminalTextUtils { /** * This method will calculate word wrappings given a number of lines of text and how wide the text can be printed .
* The result is a list of new rows where word - wrapping was applied .
* @ param maxWidth Maximum number of columns that can be used before word - wrapping is appli... | // Bounds checking
if ( maxWidth <= 0 ) { return Arrays . asList ( lines ) ; } List < String > result = new ArrayList < String > ( ) ; LinkedList < String > linesToBeWrapped = new LinkedList < String > ( Arrays . asList ( lines ) ) ; while ( ! linesToBeWrapped . isEmpty ( ) ) { String row = linesToBeWrapped . removeFir... |
public class CLISmartHandler { /** * Publish a log record . */
@ Override public void publish ( final LogRecord record ) { } } | // determine destination
final Writer destination ; if ( record . getLevel ( ) . intValue ( ) >= Level . WARNING . intValue ( ) ) { destination = this . err ; } else { destination = this . out ; } // format
final String m ; // Progress records are handled specially .
if ( record instanceof ProgressLogRecord ) { Progres... |
public class Logger { /** * Log a message at the WARN level .
* @ param marker The marker specific to this log statement
* @ param message the message string to be logged
* @ since 1.0.0 */
public void warn ( final Marker marker , final String message ) { } } | log . warn ( marker , sanitize ( message ) ) ; |
public class TangramEngine { /** * { @ inheritDoc } */
@ Override public void topPosition ( Card card ) { } } | List < BaseCell > cells = card . getCells ( ) ; if ( cells . size ( ) > 0 ) { BaseCell cell = cells . get ( 0 ) ; int pos = mGroupBasicAdapter . getComponents ( ) . indexOf ( cell ) ; if ( pos > 0 ) { VirtualLayoutManager lm = getLayoutManager ( ) ; View view = lm . findViewByPosition ( pos ) ; if ( view != null ) { in... |
public class Color { /** * Scale the components of the colour by the given value
* @ param value The value to scale by */
public void scale ( float value ) { } } | r *= value ; g *= value ; b *= value ; a *= value ; |
public class I18n { /** * copied from http : / / stackoverflow . com / questions / 309424 / read - convert - an - inputstream - to - a - string
* @ param is file to be read
* @ param bufferSize size of the buffer used to read the file
* @ return file content as String */
public static String slurp ( final InputSt... | final char [ ] buffer = new char [ bufferSize ] ; final StringBuilder out = new StringBuilder ( ) ; try { final Reader in = new InputStreamReader ( is , "UTF-8" ) ; try { for ( ; ; ) { int rsz = in . read ( buffer , 0 , buffer . length ) ; if ( rsz < 0 ) break ; out . append ( buffer , 0 , rsz ) ; } } finally { in . cl... |
public class Key { /** * Gets the for instance .
* @ param _ instance the instance
* @ return the for instance
* @ throws EFapsException on error */
public static Key get4Instance ( final Instance _instance ) throws EFapsException { } } | Key . LOG . debug ( "Retrieving Key for {}" , _instance ) ; final Key ret = new Key ( ) ; ret . setPersonId ( Context . getThreadContext ( ) . getPersonId ( ) ) ; final Type type = _instance . getType ( ) ; ret . setTypeId ( type . getId ( ) ) ; if ( type . isCompanyDependent ( ) ) { ret . setCompanyId ( Context . getT... |
public class BuildStepsInner { /** * Updates a build step in a build task .
* @ param resourceGroupName The name of the resource group to which the container registry belongs .
* @ param registryName The name of the container registry .
* @ param buildTaskName The name of the container registry build task .
* @... | return ServiceFuture . fromResponse ( updateWithServiceResponseAsync ( resourceGroupName , registryName , buildTaskName , stepName , buildStepUpdateParameters ) , serviceCallback ) ; |
public class PasswordCipherUtil { public static EncryptedInfo encipher_internal ( byte [ ] decrypted_bytes , String crypto_algorithm , String cryptoKey ) throws InvalidPasswordCipherException , UnsupportedCryptoAlgorithmException { } } | HashMap < String , String > props = new HashMap < String , String > ( ) ; if ( cryptoKey != null ) { props . put ( PasswordUtil . PROPERTY_CRYPTO_KEY , cryptoKey ) ; } return encipher_internal ( decrypted_bytes , crypto_algorithm , props ) ; |
public class Ids { /** * Returns a new { @ link Id } which represents the { @ code type } qualified by
* the { @ code annotation } instance .
* @ param type the type to which the new id has to be associated .
* @ param annotation the qualifying annotation .
* @ return an new { @ code Id } based on the given typ... | return IdImpl . newId ( type , annotation ) ; |
public class AbstractBigtableTable { /** * { @ inheritDoc } */
@ Override public boolean exists ( Get get ) throws IOException { } } | try ( Scope scope = TRACER . spanBuilder ( "BigtableTable.exists" ) . startScopedSpan ( ) ) { LOG . trace ( "exists(Get)" ) ; return ! convertToResult ( getResults ( GetAdapter . setCheckExistenceOnly ( get ) , "exists" ) ) . isEmpty ( ) ; } |
public class Graph { /** * Adds a node to this graph .
* @ param node the node */
public void addNode ( NodeT node ) { } } | node . setOwner ( this ) ; nodeTable . put ( node . key ( ) , node ) ; |
public class A_CmsListAction { /** * Generates html for the confirmation message when having one confirmation message
* for several actions . < p >
* @ param confId the id of the confirmation message
* @ param confText the confirmation message
* @ return html code */
public static String defaultConfirmationHtml... | StringBuffer html = new StringBuffer ( 1024 ) ; html . append ( "<div class='hide' id='conf" ) ; html . append ( confId ) ; html . append ( "'>" ) ; html . append ( CmsStringUtil . isEmptyOrWhitespaceOnly ( confText ) ? "null" : confText ) ; html . append ( "</div>\n" ) ; return html . toString ( ) ; |
public class IntArrayList { /** * Index of the last element with this value .
* @ param value for the element .
* @ return the index if found otherwise - 1. */
public @ DoNotSub int lastIndexOf ( final int value ) { } } | for ( @ DoNotSub int i = size - 1 ; i >= 0 ; i -- ) { if ( value == elements [ i ] ) { return i ; } } return - 1 ; |
public class DeleteUserTeamAssociations { /** * Runs the example .
* @ param adManagerServices the services factory .
* @ param session the session .
* @ param userId the ID of the user to delete user team associations for .
* @ throws ApiException if the API request failed with one or more service errors .
*... | // Get the UserTeamAssociationService .
UserTeamAssociationServiceInterface userTeamAssociationService = adManagerServices . get ( session , UserTeamAssociationServiceInterface . class ) ; // Create a statement to get all user team associations for a user .
StatementBuilder statementBuilder = new StatementBuilder ( ) .... |
public class Kafka { /** * Adds a configuration properties for the Kafka consumer .
* @ param key property key for the Kafka consumer
* @ param value property value for the Kafka consumer */
public Kafka property ( String key , String value ) { } } | Preconditions . checkNotNull ( key ) ; Preconditions . checkNotNull ( value ) ; if ( this . kafkaProperties == null ) { this . kafkaProperties = new HashMap < > ( ) ; } kafkaProperties . put ( key , value ) ; return this ; |
public class AdminWhitelistRule { /** * Approves all the currently rejected subjects */
@ RequirePOST public HttpResponse doApproveAll ( ) throws IOException { } } | StringBuilder buf = new StringBuilder ( ) ; for ( Class c : rejected . get ( ) ) { buf . append ( c . getName ( ) ) . append ( '\n' ) ; } whitelisted . append ( buf . toString ( ) ) ; return HttpResponses . ok ( ) ; |
public class EmbeddableAttributesImpl { /** * If not already created , a new < code > transient < / code > element will be created and returned .
* Otherwise , the first existing < code > transient < / code > element will be returned .
* @ return the instance defined for the element < code > transient < / code > */... | List < Node > nodeList = childNode . get ( "transient" ) ; if ( nodeList != null && nodeList . size ( ) > 0 ) { return new TransientImpl < EmbeddableAttributes < T > > ( this , "transient" , childNode , nodeList . get ( 0 ) ) ; } return createTransient ( ) ; |
public class RecurrencePickerDialog { /** * Update the " Repeat for N events " end option with the proper string values
* based on the value that has been entered for N . */
private void updateEndCountText ( ) { } } | final String END_COUNT_MARKER = "%d" ; String endString = mResources . getQuantityString ( R . plurals . recurrence_end_count , mModel . endCount ) ; int markerStart = endString . indexOf ( END_COUNT_MARKER ) ; if ( markerStart != - 1 ) { if ( markerStart == 0 ) { Log . e ( TAG , "No text to put in to recurrence's end ... |
public class Client { /** * Returns virtual host shovels .
* @ param vhost Virtual host from where search shovels .
* @ return Shovels . */
public List < ShovelInfo > getShovels ( String vhost ) { } } | final URI uri = uriWithPath ( "./parameters/shovel/" + encodePathSegment ( vhost ) ) ; final ShovelInfo [ ] result = this . getForObjectReturningNullOn404 ( uri , ShovelInfo [ ] . class ) ; return asListOrNull ( result ) ; |
public class GetBotVersionsResult { /** * An array of < code > BotMetadata < / code > objects , one for each numbered version of the bot plus one for the
* < code > $ LATEST < / code > version .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setBots ( java... | if ( this . bots == null ) { setBots ( new java . util . ArrayList < BotMetadata > ( bots . length ) ) ; } for ( BotMetadata ele : bots ) { this . bots . add ( ele ) ; } return this ; |
public class LinearLayout { /** * Compute the offset for the item in the layout based on the offsets of neighbors
* in the layout . The other offsets are not patched . If neighbors offsets have not
* been computed the offset of the item will not be set .
* @ return true if the item fits the container , false othe... | // offset computation : update offset for all items in the cache
float startDataOffset = getStartingOffset ( ( cache . getTotalSizeWithPadding ( ) ) ) ; float layoutOffset = getLayoutOffset ( ) ; boolean inBounds = startDataOffset < - layoutOffset ; for ( int pos = 0 ; pos < cache . count ( ) ; ++ pos ) { int id = cach... |
public class F23NoncontinuousRotatedHybridComposition3 { /** * Function body */
public double f ( double [ ] x ) throws JMetalException { } } | double result = 0.0 ; for ( int i = 0 ; i < mDimension ; i ++ ) { x [ i ] = Benchmark . myXRound ( x [ i ] , m_o [ 0 ] [ i ] ) ; } result = Benchmark . hybrid_composition ( x , theJob ) ; result += mBias ; return ( result ) ; |
public class AuthenticationFilterImpl { /** * { @ inheritDoc } */
@ Override public boolean isAccepted ( HttpServletRequest request ) { } } | if ( commonFilter != null ) { return commonFilter . isAccepted ( new RealRequestInfo ( request ) ) ; } return true ; |
public class XMLServiceDocumentWriter { /** * This writes all entity sets in entity data model as collection of elements .
* @ param writer which writes to stream .
* @ throws XMLStreamException in case of any xml errors
* @ throws ODataRenderException if entity container is null . */
private void writeEntitySets... | List < EntitySet > entitySets = getEntityContainer ( ) . getEntitySets ( ) ; LOG . debug ( "Number of entity sets to be written in service document are {}" , entitySets . size ( ) ) ; for ( EntitySet entitySet : entitySets ) { if ( entitySet . isIncludedInServiceDocument ( ) ) { writeElement ( writer , null , SERVICE_C... |
public class RandomDateUtils { /** * Returns a random { @ link ZoneOffset } ( - 18:00 to + 18:00 ) .
* @ return the random { @ link ZoneOffset } */
public static ZoneOffset randomZoneOffset ( ) { } } | int totalSeconds = MAX_ZONE_OFFSET_SECONDS - RandomUtils . nextInt ( 0 , MAX_ZONE_OFFSET_SECONDS * 2 + 1 ) ; return ZoneOffset . ofTotalSeconds ( totalSeconds ) ; |
public class Account { /** * Sets if a account should ignore his ACL . Only works on Bank accounts .
* @ param ignore If the ACL is ignored or not */
public void setIgnoreACL ( boolean ignore ) { } } | Common . getInstance ( ) . getStorageHandler ( ) . getStorageEngine ( ) . setIgnoreACL ( this , ignore ) ; ignoreACL = ignore ; |
public class CommonMatchers { public static Matcher < JsonElement > isItemValid ( final Validator validator , final int itemPos ) { } } | return new TypeSafeDiagnosingMatcher < JsonElement > ( ) { @ Override protected boolean matchesSafely ( JsonElement item , Description mismatchDescription ) { // we do not care for the properties if parent item is not JsonArray
if ( ! item . isJsonArray ( ) ) return true ; // we also dont care if the item at position i... |
public class ApiOvhVps { /** * List available softwares for this template Id
* REST : GET / vps / { serviceName } / distribution / software
* @ param serviceName [ required ] The internal name of your VPS offer */
public ArrayList < Long > serviceName_distribution_software_GET ( String serviceName ) throws IOExcept... | String qPath = "/vps/{serviceName}/distribution/software" ; StringBuilder sb = path ( qPath , serviceName ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , t4 ) ; |
public class Literal { /** * Checks whether the value represents a complete substring from the from index .
* @ param from The start index of the potential substring
* @ return < code > true < / code > If the arguments represent a valid substring , < code > false < / code > otherwise . */
boolean matches ( final ch... | // Check the bounds
final int len = myCharacters . length ; if ( len + from > value . length || from < 0 ) { return false ; } // Bounds are ok , check all characters .
// Allow question marks to match any character
for ( int i = 0 ; i < len ; i ++ ) { if ( myCharacters [ i ] != value [ i + from ] && myCharacters [ i ] ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.