signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class Spy { /** * Executes the { @ link Runnable # run ( ) } method on provided argument and verifies the expectations
* @ throws SniffyAssertionError if wrong number of queries was executed
* @ since 2.0 */
public C run ( Runnable runnable ) throws SniffyAssertionError { } } | checkOpened ( ) ; try { runnable . run ( ) ; } catch ( Throwable e ) { throw verifyAndAddToException ( e ) ; } verify ( ) ; return self ( ) ; |
public class CEMILData { /** * / * ( non - Javadoc )
* @ see tuwien . auto . calimero . cemi . CEMI # toByteArray ( ) */
@ Override public byte [ ] toByteArray ( ) { } } | final ByteArrayOutputStream os = new ByteArrayOutputStream ( ) ; os . write ( mc ) ; writeAddInfo ( os ) ; setCtrlPriority ( ) ; os . write ( ctrl1 ) ; os . write ( ctrl2 ) ; byte [ ] buf = source . toByteArray ( ) ; os . write ( buf , 0 , buf . length ) ; buf = dst . toByteArray ( ) ; os . write ( buf , 0 , buf . leng... |
public class Currency { /** * Returns the exchange rate between 2 currency .
* @ param otherCurrency The other currency to exchange to
* @ return The exchange rate or Double . MIN _ VALUE if no exchange information are found .
* @ throws com . greatmancode . craftconomy3 . utils . NoExchangeRate If there ' s no e... | return Common . getInstance ( ) . getStorageHandler ( ) . getStorageEngine ( ) . getExchangeRate ( this , otherCurrency ) ; |
public class ProtectedBranchesApi { /** * Gets a Stream of protected branches from a project .
* < pre > < code > GitLab Endpoint : GET / projects / : id / protected _ branches < / code > < / pre >
* @ param projectIdOrPath the project in the form of an Integer ( ID ) , String ( path ) , or Project instance
* @ r... | return ( getProtectedBranches ( projectIdOrPath , this . getDefaultPerPage ( ) ) . stream ( ) ) ; |
public class AdjustPolygonForThresholdBias { /** * Processes and adjusts the polygon . If after adjustment a corner needs to be removed because two sides are
* parallel then the size of the polygon can be changed .
* @ param polygon The polygon that is to be adjusted . Modified .
* @ param clockwise Is the polygo... | int N = polygon . size ( ) ; segments . resize ( N ) ; // Apply the adjustment independently to each side
for ( int i = N - 1 , j = 0 ; j < N ; i = j , j ++ ) { int ii , jj ; if ( clockwise ) { ii = i ; jj = j ; } else { ii = j ; jj = i ; } Point2D_F64 a = polygon . get ( ii ) , b = polygon . get ( jj ) ; double dx = b... |
public class SipParser { /** * Frame the supplied buffer into a { @ link SipMessage } . No deep analysis of the message will be
* performed by this framer so there is no guarantee that this { @ link SipMessage } is actually a
* well formed message .
* @ param buffer
* @ return the framed { @ link SipMessage } *... | if ( true ) return frame2 ( buffer ) ; if ( ! couldBeSipMessage ( buffer ) ) { throw new SipParseException ( 0 , "Cannot be a SIP message because is doesnt start with \"SIP\" " + "(for responses) or a method (for requests)" ) ; } // we just assume that the initial line
// indeed is a correct sip line
final Buffer rawIn... |
public class CodeTypeField { /** * GetCodeType Method . */
public ClassProject . CodeType getCodeType ( ) { } } | String code = this . toString ( ) ; if ( "THICK" . equalsIgnoreCase ( code ) ) return ClassProject . CodeType . THICK ; if ( "THIN" . equalsIgnoreCase ( code ) ) return ClassProject . CodeType . THIN ; if ( "RESOURCE_CODE" . equalsIgnoreCase ( code ) ) return ClassProject . CodeType . RESOURCE_CODE ; if ( "RESOURCE_PRO... |
public class BeanHelper { /** * ( g / s ) etField - > property
* Field - > property
* @ param etter
* @ return */
public static final String property ( String etter ) { } } | if ( etter . startsWith ( "get" ) || etter . startsWith ( "set" ) ) { etter = etter . substring ( 3 ) ; } if ( etter . startsWith ( "is" ) ) { etter = etter . substring ( 2 ) ; } return lower ( etter ) ; |
public class StatefulBeanO { /** * LI2281.07 */
@ Override public MessageContext getMessageContext ( ) throws IllegalStateException { } } | IllegalStateException ise ; // Not an allowed method for Stateful beans per EJB Specification .
ise = new IllegalStateException ( "StatefulBean: getMessageContext not " + "allowed from Stateful Session Bean" ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "getMessageCont... |
public class DefaultGroovyMethods { /** * Finds all values matching the closure condition .
* < pre class = " groovyTestCase " > assert [ 2,4 ] = = [ 1,2,3,4 ] . findAll { it % 2 = = 0 } < / pre >
* @ param self a Collection
* @ param closure a closure condition
* @ return a Collection of matching values
* @ ... | Collection < T > answer = createSimilarCollection ( self ) ; Iterator < T > iter = self . iterator ( ) ; return findAll ( closure , answer , iter ) ; |
public class CommerceTierPriceEntryPersistenceImpl { /** * Returns a range of all the commerce tier price entries .
* 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 indexes in the r... | return findAll ( start , end , null ) ; |
public class ChatHistory { /** * Returns this user ' s chat history , creating one if necessary . If the given name implements
* { @ link KeepNoHistory } , null is returned . */
protected List < Entry > getList ( Name username ) { } } | if ( username instanceof KeepNoHistory ) { return null ; } List < Entry > history = _histories . get ( username ) ; if ( history == null ) { _histories . put ( username , history = Lists . newArrayList ( ) ) ; } return history ; |
public class SourceStreamManager { /** * Create a new Source Stream and store it in the given StreamSet
* @ param streamSet
* @ param priority
* @ param reliability
* @ return a new SourceStream
* @ throws SIResourceException */
private SourceStream createStream ( StreamSet streamSet , int priority , Reliabil... | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "createStream" , new Object [ ] { streamSet , new Integer ( priority ) , reliability } ) ; SourceStream stream = null ; // there is no source stream for express messages
if ( reliability . compareTo ( Reliability . BEST_EFFO... |
public class Multiplexing { /** * Demultiplexes elements from the source iterable into an iterator of channels .
* < code >
* unchain ( 2 , [ 1,2,3,4,5 ] ) - > [ [ 1,2 ] , [ 3,4 ] , [ 5 ] ]
* < / code >
* @ param < C > the channel collection type
* @ param < E > the element type
* @ param channelSize maximu... | dbc . precondition ( iterable != null , "cannot unchain a null iterable" ) ; return new UnchainIterator < C , E > ( channelSize , iterable . iterator ( ) , channelProvider ) ; |
public class Expression { /** * checkValidCheckConstraint */
public void checkValidCheckConstraint ( ) { } } | HsqlArrayList set = new HsqlArrayList ( ) ; Expression . collectAllExpressions ( set , this , subqueryExpressionSet , emptyExpressionSet ) ; if ( ! set . isEmpty ( ) ) { throw Error . error ( ErrorCode . X_0A000 , "subquery in check constraint" ) ; } |
public class LssClient { /** * get detail of your stream by app name and stream name
* @ param request The request object containing all parameters for query app stream .
* @ return the response */
public GetAppStreamResponse queryAppStream ( GetAppStreamRequest request ) { } } | checkNotNull ( request , "The parameter request should NOT be null." ) ; checkStringNotEmpty ( request . getApp ( ) , "The parameter app should NOT be null or empty string." ) ; checkStringNotEmpty ( request . getStream ( ) , "The parameter stream should NOT be null or empty string." ) ; InternalRequest internalRequest... |
public class ArrayContainer { /** * shares lots of code with inot ; candidate for refactoring */
@ Override public Container not ( final int firstOfRange , final int lastOfRange ) { } } | // TODO : may need to convert to a RunContainer
if ( firstOfRange >= lastOfRange ) { return clone ( ) ; // empty range
} // determine the span of array indices to be affected
int startIndex = Util . unsignedBinarySearch ( content , 0 , cardinality , ( short ) firstOfRange ) ; if ( startIndex < 0 ) { startIndex = - star... |
public class EvolutionDurations { /** * Returns a copy of this duration with the specified duration added .
* This instance is immutable and unaffected by this method call .
* @ param other the duration to add
* @ return a { @ code EvolutionDurations } based on this duration with the
* specified duration added ... | requireNonNull ( other ) ; return of ( _offspringSelectionDuration . plus ( other . _offspringSelectionDuration ) , _survivorsSelectionDuration . plus ( other . _survivorsSelectionDuration ) , _offspringAlterDuration . plus ( other . _offspringAlterDuration ) , _offspringFilterDuration . plus ( other . _offspringFilter... |
public class MemoryCache { /** * Clears component state . */
private void cleanup ( ) { } } | CacheEntry oldest = null ; _count = 0 ; // Cleanup obsolete entries and find the oldest
for ( Map . Entry < String , CacheEntry > e : _cache . entrySet ( ) ) { String key = e . getKey ( ) ; CacheEntry entry = e . getValue ( ) ; // Remove obsolete entry
if ( entry . isExpired ( ) ) { _cache . remove ( key ) ; } // Count... |
public class DeleteAccountAuditConfigurationRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( DeleteAccountAuditConfigurationRequest deleteAccountAuditConfigurationRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( deleteAccountAuditConfigurationRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( deleteAccountAuditConfigurationRequest . getDeleteScheduledAudits ( ) , DELETESCHEDULEDAUDITS_BINDING ) ; } catch ( Exception e ) { throw new SdkC... |
public class OutputHandler { /** * The task output a record with a partition number attached . */
public void partitionedOutput ( int reduce , K key , V value ) throws IOException { } } | PipesPartitioner . setNextPartition ( reduce ) ; collector . collect ( key , value ) ; |
public class AbstractPlugin { /** * Gets language label with the specified locale and key .
* @ param locale the specified locale
* @ param key the specified key
* @ return language label */
public String getLang ( final Locale locale , final String key ) { } } | return langs . get ( locale . toString ( ) ) . getProperty ( key ) ; |
public class HtmlDocletWriter { /** * Adds the annotation types for the given packageElement .
* @ param packageElement the package to write annotations for .
* @ param htmltree the documentation tree to which the annotation info will be
* added */
public void addAnnotationInfo ( PackageElement packageElement , C... | addAnnotationInfo ( packageElement , packageElement . getAnnotationMirrors ( ) , htmltree ) ; |
public class JdbcExtractor { /** * Build / Format input query in the required format
* @ param schema
* @ param entity
* @ param inputQuery
* @ return formatted extract query */
private String getExtractQuery ( String schema , String entity , String inputQuery ) { } } | String inputColProjection = this . getInputColumnProjection ( ) ; String outputColProjection = this . getOutputColumnProjection ( ) ; String query = inputQuery ; if ( query == null ) { // if input query is null , build the query from metadata
query = "SELECT " + outputColProjection + " FROM " + schema + "." + entity ; ... |
public class PeekView { /** * Show the PeekView over the point of motion
* @ param startX
* @ param startY */
private void setContentOffset ( int startX , int startY , Translation translation , int movementAmount ) { } } | if ( translation == Translation . VERTICAL ) { // center the X around the start point
int originalStartX = startX ; startX -= contentParams . width / 2 ; // if Y is in the lower half , we want it to go up , otherwise , leave it the same
boolean moveDown = true ; if ( startY + contentParams . height + FINGER_SIZE > scre... |
public class DrizzleConnection { /** * Sets whether this connection is auto commited .
* @ param autoCommit if it should be auto commited .
* @ throws SQLException if something goes wrong talking to the server . */
public void setAutoCommit ( final boolean autoCommit ) throws SQLException { } } | Statement stmt = createStatement ( ) ; String clause ; if ( autoCommit ) { clause = "1" ; } else { clause = "0" ; } stmt . executeUpdate ( "set autocommit=" + clause ) ; |
public class GitlabAPI { /** * Gets all members of a Group
* @ param groupId The id of the GitLab Group
* @ return The Group Members */
public List < GitlabGroupMember > getGroupMembers ( Integer groupId ) { } } | String tailUrl = GitlabGroup . URL + "/" + groupId + GitlabGroupMember . URL + PARAM_MAX_ITEMS_PER_PAGE ; return retrieve ( ) . getAll ( tailUrl , GitlabGroupMember [ ] . class ) ; |
public class IntAVLTree { /** * Find a node in this tree . */
public int find ( ) { } } | for ( int node = root ; node != NIL ; ) { final int cmp = compare ( node ) ; if ( cmp < 0 ) { node = left ( node ) ; } else if ( cmp > 0 ) { node = right ( node ) ; } else { return node ; } } return NIL ; |
public class HttpConnection { /** * Reads up to < tt > " \ n " < / tt > from the ( unchunked ) input stream .
* If the stream ends before the line terminator is found ,
* the last part of the string will still be returned .
* @ throws IllegalStateException if the connection is not open
* @ throws IOException if... | LOG . trace ( "enter HttpConnection.readLine()" ) ; assertOpen ( ) ; return HttpParser . readLine ( inputStream ) ; |
public class MediaApi { /** * Log out of a media channel
* Log out the current agent on the specified media channels . You can make a [ / media / { mediatype } / ready ] ( / reference / workspace / Media / index . html # readyAgentState ) or [ / media / { mediatype } / not - ready ] ( / reference / workspace / Media ... | ApiResponse < ApiSuccessResponse > resp = removeMediaWithHttpInfo ( mediatype , logoutMediaData ) ; return resp . getData ( ) ; |
public class CasConfigurationModifiedEvent { /** * Is eligible for context refresh ?
* @ return the boolean */
public boolean isEligibleForContextRefresh ( ) { } } | if ( this . override ) { return true ; } if ( getFile ( ) != null ) { return CONFIG_FILE_PATTERN . matcher ( getFile ( ) . toFile ( ) . getName ( ) ) . find ( ) ; } return false ; |
public class CompletableFuture { /** * Pushes the given completion unless it completes while trying . Caller should first check that
* result is null . */
final void unipush ( Completion c ) { } } | if ( c != null ) { while ( ! tryPushStack ( c ) ) { if ( result != null ) { lazySetNext ( c , null ) ; break ; } } if ( result != null ) c . tryFire ( SYNC ) ; } |
public class TransitFactory { /** * Creates a reader instance .
* @ param type the format to read in
* @ param in the input stream to read from
* @ param customHandlers a map of custom ReadHandlers to use in addition
* or in place of the default ReadHandlers
* @ return a reader */
public static Reader reader ... | return reader ( type , in , customHandlers , null ) ; |
public class Util { /** * Ensure string ends with suffix
* @ param subject Examined string
* @ param suffix Desired suffix
* @ return Original subject in case it already ends with suffix , null in
* case subject was null and subject + suffix otherwise .
* @ since 1.505 */
@ Nullable public static String ensur... | if ( subject == null ) return null ; if ( subject . endsWith ( suffix ) ) return subject ; return subject + suffix ; |
public class Parser { /** * May return an { @ link ArrayLiteral } or { @ link ArrayComprehension } . */
private AstNode arrayLiteral ( ) throws IOException { } } | if ( currentToken != Token . LB ) codeBug ( ) ; int pos = ts . tokenBeg , end = ts . tokenEnd ; List < AstNode > elements = new ArrayList < AstNode > ( ) ; ArrayLiteral pn = new ArrayLiteral ( pos ) ; boolean after_lb_or_comma = true ; int afterComma = - 1 ; int skipCount = 0 ; for ( ; ; ) { int tt = peekToken ( ) ; if... |
public class RegistriesInner { /** * Updates a container registry with the specified parameters .
* @ param resourceGroupName The name of the resource group to which the container registry belongs .
* @ param registryName The name of the container registry .
* @ param registryUpdateParameters The parameters for u... | return updateWithServiceResponseAsync ( resourceGroupName , registryName , registryUpdateParameters ) . toBlocking ( ) . last ( ) . body ( ) ; |
public class SessionManager { /** * Returns a participant in a session
* @ param sessionId identifier of the session
* @ param participantPrivateId private identifier of the participant
* @ return { @ link Participant }
* @ throws OpenViduException in case the session doesn ' t exist or the
* participant does... | Session session = sessions . get ( sessionId ) ; if ( session == null ) { throw new OpenViduException ( Code . ROOM_NOT_FOUND_ERROR_CODE , "Session '" + sessionId + "' not found" ) ; } Participant participant = session . getParticipantByPrivateId ( participantPrivateId ) ; if ( participant == null ) { throw new OpenVid... |
public class AzureBatchEvaluatorShimManager { /** * This method is called when a resource is requested . It will add a task to the existing Azure Batch job which
* is equivalent to requesting a container in Azure Batch . When the request is fulfilled and the evaluator shim is
* started , it will send a message back... | try { createAzureBatchTask ( containerId , jarFileUri ) ; this . outstandingResourceRequests . put ( containerId , resourceRequestEvent ) ; this . outstandingResourceRequestCount . incrementAndGet ( ) ; this . updateRuntimeStatus ( ) ; } catch ( IOException e ) { LOG . log ( Level . SEVERE , "Failed to create Azure Bat... |
public class MultiRestServiceAdapter { /** * Returns the endpoint URLs for the RESTful service . Supports property specifiers
* via the syntax for { @ link # AdapterActivityBase . getAttributeValueSmart ( String ) } .
* @ throws ActivityException */
protected List < String > getEndpointUris ( ) throws AdapterExcept... | List < String > urlmap = new ArrayList < String > ( ) ; try { String map = getAttributeValue ( ENDPOINT_URI ) ; List < String [ ] > urlmaparray ; if ( map == null ) urlmaparray = new ArrayList < String [ ] > ( ) ; else urlmaparray = StringHelper . parseTable ( map , ',' , ';' , 1 ) ; for ( String [ ] entry : urlmaparra... |
public class DescribePipelinesRequest { /** * The IDs of the pipelines to describe . You can pass as many as 25 identifiers in a single call . To obtain pipeline
* IDs , call < a > ListPipelines < / a > .
* @ param pipelineIds
* The IDs of the pipelines to describe . You can pass as many as 25 identifiers in a si... | if ( pipelineIds == null ) { this . pipelineIds = null ; return ; } this . pipelineIds = new com . amazonaws . internal . SdkInternalList < String > ( pipelineIds ) ; |
public class CanonicalXML { /** * Create canonical XML silently , throwing exceptions rather than displaying messages
* @ param parser
* @ param inputSource
* @ param stripSpace
* @ return
* @ throws Exception */
public String toCanonicalXml2 ( XMLReader parser , InputSource inputSource , boolean stripSpace )... | mStrip = stripSpace ; mOut = new StringWriter ( ) ; parser . setContentHandler ( this ) ; parser . setErrorHandler ( this ) ; parser . parse ( inputSource ) ; return mOut . toString ( ) ; |
public class AmazonIdentityManagementClient { /** * Simulate how a set of IAM policies attached to an IAM entity works with a list of API operations and AWS
* resources to determine the policies ' effective permissions . The entity can be an IAM user , group , or role . If you
* specify a user , then the simulation... | request = beforeClientExecution ( request ) ; return executeSimulatePrincipalPolicy ( request ) ; |
public class LdapHelper { /** * Returns the DN ( Distinguished Name ) for a Node .
* @ param node the given Node .
* @ return the DN of that Node . */
public String getDNForNode ( final LdapNode node ) { } } | if ( node instanceof LdapGroup ) { return String . format ( LdapKeys . GROUP_CN_FORMAT , groupIdentifyer , node . get ( groupIdentifyer ) , baseGroupDn ) ; } else { return String . format ( LdapKeys . USER_UID_FORMAT , userIdentifyer , node . get ( userIdentifyer ) , basePeopleDn ) ; } |
public class ClassInfoRepository { /** * Java { @ code Class . getCanonicalName ( ) } sometimes will throw out
* { @ code InternalError } with message : " { code Malformed class name } "
* We just ignore it
* @ param c the class on which canonical name is returned
* @ return the canonical name of the class spec... | try { return c . getCanonicalName ( ) ; } catch ( InternalError e ) { return null ; } catch ( IllegalAccessError e ) { return null ; } |
public class SchedulerForType { /** * Update the pool metrics . The update is atomic at the map level . */
private void collectPoolInfoMetrics ( ) { } } | Map < PoolInfo , PoolInfoMetrics > newPoolNameToMetrics = new HashMap < PoolInfo , PoolInfoMetrics > ( ) ; long now = ClusterManager . clock . getTime ( ) ; Map < PoolInfo , Long > poolInfoAverageFirstWaitMs = sessionManager . getTypePoolInfoAveFirstWaitMs ( type ) ; // The gets + puts below are OK because only one thr... |
public class PathOverrideService { /** * Generate a path select string
* @ return Select query string */
private String getPathSelectString ( ) { } } | String queryString = "SELECT " + Constants . DB_TABLE_REQUEST_RESPONSE + "." + Constants . GENERIC_CLIENT_UUID + "," + Constants . DB_TABLE_PATH + "." + Constants . GENERIC_ID + "," + Constants . PATH_PROFILE_PATHNAME + "," + Constants . PATH_PROFILE_ACTUAL_PATH + "," + Constants . PATH_PROFILE_BODY_FILTER + "," + Cons... |
public class ClasspathWorkspaceReader { /** * Returns if two artifacts are equivalent , that is , have the same groupId , artifactId and Version
* @ param artifact
* left side artifact to be compared
* @ param foundArtifact
* right side artifact to be compared
* @ return true if the groupId , artifactId and v... | boolean areEquivalent = ( foundArtifact . getGroupId ( ) . equals ( artifact . getGroupId ( ) ) && foundArtifact . getArtifactId ( ) . equals ( artifact . getArtifactId ( ) ) && foundArtifact . getVersion ( ) . equals ( artifact . getVersion ( ) ) ) ; return areEquivalent ; |
public class Calc { /** * Rotate a structure object . The rotation Matrix must be a
* pre - multiplication Matrix .
* @ param structure
* the structure to be rotated
* @ param m
* rotation matrix to be applied */
public static final void rotate ( Structure structure , Matrix m ) { } } | AtomIterator iter = new AtomIterator ( structure ) ; while ( iter . hasNext ( ) ) { Atom atom = iter . next ( ) ; rotate ( atom , m ) ; } |
public class MalisisRegistry { /** * Registers a { @ link IRegisterable } . < br >
* The object has to be either a { @ link Block } or an { @ link Item } .
* @ param registerable the registerable */
public static void register ( IRegisterable < ? > registerable ) { } } | ResourceLocation name = registerable . getName ( ) ; if ( name == null ) throw new IllegalArgumentException ( "No name specified for registration for " + registerable . getClass ( ) . getName ( ) ) ; if ( ! ( registerable instanceof Block || registerable instanceof Item ) ) throw new IllegalArgumentException ( "Cannot ... |
public class Splash { /** * Display splash , and launch app .
* @ param args the command line arguments */
public static void main ( String [ ] args ) { } } | String splashImage = Splash . getParam ( args , SPLASH ) ; if ( ( splashImage == null ) || ( splashImage . length ( ) == 0 ) ) splashImage = DEFAULT_SPLASH ; URL url = Splash . class . getResource ( splashImage ) ; if ( url == null ) if ( ClassServiceUtility . getClassService ( ) . getClassFinder ( null ) != null ) url... |
public class AfplibFactoryImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public PresentationControlPRSFlg createPresentationControlPRSFlgFromString ( EDataType eDataType , String initialValue ) { } } | PresentationControlPRSFlg result = PresentationControlPRSFlg . get ( initialValue ) ; if ( result == null ) throw new IllegalArgumentException ( "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType . getName ( ) + "'" ) ; return result ; |
public class ResourceService { /** * execute with a resource
* @ param copyResourcesMojo
* @ param resource
* @ param outputDirectory
* @ param flatten
* @ throws ResourceExecutionException */
public static void execute ( CopyResourcesMojo copyResourcesMojo , Resource resource , File outputDirectory ) throws ... | copyResourcesMojo . getLog ( ) . debug ( "Execute resource : " + resource ) ; // choose a location to checkout project
File workspacePlugin = PathUtils . getWorkspace ( copyResourcesMojo ) ; // security
if ( workspacePlugin . exists ( ) ) { copyResourcesMojo . getLog ( ) . debug ( "delete workspacePlugin resource becau... |
public class Task { /** * The Baseline Duration field shows the original span of time planned
* to complete a task .
* @ return - duration string */
public Duration getBaselineDuration ( ) { } } | Object result = getCachedValue ( TaskField . BASELINE_DURATION ) ; if ( result == null ) { result = getCachedValue ( TaskField . BASELINE_ESTIMATED_DURATION ) ; } if ( ! ( result instanceof Duration ) ) { result = null ; } return ( Duration ) result ; |
public class Node { /** * syck _ seq _ empty */
public void seqEmpty ( ) { } } | Data . Seq s = ( Data . Seq ) data ; s . idx = 0 ; s . capa = YAML . ALLOC_CT ; s . items = new Object [ s . capa ] ; |
public class JsonUtil { /** * Writes the given value with the given writer .
* @ param writer
* @ param values
* @ throws IOException
* @ author vvakame */
public static void putLongList ( Writer writer , List < Long > values ) throws IOException { } } | if ( values == null ) { writer . write ( "null" ) ; } else { startArray ( writer ) ; for ( int i = 0 ; i < values . size ( ) ; i ++ ) { put ( writer , values . get ( i ) ) ; if ( i != values . size ( ) - 1 ) { addSeparator ( writer ) ; } } endArray ( writer ) ; } |
public class ManagerReaderImpl { /** * Reads line by line from the asterisk server , sets the protocol identifier
* ( using a generated
* { @ link org . asteriskjava . manager . event . ProtocolIdentifierReceivedEvent } )
* as soon as it is received and dispatches the received events and
* responses via the ass... | final Map < String , Object > buffer = new HashMap < > ( ) ; String line ; if ( socket == null ) { throw new IllegalStateException ( "Unable to run: socket is null." ) ; } this . die = false ; this . dead = false ; try { // main loop
while ( ! this . die && ( line = socket . readLine ( ) ) != null ) { // maybe we will ... |
public class AbstractFileLookup { /** * Looks up the file , see : { @ link DefaultFileLookup } .
* @ param filename might be the name of the file ( too look it up in the class path ) or an url to a file .
* @ return an input stream to the file or null if nothing found through all lookup steps .
* @ throws FileNot... | InputStream is = filename == null || filename . length ( ) == 0 ? null : getAsInputStreamFromClassLoader ( filename , cl ) ; if ( is == null ) { if ( log . isDebugEnabled ( ) ) log . debugf ( "Unable to find file %s in classpath; searching for this file on the filesystem instead." , filename ) ; return new FileInputStr... |
public class IPDImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public void eSet ( int featureID , Object newValue ) { } } | switch ( featureID ) { case AfplibPackage . IPD__IOC_ADAT : setIOCAdat ( ( byte [ ] ) newValue ) ; return ; case AfplibPackage . IPD__IMAGE_DATA : setImageData ( ( byte [ ] ) newValue ) ; return ; } super . eSet ( featureID , newValue ) ; |
public class JavaParser { /** * src / main / resources / org / drools / compiler / semantics / java / parser / Java . g : 950:1 : retractStatement : s = ' retract ' ' ( ' expression c = ' ) ' ; */
public final void retractStatement ( ) throws RecognitionException { } } | int retractStatement_StartIndex = input . index ( ) ; Token s = null ; Token c = null ; ParserRuleReturnScope expression9 = null ; try { if ( state . backtracking > 0 && alreadyParsedRule ( input , 91 ) ) { return ; } // src / main / resources / org / drools / compiler / semantics / java / parser / Java . g : 951:5 : (... |
public class NettyClient { ChannelFuture connect ( final InetSocketAddress serverSocketAddress ) { } } | checkState ( bootstrap != null , "Client has not been initialized yet." ) ; // Child channel pipeline for accepted connections
bootstrap . handler ( new ChannelInitializer < SocketChannel > ( ) { @ Override public void initChannel ( SocketChannel channel ) throws Exception { // SSL handler should be added first in the ... |
public class Utils { /** * Get the MIME type of a file
* @ param url
* @ return */
public static String getMimeType ( String url ) { } } | String type = null ; String extension = MimeTypeMap . getFileExtensionFromUrl ( url ) ; if ( extension != null ) { MimeTypeMap mime = MimeTypeMap . getSingleton ( ) ; type = mime . getMimeTypeFromExtension ( extension ) ; } return type ; |
public class Database { public DbDatum [ ] get_property ( String name , DbDatum [ ] properties ) throws DevFailed { } } | return databaseDAO . get_property ( this , name , properties ) ; |
public class StandardRoadNetwork { /** * Compute the bounds of this element .
* This function does not update the internal
* attribute replied by { @ link # getBoundingBox ( ) } */
@ Override @ Pure protected Rectangle2d calcBounds ( ) { } } | final Rectangle2d rect = new Rectangle2d ( ) ; boolean first = true ; Rectangle2d rs ; for ( final RoadSegment segment : getRoadSegments ( ) ) { rs = segment . getBoundingBox ( ) ; if ( rs != null && ! rs . isEmpty ( ) ) { if ( first ) { first = false ; rect . set ( rs ) ; } else { rect . setUnion ( rs ) ; } } } return... |
public class TaskAddCollectionOptions { /** * Set the time the request was issued . Client libraries typically set this to the current system clock time ; set it explicitly if you are calling the REST API directly .
* @ param ocpDate the ocpDate value to set
* @ return the TaskAddCollectionOptions object itself . *... | if ( ocpDate == null ) { this . ocpDate = null ; } else { this . ocpDate = new DateTimeRfc1123 ( ocpDate ) ; } return this ; |
public class ZookeeperServerManager { public void startup ( ) { } } | // Dictionary < ? , ? > dict = cmPropertyPlaceholder . getConfigAdmin ( )
// . getConfiguration ( cmPropertyPlaceholder . getPersistentId ( ) ) . getProperties ( ) ;
Dictionary < ? , ? > dict = properties ; // System . out . println ( " # # # ZOOKEEPER : : dictionary : " + dict ) ;
LOG . info ( "Staring up ZooKeeper se... |
public class HeartbeatBackground { /** * Schedule the next heartbeat */
private void scheduleHeartbeat ( ) { } } | // elapsed time in seconds since the last heartbeat
long elapsedSecsSinceLastHeartBeat = System . currentTimeMillis ( ) / 1000 - lastHeartbeatStartTimeInSecs ; /* * The initial delay for the new scheduling is 0 if the elapsed
* time is more than the heartbeat time interval , otherwise it is the
* difference between... |
public class PropertiesManagerCore { /** * Close all GeoPackages in the manager */
public void closeGeoPackages ( ) { } } | for ( PropertiesCoreExtension < T , ? , ? , ? > properties : propertiesMap . values ( ) ) { properties . getGeoPackage ( ) . close ( ) ; } propertiesMap . clear ( ) ; |
public class ItemProcessorPipeline { /** * Adds several processors to the pipeline of processors . */
public void addProcessors ( Collection < ItemProcessor > processors ) { } } | if ( processors == null ) { processors = new ArrayList < > ( ) ; } processors . addAll ( processors ) ; |
public class TransactionHelper { /** * Starts a new Hibernate transaction . Note that the caller accepts responsibility for closing the transaction
* @ return */
public HibernateTransaction start ( ) { } } | final Session session = sessionProvider . get ( ) ; final Transaction tx = session . beginTransaction ( ) ; return new HibernateTransaction ( tx ) ; |
public class AWSIotClient { /** * Lists the active violations for a given Device Defender security profile .
* @ param listActiveViolationsRequest
* @ return Result of the ListActiveViolations operation returned by the service .
* @ throws InvalidRequestException
* The request is not valid .
* @ throws Resour... | request = beforeClientExecution ( request ) ; return executeListActiveViolations ( request ) ; |
public class FastAdapter { /** * Gets the adapter for the given position
* @ param position the global position
* @ return the adapter responsible for this global position */
@ Nullable public IAdapter < Item > getAdapter ( int position ) { } } | // if we are out of range just return null
if ( position < 0 || position >= mGlobalSize ) { return null ; } if ( mVerbose ) Log . v ( TAG , "getAdapter" ) ; // now get the adapter which is responsible for the given position
return mAdapterSizes . valueAt ( floorIndex ( mAdapterSizes , position ) ) ; |
public class tmtrafficaction { /** * Use this API to update tmtrafficaction . */
public static base_response update ( nitro_service client , tmtrafficaction resource ) throws Exception { } } | tmtrafficaction updateresource = new tmtrafficaction ( ) ; updateresource . name = resource . name ; updateresource . apptimeout = resource . apptimeout ; updateresource . sso = resource . sso ; updateresource . formssoaction = resource . formssoaction ; updateresource . persistentcookie = resource . persistentcookie ;... |
public class DescribeRdsDbInstancesResult { /** * An a array of < code > RdsDbInstance < / code > objects that describe the instances .
* @ return An a array of < code > RdsDbInstance < / code > objects that describe the instances . */
public java . util . List < RdsDbInstance > getRdsDbInstances ( ) { } } | if ( rdsDbInstances == null ) { rdsDbInstances = new com . amazonaws . internal . SdkInternalList < RdsDbInstance > ( ) ; } return rdsDbInstances ; |
public class LikeIgnoreCase { /** * / * ( non - Javadoc )
* @ see net . leadware . persistence . tools . api . utils . restrictions . Predicate # generateJPAPredicate ( javax . persistence . criteria . CriteriaBuilder , javax . persistence . criteria . Root ) */
@ Override public Predicate generateJPAPredicate ( Crit... | // On retourne le predicat
return criteriaBuilder . like ( criteriaBuilder . lower ( this . < String > buildPropertyPath ( root , property ) ) , value . toLowerCase ( ) ) ; |
public class DerivedByRemovalFrom { /** * Gets the value of the others property .
* This accessor method returns a reference to the live list ,
* not a snapshot . Therefore any modification you make to the
* returned list will be present inside the JAXB object .
* This is why there is not a < CODE > set < / COD... | if ( others == null ) { others = AttributeList . populateKnownAttributes ( this , all , org . openprovenance . prov . model . Other . class ) ; } return this . others ; |
public class DefaultGroovyMethods { /** * internal helper method */
protected static < T > T callClosureForLine ( @ ClosureParams ( value = FromString . class , options = { } } | "String" , "String,Integer" } ) Closure < T > closure , String line , int counter ) { if ( closure . getMaximumNumberOfParameters ( ) == 2 ) { return closure . call ( line , counter ) ; } return closure . call ( line ) ; |
public class UpdateMethodResponseResult { /** * A key - value map specifying required or optional response parameters that API Gateway can send back to the caller .
* A key defines a method response header and the value specifies whether the associated method response header is
* required or not . The expression of... | setResponseParameters ( responseParameters ) ; return this ; |
public class JsonView { /** * Creates a JSON [ JSONObject , JSONArray , JSONNUll ] from the model values . */
protected JSON createJSON ( Map model , HttpServletRequest request , HttpServletResponse response ) { } } | return defaultCreateJSON ( model ) ; |
public class Fibers { /** * Runs an action in a new fiber and awaits the fiber ' s termination .
* @ param scheduler the { @ link FiberScheduler } to use when scheduling the fiber .
* @ param target the operation
* @ throws ExecutionException
* @ throws InterruptedException */
public static void runInFiber ( Fi... | FiberUtil . runInFiber ( scheduler , target ) ; |
public class SessionDialog { /** * Creates the UI shared context for the given context .
* Should be called when a new context is added to the session and before adding its panels .
* @ param context the context
* @ since 2.6.0 */
public void createUISharedContext ( Context context ) { } } | if ( session != null ) { uiContexts . put ( context . getIndex ( ) , context . duplicate ( ) ) ; } |
public class UInteger { /** * Figure out the size of the precache .
* @ return The parsed value of the system property
* { @ link # PRECACHE _ PROPERTY } or { @ link # DEFAULT _ PRECACHE _ SIZE } if
* the property is not set , not a number or retrieving results in a
* { @ link SecurityException } . If the parse... | String prop = null ; long propParsed ; try { prop = System . getProperty ( PRECACHE_PROPERTY ) ; } catch ( SecurityException e ) { // security manager stopped us so use default
// FIXME : should we log this somewhere ?
return DEFAULT_PRECACHE_SIZE ; } if ( prop == null ) return DEFAULT_PRECACHE_SIZE ; // empty value
//... |
public class StaticWord2Vec { /** * This method returns mean vector , built from words / labels passed in
* @ param labels
* @ return */
@ Override public INDArray getWordVectorsMean ( Collection < String > labels ) { } } | INDArray matrix = getWordVectors ( labels ) ; // TODO : check this ( 1)
return matrix . mean ( 1 ) ; |
public class GenericResource { /** * Returns the information about lock .
* @ param token lock token
* @ param lockOwner lockowner
* @ param timeOut lock timeout
* @ return lock information */
public static HierarchicalProperty lockDiscovery ( String token , String lockOwner , String timeOut ) { } } | HierarchicalProperty lockDiscovery = new HierarchicalProperty ( new QName ( "DAV:" , "lockdiscovery" ) ) ; HierarchicalProperty activeLock = lockDiscovery . addChild ( new HierarchicalProperty ( new QName ( "DAV:" , "activelock" ) ) ) ; HierarchicalProperty lockType = activeLock . addChild ( new HierarchicalProperty ( ... |
public class MolaDbClient { /** * Delete a table from moladb
* @ param request Container for the necessary parameters to
* execute the delete table service method on Moladb .
* @ return The responseContent from the Delete table service method , as returned by
* Moladb .
* @ throws BceClientException
* If an... | checkNotNull ( request , "request should not be null." ) ; InternalRequest httpRequest = createRequestUnderInstance ( HttpMethodName . DELETE , MolaDbConstants . URI_TABLE , request . getTableName ( ) ) ; DeleteTableResponse ret = this . invokeHttpClient ( httpRequest , DeleteTableResponse . class ) ; return ret ; |
public class EC2Context { /** * < br >
* Needed AWS actions :
* < ul >
* < li > autoscaling : DescribeAutoScalingGroups < / li >
* < / ul >
* @ return the tags of the given auto sclaing group */
public Map < String , String > getAutoScalingGroupTags ( String autoScalingGroupName ) { } } | Preconditions . checkArgument ( autoScalingGroupName != null && ! autoScalingGroupName . isEmpty ( ) ) ; AutoScalingGroup group = this . getAutoScalingGroup ( autoScalingGroupName ) ; Map < String , String > tags = new HashMap < > ( ) ; for ( TagDescription tagDescription : group . getTags ( ) ) { tags . put ( tagDescr... |
public class TemplatedEmail { /** * Creates the mime message for the e - mail .
* @ param messageBody
* @ return the message */
private Message buildMessage ( String messageBody ) throws MessagingException { } } | Message message = new MimeMessage ( getSession ( ) ) ; message . setFrom ( new InternetAddress ( fromAddress ) ) ; message . setSubject ( substitute ( subject ) ) ; Multipart multiPart = new MimeMultipart ( ) ; // html body part
BodyPart bodyPart = new MimeBodyPart ( ) ; if ( messageBody == null ) messageBody = getBody... |
public class TangoMonitor { synchronized void rel_monitor ( ) { } } | Util . out4 . println ( "In rel_monitor(), used = " + used + ", ctr = " + locked_ctr ) ; if ( used == true ) { locked_ctr -- ; if ( locked_ctr == 0 ) { Util . out4 . println ( "Signalling !" ) ; used = false ; // locking _ thread = NULL ;
notify ( ) ; } } |
public class LBFGS_port { /** * Start a L - BFGS optimization .
* @ param n The number of variables .
* @ param x The array of variables . A client program can set
* default values for the optimization and receive the
* optimization result through this array . This array
* must be allocated by : : lbfgs _ mal... | final int n = x . length ; StatusCode ret , ls_ret ; MutableInt ls = new MutableInt ( 0 ) ; int i , j , k , end , bound ; double step ; /* Constant parameters and their default values . */
LBFGSPrm param = ( _param != null ) ? _param : new LBFGSPrm ( ) ; final int m = param . m ; double [ ] xp ; double [ ] g , gp , pg ... |
public class StreamUtil { /** * Eats an inputstream , discarding its contents
* @ param is
* InputStream The input stream to read to the end of
* @ return long The size of the stream */
public static long eatInputStream ( InputStream is ) { } } | try { long eaten = 0 ; try { Thread . sleep ( STREAM_SLEEP_TIME ) ; } catch ( InterruptedException e ) { // ignore
} int avail = Math . min ( is . available ( ) , CHUNKSIZE ) ; byte [ ] eatingArray = new byte [ CHUNKSIZE ] ; while ( avail > 0 ) { is . read ( eatingArray , 0 , avail ) ; eaten += avail ; if ( avail < CHU... |
public class DataIOEditorNameTextBox { /** * Sets the invalid values for the TextBox
* @ param invalidValues
* @ param isCaseSensitive
* @ param invalidValueErrorMessage */
public void setInvalidValues ( final Set < String > invalidValues , final boolean isCaseSensitive , final String invalidValueErrorMessage ) {... | if ( isCaseSensitive ) { this . invalidValues = invalidValues ; } else { this . invalidValues = new HashSet < String > ( ) ; for ( String value : invalidValues ) { this . invalidValues . add ( value . toLowerCase ( ) ) ; } } this . isCaseSensitive = isCaseSensitive ; this . invalidValueErrorMessage = invalidValueErrorM... |
public class DocumentImpl { /** * { @ inheritDoc }
* Text documents in MarkLogic cannot be cloned .
* UnsupportedOperationException will be thrown if cloneNode is call on text
* document . < / >
* DocumentType node will not be cloned as it is not part of the Expanded
* Tree . < / > */
public Node cloneNode ( ... | try { if ( isXMLDoc == UNKNOWN_TYPE ) isXMLDoc = getDocumentType ( ) ; if ( isXMLDoc == NON_XML ) { throw new UnsupportedOperationException ( "Text document cannot be cloned" ) ; } // initialize a new doc owner node
initClonedOwnerDoc ( ) ; } catch ( ParserConfigurationException e ) { throw new RuntimeException ( "Inte... |
public class CmsHistoryListUtil { /** * Returns the version number from a version parameter . < p >
* @ param version might be negative for the online version
* @ param locale if the result is for display purposes , the locale has to be < code > ! = null < / code >
* @ return the display name */
public static Str... | int ver = Integer . parseInt ( version ) ; if ( ver == CmsHistoryResourceHandler . PROJECT_OFFLINE_VERSION ) { return Messages . get ( ) . getBundle ( locale ) . key ( Messages . GUI_PROJECT_OFFLINE_0 ) ; } if ( ver < 0 ) { ver *= - 1 ; if ( locale != null ) { return Messages . get ( ) . getBundle ( locale ) . key ( Me... |
public class Snackbar { /** * Sets the text to be displayed in this { @ link Snackbar }
* @ param text
* @ return */
public Snackbar text ( CharSequence text ) { } } | mText = text ; if ( snackbarText != null ) { snackbarText . setText ( mText ) ; } return this ; |
public class SessionImpl { /** * Copy schema concept and all its subs labels to keyspace cache
* @ param schemaConcept */
private void copyToCache ( SchemaConcept schemaConcept ) { } } | schemaConcept . subs ( ) . forEach ( concept -> keyspaceCache . cacheLabel ( concept . label ( ) , concept . labelId ( ) ) ) ; |
public class Predicates { /** * Returns a predicate that evaluates to { @ code true } if both of its
* components evaluate to { @ code true } . The components are evaluated in
* order , and evaluation will be " short - circuited " as soon as a false
* predicate is found .
* @ param first the first
* @ param s... | checkArgNotNull ( first , "first" ) ; checkArgNotNull ( second , "second" ) ; return new AndPredicate < T > ( ImmutableList . < Predicate < ? super T > > of ( first , second ) ) ; |
public class JobTracker { /** * Run forever */
public void offerService ( ) throws InterruptedException , IOException { } } | taskScheduler . start ( ) ; // refresh the node list as the recovery manager might have added
// disallowed trackers
refreshHosts ( ) ; this . expireTrackersThread = new Thread ( this . expireTrackers , "expireTrackers" ) ; this . expireTrackersThread . setDaemon ( true ) ; this . expireTrackersThread . start ( ) ; thi... |
public class AwsSecurityFindingFilters { /** * The ARN of the solution that generated a related finding .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setRelatedFindingsProductArn ( java . util . Collection ) } or
* { @ link # withRelatedFindingsProductA... | if ( this . relatedFindingsProductArn == null ) { setRelatedFindingsProductArn ( new java . util . ArrayList < StringFilter > ( relatedFindingsProductArn . length ) ) ; } for ( StringFilter ele : relatedFindingsProductArn ) { this . relatedFindingsProductArn . add ( ele ) ; } return this ; |
public class BinaryField { /** * Pulls out the portion of our full buffer that represents just the binary value held by the field .
* Shared by both constructors to initialize the { @ link # value } field . Handles the special case of
* a zero - length blob , for which no bytes at all are sent . ( Really ! The prot... | buffer . rewind ( ) ; if ( buffer . capacity ( ) > 0 ) { buffer . get ( ) ; // Move past the tag
buffer . getInt ( ) ; // Move past the size
} return buffer . slice ( ) ; |
public class DurableLog { /** * region AbstractService Implementation */
@ Override protected void doStart ( ) { } } | log . info ( "{}: Starting." , this . traceObjectId ) ; this . delayedStartRetry . runAsync ( ( ) -> tryStartOnce ( ) . whenComplete ( ( v , ex ) -> { if ( ex == null ) { // We are done .
notifyDelayedStartComplete ( null ) ; } else { if ( Exceptions . unwrap ( ex ) instanceof DataLogDisabledException ) { // Place the ... |
public class ReactiveTypes { /** * Returns { @ literal true } if { @ code type } is a reactive wrapper type that contains no value .
* @ param type must not be { @ literal null } .
* @ return { @ literal true } if { @ code type } is a reactive wrapper type that contains no value . */
public static boolean isNoValue... | LettuceAssert . notNull ( type , "Class must not be null!" ) ; return findDescriptor ( type ) . map ( Descriptor :: isNoValue ) . orElse ( false ) ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.