signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class RectifyFundamental { /** * Finds the values of a , b , c which minimize * sum ( a * x ( + ) _ i + b * y ( + ) _ i + c - x ( - ) _ i ) ^ 2 * See page 306 * @ return Affine transform */ private SimpleMatrix computeAffineH ( List < AssociatedPair > observations , DMatrixRMaj H , DMatrixRMaj Hzero ) { } ...
SimpleMatrix A = new SimpleMatrix ( observations . size ( ) , 3 ) ; SimpleMatrix b = new SimpleMatrix ( A . numRows ( ) , 1 ) ; Point2D_F64 c = new Point2D_F64 ( ) ; Point2D_F64 k = new Point2D_F64 ( ) ; for ( int i = 0 ; i < observations . size ( ) ; i ++ ) { AssociatedPair a = observations . get ( i ) ; GeometryMath_...
public class DefaultShardManagerBuilder { /** * Removes all provided listeners from the list of listeners . * @ param listeners * The listener ( s ) to remove from the list . * @ return The DefaultShardManagerBuilder instance . Useful for chaining . * @ see net . dv8tion . jda . core . JDA # removeEventListener...
Checks . noneNull ( listeners , "listeners" ) ; this . listeners . removeAll ( listeners ) ; return this ;
public class DateTimeExtensions { /** * Creates a { @ link java . time . YearMonth } at the provided { @ link java . time . Year } . * @ param self a Month * @ param year a Year * @ return a YearMonth * @ since 2.5.0 */ public static YearMonth leftShift ( final Month self , Year year ) { } }
return YearMonth . of ( year . getValue ( ) , self ) ;
public class ProcessDefines { /** * Records the fact that because of the current node in the node traversal , the define can ' t ever * be assigned again . * @ param info Represents the define variable . * @ param t The current traversal . */ private static void setDefineInfoNotAssignable ( DefineInfo info , Node...
info . setNotAssignable ( format ( REASON_DEFINE_NOT_ASSIGNABLE , t . getLineNumber ( ) , t . getSourceName ( ) ) ) ;
public class AWSStorageGatewayClient { /** * Returns information about the upload buffer of a gateway . This operation is supported for the stored volume , * cached volume and tape gateway types . * The response includes disk IDs that are configured as upload buffer space , and it includes the amount of upload * ...
request = beforeClientExecution ( request ) ; return executeDescribeUploadBuffer ( request ) ;
public class CommerceAccountUserRelUtil { /** * Returns the first commerce account user rel in the ordered set where commerceAccountUserId = & # 63 ; . * @ param commerceAccountUserId the commerce account user ID * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) ...
return getPersistence ( ) . fetchByCommerceAccountUserId_First ( commerceAccountUserId , orderByComparator ) ;
public class XfdfReader { /** * Called when a start tag is found . * @ param tag the tag name * @ param h the tag ' s attributes */ public void startElement ( String tag , HashMap h ) { } }
if ( ! foundRoot ) { if ( ! tag . equals ( "xfdf" ) ) { throw new RuntimeException ( "Root element is not Bookmark." ) ; } else { foundRoot = true ; } } if ( tag . equals ( "xfdf" ) ) { } else if ( tag . equals ( "f" ) ) { fileSpec = ( String ) h . get ( "href" ) ; } else if ( tag . equals ( "fields" ) ) { fields = new...
public class GetTemplateResult { /** * The stage of the template that you can retrieve . For stacks , the < code > Original < / code > and < code > Processed < / code > * templates are always available . For change sets , the < code > Original < / code > template is always available . After * AWS CloudFormation fin...
if ( stagesAvailable == null ) { this . stagesAvailable = null ; return ; } this . stagesAvailable = new com . amazonaws . internal . SdkInternalList < String > ( stagesAvailable ) ;
public class AuthenticateUserHelper { /** * Authenticate the given user and return an authenticated Subject . * @ param authenticationService service to authenticate a user , must not be null * @ param userName the user to authenticate , must not be null * @ param jaasEntryName the optional JAAS configuration ent...
validateInput ( authenticationService , userName ) ; if ( jaasEntryName == null || jaasEntryName . trim ( ) . isEmpty ( ) ) jaasEntryName = JaasLoginConfigConstants . SYSTEM_DEFAULT ; Subject partialSubject = createPartialSubject ( userName , authenticationService , customCacheKey ) ; return authenticationService . aut...
public class Settings { /** * Loads a property of the type String from the Properties object * @ param propertyKey * the property name * @ return the value */ private String loadStringProperty ( String propertyKey ) { } }
String propValue = prop . getProperty ( propertyKey ) ; if ( propValue != null ) { propValue = propValue . trim ( ) ; } return propValue ;
public class ZuulFilterChainHandler { /** * channel close . . resulting in an i / o exception */ private boolean isClientChannelClosed ( Throwable cause ) { } }
if ( cause instanceof ClosedChannelException || cause instanceof Errors . NativeIoException ) { LOG . error ( "ZuulFilterChainHandler::isClientChannelClosed - IO Exception" ) ; return true ; } return false ;
public class FirstPartyAudienceSegmentRule { /** * Gets the customCriteriaRule value for this FirstPartyAudienceSegmentRule . * @ return customCriteriaRule * Specifies the collection of custom criteria that are part of * the rule of a * { @ link FirstPartyAudienceSegment } . * Once the { @ link FirstPartyAudien...
return customCriteriaRule ;
public class IPv6Address { /** * Subtraction . Will never underflow , but wraps around when the lowest ip address has been reached . * @ param value value to substract * @ return new IPv6 address */ public IPv6Address subtract ( int value ) { } }
final long newLowBits = lowBits - value ; if ( value >= 0 ) { if ( IPv6AddressHelpers . isLessThanUnsigned ( lowBits , newLowBits ) ) { // oops , we subtracted something postive and the result is bigger - > overflow detected ( carry over one bit from high to low ) return new IPv6Address ( highBits - 1 , newLowBits ) ; ...
public class WebApp { /** * Add a servlet mapping . * @ param servletMapping to add * @ throws NullArgumentException if servlet mapping , servlet name or url pattern is null */ public void addServletMapping ( final WebAppServletMapping servletMapping ) { } }
NullArgumentException . validateNotNull ( servletMapping , "Servlet mapping" ) ; NullArgumentException . validateNotNull ( servletMapping . getServletName ( ) , "Servlet name" ) ; NullArgumentException . validateNotNull ( servletMapping . getUrlPattern ( ) , "Url pattern" ) ; Set < WebAppServletMapping > webAppServletM...
public class JVMCollector { /** * 收集信息 */ public static JvmMData collect ( ) { } }
JvmMData JVMMData = new JvmMData ( ) ; // memory Map < String , Object > memoryMap = JVMMonitor . getAttribute ( JVMConstants . JMX_JVM_MEMORY_NAME , getAttributeList ( JVMMemoryMBean . class ) ) ; JVMMData . setMemoryMap ( memoryMap ) ; // gc Map < String , Object > gcMap = JVMMonitor . getAttribute ( JVMConstants . J...
public class WebSocketScopeManager { /** * Removes a websocket scope . * @ param webSocketScope */ public void removeWebSocketScope ( WebSocketScope webSocketScope ) { } }
log . info ( "removeWebSocketScope: {}" , webSocketScope ) ; WebSocketScope wsScope = scopes . remove ( webSocketScope . getPath ( ) ) ; if ( wsScope != null ) { notifyListeners ( WebSocketEvent . SCOPE_REMOVED , wsScope ) ; }
public class Humanize { /** * Parses the given text with the mask specified . * @ param mask * The pattern mask . * @ param value * The text to be parsed * @ return The parsed text * @ throws ParseException * @ see MaskFormat */ public static String unmask ( final String mask , final String value ) throws...
return maskFormat ( mask ) . parse ( value ) ;
public class NoteController { /** * Connects HTML template file with data for the source page . * @ param idString id URL argument . * @ param dbName name of database for the lookup . * @ param model Spring connection between the data model wrapper . * @ return a string identifying which HTML template to use . ...
logger . debug ( "Entering source" ) ; final Root root = fetchRoot ( dbName ) ; final RenderingContext context = createRenderingContext ( ) ; final Note note = ( Note ) root . find ( idString ) ; if ( note == null ) { throw new NoteNotFoundException ( "Note " + idString + " not found" , idString , dbName , context ) ; ...
public class PageDto { /** * Returns the elements of the page . < br > * If the serialized page was read with the Jackson JSON processor , each * element will be a { @ link LinkedHashMap } . * @ return the elements of the page */ @ XmlElementWrapper ( name = "entries" ) @ XmlElement ( name = "entry" , nillable = ...
return entries ;
public class DatabaseDAODefaultImpl { public void put_class_attribute_property ( Database database , String classname , DbAttribute [ ] attr ) throws DevFailed { } }
if ( ! database . isAccess_checked ( ) ) checkAccess ( database ) ; DeviceData argIn = new DeviceData ( ) ; argIn . insert ( ApiUtil . toStringArray ( classname , attr , 2 ) ) ; command_inout ( database , "DbPutClassAttributeProperty2" , argIn ) ;
public class ResponseUtil { /** * the default rule set for general import an export features */ public static MappingRules getDefaultJsonMapping ( ) { } }
return new MappingRules ( MappingRules . getDefaultMappingRules ( ) . MAPPING_NODE_FILTER , MappingRules . MAPPING_EXPORT_FILTER , MappingRules . MAPPING_IMPORT_FILTER , new MappingRules . PropertyFormat ( MappingRules . PropertyFormat . Scope . definition , MappingRules . PropertyFormat . Binary . link ) , 0 , Mapping...
public class AssetsConfiguration { /** * A series of mappings from resource paths ( in the classpath ) * to the uri path that hosts the resource * @ return The resourcePathToUriMappings . */ public Map < String , String > getResourcePathToUriMappings ( ) { } }
if ( resourcePathToUriMappings == null ) { ImmutableMap . Builder < String , String > mapBuilder = ImmutableMap . < String , String > builder ( ) ; // Ensure that resourcePath and uri ends with a ' / ' for ( Map . Entry < String , String > mapping : mappings ( ) . entrySet ( ) ) { mapBuilder . put ( ensureEndsWithSlash...
public class DoublesUnionImpl { /** * Returns a Heap DoublesUnion object that has been initialized with the data from the given * Memory image of a DoublesSketch . The srcMem object will not be modified and a reference to * it is not retained . The < i > maxK < / i > of the resulting union will be that obtained fro...
final HeapUpdateDoublesSketch sketch = HeapUpdateDoublesSketch . heapifyInstance ( srcMem ) ; final DoublesUnionImpl union = new DoublesUnionImpl ( sketch . getK ( ) ) ; union . gadget_ = sketch ; return union ;
public class Collections3 { /** * Gets the only element from a given map or throws an exception * @ param map the map to get only entry from * @ param < K > the key type * @ param < V > the value type * @ return the single entry contained in the map * @ throws NoSuchElementException if the map is empty * @ ...
checkArgument ( map != null , "Expected non-null map" ) ; return getOnlyElement ( map . entrySet ( ) ) ;
public class BindDaoBuilder { /** * ( non - Javadoc ) * @ see * com . abubusoft . kripton . processor . sqlite . model . SQLiteModelElementVisitor # * visit ( com . abubusoft . kripton . processor . sqlite . model . SQLiteDaoDefinition ) */ @ Override public void visit ( SQLiteDaoDefinition value ) throws Excepti...
currentDaoDefinition = value ; // check if we need to generate or not if ( value . getElement ( ) . getAnnotation ( BindDaoMany2Many . class ) != null && value . getElement ( ) . getAnnotation ( BindGeneratedDao . class ) == null ) { return ; } String classTableName = daoName ( value ) ; PackageElement pkg = elementUti...
public class AbstractBeanDefinition { /** * Obtains a value for the given method argument . * @ param resolutionContext The resolution context * @ param context The bean context * @ param methodIndex The method index * @ param argIndex The argument index * @ return The value */ @ Internal @ UsedByGeneratedCod...
if ( context instanceof ApplicationContext ) { MethodInjectionPoint injectionPoint = methodInjectionPoints . get ( methodIndex ) ; Argument argument = injectionPoint . getArguments ( ) [ argIndex ] ; String valueAnnStr = argument . getAnnotationMetadata ( ) . getValue ( Value . class , String . class ) . orElse ( null ...
public class BaseNCodecInputStream { /** * Reads one < code > byte < / code > from this input stream . * @ return the byte as an integer in the range 0 to 255 . Returns - 1 if EOF has been reached . * @ throws IOException * if an I / O error occurs . */ @ Override public int read ( ) throws IOException { } }
int r = read ( singleByte , 0 , 1 ) ; while ( r == 0 ) { r = read ( singleByte , 0 , 1 ) ; } if ( r > 0 ) { final byte b = singleByte [ 0 ] ; return b < 0 ? 256 + b : b ; } return EOF ;
public class SwiftInputStream { /** * close the stream * @ param msg close message * @ param length length */ private void closeStream ( String msg , long length ) { } }
if ( wrappedStream != null ) { long remaining = remainingInCurrentRequest ( ) ; boolean shouldAbort = remaining > readahead ; if ( ! shouldAbort ) { try { wrappedStream . close ( ) ; } catch ( IOException e ) { LOG . debug ( "When closing {} stream for {}" , uri , msg , e ) ; shouldAbort = true ; } } if ( shouldAbort )...
public class Commit { /** * A list of parent commits for the specified commit . Each parent commit ID is the full commit ID . * @ param parents * A list of parent commits for the specified commit . Each parent commit ID is the full commit ID . */ public void setParents ( java . util . Collection < String > parents ...
if ( parents == null ) { this . parents = null ; return ; } this . parents = new java . util . ArrayList < String > ( parents ) ;
public class MediaClient { /** * Creates a new transcoder job which converts media files in BOS buckets with specified preset , watermarkId , and * delogoArea . * @ param pipelineName The name of pipeline used by this job . * @ param sourceKey The key of the source media file in the bucket specified in the pipeli...
CreateTranscodingJobRequest request = new CreateTranscodingJobRequest ( ) ; request . setPipelineName ( pipelineName ) ; Source source = new Source ( ) ; source . setSourceKey ( sourceKey ) ; request . setSource ( source ) ; Target target = new Target ( ) ; target . setTargetKey ( targetKey ) ; target . setPresetName (...
public class CmsSearchConfiguration { /** * Propagates the names of all facets to each single facet . */ private void propagateFacetNames ( ) { } }
// collect all names and configurations Collection < String > facetNames = new ArrayList < String > ( ) ; Collection < I_CmsSearchConfigurationFacet > facetConfigs = new ArrayList < I_CmsSearchConfigurationFacet > ( ) ; facetNames . addAll ( m_fieldFacets . keySet ( ) ) ; facetConfigs . addAll ( m_fieldFacets . values ...
public class MiniMaxNNChain { /** * Uses NNChain as in " Modern hierarchical , agglomerative clustering * algorithms " by Daniel Müllner * @ param mat distance matrix * @ param prots computed prototypes * @ param dq distance query of the data set * @ param builder Result builder * @ param clusters current ...
final DBIDArrayIter ix = mat . ix ; final double [ ] distances = mat . matrix ; final int size = mat . size ; // The maximum chain size = number of ids + 1 IntegerArray chain = new IntegerArray ( size + 1 ) ; FiniteProgress progress = LOG . isVerbose ( ) ? new FiniteProgress ( "Running MiniMax-NNChain" , size - 1 , LOG...
public class DSLMapWalker { /** * src / main / resources / org / drools / compiler / lang / dsl / DSLMapWalker . g : 162:1 : consequence _ key : VT _ CONSEQUENCE ; */ public final void consequence_key ( ) throws RecognitionException { } }
try { // src / main / resources / org / drools / compiler / lang / dsl / DSLMapWalker . g : 163:5 : ( VT _ CONSEQUENCE ) // src / main / resources / org / drools / compiler / lang / dsl / DSLMapWalker . g : 163:7 : VT _ CONSEQUENCE { match ( input , VT_CONSEQUENCE , FOLLOW_VT_CONSEQUENCE_in_consequence_key524 ) ; entry...
public class HistoryReference { /** * Delete this HistoryReference from database * This should typically only be called via the ExtensionHistory . delete ( href ) method */ public void delete ( ) { } }
if ( historyId > 0 ) { try { // ZAP : Support for multiple tags staticTableTag . deleteTagsForHistoryID ( historyId ) ; staticTableHistory . delete ( historyId ) ; notifyEvent ( HistoryReferenceEventPublisher . EVENT_REMOVED ) ; } catch ( DatabaseException e ) { log . error ( e . getMessage ( ) , e ) ; } }
public class NodeTypeImpl { /** * { @ inheritDoc } */ public NodeType [ ] getSupertypes ( ) { } }
Set < InternalQName > supers = nodeTypeDataManager . getSupertypes ( nodeTypeData . getName ( ) ) ; NodeType [ ] superTypes = new NodeType [ supers . size ( ) ] ; int i = 0 ; for ( InternalQName nodeTypeName : supers ) { try { superTypes [ i ++ ] = nodeTypeManager . findNodeType ( nodeTypeName ) ; } catch ( NoSuchNodeT...
public class FiniteProgress { /** * Ensure that the progress was completed , to make progress bars disappear * @ param logger Logger to report to . */ public void ensureCompleted ( Logging logger ) { } }
if ( ! isComplete ( ) ) { logger . warning ( "Progress had not completed automatically as expected: " + getProcessed ( ) + "/" + total , new Throwable ( ) ) ; setProcessed ( getTotal ( ) ) ; logger . progress ( this ) ; }
public class IPAddress { /** * Creates the normalized string for an address without having to create the address objects first . */ protected static String toNormalizedString ( PrefixConfiguration prefixConfiguration , SegmentValueProvider lowerValueProvider , SegmentValueProvider upperValueProvider , Integer prefixLen...
int length = toNormalizedString ( prefixConfiguration , lowerValueProvider , upperValueProvider , prefixLength , segmentCount , bytesPerSegment , bitsPerSegment , segmentMaxValue , separator , radix , zone , null ) ; StringBuilder builder = new StringBuilder ( length ) ; toNormalizedString ( prefixConfiguration , lower...
public class BooleanCondition { /** * { @ inheritDoc } */ @ Override public synchronized BooleanQuery doQuery ( Schema schema ) { } }
int oldMaxClauses = BooleanQuery . getMaxClauseCount ( ) ; BooleanQuery . setMaxClauseCount ( maxClauses ) ; BooleanQuery . Builder builder = new BooleanQuery . Builder ( ) ; must . forEach ( condition -> builder . add ( condition . query ( schema ) , MUST ) ) ; should . forEach ( condition -> builder . add ( condition...
public class MPP12Reader { /** * This method extracts and collates the value list information * for custom column value lists . */ private void processCustomValueLists ( ) throws IOException { } }
DirectoryEntry taskDir = ( DirectoryEntry ) m_projectDir . getEntry ( "TBkndTask" ) ; Props taskProps = new Props12 ( m_inputStreamFactory . getInstance ( taskDir , "Props" ) ) ; CustomFieldValueReader12 reader = new CustomFieldValueReader12 ( m_file . getProjectProperties ( ) , m_file . getCustomFields ( ) , m_outline...
public class QuickSelect { /** * QuickSelect is essentially quicksort , except that we only " sort " that half * of the array that we are interested in . * Note : the array is < b > modified < / b > by this . * @ param data Data to process * @ param rank Rank position that we are interested in ( integer ! ) *...
quickSelect ( data , 0 , data . length , rank ) ; return data [ rank ] ;
public class AmazonGuardDutyClient { /** * Deletes a Amazon GuardDuty detector specified by the detector ID . * @ param deleteDetectorRequest * @ return Result of the DeleteDetector operation returned by the service . * @ throws BadRequestException * 400 response * @ throws InternalServerErrorException * 50...
request = beforeClientExecution ( request ) ; return executeDeleteDetector ( request ) ;
public class NfsFileBase { /** * ( non - Javadoc ) * @ see * com . emc . ecs . nfsclient . nfs . NfsFile # makeMkdirRequest ( com . emc . ecs . nfsclient . * nfs . NfsSetAttributes ) */ public NfsMkdirRequest makeMkdirRequest ( NfsSetAttributes attributes ) throws IOException { } }
return getNfs ( ) . makeMkdirRequest ( getParentFile ( ) . getFileHandle ( ) , getName ( ) , attributes ) ;
public class ClassCache { /** * Initializes the cache . */ protected void initialize ( ClassTraversal traversal ) { } }
Listener listener ; listener = new Listener ( ) ; traversal . traverse ( listener ) ; m_NameCache = listener . getNameCache ( ) ;
public class JdbcWriter { /** * Resets the database connection after an error , if automatic reconnection is enabled . */ private void resetConnection ( ) { } }
if ( reconnect ) { closeConnectionSilently ( ) ; statement = null ; lostCount = batch ? batchCount : 1 ; batchCount = 0 ; reconnectTimestamp = 0 ; }
import java . util . ArrayList ; import java . util . List ; public class UpdatedRunLengthEncoding { /** * Function to represent the revised run - length encoding from a list . * Example : * > > > updated _ run _ length _ encoding ( [ 1 , 1 , 2 , 3 , 4 , 4 , 5 , 1 ] ) * [ [ 2 , 1 ] , 2 , 3 , [ 2 , 4 ] , 5 , 1] ...
List < Object > resultList = new ArrayList < > ( ) ; int count = 1 ; for ( int i = 1 ; i <= inputList . size ( ) ; i ++ ) { if ( i < inputList . size ( ) && inputList . get ( i ) . equals ( inputList . get ( i - 1 ) ) ) { count ++ ; } else if ( count > 1 ) { List < Object > temp = new ArrayList < > ( ) ; temp . add ( c...
public class AbstractListenerLmlTag { /** * Invoked after template parsing . Hooks up the listener to actors registered by " attachTo " attribute . * @ param parser parsed the template . * @ param parsingResult parsed actors . * @ return { @ link LmlParserListener # REMOVE } by default . See { @ link # setKeepLis...
final ObjectMap < String , Actor > actorsByIds = parser . getActorsMappedByIds ( ) ; for ( final String id : ids ) { final Actor actor = actorsByIds . get ( id ) ; if ( actor != null ) { attachListener ( actor ) ; } else if ( ! keep ) { parser . throwErrorIfStrict ( "Unknown ID: '" + id + "'. Cannot attach listener." )...
public class BTreeIndex { /** * Processes a Page Split result . The first split page will replace the existing page , while the remaining pages * will need to be inserted as children into the parent . * @ param splitResult The result of the original BTreePage ' s splitIfNecessary ( ) call . * @ param context Proc...
PageWrapper originalPage = context . getPageWrapper ( ) ; for ( int i = 0 ; i < splitResult . size ( ) ; i ++ ) { val page = splitResult . get ( i ) ; ByteArraySegment newPageKey ; long newOffset ; long minOffset ; PageWrapper processedPage ; if ( i == 0 ) { // The original page will be replaced by the first split . No...
public class CTFileQueryBond { /** * Create a CTFileQueryBond of the specified type ( from the MDL spec ) . The * bond copies the atoms and sets the type using the value ' type ' , 5 = single * or double , 8 = any , etc . * @ param bond an existing bond * @ param type the specified type * @ return a new CTFil...
CTFileQueryBond queryBond = new CTFileQueryBond ( bond . getBuilder ( ) ) ; queryBond . setOrder ( Order . UNSET ) ; queryBond . setAtoms ( new IAtom [ ] { bond . getBegin ( ) , bond . getEnd ( ) } ) ; switch ( type ) { case 1 : queryBond . setType ( Type . SINGLE ) ; break ; case 2 : queryBond . setType ( Type . DOUBL...
public class RedisMonitor { /** * 内存信息 * @ return */ public static JSONArray monitorForMemory ( ) { } }
Map < String , Cache > CACHE = Redis . unmodifiableCache ( ) ; JSONArray monitors = new JSONArray ( ) ; if ( CACHE == null || CACHE . isEmpty ( ) ) return monitors ; JSONObject monitor = new JSONObject ( ) ; monitor . put ( "application" , EnvUtil . getApplication ( ) ) ; monitor . put ( "nodeId" , LocalNodeManager . L...
public class GroupReduceFunction { /** * The combine methods pre - reduces elements . It may be called on subsets of the data * before the actual reduce function . This is often helpful to lower data volume prior * to reorganizing the data in an expensive way , as might be required for the final * reduce function...
@ SuppressWarnings ( "unchecked" ) Collector < OUT > c = ( Collector < OUT > ) out ; reduce ( values , c ) ;
public class MousePlugin { /** * Method called when mouse down occur on the element . * You should not override this method . Instead , override { @ link # mouseStart ( Element , GqEvent ) } * method . */ protected boolean mouseDown ( Element element , GqEvent event ) { } }
// test if an other plugin handle the mouseStart if ( isEventAlreadyHandled ( event ) ) { return false ; } if ( started ) { // case where we missed a mouseup mouseUp ( element , event ) ; } // calculate all interesting variables reset ( event ) ; if ( notHandleMouseDown ( element , event ) ) { return true ; } if ( dela...
public class ClosureRewriteModule { /** * In module " foo . Bar " , rewrite " exports = Bar " to " var module $ exports $ foo $ Bar = Bar " . */ private void maybeUpdateExportDeclaration ( NodeTraversal t , Node n ) { } }
if ( ! currentScript . isModule || ! n . getString ( ) . equals ( "exports" ) || ! isAssignTarget ( n ) ) { return ; } Node assignNode = n . getParent ( ) ; if ( ! currentScript . declareLegacyNamespace && currentScript . defaultExportLocalName != null ) { assignNode . getParent ( ) . detach ( ) ; return ; } // Rewrite...
public class Shutterbug { /** * To be used when screen shooting the page * and need to scroll while making screen shots , either vertically or * horizontally or both directions ( Chrome ) . * @ param driver WebDriver instance * @ param scroll ScrollStrategy How you need to scroll * @ param useDevicePixelRatio...
return shootPage ( driver , scroll , 0 , useDevicePixelRatio ) ;
public class ColumnWithIdComparator { /** * Compares two columns given by their names . * @ param objA The name of the first column * @ param objB The name of the second column * @ return * @ see java . util . Comparator # compare ( java . lang . Object , java . lang . Object ) */ public int compare ( Object ob...
String idAStr = _table . getColumn ( ( String ) objA ) . getProperty ( "id" ) ; String idBStr = _table . getColumn ( ( String ) objB ) . getProperty ( "id" ) ; int idA ; int idB ; try { idA = Integer . parseInt ( idAStr ) ; } catch ( Exception ex ) { return 1 ; } try { idB = Integer . parseInt ( idBStr ) ; } catch ( Ex...
public class Region { /** * The Availability Zones for databases . Follows the format < code > us - east - 2a < / code > ( case - sensitive ) . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setRelationalDatabaseAvailabilityZones ( java . util . Collection )...
if ( this . relationalDatabaseAvailabilityZones == null ) { setRelationalDatabaseAvailabilityZones ( new java . util . ArrayList < AvailabilityZone > ( relationalDatabaseAvailabilityZones . length ) ) ; } for ( AvailabilityZone ele : relationalDatabaseAvailabilityZones ) { this . relationalDatabaseAvailabilityZones . a...
public class Transforms { /** * 1 if less than or equal to 0 otherwise ( at each element ) * @ param first * @ param ndArray * @ return */ public static INDArray lessThanOrEqual ( INDArray first , INDArray ndArray ) { } }
return lessThanOrEqual ( first , ndArray , true ) ;
public class DefaultErrorHandler { /** * Returns TRUE in case status code of response starts with 4 or 5 */ @ Override public boolean hasError ( Response < ByteSource > rs ) { } }
StatusType statusType = StatusType . valueOf ( rs . getStatus ( ) ) ; return ( statusType == StatusType . CLIENT_ERROR || statusType == StatusType . SERVER_ERROR ) ;
public class SslHandler { /** * Notify all the handshake futures about the successfully handshake */ private void setHandshakeSuccess ( ) { } }
handshakePromise . trySuccess ( ctx . channel ( ) ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( "{} HANDSHAKEN: {}" , ctx . channel ( ) , engine . getSession ( ) . getCipherSuite ( ) ) ; } ctx . fireUserEventTriggered ( SslHandshakeCompletionEvent . SUCCESS ) ; if ( readDuringHandshake && ! ctx . channel ( ...
public class DescribeSpotPriceHistoryRequest { /** * Filters the results by the specified instance types . * @ param instanceTypes * Filters the results by the specified instance types . * @ see InstanceType */ public void setInstanceTypes ( java . util . Collection < String > instanceTypes ) { } }
if ( instanceTypes == null ) { this . instanceTypes = null ; return ; } this . instanceTypes = new com . amazonaws . internal . SdkInternalList < String > ( instanceTypes ) ;
public class ProtocolDecoderException { /** * Returns the message and the hexdump of the unknown part . */ @ Override public String getMessage ( ) { } }
String message = super . getMessage ( ) ; if ( message == null ) { message = "" ; } if ( hexdump != null ) { return message + ( message . length ( ) > 0 ? " " : "" ) + "(Hexdump: " + hexdump + ')' ; } return message ;
public class DirectoryConfig { /** * The distinguished names of the organizational units for computer accounts . * @ param organizationalUnitDistinguishedNames * The distinguished names of the organizational units for computer accounts . */ public void setOrganizationalUnitDistinguishedNames ( java . util . Collect...
if ( organizationalUnitDistinguishedNames == null ) { this . organizationalUnitDistinguishedNames = null ; return ; } this . organizationalUnitDistinguishedNames = new java . util . ArrayList < String > ( organizationalUnitDistinguishedNames ) ;
public class Reflecter { /** * Populate the JavaBeans properties of this delegate object , based on the specified name / value pairs * @ param properties * @ return */ public < V > Reflecter < T > populate ( Map < String , V > properties , String ... excludes ) { } }
return populate ( properties , Arrays . asList ( excludes ) ) ;
public class AttributeQualifierImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public void setLevNum ( Integer newLevNum ) { } }
Integer oldLevNum = levNum ; levNum = newLevNum ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , AfplibPackage . ATTRIBUTE_QUALIFIER__LEV_NUM , oldLevNum , levNum ) ) ;
public class AstaDatabaseReader { /** * Select the project properties row from the database . * @ throws SQLException */ private void processProjectProperties ( ) throws SQLException { } }
List < Row > rows = getRows ( "select * from project_summary where projid=?" , m_projectID ) ; if ( rows . isEmpty ( ) == false ) { m_reader . processProjectProperties ( rows . get ( 0 ) ) ; }
public class OrmDescriptorImpl { /** * Adds a new namespace * @ return the current instance of < code > OrmDescriptor < / code > */ public OrmDescriptor addNamespace ( String name , String value ) { } }
model . attribute ( name , value ) ; return this ;
public class FatLfnDirectory { /** * { @ inheritDoc } * < / p > < p > * According to the FAT file system specification , leading and trailing * spaces in the { @ code name } are ignored by this method . * @ param name { @ inheritDoc } * @ return { @ inheritDoc } */ @ Override public FatLfnDirectoryEntry getEn...
name = name . trim ( ) . toLowerCase ( Locale . ROOT ) ; final FatLfnDirectoryEntry entry = longNameIndex . get ( name ) ; if ( entry == null ) { if ( ! ShortName . canConvert ( name ) ) return null ; return shortNameIndex . get ( ShortName . get ( name ) ) ; } else { return entry ; }
public class WebMvcTags { /** * Creates a { @ code method } tag based on the { @ link HttpServletRequest # getMethod ( ) * method } of the given { @ code request } . * @ param request the request * @ return the method tag whose value is a capitalized method ( e . g . GET ) . */ public static Tag method ( @ Nullab...
return request == null ? METHOD_UNKNOWN : Tag . of ( "method" , request . getMethod ( ) ) ;
public class XIncProcXIncludeFilter { @ Override public void startDTD ( final String name , final String publicId , final String systemId ) throws SAXException { } }
LOG . trace ( "startDTD:{},{},{}" , name , publicId , systemId ) ; this . inDTD = true ; if ( ofNullable ( this . lexicalHandler ) . isPresent ( ) ) { this . lexicalHandler . startDTD ( name , publicId , systemId ) ; } this . context . setDocType ( name , publicId , systemId ) ;
public class AliasFactory { /** * Create a proxy instance for the given class and path * @ param < A > * @ param cl type of the proxy * @ param path underlying expression * @ return proxy instance */ @ SuppressWarnings ( "unchecked" ) protected < A > A createProxy ( Class < A > cl , Expression < ? > path ) { } ...
Enhancer enhancer = new Enhancer ( ) ; enhancer . setClassLoader ( AliasFactory . class . getClassLoader ( ) ) ; if ( cl . isInterface ( ) ) { enhancer . setInterfaces ( new Class < ? > [ ] { cl , ManagedObject . class } ) ; } else { enhancer . setSuperclass ( cl ) ; enhancer . setInterfaces ( new Class < ? > [ ] { Man...
public class FindBugsCommandLine { /** * Load given project file . * @ param arg * name of project file * @ throws java . io . IOException */ public void loadProject ( String arg ) throws IOException { } }
Project newProject = Project . readProject ( arg ) ; newProject . setConfiguration ( project . getConfiguration ( ) ) ; project = newProject ; projectLoadedFromFile = true ;
public class LinkedOptionalMap { /** * Tries to merges the keys and the values of @ right into @ left . */ public static < K , V > MergeResult < K , V > mergeRightIntoLeft ( LinkedOptionalMap < K , V > left , LinkedOptionalMap < K , V > right ) { } }
LinkedOptionalMap < K , V > merged = new LinkedOptionalMap < > ( left ) ; merged . putAll ( right ) ; return new MergeResult < > ( merged , isLeftPrefixOfRight ( left , right ) ) ;
public class VectorTile { /** * Return the current status of this VectorTile . Can be one of the following : * < ul > * < li > STATUS . EMPTY < / li > * < li > STATUS . LOADING < / li > * < li > STATUS . LOADED < / li > * < / ul > * @ return status */ public STATUS getStatus ( ) { } }
if ( featureContent . isLoaded ( ) ) { return STATUS . LOADED ; } if ( deferred == null ) { return STATUS . EMPTY ; } return STATUS . LOADING ;
public class ListUtils { /** * 生成一个 { @ link Vector } * @ param values 值数组 * @ param capacity 初始化长度 * @ param < T > 值类型 * @ return { @ link Vector } * @ since 1.0.9 */ public static < T > Vector < T > getVector ( int capacity , T ... values ) { } }
return new Vector < T > ( ) { { addAll ( Arrays . asList ( values ) ) ; } } ;
public class VdmPluginImages { /** * Returns the image descriptor for the given key in this registry . Might be called in a non - UI thread . * @ param key * the image ' s key * @ return the image descriptor for the given key */ public static ImageDescriptor getDescriptor ( String key ) { } }
if ( fgImageRegistry == null ) { return fgAvoidSWTErrorMap . get ( key ) ; } return getImageRegistry ( ) . getDescriptor ( key ) ;
public class CacheProxy { /** * Returns a deep copy of the map if value - based caching is enabled . * @ param map the mapping of keys to expirable values * @ return a deep or shallow copy of the mappings depending on the store by value setting */ protected final Map < K , V > copyMap ( Map < K , Expirable < V > > ...
ClassLoader classLoader = cacheManager . getClassLoader ( ) ; return map . entrySet ( ) . stream ( ) . collect ( toMap ( entry -> copier . copy ( entry . getKey ( ) , classLoader ) , entry -> copier . copy ( entry . getValue ( ) . get ( ) , classLoader ) ) ) ;
public class NotificationBoard { /** * Add footer view . * @ param view * @ param index * @ param lp */ public void addFooterView ( View view , int index , ViewGroup . LayoutParams lp ) { } }
mFooter . addView ( view , index , lp ) ;
public class MergeableManifest2 { /** * Add the list with given bundles to the " Export - Package " main attribute . * @ param exportedPackages The list of all packages to add . */ public void addExportedPackages ( String ... exportedPackages ) { } }
String oldBundles = mainAttributes . get ( EXPORT_PACKAGE ) ; if ( oldBundles == null ) oldBundles = "" ; BundleList oldResultList = BundleList . fromInput ( oldBundles , newline ) ; BundleList resultList = BundleList . fromInput ( oldBundles , newline ) ; for ( String bundle : exportedPackages ) resultList . mergeInto...
public class ZooKeeperStateHandleStore { /** * Releases all lock nodes of this ZooKeeperStateHandleStores and tries to remove all state nodes which * are not locked anymore . * < p > The delete operation is executed asynchronously * @ throws Exception if the delete operation fails */ public void releaseAndTryRemo...
Collection < String > children = getAllPaths ( ) ; Exception exception = null ; for ( String child : children ) { try { releaseAndTryRemove ( '/' + child ) ; } catch ( Exception e ) { exception = ExceptionUtils . firstOrSuppressed ( e , exception ) ; } } if ( exception != null ) { throw new Exception ( "Could not prope...
public class TelegramBot { /** * This allows you to edit the text of a message you have already sent previously * @ param chatId The chat ID of the chat containing the message you want to edit * @ param messageId The message ID of the message you want to edit * @ param text The new text you want to display * @ ...
if ( chatId != null && messageId != null && text != null ) { JSONObject jsonResponse = this . editMessageText ( chatId , messageId , null , text , parseMode , disableWebPagePreview , inlineReplyMarkup ) ; if ( jsonResponse != null ) { return MessageImpl . createMessage ( jsonResponse . getJSONObject ( "result" ) , this...
public class FileManagerImpl { /** * / * Split a block on disk and return the appropriate address . We assume * that this is only called to split a block on the misc list . */ private long split_block ( long block_addr , int request_size , int rem ) throws IOException { } }
allocated_words += request_size ; allocated_blocks ++ ; free_words -= request_size ; ml_hits ++ ; ml_splits ++ ; seek_and_count ( block_addr + request_size ) ; writeInt ( rem ) ; seek_and_count ( block_addr ) ; writeInt ( - request_size ) ; return ( block_addr + HDR_SIZE ) ;
public class BlockingArrayQueue { @ SuppressWarnings ( "unchecked" ) @ Override public E get ( int index ) { } }
_tailLock . lock ( ) ; try { _headLock . lock ( ) ; try { if ( index < 0 || index >= _size . get ( ) ) throw new IndexOutOfBoundsException ( "!(" + 0 + "<" + index + "<=" + _size + ")" ) ; int i = _indexes [ HEAD_OFFSET ] + index ; int capacity = _elements . length ; if ( i >= capacity ) i -= capacity ; return ( E ) _e...
public class SqlEntityQueryImpl { /** * { @ inheritDoc } * @ see jp . co . future . uroborosql . fluent . SqlEntityQuery # first ( ) */ @ Override public Optional < E > first ( ) { } }
try ( Stream < E > stream = stream ( ) ) { return stream . findFirst ( ) ; }
public class WikiParser { /** * Finds first closing ' } } } ' for nowiki block or span . * Skips escaped sequences : ' ~ } } } ' . * @ param startBlock points to first char after ' { { { ' * @ return position of first ' } ' in closing ' } } } ' */ private int findEndOfNowiki ( int startBlock ) { } }
// NOTE : this method could step back one char from startBlock position int endBlock = startBlock - 3 ; do { endBlock = wikiText . indexOf ( "}}}" , endBlock + 3 ) ; if ( endBlock < 0 ) return wikiLength ; // no matching ' } } } ' found while ( endBlock + 3 < wikiLength && wikiChars [ endBlock + 3 ] == '}' ) endBlock +...
public class ApplicationServiceClient { /** * Creates a new application entity . * < p > Sample code : * < pre > < code > * try ( ApplicationServiceClient applicationServiceClient = ApplicationServiceClient . create ( ) ) { * ProfileName parent = ProfileName . of ( " [ PROJECT ] " , " [ TENANT ] " , " [ PROFILE...
CreateApplicationRequest request = CreateApplicationRequest . newBuilder ( ) . setParent ( parent == null ? null : parent . toString ( ) ) . setApplication ( application ) . build ( ) ; return createApplication ( request ) ;
public class CommerceDiscountRelLocalServiceBaseImpl { /** * Creates a new commerce discount rel with the primary key . Does not add the commerce discount rel to the database . * @ param commerceDiscountRelId the primary key for the new commerce discount rel * @ return the new commerce discount rel */ @ Override @ ...
return commerceDiscountRelPersistence . create ( commerceDiscountRelId ) ;
public class LinkArgs { /** * Custom properties that my be used by application - specific markup builders or processors . * @ param key Property key * @ param value Property value * @ return this */ public @ NotNull LinkArgs property ( String key , Object value ) { } }
if ( key == null ) { throw new IllegalArgumentException ( "Key argument must not be null." ) ; } getProperties ( ) . put ( key , value ) ; return this ;
public class DefaultIncrementalAttributesMapper { /** * Lookup all values for the specified attribute , looping through the results incrementally if necessary . * @ param ldapOperations The instance to use for performing the actual lookup . * @ param dn The distinguished name of the object to find . * @ param att...
return lookupAttributes ( ldapOperations , dn , new String [ ] { attribute } ) ;
public class device_profile { /** * < pre > * Performs generic data validation for the operation to be performed * < / pre > */ protected void validate ( String operationType ) throws Exception { } }
super . validate ( operationType ) ; MPSString id_validator = new MPSString ( ) ; id_validator . setConstraintIsReq ( MPSConstants . DELETE_CONSTRAINT , true ) ; id_validator . setConstraintIsReq ( MPSConstants . MODIFY_CONSTRAINT , true ) ; id_validator . validate ( operationType , id , "\"id\"" ) ; MPSString name_val...
public class EmbeddedJCA { /** * Deploy * @ param cl The class loader * @ param name The resource name * @ exception Throwable If an error occurs */ private void deploy ( ClassLoader cl , String name ) throws Throwable { } }
if ( cl == null ) throw new IllegalArgumentException ( "ClassLoader is null" ) ; if ( name == null ) throw new IllegalArgumentException ( "Name is null" ) ; URL url = cl . getResource ( name ) ; if ( url == null ) throw new IllegalArgumentException ( "Resource is null" ) ; log . debugf ( "Deploying: %s" , url ) ; kerne...
public class ClassFileVersion { /** * Finds the highest class file version that is compatible to the current JVM version . Prior to Java 9 , this is achieved * by parsing the { @ code java . version } property which is provided by { @ link java . lang . System # getProperty ( String ) } . If the system * property i...
try { return ofThisVm ( ) ; } catch ( Exception ignored ) { return fallback ; }
public class PoolEvaluateAutoScaleOptions { /** * Set the time the request was issued . Client libraries typically set this to the current system clock time ; set it explicitly if you are calling the REST API directly . * @ param ocpDate the ocpDate value to set * @ return the PoolEvaluateAutoScaleOptions object it...
if ( ocpDate == null ) { this . ocpDate = null ; } else { this . ocpDate = new DateTimeRfc1123 ( ocpDate ) ; } return this ;
public class FrameReadProcessor { /** * Finish building the current frame : process its payload and pass it to the Stream Processor * @ throws ProtocolException */ public void processCompleteFrame ( ) throws Http2Exception { } }
Frame currentFrame = getCurrentFrame ( ) ; boolean frameSizeError = false ; try { currentFrame . processPayload ( this ) ; } catch ( Http2Exception e ) { // If we get an error here , it should be safe to assume that this frame doesn ' t have the expected byte count , // which must be treated as an error of type FRAME _...
public class CapacityMarshaller { /** * Marshall the given parameter object . */ public void marshall ( Capacity capacity , ProtocolMarshaller protocolMarshaller ) { } }
if ( capacity == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( capacity . getReadCapacityUnits ( ) , READCAPACITYUNITS_BINDING ) ; protocolMarshaller . marshall ( capacity . getWriteCapacityUnits ( ) , WRITECAPACITYUNITS_BINDING ) ; protoc...
public class Period { /** * Returns a new period with the specified number of years . * This period instance is immutable and unaffected by this method call . * @ param years the amount of years to add , may be negative * @ return the new period with the increased years * @ throws UnsupportedOperationException ...
int [ ] values = getValues ( ) ; // cloned getPeriodType ( ) . setIndexedField ( this , PeriodType . YEAR_INDEX , values , years ) ; return new Period ( values , getPeriodType ( ) ) ;
public class MetadataService { /** * Removes the specified { @ link Token } from the specified { @ code projectName } . It also removes * every token permission belonging to the { @ link Token } from every { @ link RepositoryMetadata } . */ public CompletableFuture < Revision > removeToken ( Author author , String pr...
return removeToken ( author , projectName , requireNonNull ( token , "token" ) . appId ( ) ) ;
public class ZWaveNode { /** * Encapsulates a serial message for sending to a * multi - instance instance / multi - channel endpoint on * a node . * @ param serialMessage the serial message to encapsulate * @ param commandClass the command class used to generate the message . * @ param endpointId the instance...
ZWaveMultiInstanceCommandClass multiInstanceCommandClass ; if ( serialMessage == null ) return null ; // no encapsulation necessary . if ( endpointId == 1 && commandClass . getInstances ( ) == 1 && commandClass . getEndpoint ( ) == null ) return serialMessage ; multiInstanceCommandClass = ( ZWaveMultiInstanceCommandCla...
public class PersonVisitor { /** * Visit a FamS . We will build up a collection of Navigators to the FamSs . * @ see GedObjectVisitor # visit ( FamS ) */ @ Override public void visit ( final FamS fams ) { } }
final FamilyNavigator navigator = new FamilyNavigator ( fams ) ; final Family family = navigator . getFamily ( ) ; if ( family . isSet ( ) ) { familySNavigators . add ( navigator ) ; }
public class _ComponentAttributesMap { /** * Execute the setter method of the specified property on the underlying * component . * @ param propertyDescriptor specifies which property to write . * @ throws IllegalArgumentException if the property is not writable . * @ throws FacesException if any other problem o...
Method writeMethod = propertyDescriptor . getWriteMethod ( ) ; if ( writeMethod == null ) { throw new IllegalArgumentException ( "Component property " + propertyDescriptor . getName ( ) + " is not writable" ) ; } try { writeMethod . invoke ( _component , new Object [ ] { value } ) ; } catch ( Exception e ) { FacesConte...
public class StandaloneCommandBuilder { /** * Adds a JVM argument to the command ignoring { @ code null } arguments . * @ param jvmArg the JVM argument to add * @ return the builder */ public StandaloneCommandBuilder addJavaOption ( final String jvmArg ) { } }
if ( jvmArg != null && ! jvmArg . trim ( ) . isEmpty ( ) ) { final Argument argument = Arguments . parse ( jvmArg ) ; switch ( argument . getKey ( ) ) { case SERVER_BASE_DIR : if ( argument . getValue ( ) != null ) { setBaseDirectory ( argument . getValue ( ) ) ; } break ; case SERVER_CONFIG_DIR : if ( argument . getVa...
public class MapObjectReference { /** * CHECKSTYLE : OFF */ @ Override public void __put ( final Object key , final Key k ) { } }
keyMap . put ( key , k ) ;