signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class rnat6 { /** * Use this API to fetch rnat6 resource of given name . */ public static rnat6 get ( nitro_service service , String name ) throws Exception { } }
rnat6 obj = new rnat6 ( ) ; obj . set_name ( name ) ; rnat6 response = ( rnat6 ) obj . get_resource ( service ) ; return response ;
public class ListT { /** * / * ( non - Javadoc ) * @ see cyclops2 . monads . transformers . values . ListT # shuffle ( ) */ @ Override public ListT < W , T > shuffle ( ) { } }
return ( ListT < W , T > ) FoldableTransformerSeq . super . shuffle ( ) ;
public class CmsLogToPublishListChangeConverter { /** * Feeds a log entry to the converter . < p > * @ param entry the log entry to process */ public void add ( CmsLogEntry entry ) { } }
CmsUUID userId = entry . getUserId ( ) ; CmsUUID structureId = entry . getStructureId ( ) ; if ( ( userId == null ) || ( structureId == null ) ) { return ; } CmsPair < CmsUUID , CmsUUID > key = CmsPair . create ( userId , structureId ) ; if ( isDeleting ( entry ) ) { m_state . put ( key , Long . valueOf ( - 1 ) ) ; } e...
public class CollectionUtils { /** * Joins a collection of strings with the given separator into a single string . * @ param toJoin Collection containing items to join . * @ param separator String to join items with . * @ return Empty string if collection is null or empty . Otherwise joins all strings in the coll...
if ( isNullOrEmpty ( toJoin ) ) { return "" ; } StringBuilder joinedString = new StringBuilder ( ) ; int currentIndex = 0 ; for ( String s : toJoin ) { if ( s != null ) { joinedString . append ( s ) ; } if ( currentIndex ++ != toJoin . size ( ) - 1 ) { joinedString . append ( separator ) ; } } return joinedString . toS...
public class UpdatableResultSet { /** * { inheritDoc } . */ public void updateAsciiStream ( int columnIndex , InputStream inputStream , long length ) throws SQLException { } }
checkUpdatable ( columnIndex ) ; if ( inputStream == null ) { parameterHolders [ columnIndex - 1 ] = new NullParameter ( ColumnType . BLOB ) ; return ; } parameterHolders [ columnIndex - 1 ] = new StreamParameter ( inputStream , length , noBackslashEscapes ) ;
public class CmsConfigurationCache { /** * Looks up the root path for a given structure id . < p > * This is used for correcting the paths of cached resource objects . < p > * @ param structureId the structure id * @ return the root path for the structure id * @ throws CmsException if the resource with the give...
String rootPath = m_pathCache . get ( structureId ) ; if ( rootPath != null ) { return rootPath ; } CmsResource res = m_cms . readResource ( structureId ) ; m_pathCache . put ( structureId , res . getRootPath ( ) ) ; return res . getRootPath ( ) ;
public class CxDxSessionFactoryImpl { /** * ( non - Javadoc ) * @ see org . jdiameter . api . cxdx . ServerCxDxSessionListener # doRegistrationTerminationAnswer ( org . jdiameter . api . cxdx . ServerCxDxSession , * org . jdiameter . api . cxdx . events . JRegistrationTerminationRequest , org . jdiameter . api . cx...
logger . info ( "Diameter Cx/Dx Session Factory :: doRegistrationTerminationAnswer :: appSession[{}], Request[{}], Answer[{}]" , new Object [ ] { appSession , request , answer } ) ;
public class ByteUtils { /** * Read an int from the byte array starting at the given offset * @ param bytes The byte array to read from * @ param offset The offset to start reading at * @ return The int read */ public static int readInt ( byte [ ] bytes , int offset ) { } }
return ( ( ( bytes [ offset + 0 ] & 0xff ) << 24 ) | ( ( bytes [ offset + 1 ] & 0xff ) << 16 ) | ( ( bytes [ offset + 2 ] & 0xff ) << 8 ) | ( bytes [ offset + 3 ] & 0xff ) ) ;
public class TreeMultiMap { /** * { @ inheritDoc } */ public SortedMultiMap < K , V > headMap ( K toKey ) { } }
return new TreeMultiMap < K , V > ( map . headMap ( toKey ) , this ) ;
public class DeploymentsInner { /** * Gets a deployment . * @ param resourceGroupName The name of the resource group . The name is case insensitive . * @ param deploymentName The name of the deployment to get . * @ param serviceCallback the async ServiceCallback to handle successful and failed responses . * @ t...
return ServiceFuture . fromResponse ( getByResourceGroupWithServiceResponseAsync ( resourceGroupName , deploymentName ) , serviceCallback ) ;
public class SheetBase { /** * The currently selected column . * @ return */ public Integer getSelectedColumn ( ) { } }
final Object result = getStateHelper ( ) . eval ( PropertyKeys . selectedColumn ) ; if ( result == null ) { return null ; } return Integer . valueOf ( result . toString ( ) ) ;
public class WsFederationConfiguration { /** * getSigningCredential loads up an X509Credential from a file . * @ param resource the signing certificate file * @ return an X509 credential */ private static Credential getSigningCredential ( final Resource resource ) { } }
try ( val inputStream = resource . getInputStream ( ) ) { val certificateFactory = CertificateFactory . getInstance ( "X.509" ) ; val certificate = ( X509Certificate ) certificateFactory . generateCertificate ( inputStream ) ; val publicCredential = new BasicX509Credential ( certificate ) ; LOGGER . debug ( "Signing cr...
public class Predicates { /** * Returns a predicate that evaluates to { @ code true } if its * argument is between { @ code low } ( inclusive ) and { @ code high } * ( exclusive ) . */ public static < T extends Comparable < T > > Predicate < T > between ( final T low , final T high ) { } }
return new Predicate < T > ( ) { @ Override public boolean apply ( T obj ) { return obj != null && ( low == null || obj . compareTo ( low ) >= 0 ) && ( high == null || obj . compareTo ( high ) < 0 ) ; } } ;
public class ManualDescriptor { /** * setter for keywordList - sets A collection of objects of type uima . julielab . uima . Keyword , O * @ generated * @ param v value to set into the feature */ public void setKeywordList ( FSArray v ) { } }
if ( ManualDescriptor_Type . featOkTst && ( ( ManualDescriptor_Type ) jcasType ) . casFeat_keywordList == null ) jcasType . jcas . throwFeatMissing ( "keywordList" , "de.julielab.jules.types.pubmed.ManualDescriptor" ) ; jcasType . ll_cas . ll_setRefValue ( addr , ( ( ManualDescriptor_Type ) jcasType ) . casFeatCode_key...
public class Util { /** * make a locale from the standard underscore separated parts - no idea why * this isn ' t in Locale * @ param val teh locale String e . g . en _ US * @ return a Locale * @ throws Throwable */ public static Locale makeLocale ( final String val ) throws Throwable { } }
String lang = null ; String country = "" ; // NOT null for Locale String variant = "" ; if ( val == null ) { throw new Exception ( "Bad Locale: NULL" ) ; } if ( val . length ( ) == 2 ) { lang = val ; } else { int pos = val . indexOf ( '_' ) ; if ( pos != 2 ) { throw new Exception ( "Bad Locale: " + val ) ; } lang = val...
public class UserResources { /** * Updates user preferences . * @ param req The HTTP request . * @ param userId The ID of the user to update . * @ param prefs The updated preferences . * @ return The updated user DTO . * @ throws WebApplicationException If an error occurs . */ @ PUT @ Produces ( MediaType . A...
if ( userId == null || userId . compareTo ( BigInteger . ZERO ) < 1 ) { throw new WebApplicationException ( "User Id cannot be null and must be a positive non-zero number." , Status . BAD_REQUEST ) ; } if ( prefs == null ) { throw new WebApplicationException ( "Cannot update with null prefs." , Status . BAD_REQUEST ) ;...
public class MembershipHandlerImpl { /** * { @ inheritDoc } */ public Membership removeMembership ( String id , boolean broadcast ) throws Exception { } }
Session session = service . getStorageSession ( ) ; try { return removeMembership ( session , id , broadcast ) ; } finally { session . logout ( ) ; }
public class PebbleDictionary { /** * Associate the specified signed byte with the provided key in the dictionary . If another key - value pair with the * same key is already present in the dictionary , it will be replaced . * @ param key * key with which the specified value is associated * @ param b * value ...
PebbleTuple t = PebbleTuple . create ( key , PebbleTuple . TupleType . INT , PebbleTuple . Width . BYTE , b ) ; addTuple ( t ) ;
public class Contracts { /** * Construct an { @ code int } specialized predicate from the given predicate * function and describer . * @ param condition The predicate function * @ param describer The describer * @ return A predicate */ public static ContractIntCondition conditionI ( final IntPredicate condition...
return ContractIntCondition . of ( condition , describer ) ;
public class NodeSequence { /** * Create a sequence of nodes that iterates over the supplied nodes . Note that the supplied iterator is accessed lazily as the * resulting sequence ' s { @ link # nextBatch ( ) first batch } is { @ link Batch # nextRow ( ) used } . * @ param nodes the iterator over the nodes to be re...
if ( nodes == null || nodes . isEmpty ( ) ) return emptySequence ( 1 ) ; return withNodes ( nodes . iterator ( ) , nodes . size ( ) , score , workspaceName ) ;
public class JXLayer { /** * { @ inheritDoc } */ @ Override protected void addImpl ( Component comp , Object constraints , int index ) { } }
contentPane . add ( comp , constraints , index ) ; doLayout ( ) ;
public class AmazonAlexaForBusinessClient { /** * Retrieves the details of a gateway group . * @ param getGatewayGroupRequest * @ return Result of the GetGatewayGroup operation returned by the service . * @ throws NotFoundException * The resource is not found . * @ sample AmazonAlexaForBusiness . GetGatewayGr...
request = beforeClientExecution ( request ) ; return executeGetGatewayGroup ( request ) ;
public class MmffAromaticTypeMapping { /** * Update aromatic atom types in a six member ring . The aromatic types here are hard coded from * the ' MMFFAROM . PAR ' file . * @ param cycle 6 - member aromatic cycle / ring * @ param symbs vector of symbolic types for the whole structure */ static void updateAromatic...
for ( final int v : cycle ) { if ( NCN_PLUS . equals ( symbs [ v ] ) || "N+=C" . equals ( symbs [ v ] ) || "N=+C" . equals ( symbs [ v ] ) ) symbs [ v ] = "NPD+" ; else if ( "N2OX" . equals ( symbs [ v ] ) ) symbs [ v ] = "NPOX" ; else if ( "N=C" . equals ( symbs [ v ] ) || "N=N" . equals ( symbs [ v ] ) ) symbs [ v ] ...
public class DisruptorQueue { /** * { @ inheritDoc } * @ throws QueueException . QueueIsFull * if the ring buffer is full */ @ Override public boolean requeue ( IQueueMessage < ID , DATA > _msg ) throws QueueException . QueueIsFull { } }
IQueueMessage < ID , DATA > msg = _msg . clone ( ) ; Date now = new Date ( ) ; msg . incNumRequeues ( ) . setQueueTimestamp ( now ) ; putToRingBuffer ( msg ) ; if ( ! isEphemeralDisabled ( ) ) { ephemeralStorage . remove ( msg . getId ( ) ) ; } return true ;
public class MarkdownParser { /** * Checking if symbol is not eq to c * @ param text * @ param index * @ param c * @ return */ private boolean isNotSymbol ( String text , int index , char c ) { } }
if ( index >= 0 && index < text . length ( ) ) { return text . charAt ( index ) != c ; } return true ;
public class Record { /** * Returns the system type for this record , i . e . , the { @ code rdf : type } URI under the * { @ code ks : } namespace , if any . * @ return the system type or null if not set * @ throws IllegalArgumentException * in case multiple system types are bound to the record */ @ Nullable p...
URI result = null ; for ( final URI type : get ( RDF . TYPE , URI . class ) ) { if ( type . getNamespace ( ) . equals ( KS . NAMESPACE ) ) { Preconditions . checkArgument ( result == null , "Multiple system types: " + result + ", " + type ) ; result = type ; } } return result ;
public class UserInformationImpl { /** * ( non - Javadoc ) * @ see org . mobicents . protocols . asn . External # encode ( org . mobicents . protocols . asn . AsnOutputStream ) */ public void encode ( AsnOutputStream aos ) throws EncodeException { } }
try { aos . writeTag ( Tag . CLASS_CONTEXT_SPECIFIC , false , _TAG ) ; int pos = aos . StartContentDefiniteLength ( ) ; ext . encode ( aos ) ; aos . FinalizeContent ( pos ) ; } catch ( AsnException e ) { throw new EncodeException ( "AsnException when encoding UserInformation: " + e . getMessage ( ) , e ) ; }
public class NotificationHubsInner { /** * Deletes a notification hub associated with a namespace . * @ param resourceGroupName The name of the resource group . * @ param namespaceName The namespace name . * @ param notificationHubName The notification hub name . * @ throws IllegalArgumentException thrown if pa...
deleteWithServiceResponseAsync ( resourceGroupName , namespaceName , notificationHubName ) . toBlocking ( ) . single ( ) . body ( ) ;
public class UnicodeSet { /** * Span a string using this UnicodeSet . * If the start index is less than 0 , span will start from 0. * If the start index is greater than the string length , span returns the string length . * < p > To replace , count elements , or delete spans , see { @ link android . icu . text . ...
int end = s . length ( ) ; if ( start < 0 ) { start = 0 ; } else if ( start >= end ) { return end ; } if ( bmpSet != null ) { // Frozen set without strings , or no string is relevant for span ( ) . return bmpSet . span ( s , start , spanCondition , null ) ; } if ( stringSpan != null ) { return stringSpan . span ( s , s...
public class SPathFilter { /** * Filter for processingInstruction ( ) . */ public void processingInstruction ( String target , String data ) throws SAXException { } }
if ( isAccepted ( ) ) getContentHandler ( ) . processingInstruction ( target , data ) ;
public class FieldAnnotationParser { /** * Parse { @ link ViewId } annotation and try to assign the view with that id to the annotated field . * It will throw a { @ link ClassCastException } if the field and the view with the given ID have different types . * @ param object object where the annotation is . * @ pa...
Field [ ] fields = object . getClass ( ) . getDeclaredFields ( ) ; for ( Field field : fields ) { if ( field . isAnnotationPresent ( ViewId . class ) ) { field . setAccessible ( true ) ; ViewId viewIdAnnotation = field . getAnnotation ( ViewId . class ) ; try { field . set ( object , field . getType ( ) . cast ( viewFi...
public class XFactory { /** * Create an XField object * @ param className * @ param fieldName * @ param fieldSignature * @ param isStatic * @ return the created XField */ public static XField createXField ( @ DottedClassName String className , String fieldName , String fieldSignature , boolean isStatic ) { } ...
FieldDescriptor fieldDesc = DescriptorFactory . instance ( ) . getFieldDescriptor ( ClassName . toSlashedClassName ( className ) , fieldName , fieldSignature , isStatic ) ; return createXField ( fieldDesc ) ;
public class BiddableAdGroupCriterion { /** * Gets the firstPositionCpc value for this BiddableAdGroupCriterion . * @ return firstPositionCpc * An estimate of the cpc bid needed for your ad to regularly * appear in the top position above * the search results on google . com when a query * matches the keywords e...
return firstPositionCpc ;
public class Checker { /** * 检测字符串是否全部是大写字母 * @ param string 字符串 * @ return { @ link Boolean } * @ since 1.0.9 */ public static boolean isOnlyUpperCase ( String string ) { } }
boolean result = isNotEmpty ( string ) ; int idx = 0 ; int len = string . length ( ) ; while ( result ) { if ( idx >= len ) { break ; } result = isUpperCase ( string . charAt ( idx ) ) ; idx ++ ; } return result ;
public class Privateer { /** * Examines each argument to see if a param in the same position is a supertype . This method is * needed because getDeclaredMethod ( ) does a formal type match . For example , if the method takes * a java . util . List as a parameter , getDeclaredMethod ( ) will never match , since the ...
Method matchingMethod = null ; Method [ ] methods = o . getClass ( ) . getDeclaredMethods ( ) ; methodloop : for ( Method method : methods ) { if ( methodName . equals ( method . getName ( ) ) ) { Class < ? > [ ] params = method . getParameterTypes ( ) ; if ( params . length == types . length ) { for ( int i = 0 ; i < ...
public class LDAPAttributeFinder { /** * Used to get an attribute . If one of those values isn ' t being asked for , * or if the types are wrong , then an empty bag is returned . * @ param attributeType * the datatype of the attributes to find , which must be time , date , * or dateTime for this module to resol...
String user = null ; URI userId = Constants . SUBJECT . LOGIN_ID . getURI ( ) ; URI category = XACML1SubjectCategoryNamespace . getInstance ( ) . ACCESS_SUBJECT . getURI ( ) ; EvaluationResult userER = context . getSubjectAttribute ( STRING_DATATYPE , userId , category ) ; if ( userER == null ) { return new EvaluationR...
public class BinaryString { /** * Find the boundaries of segments , and then compare MemorySegment . */ private int compareMultiSegments ( BinaryString other ) { } }
if ( sizeInBytes == 0 || other . sizeInBytes == 0 ) { return sizeInBytes - other . sizeInBytes ; } int len = Math . min ( sizeInBytes , other . sizeInBytes ) ; MemorySegment seg1 = segments [ 0 ] ; MemorySegment seg2 = other . segments [ 0 ] ; int segmentSize = segments [ 0 ] . size ( ) ; int otherSegmentSize = other ....
public class StateMachine { /** * Handles a special CellChunk that is marked with the reset flag . Will drop all buffers and * transition to the { @ link # AWAITING _ NEW _ ROW } state . */ private State handleResetChunk ( CellChunk cellChunk ) { } }
validate ( cellChunk . getRowKey ( ) . isEmpty ( ) , "Reset chunks can't have row keys" ) ; validate ( ! cellChunk . hasFamilyName ( ) , "Reset chunks can't have families" ) ; validate ( ! cellChunk . hasQualifier ( ) , "Reset chunks can't have qualifiers" ) ; validate ( cellChunk . getTimestampMicros ( ) == 0 , "Reset...
public class UpdateBuilder { /** * 参数是否已经合并 . */ @ Override public StatementParameter getParam ( ) { } }
if ( ! isMergedParam ) { StatementParameter param = where . getParam ( ) ; int size = param . size ( ) ; for ( int i = 0 ; i < size ; i ++ ) { Class < ? > type = param . getType ( i ) ; Object value = param . getObject ( i ) ; statementParameter . setObject ( type , value ) ; } } isMergedParam = true ; return statement...
public class NfsFileBase { /** * ( non - Javadoc ) * @ see * com . emc . ecs . nfsclient . nfs . NfsFile # link ( com . emc . ecs . nfsclient . nfs . NfsFile ) */ public NfsLinkResponse link ( F source ) throws IOException { } }
NfsLinkResponse response = getNfs ( ) . wrapped_sendLink ( makeLinkRequest ( source ) ) ; setFileHandle ( source . getFileHandle ( ) ) ; return response ;
public class ZipkinTraceExporter { /** * Creates and registers the Zipkin Trace exporter to the OpenCensus library . Only one Zipkin * exporter can be registered at any point . * @ param encoder Usually { @ link SpanBytesEncoder # JSON _ V2} * @ param sender Often , but not necessarily an http sender . This could...
synchronized ( monitor ) { checkState ( handler == null , "Zipkin exporter is already registered." ) ; Handler newHandler = new ZipkinExporterHandler ( encoder , sender , serviceName ) ; handler = newHandler ; register ( Tracing . getExportComponent ( ) . getSpanExporter ( ) , newHandler ) ; }
public class SystemPublicMetrics { /** * Add basic system metrics . * @ param result the result */ protected void addBasicMetrics ( Collection < Metric < ? > > result ) { } }
// NOTE : ManagementFactory must not be used here since it fails on GAE Runtime runtime = Runtime . getRuntime ( ) ; result . add ( newMemoryMetric ( "mem" , runtime . totalMemory ( ) + getTotalNonHeapMemoryIfPossible ( ) ) ) ; result . add ( newMemoryMetric ( "mem.free" , runtime . freeMemory ( ) ) ) ; result . add ( ...
public class HMMPOSTagger { /** * Returns the default English POS tagger . * @ return the default English POS tagger */ public static HMMPOSTagger getDefault ( ) { } }
if ( DEFAULT_TAGGER == null ) { try { ObjectInputStream ois = new ObjectInputStream ( HMMPOSTagger . class . getResourceAsStream ( "/smile/nlp/pos/hmmpostagger.model" ) ) ; DEFAULT_TAGGER = ( HMMPOSTagger ) ois . readObject ( ) ; ois . close ( ) ; } catch ( Exception ex ) { logger . error ( "Failed to load /smile/nlp/p...
public class LoggingUtils { /** * Method attempting to retrieve host port identifier * @ param address * @ return */ private static String getHostPort ( SocketAddress address ) { } }
if ( address instanceof ResourceAddress ) { ResourceAddress lowest = getLowestTransportLayer ( ( ResourceAddress ) address ) ; return format ( HOST_PORT_FORMAT , lowest . getResource ( ) . getHost ( ) , lowest . getResource ( ) . getPort ( ) ) ; } if ( address instanceof InetSocketAddress ) { InetSocketAddress inet = (...
public class AptMethod { /** * Returns the argument declaration of the method , applying the bindings in the provided * type map to any parameter types */ public String getArgDecl ( HashMap < String , TypeMirror > bindingMap ) { } }
StringBuffer sb = new StringBuffer ( ) ; if ( _methodDecl . getParameters ( ) == null ) return "" ; int i = 0 ; for ( ParameterDeclaration paramDecl : _methodDecl . getParameters ( ) ) { TypeMirror paramType = paramDecl . getType ( ) ; if ( paramType == null ) return "" ; if ( bindingMap != null && bindingMap . contain...
public class Mixer2Engine { /** * marshal the inner objects of tag to string and return it . * < pre > * & lt ; - - html - - & gt ; * & lt ; div id = " foo " & gt ; aaa & lt ; span & gt ; bbb & lt ; / span & gt ; ccc & lt ; / div & gt ; * < / pre > * < pre > * / / code * List & lt ; Object & gt ; list = h...
StringBuilder sb = new StringBuilder ( ) ; for ( Object obj : list ) { if ( obj == null ) { continue ; } else if ( obj instanceof AbstractJaxb ) { sb . append ( this . saveToString ( ( AbstractJaxb ) obj ) ) ; } else { sb . append ( obj . toString ( ) ) ; } } return sb . toString ( ) ;
public class ShuttleList { /** * Move all the source items to the chosen side . I . e . , select all the items . */ protected void moveAllLeftToRight ( ) { } }
int sz = dataModel . getSize ( ) ; int [ ] selected = new int [ sz ] ; for ( int i = 0 ; i < sz ; i ++ ) { selected [ i ] = i ; } helperList . setSelectedIndices ( selected ) ; update ( ) ;
public class GHRequest { /** * Add stopover point to routing request . * @ param point geographical position ( see GHPoint ) * @ param favoredHeading north based azimuth ( clockwise ) in ( 0 , 360 ) or NaN for equal preference */ public GHRequest addPoint ( GHPoint point , double favoredHeading ) { } }
if ( point == null ) throw new IllegalArgumentException ( "point cannot be null" ) ; if ( ! possibleToAdd ) throw new IllegalStateException ( "Please call empty constructor if you intent to use " + "more than two places via addPoint method." ) ; points . add ( point ) ; validateAzimuthValue ( favoredHeading ) ; favored...
public class ProfilerFactory { /** * Function wraps Object into Profiling Java Proxy . * Used to wrap QueryRunner instance with Java Proxy * @ param obj Object which would be wrapped into Profiling Proxy * @ return Java Proxy with wrapped input object */ public static Object newInstance ( Object obj ) { } }
if ( MjdbcLogger . isSLF4jAvailable ( ) == true && MjdbcLogger . isSLF4jImplementationAvailable ( ) == false ) { // Logging depends on slf4j . If it haven ' t found any logging system // connected - it is turned off . // In such case there is no need to output profiling information as // it won ' t be printed out . ret...
public class EsIndex { /** * Appends specified values for the given column and related pseudo columns * into list of properties . * @ param doc list of properties in json format * @ param column colum definition * @ param value column ' s value . */ private void putValues ( EsRequest doc , EsIndexColumn column ...
Object [ ] columnValue = column . columnValues ( value ) ; int [ ] ln = new int [ columnValue . length ] ; String [ ] lc = new String [ columnValue . length ] ; String [ ] uc = new String [ columnValue . length ] ; for ( int i = 0 ; i < columnValue . length ; i ++ ) { String stringValue = column . stringValue ( columnV...
public class AbstractLimitHandler { /** * Default implementation of binding parameter values needed by the LIMIT clause . * @ param selection the selection criteria for rows . * @ param statement Statement to which to bind limit parameter values . * @ param index Index from which to start binding . * @ return T...
if ( ! supportsVariableLimit ( ) || ! LimitHelper . hasMaxRows ( selection ) ) { return 0 ; } final int firstRow = convertToFirstRowValue ( LimitHelper . getFirstRow ( selection ) ) ; final int lastRow = getMaxOrLimit ( selection ) ; final boolean hasFirstRow = supportsLimitOffset ( ) && ( firstRow > 0 || forceLimitUsa...
public class Report { /** * Helper method to set all the user attributes . * @ param id the identifier of the user . * @ param email the email of the user . * @ param name the name of the user . * @ return the modified report . */ public Report setUser ( String id , String email , String name ) { } }
diagnostics . user . put ( "id" , id ) ; diagnostics . user . put ( "email" , email ) ; diagnostics . user . put ( "name" , name ) ; return this ;
public class TimeUtils { /** * Returns " Today " , " Tomorrow " , " Yesterday " , or a short date format . */ public static String formatHumanFriendlyShortDate ( final Context context , long timestamp ) { } }
long localTimestamp , localTime ; long now = System . currentTimeMillis ( ) ; TimeZone tz = TimeZone . getDefault ( ) ; localTimestamp = timestamp + tz . getOffset ( timestamp ) ; localTime = now + tz . getOffset ( now ) ; long dayOrd = localTimestamp / 86400000L ; long nowOrd = localTime / 86400000L ; if ( dayOrd == n...
public class Matchers { /** * Matches on the type of a VariableTree AST node . * @ param treeMatcher A matcher on the type of the variable . */ public static Matcher < VariableTree > variableType ( final Matcher < Tree > treeMatcher ) { } }
return new Matcher < VariableTree > ( ) { @ Override public boolean matches ( VariableTree variableTree , VisitorState state ) { return treeMatcher . matches ( variableTree . getType ( ) , state ) ; } } ;
public class AddOnInstaller { /** * Gets the files of the given add - on that can be safely uninstalled , that is , are not in use / declared by other add - ons . * @ param addOn the add - on whose files should be uninstalled . * @ param installedAddOns the add - ons currently installed . * @ return the files tha...
if ( addOn . getFiles ( ) == null || addOn . getFiles ( ) . isEmpty ( ) ) { return Collections . emptyList ( ) ; } List < String > files = new ArrayList < > ( addOn . getFiles ( ) ) ; installedAddOns . forEach ( installedAddOn -> { if ( installedAddOn == addOn ) { return ; } List < String > addOnFiles = installedAddOn ...
public class StringUtil { /** * Convert a < code > String < / code > to a < code > Double < / code > . * Returns an empty { @ code OptionalDouble } if the string is { @ code null } or can ' t be parsed as { @ code Double } . * @ param str a < code > String < / code > to convert , may be null * @ return */ public ...
if ( N . isNullOrEmpty ( str ) ) { return OptionalDouble . empty ( ) ; } try { return OptionalDouble . of ( Double . parseDouble ( str ) ) ; } catch ( NumberFormatException e ) { return OptionalDouble . empty ( ) ; }
public class Utils { /** * Returns formatted size of a file size . * @ param value * The value * @ return String */ public static String formatSize ( final long value ) { } }
double size = value ; DecimalFormat df = new DecimalFormat ( "#.##" ) ; if ( size >= GB ) { return df . format ( size / GB ) + " GB" ; } if ( size >= MB ) { return df . format ( size / MB ) + " MB" ; } if ( size >= KB ) { return df . format ( size / KB ) + " KB" ; } return String . valueOf ( ( int ) size ) + " bytes" ;
public class FinanceUtils { /** * GrowthRate = ln ( GrowthFactor ) * @ param growthFactor A growth factor per unit ( day , week , month , year . . . ) * @ param growthFactorUnit A growth factor unit * @ return Annualised return ( percentage per year ) */ public static double toAnnualReturnFromGrowthFactor ( doubl...
double tmpGrowthFactorUnitsPerYear = growthFactorUnit . convert ( CalendarDateUnit . YEAR ) ; return PrimitiveMath . POW . invoke ( growthFactor , tmpGrowthFactorUnitsPerYear ) - PrimitiveMath . ONE ;
public class AstFactory { /** * Creates a statement ` lhs = rhs ; ` . */ Node createAssignStatement ( Node lhs , Node rhs ) { } }
return exprResult ( createAssign ( lhs , rhs ) ) ;
public class RemoteDurableTopicSubscriber { /** * ( non - Javadoc ) * @ see net . timewalker . ffmq4 . remote . session . RemoteMessageConsumer # remoteInit ( ) */ @ Override protected final void remoteInit ( ) throws JMSException { } }
CreateDurableSubscriberQuery query = new CreateDurableSubscriberQuery ( ) ; query . setSessionId ( session . getId ( ) ) ; query . setConsumerId ( id ) ; query . setTopic ( ( Topic ) destination ) ; query . setMessageSelector ( messageSelector ) ; query . setNoLocal ( noLocal ) ; query . setName ( subscriptionName ) ; ...
public class TldTracker { /** * Combines hypotheses from tracking and detection . * @ param trackingWorked If the sequential tracker updated the track region successfully or not * @ return true a hypothesis was found , false if it failed to find a hypothesis */ protected boolean hypothesisFusion ( boolean trackingW...
valid = false ; boolean uniqueDetection = detectionWorked && ! detection . isAmbiguous ( ) ; TldRegion detectedRegion = detection . getBest ( ) ; double confidenceTarget ; if ( trackingWorked ) { // get the scores from tracking and detection double scoreTrack = template . computeConfidence ( trackerRegion_I32 ) ; doubl...
public class ContextInitializer { /** * Does the actual processing of found fields . * @ param component owner of the fields . * @ param fields present in one of superclasses of the component . * @ param context used to resolve dependencies . * @ param contextDestroyer used to register destruction callbacks . *...
"rawtypes" , "unchecked" } ) // Using correct types , but wildcards fail to see that . private void processFields ( final Object component , final Field [ ] fields , final Context context , final ContextDestroyer contextDestroyer ) { for ( final Field field : fields ) { final com . badlogic . gdx . utils . reflect . An...
public class ListMetricsResult { /** * The metrics . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setMetrics ( java . util . Collection ) } or { @ link # withMetrics ( java . util . Collection ) } if you want to override * the existing values . * @ par...
if ( this . metrics == null ) { setMetrics ( new com . amazonaws . internal . SdkInternalList < Metric > ( metrics . length ) ) ; } for ( Metric ele : metrics ) { this . metrics . add ( ele ) ; } return this ;
public class DOValidatorModule { /** * Validates a digital object . * @ param objectAsStream * The digital object provided as a bytestream . * @ param validationType * The level of validation to perform on the digital object . This is * an integer from 0-2 with the following meanings : 0 = VALIDATE _ ALL * ...
dov . validate ( objectAsStream , format , validationType , phase ) ;
public class Flowable { /** * Maps the upstream items into { @ link MaybeSource } s and subscribes to them one after the * other succeeds or completes , emits their success value if available or terminates immediately if * either this { @ code Flowable } or the current inner { @ code MaybeSource } fail . * < img ...
ObjectHelper . requireNonNull ( mapper , "mapper is null" ) ; ObjectHelper . verifyPositive ( prefetch , "prefetch" ) ; return RxJavaPlugins . onAssembly ( new FlowableConcatMapMaybe < T , R > ( this , mapper , ErrorMode . IMMEDIATE , prefetch ) ) ;
public class ChannelSelector { /** * Set the next timeout marker to the provided value if appropriate . * @ param newTimeoutTime */ protected void resetTimeout ( long newTimeoutTime ) { } }
// See if anything may have timed out if ( newTimeoutTime < this . nextTimeoutTime ) { this . nextTimeoutTime = newTimeoutTime ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( this , tc , "resetTimeout waking up selector" ) ; } wakeup ( ) ; }
public class XYPlot { /** * Make a new curve . * @ return Curve */ public Curve makeCurve ( ) { } }
Curve c = new Curve ( curves . size ( ) ) ; curves . add ( c ) ; return c ;
public class Search { /** * set the value collection The logical collection name that is the target of the search operation * or an external collection with fully qualified path . * @ param collection value to set * @ throws PageException */ public void setCollection ( String collection ) throws PageException { }...
String [ ] collNames = ListUtil . toStringArrayTrim ( ListUtil . listToArrayRemoveEmpty ( collection , ',' ) ) ; collections = new SearchCollection [ collNames . length ] ; SearchEngine se = pageContext . getConfig ( ) . getSearchEngine ( pageContext ) ; try { for ( int i = 0 ; i < collections . length ; i ++ ) { colle...
public class TableFactor { /** * Address a variable by index to get it ' s size . Basically just a convenience function . * @ param variable the name , not index into neighbors , of the variable in question * @ return the size of the factor along this dimension */ private int getVariableSize ( int variable ) { } }
for ( int i = 0 ; i < neighborIndices . length ; i ++ ) { if ( neighborIndices [ i ] == variable ) return getDimensions ( ) [ i ] ; } return 0 ;
public class StopWatchFactory { /** * Load configuration file , try to parse it and do something useful . * @ throws ConfigurationException If configuration fails . */ @ SuppressWarnings ( "unchecked" ) private static synchronized void configure ( InputStream in ) throws ConfigurationException { } }
if ( c_factories == null ) c_factories = new HashMap < String , StopWatchFactory > ( ) ; try { c_config . load ( in ) ; } catch ( IOException e2 ) { throw new ConfigurationException ( e2 ) ; } for ( Enumeration < String > e = ( Enumeration < String > ) c_config . propertyNames ( ) ; e . hasMoreElements ( ) ; ) { String...
public class SetupProjectProcess { /** * Run Method . */ public void run ( ) { } }
String bookmark = this . getProperty ( DBConstants . OBJECT_ID ) ; try { this . getMainRecord ( ) . setHandle ( bookmark , DBConstants . OBJECT_ID_HANDLE ) ; } catch ( DBException e ) { e . printStackTrace ( ) ; } this . populateSourceDir ( TEMPLATE_LOCATION ) ;
public class Validator { /** * Validate a set of properties for a description , and return a report . * @ param resolver property resolver * @ param description description * @ param defaultScope default scope for properties * @ param ignoredScope ignore properties at or below this scope , or null to ignore non...
final Report report = new Report ( ) ; final List < Property > properties = description . getProperties ( ) ; final Map < String , Object > inputConfig = PluginAdapterUtility . mapDescribedProperties ( resolver , description , defaultScope ) ; validate ( asProperties ( inputConfig ) , report , properties , ignoredScope...
public class ExclusiveLockStrategy { /** * PQ53065 */ @ Override public boolean lock ( EJSContainer c , ContainerTx tx , Object lockName , int mode ) throws LockException { } }
try { Locker locker = tx ; // d139352-2 return c . getLockManager ( ) . lock ( lockName , locker , mode ) ; } catch ( InterruptedException ex ) { FFDCFilter . processException ( ex , CLASS_NAME + ".lock" , "75" , this ) ; Tr . fatal ( tc , "ATTEMPT_TO_ACQUIRE_LOCK_INTERRUPTED_CNTR0004E" , new Object [ ] { ex } ) ; // p...
public class CrawlController { /** * This function can called to assign a specific document id to a url . This * feature is useful when you have had a previous crawl and have stored the * Urls and their associated document ids and want to have a new crawl which * is aware of the previously seen Urls and won ' t r...
String canonicalUrl = URLCanonicalizer . getCanonicalURL ( url ) ; if ( canonicalUrl == null ) { logger . error ( "Invalid Url: {} (can't cannonicalize it!)" , url ) ; } else { try { docIdServer . addUrlAndDocId ( canonicalUrl , docId ) ; } catch ( RuntimeException e ) { if ( config . isHaltOnError ( ) ) { throw e ; } ...
public class SyncManager { /** * Starts a new { @ link SyncThread } with the given < code > bucketId < / code > . Returns true if the { @ link SyncThread } was * successful started , false otherwise . < br > * < br > * The { @ link SyncThread } is not started , if the bucket is empty , already in process or does ...
// bucket is in process or doesnt exist if ( isBucketProcessed ( bucketId ) || bucketId == - 1 ) { log . debug ( "Can't add BufferThread. Bucket {} does not exist or a bucket with the same id is already in processing." , bucketId ) ; return false ; } Bucket < Data > oldBucket = bucketContainer . getBucket ( bucketId ) ...
public class MvpQueuingBasePresenter { /** * Runs the queued actions . */ private void runQueuedActions ( ) { } }
V view = viewRef == null ? null : viewRef . get ( ) ; if ( view != null ) { while ( ! viewActionQueue . isEmpty ( ) ) { ViewAction < V > action = viewActionQueue . poll ( ) ; action . run ( view ) ; } }
public class ManualArrayCopy { /** * looks to see if a load and store operation are working on the same type of array * @ param load * the load instruction on an array * @ param store * the store instruction on an array * @ return whether the type of the load and store are the same */ private static boolean s...
return ( ( load == Const . AALOAD ) && ( store == Const . AASTORE ) ) || ( ( load == Const . IALOAD ) && ( store == Const . IASTORE ) ) || ( ( load == Const . DALOAD ) && ( store == Const . DASTORE ) ) || ( ( load == Const . LALOAD ) && ( store == Const . LASTORE ) ) || ( ( load == Const . FALOAD ) && ( store == Const ...
public class CmsStaticExportManager { /** * Returns true if the links in the static export should be relative . < p > * @ param vfsName the name of the resource to export * @ return true if the links in the static export should be relative */ public boolean relativeLinksInExport ( String vfsName ) { } }
if ( vfsName != null ) { Iterator < CmsStaticExportRfsRule > it = m_rfsRules . iterator ( ) ; while ( it . hasNext ( ) ) { CmsStaticExportRfsRule rule = it . next ( ) ; if ( rule . getSource ( ) . matcher ( vfsName ) . matches ( ) ) { return rule . getUseRelativeLinks ( ) != null ? rule . getUseRelativeLinks ( ) . bool...
public class InMemoryChunkAccumulator { /** * Returns true if all chunks are present * @ param id the id to check for * @ return true if all the chunks are present , false otherwise */ @ Override public boolean allPresent ( String id ) { } }
if ( ! chunks . containsKey ( id ) ) return false ; List < NDArrayMessageChunk > chunkList = chunks . get ( id ) ; return chunkList . size ( ) == chunkList . get ( 0 ) . getNumChunks ( ) ;
public class FTPConnection { /** * Registers an option for the OPTS command * @ param option The option name * @ param value The default value */ public void registerOption ( String option , String value ) { } }
options . put ( option . toUpperCase ( ) , value ) ;
public class ConstraintSolver { /** * Gets a description of this { @ link ConstraintSolver } stating which variable and constraint types it supports . * @ return A description of this { @ link ConstraintSolver } stating which variable and constraint types it supports . */ public String getDescription ( ) { } }
String spacer = "" ; for ( int i = 0 ; i < nesting ; i ++ ) spacer += spacing ; String ret = spacer + "[" + this . getClass ( ) . getSimpleName ( ) + " vars: [" ; ret += variableType . getSimpleName ( ) ; ret += "] constraints: [" ; for ( Class < ? > c : this . constraintTypes ) ret += c . getSimpleName ( ) ; return re...
public class Interpreter { /** * Set an expression breakpoint . A breakpoint stops execution and allows the user to query the environment . * @ param exp * The expression at which to stop . * @ param condition * The condition when to stop . * @ return The Breakpoint object created . * @ throws LexException ...
BreakpointManager . setBreakpoint ( exp , new Stoppoint ( exp . getLocation ( ) , ++ nextbreakpoint , condition ) ) ; breakpoints . put ( nextbreakpoint , BreakpointManager . getBreakpoint ( exp ) ) ; return BreakpointManager . getBreakpoint ( exp ) ;
public class JPAVariantDao { /** * Admin queries */ @ Override public boolean existsVariantIDForAdmin ( String variantID ) { } }
Long numberOfVariants = createQuery ( "select count(t) from Variant t where t.variantID = :variantID" , Long . class ) . setParameter ( "variantID" , variantID ) . getSingleResult ( ) ; return numberOfVariants == 1L ;
public class RollingLog { /** * Given the zxid , find out the idx of the file in list which contains the * transaction with this zxid if and only if the transaction with the zxid * is in RollingLog . If the zxid is smaller than the smallest zxid in log , * - 1 will be returned . * @ param zxid the zxid of the t...
if ( logFiles . isEmpty ( ) || zxid . compareTo ( getZxidFromFileName ( logFiles . get ( 0 ) ) ) < 0 ) { // If there ' s no log files or the zxid is smaller than the smallest zxid // of the rolling log , returns - 1. return - 1 ; } int idx = 0 ; while ( idx < logFiles . size ( ) - 1 ) { Zxid firstZxid = getZxidFromFile...
public class GeoInterface { /** * Get permissions for who may view geo data for a photo . * This method requires authentication with ' read ' permission . * @ param photoId * reqired photo id , not null * @ return the permissions * @ throws FlickrException * if photo id is invalid , if photo has no geodata ...
Map < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( "method" , METHOD_GET_PERMS ) ; parameters . put ( "photo_id" , photoId ) ; Response response = transport . get ( transport . getPath ( ) , parameters , apiKey , sharedSecret ) ; if ( response . isError ( ) ) { throw new Flick...
public class Console { /** * 同 System . out . println ( ) 方法 , 打印控制台日志 < br > * 如果传入打印对象为 { @ link Throwable } 对象 , 那么同时打印堆栈 * @ param obj 要打印的对象 */ public static void log ( Object obj ) { } }
if ( obj instanceof Throwable ) { Throwable e = ( Throwable ) obj ; log ( e , e . getMessage ( ) ) ; } else { log ( "{}" , obj ) ; }
public class Properties { /** * Set the individual products for an order associated with an event . * @ see < a href = " https : / / segment . com / docs / api / tracking / ecommerce / " > Ecommerce API < / a > */ public Properties putProducts ( Product ... products ) { } }
if ( isNullOrEmpty ( products ) ) { throw new IllegalArgumentException ( "products cannot be null or empty." ) ; } List < Product > productList = new ArrayList < > ( products . length ) ; Collections . addAll ( productList , products ) ; return putValue ( PRODUCTS_KEY , Collections . unmodifiableList ( productList ) ) ...
public class AlertPolicySerializer { /** * Gson invokes this call - back method during serialization when it encounters a field of the specified type . * @ param policy The alert policy being serialized * @ param type The type of the Object to deserialize to * @ param context The JSON serialization context * @ ...
JsonElement element = gson . toJsonTree ( policy , type ) ; JsonObject obj = new JsonObject ( ) ; obj . add ( "policy" , element ) ; return obj ;
public class TranslateSnippetsBeta { /** * [ START translate _ batch _ translate _ text _ beta ] */ static BatchTranslateResponse batchTranslateText ( String projectId , String location , String sourceUri , String destinationUri ) { } }
try ( TranslationServiceClient translationServiceClient = TranslationServiceClient . create ( ) ) { LocationName locationName = LocationName . newBuilder ( ) . setProject ( projectId ) . setLocation ( location ) . build ( ) ; GcsSource gcsSource = GcsSource . newBuilder ( ) . setInputUri ( sourceUri ) . build ( ) ; Inp...
public class BaseDateTimeType { /** * Returns a view of this date / time as a Calendar object . Note that the returned * Calendar object is entirely independent from < code > this < / code > object . Changes to the * calendar will not affect < code > this < / code > . */ public Calendar toCalendar ( ) { } }
Calendar retVal = Calendar . getInstance ( ) ; retVal . setTime ( getValue ( ) ) ; retVal . setTimeZone ( getTimeZone ( ) ) ; return retVal ;
public class ForkJoinTask { /** * If the current thread is operating in a ForkJoinPool , unschedules and returns , without * executing , the next task queued by the current thread but not yet executed , if one is * available , or if not available , a task that was forked by some other thread , if available . * Av...
Thread t ; ForkJoinWorkerThread wt ; return ( ( t = Thread . currentThread ( ) ) instanceof ForkJoinWorkerThread ) ? ( wt = ( ForkJoinWorkerThread ) t ) . pool . nextTaskFor ( wt . workQueue ) : null ;
public class Namespace { /** * Adds the package name to the diagram . * Re : bug 107 : If the package name is empty ( i . e . the ' default ' package ) , * render { @ code " unnamed " } because an empty name is not valid in PlantUML . * @ param output The output to append the package name to . * @ param < IPW >...
output . append ( name . isEmpty ( ) ? "unnamed" : name ) . whitespace ( ) ; return output ;
public class AbstrCFMLScriptTransformer { /** * Liest saemtliche Statements des CFScriptString ein . < br / > * EBNF : < br / > * < code > { statement spaces } ; < / code > * @ param parent uebergeornetes Element dem das Statement zugewiesen wird . * @ param isRoot befindet sich der Parser im root des data . sr...
do { if ( isRoot && isFinish ( data ) ) return ; statement ( data , body ) ; comments ( data ) ; } while ( data . srcCode . isValidIndex ( ) && ! data . srcCode . isCurrent ( '}' ) ) ;
public class MultiEnvAware { /** * { @ inheritDoc } */ @ Override public T put ( String key , T value ) { } }
if ( StringUtils . isBlank ( key ) ) { throw new MultiEnvSupportException ( String . format ( "Expected non-empty value for environment, was: %s" , key ) ) ; } boolean isDefaultEnvironment = false ; if ( value instanceof MultiEnvDefaultedConfiguration ) { isDefaultEnvironment = ( ( MultiEnvDefaultedConfiguration ) valu...
public class WeekDay { /** * Returns a weekday / negative offset representation of the specified calendar . * @ param cal a calendar ( java . util ) * @ return a weekday instance representing the specified calendar */ public static WeekDay getNegativeMonthlyOffset ( final Calendar cal ) { } }
return new WeekDay ( getDay ( cal . get ( Calendar . DAY_OF_WEEK ) ) , cal . get ( Calendar . DAY_OF_WEEK_IN_MONTH ) - 6 ) ;
public class CmsDisplayResource { /** * Reads the resource from the DB . < p > * @ param resourceName the resource name * @ return the resource * @ throws CmsException if the resource can not be read */ private CmsResource readResource ( String resourceName ) throws CmsException { } }
CmsResource resource = null ; try { resource = getCms ( ) . readResource ( resourceName , CmsResourceFilter . ALL ) ; } catch ( CmsVfsResourceNotFoundException e ) { throw new CmsVfsResourceNotFoundException ( Messages . get ( ) . container ( Messages . ERR_RESOURCE_DOES_NOT_EXIST_3 , resourceName , getCms ( ) . getReq...
public class Message { public HashMap < String , String > getData ( ) { } }
HashMap < String , String > hash = new HashMap < > ( ) ; HashMap p = new HashMap < String , String > ( ) ; int nameskip = getName ( ) . length ( ) + 1 ; extractValues ( hash ) ; hash . forEach ( ( key , value ) -> { p . put ( key . substring ( nameskip ) , value ) ; } ) ; return p ;
public class DialogRootView { /** * Adapts the visibility of the top and bottom divider , depending on the state of the dialog ' s * scroll view . */ private void adaptDividerVisibilities ( ) { } }
if ( scrollView != null ) { adaptDividerVisibilities ( scrollView . isScrolledToTop ( ) , scrollView . isScrolledToBottom ( ) , false ) ; } else if ( listView != null ) { adaptDividerVisibilities ( isListViewScrolledToTop ( listView ) , isListViewScrolledToBottom ( listView ) , false ) ; }
public class PathUtil { /** * Conservative approach to insuring that a given filename only contains characters that are legal for use in * filenames on the disk . Other characters are replaced with underscore _ . * Note that this should only be used with the filename itself , not the entire path , because it remove...
if ( badFileName == null ) return null ; StringBuilder cleanName = new StringBuilder ( ) ; for ( int i = 0 ; i < badFileName . length ( ) ; i ++ ) { int c = ( int ) badFileName . charAt ( i ) ; if ( Character . isJavaIdentifierPart ( c ) ) cleanName . append ( ( char ) c ) ; else cleanName . append ( '_' ) ; } return c...
public class PolymerPass { /** * Polymer 2 . x Class Nodes */ private void rewritePolymer2ClassDefinition ( Node node , NodeTraversal traversal ) { } }
PolymerClassDefinition def = PolymerClassDefinition . extractFromClassNode ( node , compiler , globalNames ) ; if ( def != null ) { PolymerClassRewriter rewriter = new PolymerClassRewriter ( compiler , getExtensInsertionRef ( ) , polymerVersion , polymerExportPolicy , this . propertyRenamingEnabled ) ; rewriter . prope...