signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class Mockito { /** * Use < code > doThrow ( ) < / code > when you want to stub the void method with an exception .
* A new exception instance will be created for each method invocation .
* Stubbing voids requires different approach from { @ link Mockito # when ( Object ) } because the compiler
* does not ... | return MOCKITO_CORE . stubber ( ) . doThrow ( toBeThrown ) ; |
public class DefaultKnowledgeHelper { /** * / * Trait helper methods */
public < T , K > T don ( Thing < K > core , Class < T > trait , boolean logical , Mode ... modes ) { } } | return don ( core . getCore ( ) , trait , logical , modes ) ; |
public class ImageLoader { /** * Handler for when an image was successfully loaded .
* @ param cacheKey The cache key that is associated with the image request .
* @ param response The bitmap that was returned from the network . */
protected void onGetImageSuccess ( String cacheKey , Bitmap response ) { } } | // cache the image that was fetched .
imageCache . putBitmap ( cacheKey , response ) ; // remove the request from the list of in - flight requests .
BatchedImageRequest request = inFlightRequests . remove ( cacheKey ) ; if ( request != null ) { // Update the response bitmap .
request . mResponseBitmap = response ; // S... |
public class TimePickerDialog { /** * Get the currently - entered time , as integer values of the hours , minutes and seconds typed .
* @ param enteredZeros A size - 2 boolean array , which the caller should initialize , and which
* may then be used for the caller to know whether zeros had been explicitly entered a... | int amOrPm = - 1 ; int startIndex = 1 ; if ( ! mIs24HourMode && isTypedTimeFullyLegal ( ) ) { int keyCode = mTypedTimes . get ( mTypedTimes . size ( ) - 1 ) ; if ( keyCode == getAmOrPmKeyCode ( AM ) ) { amOrPm = AM ; } else if ( keyCode == getAmOrPmKeyCode ( PM ) ) { amOrPm = PM ; } startIndex = 2 ; } int minute = - 1 ... |
public class MultipartHttpMessageConverter { /** * Add a message body converter . Such a converter is used to convert objects
* to MIME parts . */
public void addPartConverter ( HttpMessageConverter partConverter ) { } } | checkNotNull ( partConverters , "'partConverters' must not be null" ) ; checkArgument ( ! partConverters . isEmpty ( ) , "'partConverters' must not be empty" ) ; this . partConverters . add ( partConverter ) ; |
public class ObjectArrayList { /** * Returns a new list of the part of the receiver between < code > from < / code > , inclusive , and < code > to < / code > , inclusive .
* @ param from the index of the first element ( inclusive ) .
* @ param to the index of the last element ( inclusive ) .
* @ return a new list... | if ( size == 0 ) return new ObjectArrayList ( 0 ) ; checkRangeFromTo ( from , to , size ) ; Object [ ] part = new Object [ to - from + 1 ] ; System . arraycopy ( elements , from , part , 0 , to - from + 1 ) ; return new ObjectArrayList ( part ) ; |
public class JvmOptionsElement { /** * Adds an option to the Jvm options
* @ param value the option to add */
void addOption ( final String value ) { } } | Assert . checkNotNullParam ( "value" , value ) ; synchronized ( options ) { options . add ( value ) ; } |
public class PCMUtil { /** * A helper method to get a PCMContainer from a CSV file ( limited in a sense we only retrieve the 1st element of containers )
* @ param file
* @ return
* @ throws IOException */
public static List < PCMContainer > loadCSV ( File file ) throws IOException { } } | return loadCSV ( file , PCMDirection . PRODUCTS_AS_LINES ) ; |
public class rewritepolicy_stats { /** * Use this API to fetch the statistics of all rewritepolicy _ stats resources that are configured on netscaler . */
public static rewritepolicy_stats [ ] get ( nitro_service service , options option ) throws Exception { } } | rewritepolicy_stats obj = new rewritepolicy_stats ( ) ; rewritepolicy_stats [ ] response = ( rewritepolicy_stats [ ] ) obj . stat_resources ( service , option ) ; return response ; |
public class WDropdownOptionsExample { /** * Apply the settings from the control table to the drop down . */
private void applySettings ( ) { } } | container . reset ( ) ; infoPanel . reset ( ) ; // create the list of options .
List < String > options = new ArrayList < > ( Arrays . asList ( OPTIONS_ARRAY ) ) ; if ( cbNullOption . isSelected ( ) ) { options . add ( 0 , "" ) ; } // create the dropdown .
final WDropdown dropdown = new WDropdown ( options ) ; // set t... |
public class DatabaseUtils { /** * Partition by 1000 elements a list of input and execute a function on each part .
* The goal is to prevent issue with ORACLE when there ' s more than 1000 elements in a ' in ( ' X ' , ' Y ' , . . . ) '
* and with MsSQL when there ' s more than 2000 parameters in a query */
public s... | return executeLargeInputs ( input , function , i -> i ) ; |
public class MCMPHandler { /** * Process the ping request .
* @ param exchange the http server exchange
* @ param requestData the request data
* @ throws IOException */
void processPing ( final HttpServerExchange exchange , final RequestData requestData ) throws IOException { } } | final String jvmRoute = requestData . getFirst ( JVMROUTE ) ; final String scheme = requestData . getFirst ( SCHEME ) ; final String host = requestData . getFirst ( HOST ) ; final String port = requestData . getFirst ( PORT ) ; final String OK = "Type=PING-RSP&State=OK&id=" + creationTime ; final String NOTOK = "Type=P... |
public class TreeNode { /** * Recursively sorts all children using the given comparator of their content . */
public void sortChildrenByContent ( Comparator < ? super T > comparator ) { } } | Comparator < TreeNode < T > > byContent = Comparator . comparing ( TreeNode :: getContent , comparator ) ; sortChildrenByNode ( byContent ) ; |
public class ListDataValueImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ SuppressWarnings ( "unchecked" ) @ Override public EList < DataValue > getValues ( ) { } } | return ( EList < DataValue > ) eGet ( StorePackage . Literals . LIST_DATA_VALUE__VALUES , true ) ; |
public class HTODInvalidationBuffer { /** * Call this method to check the state of " Loop Once " .
* @ return boolean - the state . */
protected synchronized boolean isLoopOnce ( ) { } } | final String methodName = "isLoopOnce()" ; if ( loopOnce ) { traceDebug ( methodName , "cacheName=" + this . cod . cacheName + " isLoopOnce=" + loopOnce + " explicitBuffer=" + explicitBuffer . size ( ) + " scanBuffer=" + this . scanBuffer . size ( ) ) ; } return this . loopOnce ; |
public class JaxbUtils { /** * Xml - > Java Object , 支持大小写敏感或不敏感 . */
@ SuppressWarnings ( "unchecked" ) public < T > T fromXml ( String xml , boolean caseSensitive ) { } } | try { String fromXml = xml ; if ( ! caseSensitive ) fromXml = xml . toLowerCase ( ) ; StringReader reader = new StringReader ( fromXml ) ; return ( T ) createUnmarshaller ( ) . unmarshal ( reader ) ; } catch ( JAXBException e ) { throw new RuntimeException ( e ) ; } |
public class FairSchedulerServlet { /** * Obtained all initialized jobs */
private Collection < JobInProgress > getInitedJobs ( ) { } } | Collection < JobInProgress > runningJobs = jobTracker . getRunningJobs ( ) ; for ( Iterator < JobInProgress > it = runningJobs . iterator ( ) ; it . hasNext ( ) ; ) { JobInProgress job = it . next ( ) ; if ( ! job . inited ( ) ) { it . remove ( ) ; } } return runningJobs ; |
public class QueryParser { /** * src / riemann / Query . g : 61:1 : greater _ equal : field ( WS ) * GREATER _ EQUAL ( WS ) * value ; */
public final QueryParser . greater_equal_return greater_equal ( ) throws RecognitionException { } } | QueryParser . greater_equal_return retval = new QueryParser . greater_equal_return ( ) ; retval . start = input . LT ( 1 ) ; CommonTree root_0 = null ; Token WS61 = null ; Token GREATER_EQUAL62 = null ; Token WS63 = null ; QueryParser . field_return field60 = null ; QueryParser . value_return value64 = null ; CommonTre... |
public class HtmlDocletWriter { /** * Return the link for the given member .
* @ param context the id of the context where the link will be printed .
* @ param typeElement the typeElement that we should link to . This is not
* necessarily equal to element . containingClass ( ) . We may be
* inheriting comments ... | return getDocLink ( context , typeElement , element , label , strong , false ) ; |
public class JobsImpl { /** * Terminates the specified job , marking it as completed .
* When a Terminate Job request is received , the Batch service sets the job to the terminating state . The Batch service then terminates any running tasks associated with the job and runs any required job release tasks . Then the j... | return ServiceFuture . fromHeaderResponse ( terminateWithServiceResponseAsync ( jobId , terminateReason , jobTerminateOptions ) , serviceCallback ) ; |
public class BatchEnableStandardsRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( BatchEnableStandardsRequest batchEnableStandardsRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( batchEnableStandardsRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( batchEnableStandardsRequest . getStandardsSubscriptionRequests ( ) , STANDARDSSUBSCRIPTIONREQUESTS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientE... |
public class AmazonSimpleEmailServiceClient { /** * Creates a new custom verification email template .
* For more information about custom verification email templates , see < a
* href = " http : / / docs . aws . amazon . com / ses / latest / DeveloperGuide / custom - verification - emails . html " > Using Custom
... | request = beforeClientExecution ( request ) ; return executeCreateCustomVerificationEmailTemplate ( request ) ; |
public class CreateAssociationRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( CreateAssociationRequest createAssociationRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( createAssociationRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( createAssociationRequest . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( createAssociationRequest . getDocumentVersion ( ) , DOCUMENTVERSION_BI... |
public class Equ { /** * showRPN .
* @ param sb a { @ link java . lang . StringBuilder } object .
* @ throws java . lang . Exception if any . */
public void showRPN ( final StringBuilder sb ) throws Exception { } } | for ( final EquPart part : rpn ) { sb . append ( part . toString ( ) ) ; sb . append ( "\n" ) ; } |
public class XElement { /** * Save this XML into the given file .
* @ param file the file
* @ throws IOException on error */
public void save ( File file ) throws IOException { } } | try ( FileOutputStream out = new FileOutputStream ( file ) ) { save ( out ) ; } |
public class CommandLine { /** * Add an option requiring an argument .
* @ param option
* the option , must start with " - "
* @ param argumentDesc
* brief ( one or two word ) description of the argument
* @ param description
* single line description of the option */
public void addOption ( String option ,... | optionList . add ( option ) ; optionDescriptionMap . put ( option , description ) ; requiresArgumentSet . add ( option ) ; argumentDescriptionMap . put ( option , argumentDesc ) ; int width = option . length ( ) + 3 + argumentDesc . length ( ) ; if ( width > maxWidth ) { maxWidth = width ; } |
public class Distributer { /** * Set up partitions .
* @ param topologyUpdate if true , it is called from topology update
* @ throws ProcCallException on any VoltDB specific failure .
* @ throws NoConnectionsException if this { @ link Client } instance is not connected to any servers .
* @ throws IOException if... | long interval = System . currentTimeMillis ( ) - m_lastPartitionKeyFetched . get ( ) ; if ( ! m_useClientAffinity && interval < PARTITION_KEYS_INFO_REFRESH_FREQUENCY ) { return ; } try { ProcedureInvocation invocation = new ProcedureInvocation ( m_sysHandle . getAndDecrement ( ) , "@GetPartitionKeys" , "INTEGER" ) ; Co... |
public class Indexer { /** * Returns a new string that is a substring of delegate string
* @ param leftIndex
* @ param rightIndex
* @ return */
public String between ( int leftIndex , int rightIndex ) { } } | String result = this . target4Sub . substring ( reviseL ( leftIndex ) , reviseR ( rightIndex ) ) ; return isResetMode ? result : ( this . target4Sub = result ) ; |
public class HashedArray { /** * Get an element from the array */
synchronized public Element get ( long index ) { } } | int bind = ( ( int ) index & Integer . MAX_VALUE ) % buckets . length ; Element [ ] bucket = buckets [ bind ] ; if ( bucket == null ) return null ; for ( int i = 0 ; i < counts [ bind ] ; i ++ ) if ( bucket [ i ] . getIndex ( ) == index ) return bucket [ i ] ; return null ; |
public class ShapeFittingOps { /** * Convenience function . Same as { @ link # fitEllipse _ F64 ( java . util . List , int , boolean , FitData ) } , but converts the set of integer points
* into floating point points .
* @ param points ( Input ) Set of unordered points . Not modified .
* @ param iterations Number... | List < Point2D_F64 > pointsF = convert_I32_F64 ( points ) ; return fitEllipse_F64 ( pointsF , iterations , computeError , outputStorage ) ; |
public class WTab { /** * Set the mode of operation for this tab . See
* < a href = " https : / / github . com / BorderTech / wcomponents / issues / 692 " > # 692 < / a > .
* @ param mode the tab mode . */
public void setMode ( final TabMode mode ) { } } | getOrCreateComponentModel ( ) . mode = TabMode . SERVER . equals ( mode ) ? TabMode . DYNAMIC : mode ; |
public class QRExampleEquation { /** * Returns the Q matrix . */
public DMatrixRMaj getQ ( ) { } } | Equation eq = new Equation ( ) ; DMatrixRMaj Q = CommonOps_DDRM . identity ( QR . numRows ) ; DMatrixRMaj u = new DMatrixRMaj ( QR . numRows , 1 ) ; int N = Math . min ( QR . numCols , QR . numRows ) ; eq . alias ( u , "u" , Q , "Q" , QR , "QR" , QR . numRows , "r" ) ; // compute Q by first extracting the householder v... |
public class DualPivotQuicksort { /** * Sorts the specified range of the array using the given
* workspace array slice if possible for merging
* @ param a the array to be sorted
* @ param left the index of the first element , inclusive , to be sorted
* @ param right the index of the last element , inclusive , t... | /* * Phase 1 : Move NaNs to the end of the array . */
while ( left <= right && Float . isNaN ( a [ right ] ) ) { -- right ; } for ( int k = right ; -- k >= left ; ) { float ak = a [ k ] ; if ( ak != ak ) { // a [ k ] is NaN
a [ k ] = a [ right ] ; a [ right ] = ak ; -- right ; } } /* * Phase 2 : Sort everything except ... |
public class UpgradeObjectDatanode { /** * Specifies what to do before the upgrade is started .
* The default implementation checks whether the data - node missed the upgrade
* and throws an exception if it did . This leads to the data - node shutdown .
* Data - nodes usually start distributed upgrade when the na... | int nsUpgradeVersion = nsInfo . getDistributedUpgradeVersion ( ) ; if ( nsUpgradeVersion >= getVersion ( ) ) return false ; // name - node will perform the upgrade
// Missed the upgrade . Report problem to the name - node and throw exception
String errorMsg = "\n Data-node missed a distributed upgrade and will shutdo... |
public class FlowConfigResourceLocalHandler { /** * Delete flowConfig locally and trigger all listeners */
public UpdateResponse deleteFlowConfig ( FlowId flowId , Properties header ) throws FlowConfigLoggedException { } } | return deleteFlowConfig ( flowId , header , true ) ; |
public class BuyerRfp { /** * Sets the adExchangeEnvironment value for this BuyerRfp .
* @ param adExchangeEnvironment * Identifies the format of the inventory or " channel " through
* which the ad serves . Environments
* currently supported include { @ link AdExchangeEnvironment # DISPLAY } ,
* { @ link AdExch... | this . adExchangeEnvironment = adExchangeEnvironment ; |
public class Authentication { /** * Logs the user out .
* @ param callback
* A possible callback to be executed when the logout has been done ( successfully or not ) . Can be null . */
public void logout ( final BooleanCallback callback ) { } } | GwtCommand command = new GwtCommand ( logoutCommandName ) ; GwtCommandDispatcher . getInstance ( ) . execute ( command , new AbstractCommandCallback < SuccessCommandResponse > ( ) { public void execute ( SuccessCommandResponse response ) { if ( response . isSuccess ( ) ) { userToken = null ; Authentication . this . use... |
public class MessageFormat { /** * Returns the part index of the next ARG _ START after partIndex , or - 1 if there is none more .
* @ param partIndex Part index of the previous ARG _ START ( initially 0 ) . */
private int nextTopLevelArgStart ( int partIndex ) { } } | if ( partIndex != 0 ) { partIndex = msgPattern . getLimitPartIndex ( partIndex ) ; } for ( ; ; ) { MessagePattern . Part . Type type = msgPattern . getPartType ( ++ partIndex ) ; if ( type == MessagePattern . Part . Type . ARG_START ) { return partIndex ; } if ( type == MessagePattern . Part . Type . MSG_LIMIT ) { retu... |
public class WidgetsUtils { /** * Test if the tag name of the element is one of tag names given in parameter .
* @ param tagNames
* @ return */
public static boolean matchesTags ( Element e , String ... tagNames ) { } } | assert e != null : "Element cannot be null" ; StringBuilder regExp = new StringBuilder ( "^(" ) ; int tagNameLenght = tagNames != null ? tagNames . length : 0 ; for ( int i = 0 ; i < tagNameLenght ; i ++ ) { regExp . append ( tagNames [ i ] . toUpperCase ( ) ) ; if ( i < tagNameLenght - 1 ) { regExp . append ( "|" ) ; ... |
public class Preconditions { /** * A { @ code long } specialized version of { @ link # checkPreconditions ( Object ,
* ContractConditionType [ ] ) }
* @ param value The value
* @ param conditions The conditions the value must obey
* @ return value
* @ throws PreconditionViolationException If any of the condit... | final Violations violations = innerCheckAllLong ( value , conditions ) ; if ( violations != null ) { throw new PreconditionViolationException ( failedMessage ( Long . valueOf ( value ) , violations ) , null , violations . count ( ) ) ; } return value ; |
public class Channel { /** * query for chain information
* @ param peer The peer to send the request to
* @ param userContext the user context to use .
* @ return a { @ link BlockchainInfo } object containing the chain info requested
* @ throws InvalidArgumentException
* @ throws ProposalException */
public B... | return queryBlockchainInfo ( Collections . singleton ( peer ) , userContext ) ; |
public class SeekBarPreference { /** * Sets the step size , the value should be increased or decreased by , when moving the seek bar .
* @ param stepSize
* The step size , which should be set , as an { @ link Integer } value . The value must be at
* least 1 and at maximum the value of the method < code > getRange... | if ( stepSize != - 1 ) { Condition . INSTANCE . ensureAtLeast ( stepSize , 1 , "The step size must be at least 1" ) ; Condition . INSTANCE . ensureAtMaximum ( stepSize , getRange ( ) , "The step size must be at maximum the range" ) ; } this . stepSize = stepSize ; setValue ( adaptToStepSize ( getValue ( ) ) ) ; |
public class TLSEnabledSocketHandler { /** * / * ( non - Javadoc )
* @ see org . openhealthtools . ihe . atna . nodeauth . handlers . AbstractSecureSocketHandler # createSecureSocket ( java . lang . String , int , org . openhealthtools . ihe . atna . nodeauth . SecurityDomain ) */
protected SSLSocket createSecureSock... | if ( ! CONTEXT . isTLSEnabled ( ) ) throw new NoSuchAlgorithmException ( "TLS has been disabled for ATNA connections via " + SecurityDomainManager . class . getName ( ) + ".setSetTLSEnabled(false)" ) ; SSLContext ctx = null ; // Attempt to get an instance of the first support TLS protocol
try { ctx = SSLContext . getIn... |
public class IssueManager { /** * DEPRECATED . use relation . delete ( ) */
@ Deprecated public void deleteRelation ( Integer id ) throws RedmineException { } } | new IssueRelation ( transport ) . setId ( id ) . delete ( ) ; |
public class DescribeImagesFilterMarshaller { /** * Marshall the given parameter object . */
public void marshall ( DescribeImagesFilter describeImagesFilter , ProtocolMarshaller protocolMarshaller ) { } } | if ( describeImagesFilter == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( describeImagesFilter . getTagStatus ( ) , TAGSTATUS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e ... |
public class AsyncCompletionHandlerBase { /** * { @ inheritDoc } */
public STATE onHeadersReceived ( final HttpResponseHeaders headers ) throws Exception { } } | builder . accumulate ( headers ) ; return STATE . CONTINUE ; |
public class RulesPlugin { /** * Find an empty field , ie one that is unknown and not ' not known '
* If we don ' t find one then return null .
* @ param fieldMetadata
* @ return qualifying field */
public FieldMetadata getEmptyField ( FieldMetadata fieldMetadata ) { } } | ValidationSession session = fieldMetadata . getValidationSession ( ) ; RuleSessionImpl ruleSession = getRuleSession ( session ) ; ProxyField proxyField = session . getProxyField ( fieldMetadata ) ; RuleProxyField ruleProxyField = ruleSession . getRuleProxyField ( proxyField ) ; while ( true ) { RuleProxyField rpf = rul... |
public class CmsErrorDialog { /** * Checks the available space and sets max - height to the details field - set . */
private void onShow ( ) { } } | if ( m_detailsFieldset != null ) { m_detailsFieldset . getContentPanel ( ) . getElement ( ) . getStyle ( ) . setPropertyPx ( "maxHeight" , getAvailableHeight ( m_messageWidget . getOffsetHeight ( ) ) ) ; } |
public class MtasSolrCQLQParserPlugin { /** * ( non - Javadoc )
* @ see org . apache . solr . search . QParserPlugin # createParser ( java . lang . String ,
* org . apache . solr . common . params . SolrParams ,
* org . apache . solr . common . params . SolrParams ,
* org . apache . solr . request . SolrQueryRe... | return new MtasCQLQParser ( qstr , localParams , params , req ) ; |
public class JobSchedulesImpl { /** * Lists all of the job schedules in the specified account .
* @ param jobScheduleListOptions Additional parameters for the operation
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ throws BatchErrorException thrown if the request is rejected by ... | ServiceResponseWithHeaders < Page < CloudJobSchedule > , JobScheduleListHeaders > response = listSinglePageAsync ( jobScheduleListOptions ) . toBlocking ( ) . single ( ) ; return new PagedList < CloudJobSchedule > ( response . body ( ) ) { @ Override public Page < CloudJobSchedule > nextPage ( String nextPageLink ) { J... |
public class SuggestedFixes { /** * Create a fix to add a suppression annotation on the surrounding class .
* < p > No suggested fix is produced if the suppression annotation cannot be used on classes , i . e .
* the annotation has a { @ code @ Target } but does not include { @ code @ Target ( TYPE ) } .
* < p > ... | // TODO ( bangert ) : Support annotations that do not have @ Target ( CLASS ) .
if ( whitelistAnnotation . equals ( "com.google.errorprone.annotations.DontSuggestFixes" ) ) { return Optional . empty ( ) ; } SuggestedFix . Builder builder = SuggestedFix . builder ( ) ; Type whitelistAnnotationType = state . getTypeFromS... |
public class CollectionBindings { /** * Returns an object binding whose value is the reduction of all elements in the list .
* @ param items the observable list of elements .
* @ param defaultValue the value to be returned if there is no value present , may be null .
* @ param reducer an associative , non - inter... | return Bindings . createObjectBinding ( ( ) -> items . stream ( ) . reduce ( reducer . getValue ( ) ) . orElse ( defaultValue ) , items , reducer ) ; |
public class CmsChangePasswordDialog { /** * Validates the passwords , checking if they match and fulfill the requirements of the password handler . < p >
* Will show the appropriate errors if necessary . < p >
* @ param password1 password 1
* @ param password2 password 2
* @ return < code > true < / code > if ... | if ( ! password1 . equals ( password2 ) ) { showPasswordMatchError ( true ) ; return false ; } showPasswordMatchError ( false ) ; try { OpenCms . getPasswordHandler ( ) . validatePassword ( password1 ) ; m_form . getPassword1Field ( ) . setComponentError ( null ) ; return true ; } catch ( CmsException e ) { m_form . se... |
public class LineBasedFrameDecoder { /** * Create a frame out of the { @ link ByteBuf } and return it .
* @ param ctx the { @ link ChannelHandlerContext } which this { @ link ByteToMessageDecoder } belongs to
* @ param buffer the { @ link ByteBuf } from which to read data
* @ return frame the { @ link ByteBuf } w... | final int eol = findEndOfLine ( buffer ) ; if ( ! discarding ) { if ( eol >= 0 ) { final ByteBuf frame ; final int length = eol - buffer . readerIndex ( ) ; final int delimLength = buffer . getByte ( eol ) == '\r' ? 2 : 1 ; if ( length > maxLength ) { buffer . readerIndex ( eol + delimLength ) ; fail ( ctx , length ) ;... |
public class TemplateFilter { /** * { @ inheritDoc } */
@ Override public TemplateFilter and ( TemplateFilter otherFilter ) { } } | checkNotNull ( otherFilter , "Other filter must be not a null" ) ; if ( evaluation instanceof SingleFilterEvaluation && otherFilter . evaluation instanceof SingleFilterEvaluation ) { return new TemplateFilter ( getDataCenter ( ) . and ( otherFilter . getDataCenter ( ) ) , getPredicate ( ) . and ( otherFilter . getPredi... |
public class ZoneRulesProvider { /** * Gets the history of rules for the zone ID .
* Time - zones are defined by governments and change frequently .
* This method allows applications to find the history of changes to the
* rules for a single zone ID . The map is keyed by a string , which is the
* version string... | Jdk8Methods . requireNonNull ( zoneId , "zoneId" ) ; return getProvider ( zoneId ) . provideVersions ( zoneId ) ; |
public class druidGParser { /** * druidG . g : 299:1 : whereClause [ QueryMeta qMeta ] : intls = intervalClause ( WS AND WS f = grandFilter ) ? ; */
public final void whereClause ( QueryMeta qMeta ) throws RecognitionException { } } | List < Interval > intls = null ; Filter f = null ; try { // druidG . g : 300:2 : ( intls = intervalClause ( WS AND WS f = grandFilter ) ? )
// druidG . g : 300:3 : intls = intervalClause ( WS AND WS f = grandFilter ) ?
{ pushFollow ( FOLLOW_intervalClause_in_whereClause2008 ) ; intls = intervalClause ( ) ; state . _fsp... |
public class SplitMergeLineFit { /** * Approximates the input list with a set of line segments
* @ param list ( Input ) Ordered list of connected points .
* @ param vertexes ( Output ) Indexes in the input list which are corners in the polyline
* @ return true if it could fit a polygon to the points or false if n... | this . contour = list ; this . minimumSideLengthPixel = minimumSideLength . computeI ( contour . size ( ) ) ; splits . reset ( ) ; boolean result = _process ( list ) ; // remove reference so that it can be freed
this . contour = null ; vertexes . setTo ( splits ) ; return result ; |
public class AttachmentInformationMarshaller { /** * Marshall the given parameter object . */
public void marshall ( AttachmentInformation attachmentInformation , ProtocolMarshaller protocolMarshaller ) { } } | if ( attachmentInformation == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( attachmentInformation . getName ( ) , NAME_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMes... |
public class SURT { /** * Given a plain URI or hostname / hostname + path , give its SURT form .
* Results may be unpredictable on strings that cannot
* be interpreted as URIs .
* UURI ' fixup ' is applied to the URI before conversion to SURT
* form .
* @ param u URI or almost - URI to consider
* @ return i... | u = ArchiveUtils . addImpliedHttpIfNecessary ( u ) ; boolean trailingSlash = u . endsWith ( "/" ) ; // ensure all typical UURI cleanup ( incl . IDN - punycoding ) is done
try { u = UsableURIFactory . getInstance ( u ) . toString ( ) ; } catch ( URIException e ) { e . printStackTrace ( ) ; // allow to continue with orig... |
public class Expression { /** * Return results that match both < code > Dimension < / code > objects .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setAnd ( java . util . Collection ) } or { @ link # withAnd ( java . util . Collection ) } if you want to ov... | if ( this . and == null ) { setAnd ( new java . util . ArrayList < Expression > ( and . length ) ) ; } for ( Expression ele : and ) { this . and . add ( ele ) ; } return this ; |
public class CmsContainerpageUtil { /** * Creates a list item . < p >
* @ param containerElement the element data
* @ return the list item widget */
public CmsMenuListItem createListItem ( final CmsContainerElementData containerElement ) { } } | CmsMenuListItem listItem = new CmsMenuListItem ( containerElement ) ; if ( ! containerElement . isGroupContainer ( ) && ! containerElement . isInheritContainer ( ) && CmsStringUtil . isEmptyOrWhitespaceOnly ( containerElement . getNoEditReason ( ) ) ) { listItem . enableEdit ( new ClickHandler ( ) { public void onClick... |
public class InitialCycles { /** * Compute the initial cycles . The code corresponds to algorithm 1 from
* { @ cdk . cite Vismara97 } , where possible the variable names have been kept
* the same . */
private void compute ( ) { } } | int n = graph . length ; // the set ' S ' contains the pairs of vertices adjacent to ' y '
int [ ] s = new int [ n ] ; int sizeOfS ; // order the vertices by degree
int [ ] vertices = new int [ n ] ; for ( int v = 0 ; v < n ; v ++ ) { vertices [ ordering [ v ] ] = v ; } // if the graph is known to be a biconnected comp... |
public class FleetsApi { /** * Create fleet invitation Invite a character into the fleet . If a character
* has a CSPA charge set it is not possible to invite them to the fleet
* using ESI - - - SSO Scope : esi - fleets . write _ fleet . v1
* @ param fleetId
* ID for a fleet ( required )
* @ param datasource ... | postFleetsFleetIdMembersWithHttpInfo ( fleetId , datasource , token , fleetInvitation ) ; |
public class CmsUserEditDialog { /** * Sets the password fields . < p > */
private void setPasswordFields ( ) { } } | m_dummyPasswordLabel . setContentMode ( com . vaadin . v7 . shared . ui . label . ContentMode . HTML ) ; // ugly hack to prevent Firefox from asking user to save password on every click which causes the history token to change after editing a user
String pwd = "<input type=\"password\" value=\"password\">" ; m_dummyPas... |
public class ExpressionSpecBuilder { /** * Returns an < code > IfNotExists < / code > object which represents an < a href =
* " http : / / docs . aws . amazon . com / amazondynamodb / latest / developerguide / Expressions . Modifying . html "
* > if _ not _ exists ( path , operand ) < / a > function call ; used for... | return if_not_exists ( new PathOperand ( path ) , new LiteralOperand ( defaultValue ) ) ; |
public class RetireJSDataSource { /** * Determines if the we should update the RetireJS database .
* @ param repo the retire JS repository .
* @ return < code > true < / code > if an updated to the RetireJS database should
* be performed ; otherwise < code > false < / code >
* @ throws NumberFormatException thr... | boolean proceed = true ; if ( repo != null && repo . isFile ( ) ) { final int validForHours = settings . getInt ( Settings . KEYS . ANALYZER_RETIREJS_REPO_VALID_FOR_HOURS , 0 ) ; final long lastUpdatedOn = repo . lastModified ( ) ; final long now = System . currentTimeMillis ( ) ; LOGGER . debug ( "Last updated: {}" , ... |
public class ValueTaglet { /** * Given the name of the field , return the corresponding FieldDoc . Return null
* due to invalid use of value tag if the name is null or empty string and if
* the value tag is not used on a field .
* @ param config the current configuration of the doclet .
* @ param tag the value ... | if ( name == null || name . length ( ) == 0 ) { // Base case : no label .
if ( tag . holder ( ) instanceof FieldDoc ) { return ( FieldDoc ) tag . holder ( ) ; } else { // If the value tag does not specify a parameter which is a valid field and
// it is not used within the comments of a valid field , return null .
retur... |
public class SetAclPRequest { /** * < pre >
* * the path of the file or directory
* < / pre >
* < code > optional string path = 1 ; < / code > */
public java . lang . String getPath ( ) { } } | java . lang . Object ref = path_ ; if ( ref instanceof java . lang . String ) { return ( java . lang . String ) ref ; } else { com . google . protobuf . ByteString bs = ( com . google . protobuf . ByteString ) ref ; java . lang . String s = bs . toStringUtf8 ( ) ; if ( bs . isValidUtf8 ( ) ) { path_ = s ; } return s ; ... |
public class SQLDroidPreparedStatement { /** * This is a pass through to the integer version of the same method . That is , the long is downcast to an
* integer . If the length is greater than Integer . MAX _ VALUE this method will throw a SQLException .
* @ see # setBinaryStream ( int , InputStream , int )
* @ e... | if ( length > Integer . MAX_VALUE ) { throw new SQLException ( "SQLDroid does not allow input stream data greater than " + Integer . MAX_VALUE ) ; } setBinaryStream ( parameterIndex , inputStream , ( int ) length ) ; |
public class WhileContextDef { /** * < pre >
* Name of the pivot _ for _ body tensor .
* < / pre >
* < code > optional string pivot _ for _ body _ name = 7 ; < / code > */
public com . google . protobuf . ByteString getPivotForBodyNameBytes ( ) { } } | java . lang . Object ref = pivotForBodyName_ ; if ( ref instanceof java . lang . String ) { com . google . protobuf . ByteString b = com . google . protobuf . ByteString . copyFromUtf8 ( ( java . lang . String ) ref ) ; pivotForBodyName_ = b ; return b ; } else { return ( com . google . protobuf . ByteString ) ref ; } |
public class CircularProgressTileSkin { /** * * * * * * Initialization * * * * * */
@ Override protected void initGraphics ( ) { } } | super . initGraphics ( ) ; if ( tile . isAutoScale ( ) ) tile . calcAutoScale ( ) ; minValue = tile . getMinValue ( ) ; range = tile . getRange ( ) ; angleStep = ANGLE_RANGE / range ; sectionsVisible = tile . getSectionsVisible ( ) ; sections = tile . getSections ( ) ; formatString = new StringBuilder ( "%." ) . append... |
public class TautomerizationMechanism { /** * Initiates the process for the given mechanism . The atoms and bonds to apply are mapped between
* reactants and products .
* @ param atomContainerSet
* @ param atomList The list of atoms taking part in the mechanism . Only allowed fourth atoms .
* @ param bondList T... | CDKAtomTypeMatcher atMatcher = CDKAtomTypeMatcher . getInstance ( atomContainerSet . getBuilder ( ) ) ; if ( atomContainerSet . getAtomContainerCount ( ) != 1 ) { throw new CDKException ( "TautomerizationMechanism only expects one IAtomContainer" ) ; } if ( atomList . size ( ) != 4 ) { throw new CDKException ( "Tautome... |
public class LightWeightBitSet { /** * Gets the bit for the given position .
* @ param bits
* - bitset
* @ param pos
* - position to retrieve . */
public static boolean get ( long [ ] bits , int pos ) { } } | int offset = pos >> LONG_SHIFT ; if ( offset >= bits . length ) return false ; return ( bits [ offset ] & ( 1L << pos ) ) != 0 ; |
public class ValidationDataRepository { /** * Save all list .
* @ param pDatas the p datas
* @ return the list */
public List < ValidationData > saveAll ( List < ValidationData > pDatas ) { } } | pDatas . forEach ( this :: save ) ; return pDatas ; |
public class StateMachine { /** * Set current state of the state machine . This method is multi - thread safe .
* @ param state the current state to be , must have already been defined . */
public void setState ( S state ) { } } | Integer id = definition . getStateId ( state ) ; currentStateId . set ( id ) ; |
public class ConnectionHandle { /** * Returns unique connection information as a byte array .
* @ param writeBuffer
* ByteBuffer to write ConnectionHandle bytes into . */
public void putBytes ( ByteBuffer writeBuffer ) { } } | if ( writeBuffer . remaining ( ) < CONNECTION_ID_LENGTH ) { throw new IllegalArgumentException ( "Could not add ConnectionHandle to byte buffer: not enough space." ) ; } writeBuffer . putLong ( this . connID ) ; writeBuffer . putInt ( this . seqNum ) ; writeBuffer . put ( this . connHandleCreatorId ) ; writeBuffer . pu... |
public class Equation { /** * Adds a new operation to the list from the operation and two variables . The inputs are removed
* from the token list and replaced by their output . */
protected TokenList . Token insertTranspose ( TokenList . Token variable , TokenList tokens , Sequence sequence ) { } } | Operation . Info info = functions . create ( '\'' , variable . getVariable ( ) ) ; sequence . addOperation ( info . op ) ; // replace the symbols with their output
TokenList . Token t = new TokenList . Token ( info . output ) ; // remove the transpose symbol
tokens . remove ( variable . next ) ; // replace the variable... |
public class TransposeAlgs_DDRM { /** * A straight forward transpose . Good for small non - square matrices .
* @ param A Original matrix . Not modified .
* @ param A _ tran Transposed matrix . Modified . */
public static void standard ( DMatrix1Row A , DMatrix1Row A_tran ) { } } | int index = 0 ; for ( int i = 0 ; i < A_tran . numRows ; i ++ ) { int index2 = i ; int end = index + A_tran . numCols ; while ( index < end ) { A_tran . data [ index ++ ] = A . data [ index2 ] ; index2 += A . numCols ; } } |
public class UTF16 { /** * Removes the codepoint at the specified position in this target ( shortening target by 1
* character if the codepoint is a non - supplementary , 2 otherwise ) .
* @ param target String buffer to remove codepoint from
* @ param limit End index of the char array , limit & lt ; = target . l... | int count = 1 ; switch ( bounds ( target , 0 , limit , offset16 ) ) { case LEAD_SURROGATE_BOUNDARY : count ++ ; break ; case TRAIL_SURROGATE_BOUNDARY : count ++ ; offset16 -- ; break ; } System . arraycopy ( target , offset16 + count , target , offset16 , limit - ( offset16 + count ) ) ; target [ limit - count ] = 0 ; ... |
public class AbstractVdmBuilder { /** * public abstract String getNatureId ( ) ; */
protected void addWarningMarker ( File file , String message , ILexLocation location , String sourceId ) { } } | FileUtility . addMarker ( project . findIFile ( file ) , message , location , IMarker . SEVERITY_WARNING , sourceId , - 1 ) ; |
public class Visualizer { /** * Draws the PE Header to the structure image */
private void drawPEHeaders ( ) { } } | long msdosOffset = 0 ; long msdosSize = withMinLength ( data . getMSDOSHeader ( ) . getHeaderSize ( ) ) ; drawPixels ( colorMap . get ( MSDOS_HEADER ) , msdosOffset , msdosSize ) ; long optOffset = data . getOptionalHeader ( ) . getOffset ( ) ; long optSize = withMinLength ( data . getOptionalHeader ( ) . getSize ( ) )... |
public class LBoolToSrtFunctionBuilder { /** * One of ways of creating builder . This is possibly the least verbose way where compiler should be able to guess the generic parameters . */
@ Nonnull public static LBoolToSrtFunction boolToSrtFunctionFrom ( Consumer < LBoolToSrtFunctionBuilder > buildingFunction ) { } } | LBoolToSrtFunctionBuilder builder = new LBoolToSrtFunctionBuilder ( ) ; buildingFunction . accept ( builder ) ; return builder . build ( ) ; |
public class FieldIterator { /** * Go through the fields in this class and add them to the field list .
* @ param strClassName The record class to read through . */
protected void scanRecordFields ( String [ ] strClassNames , int iClassIndex , boolean bMarkUnused ) { } } | ClassInfo recClassInfo = new ClassInfo ( Record . findRecordOwner ( m_recClassInfo ) ) ; FieldData recFieldData = new FieldData ( Record . findRecordOwner ( m_recFieldData ) ) ; String strClassName = strClassNames [ iClassIndex ] ; try { // First , re - read the original class .
recClassInfo . getField ( ClassInfo . CL... |
public class GenericBeanFactoryAccessor { /** * Find a { @ link Annotation } of < code > annotationType < / code > on the specified
* bean , traversing its interfaces and super classes if no annotation can be
* found on the given class itself , as well as checking its raw bean class
* if not found on the exposed ... | Class < ? > handlerType = beanFactory . getType ( beanName ) ; A ann = AnnotationUtils . findAnnotation ( handlerType , annotationType ) ; if ( ann == null && beanFactory instanceof ConfigurableBeanFactory && beanFactory . containsBeanDefinition ( beanName ) ) { ConfigurableBeanFactory cbf = ( ConfigurableBeanFactory )... |
public class Quaternion { /** * Sets this quaternion to one that first rotates about x by the specified number of radians ,
* then rotates about y , then about z . */
public Quaternion fromAngles ( float x , float y , float z ) { } } | // TODO : it may be more convenient to define the angles in the opposite order ( first z ,
// then y , then x )
float hx = x * 0.5f , hy = y * 0.5f , hz = z * 0.5f ; float sz = FloatMath . sin ( hz ) , cz = FloatMath . cos ( hz ) ; float sy = FloatMath . sin ( hy ) , cy = FloatMath . cos ( hy ) ; float sx = FloatMath .... |
public class MapCacheProvider { /** * / * ( non - Javadoc )
* @ see java . util . Map # put ( java . lang . Object , java . lang . Object ) */
@ Override public V put ( K key , V value ) { } } | final V old = this . get ( key ) ; this . cache . put ( new Element ( key , value ) ) ; return old ; |
public class HttpHeaderMap { /** * Add more than one value associated with the given key . */
public void add ( Object key , Object value ) { } } | Object existing = mMap . get ( key ) ; if ( existing instanceof List ) { if ( value instanceof List ) { ( ( List ) existing ) . addAll ( ( List ) value ) ; } else { ( ( List ) existing ) . add ( value ) ; } } else if ( existing == null && ! mMap . containsKey ( key ) ) { if ( value instanceof List ) { mMap . put ( key ... |
public class BlobStoreUtils { /** * Normalize state */
public static BlobKeySequenceInfo normalizeNimbusHostPortSequenceNumberInfo ( String nimbusSeqNumberInfo ) { } } | BlobKeySequenceInfo keySequenceInfo = new BlobKeySequenceInfo ( ) ; int lastIndex = nimbusSeqNumberInfo . lastIndexOf ( "-" ) ; keySequenceInfo . setNimbusHostPort ( nimbusSeqNumberInfo . substring ( 0 , lastIndex ) ) ; keySequenceInfo . setSequenceNumber ( nimbusSeqNumberInfo . substring ( lastIndex + 1 ) ) ; return k... |
public class LayerDrawable { /** * Sets the gravity used to position or stretch the specified layer within its container .
* Gravity is applied after any layer insets ( see { @ link # setLayerInset ( int , int , int , int ,
* int ) } ) or padding ( see { @ link # setPaddingMode ( int ) } ) .
* If gravity is speci... | final ChildDrawable childDrawable = mLayerState . mChildren [ index ] ; childDrawable . mGravity = gravity ; |
public class OracleDdlParser { /** * Utility method to additionally check if MODIFY definition without datatype
* @ param tokens a { @ link DdlTokenStream } instance ; may not be null
* @ param columnMixinType a { @ link String } ; may not be null
* @ return { @ code true } if the given stream si at the start of ... | boolean result = isColumnDefinitionStart ( tokens ) ; if ( ! result && TYPE_ALTER_COLUMN_DEFINITION . equals ( columnMixinType ) ) { for ( String start : INLINE_COLUMN_PROPERTY_START ) { if ( tokens . matches ( TokenStream . ANY_VALUE , start ) ) return true ; } } return result ; |
public class PreprocessorContext { /** * Get a local variable value
* @ param name the name for the variable , it can be null . The name will be normalized to allowed one .
* @ return null either if the name is null or the variable is not found , otherwise its value */
@ Nullable public Value getLocalVariable ( @ N... | if ( name == null ) { return null ; } final String normalized = assertNotNull ( PreprocessorUtils . normalizeVariableName ( name ) ) ; if ( normalized . isEmpty ( ) ) { return null ; } return localVarTable . get ( normalized ) ; |
public class AbstractHtmlTableCell { /** * Sets the onKeyPress javascript event for the HTML table cell .
* @ param onKeyPress the onKeyPress event .
* @ jsptagref . attributedescription The onKeyPress JavaScript event for the HTML table cell .
* @ jsptagref . attributesyntaxvalue < i > string _ cellOnKeyPress < ... | _cellState . registerAttribute ( AbstractHtmlState . ATTR_JAVASCRIPT , HtmlConstants . ONKEYPRESS , onKeyPress ) ; |
public class IPv6AddressPool { /** * Allocate the first available subnet from the pool .
* @ return resulting pool */
public IPv6AddressPool allocate ( ) { } } | if ( ! isExhausted ( ) ) { // get the first range of free subnets , and take the first subnet of that range
final IPv6AddressRange firstFreeRange = freeRanges . first ( ) ; final IPv6Network allocated = IPv6Network . fromAddressAndMask ( firstFreeRange . getFirst ( ) , allocationSubnetSize ) ; return doAllocate ( alloc... |
public class SecurityContext { /** * Executes the given task with root - permissions . Use with care .
* @ throws ExecutionException if an exception occurs during the execution of the task */
public static < ReturnType > ReturnType executeWithSystemPermissions ( Callable < ReturnType > task ) throws ExecutionExceptio... | ContextAwareCallable < ReturnType > contextAwareCallable = new ContextAwareCallable < ReturnType > ( task ) ; Subject newsubject = new Subject . Builder ( ) . buildSubject ( ) ; newsubject . login ( new RootAuthenticationToken ( ) ) ; try { return newsubject . execute ( contextAwareCallable ) ; } finally { newsubject .... |
public class YarnJobSubmissionClient { /** * Log all the tokens in the container for thr user .
* @ param logLevel - the log level .
* @ param msgPrefix - msg prefix for log .
* @ param user - the UserGroupInformation object . */
private static void logToken ( final Level logLevel , final String msgPrefix , final... | if ( LOG . isLoggable ( logLevel ) ) { LOG . log ( logLevel , "{0} number of tokens: [{1}]." , new Object [ ] { msgPrefix , user . getCredentials ( ) . numberOfTokens ( ) } ) ; for ( final org . apache . hadoop . security . token . Token t : user . getCredentials ( ) . getAllTokens ( ) ) { LOG . log ( logLevel , "Token... |
public class CertificateOperations { /** * Adds a certificate to the Batch account .
* @ param certificate The certificate to be added .
* @ param additionalBehaviors A collection of { @ link BatchClientBehavior } instances that are applied to the Batch service request .
* @ throws BatchErrorException Exception t... | CertificateAddOptions options = new CertificateAddOptions ( ) ; BehaviorManager bhMgr = new BehaviorManager ( this . customBehaviors ( ) , additionalBehaviors ) ; bhMgr . applyRequestBehaviors ( options ) ; this . parentBatchClient . protocolLayer ( ) . certificates ( ) . add ( certificate , options ) ; |
public class SipUserHostInfo { /** * Frames a SIP URI user / host info portion , specified in RFC 3261 as :
* < pre >
* SIP - URI = " sip : " [ userinfo ] hostport
* uri - parameters [ headers ]
* SIPS - URI = " sips : " [ userinfo ] hostport
* uri - parameters [ headers ]
* userinfo = ( user / telephone - ... | final Parser parser = new Parser ( buffer ) ; return parser . parse ( ) ; |
public class BridgeActivity { /** * Request for write system setting . */
static void requestWriteSetting ( Source source ) { } } | Intent intent = new Intent ( source . getContext ( ) , BridgeActivity . class ) ; intent . putExtra ( KEY_TYPE , BridgeRequest . TYPE_WRITE_SETTING ) ; source . startActivity ( intent ) ; |
public class MPP8Reader { /** * This method extracts view data from the MPP file .
* @ throws IOException */
private void processViewData ( ) throws IOException { } } | DirectoryEntry dir = ( DirectoryEntry ) m_viewDir . getEntry ( "CV_iew" ) ; FixFix ff = new FixFix ( 138 , new DocumentInputStream ( ( ( DocumentEntry ) dir . getEntry ( "FixFix 0" ) ) ) ) ; int items = ff . getItemCount ( ) ; byte [ ] data ; View view ; for ( int loop = 0 ; loop < items ; loop ++ ) { data = ff . get... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.