signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class MapTileCircuitModel { /** * Update neighbor . * @ param tile The tile reference . * @ param neighbor The neighbor reference . */ private void updateNeigbor ( Tile tile , Tile neighbor ) { } }
final String group = mapGroup . getGroup ( tile ) ; final String neighborGroup = mapGroup . getGroup ( neighbor ) ; final Circuit circuit = getCircuitOverTransition ( extractor . getCircuit ( neighbor ) , neighbor ) ; if ( group . equals ( neighborGroup ) ) { updateTile ( tile , neighbor , circuit ) ; } else if ( neigh...
public class NodeUtil { /** * Given the first sibling , this returns the nth * sibling or null if no such sibling exists . * This is like " getChildAtIndex " but returns null for non - existent indexes . */ private static Node getNthSibling ( Node first , int index ) { } }
Node sibling = first ; while ( index != 0 && sibling != null ) { sibling = sibling . getNext ( ) ; index -- ; } return sibling ;
public class PolylineSplitMerge { /** * Increase the number of sides in the polyline . This is done greedily selecting the side which would improve the * score by the most of it was split . * @ param contour Contour * @ return true if a split was selected and false if not */ boolean increaseNumberOfSidesByOne ( L...
// System . out . println ( " increase number of sides by one . list = " + list . size ( ) ) ; Element < Corner > selected = selectCornerToSplit ( loops ) ; // No side can be split if ( selected == null ) return false ; // Update the corner who ' s side was just split selected . object . sideError = selected . object ....
public class BsUserCA { public void filter ( String name , EsAbstractConditionQuery . OperatorCall < BsUserCQ > queryLambda , ConditionOptionCall < FilterAggregationBuilder > opLambda , OperatorCall < BsUserCA > aggsLambda ) { } }
UserCQ cq = new UserCQ ( ) ; if ( queryLambda != null ) { queryLambda . callback ( cq ) ; } FilterAggregationBuilder builder = regFilterA ( name , cq . getQuery ( ) ) ; if ( opLambda != null ) { opLambda . callback ( builder ) ; } if ( aggsLambda != null ) { UserCA ca = new UserCA ( ) ; aggsLambda . callback ( ca ) ; c...
public class GitlabAPI { /** * Gets email - on - push service setup for a projectId . * @ param projectId The ID of the project containing the variable . * @ throws IOException on gitlab api call error */ public GitlabServiceEmailOnPush getEmailsOnPush ( Integer projectId ) throws IOException { } }
String tailUrl = GitlabProject . URL + "/" + projectId + GitlabServiceEmailOnPush . URL ; return retrieve ( ) . to ( tailUrl , GitlabServiceEmailOnPush . class ) ;
public class BoxStoragePolicyAssignment { /** * Returns a BoxStoragePolicyAssignment information . * @ param api the API connection to be used by the resource . * @ param resolvedForType the assigned entity type for the storage policy . * @ param resolvedForID the assigned entity id for the storage policy . * @...
QueryStringBuilder builder = new QueryStringBuilder ( ) ; builder . appendParam ( "resolved_for_type" , resolvedForType ) . appendParam ( "resolved_for_id" , resolvedForID ) ; URL url = STORAGE_POLICY_ASSIGNMENT_URL_TEMPLATE . buildWithQuery ( api . getBaseURL ( ) , builder . toString ( ) ) ; BoxAPIRequest request = ne...
public class CLIContext { /** * Get the string value , or the defaultValue if not found . * @ param key The key to search for . * @ return The value , or defaultValue if not found . */ public String getString ( String key , String defaultValue ) { } }
Object o = getObject ( key ) ; if ( o == null ) { return defaultValue ; } if ( ! ( o instanceof String ) ) { throw new IllegalArgumentException ( "Object [" + o + "] associated with key [" + key + "] is not of type String." ) ; } return ( String ) o ;
public class JSONBuilder { /** * Delivers the correct JSON Object for the stencilId * @ param stencilId * @ throws org . json . JSONException */ private static JSONObject parseStencil ( String stencilId ) throws JSONException { } }
JSONObject stencilObject = new JSONObject ( ) ; stencilObject . put ( "id" , stencilId . toString ( ) ) ; return stencilObject ;
public class ReplicationLinksInner { /** * Sets which replica database is primary by failing over from the current primary replica database . This operation might result in data loss . * @ param resourceGroupName The name of the resource group that contains the resource . You can obtain this value from the Azure Reso...
return failoverAllowDataLossWithServiceResponseAsync ( resourceGroupName , serverName , databaseName , linkId ) . map ( new Func1 < ServiceResponse < Void > , Void > ( ) { @ Override public Void call ( ServiceResponse < Void > response ) { return response . body ( ) ; } } ) ;
public class DevicesInner { /** * Scans for updates on a data box edge / gateway device . * @ param deviceName The device name . * @ param resourceGroupName The resource group name . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the { @ link ServiceResponse } object if ...
return beginScanForUpdatesWithServiceResponseAsync ( deviceName , resourceGroupName ) . map ( new Func1 < ServiceResponse < Void > , Void > ( ) { @ Override public Void call ( ServiceResponse < Void > response ) { return response . body ( ) ; } } ) ;
public class ParticipantReader { /** * Add the requested query string arguments to the Request . * @ param request Request to add query string arguments to */ private void addQueryParams ( final Request request ) { } }
if ( status != null ) { request . addQueryParam ( "Status" , status . toString ( ) ) ; } if ( identity != null ) { request . addQueryParam ( "Identity" , identity ) ; } if ( dateCreatedAfter != null ) { request . addQueryParam ( "DateCreatedAfter" , dateCreatedAfter . toString ( ) ) ; } if ( dateCreatedBefore != null )...
public class CpaBid { /** * Gets the bidSource value for this CpaBid . * @ return bidSource * The level ( ad group , ad group strategy , or campaign strategy ) * at which the bid was set . * This is applicable only at the ad group level . * < span class = " constraint ReadOnly " > This field is read only and wi...
return bidSource ;
public class WildcardImport { /** * Creates a { @ link Fix } that replaces wildcard imports . */ static Fix createFix ( ImmutableList < ImportTree > wildcardImports , Set < TypeToImport > typesToImport , VisitorState state ) { } }
Map < Symbol , List < TypeToImport > > toFix = typesToImport . stream ( ) . collect ( Collectors . groupingBy ( TypeToImport :: owner ) ) ; final SuggestedFix . Builder fix = SuggestedFix . builder ( ) ; for ( ImportTree importToDelete : wildcardImports ) { String importSpecification = importToDelete . getQualifiedIden...
public class ServerListenerBuilder { /** * Add { @ link Runnable } invoked when the { @ link Server } is starting . * ( see : { @ link ServerListener # serverStarting ( Server ) } ) */ public ServerListenerBuilder addStartingCallback ( Runnable runnable ) { } }
requireNonNull ( runnable , "runnable" ) ; serverStartingCallbacks . add ( unused -> runnable . run ( ) ) ; return this ;
public class ClassicCounter { /** * { @ inheritDoc } */ public Collection < Double > values ( ) { } }
return new AbstractCollection < Double > ( ) { @ Override public Iterator < Double > iterator ( ) { return new Iterator < Double > ( ) { Iterator < MutableDouble > inner = map . values ( ) . iterator ( ) ; public boolean hasNext ( ) { return inner . hasNext ( ) ; } public Double next ( ) { // copy so as to give safety ...
public class Numeraire { /** * This method returns the value random variable of the product within the specified model , evaluated at a given evalutationTime . * Note : For a lattice this is often the value conditional to evalutationTime , for a Monte - Carlo simulation this is the ( sum of ) value discounted to eval...
return model . getNumeraire ( evaluationTime ) ;
public class AbstractConnection { /** * used by the other message types */ protected synchronized void do_send ( final OtpOutputStream header ) throws IOException { } }
try { if ( traceLevel >= ctrlThreshold ) { try { final OtpErlangObject h = header . getOtpInputStream ( 5 ) . read_any ( ) ; System . out . println ( "-> " + headerType ( h ) + " " + h ) ; } catch ( final OtpErlangDecodeException e ) { System . out . println ( " " + "can't decode output buffer: " + e ) ; } } header ....
public class InterfacesXml { /** * Creates the appropriate AbstractInterfaceCriteriaElement for simple criterion . * Note ! changes / additions made here will likely need to be added to the corresponding write method that handles the write * of the element . Failure to do so will result in a configuration that can ...
final Element element = Element . forName ( reader . getLocalName ( ) ) ; final String localName = element . getLocalName ( ) ; switch ( element ) { case INET_ADDRESS : { requireSingleAttribute ( reader , Attribute . VALUE . getLocalName ( ) ) ; final String value = reader . getAttributeValue ( 0 ) ; ModelNode valueNod...
public class RandomUtils { /** * Returns a index of a specified probability , e . g . the string is " 100:1:32:200:16:30 " . * If it returns 0 that probability is 100 / ( 100 + 1 + 32 + 200 + 16 + 30) * @ param conf Configures specified probability * @ return The index of a specified probability */ public static ...
String [ ] tmp = StringUtils . split ( conf , ":" ) ; int [ ] probability = new int [ tmp . length ] ; for ( int i = 0 ; i < probability . length ; i ++ ) probability [ i ] = Integer . parseInt ( tmp [ i ] . trim ( ) ) ; return randomSegment ( probability ) ;
public class DelayedMBeanActivatorHelper { /** * DS method to activate this component . * @ param compContext */ protected void activate ( ComponentContext compContext ) { } }
BundleContext ctx = compContext . getBundleContext ( ) ; mDelayedMBeanActivator = new DelayedMBeanActivator ( ctx ) ; pipeline . insert ( mDelayedMBeanActivator ) ; try { mbeanTracker = new ServiceTracker < Object , ServiceReference < ? > > ( ctx , ctx . createFilter ( "(jmx.objectname=*)" ) , this ) ; mbeanTracker . o...
public class Factories { /** * Creates a new instance of a class whose full qualified name is specified under the given key , loading * the class with the given class loader . * < br / > * If the given settings is null , or it does not contain the specified key , the default value of the key * is taken from the...
Class < ? > klass = loadClass ( settings , key , classLoader ) ; // Workaround for compiler bug ( # 6302954) return Factories . < T > newInstance ( klass ) ;
public class PBBaseBeanImpl { /** * Delete an object . */ public void deleteObject ( Object object ) { } }
PersistenceBroker broker = null ; try { broker = getBroker ( ) ; broker . delete ( object ) ; } finally { if ( broker != null ) broker . close ( ) ; }
public class OutputManager { /** * gets the Event and sends it to the right outputPlugin for further processing * passDataToOutputPlugins is the main method of OutputManger . It is called whenever the output process has to be started * @ param event an Instance of Event */ public void passDataToOutputPlugins ( Even...
IdentificationManagerM identificationManager = IdentificationManager . getInstance ( ) ; List < Identification > allIds = outputPlugins . stream ( ) . map ( identificationManager :: getIdentification ) . filter ( Optional :: isPresent ) . map ( Optional :: get ) . collect ( Collectors . toList ( ) ) ; HashMap < Integer...
public class ChangesetsDao { /** * Get map data changes associated with the given changeset . * @ throws OsmAuthorizationException if not logged in * @ throws OsmNotFoundException if changeset with the given id does not exist */ public void getData ( long id , MapDataChangesHandler handler , MapDataFactory factory ...
osm . makeAuthenticatedRequest ( CHANGESET + "/" + id + "/download" , null , new MapDataChangesParser ( handler , factory ) ) ;
public class SingleTabUrlNodeSyntaxHelper { /** * Get the index of the default tab for the user */ protected String getDefaultTabIndex ( HttpServletRequest httpServletRequest ) { } }
final String stylesheetParameter = this . stylesheetUserPreferencesService . getStylesheetParameter ( httpServletRequest , PreferencesScope . STRUCTURE , this . defaultTabParameter ) ; if ( stylesheetParameter != null ) { return stylesheetParameter ; } final IStylesheetDescriptor stylesheetDescriptor = this . styleshee...
public class CompiledFEELSupport { /** * Generates a compilable class that reports a ( compile - time ) error at runtime */ public static CompiledFEELExpression compiledError ( String expression , String msg ) { } }
return new CompilerBytecodeLoader ( ) . makeFromJPExpression ( expression , compiledErrorExpression ( msg ) , Collections . emptySet ( ) ) ;
public class MasterWorkerInfo { /** * Sets the capacity of the worker in bytes . * @ param capacityBytesOnTiers used bytes on each storage tier */ public void updateCapacityBytes ( Map < String , Long > capacityBytesOnTiers ) { } }
mCapacityBytes = 0 ; mTotalBytesOnTiers = capacityBytesOnTiers ; for ( long t : mTotalBytesOnTiers . values ( ) ) { mCapacityBytes += t ; }
public class Link { /** * Create new { @ link Link } with additional { @ link Affordance } s . * @ param affordances must not be { @ literal null } . * @ return */ public Link andAffordances ( List < Affordance > affordances ) { } }
List < Affordance > newAffordances = new ArrayList < > ( ) ; newAffordances . addAll ( this . affordances ) ; newAffordances . addAll ( affordances ) ; return withAffordances ( newAffordances ) ;
public class GrassLegacyUtilities { /** * Return the row and column of the active region matrix for a give coordinate * * NOTE : basically the inverse of * { @ link GrassLegacyUtilities # rowColToCenterCoordinates ( Window , int , int ) } * @ param active the active region * @ param coord * @ return and int a...
double easting = coord . x ; double northing = coord . y ; int [ ] rowcol = new int [ 2 ] ; if ( easting > active . getEast ( ) || easting < active . getWest ( ) || northing > active . getNorth ( ) || northing < active . getSouth ( ) ) { return null ; } double minx = active . getWest ( ) ; double ewres = active . getWE...
public class SignalServiceAccountManager { /** * Register / Unregister a Google Cloud Messaging registration ID . * @ param gcmRegistrationId The GCM id to register . A call with an absent value will unregister . * @ throws IOException */ public void setGcmId ( Optional < String > gcmRegistrationId ) throws IOExcep...
if ( gcmRegistrationId . isPresent ( ) ) { this . pushServiceSocket . registerGcmId ( gcmRegistrationId . get ( ) ) ; } else { this . pushServiceSocket . unregisterGcmId ( ) ; }
public class ContentSpecUtilities { /** * Fixes a failed Content Spec so that the ID and CHECKSUM are included . This is primarily an issue when creating new content specs * and they are initially invalid . * @ param id The id of the content spec tha tis being fixed . * @ param failedContentSpec The failed conten...
if ( failedContentSpec == null || failedContentSpec . isEmpty ( ) ) { return null ; } else if ( includeChecksum ) { if ( id == null || getContentSpecChecksum ( failedContentSpec ) != null ) { return failedContentSpec ; } else { final String cleanContentSpec = removeChecksumAndId ( failedContentSpec ) ; final String che...
public class ServicesInner { /** * Get services in resource group . * The Services resource is the top - level resource that represents the Data Migration Service . This method returns a list of service resources in a resource group . * @ param nextPageLink The NextLink from the previous successful call to List ope...
return listByResourceGroupNextWithServiceResponseAsync ( nextPageLink ) . map ( new Func1 < ServiceResponse < Page < DataMigrationServiceInner > > , Page < DataMigrationServiceInner > > ( ) { @ Override public Page < DataMigrationServiceInner > call ( ServiceResponse < Page < DataMigrationServiceInner > > response ) { ...
public class SAXEncoder { public void startElement ( String uri , String local , String raw , Attributes attributes ) throws SAXException { } }
try { // no prefix this . startElementPfx ( uri , local , null , attributes ) ; } catch ( Exception e ) { throw new SAXException ( "startElement: " + raw , e ) ; }
public class Interval { /** * Checks if the current interval contains the entirety of another interval . More formally , * this method returns { @ code true } , if for every point { @ code x } from the interval { @ code another } * this point { @ code x } also belongs to the current interval . * @ param another A...
if ( another == null || isEmpty ( ) || another . isEmpty ( ) ) { return false ; } Interval < T > intersection = getIntersection ( another ) ; return intersection != null && intersection . equals ( another ) ;
public class Annotate { /** * Read already tokenized text ( one sentence per line ) and builds a NAF * document . * @ param breader * the reader * @ param kaf * the naf document * @ throws IOException * if io problems */ public static void tokensToKAF ( final Reader breader , final KAFDocument kaf ) throw...
int noSents = 0 ; int noParas = 1 ; final List < String > sentences = CharStreams . readLines ( breader ) ; for ( final String sentence : sentences ) { noSents = noSents + 1 ; final String [ ] tokens = sentence . split ( DELIMITER ) ; for ( final String token : tokens ) { if ( token . equals ( RuleBasedSegmenter . PARA...
public class ManagementClientImpl { /** * min + max ASDU len are * not * including any field that contains ACPI */ private byte [ ] waitForResponse ( final IndividualAddress from , final int minAsduLen , final int maxAsduLen , final long timeout , final Optional < List < IndividualAddress > > responders ) throws KNXInv...
long remaining = timeout ; final long end = System . currentTimeMillis ( ) + remaining ; synchronized ( indications ) { while ( remaining > 0 ) { while ( indications . size ( ) > 0 ) { final CEMI frame = indications . remove ( ) . getFrame ( ) ; final byte [ ] apdu = frame . getPayload ( ) ; if ( svcResponse != DataUni...
public class VoldemortServer { /** * - - LGao */ private void checkHostName ( ) { } }
try { HashSet < String > ipAddrList = new HashSet < String > ( ) ; InetAddress localhost = InetAddress . getLocalHost ( ) ; InetAddress [ ] serverAddrs = InetAddress . getAllByName ( localhost . getCanonicalHostName ( ) ) ; ipAddrList . add ( "localhost" ) ; if ( serverAddrs != null && serverAddrs . length > 0 ) { for ...
public class StreamScanner { /** * Method that will try to read one or more characters from currently * open input sources ; closing input sources if necessary . * @ return true if reading succeeded ( or may succeed ) , false if * we reached EOF . */ protected boolean loadMore ( ) throws XMLStreamException { } }
WstxInputSource input = mInput ; do { /* Need to make sure offsets are properly updated for error * reporting purposes , and do this now while previous amounts * are still known . */ mCurrInputProcessed += mInputEnd ; verifyLimit ( "Maximum document characters" , mConfig . getMaxCharacters ( ) , mCurrInputProcessed...
public class Certificate { /** * Replace the Certificate to be serialized . * @ return the alternate Certificate object to be serialized * @ throws java . io . ObjectStreamException if a new object representing * this Certificate could not be created * @ since 1.3 */ protected Object writeReplace ( ) throws jav...
try { return new CertificateRep ( type , getEncoded ( ) ) ; } catch ( CertificateException e ) { throw new java . io . NotSerializableException ( "java.security.cert.Certificate: " + type + ": " + e . getMessage ( ) ) ; }
public class ExtensionFactory { /** * Relax visibility to ease the tests . */ static boolean canBeLoaded ( Map < Class < ? extends Extension > , Extension > extensions , Extension extension ) { } }
return canBeLoaded ( extensions , extension , new ArrayList < > ( ) ) ;
public class RePairGrammar { /** * Global method : iterates over all rules expanding them . */ public void expandRules ( ) { } }
// iterate over all SAX containers for ( int currentPositionIndex = 1 ; currentPositionIndex <= this . theRules . size ( ) ; currentPositionIndex ++ ) { RePairRule rr = this . theRules . get ( currentPositionIndex ) ; String resultString = rr . toRuleString ( ) ; int currentSearchStart = resultString . indexOf ( THE_R ...
public class AllConnectConnectionHolder { /** * 销毁全部连接 * @ param destroyHook 销毁钩子 */ @ Override public void closeAllClientTransports ( DestroyHook destroyHook ) { } }
// 清空所有列表 , 不让再调了 Map < ProviderInfo , ClientTransport > all = clearProviders ( ) ; if ( destroyHook != null ) { try { destroyHook . preDestroy ( ) ; } catch ( Exception e ) { if ( LOGGER . isWarnEnabled ( consumerConfig . getAppName ( ) ) ) { LOGGER . warnWithApp ( consumerConfig . getAppName ( ) , e . getMessage ( ) ...
public class TransactionContext { /** * Asynchronously rollback the transaction . * @ return a CompletableFuture for the rollback operation */ public CompletableFuture < Void > rollbackAsync ( ) { } }
if ( this . messagingFactory == null ) { CompletableFuture < Void > exceptionCompletion = new CompletableFuture < > ( ) ; exceptionCompletion . completeExceptionally ( new ServiceBusException ( false , "MessagingFactory should not be null" ) ) ; return exceptionCompletion ; } return this . messagingFactory . endTransac...
public class FixedIntHashMap { /** * Returns the value of the mapping with the specified key . * @ param key the key . * @ return the value of the mapping with the specified key , or { @ code - 1 } if no mapping for the specified * key is found . */ public T get ( final int key ) { } }
int index = ( ( key & 0x7FFFFFFF ) % elementKeys . length ) ; long m = elementKeys [ index ] ; if ( key == m ) { return elementValues [ index ] ; } return null ;
public class TransitionRepository { /** * Note in the database that a particular transition has been applied . * @ return true if the transition was noted , false if it could not be noted because another * process noted it first . */ public boolean noteTransition ( Class < ? > clazz , final String name ) throws Per...
final String cname = clazz . getName ( ) ; return executeUpdate ( new Operation < Boolean > ( ) { public Boolean invoke ( Connection conn , DatabaseLiaison liaison ) throws SQLException , PersistenceException { PreparedStatement stmt = null ; try { stmt = conn . prepareStatement ( "insert into " + liaison . tableSQL ( ...
public class StorePackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getDensity ( ) { } }
if ( densityEClass == null ) { densityEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( StorePackage . eNS_URI ) . getEClassifiers ( ) . get ( 121 ) ; } return densityEClass ;
public class IdpMetadataGenerator { /** * Generates extended metadata . Default extendedMetadata object is cloned if present and used for defaults . The * following properties are always overriden from the properties of this bean : discoveryUrl , discoveryResponseUrl , * signingKey , encryptionKey , entityAlias and...
IdpExtendedMetadata metadata ; if ( extendedMetadata != null ) { metadata = extendedMetadata . clone ( ) ; } else { metadata = new IdpExtendedMetadata ( ) ; } String entityBaseURL = getEntityBaseURL ( ) ; String entityAlias = getEntityAlias ( ) ; if ( isIncludeDiscovery ( ) ) { metadata . setIdpDiscoveryURL ( getDiscov...
public class FixedFatJarExportPage { /** * Returns the label of a path . * @ param path the path * @ param isOSPath if < code > true < / code > , the path represents an OS path , if < code > false < / code > it is a workspace path . * @ return the label of the path to be used in the UI . */ protected static Strin...
String label ; if ( isOSPath ) { label = path . toOSString ( ) ; } else { label = path . makeRelative ( ) . toString ( ) ; } return label ;
public class CmsSiteManagerImpl { /** * Returns true if this request goes to a secure site . < p > * @ param req the request to check * @ return true if the request goes to a secure site */ public boolean usesSecureSite ( HttpServletRequest req ) { } }
CmsSite site = matchRequest ( req ) ; if ( site == null ) { return false ; } CmsSiteMatcher secureMatcher = site . getSecureServerMatcher ( ) ; boolean result = false ; if ( secureMatcher != null ) { result = secureMatcher . equals ( getRequestMatcher ( req ) ) ; } return result ;
public class FileUtil { /** * 按照给定的readerHandler读取文件中的数据 * @ param < T > 集合类型 * @ param readerHandler Reader处理类 * @ param path 文件的绝对路径 * @ return 从文件中load出的数据 * @ throws IORuntimeException IO异常 * @ since 3.1.1 */ public static < T > T loadUtf8 ( String path , ReaderHandler < T > readerHandler ) throws IORun...
return load ( path , CharsetUtil . CHARSET_UTF_8 , readerHandler ) ;
public class CommercePriceListUserSegmentEntryRelPersistenceImpl { /** * Caches the commerce price list user segment entry rel in the entity cache if it is enabled . * @ param commercePriceListUserSegmentEntryRel the commerce price list user segment entry rel */ @ Override public void cacheResult ( CommercePriceListU...
entityCache . putResult ( CommercePriceListUserSegmentEntryRelModelImpl . ENTITY_CACHE_ENABLED , CommercePriceListUserSegmentEntryRelImpl . class , commercePriceListUserSegmentEntryRel . getPrimaryKey ( ) , commercePriceListUserSegmentEntryRel ) ; finderCache . putResult ( FINDER_PATH_FETCH_BY_UUID_G , new Object [ ] {...
public class NodeUtil { /** * Returns true if the current node ' s type implies side effects . * < p > This is a non - recursive version of the may have side effects * check ; used to check wherever the current node ' s type is one of * the reasons why a subtree has side effects . */ static boolean nodeTypeMayHav...
if ( isAssignmentOp ( n ) ) { return true ; } switch ( n . getToken ( ) ) { case DELPROP : case DEC : case INC : case YIELD : case THROW : case AWAIT : case FOR_IN : // assigns to a loop LHS case FOR_OF : // assigns to a loop LHS , runs an iterator case FOR_AWAIT_OF : // assigns to a loop LHS , runs an iterator , async...
public class Code { /** * Compare longs . This stores - 1 in { @ code target } if { @ code * a < b } , 0 in { @ code target } if { @ code a = = b } and 1 in target if { @ code * a > b } . */ public void compareLongs ( Local < Integer > target , Local < Long > a , Local < Long > b ) { } }
addInstruction ( new PlainInsn ( Rops . CMPL_LONG , sourcePosition , target . spec ( ) , RegisterSpecList . make ( a . spec ( ) , b . spec ( ) ) ) ) ;
public class FileLock { /** * checks if lockFile is older than ' olderThan ' UTC time by examining the modification time * on file and ( if necessary ) the timestamp in last log entry in the file . If its stale , then * returns the last log entry , else returns null . * @ param fs * @ param lockFile * @ param...
long modifiedTime = fs . getFileStatus ( lockFile ) . getModificationTime ( ) ; if ( modifiedTime <= olderThan ) { // look // Impt : HDFS timestamp may not reflect recent appends , so we double check the // timestamp in last line of file to see when the last update was made LogEntry lastEntry = getLastEntry ( fs , lock...
public class SystemEntityTypePersister { /** * Package - private for testability */ void removeNonExistingSystemEntityTypes ( ) { } }
// get all system entities List < EntityType > removedSystemEntityMetas = dataService . findAll ( ENTITY_TYPE_META_DATA , EntityType . class ) . filter ( EntityTypeUtils :: isSystemEntity ) . filter ( this :: isNotExists ) . collect ( toList ( ) ) ; dataService . getMeta ( ) . deleteEntityType ( removedSystemEntityMeta...
public class CmsStringUtil { /** * Escapes a String so it may be used as a Perl5 regular expression . < p > * This method replaces the following characters in a String : < br > * < code > { } [ ] ( ) \ $ ^ . * + / < / code > < p > * < b > Directly exposed for JSP EL < / b > , not through { @ link org . opencms . ...
if ( source == null ) { return null ; } StringBuffer result = new StringBuffer ( source . length ( ) * 2 ) ; for ( int i = 0 ; i < source . length ( ) ; ++ i ) { char ch = source . charAt ( i ) ; switch ( ch ) { case '\\' : result . append ( "\\\\" ) ; break ; case '/' : result . append ( "\\/" ) ; break ; case '$' : r...
public class MarkLogicRepositoryConnection { /** * returns number of triples in supplied context * @ param contexts * @ return long * @ throws RepositoryException */ @ Override public long size ( Resource ... contexts ) throws RepositoryException { } }
if ( contexts == null ) { contexts = new Resource [ ] { null } ; } try { StringBuilder sb = new StringBuilder ( ) ; sb . append ( "SELECT (count(?s) as ?ct) where { GRAPH ?g { ?s ?p ?o }" ) ; boolean first = true ; // with no args , measure the whole triple store . if ( contexts != null && contexts . length > 0 ) { sb ...
public class DateTimeExtensions { /** * Returns the name of this zone formatted according to the { @ link java . time . format . TextStyle # FULL } text style * for the provided { @ link java . util . Locale } . * @ param self a ZoneId * @ param locale a Locale * @ return the full display name of the ZoneId *...
return self . getDisplayName ( TextStyle . FULL , locale ) ;
public class CrxApi { /** * ( asynchronously ) * @ param path ( required ) * @ param cmd ( required ) * @ param groupName ( optional ) * @ param packageName ( optional ) * @ param packageVersion ( optional ) * @ param charset _ ( optional ) * @ param force ( optional ) * @ param recursive ( optional ) ...
ProgressResponseBody . ProgressListener progressListener = null ; ProgressRequestBody . ProgressRequestListener progressRequestListener = null ; if ( callback != null ) { progressListener = new ProgressResponseBody . ProgressListener ( ) { @ Override public void update ( long bytesRead , long contentLength , boolean do...
public class RuntimeCommandFactory { /** * Create { @ link RunnableCommand } from the given parameters . * @ param description an informative description of the command * @ param path the path to the command executable * @ param arguments arguments to pass to the command * @ param environment environment variab...
return new RuntimeCommand ( description , path , arguments , environment ) ;
public class CoreSyncMongoIterableImpl { /** * Iterates over all the documents , adding each to the given target . * @ param target the collection to insert into * @ param < A > the collection type * @ return the target */ public < A extends Collection < ? super ResultT > > A into ( final A target ) { } }
forEach ( new Block < ResultT > ( ) { @ Override public void apply ( @ Nonnull final ResultT t ) { target . add ( t ) ; } } ) ; return target ;
public class DebugKelp { /** * Trace through a segment , displaying its sequence , table , and extent . */ private void debugSegment ( WriteStream out , SegmentServiceImpl segmentService , SegmentExtent extent , byte [ ] debugTableKey ) throws IOException { } }
int length = extent . length ( ) ; try ( InSegment in = segmentService . openRead ( extent ) ) { ReadStream is = new ReadStream ( in ) ; is . position ( length - BLOCK_SIZE ) ; long seq = BitsUtil . readLong ( is ) ; if ( seq <= 0 ) { return ; } byte [ ] tableKey = new byte [ 32 ] ; is . readAll ( tableKey , 0 , tableK...
public class OrientGraphFactory { /** * Closes all pooled databases and clear the pool . */ public void close ( ) { } }
if ( pool != null ) pool . close ( ) ; pool = null ; if ( shouldCloseOrientDB ) { factory . close ( ) ; }
public class Vector2f { /** * / * ( non - Javadoc ) * @ see org . joml . Vector2fc # add ( float , float , org . joml . Vector2f ) */ public Vector2f add ( float x , float y , Vector2f dest ) { } }
dest . x = this . x + x ; dest . y = this . y + y ; return dest ;
public class TimePicker { /** * initComponents , This initializes the components of the JFormDesigner panel . This function is * automatically generated by JFormDesigner from the JFD form design file , and should not be * modified by hand . This function can be modified , if needed , by using JFormDesigner . */ pri...
// JFormDesigner - Component initialization - DO NOT MODIFY / / GEN - BEGIN : initComponents timeTextField = new JTextField ( ) ; toggleTimeMenuButton = new JButton ( ) ; spinnerPanel = new JPanel ( ) ; increaseButton = new JButton ( ) ; decreaseButton = new JButton ( ) ; // = = = = = this = = = = = setLayout ( new For...
public class DateTimeFormatterBuilder { /** * Constructs a DateTimeFormatter using all the appended elements . * This is the main method used by applications at the end of the build * process to create a usable formatter . * Subsequent changes to this builder do not affect the returned formatter . * The returne...
Object f = getFormatter ( ) ; InternalPrinter printer = null ; if ( isPrinter ( f ) ) { printer = ( InternalPrinter ) f ; } InternalParser parser = null ; if ( isParser ( f ) ) { parser = ( InternalParser ) f ; } if ( printer != null || parser != null ) { return new DateTimeFormatter ( printer , parser ) ; } throw new ...
public class WebhookManager { /** * Resets all fields for this manager . * @ return WebhookManager for chaining convenience */ @ Override @ CheckReturnValue public WebhookManager reset ( ) { } }
super . reset ( ) ; this . name = null ; this . channel = null ; this . avatar = null ; return this ;
public class ResourceReader { /** * 将文件读出为输出流 * @ param filename 需要读取的文件名称 * @ return 文件内容输出流 * @ throws NoSuchPathException 无法找到对应的文件或者路径 */ public InputStreamReader getFileStream ( String filename ) throws NoSuchPathException { } }
try { return new InputStreamReader ( new FileInputStream ( filename ) ) ; } catch ( FileNotFoundException e ) { throw new NoSuchPathException ( e ) ; }
public class RDBMSEntityReader { /** * Populate relations . * @ param relations * the relations * @ param o * the o * @ return the map */ private Map < String , Object > populateRelations ( List < String > relations , Object [ ] o ) { } }
Map < String , Object > relationVal = new HashMap < String , Object > ( relations . size ( ) ) ; int counter = 1 ; for ( String r : relations ) { relationVal . put ( r , o [ counter ++ ] ) ; } return relationVal ;
public class ESClient { /** * ( non - Javadoc ) * @ see com . impetus . kundera . persistence . api . Batcher # executeBatch ( ) */ @ Override public int executeBatch ( ) { } }
BulkRequestBuilder bulkRequest = txClient . prepareBulk ( ) . setRefresh ( isRefreshIndexes ( ) ) ; try { for ( Node node : nodes ) { if ( node . isDirty ( ) ) { node . handlePreEvent ( ) ; Object entity = node . getData ( ) ; Object id = node . getEntityId ( ) ; EntityMetadata metadata = KunderaMetadataManager . getEn...
public class DataSetLookupEditor { /** * DataSetGroupDateEditor events */ void onDateGroupChanged ( @ Observes DataSetGroupDateChanged event ) { } }
ColumnGroup columnGroup = event . getColumnGroup ( ) ; DataSetGroup groupOp = getFirstGroupOp ( ) ; if ( groupOp != null ) { groupOp . setColumnGroup ( columnGroup ) ; changeEvent . fire ( new DataSetLookupChangedEvent ( dataSetLookup ) ) ; }
public class UpdateResolverRuleRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( UpdateResolverRuleRequest updateResolverRuleRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( updateResolverRuleRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( updateResolverRuleRequest . getResolverRuleId ( ) , RESOLVERRULEID_BINDING ) ; protocolMarshaller . marshall ( updateResolverRuleRequest . getConfig ( ) , CONF...
public class Headers { /** * Returns the current values of the headers in natural sort order or null if none . */ public String [ ] get ( final String name ) { } }
if ( has ( name ) ) { List < String > values = headers . get ( name ) . getValues ( ) ; return values . toArray ( new String [ values . size ( ) ] ) ; } else return null ;
public class RowVector { /** * Print the vector values . */ public void print ( ) { } }
for ( int c = 0 ; c < nCols ; ++ c ) { System . out . print ( " " + values [ 0 ] [ c ] ) ; } System . out . println ( ) ;
public class UIUtils { /** * helper method to activate or deactivate a specific flag * @ param bits * @ param on */ public static void setFlag ( Activity activity , final int bits , boolean on ) { } }
Window win = activity . getWindow ( ) ; WindowManager . LayoutParams winParams = win . getAttributes ( ) ; if ( on ) { winParams . flags |= bits ; } else { winParams . flags &= ~ bits ; } win . setAttributes ( winParams ) ;
public class SelectBase { /** * Checks to see which has more room , above or below . * If the drop - up has enough room to fully open normally , * but there is more room above , the drop - up still opens * normally . Otherwise , it becomes a drop - up . * If dropupAuto is set to < code > false < / code > , drop...
if ( ! dropupAuto ) attrMixin . setAttribute ( DROPUP_AUTO , Boolean . toString ( false ) ) ; else attrMixin . removeAttribute ( DROPUP_AUTO ) ;
public class InnerClassCompletionVisitor { /** * Adds a compilation error if a { @ link MethodNode } with the given < tt > methodName < / tt > and * < tt > parameters < / tt > exists in the { @ link InnerClassNode } . */ private void addCompilationErrorOnCustomMethodNode ( InnerClassNode node , String methodName , Pa...
MethodNode existingMethodNode = node . getMethod ( methodName , parameters ) ; // if there is a user - defined methodNode , add compiler error msg and continue if ( existingMethodNode != null && ! isSynthetic ( existingMethodNode ) ) { addError ( "\"" + methodName + "\" implementations are not supported on static inner...
public class RDBMEntityGroupStore { /** * Answers if < code > IGroupMember < / code > member is a member of < code > group < / code > . * @ return boolean * @ param group IEntityGroup * @ param member IGroupMember */ @ Override public boolean contains ( IEntityGroup group , IGroupMember member ) throws GroupsExce...
return ( member . isGroup ( ) ) ? containsGroup ( group , ( IEntityGroup ) member ) : containsEntity ( group , member ) ;
public class UpdateSkillGroupRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( UpdateSkillGroupRequest updateSkillGroupRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( updateSkillGroupRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( updateSkillGroupRequest . getSkillGroupArn ( ) , SKILLGROUPARN_BINDING ) ; protocolMarshaller . marshall ( updateSkillGroupRequest . getSkillGroupName ( ) , SKIL...
public class BitmapUtil { /** * Creates and returns a bitmap from a specific drawable . * @ param drawable * The drawable , which should be converted , as an instance of the class { @ link * Drawable } . The drawable may not be null * @ return The bitmap , which has been created , as an instance of the class { ...
Condition . INSTANCE . ensureNotNull ( drawable , "The drawable may not be null" ) ; if ( drawable instanceof BitmapDrawable ) { BitmapDrawable bitmapDrawable = ( BitmapDrawable ) drawable ; if ( bitmapDrawable . getBitmap ( ) != null ) { return bitmapDrawable . getBitmap ( ) ; } } Bitmap bitmap ; if ( drawable . getIn...
public class XPathContext { /** * Create a new < code > DTMIterator < / code > based on an XPath * < a href = " http : / / www . w3 . org / TR / xpath # NT - LocationPath > LocationPath < / a > or * a < a href = " http : / / www . w3 . org / TR / xpath # NT - UnionExpr " > UnionExpr < / a > . * @ param xpathStrin...
return m_dtmManager . createDTMIterator ( xpathString , presolver ) ;
public class NumberVectorRandomFeatureSelectionFilter { /** * Initialize random attributes . * Invoke this from { @ link # convertedType } ! * @ param in Type information . */ void initializeRandomAttributes ( SimpleTypeInformation < V > in ) { } }
int d = ( ( VectorFieldTypeInformation < V > ) in ) . getDimensionality ( ) ; selectedAttributes = BitsUtil . random ( k , d , rnd . getSingleThreadedRandom ( ) ) ;
public class PasswordManagementWebflowUtils { /** * Gets password reset questions . * @ param requestContext the request context * @ return the password reset questions */ public static List < String > getPasswordResetQuestions ( final RequestContext requestContext ) { } }
val flowScope = requestContext . getFlowScope ( ) ; return flowScope . get ( "questions" , List . class ) ;
public class NessEventSender { /** * Enqueue an event into the messaging system . */ public void enqueue ( @ Nonnull NessEvent event ) { } }
for ( NessEventTransmitter transport : eventTransmitters ) { transport . transmit ( event ) ; }
public class SourceInfoMap { /** * Expect a particular token string to be returned by the given * StringTokenizer . * @ param tokenizer * the StringTokenizer * @ param token * the expectedToken * @ return true if the expected token was returned , false if not */ private static boolean expect ( StringTokeniz...
if ( ! tokenizer . hasMoreTokens ( ) ) { return false ; } String s = tokenizer . nextToken ( ) ; if ( DEBUG ) { System . out . println ( "token=" + s ) ; } return s . equals ( token ) ;
public class PluginClassLoader { /** * Indexes the content of the plugin artifact . This includes discovering all of the * dependency JARs as well as any configuration resources such as plugin definitions . * @ throws IOException if an I / O error has occurred */ private void indexPluginArtifact ( ) throws IOExcept...
dependencyZips = new ArrayList < > ( ) ; Enumeration < ? extends ZipEntry > entries = this . pluginArtifactZip . entries ( ) ; while ( entries . hasMoreElements ( ) ) { ZipEntry zipEntry = entries . nextElement ( ) ; if ( zipEntry . getName ( ) . startsWith ( "WEB-INF/lib/" ) && zipEntry . getName ( ) . toLowerCase ( )...
public class CharacterEscapingReader { /** * Reads characters into a portion of an array . * @ param cbuf * - Destination buffer * @ param off * - Offset at which to start writing characters * @ param len * - Maximum number of characters to read * @ return The character read , or - 1 if the end of the str...
int bytesread = 0 ; while ( len -- > 0 ) { int ch = read ( ) ; if ( ch == - 1 ) { return ( bytesread > 0 ) ? bytesread : - 1 ; } cbuf [ off ++ ] = ( char ) ch ; bytesread ++ ; } return bytesread ;
public class JsonSerializer { /** * Deserialize from byte array , it always used in the generic type object . * @ param input * the JSON String byte array . * @ param typeRef * the target Object TypeReference . * @ return * the target Object instance . * @ throws JsonParseException * @ throws JsonMappin...
return mapper . readValue ( input , typeRef ) ;
public class DoubleTuples { /** * Normalize the elements of the given tuple , so that each element * will be linearly rescaled to the interval defined by the corresponding * elements of the given minimum and maximum tuple . * Each element that is equal to the corresponding minimum element will * be 0.0 in the r...
result = validate ( t , result ) ; for ( int i = 0 ; i < result . getSize ( ) ; i ++ ) { double value = t . get ( i ) ; double minValue = min . get ( i ) ; double maxValue = max . get ( i ) ; double alpha = ( value - minValue ) / ( maxValue - minValue ) ; double newValue = alpha ; result . set ( i , newValue ) ; } retu...
public class Batch { /** * Helper method to create batch from list of aggregates , for cases when list of aggregates is higher then batchLimit * @ param list * @ param < U > * @ return */ public static < U extends Aggregate > List < Batch < U > > getBatches ( List < U > list ) { } }
return getBatches ( list , batchLimit ) ;
public class GitlabAPI { /** * Creates a Group * @ param name The name of the group * @ param path The path for the group * @ param ldapCn LDAP Group Name to sync with , null otherwise * @ param ldapAccess Access level for LDAP group members , null otherwise * @ param sudoUser The user to create the group on ...
Query query = new Query ( ) . append ( "name" , name ) . append ( "path" , path ) . appendIf ( "ldap_cn" , ldapCn ) . appendIf ( "ldap_access" , ldapAccess ) . appendIf ( PARAM_SUDO , sudoUser != null ? sudoUser . getId ( ) : null ) . appendIf ( "parent_id" , parentId ) ; String tailUrl = GitlabGroup . URL + query . to...
public class ProtoUtils { /** * Returns the { @ link FieldRef } for the generated { @ link Extension } field . */ private static FieldRef getExtensionField ( FieldDescriptor descriptor ) { } }
Preconditions . checkArgument ( descriptor . isExtension ( ) , "%s is not an extension" , descriptor ) ; String extensionFieldName = getFieldName ( descriptor , false ) ; if ( descriptor . getExtensionScope ( ) != null ) { TypeInfo owner = messageRuntimeType ( descriptor . getExtensionScope ( ) ) ; return FieldRef . cr...
public class TaskScheduler { /** * Add a job to the queue . * @ param objJobDef Can be a AutoTask object or a string describing the job to run ( in the overriding class ) . */ public void addTask ( Object objJobDef ) { } }
synchronized ( this ) { gvJobs . addElement ( objJobDef ) ; // Vector is thread safe . if ( giCurrentThreads >= giMaxThreads ) return ; // The max threads are running . . . let the scheduler process them in order giCurrentThreads ++ ; // I ' m going to start another thread } TaskScheduler js = this . makeNewTaskSchedul...
public class AbstractCodeGen { /** * generate code * @ param def Definition * @ param out Writer * @ throws IOException ioException */ public void generate ( Definition def , Writer out ) throws IOException { } }
writeHeader ( def , out ) ; writeImport ( def , out ) ; writeClassComment ( def , out ) ; writeClassBody ( def , out ) ;
public class ConditionalCheck { /** * Ensures that a passed boolean is not equal to another boolean . The comparison is made using * < code > expected = = check < / code > . * We recommend to use the overloaded method { @ link ConditionalCheck # notEquals ( condition , boolean , boolean , String ) } * and pass as...
if ( condition ) { Check . notEquals ( expected , check ) ; }
public class AbstractSQLServerQuery { /** * Set the table hints * @ param tableHints table hints * @ return the current object */ @ WithBridgeMethods ( value = SQLServerQuery . class , castRequired = true ) public C tableHints ( SQLServerTableHints ... tableHints ) { } }
if ( tableHints . length > 0 ) { String hints = SQLServerGrammar . tableHints ( tableHints ) ; addJoinFlag ( hints , JoinFlag . Position . END ) ; } return ( C ) this ;
public class SourceMapConsumerV3 { /** * Compare an array entry ' s column value to the target column value . */ private static int compareEntry ( ArrayList < Entry > entries , int entry , int target ) { } }
return entries . get ( entry ) . getGeneratedColumn ( ) - target ;
public class TwoDScrollView { /** * Like { @ link View # scrollBy } , but scroll smoothly instead of immediately . * @ param dx the number of pixels to scroll by on the X axis * @ param dy the number of pixels to scroll by on the Y axis */ public final void smoothScrollBy ( int dx , int dy ) { } }
long duration = AnimationUtils . currentAnimationTimeMillis ( ) - mLastScroll ; if ( duration > ANIMATED_SCROLL_GAP ) { mScroller . startScroll ( getScrollX ( ) , getScrollY ( ) , dx , dy ) ; awakenScrollBars ( mScroller . getDuration ( ) ) ; invalidate ( ) ; } else { if ( ! mScroller . isFinished ( ) ) { mScroller . a...
public class PHPMethods { /** * Rounds a number to a specified precision . * @ param d * @ param i * @ return */ public static double round ( double d , int i ) { } }
double multiplier = Math . pow ( 10 , i ) ; return Math . round ( d * multiplier ) / multiplier ;
public class DynamicFactory { /** * Construct an implementation using the default constructor . This provides * some speed boost over invoking { @ link # ofClass ( Class , Object . . . ) } . * @ param intf the interface to construct an instance of * @ param < T > the type of the class * @ return an implementati...
try { if ( ! intf . isInterface ( ) ) throw new IllegalArgumentException ( "expected interface, got " + intf . getClass ( ) ) ; Creator < T > creator = get ( new ClassBasedKey ( intf , EMPTY_CLASS_ARRAY ) ) ; return creator . create ( null ) ; // throws an exception if no impl was found } catch ( InstantiationException...