signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class Color { /** * Converts the number to a two - digit hex string ,
* e . g . 0 becomes " 00 " and 255 becomes " FF " .
* @ param number int between 0 and 255
* @ return String */
private static final String toBrowserHexValue ( final int number ) { } } | final String chex = Integer . toHexString ( fixRGB ( number ) & 0xFF ) . toUpperCase ( ) ; if ( chex . length ( ) < 2 ) { return "0" + chex ; } return chex ; |
public class BackendManager { /** * Final private error log for use in the constructor above */
private void intError ( String message , Throwable t ) { } } | logHandler . error ( message , t ) ; debugStore . log ( message , t ) ; |
public class JSONObject { /** * Put a key / boolean pair in the JSONObject .
* @ param key
* A key string .
* @ param value
* A boolean which is the value .
* @ return this .
* @ throws JSONException
* If the key is null . */
public JSONObject put ( Enum < ? > key , boolean value ) throws JSONException { ... | return put ( key . name ( ) , value ) ; |
public class AbstractGISTreeSet { /** * Replies the set of nodes that have an intersection with the specified rectangle .
* < p > This function replies the nodes with a broad - first iteration on the elements ' tree .
* @ param clipBounds is the bounds outside which the nodes will not be replied
* @ return the no... | return new BroadFirstTreeIterator < > ( this . tree , new FrustumSelector < P , N > ( clipBounds ) ) ; |
public class JavaScriptEscape { /** * Perform a ( configurable ) JavaScript < strong > escape < / strong > operation on a < tt > String < / tt > input ,
* writing results to a < tt > Writer < / tt > .
* This method will perform an escape operation according to the specified
* { @ link org . unbescape . javascript... | if ( writer == null ) { throw new IllegalArgumentException ( "Argument 'writer' cannot be null" ) ; } if ( type == null ) { throw new IllegalArgumentException ( "The 'type' argument cannot be null" ) ; } if ( level == null ) { throw new IllegalArgumentException ( "The 'level' argument cannot be null" ) ; } JavaScriptEs... |
public class ProcessStateListenerService { /** * This will < strong > NEVER < / strong > be called on a HostController .
* @ param newState the new running state . */
private void suspendTransition ( Process . RunningState oldState , Process . RunningState newState ) { } } | synchronized ( stopLock ) { if ( oldState == newState ) { return ; } this . runningState = newState ; final RunningStateChangeEvent event = new RunningStateChangeEvent ( oldState , newState ) ; Future < ? > suspendStateTransition = executorServiceSupplier . get ( ) . submit ( ( ) -> { CoreManagementLogger . ROOT_LOGGER... |
public class ArrayComprehension { /** * Adds a child loop node , and sets its parent to this node .
* @ throws IllegalArgumentException if acl is { @ code null } */
public void addLoop ( ArrayComprehensionLoop acl ) { } } | assertNotNull ( acl ) ; loops . add ( acl ) ; acl . setParent ( this ) ; |
public class DatabaseDAODefaultImpl { public String [ ] getPossibleTangoHosts ( Database database ) { } } | String [ ] tangoHosts = null ; try { DeviceData deviceData = database . command_inout ( "DbGetCSDbServerList" ) ; tangoHosts = deviceData . extractStringArray ( ) ; } catch ( DevFailed e ) { String desc = e . errors [ 0 ] . desc . toLowerCase ( ) ; try { if ( desc . startsWith ( "command " ) && desc . endsWith ( "not f... |
public class RecursiveObjectReader { /** * Get values of all properties in specified object and its subobjects and
* returns them as a map .
* The object can be a user defined object , map or array . Returned properties
* correspondently are object properties , map key - pairs or array elements with
* their ind... | Map < String , Object > properties = new HashMap < String , Object > ( ) ; if ( obj == null ) { return properties ; } else { List < Object > cycleDetect = new ArrayList < Object > ( ) ; performGetProperties ( obj , null , properties , cycleDetect ) ; return properties ; } |
public class SqlBuilder { /** * param .
* @ param name a { @ link java . lang . String } object .
* @ param value a { @ link java . lang . Object } object .
* @ return a { @ link org . beangle . commons . dao . query . builder . SqlBuilder } object . */
public SqlBuilder param ( String name , Object value ) { } } | params . put ( name , value ) ; return this ; |
public class CachedInstanceQuery { /** * Get a CachedInstanceQuery that will only cache during a request .
* @ param _ typeUUID uuid of the Type the query is based on
* @ return the 4 request
* @ throws EFapsException on error */
public static CachedInstanceQuery get4Request ( final UUID _typeUUID ) throws EFapsE... | return new CachedInstanceQuery ( Context . getThreadContext ( ) . getRequestId ( ) , _typeUUID ) . setLifespan ( 5 ) . setLifespanUnit ( TimeUnit . MINUTES ) ; |
public class ZKPaths { /** * Make sure all the nodes in the path are created . NOTE : Unlike File . mkdirs ( ) , Zookeeper doesn ' t distinguish
* between directories and files . So , every node in the path is created . The data for each node is an empty blob
* @ param zookeeper the client
* @ param path path to ... | mkdirs ( zookeeper , path , true , null , false ) ; |
public class AbstractGenericController { /** * ( non - Javadoc ) .
* @ param key
* the key
* @ return the controller */
@ Override public Controller < M , V > removeChild ( final String key ) { } } | return children . remove ( key ) ; |
public class KeyVaultClientCustomImpl { /** * The update key operation changes specified attributes of a stored key and can
* be applied to any key type and key version stored in Azure Key Vault . The
* cryptographic material of a key itself cannot be changed . In order to perform
* this operation , the key must ... | return updateKey ( updateKeyRequest . vaultBaseUrl ( ) , updateKeyRequest . keyName ( ) , updateKeyRequest . keyVersion ( ) , updateKeyRequest . keyOperations ( ) , updateKeyRequest . keyAttributes ( ) , updateKeyRequest . tags ( ) ) ; |
public class JsResources { /** * async load of resources .
* @ param function function to call on load */
public static void whenReady ( final String scriptname , final EventListener function ) { } } | List < EventListener > eventList = JsResources . eventLisenerQueue . get ( scriptname ) ; if ( eventList == null ) { eventList = new ArrayList < > ( ) ; JsResources . eventLisenerQueue . put ( scriptname , eventList ) ; } eventList . add ( function ) ; if ( BooleanUtils . isTrue ( JsResources . initializationStarted . ... |
public class SecurityManagerImpl { /** * translate a string access value ( all , local , none , no , yes ) to int type
* @ param accessValue
* @ return return int access value ( VALUE _ ALL , VALUE _ LOCAL , VALUE _ NO , VALUE _ NONE , VALUE _ YES )
* @ throws SecurityException */
public static short toShortAcces... | accessValue = accessValue . trim ( ) . toLowerCase ( ) ; if ( accessValue . equals ( "all" ) ) return VALUE_ALL ; else if ( accessValue . equals ( "local" ) ) return VALUE_LOCAL ; else if ( accessValue . equals ( "none" ) ) return VALUE_NONE ; else if ( accessValue . equals ( "no" ) ) return VALUE_NO ; else if ( access... |
public class FeatureTileGen { /** * Get a r , g , b , a color string from the color
* @ param color
* @ return color string */
private static String colorString ( Color color ) { } } | return color . getRed ( ) + "," + color . getGreen ( ) + "," + color . getBlue ( ) + "," + color . getAlpha ( ) ; |
public class JdbcCpoXaAdapter { /** * Retrieves the bean from the datasource . The assumption is that the bean exists in the datasource . If the retrieve
* function defined for this beans returns more than one row , an exception will be thrown .
* @ param name DOCUMENT ME !
* @ param bean This is an bean that has... | return getCurrentResource ( ) . retrieveBean ( name , bean , wheres , orderBy , nativeExpressions ) ; |
public class JoltUtils { /** * Given a json document checks if its jst blank doc , i . e . [ ] or { }
* @ param obj source
* @ return true if the json doc is [ ] or { } */
public static boolean isBlankJson ( final Object obj ) { } } | if ( obj == null ) { return true ; } if ( obj instanceof Collection ) { return ( ( ( Collection ) obj ) . size ( ) == 0 ) ; } if ( obj instanceof Map ) { return ( ( ( Map ) obj ) . size ( ) == 0 ) ; } throw new UnsupportedOperationException ( "map or list is supported, got ${obj?obj.getClass():null}" ) ; |
public class CalledRemoteApiCounter { public CalledRemoteApiCounter increment ( String facadeName ) { } } | if ( facadeName == null ) { throw new IllegalArgumentException ( "The argument 'facadeName' should not be null." ) ; } if ( facadeCountMap == null ) { facadeCountMap = new LinkedHashMap < String , Integer > ( ) ; } final Integer count = facadeCountMap . get ( facadeName ) ; if ( count != null ) { facadeCountMap . put (... |
public class PermissionOverrideAction { /** * Sets the value of explicitly granted permissions
* using a set of { @ link net . dv8tion . jda . core . Permission Permissions } .
* < br > < b > Note : Permissions not marked as { @ link net . dv8tion . jda . core . Permission # isChannel ( ) isChannel ( ) } will have ... | if ( permissions == null || permissions . length < 1 ) return setAllow ( 0 ) ; checkNull ( permissions , "Permission" ) ; return setAllow ( Permission . getRaw ( permissions ) ) ; |
public class SonarResultParser { /** * Returns the path of the file linked to an issue created by Sonar .
* The path is relative to the folder where Sonar has been run .
* @ param issueComponent " component " field in an issue .
* @ param components information about all components . */
private String getIssueFil... | Component comp = components . get ( issueComponent ) ; String file = comp . path ; if ( ! Strings . isNullOrEmpty ( comp . moduleKey ) ) { String theKey = comp . moduleKey ; while ( ! theKey . isEmpty ( ) ) { Component theChildComp = components . get ( theKey ) ; int p = theKey . lastIndexOf ( ":" ) ; if ( p > 0 ) { th... |
public class ConfusionMatrix { /** * The percentage of negative labeled instances that were predicted as negative .
* @ return TNR / Specificity */
public double specificity ( ) { } } | if ( ! isBinary ( ) ) throw new UnsupportedOperationException ( "specificity is only implemented for 2 class problems." ) ; if ( tooLarge ( ) ) throw new UnsupportedOperationException ( "specificity cannot be computed: too many classes" ) ; double tn = _cm [ 0 ] [ 0 ] ; double fp = _cm [ 0 ] [ 1 ] ; return tn / ( tn + ... |
public class DataSourceProperties { /** * Determine the name to used based on this configuration .
* @ return the database name to use or { @ code null }
* @ since 2.0.0 */
public String determineDatabaseName ( ) { } } | if ( this . generateUniqueName ) { if ( this . uniqueName == null ) { this . uniqueName = UUID . randomUUID ( ) . toString ( ) ; } return this . uniqueName ; } if ( StringUtils . hasLength ( this . name ) ) { return this . name ; } if ( this . embeddedDatabaseConnection != EmbeddedDatabaseConnection . NONE ) { return "... |
public class StringMan { /** * Converts a string with possible high - ascii values into their ascii7 equiv . , for instance ' é '
* maps to ' e ' . All low ascii characters are left untouched . Any character above 255 is converted
* to a space . */
public static String getUS7ASCIIEquiv ( String convertString ) { }... | if ( convertString == null ) return null ; StringBuilder convertedString = new StringBuilder ( ) ; String upperConvertString = convertString . toUpperCase ( ) ; Collator collator = Collator . getInstance ( Locale . US ) ; collator . setStrength ( Collator . PRIMARY ) ; String chars = "abcdefghijklmnopqrstuvwxyz" ; for ... |
public class Node { /** * Called by the { @ link Queue } to determine whether or not this node can
* take the given task . The default checks include whether or not this node
* is part of the task ' s assigned label , whether this node is in
* { @ link Mode # EXCLUSIVE } mode if it is not in the task ' s assigned... | Label l = item . getAssignedLabel ( ) ; if ( l != null && ! l . contains ( this ) ) return CauseOfBlockage . fromMessage ( Messages . _Node_LabelMissing ( getDisplayName ( ) , l ) ) ; // the task needs to be executed on label that this node doesn ' t have .
if ( l == null && getMode ( ) == Mode . EXCLUSIVE ) { // flywe... |
public class Record { /** * Retrieves a CodePage instance . Defaults to ANSI .
* @ param field the index number of the field to be retrieved
* @ return the value of the required field */
public CodePage getCodePage ( int field ) { } } | CodePage result ; if ( ( field < m_fields . length ) && ( m_fields [ field ] . length ( ) != 0 ) ) { result = CodePage . getInstance ( m_fields [ field ] ) ; } else { result = CodePage . getInstance ( null ) ; } return ( result ) ; |
public class DevicesManagementApi { /** * Updates a task for all devices - For now just allows changing the state to cancelled .
* Updates a task for all devices - For now just allows changing the state to cancelled .
* @ param tid Task ID . ( required )
* @ param taskUpdateRequest Task update request ( required ... | ApiResponse < TaskUpdateResponse > resp = updateTaskWithHttpInfo ( tid , taskUpdateRequest ) ; return resp . getData ( ) ; |
public class Calendar { /** * Sets the values for the fields year , month , date , hour , and minute .
* Previous values of other fields are retained . If this is not desired ,
* call { @ link # clear ( ) } first .
* @ param year the value used to set the YEAR time field .
* @ param month the value used to set ... | set ( YEAR , year ) ; set ( MONTH , month ) ; set ( DATE , date ) ; set ( HOUR_OF_DAY , hour ) ; set ( MINUTE , minute ) ; |
public class RansacMulti { /** * { @ inheritDoc } */
@ Override public boolean process ( List < Point > _dataSet ) { } } | // see if it has the minimum number of points
if ( _dataSet . size ( ) < sampleSize ) return false ; dataSet . clear ( ) ; dataSet . addAll ( _dataSet ) ; // configure internal data structures
initialize ( dataSet ) ; // iterate until it has exhausted all iterations or stop if the entire data set
// is in the inlier se... |
public class QYWeixinControllerSupport { /** * 微信消息交互处理
* @ param request 请求
* @ param response 响应
* @ return 结果
* @ throws ServletException servlet异常
* @ throws IOException IO异常 */
@ RequestMapping ( method = RequestMethod . POST ) @ ResponseBody protected final String process ( HttpServletRequest request , ... | // if ( StrUtil . isBlank ( legalStr ( request ) ) ) {
// return " " ;
String result = processRequest ( request ) ; response . getWriter ( ) . write ( result ) ; return null ; |
public class AbstractWebApplicationServiceResponseBuilder { /** * Build header response .
* @ param service the service
* @ param parameters the parameters
* @ return the response */
protected Response buildHeader ( final WebApplicationService service , final Map < String , String > parameters ) { } } | return DefaultResponse . getHeaderResponse ( service . getOriginalUrl ( ) , parameters ) ; |
public class FindObjects { /** * Parses an XML based response and removes the items that are not
* permitted .
* @ param request
* the http servlet request
* @ param response
* the http servlet response
* @ return the new response body without non - permissable objects .
* @ throws ServletException */
pri... | byte [ ] data = response . getData ( ) ; DocumentBuilder docBuilder = null ; Document doc = null ; try { synchronized ( BUILDER_FACTORY ) { docBuilder = BUILDER_FACTORY . newDocumentBuilder ( ) ; } doc = docBuilder . parse ( new ByteArrayInputStream ( data ) ) ; } catch ( Exception e ) { throw new ServletException ( e ... |
public class Parse { /** * Appends the specified string buffer with a string representation of this parse .
* @ param sb A string buffer into which the parse string can be appended . */
public void show ( StringBuffer sb ) { } } | int start ; start = span . getStart ( ) ; if ( ! type . equals ( ParserME . TOK_NODE ) ) { sb . append ( "(" ) ; sb . append ( type + " " ) ; // System . out . print ( label + " " ) ;
// System . out . print ( head + " " ) ;
// System . out . print ( df . format ( prob ) + " " ) ;
} for ( Iterator i = parts . iterator ... |
public class XCasePartImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public void setFallThrough ( boolean newFallThrough ) { } } | boolean oldFallThrough = fallThrough ; fallThrough = newFallThrough ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , XbasePackage . XCASE_PART__FALL_THROUGH , oldFallThrough , fallThrough ) ) ; |
public class LeaderCache { /** * Get a current snapshot of the watched root node ' s children . This snapshot
* promises no cross - children atomicity guarantees . */
@ Override public ImmutableMap < Integer , Long > pointInTimeCache ( ) { } } | if ( m_shutdown . get ( ) ) { throw new RuntimeException ( "Requested cache from shutdown LeaderCache." ) ; } HashMap < Integer , Long > cacheCopy = new HashMap < Integer , Long > ( ) ; for ( Entry < Integer , LeaderCallBackInfo > e : m_publicCache . entrySet ( ) ) { cacheCopy . put ( e . getKey ( ) , e . getValue ( ) ... |
public class UberLinkDiscoverer { /** * ( non - Javadoc )
* @ see org . springframework . hateoas . LinkDiscoverer # findLinksWithRel ( org . springframework . hateoas . LinkRelation , java . lang . String ) */
@ Override public Links findLinksWithRel ( LinkRelation rel , String representation ) { } } | return getLinks ( representation ) . stream ( ) . filter ( it -> it . hasRel ( rel ) ) . collect ( Links . collector ( ) ) ; |
public class ActivityChooserModel { /** * Loads the activities for the current intent if needed which is
* if they are not already loaded for the current intent .
* @ return Whether loading was performed . */
private boolean loadActivitiesIfNeeded ( ) { } } | if ( mReloadActivities && mIntent != null ) { mReloadActivities = false ; mActivities . clear ( ) ; List < ResolveInfo > resolveInfos = mContext . getPackageManager ( ) . queryIntentActivities ( mIntent , 0 ) ; final int resolveInfoCount = resolveInfos . size ( ) ; for ( int i = 0 ; i < resolveInfoCount ; i ++ ) { Reso... |
public class MtasSolrComponentStats { /** * Prepare tokens .
* @ param rb the rb
* @ param mtasFields the mtas fields
* @ throws IOException Signals that an I / O exception has occurred . */
private void prepareTokens ( ResponseBuilder rb , ComponentFields mtasFields ) throws IOException { } } | Set < String > ids = MtasSolrResultUtil . getIdsFromParameters ( rb . req . getParams ( ) , PARAM_MTAS_STATS_TOKENS ) ; if ( ! ids . isEmpty ( ) ) { int tmpCounter = 0 ; String [ ] fields = new String [ ids . size ( ) ] ; String [ ] keys = new String [ ids . size ( ) ] ; String [ ] minima = new String [ ids . size ( ) ... |
public class ReflectionUtils { /** * Checks if the 2 methods are equals .
* @ param method the first method
* @ param other the second method
* @ return true if the 2 methods are equals */
public static boolean methodEquals ( Method method , Method other ) { } } | if ( ( method . getDeclaringClass ( ) . equals ( other . getDeclaringClass ( ) ) ) && ( method . getName ( ) . equals ( other . getName ( ) ) ) ) { if ( ! method . getReturnType ( ) . equals ( other . getReturnType ( ) ) ) return false ; Class < ? > [ ] params1 = method . getParameterTypes ( ) ; Class < ? > [ ] params2... |
public class AbstractCodeGen { /** * Output right curly bracket
* @ param out Writer
* @ param indent space number
* @ throws IOException ioException */
void writeRightCurlyBracket ( Writer out , int indent ) throws IOException { } } | writeEol ( out ) ; writeWithIndent ( out , indent , "}\n" ) ; |
public class PathQueryNode { /** * Returns an array of all currently set location step nodes .
* @ return an array of all currently set location step nodes . */
public LocationStepQueryNode [ ] getPathSteps ( ) { } } | if ( operands == null ) { return EMPTY ; } else { return ( LocationStepQueryNode [ ] ) operands . toArray ( new LocationStepQueryNode [ operands . size ( ) ] ) ; } |
public class UsagesInner { /** * Gets the current usage count and the limit for the resources under the subscription .
* @ return the observable to the List & lt ; UsageInner & gt ; object */
public Observable < Page < UsageInner > > listAsync ( ) { } } | return listWithServiceResponseAsync ( ) . map ( new Func1 < ServiceResponse < List < UsageInner > > , Page < UsageInner > > ( ) { @ Override public Page < UsageInner > call ( ServiceResponse < List < UsageInner > > response ) { PageImpl < UsageInner > page = new PageImpl < > ( ) ; page . setItems ( response . body ( ) ... |
public class NatsTransporter { /** * Closes transporter . */
@ Override public void stopped ( ) { } } | // Mark as stopped
started . set ( false ) ; // Stop timers
super . stopped ( ) ; // Disconnect
try { Thread . sleep ( 100 ) ; } catch ( InterruptedException interrupt ) { } disconnect ( ) ; |
public class ScalarMult { /** * @ description
* Multiplies an integer n by a group element p and
* returns the resulting group element . */
public static byte [ ] scalseMult ( byte [ ] n , byte [ ] p ) { } } | if ( ! ( n . length == scalarLength && p . length == groupElementLength ) ) return null ; byte [ ] q = new byte [ scalarLength ] ; crypto_scalarmult ( q , n , p ) ; return q ; |
public class DependencyTree { /** * 错误 */
private void getWords ( String [ ] words ) { } } | words [ id ] = word ; for ( int i = 0 ; i < leftChilds . size ( ) ; i ++ ) { leftChilds . get ( i ) . getWords ( words ) ; } for ( int i = 0 ; i < rightChilds . size ( ) ; i ++ ) { rightChilds . get ( i ) . getWords ( words ) ; } |
public class ProcessApplicationProcessor { /** * Detect an existing { @ link ProcessApplication } component . */
protected ComponentDescription detectExistingComponent ( DeploymentUnit deploymentUnit ) throws DeploymentUnitProcessingException { } } | final EEModuleDescription eeModuleDescription = deploymentUnit . getAttachment ( Attachments . EE_MODULE_DESCRIPTION ) ; final EEApplicationClasses eeApplicationClasses = deploymentUnit . getAttachment ( Attachments . EE_APPLICATION_CLASSES_DESCRIPTION ) ; final CompositeIndex compositeIndex = deploymentUnit . getAttac... |
public class ClassMap { /** * Returns the vale associated with the any
* interface implemented by the supplied class .
* This method will return the first match only , if
* more than one value can be resolved the first is
* returned .
* @ param clazz Class to inspect interfaces of .
* @ return The resolved ... | T object = null ; Class < ? > [ ] interfaces = clazz . getInterfaces ( ) ; for ( Class < ? > interfaceClass : interfaces ) { object = map . get ( interfaceClass ) ; if ( object != null ) { break ; } } return object ; |
public class AbstractFaxClientSpi { /** * This function will cancel an existing fax job .
* @ param faxJob
* The fax job object containing the needed information */
public void cancelFaxJob ( FaxJob faxJob ) { } } | // validate fax job ID
this . invokeFaxJobIDValidation ( faxJob ) ; // invoke action
this . cancelFaxJobImpl ( faxJob ) ; // fire event
this . fireFaxEvent ( FaxClientActionEventID . CANCEL_FAX_JOB , faxJob ) ; |
public class BackendTransaction { /** * Acquires a lock for the key - column pair on the edge store which ensures that nobody else can take a lock on that
* respective entry for the duration of this lock ( but somebody could potentially still overwrite
* the key - value entry without taking a lock ) .
* The expec... | acquiredLock = true ; edgeStore . acquireLock ( key , column , null , storeTx ) ; |
public class InstantAdapter { /** * Read a time from the Places API and convert to a { @ link Instant } */
@ Override public Instant read ( JsonReader reader ) throws IOException { } } | if ( reader . peek ( ) == JsonToken . NULL ) { reader . nextNull ( ) ; return null ; } if ( reader . peek ( ) == JsonToken . NUMBER ) { // Number is the number of seconds since Epoch .
return Instant . ofEpochMilli ( reader . nextLong ( ) * 1000L ) ; } throw new UnsupportedOperationException ( "Unsupported format" ) ; |
public class AbcGrammar { /** * field - rhythm : : = % x52.3A * WSP tex - text header - eol < p >
* < tt > R : < / tt > */
Rule FieldRhythm ( ) { } } | return Sequence ( String ( "R:" ) , ZeroOrMore ( WSP ( ) ) . suppressNode ( ) , TexText ( ) , HeaderEol ( ) ) . label ( FieldRhythm ) ; |
public class ResourceList { /** * Customer iterator calls out to BW API when there is more data to retrieve */
public Iterator < E > iterator ( ) { } } | final Iterator < E > it = new Iterator < E > ( ) { @ Override public boolean hasNext ( ) { return ( index < size ( ) ) ; } @ Override public E next ( ) { final E elem = get ( index ++ ) ; if ( index >= size ( ) && nextLink != null ) { getNextPage ( ) ; } return elem ; } @ Override public void remove ( ) { // TODO Auto ... |
public class RecurlyClient { /** * Refund an invoice given an open amount
* Returns the refunded invoice
* @ deprecated Please use refundInvoice ( String , InvoiceRefund )
* @ param invoiceId The id of the invoice to refund
* @ param amountInCents The open amount to refund
* @ param method If credit line item... | final InvoiceRefund invoiceRefund = new InvoiceRefund ( ) ; invoiceRefund . setRefundMethod ( method ) ; invoiceRefund . setAmountInCents ( amountInCents ) ; return refundInvoice ( invoiceId , invoiceRefund ) ; |
public class ProjectReportToolbar { /** * SetupSFields Method . */
public void setupSFields ( ) { } } | super . setupSFields ( ) ; this . getRecord ( ProjectTaskScreenRecord . PROJECT_TASK_SCREEN_RECORD_FILE ) . getField ( ProjectTaskScreenRecord . PROJECT_TASK_ID ) . setupDefaultView ( this . getNextLocation ( ScreenConstants . NEXT_LOGICAL , ScreenConstants . ANCHOR_DEFAULT ) , this , ScreenConstants . DEFAULT_DISPLAY ... |
public class Assets { /** * Normalizes the path , by removing { @ code foo / . . } pairs until the path contains no { @ code . . } s .
* For example :
* { @ code foo / bar / . . / baz / bif / . . / bonk . png } becomes { @ code foo / baz / bonk . png } and
* { @ code foo / bar / baz / . . / . . / bing . png } bec... | int pathLen ; do { pathLen = path . length ( ) ; path = path . replaceAll ( "[^/]+/\\.\\./" , "" ) ; } while ( path . length ( ) != pathLen ) ; return path ; |
public class Ix { /** * Calls the given function ( with per - iterator state ) to generate a value or terminate
* whenever the next ( ) is called on the resulting Ix . iterator ( ) .
* The result ' s iterator ( ) doesn ' t support remove ( ) .
* The action may call { @ code onNext } at most once to signal the nex... | return new IxGenerate < T , S > ( nullCheck ( stateSupplier , "stateSupplier is null" ) , nullCheck ( nextSupplier , "nextSupplier is null" ) , nullCheck ( stateDisposer , "stateDisposer is null" ) ) ; |
public class ThemeManager { /** * Get a specific style of a styleId .
* @ param styleId The styleId .
* @ param theme The theme .
* @ return The specific style . */
public int getStyle ( int styleId , int theme ) { } } | int [ ] styles = getStyleList ( styleId ) ; return styles == null ? 0 : styles [ theme ] ; |
public class ProofObligation { /** * Generate an AEqualsBinaryExp */
protected AEqualsBinaryExp getEqualsExp ( PExp left , PExp right ) { } } | return AstExpressionFactory . newAEqualsBinaryExp ( left . clone ( ) , right . clone ( ) ) ; |
public class SwipeBackLayout { /** * Set a drawable used for edge shadow .
* @ param shadow Drawable to use
* @ param edgeFlags Combination of edge flags describing the edge to set
* @ see # EDGE _ LEFT
* @ see # EDGE _ RIGHT
* @ see # EDGE _ BOTTOM */
public void setShadow ( Drawable shadow , int edgeFlag ) ... | if ( ( edgeFlag & EDGE_LEFT ) != 0 ) { mShadowLeft = shadow ; } else if ( ( edgeFlag & EDGE_RIGHT ) != 0 ) { mShadowRight = shadow ; } else if ( ( edgeFlag & EDGE_BOTTOM ) != 0 ) { mShadowBottom = shadow ; } invalidate ( ) ; |
public class DefaultGroovyMethods { /** * Returns an iterator equivalent to this iterator with all duplicated
* items removed by using the natural ordering of the items .
* @ param self an Iterator
* @ return an Iterator with no duplicate items
* @ since 2.4.0 */
public static < T > Iterator < T > toUnique ( It... | return new UniqueIterator < T > ( self , null ) ; |
public class MessageScreen { /** * This is the application code for handling the message . Once the
* message is received the application can retrieve the soap part , the
* attachment part if there are any , or any other information from the
* message . */
public void processThisMessage ( ) { } } | Utility . getLogger ( ) . info ( "On message called in receiving process" ) ; try { BaseMessage messageIn = this . getMessage ( ) ; if ( messageIn != null ) { BaseMessage messageReply = this . createReplyMessage ( messageIn ) ; this . moveScreenParamsToMessage ( messageReply ) ; // Step 2 - Get the body part of the mes... |
public class TypeReflector { /** * Creates an instance of an object type .
* @ param type an object type ( factory function ) to create .
* @ param args arguments for the object constructor .
* @ return the created object instance .
* @ throws Exception when constructors with parameters are not supported */
pub... | if ( args . length == 0 ) { Constructor < ? > constructor = type . getConstructor ( ) ; return constructor . newInstance ( ) ; } else { throw new UnsupportedException ( null , "NOT_SUPPORTED" , "Constructors with parameters are not supported" ) ; } |
public class ValidationObjUtil { /** * Gets object size .
* @ param value the value
* @ return the object size */
public static Double getObjectSize ( Object value ) { } } | double v = 1 ; if ( value instanceof String ) { v = ( ( String ) value ) . length ( ) ; if ( v < 1 ) { return null ; } } else if ( value instanceof List ) { v = ( ( List ) value ) . size ( ) ; } else if ( ValidationObjUtil . isNumberObj ( value ) ) { v = Double . valueOf ( value + "" ) ; } return v ; |
public class WhileyFileParser { /** * Parse a " multi - expression " ; that is , a sequence of one or more
* expressions separated by comma ' s
* @ param scope
* The enclosing scope for this statement , which determines the
* set of visible ( i . e . declared ) variables and also the current
* indentation lev... | ArrayList < Expr > returns = new ArrayList < > ( ) ; // A return statement may optionally have a return expression .
// Therefore , we first skip all whitespace on the given line .
int next = skipLineSpace ( index ) ; // Then , we check whether or not we reached the end of the line . If not ,
// then we assume what ' s... |
public class GUIObjectDetails { /** * A overloaded version of transformKeys method which internally specifies { @ link TestPlatform # WEB } as the
* { @ link TestPlatform }
* @ param keys
* keys for which { @ link GUIObjectDetails } is to be created .
* @ return the { @ link List } of { @ link GUIObjectDetails ... | return transformKeys ( keys , TestPlatform . WEB ) ; |
public class SimpleBase { /** * Sets the elements in this matrix to be equal to the elements in the passed in matrix .
* Both matrix must have the same dimension .
* @ param a The matrix whose value this matrix is being set to . */
public void set ( T a ) { } } | if ( a . getType ( ) == getType ( ) ) mat . set ( a . getMatrix ( ) ) ; else { setMatrix ( a . mat . copy ( ) ) ; } |
public class Locomotive { /** * / * Window / Frame Switching */
public Locomotive waitForWindow ( String regex ) { } } | Set < String > windows = driver . getWindowHandles ( ) ; for ( String window : windows ) { try { driver . switchTo ( ) . window ( window ) ; p = Pattern . compile ( regex ) ; m = p . matcher ( driver . getCurrentUrl ( ) ) ; if ( m . find ( ) ) { attempts = 0 ; return switchToWindow ( regex ) ; } else { // try for title... |
public class FleetCapacityMarshaller { /** * Marshall the given parameter object . */
public void marshall ( FleetCapacity fleetCapacity , ProtocolMarshaller protocolMarshaller ) { } } | if ( fleetCapacity == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( fleetCapacity . getFleetId ( ) , FLEETID_BINDING ) ; protocolMarshaller . marshall ( fleetCapacity . getInstanceType ( ) , INSTANCETYPE_BINDING ) ; protocolMarshaller . ma... |
public class DefaultLoginWebflowConfigurer { /** * Create handle authentication failure action .
* @ param flow the flow */
protected void createHandleAuthenticationFailureAction ( final Flow flow ) { } } | val handler = createActionState ( flow , CasWebflowConstants . STATE_ID_HANDLE_AUTHN_FAILURE , CasWebflowConstants . ACTION_ID_AUTHENTICATION_EXCEPTION_HANDLER ) ; createTransitionForState ( handler , AccountDisabledException . class . getSimpleName ( ) , CasWebflowConstants . VIEW_ID_ACCOUNT_DISABLED ) ; createTransit... |
public class WhileyFileParser { /** * Parse a fail statement , which is of the form :
* < pre >
* FailStmt : : = " fail "
* < / pre >
* @ param scope
* The enclosing scope for this statement , which determines the
* set of visible ( i . e . declared ) variables and also the current
* indentation level .
... | int start = index ; // Match the fail keyword
match ( Fail ) ; int end = index ; matchEndLine ( ) ; // Done .
return annotateSourceLocation ( new Stmt . Fail ( ) , start , end - 1 ) ; |
public class DatatypeConverter { /** * Print priority .
* @ param priority Priority instance
* @ return priority value */
public static final BigInteger printPriority ( Priority priority ) { } } | int result = Priority . MEDIUM ; if ( priority != null ) { result = priority . getValue ( ) ; } return ( BigInteger . valueOf ( result ) ) ; |
public class FormatterUtils { /** * This method maps a formatter name to a < code > Formatter < / code > instance .
* If the formatter name is unknown , then null will be returned . The name
* comparison ignores the case of the given name .
* @ param name
* name of the formatter
* @ return < code > Formatter ... | String key = ( name != null ) ? name . toLowerCase ( ) : "" ; return formatters . get ( key ) ; |
public class AWSAppSyncClient { /** * Lists the resolvers for a given API and type .
* @ param listResolversRequest
* @ return Result of the ListResolvers operation returned by the service .
* @ throws BadRequestException
* The request is not well formed . For example , a value is invalid or a required field is... | request = beforeClientExecution ( request ) ; return executeListResolvers ( request ) ; |
public class TraderSteps { /** * Method used as dynamical parameter converter */
@ AsParameterConverter public Trader retrieveTrader ( String name ) { } } | for ( Trader trader : traders ) { if ( trader . getName ( ) . equals ( name ) ) { return trader ; } } return mockTradePersister ( ) . retrieveTrader ( name ) ; |
public class ArrayUtil { /** * Copies some elements of row into newRow by using columnMap as
* the list of indexes into row . That is , newRow [ i ] = row [ columnMap [ i ] ]
* for each i .
* columnMap and newRow are of equal length and are normally
* shorter than row .
* @ param row the source array
* @ pa... | for ( int i = 0 ; i < columnMap . length ; i ++ ) { newRow [ i ] = row [ columnMap [ i ] ] ; } |
public class IfixParser { /** * { @ inheritDoc } */
@ Override public IfixResourceWritable parseFileToResource ( File assetFile , File metadataFile , String contentUrl ) throws RepositoryException { } } | ArtifactMetadata artifactMetadata = explodeArtifact ( assetFile , metadataFile ) ; // Throw an exception if there is no metadata and properties , we get the name and readme from it
if ( artifactMetadata == null ) { throw new RepositoryArchiveException ( "Unable to find sibling metadata zip for " + assetFile . getName (... |
public class CmsResourceFilter { /** * Returns an extended filter to restrict the results to resources that expire in the given timerange . < p >
* @ param time the required time
* @ return a filter to restrict the results to resources that expire in the given timerange */
public CmsResourceFilter addRequireExpireB... | CmsResourceFilter extendedFilter = ( CmsResourceFilter ) clone ( ) ; extendedFilter . m_filterExpire = true ; extendedFilter . m_expireBefore = time ; extendedFilter . updateCacheId ( ) ; return extendedFilter ; |
public class CleverTapAPI { /** * Launches an asynchronous task to download the notification icon from CleverTap ,
* and create the Android notification .
* Use this method when implementing your own FCM / GCM handling mechanism . Refer to the
* SDK documentation for usage scenarios and examples .
* @ param con... | "WeakerAccess" } ) public static void createNotification ( final Context context , final Bundle extras ) { createNotification ( context , extras , Constants . EMPTY_NOTIFICATION_ID ) ; |
public class PlaceObject { /** * documentation inherited */
public void applyToListeners ( ListenerOp op ) { } } | for ( int ii = 0 , ll = occupants . size ( ) ; ii < ll ; ii ++ ) { op . apply ( this , occupants . get ( ii ) ) ; } |
public class SecurityContextImpl { /** * Get the WSPrincipal from the subject
* @ param subject
* @ return the WSPrincipal of the subject
* @ throws IOException if there is more than one WSPrincipal in the subject */
protected WSPrincipal getWSPrincipal ( Subject subject ) throws IOException { } } | WSPrincipal wsPrincipal = null ; Set < WSPrincipal > principals = ( subject != null ) ? subject . getPrincipals ( WSPrincipal . class ) : null ; if ( principals != null && ! principals . isEmpty ( ) ) { if ( principals . size ( ) > 1 ) { // Error - too many principals
String principalNames = null ; for ( WSPrincipal pr... |
public class ValidationException { /** * Creates a ValidationException which contains a ValidationMessage info .
* @ param messageKey a message key
* @ param params message parameters
* @ return a validation exception with a ValidationMessage info */
public static ValidationException info ( String messageKey , Ob... | return new ValidationException ( ValidationMessage . info ( messageKey , params ) ) ; |
public class AmortizedSparseVector { /** * { @ inheritDoc }
* Note that any values which are 0 are left out of the vector . */
public void set ( double [ ] value ) { } } | checkIndex ( value . length ) ; for ( int i = 0 ; i < value . length ; ++ i ) { if ( value [ i ] != 0d ) set ( i , value [ i ] ) ; } |
public class DatabaseDAODefaultImpl { public String getDeviceFromAlias ( Database database , String alias ) throws DevFailed { } } | DeviceData argIn = new DeviceData ( ) ; argIn . insert ( alias ) ; DeviceData argOut = command_inout ( database , "DbGetAliasDevice" , argIn ) ; return argOut . extractString ( ) ; |
public class DMatrixSparseCSC { /** * Returns the index in nz _ rows for the element at ( row , col ) if it already exists in the matrix . If not then - 1
* is returned .
* @ param row row coordinate
* @ param col column coordinate
* @ return nz _ row index or - 1 if the element does not exist */
public int nz_... | int col0 = col_idx [ col ] ; int col1 = col_idx [ col + 1 ] ; for ( int i = col0 ; i < col1 ; i ++ ) { if ( nz_rows [ i ] == row ) { return i ; } } return - 1 ; |
public class PMContext { /** * Return the selected item of the container
* @ return The EntityInstanceWrapper
* @ throws PMException */
public EntityInstanceWrapper getSelected ( ) throws PMException { } } | final EntityContainer container = getEntityContainer ( true ) ; if ( container == null ) { return null ; } return container . getSelected ( ) ; |
public class AssertKripton { /** * Assert true or invalid global type apdater exception .
* @ param expression
* the expression
* @ param sqLiteDatabaseSchema
* the sq lite database schema
* @ param typeAdapter
* the type adapter
* @ param typeAdapter2
* the type adapter 2 */
public static void assertTr... | if ( ! expression ) { String msg = String . format ( "In data source '%s', there are two or more global type adapter that cover type '%s': '%s' and '%s'" , sqLiteDatabaseSchema . getElement ( ) . getQualifiedName ( ) , TypeAdapterHelper . detectSourceType ( typeAdapter ) , typeAdapter , typeAdapter2 ) ; throw ( new Inv... |
public class ByteBufferInputStream { /** * Get a buffer to write to this InputStream .
* The buffer wll either be a new direct buffer or a recycled buffer . */
public synchronized ByteBuffer getBuffer ( ) { } } | ByteBuffer buf = null ; int s = LazyList . size ( _recycle ) ; if ( s > 0 ) { s -- ; buf = ( ByteBuffer ) LazyList . get ( _recycle , s ) ; _recycle = LazyList . remove ( _recycle , s ) ; buf . clear ( ) ; } else { buf = ByteBuffer . allocateDirect ( _bufferSize ) ; } return buf ; |
public class JmsBytesMessageImpl { /** * Read a Unicode character value from the stream message .
* @ return the next two bytes from the stream message as a Unicode
* character .
* @ exception MessageNotReadableException if message in write - only mode .
* @ exception MessageEOFException if end of message strea... | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "readChar" ) ; try { // Check that we are in read mode
checkBodyReadable ( "readChar" ) ; if ( requiresInit ) lazyInitForReading ( ) ; // Mark the current position , so we can return to it if there ' s an error
readSt... |
public class Db { /** * Execute sql query and return the first result . I recommend add " limit 1 " in your sql .
* @ param sql an SQL statement that may contain one or more ' ? ' IN parameter placeholders
* @ param paras the parameters of sql
* @ return Object [ ] if your sql has select more than one column ,
... | return MAIN . queryFirst ( sql , paras ) ; |
public class PipelineExecutionSummary { /** * A list of the source artifact revisions that initiated a pipeline execution .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setSourceRevisions ( java . util . Collection ) } or { @ link # withSourceRevisions ( j... | if ( this . sourceRevisions == null ) { setSourceRevisions ( new java . util . ArrayList < SourceRevision > ( sourceRevisions . length ) ) ; } for ( SourceRevision ele : sourceRevisions ) { this . sourceRevisions . add ( ele ) ; } return this ; |
public class TemplateVars { /** * system does run it using a jar , so we do have coverage . */
private static InputStream inputStreamFromFile ( URL resourceUrl ) throws IOException , URISyntaxException { } } | File resourceFile = new File ( resourceUrl . toURI ( ) ) ; return new FileInputStream ( resourceFile ) ; |
public class InodeLockManager { /** * Acquires an edge lock .
* @ param edge the edge to lock
* @ param mode the mode to lock in
* @ return a lock resource which must be closed to release the lock */
public LockResource lockEdge ( Edge edge , LockMode mode ) { } } | return mEdgeLocks . get ( edge , mode ) ; |
public class AccountsInner { /** * Lists the Data Lake Store firewall rules within the specified Data Lake Store account .
* ServiceResponse < PageImpl < FirewallRuleInner > > * @ param resourceGroupName The name of the Azure resource group that contains the Data Lake Store account .
* ServiceResponse < PageImpl < ... | if ( resourceGroupName == null ) { throw new IllegalArgumentException ( "Parameter resourceGroupName is required and cannot be null." ) ; } if ( accountName == null ) { throw new IllegalArgumentException ( "Parameter accountName is required and cannot be null." ) ; } if ( this . client . subscriptionId ( ) == null ) { ... |
public class CmsSetupBean { /** * Restores the opencms . xml either to or from a backup file , depending
* whether the setup wizard is executed the first time ( the backup
* does not exist ) or not ( the backup exists ) .
* @ param filename something like e . g . " opencms . xml "
* @ param originalFilename the... | // ensure backup folder exists
File backupFolder = new File ( m_configRfsPath + FOLDER_BACKUP ) ; if ( ! backupFolder . exists ( ) ) { backupFolder . mkdirs ( ) ; } // copy file to ( or from ) backup folder
originalFilename = FOLDER_BACKUP + originalFilename ; File file = new File ( m_configRfsPath + originalFilename )... |
public class SSLConfiguration { /** * Creates the key managers required to initiate the { @ link SSLContext } , using a JKS keystore as an input .
* @ param filepath - the path to the JKS keystore .
* @ param keystorePassword - the keystore ' s password .
* @ param keyPassword - the key ' s passsword .
* @ retu... | KeyStore keyStore = KeyStore . getInstance ( "JKS" ) ; try ( InputStream keyStoreIS = new FileInputStream ( filepath ) ) { keyStore . load ( keyStoreIS , keystorePassword . toCharArray ( ) ) ; } KeyManagerFactory kmf = KeyManagerFactory . getInstance ( KeyManagerFactory . getDefaultAlgorithm ( ) ) ; kmf . init ( keySto... |
public class AbstractApacheHttpClient { /** * Creates asynchronous Apache HTTP client .
* @ param settings
* settings to use to create client .
* @ param conf
* configuration related to async connection .
* @ return Instance of { @ link CloseableHttpAsyncClient } . */
private CloseableHttpAsyncClient createCl... | IOReactorConfig ioReactor = IOReactorConfig . custom ( ) . setIoThreadCount ( conf . getMaxThreadCount ( ) ) . build ( ) ; HttpAsyncClientBuilder httpClientBuilder = HttpAsyncClients . custom ( ) . useSystemProperties ( ) // allow POST redirects
. setRedirectStrategy ( new LaxRedirectStrategy ( ) ) . setMaxConnTotal ( ... |
public class ProtocolService { /** * This will add a new endpoint service to the list . Once added , the new service
* will immediately be started .
* @ param newEndpointService the new service to add and start */
public void add ( EndpointService < L , S > newEndpointService ) { } } | if ( newEndpointService == null ) { throw new IllegalArgumentException ( "New endpoint service must not be null" ) ; } synchronized ( this . inventoryListeners ) { for ( InventoryListener listener : this . inventoryListeners ) { newEndpointService . addInventoryListener ( listener ) ; } } endpointServices . put ( newEn... |
public class DataFrames { /** * Convert a list of string names
* to columns
* @ param columns the columns to convert
* @ return the resulting column list */
public static List < Column > toColumn ( List < String > columns ) { } } | List < Column > ret = new ArrayList < > ( ) ; for ( String s : columns ) ret . add ( col ( s ) ) ; return ret ; |
public class StrBuilder { /** * Searches the string builder to find the first reference to the specified
* string starting searching from the given index .
* Note that a null input string will return - 1 , whereas the JDK throws an exception .
* @ param str the string to find , null returns - 1
* @ param startI... | startIndex = ( startIndex < 0 ? 0 : startIndex ) ; if ( str == null || startIndex >= size ) { return - 1 ; } final int strLen = str . length ( ) ; if ( strLen == 1 ) { return indexOf ( str . charAt ( 0 ) , startIndex ) ; } if ( strLen == 0 ) { return startIndex ; } if ( strLen > size ) { return - 1 ; } final char [ ] t... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.