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...
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 , joi...
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 getUriStyleSh...
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 ( CmsExcepti...
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 (...
// 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 ...
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 scrollBut...
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 . up...
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 authent...
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 = ...
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 c...
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 = ...
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 lay...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "parsePrimaryHeader" , contextBuffer ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) JFapUtils . debugTraceWsByteBufferInfo ( this , tc , contextBuffer , "contextBuffer" ) ; if ( TraceCo...
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 ...
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 = curre...
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 ( describeInstanceAssociat...
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 prio...
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 /...
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 ) ...
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 ( ERRO...
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 mo...
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 ...
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 = authenticationR...
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 success...
return listMultiRolePoolInstanceMetricDefinitionsNextSinglePageAsync ( nextPageLink ) . concatMap ( new Func1 < ServiceResponse < Page < ResourceMetricDefinitionInner > > , Observable < ServiceResponse < Page < ResourceMetricDefinitionInner > > > > ( ) { @ Override public Observable < ServiceResponse < Page < ResourceM...
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 ...
Serializable serializable = entityCache . getResult ( CommerceDiscountRuleModelImpl . ENTITY_CACHE_ENABLED , CommerceDiscountRuleImpl . class , primaryKey ) ; if ( serializable == nullModel ) { return null ; } CommerceDiscountRule commerceDiscountRule = ( CommerceDiscountRule ) serializable ; if ( 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...
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...
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 ...
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 ma...
// 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 = combinab...
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 obje...
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 ) ) re...
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 ... elem...
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 ( BooleanLi...
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 ) *...
final long timeout = getPortletActionTimeout ( portletWindowId , request ) ; final IPortletExecutionWorker < Long > portletActionExecutionWorker = this . portletWorkerFactory . createActionWorker ( request , response , portletWindowId ) ; portletActionExecutionWorker . submit ( ) ; try { portletActionExecutionWorker . ...
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 . */ publi...
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...
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 < ...
// 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 ( ) )...
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 i...
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 , userS...
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 ] ; ...
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 In...
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 ; } ...
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 ...
Objects . requireNonNull ( stream ) ; Objects . requireNonNull ( validator ) ; Objects . requireNonNull ( transformingIfValid ) ; Objects . requireNonNull ( transformingIfNotValid ) ; ValidatingSpliterator . Builder < E , R > builder = new ValidatingSpliterator . Builder < > ( ) ; ValidatingSpliterator < E , R > splite...
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...
/* * 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 . SECURIT...
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 ) { BaseRxLceP...
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 > }...
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 ) ; }...
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 t...
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" ...
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...
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 . ensureLoc...
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 < A...
RequestContextV1 requestContext = RequestContextV1 . get ( ) ; Set < AtlasVertex > deletionCandidateVertices = new HashSet < > ( ) ; for ( AtlasVertex instanceVertex : instanceVertices ) { String guid = AtlasGraphUtilsV1 . getIdFromVertex ( instanceVertex ) ; AtlasEntity . Status state = AtlasGraphUtilsV1 . getState ( ...
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 ( ) . orEls...
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 initializati...
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...
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 * ...
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 >=...
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 : entr...
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 cont...
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 * ...
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 ( "createNotificationCh...
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 chronolog...
com . squareup . okhttp . Call call = getCharactersCharacterIdCalendarValidateBeforeCall ( characterId , datasource , fromEvent , ifNoneMatch , token , callback ) ; Type localVarReturnType = new TypeToken < List < CharacterCalendarResponse > > ( ) { } . getType ( ) ; apiClient . executeAsync ( call , localVarReturnType...
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 " , getEffective...
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 ( domainLa...
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 fal...
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 setIgnoreIncludeSer...
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 ...
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_BINDI...
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 h...
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 . ge...
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...
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 envV...
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 . assert...
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 . makeThr...
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 ( Cus...
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 i...
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 T...
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 mus...
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 { ...
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 , Objec...
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 ...
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 ) ;