signature
stringlengths 43
39.1k
| implementation
stringlengths 0
450k
|
|---|---|
public class DefaultLoginWebflowConfigurer { /** * Create redirect unauthorized service url end state .
* @ param flow the flow */
protected void createRedirectUnauthorizedServiceUrlEndState ( final Flow flow ) { } }
|
val state = createEndState ( flow , CasWebflowConstants . STATE_ID_VIEW_REDIR_UNAUTHZ_URL , "flowScope.unauthorizedRedirectUrl" , true ) ; state . getEntryActionList ( ) . add ( createEvaluateAction ( "redirectUnauthorizedServiceUrlAction" ) ) ;
|
public class AppKey { /** * Compares two AppKey objects on the basis of their cluster , userName , appId and encodedRunId
* @ param other
* @ return 0 if this cluster , userName , appId are equal to the other ' s
* cluster , userName , appId ,
* 1 if this cluster or userName or appId are less than the other ' s
* cluster , userName , appId ,
* - 1 if this cluster and userName and appId are greater the other ' s
* cluster , userName , appId */
@ Override public int compareTo ( Object other ) { } }
|
if ( other == null ) { return - 1 ; } AppKey otherKey = ( AppKey ) other ; return new CompareToBuilder ( ) . append ( this . cluster , otherKey . getCluster ( ) ) . append ( this . userName , otherKey . getUserName ( ) ) . append ( this . appId , otherKey . getAppId ( ) ) . toComparison ( ) ;
|
public class R2RMLParser { /** * get a typed atom of a specific type
* @ param type
* - iri , blanknode or literal
* @ param string
* - the atom as string
* @ return the contructed Function atom */
private ImmutableFunctionalTerm getTermTypeAtom ( String string , Object type , String joinCond ) { } }
|
if ( type . equals ( R2RMLVocabulary . iri ) ) { return getURIFunction ( string , joinCond ) ; } else if ( type . equals ( R2RMLVocabulary . blankNode ) ) { return getTypedFunction ( string , 2 , joinCond ) ; } else if ( type . equals ( R2RMLVocabulary . literal ) ) { return getTypedFunction ( trim ( string ) , 3 , joinCond ) ; } return null ;
|
public class CmsResourceWrapperXmlPage { /** * Returns the OpenCms VFS uri of the style sheet of the resource . < p >
* @ param cms the initialized CmsObject
* @ param res the resource where to read the style sheet for
* @ return the OpenCms VFS uri of the style sheet of resource */
protected String getUriStyleSheet ( CmsObject cms , CmsResource res ) { } }
|
String result = "" ; try { String currentTemplate = getUriTemplate ( cms , res ) ; if ( ! "" . equals ( currentTemplate ) ) { // read the stylesheet from the template file
result = cms . readPropertyObject ( currentTemplate , CmsPropertyDefinition . PROPERTY_TEMPLATE , false ) . getValue ( "" ) ; } } catch ( CmsException e ) { // noop
} return result ;
|
public class LineByLinePropertyParser { /** * Line parsing when inside a multiple line property definition .
* @ param line */
private void parseLine__multipleLineMode ( String line ) { } }
|
boolean _leftTrim = ( FinalState . IS_MULTIPLE_LINE_LEFT_TRIM == getParserOutcome ( ) ) ; parseLine__multipleLineMode__appendLineUnlessEndTag ( line , _leftTrim ) ;
|
public class EnforcerRuleUtils { /** * Make sure the model is the one I ' m expecting .
* @ param groupId the group id
* @ param artifactId the artifact id
* @ param version the version
* @ param model Model being checked .
* @ return true , if check if model matches */
protected boolean checkIfModelMatches ( String groupId , String artifactId , String version , Model model ) { } }
|
// try these first .
String modelGroup = model . getGroupId ( ) ; String modelArtifactId = model . getArtifactId ( ) ; String modelVersion = model . getVersion ( ) ; try { if ( StringUtils . isEmpty ( modelGroup ) ) { modelGroup = model . getParent ( ) . getGroupId ( ) ; } else { // MENFORCER - 30 , handle cases where the value is a property like $ { project . parent . groupId }
modelGroup = ( String ) helper . evaluate ( modelGroup ) ; } if ( StringUtils . isEmpty ( modelVersion ) ) { modelVersion = model . getParent ( ) . getVersion ( ) ; } else { // MENFORCER - 30 , handle cases where the value is a property like $ { project . parent . version }
modelVersion = ( String ) helper . evaluate ( modelVersion ) ; } // Is this only required for Maven2?
modelArtifactId = ( String ) helper . evaluate ( modelArtifactId ) ; } catch ( NullPointerException e ) { // this is probably bad . I don ' t have a valid
// group or version and I can ' t find a
// parent ? ? ? ?
// lets see if it ' s what we ' re looking for
// anyway .
} catch ( ExpressionEvaluationException e ) { // as above
} return ( StringUtils . equals ( groupId , modelGroup ) && StringUtils . equals ( version , modelVersion ) && StringUtils . equals ( artifactId , modelArtifactId ) ) ;
|
public class appfwpolicylabel { /** * Use this API to fetch appfwpolicylabel resource of given name . */
public static appfwpolicylabel get ( nitro_service service , String labelname ) throws Exception { } }
|
appfwpolicylabel obj = new appfwpolicylabel ( ) ; obj . set_labelname ( labelname ) ; appfwpolicylabel response = ( appfwpolicylabel ) obj . get_resource ( service ) ; return response ;
|
public class SeaGlassTabbedPaneUI { /** * Paint the background for a tab scroll button .
* @ param ss the tab subregion SynthContext .
* @ param g the Graphics context .
* @ param scrollButton the button to paint . */
protected void paintScrollButtonBackground ( SeaGlassContext ss , Graphics g , JButton scrollButton ) { } }
|
Rectangle tabRect = scrollButton . getBounds ( ) ; int x = tabRect . x ; int y = tabRect . y ; int height = tabRect . height ; int width = tabRect . width ; boolean flipSegments = ( orientation == ControlOrientation . HORIZONTAL && ! tabPane . getComponentOrientation ( ) . isLeftToRight ( ) ) ; SeaGlassLookAndFeel . updateSubregion ( ss , g , tabRect ) ; tabPane . putClientProperty ( "JTabbedPane.Tab.segmentPosition" , ( ( scrollButton == scrollBackwardButton ) ^ flipSegments ) ? "first" : "last" ) ; int oldState = tabContext . getComponentState ( ) ; ButtonModel model = scrollButton . getModel ( ) ; int isPressed = model . isPressed ( ) && model . isArmed ( ) ? PRESSED : 0 ; int buttonState = SeaGlassLookAndFeel . getComponentState ( scrollButton ) | isPressed ; tabContext . setComponentState ( buttonState ) ; tabContext . getPainter ( ) . paintTabbedPaneTabBackground ( tabContext , g , x , y , width , height , - 1 , tabPlacement ) ; tabContext . getPainter ( ) . paintTabbedPaneTabBorder ( tabContext , g , x , y , width , height , - 1 , tabPlacement ) ; tabContext . setComponentState ( oldState ) ;
|
public class MyProxy { /** * Retrieves delegated credentials from the MyProxy server .
* Notes : Performs simple verification of private / public keys of
* the delegated credential . Should be improved later .
* And only checks for RSA keys .
* @ param credential
* The local GSI credentials to use for authentication .
* Can be set to null if no local credentials .
* @ param username
* The username of the credentials to retrieve .
* @ param passphrase
* The passphrase of the credentials to retrieve .
* @ param lifetime
* The requested lifetime of the retrieved credential ( in seconds ) .
* @ return GSSCredential
* The retrieved delegated credentials .
* @ exception MyProxyException
* If an error occurred during the operation . */
public GSSCredential get ( GSSCredential credential , String username , String passphrase , int lifetime ) throws MyProxyException { } }
|
GetParams request = new GetParams ( ) ; request . setUserName ( username ) ; request . setPassphrase ( passphrase ) ; request . setLifetime ( lifetime ) ; return get ( credential , request ) ;
|
public class Vector3d { /** * / * ( non - Javadoc )
* @ see org . joml . Vector3dc # rotateAxis ( double , double , double , double , org . joml . Vector3d ) */
public Vector3d rotateAxis ( double angle , double aX , double aY , double aZ , Vector3d dest ) { } }
|
double hangle = angle * 0.5 ; double sinAngle = Math . sin ( hangle ) ; double qx = aX * sinAngle , qy = aY * sinAngle , qz = aZ * sinAngle ; double qw = Math . cosFromSin ( sinAngle , hangle ) ; double w2 = qw * qw , x2 = qx * qx , y2 = qy * qy , z2 = qz * qz , zw = qz * qw ; double xy = qx * qy , xz = qx * qz , yw = qy * qw , yz = qy * qz , xw = qx * qw ; double nx = ( w2 + x2 - z2 - y2 ) * x + ( - zw + xy - zw + xy ) * y + ( yw + xz + xz + yw ) * z ; double ny = ( xy + zw + zw + xy ) * x + ( y2 - z2 + w2 - x2 ) * y + ( yz + yz - xw - xw ) * z ; double nz = ( xz - yw + xz - yw ) * x + ( yz + yz + xw + xw ) * y + ( z2 - y2 - x2 + w2 ) * z ; dest . x = nx ; dest . y = ny ; dest . z = nz ; return dest ;
|
public class TableBucketReader { /** * Locates all { @ link ResultT } instances in a TableBucket .
* @ param bucketOffset The current segment offset of the Table Bucket we are looking into .
* @ param timer A { @ link TimeoutTimer } for the operation .
* @ return A CompletableFuture that , when completed , will contain a List with the desired result items . This list
* will exclude all { @ link ResultT } items that are marked as deleted . */
CompletableFuture < List < ResultT > > findAllExisting ( long bucketOffset , TimeoutTimer timer ) { } }
|
val result = new HashMap < HashedArray , ResultT > ( ) ; // This handler ensures that items are only added once ( per key ) and only if they are not deleted . Since the items
// are processed in descending version order , the first time we encounter its key is its latest value .
BiConsumer < ResultT , Long > handler = ( item , offset ) -> { TableKey key = getKey ( item ) ; HashedArray indexedKey = new HashedArray ( key . getKey ( ) ) ; if ( ! result . containsKey ( indexedKey ) ) { result . put ( indexedKey , key . getVersion ( ) == TableKey . NOT_EXISTS ? null : item ) ; } } ; return findAll ( bucketOffset , handler , timer ) . thenApply ( v -> result . values ( ) . stream ( ) . filter ( Objects :: nonNull ) . collect ( Collectors . toList ( ) ) ) ;
|
public class LinearKeyAlgo { /** * This method returns latitude and longitude via latLon - calculated from specified linearKey
* @ param linearKey is the input */
@ Override public final void decode ( long linearKey , GHPoint latLon ) { } }
|
double lat = linearKey / lonUnits * latDelta + bounds . minLat ; double lon = linearKey % lonUnits * lonDelta + bounds . minLon ; latLon . lat = lat + latDelta / 2 ; latLon . lon = lon + lonDelta / 2 ;
|
public class InboundTransmissionParser { /** * Invoked to parse a primary header structure from the supplied buffer .
* May be invoked multiple times to incrementally parse the structure .
* Once the structure has been fully parsed , transitions the state machine
* into the appropriate next state based on the layout of the transmission .
* @ param contextBuffer */
private void parsePrimaryHeader ( WsByteBuffer contextBuffer ) { } }
|
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "parsePrimaryHeader" , contextBuffer ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) JFapUtils . debugTraceWsByteBufferInfo ( this , tc , contextBuffer , "contextBuffer" ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) JFapUtils . debugTraceWsByteBufferInfo ( this , tc , unparsedPrimaryHeader , "unparsedPrimaryHeader" ) ; int initialPrimaryHeaderPosition = unparsedPrimaryHeader . position ( ) ; WsByteBuffer parseHeaderBuffer = readData ( contextBuffer , unparsedPrimaryHeader ) ; if ( parseHeaderBuffer != null ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "parse header buffer not null" ) ; short eyecatcher = parseHeaderBuffer . getShort ( ) ; if ( eyecatcher != ( short ) 0xBEEF ) { // bad eyecatcher
state = STATE_ERROR ; throwable = new SIConnectionLostException ( nls . getFormattedMessage ( "TRANSPARSER_PROTOCOLERROR_SICJ0053" , new Object [ ] { connection . remoteHostAddress , connection . chainName } , "TRANSPARSER_PROTOCOLERROR_SICJ0053" ) ) ; // D226223
// This FFDC was generated because our peer sent us an invalid eyecatcher .
FFDCFilter . processException ( throwable , "com.ibm.ws.sib.jfapchannel.impl.InboundTransmissionParser" , JFapChannelConstants . INBOUNDXMITPARSER_PARSEPRIMHDR_01 , getFormattedBytes ( contextBuffer ) ) ; // D267629
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "bad eyecatcer (as short): " + eyecatcher ) ; } else { primaryHeaderFields . segmentLength = parseHeaderBuffer . getInt ( ) ; if ( primaryHeaderFields . segmentLength < 0 ) primaryHeaderFields . segmentLength += 4294967296L ; // Reject lengths greater than our maximum transmission length .
if ( primaryHeaderFields . segmentLength > connection . getMaxTransmissionSize ( ) ) { state = STATE_ERROR ; throwable = new SIConnectionLostException ( nls . getFormattedMessage ( "TRANSPARSER_PROTOCOLERROR_SICJ0053" , new Object [ ] { connection . remoteHostAddress , connection . chainName } , "TRANSPARSER_PROTOCOLERROR_SICJ0053" ) ) ; // D226223
// This FFDC was generated because our peer has exceeded the maximum segment size
// that was agreed at handshake time .
FFDCFilter . processException ( throwable , "com.ibm.ws.sib.jfapchannel.impl.InboundTransmissionParser" , JFapChannelConstants . INBOUNDXMITPARSER_PARSEPRIMHDR_02 , getFormattedBytes ( contextBuffer ) ) ; // D267629
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "max transmission size exceeded" ) ; } else { transmissionPayloadRemaining = primaryHeaderFields . segmentLength - JFapChannelConstants . SIZEOF_PRIMARY_HEADER ; short flags = parseHeaderBuffer . getShort ( ) ; primaryHeaderFields . priority = flags & 0x000F ; primaryHeaderFields . isPooled = ( flags & 0x1000 ) == 0x1000 ; primaryHeaderFields . isExchange = ( flags & 0x4000 ) == 0x4000 ; // D190023
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "flags: " + flags ) ; primaryHeaderFields . packetNumber = parseHeaderBuffer . get ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( tc , "packet number: " + primaryHeaderFields . packetNumber + " expected: " + expectedPacketNumber ) ; if ( primaryHeaderFields . packetNumber != expectedPacketNumber ) { state = STATE_ERROR ; throwable = new SIConnectionLostException ( nls . getFormattedMessage ( "TRANSPARSER_PROTOCOLERROR_SICJ0053" , new Object [ ] { connection . remoteHostAddress , connection . chainName } , "TRANSPARSER_PROTOCOLERROR_SICJ0053" ) ) ; // D226223
// This FFDC was generated because our peer sent us a transmission containing
// a sequence number that did not match the one we expected .
final Object [ ] ffdcData = new Object [ ] { "expected packet number=" + expectedPacketNumber , "received packet number=" + primaryHeaderFields . packetNumber , getFormattedBytes ( contextBuffer ) } ; FFDCFilter . processException ( throwable , "com.ibm.ws.sib.jfapchannel.impl.InboundTransmissionParser" , JFapChannelConstants . INBOUNDXMITPARSER_PARSEPRIMHDR_03 , ffdcData ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "sequence number mis-match - expected:" + expectedPacketNumber + " got:" + primaryHeaderFields . packetNumber ) ; } else { ++ expectedPacketNumber ; primaryHeaderFields . segmentType = parseHeaderBuffer . get ( ) ; if ( primaryHeaderFields . segmentType < 0 ) primaryHeaderFields . segmentType += 256 ; transmissionLayout = JFapChannelConstants . segmentToLayout ( primaryHeaderFields . segmentType ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "layout = " + transmissionLayout ) ; if ( transmissionLayout == JFapChannelConstants . XMIT_PRIMARY_ONLY ) { transmissionPayloadDataLength = primaryHeaderFields . segmentLength - JFapChannelConstants . SIZEOF_PRIMARY_HEADER ; state = STATE_PARSING_PRIMARY_ONLY_PAYLOAD ; } else if ( ( transmissionLayout == JFapChannelConstants . XMIT_CONVERSATION ) || ( transmissionLayout == JFapChannelConstants . XMIT_SEGMENT_START ) || ( transmissionLayout == JFapChannelConstants . XMIT_SEGMENT_MIDDLE ) || ( transmissionLayout == JFapChannelConstants . XMIT_SEGMENT_END ) ) { state = STATE_PARSING_CONVERSATION_HEADER ; } else if ( transmissionLayout == JFapChannelConstants . XMIT_LAYOUT_UNKNOWN ) { throwable = new SIErrorException ( nls . getFormattedMessage ( "TRANSPARSER_INTERNAL_SICJ0054" , null , "TRANSPARSER_INTERNAL_SICJ0054" ) ) ; // D226223
// This FFDC was generated because the segment type of the transmission doesn ' t match any of
// the segment types that we know the layout for .
FFDCFilter . processException ( throwable , "com.ibm.ws.sib.jfapchannel.impl.InboundTransmissionParser" , JFapChannelConstants . INBOUNDXMITPARSER_PARSEPRIMHDR_04 , getFormattedBytes ( contextBuffer ) ) ; // D267629
state = STATE_ERROR ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "invalid layout" ) ; } else { throwable = new SIErrorException ( nls . getFormattedMessage ( "TRANSPARSER_INTERNAL_SICJ0054" , null , "TRANSPARSER_INTERNAL_SICJ0054" ) ) ; // D226223
// This FFDC was generated because the JFapChannelConstants . segmentToLayout method
// returned a transmission layout we didn ' t expect .
FFDCFilter . processException ( throwable , "com.ibm.ws.sib.jfapchannel.impl.InboundTransmissionParser" , JFapChannelConstants . INBOUNDXMITPARSER_PARSEPRIMHDR_05 , getFormattedBytes ( contextBuffer ) ) ; // D267629
state = STATE_ERROR ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "JFapChannelConstants.segmentToLayout method returned unknown enumeration value" ) ; } } } } } else { // Optimisation for early rejection of bad eyecatcher
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) JFapUtils . debugTraceWsByteBufferInfo ( this , tc , unparsedPrimaryHeader , "unparsedPrimaryHEader" ) ; int unparsedPrimaryHeaderPosition = unparsedPrimaryHeader . position ( ) ; if ( ( initialPrimaryHeaderPosition < JFapChannelConstants . SIZEOF_EYECATCHER ) && ( unparsedPrimaryHeaderPosition > initialPrimaryHeaderPosition ) ) { int eyecatcherPresent = unparsedPrimaryHeaderPosition - initialPrimaryHeaderPosition ; if ( eyecatcherPresent > JFapChannelConstants . SIZEOF_EYECATCHER ) eyecatcherPresent = JFapChannelConstants . SIZEOF_EYECATCHER ; int eyecatcherOffset = initialPrimaryHeaderPosition ; unparsedPrimaryHeader . position ( eyecatcherOffset ) ; boolean reject = false ; for ( int i = eyecatcherOffset ; ( i < eyecatcherPresent ) && ( ! reject ) ; ++ i ) { reject = unparsedPrimaryHeader . get ( ) != JFapChannelConstants . EYECATCHER_AS_BYTES [ i ] ; } if ( reject ) { throwable = new SIConnectionLostException ( nls . getFormattedMessage ( "TRANSPARSER_PROTOCOLERROR_SICJ0053" , new Object [ ] { connection . remoteHostAddress , connection . chainName } , "TRANSPARSER_PROTOCOLERROR_SICJ0053" ) ) ; // D226223
// This FFDC was generated because our peer sent us bad eyecathcer data .
FFDCFilter . processException ( throwable , "com.ibm.ws.sib.jfapchannel.impl.InboundTransmissionParser" , JFapChannelConstants . INBOUNDXMITPARSER_PARSEPRIMHDR_06 , getFormattedBytes ( contextBuffer ) ) ; // D267629
state = STATE_ERROR ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "invalid eyecatcher" ) ; } else { unparsedPrimaryHeader . position ( unparsedPrimaryHeaderPosition ) ; } } if ( state != STATE_ERROR ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "need more data" ) ; needMoreData = true ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "parsePrimaryHeader" ) ;
|
public class TextEncryptor { /** * < p > Encrypts and Base64 encodes a message . < / p >
* @ param message the message
* @ return the encrypted message
* @ throws GeneralSecurityException */
public String encrypt ( String message ) throws GeneralSecurityException { } }
|
byte [ ] bytes = encryptor . encrypt ( message . getBytes ( ) ) ; return Base64 . getEncoder ( ) . encodeToString ( bytes ) ;
|
public class PdfStamper { /** * This is the most simple way to change a PDF into a
* portable collection . Choose one of the following names :
* < ul >
* < li > PdfName . D ( detailed view )
* < li > PdfName . T ( tiled view )
* < li > PdfName . H ( hidden )
* < / ul >
* Pass this name as a parameter and your PDF will be
* a portable collection with all the embedded and
* attached files as entries .
* @ param initialView can be PdfName . D , PdfName . T or PdfName . H */
public void makePackage ( PdfName initialView ) { } }
|
PdfCollection collection = new PdfCollection ( 0 ) ; collection . put ( PdfName . VIEW , initialView ) ; stamper . makePackage ( collection ) ;
|
public class Server { /** * ( non - Javadoc )
* @ see org . restcomm . protocols . ss7 . map . api . MAPDialogListener # onDialogResease
* ( org . restcomm . protocols . ss7 . map . api . MAPDialog ) */
@ Override public void onDialogRelease ( MAPDialog mapDialog ) { } }
|
if ( logger . isDebugEnabled ( ) ) { logger . debug ( String . format ( "onDialogResease for DialogId=%d" , mapDialog . getLocalDialogId ( ) ) ) ; } this . endCount ++ ; if ( ( this . endCount % 2000 ) == 0 ) { long currentTime = System . currentTimeMillis ( ) ; long processingTime = currentTime - start ; start = currentTime ; logger . warn ( "Completed 2000 Dialogs in=" + processingTime ) ; }
|
public class DescribeInstanceAssociationsStatusRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( DescribeInstanceAssociationsStatusRequest describeInstanceAssociationsStatusRequest , ProtocolMarshaller protocolMarshaller ) { } }
|
if ( describeInstanceAssociationsStatusRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( describeInstanceAssociationsStatusRequest . getInstanceId ( ) , INSTANCEID_BINDING ) ; protocolMarshaller . marshall ( describeInstanceAssociationsStatusRequest . getMaxResults ( ) , MAXRESULTS_BINDING ) ; protocolMarshaller . marshall ( describeInstanceAssociationsStatusRequest . getNextToken ( ) , NEXTTOKEN_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
|
public class FctFillersObjectFields { /** * < p > Set / replace bean . < / p >
* @ param pBeanClass - bean class
* @ param pBean bean
* @ throws Exception - an exception */
@ Override public final synchronized void set ( final Class < ? > pBeanClass , final IFillerObjectFields < ? > pBean ) throws Exception { } }
|
this . fillersMap . put ( pBeanClass , pBean ) ;
|
public class DBCleaningScripts { /** * Returns SQL scripts for dropping existed old JCR tables . */
protected Collection < String > getOldTablesDroppingScripts ( ) { } }
|
List < String > scripts = new ArrayList < String > ( ) ; scripts . add ( "DROP TABLE " + valueTableName + "_OLD" ) ; scripts . add ( "DROP TABLE " + refTableName + "_OLD" ) ; scripts . add ( "DROP TABLE " + itemTableName + "_OLD" ) ; return scripts ;
|
public class CloudSnippets { /** * Example of running a batch query . */
public void runBatchQuery ( ) throws TimeoutException , InterruptedException { } }
|
// [ START bigquery _ query _ batch ]
// BigQuery bigquery = BigQueryOptions . getDefaultInstance ( ) . getService ( ) ;
String query = "SELECT corpus FROM `bigquery-public-data.samples.shakespeare` GROUP BY corpus;" ; QueryJobConfiguration queryConfig = QueryJobConfiguration . newBuilder ( query ) // Run at batch priority , which won ' t count toward concurrent rate
// limit .
. setPriority ( QueryJobConfiguration . Priority . BATCH ) . build ( ) ; // Location must match that of the dataset ( s ) referenced in the query .
JobId jobId = JobId . newBuilder ( ) . setRandomJob ( ) . setLocation ( "US" ) . build ( ) ; String jobIdString = jobId . getJob ( ) ; // API request - starts the query .
bigquery . create ( JobInfo . newBuilder ( queryConfig ) . setJobId ( jobId ) . build ( ) ) ; // Check on the progress by getting the job ' s updated state . Once the state
// is ` DONE ` , the results are ready .
Job queryJob = bigquery . getJob ( JobId . newBuilder ( ) . setJob ( jobIdString ) . setLocation ( "US" ) . build ( ) ) ; System . out . printf ( "Job %s in location %s currently in state: %s%n" , queryJob . getJobId ( ) . getJob ( ) , queryJob . getJobId ( ) . getLocation ( ) , queryJob . getStatus ( ) . getState ( ) . toString ( ) ) ; // [ END bigquery _ query _ batch ]
|
public class ConnectionInputStream { /** * Repeatedly read the underlying { @ link InputStream } until the requested number of
* bytes have been loaded .
* @ param buffer the destination buffer
* @ param offset the buffer offset
* @ param length the amount of data to read
* @ throws IOException in case of I / O errors */
public void readFully ( byte [ ] buffer , int offset , int length ) throws IOException { } }
|
while ( length > 0 ) { int amountRead = checkedRead ( buffer , offset , length ) ; offset += amountRead ; length -= amountRead ; }
|
public class Toolbox { /** * 添加组件
* @ param value
* @ return */
private Toolbox _addFeature ( Feature value ) { } }
|
if ( value == null ) { return this ; } // 第一个字母转小写
String name = value . getClass ( ) . getSimpleName ( ) ; name = name . substring ( 0 , 1 ) . toLowerCase ( ) + name . substring ( 1 ) ; _addFeatureOnce ( name , value ) ; return this ;
|
public class MediaApi { /** * Assign the contact to the open interaction
* Assign the contact to the open interaction specified in the contactId path parameter
* @ param mediatype media - type of interaction ( required )
* @ param id id of interaction ( required )
* @ param contactId id of contact ( required )
* @ param assignContactData Request parameters . ( optional )
* @ return ApiSuccessResponse
* @ throws ApiException If fail to call the API , e . g . server error or cannot deserialize the response body */
public ApiSuccessResponse assignContact ( String mediatype , String id , String contactId , AssignContactData assignContactData ) throws ApiException { } }
|
ApiResponse < ApiSuccessResponse > resp = assignContactWithHttpInfo ( mediatype , id , contactId , assignContactData ) ; return resp . getData ( ) ;
|
public class GreenPepperServerServiceImpl { /** * { @ inheritDoc } */
public boolean doesSpecificationHasReferences ( Specification specification ) throws GreenPepperServerException { } }
|
try { sessionService . startSession ( ) ; boolean hasReferences = ! documentDao . getAllReferences ( specification ) . isEmpty ( ) ; log . debug ( "Does Specification " + specification . getName ( ) + " Has References: " + hasReferences ) ; return hasReferences ; } catch ( Exception ex ) { throw handleException ( ERROR , ex ) ; } finally { sessionService . closeSession ( ) ; }
|
public class Match { /** * Creates a state used for actually matching a token .
* @ since 2.3 */
public MatchState createState ( Synthesizer synthesizer , AnalyzedTokenReadings [ ] tokens , int index , int next ) { } }
|
MatchState state = new MatchState ( this , synthesizer ) ; state . setToken ( tokens , index , next ) ; return state ;
|
public class CmsModuleUpdater { /** * Tries to create a new updater instance . < p >
* If the module is deemed non - updatable , an empty result is returned . < p >
* @ param cms the current CMS context
* @ param importFile the import file path
* @ param report the report to write to
* @ return an optional module updater
* @ throws CmsException if something goes wrong */
public static Optional < CmsModuleUpdater > create ( CmsObject cms , String importFile , I_CmsReport report ) throws CmsException { } }
|
CmsModuleImportData moduleData = readModuleData ( cms , importFile , report ) ; if ( moduleData . checkUpdatable ( cms ) ) { return Optional . of ( new CmsModuleUpdater ( moduleData , report ) ) ; } else { return Optional . empty ( ) ; }
|
public class AuthorizationUtils { /** * Filter a collection of resources by applying the resourceActionGenerator to each resource , return an iterable
* containing the filtered resources .
* The resourceActionGenerator returns an Iterable < ResourceAction > for each resource .
* If every resource - action in the iterable is authorized , the resource will be added to the filtered resources .
* If there is an authorization failure for one of the resource - actions , the resource will not be
* added to the returned filtered resources . .
* If the resourceActionGenerator returns null for a resource , that resource will not be added to the filtered
* resources .
* This function will set the DRUID _ AUTHORIZATION _ CHECKED attribute in the request .
* If this attribute is already set when this function is called , an exception is thrown .
* @ param request HTTP request to be authorized
* @ param resources resources to be processed into resource - actions
* @ param resourceActionGenerator Function that creates an iterable of resource - actions from a resource
* @ param authorizerMapper authorizer mapper
* @ return Iterable containing resources that were authorized */
public static < ResType > Iterable < ResType > filterAuthorizedResources ( final HttpServletRequest request , final Iterable < ResType > resources , final Function < ? super ResType , Iterable < ResourceAction > > resourceActionGenerator , final AuthorizerMapper authorizerMapper ) { } }
|
if ( request . getAttribute ( AuthConfig . DRUID_ALLOW_UNSECURED_PATH ) != null ) { return resources ; } if ( request . getAttribute ( AuthConfig . DRUID_AUTHORIZATION_CHECKED ) != null ) { throw new ISE ( "Request already had authorization check." ) ; } final AuthenticationResult authenticationResult = authenticationResultFromRequest ( request ) ; final Iterable < ResType > filteredResources = filterAuthorizedResources ( authenticationResult , resources , resourceActionGenerator , authorizerMapper ) ; // We ' re filtering , so having access to none of the objects isn ' t an authorization failure ( in terms of whether
// to send an error response or not . )
request . setAttribute ( AuthConfig . DRUID_AUTHORIZATION_CHECKED , true ) ; return filteredResources ;
|
public class AppServiceEnvironmentsInner { /** * Get metric definitions for a specific instance of a multi - role pool of an App Service Environment .
* Get metric definitions for a specific instance of a multi - role pool of an App Service Environment .
* @ param nextPageLink The NextLink from the previous successful call to List operation .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the PagedList & lt ; ResourceMetricDefinitionInner & gt ; object */
public Observable < ServiceResponse < Page < ResourceMetricDefinitionInner > > > listMultiRolePoolInstanceMetricDefinitionsNextWithServiceResponseAsync ( final String nextPageLink ) { } }
|
return listMultiRolePoolInstanceMetricDefinitionsNextSinglePageAsync ( nextPageLink ) . concatMap ( new Func1 < ServiceResponse < Page < ResourceMetricDefinitionInner > > , Observable < ServiceResponse < Page < ResourceMetricDefinitionInner > > > > ( ) { @ Override public Observable < ServiceResponse < Page < ResourceMetricDefinitionInner > > > call ( ServiceResponse < Page < ResourceMetricDefinitionInner > > page ) { String nextPageLink = page . body ( ) . nextPageLink ( ) ; if ( nextPageLink == null ) { return Observable . just ( page ) ; } return Observable . just ( page ) . concatWith ( listMultiRolePoolInstanceMetricDefinitionsNextWithServiceResponseAsync ( nextPageLink ) ) ; } } ) ;
|
public class CommerceDiscountRulePersistenceImpl { /** * Returns the commerce discount rule with the primary key or returns < code > null < / code > if it could not be found .
* @ param primaryKey the primary key of the commerce discount rule
* @ return the commerce discount rule , or < code > null < / code > if a commerce discount rule with the primary key could not be found */
@ Override public CommerceDiscountRule fetchByPrimaryKey ( Serializable primaryKey ) { } }
|
Serializable serializable = entityCache . getResult ( CommerceDiscountRuleModelImpl . ENTITY_CACHE_ENABLED , CommerceDiscountRuleImpl . class , primaryKey ) ; if ( serializable == nullModel ) { return null ; } CommerceDiscountRule commerceDiscountRule = ( CommerceDiscountRule ) serializable ; if ( commerceDiscountRule == null ) { Session session = null ; try { session = openSession ( ) ; commerceDiscountRule = ( CommerceDiscountRule ) session . get ( CommerceDiscountRuleImpl . class , primaryKey ) ; if ( commerceDiscountRule != null ) { cacheResult ( commerceDiscountRule ) ; } else { entityCache . putResult ( CommerceDiscountRuleModelImpl . ENTITY_CACHE_ENABLED , CommerceDiscountRuleImpl . class , primaryKey , nullModel ) ; } } catch ( Exception e ) { entityCache . removeResult ( CommerceDiscountRuleModelImpl . ENTITY_CACHE_ENABLED , CommerceDiscountRuleImpl . class , primaryKey ) ; throw processException ( e ) ; } finally { closeSession ( session ) ; } } return commerceDiscountRule ;
|
public class MilestonesApi { /** * Get a list of project milestones that have the specified state .
* @ param projectIdOrPath the project in the form of an Integer ( ID ) , String ( path ) , or Project instance
* @ param state the milestone state
* @ return the milestones associated with the specified project and state
* @ throws GitLabApiException if any exception occurs */
public List < Milestone > getMilestones ( Object projectIdOrPath , MilestoneState state ) throws GitLabApiException { } }
|
Form formData = new GitLabApiForm ( ) . withParam ( "state" , state ) . withParam ( PER_PAGE_PARAM , getDefaultPerPage ( ) ) ; Response response = get ( Response . Status . OK , formData . asMap ( ) , "projects" , getProjectIdOrPath ( projectIdOrPath ) , "milestones" ) ; return ( response . readEntity ( new GenericType < List < Milestone > > ( ) { } ) ) ;
|
public class FTPServer { /** * Called when a connection is created .
* @ param socket The connection socket
* @ throws IOException When an error occurs */
protected void addConnection ( Socket socket ) throws IOException { } }
|
FTPConnection con = createConnection ( socket ) ; synchronized ( listeners ) { for ( IFTPListener l : listeners ) { l . onConnected ( con ) ; } } synchronized ( connections ) { connections . add ( con ) ; }
|
public class PortAllocator { /** * Allocate ports for port mappings with no external ports configured .
* @ param ports A map of port mappings for a container , both with statically configured
* external ports and dynamic unconfigured external ports .
* @ param used A set of used ports . The ports allocated will not clash with these ports .
* @ return The allocated ports . */
public Map < String , Integer > allocate ( final Map < String , PortMapping > ports , final Set < Integer > used ) { } }
|
return allocate0 ( ports , Sets . newHashSet ( used ) ) ;
|
public class AbstractCompositeServiceBuilder { /** * Binds the specified { @ link Service } at the specified path pattern .
* @ deprecated Use { @ link # service ( String , Service ) } instead . */
@ Deprecated protected T serviceAt ( String pathPattern , Service < I , O > service ) { } }
|
return service ( pathPattern , service ) ;
|
public class MappeableArrayContainer { /** * not thread - safe */
private void emit ( short val ) { } }
|
if ( cardinality == content . limit ( ) ) { increaseCapacity ( true ) ; } content . put ( cardinality ++ , val ) ;
|
public class GroupReduceOperatorBase { /** * Marks the group reduce operation as combinable . Combinable operations may pre - reduce the
* data before the actual group reduce operations . Combinable user - defined functions
* must implement the interface { @ link GenericCombine } .
* @ param combinable Flag to mark the group reduce operation as combinable . */
public void setCombinable ( boolean combinable ) { } }
|
// sanity check
if ( combinable && ! GenericCombine . class . isAssignableFrom ( this . userFunction . getUserCodeClass ( ) ) ) { throw new IllegalArgumentException ( "Cannot set a UDF as combinable if it does not implement the interface " + GenericCombine . class . getName ( ) ) ; } else { this . combinable = combinable ; }
|
public class PathHelper { /** * Returns the number of files and directories contained in the passed
* directory excluding the system internal directories .
* @ param aDirectory
* The directory to check . May not be < code > null < / code > and must be a
* directory .
* @ return A non - negative number of objects in that directory .
* @ see FilenameHelper # isSystemInternalDirectory ( CharSequence ) */
@ Nonnegative public static int getDirectoryObjectCount ( @ Nonnull final Path aDirectory ) { } }
|
ValueEnforcer . notNull ( aDirectory , "Directory" ) ; ValueEnforcer . isTrue ( aDirectory . toFile ( ) . isDirectory ( ) , "Passed object is not a directory: " + aDirectory ) ; int ret = 0 ; for ( final Path aChild : getDirectoryContent ( aDirectory ) ) if ( ! FilenameHelper . isSystemInternalDirectory ( aChild ) ) ret ++ ; return ret ;
|
public class CommerceOrderItemPersistenceImpl { /** * Returns all the commerce order items where CProductId = & # 63 ; .
* @ param CProductId the c product ID
* @ return the matching commerce order items */
@ Override public List < CommerceOrderItem > findByCProductId ( long CProductId ) { } }
|
return findByCProductId ( CProductId , QueryUtil . ALL_POS , QueryUtil . ALL_POS , null ) ;
|
public class N { /** * Returns a new array with removes all the occurrences of specified elements from < code > a < / code >
* @ param a
* @ param elements
* @ return
* @ see Collection # removeAll ( Collection ) */
@ SafeVarargs public static boolean [ ] removeAll ( final boolean [ ] a , final boolean ... elements ) { } }
|
if ( N . isNullOrEmpty ( a ) ) { return N . EMPTY_BOOLEAN_ARRAY ; } else if ( N . isNullOrEmpty ( elements ) ) { return a . clone ( ) ; } else if ( elements . length == 1 ) { return removeAllOccurrences ( a , elements [ 0 ] ) ; } final BooleanList list = BooleanList . of ( a . clone ( ) ) ; list . removeAll ( BooleanList . of ( elements ) ) ; return list . trimToSize ( ) . array ( ) ;
|
public class PortletExecutionManager { /** * / * ( non - Javadoc )
* @ see org . apereo . portal . portlet . rendering . IPortletExecutionManager # doPortletAction ( org . apereo . portal . portlet . om . IPortletWindowId , javax . servlet . http . HttpServletRequest , javax . servlet . http . HttpServletResponse ) */
@ Override public void doPortletAction ( IPortletWindowId portletWindowId , HttpServletRequest request , HttpServletResponse response ) { } }
|
final long timeout = getPortletActionTimeout ( portletWindowId , request ) ; final IPortletExecutionWorker < Long > portletActionExecutionWorker = this . portletWorkerFactory . createActionWorker ( request , response , portletWindowId ) ; portletActionExecutionWorker . submit ( ) ; try { portletActionExecutionWorker . get ( timeout ) ; } catch ( Exception e ) { // put the exception into the error map for the session
final Map < IPortletWindowId , Exception > portletFailureMap = getPortletErrorMap ( request ) ; portletFailureMap . put ( portletWindowId , e ) ; } // If the worker is still running add it to the hung - workers queue
if ( ! portletActionExecutionWorker . isComplete ( ) ) { cancelWorker ( request , portletActionExecutionWorker ) ; } // Is this portlet permitted to emit events ? ( Or is it disablePortletEvents = true ? )
final IPortletWindow portletWindow = portletWindowRegistry . getPortletWindow ( request , portletWindowId ) ; IPortletDefinition portletDefinition = portletWindow . getPortletEntity ( ) . getPortletDefinition ( ) ; IPortletDefinitionParameter disablePortletEvents = portletDefinition . getParameter ( DISABLE_PORTLET_EVENTS_PARAMETER ) ; if ( disablePortletEvents != null && Boolean . parseBoolean ( disablePortletEvents . getValue ( ) ) ) { logger . info ( "Ignoring portlet events for portlet '{}' because they have been disabled." , portletDefinition . getFName ( ) ) ; } else { // Proceed with events . . .
final PortletEventQueue portletEventQueue = this . eventCoordinationService . getPortletEventQueue ( request ) ; this . doPortletEvents ( portletEventQueue , request , response ) ; }
|
public class MovingMessage { /** * Reads the contents of the stream until
* & lt ; CRLF & gt ; . & lt ; CRLF & gt ; is encountered .
* It would be possible and perhaps desirable to prevent the
* adding of an unnecessary CRLF at the end of the message , but
* it hardly seems worth 30 seconds of effort . */
public void readDotTerminatedContent ( BufferedReader in ) throws IOException { } }
|
content = workspace . getTmpFile ( ) ; Writer data = content . getWriter ( ) ; PrintWriter dataWriter = new InternetPrintWriter ( data ) ; while ( true ) { String line = in . readLine ( ) ; if ( line == null ) throw new EOFException ( "Did not receive <CRLF>.<CRLF>" ) ; if ( "." . equals ( line ) ) { dataWriter . close ( ) ; break ; } else if ( line . startsWith ( "." ) ) { dataWriter . println ( line . substring ( 1 ) ) ; } else { dataWriter . println ( line ) ; } } try { message = GreenMailUtil . newMimeMessage ( content . getAsString ( ) ) ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; }
|
public class ByteSort { /** * Swaps the elements at positions i and j . */
private static void swap ( byte [ ] array , int i , int j ) { } }
|
if ( i != j ) { byte valAtI = array [ i ] ; array [ i ] = array [ j ] ; array [ j ] = valAtI ; numSwaps ++ ; }
|
public class AbstractSpreadSheetDocumentRecordWriter { /** * This method closes the document and writes it into the OutputStream */
@ Override public synchronized void close ( Reporter reporter ) throws IOException { } }
|
try { this . officeWriter . close ( ) ; } finally { if ( this . currentReader != null ) { this . currentReader . close ( ) ; } }
|
public class ImageKit { /** * 将文件编码成base64格式
* @ param imageFile 图片文件对象
* @ return base64编码格式的字符串
* @ throws IOException */
public static String encodeBase64 ( File imageFile ) throws IOException { } }
|
BufferedImage bi = ImageIO . read ( imageFile ) ; String type = FileKit . getFileExtension ( imageFile ) . toLowerCase ( ) ; ByteArrayOutputStream baos = new ByteArrayOutputStream ( ) ; ImageIO . write ( bi , type , baos ) ; return Base64Kit . encode ( baos . toByteArray ( ) ) ;
|
public class EmbedBuilder { /** * Sets the Author of the embed . The author appears in the top left of the embed and can have a small
* image beside it along with the author ' s name being made clickable by way of providing a url .
* < p > < b > < a href = " http : / / i . imgur . com / JgZtxIM . png " > Example < / a > < / b >
* < p > < b > Uploading images with Embeds < / b >
* < br > When uploading an < u > image < / u >
* ( using { @ link net . dv8tion . jda . core . entities . MessageChannel # sendFile ( java . io . File , net . dv8tion . jda . core . entities . Message ) MessageChannel . sendFile ( . . . ) } )
* you can reference said image using the specified filename as URI { @ code attachment : / / filename . ext } .
* < p > < u > Example < / u >
* < pre > < code >
* MessageChannel channel ; / / = reference of a MessageChannel
* MessageBuilder message = new MessageBuilder ( ) ;
* EmbedBuilder embed = new EmbedBuilder ( ) ;
* InputStream file = new URL ( " https : / / http . cat / 500 " ) . openStream ( ) ;
* embed . setAuthor ( " Minn " , null , " attachment : / / cat . png " ) / / we specify this in sendFile as " cat . png "
* . setDescription ( " This is a cute cat : 3 " ) ;
* message . setEmbed ( embed . build ( ) ) ;
* channel . sendFile ( file , " cat . png " , message . build ( ) ) . queue ( ) ;
* < / code > < / pre >
* @ param name
* the name of the author of the embed . If this is not set , the author will not appear in the embed
* @ param url
* the url of the author of the embed
* @ param iconUrl
* the url of the icon for the author
* @ throws java . lang . IllegalArgumentException
* < ul >
* < li > If the length of { @ code url } is longer than { @ link net . dv8tion . jda . core . entities . MessageEmbed # URL _ MAX _ LENGTH } . < / li >
* < li > If the provided { @ code url } is not a properly formatted http or https url . < / li >
* < li > If the length of { @ code iconUrl } is longer than { @ link net . dv8tion . jda . core . entities . MessageEmbed # URL _ MAX _ LENGTH } . < / li >
* < li > If the provided { @ code iconUrl } is not a properly formatted http or https url . < / li >
* < / ul >
* @ return the builder after the author has been set */
public EmbedBuilder setAuthor ( String name , String url , String iconUrl ) { } }
|
// We only check if the name is null because its presence is what determines if the
// the author will appear in the embed .
if ( name == null ) { this . author = null ; } else { urlCheck ( url ) ; urlCheck ( iconUrl ) ; this . author = new MessageEmbed . AuthorInfo ( name , url , iconUrl , null ) ; } return this ;
|
public class JDBCPersistenceManagerImpl { /** * Creates tableName using the createTableStatement DDL .
* @ param tableName
* @ param createTableStatement
* @ throws SQLException */
private void createIfNotExists ( String tableName , String createTableStatement ) throws SQLException { } }
|
logger . entering ( CLASSNAME , "createIfNotExists" , new Object [ ] { tableName , createTableStatement } ) ; Connection conn = getConnection ( ) ; DatabaseMetaData dbmd = conn . getMetaData ( ) ; ResultSet rs = dbmd . getTables ( null , schema , tableName , null ) ; PreparedStatement ps = null ; if ( ! rs . next ( ) ) { logger . log ( Level . INFO , tableName + " table does not exists. Trying to create it." ) ; ps = conn . prepareStatement ( createTableStatement ) ; ps . executeUpdate ( ) ; } cleanupConnection ( conn , rs , ps ) ; logger . exiting ( CLASSNAME , "createIfNotExists" ) ;
|
public class Chainr { /** * Useful for testing and debugging .
* @ param input the input data to transform
* @ param to transform from the chainrSpec to end with : 0 based index exclusive
* @ param context optional tweaks that the consumer of the transform would like */
public Object transform ( int to , Object input , Map < String , Object > context ) { } }
|
return transform ( 0 , to , input , context ) ;
|
public class NeutralImporter { /** * { @ inheritDoc } */
public void startElement ( String namespaceURI , String localName , String name , Map < String , String > atts ) throws RepositoryException { } }
|
if ( contentImporter == null ) { switch ( NodeTypeRecognizer . recognize ( namespaceURI , name ) ) { case DOCVIEW : contentImporter = new DocumentViewImporter ( getParent ( ) , ancestorToSave , uuidBehavior , dataConsumer , nodeTypeDataManager , locationFactory , valueFactory , namespaceRegistry , accessManager , userState , context , repository , currentWorkspaceName ) ; break ; case SYSVIEW : contentImporter = new SystemViewImporter ( getParent ( ) , ancestorToSave , uuidBehavior , dataConsumer , nodeTypeDataManager , locationFactory , valueFactory , namespaceRegistry , accessManager , userState , context , repository , currentWorkspaceName ) ; break ; default : throw new IllegalStateException ( "There was an error during ascertaining the " + "type of document. First element " + namespaceURI + ":" + name ) ; } } contentImporter . startElement ( namespaceURI , localName , name , atts ) ;
|
public class aaakcdaccount { /** * Use this API to unset the properties of aaakcdaccount resources .
* Properties that need to be unset are specified in args array . */
public static base_responses unset ( nitro_service client , String kcdaccount [ ] , String args [ ] ) throws Exception { } }
|
base_responses result = null ; if ( kcdaccount != null && kcdaccount . length > 0 ) { aaakcdaccount unsetresources [ ] = new aaakcdaccount [ kcdaccount . length ] ; for ( int i = 0 ; i < kcdaccount . length ; i ++ ) { unsetresources [ i ] = new aaakcdaccount ( ) ; unsetresources [ i ] . kcdaccount = kcdaccount [ i ] ; } result = unset_bulk_request ( client , unsetresources , args ) ; } return result ;
|
public class StreamUtil { /** * Skips exactly bytesCount bytes in inputStream unless end of stream is reached first .
* @ param inputStream input stream to skip bytes from
* @ param bytesCount number of bytes to skip
* @ return number of skipped bytes
* @ throws IOException */
public static long skip ( final InputStream inputStream , final long bytesCount ) throws IOException { } }
|
Preconditions . checkNotNull ( inputStream ) ; Preconditions . checkArgument ( bytesCount >= 0 ) ; long toSkip = bytesCount ; while ( toSkip > 0 ) { final long skipped = inputStream . skip ( toSkip ) ; if ( skipped > 0 ) { toSkip -= skipped ; continue ; } if ( inputStream . read ( ) != - 1 ) { toSkip -- ; continue ; } return bytesCount - toSkip ; } return bytesCount ;
|
public class StreamsUtils { /** * < p > Generates a stream by validating the elements of an input stream one by one using the provided predicate . < / p >
* < p > An element of the input stream is said to be valid if the provided predicate returns true for this element . < / p >
* < p > A valid element is replaced in the returned stream by the application of the provided function for valid
* elements . A non - valid element is replaced by the other function . < / p >
* < p > A < code > NullPointerException < / code > will be thrown if one of the provided elements is null . < / p >
* @ param stream the stream to be validated . Will throw a < code > NullPointerException < / code > if < code > null < / code > .
* @ param validator the predicate used to validate the elements of the stream .
* Will throw a < code > NullPointerException < / code > if < code > null < / code > .
* @ param transformingIfValid the function applied to the valid elements .
* Will throw a < code > NullPointerException < / code > if < code > null < / code > .
* @ param transformingIfNotValid the function applied to the non - valid elements .
* Will throw a < code > NullPointerException < / code > if < code > null < / code > .
* @ param < E > the type of the elements of the input stream .
* @ param < R > the type of the elements of the returned stream .
* @ return the validated and transformed stream . */
public static < E , R > Stream < R > validate ( Stream < E > stream , Predicate < ? super E > validator , Function < ? super E , ? extends R > transformingIfValid , Function < ? super E , ? extends R > transformingIfNotValid ) { } }
|
Objects . requireNonNull ( stream ) ; Objects . requireNonNull ( validator ) ; Objects . requireNonNull ( transformingIfValid ) ; Objects . requireNonNull ( transformingIfNotValid ) ; ValidatingSpliterator . Builder < E , R > builder = new ValidatingSpliterator . Builder < > ( ) ; ValidatingSpliterator < E , R > spliterator = builder . with ( stream . spliterator ( ) ) . validatedBy ( validator ) . withValidFunction ( transformingIfValid ) . withNotValidFunction ( transformingIfNotValid ) . build ( ) ; return StreamSupport . stream ( spliterator , stream . isParallel ( ) ) . onClose ( stream :: close ) ;
|
public class AVObject { /** * generate a json string .
* @ return */
public String toJSONString ( ) { } }
|
return JSON . toJSONString ( this , ObjectValueFilter . instance , SerializerFeature . WriteClassName , SerializerFeature . DisableCircularReferenceDetect ) ;
|
public class CcgParse { /** * Gets all dependency structures populated during parsing , indexed
* by the word that projects the dependency .
* @ return */
public Multimap < Integer , DependencyStructure > getAllDependenciesIndexedByHeadWordIndex ( ) { } }
|
Multimap < Integer , DependencyStructure > map = HashMultimap . create ( ) ; for ( DependencyStructure dep : getAllDependencies ( ) ) { map . put ( dep . getHeadWordIndex ( ) , dep ) ; } return map ;
|
public class FormData { /** * Adds new form control .
* @ param control */
public void addControl ( Control control ) { } }
|
if ( controls == null ) { controls = new FormData . Controls ( ) ; } this . controls . add ( control ) ;
|
public class ContextManager { /** * Create a directory context .
* @ param env The JNDI environment to create the context with .
* @ param createTimestamp The timestamp to use as the creation timestamp for the { @ link TimedDirContext } .
* @ return The { @ link TimedDirContext } .
* @ throws NamingException If there was an issue binding to the LDAP server . */
private TimedDirContext createDirContext ( Hashtable < String , Object > env , long createTimestamp ) throws NamingException { } }
|
/* * Check if the credential is a protected string . It will be unprotected if this is an anonymous bind */
Object o = env . get ( Context . SECURITY_CREDENTIALS ) ; if ( o instanceof ProtectedString ) { // Reset the bindPassword to simple string .
ProtectedString sps = ( ProtectedString ) env . get ( Context . SECURITY_CREDENTIALS ) ; String password = sps == null ? "" : new String ( sps . getChars ( ) ) ; String decodedPassword = PasswordUtil . passwordDecode ( password . trim ( ) ) ; env . put ( Context . SECURITY_CREDENTIALS , decodedPassword ) ; } SSLUtilImpl sslUtil = new SSLUtilImpl ( ) ; Properties currentSSLProps = sslUtil . getSSLPropertiesOnThread ( ) ; try { if ( iSSLAlias != null ) { try { sslUtil . setSSLAlias ( iSSLAlias , env ) ; } catch ( Exception ssle ) { throw new NamingException ( ssle . getMessage ( ) ) ; } } /* * Set the classloader so that a class in the package can be loaded by JNDI */
ClassLoader origCL = getContextClassLoader ( ) ; setContextClassLoader ( getClass ( ) ) ; try { TimedDirContext ctx = new TimedDirContext ( env , getConnectionRequestControls ( ) , createTimestamp ) ; String newURL = getProviderURL ( ctx ) ; // Set the active URL if context pool is disabled ,
// otherwise active URL will be set when pool is refreshed
if ( ! iContextPoolEnabled ) if ( ! newURL . equalsIgnoreCase ( getActiveURL ( ) ) ) setActiveURL ( newURL ) ; return ctx ; } finally { setContextClassLoader ( origCL ) ; } } finally { sslUtil . setSSLPropertiesOnThread ( currentSSLProps ) ; }
|
public class BaseRxLcePresenter { /** * Subscribes the presenter himself as subscriber on the observable
* @ param observable The observable to subscribe
* @ param pullToRefresh Pull to refresh ? */
public void subscribe ( Observable < M > observable , final boolean pullToRefresh ) { } }
|
if ( isViewAttached ( ) ) { getView ( ) . showLoading ( pullToRefresh ) ; } unsubscribe ( ) ; subscriber = new Subscriber < M > ( ) { private boolean ptr = pullToRefresh ; @ Override public void onCompleted ( ) { BaseRxLcePresenter . this . onCompleted ( ) ; } @ Override public void onError ( Throwable e ) { BaseRxLcePresenter . this . onError ( e , ptr ) ; } @ Override public void onNext ( M m ) { BaseRxLcePresenter . this . onNext ( m ) ; } } ; observable . subscribeOn ( Schedulers . io ( ) ) . observeOn ( AndroidSchedulers . mainThread ( ) ) . subscribe ( subscriber ) ;
|
public class ExcelBase { /** * 获取或创建某一行的样式 , 返回样式后可以设置样式内容
* @ param x X坐标 , 从0计数 , 既列号
* @ return { @ link CellStyle }
* @ since 4.1.4 */
public CellStyle getOrCreateColumnStyle ( int x ) { } }
|
CellStyle columnStyle = this . sheet . getColumnStyle ( x ) ; if ( null == columnStyle ) { columnStyle = this . workbook . createCellStyle ( ) ; this . sheet . setDefaultColumnStyle ( x , columnStyle ) ; } return columnStyle ;
|
public class JobGraph { /** * Adds a new output vertex to the job graph if it is not already included .
* @ param outputVertex
* the new output vertex to be added */
public void addVertex ( final AbstractJobOutputVertex outputVertex ) { } }
|
if ( ! outputVertices . containsKey ( outputVertex . getID ( ) ) ) { outputVertices . put ( outputVertex . getID ( ) , outputVertex ) ; }
|
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link RasterReliefType } { @ code > }
* @ param value
* Java instance representing xml element ' s value .
* @ return
* the new instance of { @ link JAXBElement } { @ code < } { @ link RasterReliefType } { @ code > } */
@ XmlElementDecl ( namespace = "http://www.opengis.net/citygml/relief/1.0" , name = "RasterRelief" , substitutionHeadNamespace = "http://www.opengis.net/citygml/relief/1.0" , substitutionHeadName = "_ReliefComponent" ) public JAXBElement < RasterReliefType > createRasterRelief ( RasterReliefType value ) { } }
|
return new JAXBElement < RasterReliefType > ( _RasterRelief_QNAME , RasterReliefType . class , null , value ) ;
|
public class Order { /** * Compares the specified two entities .
* @ param entity1 An entity to be compared .
* @ param entity2 An entity to be compared .
* @ return The comparison result . */
@ Override public int compare ( E entity1 , E entity2 ) { } }
|
T value = property . get ( entity1 ) ; T value2 = property . get ( entity2 ) ; return value . compareTo ( value2 ) ;
|
public class MvcGraph { /** * Inject all fields annotated by { @ link Inject } . References of controllers will be
* incremented .
* @ param target The target object whose fields annotated by { @ link Inject } will be injected . */
public void inject ( final Object target ) { } }
|
if ( uiThreadRunner . isOnUiThread ( ) ) { try { graph . inject ( target , Inject . class ) ; } catch ( PokeException e ) { throw new MvcGraphException ( e . getMessage ( ) , e ) ; } } else { uiThreadRunner . post ( new Runnable ( ) { @ Override public void run ( ) { try { graph . inject ( target , Inject . class ) ; } catch ( PokeException e ) { throw new MvcGraphException ( e . getMessage ( ) , e ) ; } } } ) ; }
|
public class CPDefinitionUtil { /** * Returns the cp definitions before and after the current cp definition in the ordered set where companyId = & # 63 ; .
* @ param CPDefinitionId the primary key of the current cp definition
* @ param companyId the company ID
* @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > )
* @ return the previous , current , and next cp definition
* @ throws NoSuchCPDefinitionException if a cp definition with the primary key could not be found */
public static CPDefinition [ ] findByCompanyId_PrevAndNext ( long CPDefinitionId , long companyId , OrderByComparator < CPDefinition > orderByComparator ) throws com . liferay . commerce . product . exception . NoSuchCPDefinitionException { } }
|
return getPersistence ( ) . findByCompanyId_PrevAndNext ( CPDefinitionId , companyId , orderByComparator ) ;
|
public class SinkInfo { /** * Creates a { @ code SinkInfo } object given the name of the sink and its destination . */
public static SinkInfo of ( String name , Destination destination ) { } }
|
return new BuilderImpl ( name , destination ) . build ( ) ;
|
public class LinkedDirectedGraph { /** * DiGraphNode look ups can be expensive for a large graph operation , prefer the
* version below that takes DiGraphNodes , if you have them available . */
@ Override public boolean isConnectedInDirection ( N n1 , N n2 ) { } }
|
return isConnectedInDirection ( n1 , Predicates . < E > alwaysTrue ( ) , n2 ) ;
|
public class ServerParams { /** * Overrides the loaded / default settings by command line arguments . */
private void parseCommandLineArgs ( String [ ] args ) throws ConfigurationException { } }
|
if ( args == null || args . length == 0 ) { return ; } logger . info ( "Parsing command line arguments" ) ; m_commandLineArgs = args ; try { for ( int inx = 0 ; inx < args . length ; inx ++ ) { String arg = args [ inx ] ; if ( arg . equals ( "-?" ) || arg . equalsIgnoreCase ( "-h" ) || arg . equalsIgnoreCase ( "-help" ) ) { System . out . println ( "See documentation and doradus.yaml for help." ) ; System . exit ( 0 ) ; } Utils . require ( arg . charAt ( 0 ) == '-' , "Unrecognized argument: %s" , arg ) ; Utils . require ( inx + 1 < args . length , "A value is expected after: %s" , arg ) ; String name = arg . substring ( 1 ) ; String value = args [ ++ inx ] ; setCommandLineParam ( name , value ) ; } } catch ( Exception e ) { logger . error ( "Failed to parse command line arguments" , e ) ; throw new ConfigurationException ( "Failed to parse command line arguments" , e ) ; }
|
public class FileSystemRepository { /** * { @ inheritDoc } */
@ Override public List < String > listDocuments ( String location ) throws IOException { } }
|
File parent = fileAt ( location ) ; if ( ! parent . exists ( ) ) return Collections . emptyList ( ) ; List < String > names = new ArrayList < String > ( ) ; if ( parent . isDirectory ( ) ) { File [ ] files = parent . listFiles ( NOT_HIDDEN ) ; if ( files != null ) { for ( File child : files ) { if ( child . isDirectory ( ) ) { names . addAll ( listDocuments ( relativePath ( child ) ) ) ; } else if ( isSupported ( child ) ) { names . add ( relativePath ( child ) ) ; } } } } return names ;
|
public class CmsPropertyEditorHelper { /** * Saves a set of property changes . < p >
* @ param changes the set of property changes
* @ throws CmsException if something goes wrong */
public void saveProperties ( CmsPropertyChangeSet changes ) throws CmsException { } }
|
CmsObject cms = m_cms ; CmsUUID structureId = changes . getTargetStructureId ( ) ; if ( m_overrideStructureId != null ) { structureId = m_overrideStructureId ; } CmsResource resource = cms . readResource ( structureId , CmsResourceFilter . IGNORE_EXPIRATION ) ; CmsLockActionRecord actionRecord = CmsLockUtil . ensureLock ( cms , resource ) ; try { Map < String , CmsProperty > ownProps = getPropertiesByName ( cms . readPropertyObjects ( resource , false ) ) ; // determine if the title property should be changed in case of a ' NavText ' change
boolean changeOwnTitle = shouldChangeTitle ( ownProps ) ; String hasNavTextChange = null ; List < CmsProperty > ownPropertyChanges = new ArrayList < CmsProperty > ( ) ; for ( CmsPropertyModification propMod : changes . getChanges ( ) ) { if ( propMod . isFileNameProperty ( ) ) { // in case of the file name property , the resource needs to be renamed
if ( ( m_overrideStructureId == null ) && ! resource . getStructureId ( ) . equals ( propMod . getId ( ) ) ) { if ( propMod . getId ( ) != null ) { throw new IllegalStateException ( "Invalid structure id in property changes." ) ; } } CmsResource . checkResourceName ( propMod . getValue ( ) ) ; String oldSitePath = CmsFileUtil . removeTrailingSeparator ( cms . getSitePath ( resource ) ) ; String parentPath = CmsResource . getParentFolder ( oldSitePath ) ; String newSitePath = CmsFileUtil . removeTrailingSeparator ( CmsStringUtil . joinPaths ( parentPath , propMod . getValue ( ) ) ) ; if ( ! oldSitePath . equals ( newSitePath ) ) { cms . moveResource ( oldSitePath , newSitePath ) ; } // read the resource again to update name and path
resource = cms . readResource ( resource . getStructureId ( ) , CmsResourceFilter . IGNORE_EXPIRATION ) ; } else { CmsProperty propToModify = null ; if ( ( m_overrideStructureId != null ) || resource . getStructureId ( ) . equals ( propMod . getId ( ) ) ) { if ( CmsPropertyDefinition . PROPERTY_NAVTEXT . equals ( propMod . getName ( ) ) ) { hasNavTextChange = propMod . getValue ( ) ; } else if ( CmsPropertyDefinition . PROPERTY_TITLE . equals ( propMod . getName ( ) ) ) { changeOwnTitle = false ; } propToModify = ownProps . get ( propMod . getName ( ) ) ; if ( propToModify == null ) { propToModify = new CmsProperty ( propMod . getName ( ) , null , null ) ; } ownPropertyChanges . add ( propToModify ) ; } else { throw new IllegalStateException ( "Invalid structure id in property changes!" ) ; } String newValue = propMod . getValue ( ) ; if ( newValue == null ) { newValue = "" ; } if ( propMod . isStructureValue ( ) ) { propToModify . setStructureValue ( newValue ) ; } else { propToModify . setResourceValue ( newValue ) ; } } } if ( hasNavTextChange != null ) { if ( changeOwnTitle ) { CmsProperty titleProp = ownProps . get ( CmsPropertyDefinition . PROPERTY_TITLE ) ; if ( titleProp == null ) { titleProp = new CmsProperty ( CmsPropertyDefinition . PROPERTY_TITLE , null , null ) ; } titleProp . setStructureValue ( hasNavTextChange ) ; ownPropertyChanges . add ( titleProp ) ; } } if ( ! ownPropertyChanges . isEmpty ( ) ) { cms . writePropertyObjects ( resource , ownPropertyChanges ) ; } } finally { if ( actionRecord . getChange ( ) == LockChange . locked ) { cms . unlockResource ( resource ) ; } }
|
public class DeleteHandlerV1 { /** * Deletes the specified entity vertices .
* Deletes any traits , composite entities , and structs owned by each entity .
* Also deletes all the references from / to the entity .
* @ param instanceVertices
* @ throws AtlasException */
public void deleteEntities ( Collection < AtlasVertex > instanceVertices ) throws AtlasBaseException { } }
|
RequestContextV1 requestContext = RequestContextV1 . get ( ) ; Set < AtlasVertex > deletionCandidateVertices = new HashSet < > ( ) ; for ( AtlasVertex instanceVertex : instanceVertices ) { String guid = AtlasGraphUtilsV1 . getIdFromVertex ( instanceVertex ) ; AtlasEntity . Status state = AtlasGraphUtilsV1 . getState ( instanceVertex ) ; if ( state == AtlasEntity . Status . DELETED ) { LOG . debug ( "Skipping deletion of {} as it is already deleted" , guid ) ; continue ; } String typeName = AtlasGraphUtilsV1 . getTypeName ( instanceVertex ) ; AtlasObjectId objId = new AtlasObjectId ( guid , typeName ) ; if ( requestContext . getDeletedEntityIds ( ) . contains ( objId ) ) { LOG . debug ( "Skipping deletion of {} as it is already deleted" , guid ) ; continue ; } // Get GUIDs and vertices for all deletion candidates .
Set < GraphHelper . VertexInfo > compositeVertices = getOwnedVertices ( instanceVertex ) ; // Record all deletion candidate GUIDs in RequestContext
// and gather deletion candidate vertices .
for ( GraphHelper . VertexInfo vertexInfo : compositeVertices ) { requestContext . recordEntityDelete ( new AtlasObjectId ( vertexInfo . getGuid ( ) , vertexInfo . getTypeName ( ) ) ) ; deletionCandidateVertices . add ( vertexInfo . getVertex ( ) ) ; } } // Delete traits and vertices .
for ( AtlasVertex deletionCandidateVertex : deletionCandidateVertices ) { deleteAllTraits ( deletionCandidateVertex ) ; deleteTypeVertex ( deletionCandidateVertex , false ) ; }
|
public class ValidationResult { /** * Adds an warning .
* @ param desc Warning description
* @ param value the String that caused the warning
* @ param loc the location */
public void addWarning ( String desc , String value , String loc ) { } }
|
iaddWarning ( desc , value , loc ) ;
|
public class AuthnContextServiceImpl { /** * { @ inheritDoc } */
@ Override public String getReturnAuthnContextClassRef ( ProfileRequestContext < ? , ? > context , String authnContextUri , boolean displayedSignMessage ) throws ExternalAutenticationErrorCodeException { } }
|
AuthnContextClassContext authnContextContext = this . getAuthnContextClassContext ( context ) ; String uri = null ; if ( authnContextUri == null ) { if ( displayedSignMessage ) { uri = authnContextContext . getAuthnContextClassRefs ( ) . stream ( ) . filter ( u -> this . isSignMessageURI ( u ) ) . findFirst ( ) . orElse ( null ) ; } if ( uri == null ) { uri = ! authnContextContext . getAuthnContextClassRefs ( ) . isEmpty ( ) ? authnContextContext . getAuthnContextClassRefs ( ) . get ( 0 ) : null ; } } else { if ( displayedSignMessage ) { String sigMessageUri = this . toSignMessageURI ( authnContextUri ) ; uri = authnContextContext . getAuthnContextClassRefs ( ) . contains ( sigMessageUri ) ? sigMessageUri : null ; } if ( uri == null ) { uri = authnContextContext . getAuthnContextClassRefs ( ) . contains ( authnContextUri ) ? authnContextUri : null ; } } if ( uri == null ) { // This should never happen !
final String msg = "No AuthnContext URI:s can be used to authenticate user" ; log . info ( "{} - can not proceed [{}]" , msg , this . getLogString ( context ) ) ; throw new ExternalAutenticationErrorCodeException ( AuthnEventIds . REQUEST_UNSUPPORTED , msg ) ; } return uri ;
|
public class ContentCryptoMaterial { /** * Returns a new instance of < code > ContentCryptoMaterial < / code >
* for the input parameters using the specified s3 crypto scheme .
* Note network calls are involved if the CEK is to be protected by KMS .
* @ param cek content encrypting key
* @ param iv initialization vector
* @ param kekMaterials kek encryption material used to secure the CEK ;
* can be KMS enabled .
* @ param scheme
* s3 crypto scheme to be used for the content crypto material by
* providing the content crypto scheme , key wrapping scheme and
* mechanism for secure randomness
* @ param provider optional security provider
* @ param kms reference to the KMS client
* @ param req originating service request */
static ContentCryptoMaterial create ( SecretKey cek , byte [ ] iv , EncryptionMaterials kekMaterials , S3CryptoScheme scheme , Provider provider , AWSKMS kms , AmazonWebServiceRequest req ) { } }
|
return doCreate ( cek , iv , kekMaterials , scheme . getContentCryptoScheme ( ) , scheme , provider , kms , req ) ;
|
public class UtilEjml { /** * Give a string of numbers it returns a DenseMatrix */
public static DMatrixRMaj parse_DDRM ( String s , int numColumns ) { } }
|
String [ ] vals = s . split ( "(\\s)+" ) ; // there is the possibility the first element could be empty
int start = vals [ 0 ] . isEmpty ( ) ? 1 : 0 ; // covert it from string to doubles
int numRows = ( vals . length - start ) / numColumns ; DMatrixRMaj ret = new DMatrixRMaj ( numRows , numColumns ) ; int index = start ; for ( int i = 0 ; i < numRows ; i ++ ) { for ( int j = 0 ; j < numColumns ; j ++ ) { ret . set ( i , j , Double . parseDouble ( vals [ index ++ ] ) ) ; } } return ret ;
|
public class Equation { /** * Returns true if the specified name is NOT allowed . It isn ' t allowed if it matches a built in operator
* or if it contains a restricted character . */
protected boolean isReserved ( String name ) { } }
|
if ( functions . isFunctionName ( name ) ) return true ; for ( int i = 0 ; i < name . length ( ) ; i ++ ) { if ( ! isLetter ( name . charAt ( i ) ) ) return true ; } return false ;
|
public class ToStream { /** * Escape and writer . write a character .
* @ param ch character to be escaped .
* @ param i index into character array .
* @ param chars non - null reference to character array .
* @ param len length of chars .
* @ param fromTextNode true if the characters being processed are
* from a text node , false if the characters being processed are from
* an attribute value .
* @ param escLF true if the linefeed should be escaped .
* @ return i + 1 if a character was written , i + 2 if two characters
* were written out , else return i .
* @ throws org . xml . sax . SAXException */
private int accumDefaultEscape ( Writer writer , char ch , int i , char [ ] chars , int len , boolean fromTextNode , boolean escLF ) throws IOException { } }
|
int pos = accumDefaultEntity ( writer , ch , i , chars , len , fromTextNode , escLF ) ; if ( i == pos ) { if ( Encodings . isHighUTF16Surrogate ( ch ) ) { // Should be the UTF - 16 low surrogate of the hig / low pair .
char next ; // Unicode code point formed from the high / low pair .
int codePoint = 0 ; if ( i + 1 >= len ) { throw new IOException ( Utils . messages . createMessage ( MsgKey . ER_INVALID_UTF16_SURROGATE , new Object [ ] { Integer . toHexString ( ch ) } ) ) ; // " Invalid UTF - 16 surrogate detected : "
// + Integer . toHexString ( ch ) + " ? " ) ;
} else { next = chars [ ++ i ] ; if ( ! ( Encodings . isLowUTF16Surrogate ( next ) ) ) throw new IOException ( Utils . messages . createMessage ( MsgKey . ER_INVALID_UTF16_SURROGATE , new Object [ ] { Integer . toHexString ( ch ) + " " + Integer . toHexString ( next ) } ) ) ; // " Invalid UTF - 16 surrogate detected : "
// + Integer . toHexString ( ch ) + " " + Integer . toHexString ( next ) ) ;
codePoint = Encodings . toCodePoint ( ch , next ) ; } writer . write ( "&#" ) ; writer . write ( Integer . toString ( codePoint ) ) ; writer . write ( ';' ) ; pos += 2 ; // count the two characters that went into writing out this entity
} else { /* This if check is added to support control characters in XML 1.1.
* If a character is a Control Character within C0 and C1 range , it is desirable
* to write it out as Numeric Character Reference ( NCR ) regardless of XML Version
* being used for output document . */
if ( isCharacterInC0orC1Range ( ch ) || isNELorLSEPCharacter ( ch ) ) { writer . write ( "&#" ) ; writer . write ( Integer . toString ( ch ) ) ; writer . write ( ';' ) ; } else if ( ( ! escapingNotNeeded ( ch ) || ( ( fromTextNode && m_charInfo . shouldMapTextChar ( ch ) ) || ( ! fromTextNode && m_charInfo . shouldMapAttrChar ( ch ) ) ) ) && m_elemContext . m_currentElemDepth > 0 ) { writer . write ( "&#" ) ; writer . write ( Integer . toString ( ch ) ) ; writer . write ( ';' ) ; } else { writer . write ( ch ) ; } pos ++ ; // count the single character that was processed
} } return pos ;
|
public class Keyword { /** * getter for source - gets Tthe keyword source ( terminology ) , O
* @ generated
* @ return value of the feature */
public String getSource ( ) { } }
|
if ( Keyword_Type . featOkTst && ( ( Keyword_Type ) jcasType ) . casFeat_source == null ) jcasType . jcas . throwFeatMissing ( "source" , "de.julielab.jules.types.Keyword" ) ; return jcasType . ll_cas . ll_getStringValue ( addr , ( ( Keyword_Type ) jcasType ) . casFeatCode_source ) ;
|
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public EClass getIfcTransportElementType ( ) { } }
|
if ( ifcTransportElementTypeEClass == null ) { ifcTransportElementTypeEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 621 ) ; } return ifcTransportElementTypeEClass ;
|
public class Word2VecMore { /** * FAIL only counting min + max distance */
public Set < WordEntry > distanceMax ( String word ) { } }
|
float [ ] wordVector = getWordVector ( word ) ; if ( wordVector == null ) { return null ; } Set < Entry < String , float [ ] > > entrySet = vocabulary . entrySet ( ) ; float [ ] tempVector = null ; List < WordEntry > wordEntrys = new ArrayList < WordEntry > ( topNSize ) ; for ( Entry < String , float [ ] > entry : entrySet ) { String name = entry . getKey ( ) ; if ( name . equals ( word ) ) { continue ; } float minDist = 10 , maxDist = - 10 ; tempVector = entry . getValue ( ) ; for ( int i = 0 ; i < wordVector . length ; i ++ ) { maxDist = Math . max ( wordVector [ i ] * tempVector [ i ] , maxDist ) ; minDist = Math . min ( wordVector [ i ] * tempVector [ i ] , minDist ) ; } insertTopN ( name , maxDist + minDist , wordEntrys ) ; } return new TreeSet < WordEntry > ( wordEntrys ) ;
|
public class SARLJvmModelInferrer { /** * Append the SARL specification version as an annotation to the given container .
* < p > The added annotation may be used by any underground platform for determining what is
* the version of the SARL specification that was used for generating the container .
* @ param context the current generation context .
* @ param source the source object .
* @ param target the inferred JVM object . */
protected void appendSARLSpecificationVersion ( GenerationContext context , XtendTypeDeclaration source , JvmDeclaredType target ) { } }
|
addAnnotationSafe ( target , SarlSpecification . class , SARLVersion . SPECIFICATION_RELEASE_VERSION_STRING ) ;
|
public class Interval { /** * Returns the BigInteger result of calculating product for the range . */
private BigInteger bigIntegerProduct ( ) { } }
|
return this . injectInto ( BigInteger . valueOf ( 1L ) , new Function2 < BigInteger , Integer , BigInteger > ( ) { public BigInteger value ( BigInteger result , Integer each ) { return result . multiply ( BigInteger . valueOf ( each . longValue ( ) ) ) ; } } ) ;
|
public class CleverTapAPI { /** * Launches an asynchronous task to create the notification channel from CleverTap
* Use this method when implementing your own FCM / GCM handling mechanism . Refer to the
* SDK documentation for usage scenarios and examples .
* @ param context A reference to an Android context
* @ param channelId A String for setting the id of the notification channel
* @ param channelName A String for setting the name of the notification channel
* @ param channelDescription A String for setting the description of the notification channel
* @ param importance An Integer value setting the importance of the notifications sent in this channel
* @ param showBadge An boolean value as to whether this channel shows a badge */
@ SuppressWarnings ( "unused" ) public static void createNotificationChannel ( final Context context , final String channelId , final CharSequence channelName , final String channelDescription , final int importance , final boolean showBadge ) { } }
|
final CleverTapAPI instance = getDefaultInstanceOrFirstOther ( context ) ; if ( instance == null ) { Logger . v ( "No CleverTap Instance found in CleverTapAPI#createNotificatonChannel" ) ; return ; } try { if ( Build . VERSION . SDK_INT >= Build . VERSION_CODES . O ) { instance . postAsyncSafely ( "createNotificationChannel" , new Runnable ( ) { @ RequiresApi ( api = Build . VERSION_CODES . O ) @ Override public void run ( ) { NotificationManager notificationManager = ( NotificationManager ) context . getSystemService ( NOTIFICATION_SERVICE ) ; if ( notificationManager == null ) return ; NotificationChannel notificationChannel = new NotificationChannel ( channelId , channelName , importance ) ; notificationChannel . setDescription ( channelDescription ) ; notificationChannel . setShowBadge ( showBadge ) ; notificationManager . createNotificationChannel ( notificationChannel ) ; instance . getConfigLogger ( ) . info ( instance . getAccountId ( ) , "Notification channel " + channelName . toString ( ) + " has been created" ) ; } } ) ; } } catch ( Throwable t ) { instance . getConfigLogger ( ) . verbose ( instance . getAccountId ( ) , "Failure creating Notification Channel" , t ) ; }
|
public class CalendarApi { /** * List calendar event summaries ( asynchronously ) Get 50 event summaries
* from the calendar . If no from _ event ID is given , the resource will return
* the next 50 chronological event summaries from now . If a from _ event ID is
* specified , it will return the next 50 chronological event summaries from
* after that event - - - This route is cached for up to 5 seconds SSO Scope :
* esi - calendar . read _ calendar _ events . v1
* @ param characterId
* An EVE character ID ( required )
* @ param datasource
* The server name you would like data from ( optional , default to
* tranquility )
* @ param fromEvent
* The event ID to retrieve events from ( optional )
* @ param ifNoneMatch
* ETag from a previous request . A 304 will be returned if this
* matches the current ETag ( optional )
* @ param token
* Access token to use if unable to set a header ( optional )
* @ param callback
* The callback to be executed when the API call finishes
* @ return The request call
* @ throws ApiException
* If fail to process the API call , e . g . serializing the request
* body object */
public com . squareup . okhttp . Call getCharactersCharacterIdCalendarAsync ( Integer characterId , String datasource , Integer fromEvent , String ifNoneMatch , String token , final ApiCallback < List < CharacterCalendarResponse > > callback ) throws ApiException { } }
|
com . squareup . okhttp . Call call = getCharactersCharacterIdCalendarValidateBeforeCall ( characterId , datasource , fromEvent , ifNoneMatch , token , callback ) ; Type localVarReturnType = new TypeToken < List < CharacterCalendarResponse > > ( ) { } . getType ( ) ; apiClient . executeAsync ( call , localVarReturnType , callback ) ; return call ;
|
public class PublicSuffixDatabase { /** * Returns the effective top - level domain plus one ( eTLD + 1 ) by referencing the public suffix list .
* Returns null if the domain is a public suffix or a private address .
* < p > Here are some examples : < pre > { @ code
* assertEquals ( " google . com " , getEffectiveTldPlusOne ( " google . com " ) ) ;
* assertEquals ( " google . com " , getEffectiveTldPlusOne ( " www . google . com " ) ) ;
* assertNull ( getEffectiveTldPlusOne ( " com " ) ) ;
* assertNull ( getEffectiveTldPlusOne ( " localhost " ) ) ;
* assertNull ( getEffectiveTldPlusOne ( " mymacbook " ) ) ;
* } < / pre >
* @ param domain A canonicalized domain . An International Domain Name ( IDN ) should be punycode
* encoded . */
public String getEffectiveTldPlusOne ( String domain ) { } }
|
if ( domain == null ) throw new NullPointerException ( "domain == null" ) ; // We use UTF - 8 in the list so we need to convert to Unicode .
String unicodeDomain = IDN . toUnicode ( domain ) ; String [ ] domainLabels = unicodeDomain . split ( "\\." ) ; String [ ] rule = findMatchingRule ( domainLabels ) ; if ( domainLabels . length == rule . length && rule [ 0 ] . charAt ( 0 ) != EXCEPTION_MARKER ) { // The domain is a public suffix .
return null ; } int firstLabelOffset ; if ( rule [ 0 ] . charAt ( 0 ) == EXCEPTION_MARKER ) { // Exception rules hold the effective TLD plus one .
firstLabelOffset = domainLabels . length - rule . length ; } else { // Otherwise the rule is for a public suffix , so we must take one more label .
firstLabelOffset = domainLabels . length - ( rule . length + 1 ) ; } StringBuilder effectiveTldPlusOne = new StringBuilder ( ) ; String [ ] punycodeLabels = domain . split ( "\\." ) ; for ( int i = firstLabelOffset ; i < punycodeLabels . length ; i ++ ) { effectiveTldPlusOne . append ( punycodeLabels [ i ] ) . append ( '.' ) ; } effectiveTldPlusOne . deleteCharAt ( effectiveTldPlusOne . length ( ) - 1 ) ; return effectiveTldPlusOne . toString ( ) ;
|
public class InternalUtils { /** * Tell { @ link # getDecodedServletPath } ( and all that call it ) to ignore the attribute that specifies the Servlet
* Include path , which is set when a Servlet include is done through RequestDispatcher . Normally ,
* getDecodedServletPath tries the Servlet Include path before falling back to getServletPath ( ) on the request .
* Note that this is basically a stack of instructions to ignore the include path , and this method expects each
* call with < code > ignore < / code > = = < code > true < / code > to be balanced by a call with
* < code > ignore < / code > = = < code > false < / code > . */
public static void setIgnoreIncludeServletPath ( ServletRequest request , boolean ignore ) { } }
|
Integer depth = ( Integer ) request . getAttribute ( IGNORE_INCLUDE_SERVLET_PATH_ATTR ) ; if ( ignore ) { if ( depth == null ) depth = new Integer ( 0 ) ; request . setAttribute ( IGNORE_INCLUDE_SERVLET_PATH_ATTR , new Integer ( depth . intValue ( ) + 1 ) ) ; } else { assert depth != null : "call to setIgnoreIncludeServletPath() was imbalanced" ; depth = new Integer ( depth . intValue ( ) - 1 ) ; if ( depth . intValue ( ) == 0 ) { request . removeAttribute ( IGNORE_INCLUDE_SERVLET_PATH_ATTR ) ; } else { request . setAttribute ( IGNORE_INCLUDE_SERVLET_PATH_ATTR , depth ) ; } }
|
public class Validator { /** * Validates a given field to have a minimum length
* @ param name The field to check
* @ param minLength The minimum length
* @ param message A custom error message instead of the default one */
public void expectMin ( String name , double minLength , String message ) { } }
|
String value = Optional . ofNullable ( get ( name ) ) . orElse ( "" ) ; if ( StringUtils . isNumeric ( value ) ) { if ( Double . parseDouble ( value ) < minLength ) { addError ( name , Optional . ofNullable ( message ) . orElse ( messages . get ( Validation . MIN_KEY . name ( ) , name , minLength ) ) ) ; } } else { if ( value . length ( ) < minLength ) { addError ( name , Optional . ofNullable ( message ) . orElse ( messages . get ( Validation . MIN_KEY . name ( ) , name , minLength ) ) ) ; } }
|
public class RevokeInvitationRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( RevokeInvitationRequest revokeInvitationRequest , ProtocolMarshaller protocolMarshaller ) { } }
|
if ( revokeInvitationRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( revokeInvitationRequest . getUserArn ( ) , USERARN_BINDING ) ; protocolMarshaller . marshall ( revokeInvitationRequest . getEnrollmentId ( ) , ENROLLMENTID_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
|
public class AuthyUtil { /** * Loads your api _ key and api _ url properties from the given property file
* Two important things to have in mind here :
* 1 ) if api _ key and api _ url are defined as environment variables , they will be returned as the properties .
* 2 ) If you want to load your properties file have in mind your classloader path may change .
* @ return the Properties object containing the properties to setup Authy or an empty Properties object if no properties were found */
public static Properties loadProperties ( String path , Class cls ) { } }
|
Properties properties = new Properties ( ) ; // environment variables will always override properties file
try { InputStream in = cls . getResourceAsStream ( path ) ; // if we cant find the properties file
if ( in != null ) { properties . load ( in ) ; } // Env variables will always override properties
if ( System . getenv ( "api_key" ) != null && System . getenv ( "api_url" ) != null ) { properties . put ( "api_key" , System . getenv ( "api_key" ) ) ; properties . put ( "api_url" , System . getenv ( "api_url" ) ) ; } } catch ( IOException e ) { LOGGER . log ( Level . SEVERE , "Problems loading properties" , e ) ; } return properties ;
|
public class ShareResourcesImpl { /** * List shares of a given object .
* It mirrors to the following Smartsheet REST API method :
* GET / workspace / { id } / shares
* GET / sheet / { id } / shares
* GET / sights / { id } / shares
* GET / reports / { id } / shares
* Exceptions :
* InvalidRequestException : if there is any problem with the REST API request
* AuthorizationException : if there is any problem with the REST API authorization ( access token )
* ResourceNotFoundException : if the resource can not be found
* ServiceUnavailableException : if the REST API service is not available ( possibly due to rate limiting )
* SmartsheetRestException : if there is any other REST API related error occurred during the operation
* SmartsheetException : if there is any other error occurred during the operation
* @ param objectId the id of the object to share .
* @ param pagination the pagination parameters
* @ param includeWorkspaceShares include workspace shares in enumeration
* @ return the shares ( note that empty list will be returned if there is none )
* @ throws SmartsheetException the smartsheet exception */
public PagedResult < Share > listShares ( long objectId , PaginationParameters pagination ) throws SmartsheetException { } }
|
return this . listShares ( objectId , pagination , false ) ;
|
public class MiscSpec { /** * Check value stored in environment variable " is | matches | is higher than | is lower than | contains | | does not contain | is different from " to value provided
* @ param envVar
* @ param value */
@ Then ( "^'(?s)(.+?)' ((?!.*with).+?) '(.+?)'$" ) public void checkValue ( String envVar , String operation , String value ) throws Exception { } }
|
switch ( operation . toLowerCase ( ) ) { case "is" : Assertions . assertThat ( envVar ) . isEqualTo ( value ) ; break ; case "matches" : Assertions . assertThat ( envVar ) . matches ( value ) ; break ; case "is higher than" : if ( envVar . matches ( "^-?\\d+$" ) && value . matches ( "^-?\\d+$" ) ) { Assertions . assertThat ( Integer . parseInt ( envVar ) ) . isGreaterThan ( Integer . parseInt ( value ) ) ; } else { Fail . fail ( "A number should be provided in order to perform a valid comparison." ) ; } break ; case "is lower than" : if ( envVar . matches ( "^-?\\d+$" ) && value . matches ( "^-?\\d+$" ) ) { Assertions . assertThat ( Integer . parseInt ( envVar ) ) . isLessThan ( Integer . parseInt ( value ) ) ; } else { Fail . fail ( "A number should be provided in order to perform a valid comparison." ) ; } break ; case "contains" : Assertions . assertThat ( envVar ) . contains ( value ) ; break ; case "does not contain" : Assertions . assertThat ( envVar ) . doesNotContain ( value ) ; break ; case "is different from" : Assertions . assertThat ( envVar ) . isNotEqualTo ( value ) ; break ; default : Fail . fail ( "Not a valid comparison. Valid ones are: is | matches | is higher than | is lower than | contains | does not contain | is different from" ) ; }
|
public class FastdfsService { /** * 删除文件
* @ param fullFilename 文件路径
* @ return */
public int deleteFile ( String fullFilename ) { } }
|
int result = 1 ; TrackerServer trackerServer = null ; StorageClient1 storageClient1 = null ; try { trackerServer = fastDfsClientPool . borrowObject ( ) ; storageClient1 = new StorageClient1 ( trackerServer , null ) ; result = storageClient1 . deleteFile1 ( fullFilename ) ; } catch ( Exception e ) { throw Lang . makeThrow ( "[FastdfsService] delete file error : %s" , e . getMessage ( ) ) ; } finally { if ( trackerServer != null ) fastDfsClientPool . returnObject ( trackerServer ) ; storageClient1 = null ; } return result ;
|
public class InterceptorChain { /** * { @ inheritDoc } */
@ Override public Object proceed ( ) throws Exception { } }
|
Object rc = null ; // if there are more interceptors left in the chain , call the next one
if ( nextInterceptor < interceptors . size ( ) ) { rc = invokeNextInterceptor ( ) ; } else { // otherwise call proceed on the delegate InvocationContext
rc = delegateInvocationContext . proceed ( ) ; } return rc ;
|
public class MSPDIWriter { /** * This method writes project extended attribute data into an MSPDI file .
* @ param project Root node of the MSPDI file */
private void writeProjectExtendedAttributes ( Project project ) { } }
|
Project . ExtendedAttributes attributes = m_factory . createProjectExtendedAttributes ( ) ; project . setExtendedAttributes ( attributes ) ; List < Project . ExtendedAttributes . ExtendedAttribute > list = attributes . getExtendedAttribute ( ) ; Set < FieldType > customFields = new HashSet < FieldType > ( ) ; for ( CustomField customField : m_projectFile . getCustomFields ( ) ) { FieldType fieldType = customField . getFieldType ( ) ; if ( fieldType != null ) { customFields . add ( fieldType ) ; } } customFields . addAll ( m_extendedAttributesInUse ) ; List < FieldType > customFieldsList = new ArrayList < FieldType > ( ) ; customFieldsList . addAll ( customFields ) ; // Sort to ensure consistent order in file
final CustomFieldContainer customFieldContainer = m_projectFile . getCustomFields ( ) ; Collections . sort ( customFieldsList , new Comparator < FieldType > ( ) { @ Override public int compare ( FieldType o1 , FieldType o2 ) { CustomField customField1 = customFieldContainer . getCustomField ( o1 ) ; CustomField customField2 = customFieldContainer . getCustomField ( o2 ) ; String name1 = o1 . getClass ( ) . getSimpleName ( ) + "." + o1 . getName ( ) + " " + customField1 . getAlias ( ) ; String name2 = o2 . getClass ( ) . getSimpleName ( ) + "." + o2 . getName ( ) + " " + customField2 . getAlias ( ) ; return name1 . compareTo ( name2 ) ; } } ) ; for ( FieldType fieldType : customFieldsList ) { Project . ExtendedAttributes . ExtendedAttribute attribute = m_factory . createProjectExtendedAttributesExtendedAttribute ( ) ; list . add ( attribute ) ; attribute . setFieldID ( String . valueOf ( FieldTypeHelper . getFieldID ( fieldType ) ) ) ; attribute . setFieldName ( fieldType . getName ( ) ) ; CustomField customField = customFieldContainer . getCustomField ( fieldType ) ; attribute . setAlias ( customField . getAlias ( ) ) ; }
|
public class UsageMap { /** * Returns the first key in the map , the most recently used . If reverse
* order , then the least recently used is returned . */
public Object firstKey ( ) throws NoSuchElementException { } }
|
Entry first = ( mReverse ) ? mLeastRecent : mMostRecent ; if ( first != null ) { return first . mKey ; } else if ( mRecentMap . size ( ) == 0 ) { throw new NoSuchElementException ( ) ; } else { return null ; }
|
public class Client { /** * Returns a cursor of multi - datapoints specified by a series filter .
* < p > This endpoint allows one to request datapoints for multiple series in one call .
* The system default timezone is used for the returned DateTimes .
* @ param filter The series filter
* @ param interval An interval of time for the query ( start / end datetimes )
* @ return A Cursor of MultiDataPoints . The cursor . iterator ( ) . next ( ) may throw a { @ link TempoDBException } if an error occurs while making a request .
* @ see Cursor
* @ see Filter
* @ see MultiDataPoint
* @ since 1.1.0 */
public Cursor < MultiDataPoint > readMultiDataPoints ( Filter filter , Interval interval ) { } }
|
return readMultiDataPoints ( filter , interval , DateTimeZone . getDefault ( ) , null , null ) ;
|
public class Common { /** * Get an input stream to read the raw contents of the given resource , remember to close it : ) */
public static InputStream getResourceAsStream ( Class < ? > clazz , String fn ) throws IOException { } }
|
InputStream stream = clazz . getResourceAsStream ( fn ) ; if ( stream == null ) { throw new IOException ( "resource \"" + fn + "\" relative to " + clazz + " not found." ) ; } return unpackStream ( stream , fn ) ;
|
public class Try { /** * Construct a Failure instance from a throwable ( an implementation of Try )
* < pre >
* { @ code
* Failure < Exception > failure = Try . failure ( new RuntimeException ( ) ) ;
* < / pre >
* @ param error for Failure
* @ return new Failure with error */
public static < T , X extends Throwable > Try < T , X > failure ( final X error ) { } }
|
return new Try < > ( Either . left ( error ) , new Class [ 0 ] ) ;
|
public class ItemsPmfCdfImpl { /** * This one does a linear time simultaneous walk of the samples and splitPoints . Because this
* internal procedure is called multiple times , we require the caller to ensure these 3 properties :
* < ol >
* < li > samples array must be sorted . < / li >
* < li > splitPoints must be unique and sorted < / li >
* < li > number of SplitPoints + 1 = = counters . length < / li >
* < / ol >
* @ param < T > the data type
* @ param samples sorted array of samples
* @ param offset into samples array
* @ param numSamples number of samples in samples array
* @ param weight of the samples
* @ param splitPoints must be unique and sorted . Number of splitPoints + 1 = counters . length .
* @ param counters array of counters
* @ param comparator the comparator for data type T */
private static < T > void linearTimeIncrementHistogramCounters ( final T [ ] samples , final int offset , final int numSamples , final long weight , final T [ ] splitPoints , final double [ ] counters , final Comparator < ? super T > comparator ) { } }
|
int i = 0 ; int j = 0 ; while ( ( i < numSamples ) && ( j < splitPoints . length ) ) { if ( comparator . compare ( samples [ i + offset ] , splitPoints [ j ] ) < 0 ) { counters [ j ] += weight ; // this sample goes into this bucket
i ++ ; // move on to next sample and see whether it also goes into this bucket
} else { j ++ ; // no more samples for this bucket . move on the next bucket .
} } // now either i = = numSamples ( we are out of samples ) , or
// j = = numSplitPoints ( out of buckets , but there are more samples remaining )
// we only need to do something in the latter case .
if ( j == splitPoints . length ) { counters [ j ] += ( weight * ( numSamples - i ) ) ; }
|
public class FilteredTreeModel { /** * Fires a treeStructureChanged event
* @ param source The source
* @ param path The tree paths
* @ param childIndices The child indices
* @ param children The children */
protected void fireTreeStructureChanged ( Object source , Object [ ] path , int [ ] childIndices , Object [ ] children ) { } }
|
for ( TreeModelListener listener : treeModelListeners ) { listener . treeStructureChanged ( new TreeModelEvent ( source , path , childIndices , children ) ) ; }
|
public class InternalXbaseWithAnnotationsParser { /** * InternalXbaseWithAnnotations . g : 1916:1 : entryRuleJvmLowerBound : ruleJvmLowerBound EOF ; */
public final void entryRuleJvmLowerBound ( ) throws RecognitionException { } }
|
try { // InternalXbaseWithAnnotations . g : 1917:1 : ( ruleJvmLowerBound EOF )
// InternalXbaseWithAnnotations . g : 1918:1 : ruleJvmLowerBound EOF
{ if ( state . backtracking == 0 ) { before ( grammarAccess . getJvmLowerBoundRule ( ) ) ; } pushFollow ( FOLLOW_1 ) ; ruleJvmLowerBound ( ) ; state . _fsp -- ; if ( state . failed ) return ; if ( state . backtracking == 0 ) { after ( grammarAccess . getJvmLowerBoundRule ( ) ) ; } match ( input , EOF , FOLLOW_2 ) ; if ( state . failed ) return ; } } catch ( RecognitionException re ) { reportError ( re ) ; recover ( input , re ) ; } finally { } return ;
|
public class TextUtil { /** * Removes the index from the path if it has an index defined */
public static String removeIndexFromPath ( String path ) { } }
|
if ( path . endsWith ( "]" ) ) { int index = path . lastIndexOf ( '[' ) ; if ( index != - 1 ) { return path . substring ( 0 , index ) ; } } return path ;
|
public class DefaultHistoryManager { /** * ( non - Javadoc )
* @ see org . activiti . engine . impl . history . HistoryManagerInterface # recordTaskCategoryChange ( java . lang . String , java . lang . String ) */
@ Override public void recordTaskCategoryChange ( String taskId , String category ) { } }
|
if ( isHistoryLevelAtLeast ( HistoryLevel . AUDIT ) ) { HistoricTaskInstanceEntity historicTaskInstance = getHistoricTaskInstanceEntityManager ( ) . findById ( taskId ) ; if ( historicTaskInstance != null ) { historicTaskInstance . setCategory ( category ) ; } }
|
public class PowerComponent { /** * Checks if is powered of this { @ link IBlockState } .
* @ param state the state
* @ return true , if is powered */
public static boolean isPowered ( IBlockState state ) { } }
|
PowerComponent pc = IComponent . getComponent ( PowerComponent . class , state . getBlock ( ) ) ; if ( pc == null ) return false ; PropertyBool property = pc . getProperty ( ) ; if ( property == null || ! state . getProperties ( ) . containsKey ( property ) ) return false ; return state . getValue ( property ) ;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.