signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class ColumnNameHelper { /** * return the max column * note that comparator should not be of CompositeType ! * @ param b1 lhs * @ param b2 rhs * @ param comparator the comparator to use * @ return the biggest column according to comparator */ private static ByteBuffer max ( ByteBuffer b1 , ByteBuffer b...
if ( b1 == null ) return b2 ; if ( b2 == null ) return b1 ; if ( comparator . compare ( b1 , b2 ) >= 0 ) return b1 ; return b2 ;
public class WstxEventReader { /** * Method used to locate error message description to use . * Calls sub - classes < code > getErrorDesc ( ) < / code > first , and only * if no message found , uses default messages defined here . */ protected final String findErrorDesc ( int errorType , int currEvent ) { } }
String msg = getErrorDesc ( errorType , currEvent ) ; if ( msg != null ) { return msg ; } switch ( errorType ) { case ERR_GETELEMTEXT_NOT_START_ELEM : return "Current state not START_ELEMENT when calling getElementText()" ; case ERR_GETELEMTEXT_NON_TEXT_EVENT : return "Expected a text token" ; case ERR_NEXTTAG_NON_WS_T...
public class TableCellWithActionExample { /** * Parses a date string . * @ param dateString the date string to parse * @ return a date corresponding to the given dateString , or null on error . */ private static Date parse ( final String dateString ) { } }
try { return new SimpleDateFormat ( "dd/mm/yyyy" ) . parse ( dateString ) ; } catch ( ParseException e ) { LOG . error ( "Error parsing date: " + dateString , e ) ; return null ; }
public class MarkLogicClientImpl { /** * executes BooleanQuery * @ param queryString * @ param bindings * @ param tx * @ param includeInferred * @ param baseURI * @ return */ public boolean performBooleanQuery ( String queryString , SPARQLQueryBindingSet bindings , Transaction tx , boolean includeInferred ,...
SPARQLQueryDefinition qdef = sparqlManager . newQueryDefinition ( queryString ) ; if ( notNull ( baseURI ) && ! baseURI . isEmpty ( ) ) { qdef . setBaseUri ( baseURI ) ; } qdef . setIncludeDefaultRulesets ( includeInferred ) ; if ( notNull ( ruleset ) ) { qdef . setRulesets ( ruleset ) ; } if ( notNull ( getConstrainin...
public class SelectList { /** * Select all options that display text matching the argument . * @ param label * the label to select */ public void selectByLabel ( String label ) { } }
getDispatcher ( ) . beforeSelect ( this , label ) ; new Select ( getElement ( ) ) . selectByVisibleText ( label ) ; if ( Config . getBoolConfigProperty ( ConfigProperty . ENABLE_GUI_LOGGING ) ) { logUIActions ( UIActions . SELECTED , label ) ; } getDispatcher ( ) . afterSelect ( this , label ) ;
public class GridCellElement { /** * Add a reference from this element to a cell that is containing this element . * @ param cell the grid cell . * @ return < code > true < / code > if the added cell is the reference ; * < code > false < / code > if the added cell is not the reference . */ public boolean addCellL...
if ( this . cells . add ( cell ) ) { return isReferenceCell ( cell ) ; } return false ;
public class GosuStringUtil { /** * < p > Returns padding using the specified delimiter repeated * to a given length . < / p > * < pre > * GosuStringUtil . padding ( 0 , ' e ' ) = " " * GosuStringUtil . padding ( 3 , ' e ' ) = " eee " * GosuStringUtil . padding ( - 2 , ' e ' ) = IndexOutOfBoundsException * ...
if ( repeat < 0 ) { throw new IndexOutOfBoundsException ( "Cannot pad a negative amount: " + repeat ) ; } final char [ ] buf = new char [ repeat ] ; for ( int i = 0 ; i < buf . length ; i ++ ) { buf [ i ] = padChar ; } return new String ( buf ) ;
public class DocumentRevsUtils { /** * Create the list of the revision IDs in ascending order . * The DocumentRevs is for a single tree . There should be one DocumentRevs for each open revision . * @ param documentRevs a deserialised JSON document including the _ revisions structure . See * < a target = " _ blank...
validateDocumentRevs ( documentRevs ) ; String latestRevision = documentRevs . getRev ( ) ; int generation = CouchUtils . generationFromRevId ( latestRevision ) ; assert generation == documentRevs . getRevisions ( ) . getStart ( ) ; List < String > revisionHistory = CouchUtils . couchStyleRevisionHistoryToFullRevisionI...
public class EvolutionResult { /** * Return a collector which collects the best result of an evolution stream . * < pre > { @ code * final Problem < ISeq < Point > , EnumGene < Point > , Double > tsm = . . . ; * final EvolutionResult < EnumGene < Point > , Double > result = Engine . builder ( tsm ) * . optimize...
return Collector . of ( MinMax :: < EvolutionResult < G , C > > of , MinMax :: accept , MinMax :: combine , mm -> mm . getMax ( ) != null ? mm . getMax ( ) . withTotalGenerations ( mm . getCount ( ) ) : null ) ;
public class IPv6Network { /** * Create an IPv6 network from the two addresses within the network . This will construct the smallest possible network ( " longest prefix * length " ) which contains both addresses . * @ param one address one * @ param two address two , should be bigger than address one * @ return...
final IPv6NetworkMask longestPrefixLength = IPv6NetworkMask . fromPrefixLength ( IPv6NetworkHelpers . longestPrefixLength ( one , two ) ) ; return new IPv6Network ( one . maskWithNetworkMask ( longestPrefixLength ) , longestPrefixLength ) ;
public class ParserDQL { /** * @ param exprList * @ param parseList * @ param start * @ param count * @ param isOption * @ param preferToThrow - if false , exceptions are quietly passed up the stack rather than thrown . * making it possible to distinguish ( breakpoint at ) serious exceptions * vs . false ...
/* disable 2 lines . . . void readExpression ( HsqlArrayList exprList , short [ ] parseList , int start , int count , boolean isOption ) { . . . disabled 2 lines */ // End of VoltDB extension for ( int i = start ; i < start + count ; i ++ ) { int exprType = parseList [ i ] ; switch ( exprType ) { case Tokens . QU...
public class Admin { /** * @ throws PageException */ private void doGetTLDs ( ) throws PageException { } }
lucee . runtime . type . Query qry = new QueryImpl ( new String [ ] { "displayname" , "namespace" , "namespaceseparator" , "shortname" , "type" , "description" , "uri" , "elclass" , "elBundleName" , "elBundleVersion" , "source" } , new String [ ] { "varchar" , "varchar" , "varchar" , "varchar" , "varchar" , "varchar" ,...
public class FieldType { /** * Call through to { @ link DatabaseFieldConfig # getColumnDefinition ( ) } and * { @ link DatabaseFieldConfig # getFullColumnDefinition ( ) } . */ public String getColumnDefinition ( ) { } }
String full = fieldConfig . getFullColumnDefinition ( ) ; if ( full == null ) { return fieldConfig . getColumnDefinition ( ) ; } else { return full ; }
public class ContextFromVertx { /** * Like { @ link # parameter ( String , String ) } , but converts the * parameter to Boolean if found . * The parameter is decoded by default . * @ param name The name of the parameter * @ param defaultValue A default value if parameter not found . * @ return The value of th...
return request . parameterAsBoolean ( name , defaultValue ) ;
public class AbstractBean { /** * Initializes the bean and its metadata */ @ Override public void internalInitialize ( BeanDeployerEnvironment environment ) { } }
preInitialize ( ) ; BeanLogger . LOG . creatingBean ( getType ( ) ) ; if ( getScope ( ) != null ) { proxyRequired = isNormalScoped ( ) ; } else { proxyRequired = false ; } BeanLogger . LOG . qualifiersUsed ( getQualifiers ( ) , this ) ; BeanLogger . LOG . usingName ( getName ( ) , this ) ; BeanLogger . LOG . usingScope...
public class KeyVaultClientBaseImpl { /** * List storage accounts managed by the specified key vault . This operation requires the storage / list permission . * @ param vaultBaseUrl The vault name , for example https : / / myvault . vault . azure . net . * @ param maxresults Maximum number of results to return in a...
return AzureServiceFuture . fromPageResponse ( getStorageAccountsSinglePageAsync ( vaultBaseUrl , maxresults ) , new Func1 < String , Observable < ServiceResponse < Page < StorageAccountItem > > > > ( ) { @ Override public Observable < ServiceResponse < Page < StorageAccountItem > > > call ( String nextPageLink ) { ret...
public class SerializationTools { /** * Object to byte array */ public static byte [ ] toByteArray ( Serializable object ) { } }
try { ByteArrayOutputStream buf = new ByteArrayOutputStream ( 1024 ) ; ObjectOutputStream objOut = new ObjectOutputStream ( buf ) ; objOut . writeObject ( object ) ; objOut . close ( ) ; return buf . toByteArray ( ) ; } catch ( IOException e ) { throw new IllegalArgumentException ( "Cannot serialize object : " + e . to...
public class SVNController { /** * Change log issues */ @ RequestMapping ( value = "changelog/{uuid}/issues" , method = RequestMethod . GET ) public SVNChangeLogIssues changeLogIssues ( @ PathVariable String uuid ) { } }
// Gets the change log SVNChangeLog changeLog = getChangeLog ( uuid ) ; // Cached ? SVNChangeLogIssues issues = changeLog . getIssues ( ) ; if ( issues != null ) { return issues ; } // Loads the issues issues = changeLogService . getChangeLogIssues ( changeLog ) ; // Stores in cache logCache . put ( uuid , changeLog . ...
public class RandomUtil { /** * 获得指定范围内的随机数 * @ param min 最小数 ( 包含 ) * @ param max 最大数 ( 不包含 ) * @ return 随机数 * @ since 4.0.9 */ public static BigDecimal randomBigDecimal ( BigDecimal min , BigDecimal max ) { } }
return NumberUtil . toBigDecimal ( getRandom ( ) . nextDouble ( min . doubleValue ( ) , max . doubleValue ( ) ) ) ;
public class BasicScaling { /** * < pre > * Duration of time after the last request that an instance must wait before * the instance is shut down . * < / pre > * < code > . google . protobuf . Duration idle _ timeout = 1 ; < / code > */ public com . google . protobuf . Duration getIdleTimeout ( ) { } }
return idleTimeout_ == null ? com . google . protobuf . Duration . getDefaultInstance ( ) : idleTimeout_ ;
public class AssignInstanceRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( AssignInstanceRequest assignInstanceRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( assignInstanceRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( assignInstanceRequest . getInstanceId ( ) , INSTANCEID_BINDING ) ; protocolMarshaller . marshall ( assignInstanceRequest . getLayerIds ( ) , LAYERIDS_BINDING ) ; }...
public class WebMonitorEndpoint { @ Override public void grantLeadership ( final UUID leaderSessionID ) { } }
log . info ( "{} was granted leadership with leaderSessionID={}" , getRestBaseUrl ( ) , leaderSessionID ) ; leaderElectionService . confirmLeaderSessionID ( leaderSessionID ) ;
public class JCROrganizationServiceImpl { /** * { @ inheritDoc } */ @ Override public void start ( ) { } }
try { MigrationTool migrationTool = new MigrationTool ( this ) ; if ( migrationTool . migrationRequired ( ) ) { LOG . info ( "Detected old organization service structure." ) ; migrationTool . migrate ( ) ; } Session session = getStorageSession ( ) ; try { session . getItem ( this . storagePath ) ; // if found do nothin...
public class FixedQuantilesCallback { /** * Create buckets using callback attributes * @ param stopwatch Target stopwatch * @ return Created buckets */ @ Override protected Buckets createBuckets ( Stopwatch stopwatch ) { } }
return createBuckets ( stopwatch , min * SimonClock . NANOS_IN_MILLIS , max * SimonClock . NANOS_IN_MILLIS , bucketNb ) ;
public class DeepWaterParameters { /** * Attempt to guess the problem type from the dataset * @ return */ ProblemType guessProblemType ( ) { } }
if ( _problem_type == auto ) { boolean image = false ; boolean text = false ; String first = null ; Vec v = train ( ) . vec ( 0 ) ; if ( v . isString ( ) || v . isCategorical ( ) /* small data parser artefact */ ) { BufferedString bs = new BufferedString ( ) ; first = v . atStr ( bs , 0 ) . toString ( ) ; try { ImageIO...
public class CommercePriceListAccountRelLocalServiceUtil { /** * Adds the commerce price list account rel to the database . Also notifies the appropriate model listeners . * @ param commercePriceListAccountRel the commerce price list account rel * @ return the commerce price list account rel that was added */ publi...
return getService ( ) . addCommercePriceListAccountRel ( commercePriceListAccountRel ) ;
public class HttpServerMBean { public void postDeregister ( ) { } }
_httpServer . removeEventListener ( this ) ; _httpServer = null ; if ( _mbeanMap != null ) _mbeanMap . clear ( ) ; _mbeanMap = null ; super . postDeregister ( ) ;
public class AbstractTreeWriter { /** * Get the tree label for the navigation bar . * @ return a content tree for the tree label */ protected Content getNavLinkTree ( ) { } }
Content li = HtmlTree . LI ( HtmlStyle . navBarCell1Rev , treeLabel ) ; return li ;
public class PlaybackConfigurationMarshaller { /** * Marshall the given parameter object . */ public void marshall ( PlaybackConfiguration playbackConfiguration , ProtocolMarshaller protocolMarshaller ) { } }
if ( playbackConfiguration == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( playbackConfiguration . getAdDecisionServerUrl ( ) , ADDECISIONSERVERURL_BINDING ) ; protocolMarshaller . marshall ( playbackConfiguration . getCdnConfiguration ( ...
public class PathUtils { /** * Converts a String array to a String with coma separator * example : String [ " a . soy " , " b . soy " ] - output : a . soy , b . soy * @ param array - array * @ return comma separated list */ public static String arrayToPath ( final String [ ] array ) { } }
if ( array == null ) { return "" ; } return Joiner . on ( "," ) . skipNulls ( ) . join ( array ) ;
public class ArrowConverter { /** * Convert a field vector to a column vector * @ param fieldVector the field vector to convert * @ param type the type of the column vector * @ return the converted ndarray */ public static INDArray convertArrowVector ( FieldVector fieldVector , ColumnType type ) { } }
DataBuffer buffer = null ; int cols = fieldVector . getValueCount ( ) ; ByteBuffer direct = ByteBuffer . allocateDirect ( fieldVector . getDataBuffer ( ) . capacity ( ) ) ; direct . order ( ByteOrder . nativeOrder ( ) ) ; fieldVector . getDataBuffer ( ) . getBytes ( 0 , direct ) ; direct . rewind ( ) ; switch ( type ) ...
public class TermsByQueryResponse { /** * Serialize * @ param out the output * @ throws IOException */ @ Override public void writeTo ( StreamOutput out ) throws IOException { } }
super . writeTo ( out ) ; // Encode flag out . writeBoolean ( isPruned ) ; // Encode size out . writeVInt ( size ) ; // Encode type of encoding out . writeVInt ( termsEncoding . ordinal ( ) ) ; // Encode terms out . writeBytesRef ( encodedTerms ) ; // Release terms encodedTerms = null ;
public class EvaluationUtils { /** * Calculate the false positive rate from the false positive count and true negative count * @ param fpCount False positive count * @ param tnCount True negative count * @ param edgeCase Edge case values are used to avoid 0/0 * @ return False positive rate */ public static doub...
// Edge case if ( fpCount == 0 && tnCount == 0 ) { return edgeCase ; } return fpCount / ( double ) ( fpCount + tnCount ) ;
public class Kmeans { /** * { @ inheritDoc } */ @ Override public Prediction _predictRecord ( Record r ) { } }
ModelParameters modelParameters = knowledgeBase . getModelParameters ( ) ; Map < Integer , Cluster > clusterMap = modelParameters . getClusterMap ( ) ; AssociativeArray clusterDistances = new AssociativeArray ( ) ; for ( Map . Entry < Integer , Cluster > e : clusterMap . entrySet ( ) ) { Integer clusterId = e . getKey ...
public class AvroUtils { /** * Given a byte array and a DatumReader , decode an avro entity from the byte * array . Decodes using the avro BinaryDecoder . Return the constructed entity . * @ param bytes * The byte array to decode the entity from . * @ param reader * The DatumReader that will decode the byte a...
Decoder decoder = new DecoderFactory ( ) . binaryDecoder ( bytes , null ) ; return AvroUtils . < T > readAvroEntity ( decoder , reader ) ;
public class BaseWorkflowExecutor { /** * Execute a step and handle flow control and error handler and log filter . * @ param executionContext context * @ param failedMap map for placing failure results * @ param resultList list of step results * @ param keepgoing true if the workflow should keepgoing on error ...
if ( null != wlistener ) { wlistener . beginWorkflowItem ( c , cmd ) ; } // collab WorkflowStatusResultImpl result = WorkflowStatusResultImpl . builder ( ) . success ( false ) . build ( ) ; // wrap node failed listener ( if any ) and capture status results NodeRecorder stepCaptureFailedNodesListener = new NodeRecorder ...
public class ScanPackagesProcess { /** * Run Method . */ public void run ( ) { } }
Packages recPackages = ( Packages ) this . getMainRecord ( ) ; ProgramControl recPackagesControl = ( ProgramControl ) this . getRecord ( ProgramControl . PROGRAM_CONTROL_FILE ) ; try { recPackagesControl . edit ( ) ; recPackagesControl . getField ( ProgramControl . LAST_PACKAGE_UPDATE ) . setValue ( DateTimeField . cur...
public class Vector3i { /** * Subtract the supplied vector from this one and store the result in * < code > this < / code > . * @ param v * the vector to subtract * @ return a vector holding the result */ public Vector3i sub ( Vector3ic v ) { } }
return sub ( v . x ( ) , v . y ( ) , v . z ( ) , thisOrNew ( ) ) ;
public class FileSourceSettingsMarshaller { /** * Marshall the given parameter object . */ public void marshall ( FileSourceSettings fileSourceSettings , ProtocolMarshaller protocolMarshaller ) { } }
if ( fileSourceSettings == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( fileSourceSettings . getConvert608To708 ( ) , CONVERT608TO708_BINDING ) ; protocolMarshaller . marshall ( fileSourceSettings . getSourceFile ( ) , SOURCEFILE_BINDING ...
public class GeoServiceBounds { /** * Build a bounding box feature . * @ param id the ID string * @ param southwest the southwest corner of the bounding box * @ param northeast the northeast corner of the bounding box * @ return the Feature for the new bounds */ public static Feature createBounds ( final String...
final Feature feature = new Feature ( ) ; feature . setId ( id ) ; if ( northeast == null || southwest == null ) { throw new IllegalArgumentException ( "Must have a proper bounding box" ) ; } final double [ ] bbox = { southwest . getLongitude ( ) , southwest . getLatitude ( ) , northeast . getLongitude ( ) , northeast ...
public class Exec { /** * Execute a command in a container . If there are multiple containers in the pod , uses the first * container in the Pod . * @ param pod The pod where the command is run . * @ param command The command to run * @ param container The container in the Pod where the command is run . * @ p...
return exec ( pod . getMetadata ( ) . getNamespace ( ) , pod . getMetadata ( ) . getName ( ) , command , container , stdin , tty ) ;
public class LinkedDeque { /** * Unlinks the non - null element . */ private void unlink ( E e ) { } }
final E prev = e . getPrevious ( ) ; final E next = e . getNext ( ) ; if ( prev == null ) { first = next ; } else { prev . setNext ( next ) ; e . setPrevious ( null ) ; } if ( next == null ) { last = prev ; } else { next . setPrevious ( prev ) ; e . setNext ( null ) ; }
public class MediaType { /** * Sorts the given list of { @ code MediaType } objects by specificity . * < p > Given two media types : < ol > < li > if either media type has a { @ linkplain # isWildcardType ( ) wildcard type } , then * the media type without the wildcard is ordered before the other . < / li > < li > ...
Assert . notNull ( mediaTypes , "'mediaTypes' must not be null" ) ; if ( mediaTypes . size ( ) > 1 ) { Collections . sort ( mediaTypes , SPECIFICITY_COMPARATOR ) ; }
public class UtilDecompositons_ZDRM { /** * Creates a zeros matrix only if A does not already exist . If it does exist it will fill * the lower triangular portion with zeros . */ public static ZMatrixRMaj checkZerosLT ( ZMatrixRMaj A , int numRows , int numCols ) { } }
if ( A == null ) { return new ZMatrixRMaj ( numRows , numCols ) ; } else if ( numRows != A . numRows || numCols != A . numCols ) throw new IllegalArgumentException ( "Input is not " + numRows + " x " + numCols + " matrix" ) ; else { for ( int i = 0 ; i < A . numRows ; i ++ ) { int index = i * A . numCols * 2 ; int end ...
public class BucketTimeSeries { /** * This method returns the value from the time - series as if it would be ordered ( i . e . , zero is now , 1 is the * previous moment , . . . ) . * @ param idx the zero based index * @ return the value associated to the zero based index */ public T getFromZeroBasedIdx ( final i...
if ( this . timeSeries != null && this . currentNowIdx != - 1 ) { // we can use the default validation , because the index still must be in the borders of the time - series validateIdx ( idx ) ; return get ( idx ( currentNowIdx + idx ) ) ; } else { return null ; }
public class RelativePathService { /** * Installs a path service . * @ param name the name to use for the service * @ param path the relative portion of the path * @ param possiblyAbsolute { @ code true } if { @ code path } may be an { @ link # isAbsoluteUnixOrWindowsPath ( String ) absolute path } * and should...
if ( possiblyAbsolute && isAbsoluteUnixOrWindowsPath ( path ) ) { return AbsolutePathService . addService ( name , path , serviceTarget ) ; } RelativePathService service = new RelativePathService ( path ) ; ServiceBuilder < String > builder = serviceTarget . addService ( name , service ) . addDependency ( pathNameOf ( ...
public class StylesheetUserPreferencesImpl { /** * / * ( non - Javadoc ) * @ see org . apereo . portal . layout . om . IStylesheetUserPreferences # removeLayoutAttribute ( java . lang . String , java . lang . String ) */ @ Override public String removeLayoutAttribute ( String nodeId , String name ) { } }
Validate . notEmpty ( nodeId , "nodeId cannot be null" ) ; Validate . notEmpty ( name , "name cannot be null" ) ; final Map < String , String > nodeAttributes = this . layoutAttributes . get ( nodeId ) ; if ( nodeAttributes == null ) { return null ; } return nodeAttributes . remove ( name ) ;
public class SourceLocation { /** * Finds all files with the given suffix that pass the include / exclude * filters in this source location . * @ param suffixes The set of suffixes to search for * @ param foundFiles The map in which to store the found files * @ param foundModules The map in which to store the f...
try { Source . scanRoot ( path . toFile ( ) , suffixes , excludes , includes , foundFiles , foundModules , currentModule , permitSourcesInDefaultPackage , false , inLinksrc ) ; } catch ( ProblemException e ) { e . printStackTrace ( ) ; }
public class MQLinkPubSubBridgeItemStream { /** * Method isToBeDeleted . * @ return boolean */ public boolean isToBeDeleted ( ) { } }
if ( tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "isToBeDeleted" ) ; SibTr . exit ( tc , "isToBeDeleted" , toBeDeleted ) ; } return toBeDeleted . booleanValue ( ) ;
public class UsableURIFactory { /** * Fixup the domain label part of the authority . * We ' re more lax than the spec . in that we allow underscores . * @ param label Domain label to fix . * @ return Return fixed domain label . * @ throws URIException */ private String fixupDomainlabel ( String label ) throws U...
// apply IDN - punycoding , as necessary try { // TODO : optimize : only apply when necessary , or // keep cache of recent encodings label = IDNA . toASCII ( label ) ; } catch ( IDNAException e ) { if ( TextUtils . matches ( ACCEPTABLE_ASCII_DOMAIN , label ) ) { // domain name has ACE prefix , leading / trailing dash ,...
public class NtlmUtil { /** * Accepts key multiple of 7 * Returns enc multiple of 8 * Multiple is the same like : 21 byte key gives 24 byte result */ static void E ( byte [ ] key , byte [ ] data , byte [ ] e ) throws ShortBufferException { } }
byte [ ] key7 = new byte [ 7 ] ; byte [ ] e8 = new byte [ 8 ] ; for ( int i = 0 ; i < key . length / 7 ; i ++ ) { System . arraycopy ( key , i * 7 , key7 , 0 , 7 ) ; Cipher des = Crypto . getDES ( key7 ) ; des . update ( data , 0 , data . length , e8 ) ; System . arraycopy ( e8 , 0 , e , i * 8 , 8 ) ; }
public class JawrWatchEventProcessor { /** * Returns true if there is no more event to process * @ return true if there is no more event to process */ public boolean hasNoEventToProcess ( ) { } }
long currentTime = Calendar . getInstance ( ) . getTimeInMillis ( ) ; return watchEvents . isEmpty ( ) && ( currentTime - lastProcessTime . get ( ) > bundlesHandler . getConfig ( ) . getSmartBundlingDelayAfterLastEvent ( ) ) ;
public class EpicsApi { /** * Deletes an epic . * < pre > < code > GitLab Endpoint : DELETE / groups / : id / epics / : epic _ iid < / code > < / pre > * @ param groupIdOrPath the group ID , path of the group , or a Group instance holding the group ID or path * @ param epicIid the IID of the epic to delete * @ ...
delete ( Response . Status . NO_CONTENT , null , "groups" , getGroupIdOrPath ( groupIdOrPath ) , "epics" , epicIid ) ;
public class GVRViewManager { /** * returns . */ private void notifyMainSceneReady ( ) { } }
runOnTheFrameworkThread ( new Runnable ( ) { @ Override public void run ( ) { // Initialize the main scene getEventManager ( ) . sendEvent ( mMainScene , ISceneEvents . class , "onInit" , GVRViewManager . this , mMainScene ) ; // Late - initialize the main scene getEventManager ( ) . sendEvent ( mMainScene , ISceneEven...
public class ReviewsImpl { /** * Get the Job Details for a Job Id . * @ param teamName Your Team Name . * @ param jobId Id of the job . * @ param serviceCallback the async ServiceCallback to handle successful and failed responses . * @ throws IllegalArgumentException thrown if parameters fail the validation *...
return ServiceFuture . fromResponse ( getJobDetailsWithServiceResponseAsync ( teamName , jobId ) , serviceCallback ) ;
public class ScriptRunner { /** * Prepares a < code > Task < / code > for ( subsequent ) execution . * @ param location Absolute or relative location of a Cernunnos script file . */ public Task compileTask ( String location ) { } }
// Assertions . if ( location == null ) { String msg = "Argument 'location' cannot be null." ; throw new IllegalArgumentException ( msg ) ; } Document doc = null ; URL origin = null ; try { origin = new URL ( new File ( "." ) . toURI ( ) . toURL ( ) , location ) ; doc = new SAXReader ( ) . read ( origin ) ; } catch ( T...
public class AbstractAdminController { /** * sets common context variables < br > * < ul > * < li > contentPage < / li > * < li > activeMenuName < / li > * < li > activeMenu < / li > * < li > rootContext < / li > * < li > < / li > * < / ul > * @ param model * @ param request * @ return */ protected ...
return addCommonContextVars ( model , request , null , null ) ;
public class RegistriesInner { /** * Updates the policies for the specified container registry . * @ param resourceGroupName The name of the resource group to which the container registry belongs . * @ param registryName The name of the container registry . * @ param registryPoliciesUpdateParameters The parameter...
if ( this . client . subscriptionId ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.subscriptionId() is required and cannot be null." ) ; } if ( resourceGroupName == null ) { throw new IllegalArgumentException ( "Parameter resourceGroupName is required and cannot be null." ) ; } if ( registr...
public class QuantilesCallback { /** * When a split is added , if buckets have been initialized , the value is added to appropriate bucket . */ @ Override public void onStopwatchAdd ( Stopwatch stopwatch , Split split , StopwatchSample sample ) { } }
onStopwatchSplit ( split . getStopwatch ( ) , split ) ;
public class BitZTradeServiceRaw { /** * 批量取消委托 * @ param ids * @ return * @ throws IOException */ public BitZTradeCancelListResult cancelAllEntrustSheet ( String ids ) throws IOException { } }
return bitz . cancelAllEntrustSheet ( apiKey , getTimeStamp ( ) , nonce , signer , ids ) ;
public class EnvironmentSettingsInner { /** * Create or replace an existing Environment Setting . This operation can take a while to complete . * @ param resourceGroupName The name of the resource group . * @ param labAccountName The name of the lab Account . * @ param labName The name of the lab . * @ param en...
return ServiceFuture . fromResponse ( beginCreateOrUpdateWithServiceResponseAsync ( resourceGroupName , labAccountName , labName , environmentSettingName , environmentSetting ) , serviceCallback ) ;
public class MainToolbar { /** * Adds the login button + login text to the toolbar . This is only happened , * when the gui is not started via the kickstarter . * The Kickstarter overrides the " kickstarterEnvironment " context parameter * and set it to " true " , so the gui can detect , that is not necessary to ...
VaadinSession session = VaadinSession . getCurrent ( ) ; if ( session != null ) { boolean kickstarter = Helper . isKickstarter ( session ) ; if ( ! kickstarter ) { addComponent ( lblUserName ) ; setComponentAlignment ( lblUserName , Alignment . MIDDLE_RIGHT ) ; addComponent ( btLogin ) ; setComponentAlignment ( btLogin...
public class BaseDataJsonFieldBo { /** * Get a " data " ' s sub - attribute using d - path . * @ param dPath * @ param clazz * @ return * @ see DPathUtils */ public < T > T getDataAttr ( String dPath , Class < T > clazz ) { } }
Lock lock = lockForRead ( ) ; try { return DPathUtils . getValue ( dataJson , dPath , clazz ) ; } finally { lock . unlock ( ) ; }
public class RepositoryResolver { /** * Resolve a single name * Identical to { @ code resolve ( Collections . singleton ( toResolve ) ) } . */ public Collection < List < RepositoryResource > > resolve ( String toResolve ) throws RepositoryResolutionException { } }
return resolve ( Collections . singleton ( toResolve ) ) ;
public class UserCoreDao { /** * Query for ordered rows starting at the offset and returning no more than * the limit . * @ param orderBy * order by * @ param limit * chunk limit * @ param offset * chunk query offset * @ return result * @ since 3.1.0 */ public TResult queryForChunk ( String orderBy , ...
return query ( null , null , null , null , orderBy , buildLimit ( limit , offset ) ) ;
public class HelloSignClient { /** * Retrieves the necessary information to build an embedded signature * request . * @ param signatureId String ID of the signature request to embed * @ return EmbeddedResponse * @ throws HelloSignException thrown if there ' s a problem processing the * HTTP request or the JSO...
String url = BASE_URI + EMBEDDED_SIGN_URL_URI + "/" + signatureId ; return new EmbeddedResponse ( httpClient . withAuth ( auth ) . post ( url ) . asJson ( ) ) ;
public class ElasticsearchRestClientFactoryBean { /** * We use convention over configuration : see https : / / github . com / dadoonet / spring - elasticsearch / issues / 3 */ static String [ ] computeTemplates ( String [ ] templates , String classpathRoot ) { } }
if ( templates == null || templates . length == 0 ) { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Automatic discovery is activated. Looking for template files in classpath under [{}]." , classpathRoot ) ; } ArrayList < String > autoTemplates = new ArrayList < > ( ) ; try { // Let ' s scan our resources List ...
public class ZkClient { /** * Add authentication information to the connection . This will be used to identify the user and check access to * nodes protected by ACLs * @ param scheme * @ param auth */ public void addAuthInfo ( final String scheme , final byte [ ] auth ) { } }
retryUntilConnected ( new Callable < Object > ( ) { @ Override public Object call ( ) throws Exception { _connection . addAuthInfo ( scheme , auth ) ; return null ; } } ) ;
public class HBaseReader { /** * Next . * @ return the h base data */ public HBaseDataWrapper next ( ) { } }
Result result = resultsIter . next ( ) ; counter ++ ; List < Cell > cells = result . listCells ( ) ; HBaseDataWrapper data = new HBaseDataWrapper ( tableName , result . getRow ( ) ) ; data . setColumns ( cells ) ; return data ;
public class GetMountTablePResponse { /** * < code > map & lt ; string , . alluxio . grpc . file . MountPointInfo & gt ; mountPoints = 1 ; < / code > */ public boolean containsMountPoints ( java . lang . String key ) { } }
if ( key == null ) { throw new java . lang . NullPointerException ( ) ; } return internalGetMountPoints ( ) . getMap ( ) . containsKey ( key ) ;
public class Getter { /** * Checks if the specified method is a getter . * @ param method The method . * @ param acceptPrefixless Flag to enable support of prefixless getters . * @ return */ public static boolean is ( Method method , boolean acceptPrefixless ) { } }
int length = method . getName ( ) . length ( ) ; if ( method . isPrivate ( ) || method . isStatic ( ) ) { return false ; } if ( ! method . getArguments ( ) . isEmpty ( ) ) { return false ; } if ( method . getReturnType ( ) . equals ( VOID ) ) { return false ; } if ( acceptPrefixless ) { return true ; } if ( method . ge...
public class Yoke { /** * Adds a IMiddleware to the chain . If the middleware is an Error Handler IMiddleware then it is * treated differently and only the last error handler is kept . * You might want to add a middleware that is only supposed to run on a specific route ( path prefix ) . * In this case if the req...
for ( IMiddleware m : middleware ) { if ( m instanceof Middleware ) { // when the type of middleware is error handler then the route is ignored and // the middleware is extracted from the execution chain into a special placeholder // for error handling if ( ( ( Middleware ) m ) . isErrorHandler ( ) ) { errorHandler = m...
public class CodingAnnotationStudy { /** * Creates a new { @ link CodingAnnotationItem } which has been coded with * the given annotation categories . Note that the order of the categories * must correspond to the raters ' indexes . Use null to represent missing * annotations , Invoking < code > addItem ( new Obj...
if ( annotations . length != raters . size ( ) ) { throw new IllegalArgumentException ( "Incorrect number of annotation units " + "(expected " + raters . size ( ) + ", given " + annotations . length + "). " + "For array params, use #addItemsAsArray instead of #addItem." ) ; } int itemIdx = items . size ( ) ; CodingAnno...
public class JStormUtils { /** * if the list contains repeated string , return the repeated string * this function is used to check whether bolt / spout has a duplicate id */ public static List < String > getRepeat ( List < String > list ) { } }
List < String > rtn = new ArrayList < > ( ) ; Set < String > idSet = new HashSet < > ( ) ; for ( String id : list ) { if ( idSet . contains ( id ) ) { rtn . add ( id ) ; } else { idSet . add ( id ) ; } } return rtn ;
public class ServiceLoader { /** * Creates a new service loader for the given service type and class loader . * @ param service The interface or abstract class representing the service * @ param loader The class loader to be used to load provider - configuration * files and provider classes , or null if the syste...
if ( loader == null ) { loader = service . getClassLoader ( ) ; } return new ServiceLoader < S > ( service , new ClassLoaderResourceLoader ( loader ) ) ;
public class PostCompilationAnalysis { /** * Perform post compilation analysis on the given ParsedElement . The other ParsedElements are supporting ones , * e . g . ClassStatements for inner classes */ public static void maybeAnalyze ( IParsedElement pe , IParsedElement ... other ) { } }
if ( ! shouldAnalyze ( ) ) { return ; } if ( ! ( pe instanceof IProgram ) && ( ! ( pe instanceof IClassFileStatement ) || classFileIsNotAnInterface ( ( IClassFileStatement ) pe ) ) ) { // pe . performUnusedElementAnalysis ( other ) ; }
public class AbstractCompositeConstraint { /** * Adds a beta constraint to this multi field OR constraint * @ param constraint */ public void addBetaConstraint ( BetaNodeFieldConstraint constraint ) { } }
if ( constraint != null ) { BetaNodeFieldConstraint [ ] tmp = this . betaConstraints ; this . betaConstraints = new BetaNodeFieldConstraint [ tmp . length + 1 ] ; System . arraycopy ( tmp , 0 , this . betaConstraints , 0 , tmp . length ) ; this . betaConstraints [ this . betaConstraints . length - 1 ] = constraint ; th...
public class TextWriterIntArray { /** * Serialize an object into the inline section . */ @ Override public void write ( TextWriterStream out , String label , int [ ] v ) { } }
StringBuilder buf = new StringBuilder ( ) ; if ( label != null ) { buf . append ( label ) . append ( '=' ) ; } if ( v != null ) { FormatUtil . formatTo ( buf , v , " " ) ; } out . inlinePrintNoQuotes ( buf . toString ( ) ) ;
public class LocaleHelper { /** * Create a { @ link Locale } from a given { @ link String } representation such as { @ link Locale # toString ( ) } or * { @ link Locale # forLanguageTag ( String ) } . * @ param locale the { @ link String } representation of the { @ link Locale } . * @ return the parsed { @ link L...
String languageTag = locale . replace ( SEPARATOR_DEFAULT , SEPARATOR_FOR_LANGUAGE_TAG ) ; if ( ! languageTag . isEmpty ( ) && ( languageTag . charAt ( 0 ) == SEPARATOR_FOR_LANGUAGE_TAG ) ) { languageTag = languageTag . substring ( 1 ) ; // tolerant for accepting suffixes like " _ en _ US " / " - en - US " } return Loc...
public class DefaultBeanClassBuilder { /** * Defines the class header for the given class definition */ protected ClassWriter buildClassHeader ( ClassLoader classLoader , ClassDefinition classDef ) { } }
boolean reactive = classDef . isReactive ( ) ; String [ ] original = classDef . getInterfaces ( ) ; int interfacesNr = original . length + ( reactive ? 2 : 1 ) ; String [ ] interfaces = new String [ interfacesNr ] ; for ( int i = 0 ; i < original . length ; i ++ ) { interfaces [ i ] = BuildUtils . getInternalType ( ori...
public class JSONDeserializer { /** * Populate object from json object . * @ param objectInstance * the object instance * @ param objectResolvedType * the object resolved type * @ param jsonVal * the json val * @ param classFieldCache * the class field cache * @ param idToObjectInstance * a map from...
// Leave objectInstance empty ( or leave fields null ) if jsonVal is null if ( jsonVal == null ) { return ; } // Check jsonVal is JSONObject or JSONArray final boolean isJsonObject = jsonVal instanceof JSONObject ; final boolean isJsonArray = jsonVal instanceof JSONArray ; if ( ! ( isJsonArray || isJsonObject ) ) { thr...
public class SoapClient { /** * 创建SOAP客户端 * @ param url WS的URL地址 * @ param protocol 协议 , 见 { @ link SoapProtocol } * @ param namespaceURI 方法上的命名空间URI * @ return { @ link SoapClient } * @ since 4.5.6 */ public static SoapClient create ( String url , SoapProtocol protocol , String namespaceURI ) { } }
return new SoapClient ( url , protocol , namespaceURI ) ;
public class JmsConnectionImpl { /** * * * * * * INTERFACE METHODS * * * * * */ @ Override public Session createSession ( boolean transacted , int acknowledgeMode ) throws JMSException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "createSession" , new Object [ ] { transacted , acknowledgeMode } ) ; JmsSessionImpl jmsSession = null ; // throw an exception if the connection is closed . checkClosed ( ) ; // mark that the client id cannot be chang...
public class Text { /** * Sets the capacity of this Text object to < em > at least < / em > * < code > len < / code > bytes . If the current buffer is longer , * then the capacity and existing content of the buffer are * unchanged . If < code > len < / code > is larger * than the current capacity , the Text obj...
if ( bytes == null || bytes . length < len ) { byte [ ] newBytes = new byte [ len ] ; if ( bytes != null && keepData ) { System . arraycopy ( bytes , 0 , newBytes , 0 , length ) ; } bytes = newBytes ; }
public class StringKit { /** * we can replace * if ( doMethod1 ( ) ! = null ) { * return doMethod1 ( ) * } else { * return doMethod2 ( ) * with * return notBlankElse ( bar : : getName , bar : : getNickName ) * @ param s1 Supplier * @ param s2 Supplier */ public static < T > T noNullElseGet ( @ NonNull S...
T t1 = s1 . get ( ) ; if ( t1 != null ) { return t1 ; } return s2 . get ( ) ;
public class SeGoodsSpecifics { /** * < p > Usually it ' s simple setter for model ID . < / p > * @ param pItsId model ID */ @ Override public final void setItsId ( final SeGoodsSpecificsId pItsId ) { } }
this . itsId = pItsId ; if ( this . itsId != null ) { setSpecifics ( this . itsId . getSpecifics ( ) ) ; setItem ( this . itsId . getItem ( ) ) ; } else { setSpecifics ( null ) ; setItem ( null ) ; }
public class JmsSession { /** * Method that closes the opened Context { @ link # openContext ( ) } , by * committing or rollback it . * @ throws EFapsException on error * @ see # detach ( ) */ public void closeContext ( ) throws EFapsException { } }
if ( isLogedIn ( ) ) { try { if ( ! Context . isTMNoTransaction ( ) ) { if ( Context . isTMActive ( ) ) { Context . commit ( ) ; } else { Context . rollback ( ) ; } } } catch ( final SecurityException e ) { throw new EFapsException ( "SecurityException" , e ) ; } catch ( final IllegalStateException e ) { throw new EFap...
public class DestinationManager { /** * This method is used to perform local Destination reconciliation tasks */ public void reconcileLocal ( ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "reconcileLocal" ) ; // Set reconciling flag to false reconciling = false ; DestinationTypeFilter filter = new DestinationTypeFilter ( ) ; filter . LOCAL = Boolean . TRUE ; filter . UNRECONCILED = Boolean . TRUE ; SIMPIterat...
public class WalkingIterator { /** * Initialize the context values for this expression * after it is cloned . * @ param context The XPath runtime context for this * transformation . */ public void setRoot ( int context , Object environment ) { } }
super . setRoot ( context , environment ) ; if ( null != m_firstWalker ) { m_firstWalker . setRoot ( context ) ; m_lastUsedWalker = m_firstWalker ; }
public class JawnServletContext { /** * IP address of the requesting client . * If the IP of the request seems to come from a local proxy , * then the X - Forwarded - For header is returned . * @ return IP address of the requesting client . */ public String remoteIP ( ) { } }
String remoteAddr = request . getRemoteAddr ( ) ; // This could be a list of proxy IPs , which the developer could // provide via some configuration if ( "127.0.0.1" . equals ( remoteAddr ) ) remoteAddr = requestHeader ( "X-Forwarded-For" ) ; return remoteAddr ;
public class Iterate { /** * Filters a collection into two separate collections based on a predicate returned via a Twin . * Example using a Java 8 lambda expression : * < pre > * Twin & lt ; MutableList & lt ; Person & gt ; & gt ; selectedRejected = * Iterate . < b > selectAndRejectWith < / b > ( people , ( Pe...
if ( iterable instanceof MutableCollection ) { return ( ( MutableCollection < T > ) iterable ) . selectAndRejectWith ( predicate , injectedValue ) ; } if ( iterable instanceof ArrayList ) { return ArrayListIterate . selectAndRejectWith ( ( ArrayList < T > ) iterable , predicate , injectedValue ) ; } if ( iterable insta...
public class CommunicationManager { /** * Piece download completion handler . * When a piece is completed , and valid , we announce to all connected peers * that we now have this piece . * We use this handler to identify when all of the pieces have been * downloaded . When that ' s the case , we can start the s...
final SharedTorrent torrent = peer . getTorrent ( ) ; final String torrentHash = torrent . getHexInfoHash ( ) ; try { final Future < ? > validationFuture = myPieceValidatorExecutor . submit ( new Runnable ( ) { @ Override public void run ( ) { validatePieceAsync ( torrent , piece , torrentHash , peer ) ; } } ) ; torren...
public class Proxy { /** * Specifies the URL to be used for proxy auto - configuration . Expected format is * < code > http : / / hostname . com : 1234 / pacfile < / code > . This is required if { @ link # getProxyType ( ) } is * set to { @ link ProxyType # PAC } , ignored otherwise . * @ param proxyAutoconfigUrl...
verifyProxyTypeCompatibility ( ProxyType . PAC ) ; this . proxyType = ProxyType . PAC ; this . proxyAutoconfigUrl = proxyAutoconfigUrl ; return this ;
public class PersonGroupPersonsImpl { /** * Delete a face from a person . Relative image for the persisted face will also be deleted . * @ param personGroupId Id referencing a particular person group . * @ param personId Id referencing a particular person . * @ param persistedFaceId Id referencing a particular pe...
deleteFaceWithServiceResponseAsync ( personGroupId , personId , persistedFaceId ) . toBlocking ( ) . single ( ) . body ( ) ;
public class Maps { /** * Returns the value to which the specified key is mapped , or * an empty immutable { @ code List } if this map contains no mapping for the key . * @ param map * @ param key * @ return */ public static < K , E , V extends List < E > > List < E > getOrEmptyList ( final Map < K , V > map , ...
if ( N . isNullOrEmpty ( map ) ) { return N . < E > emptyList ( ) ; } final V val = map . get ( key ) ; if ( val != null || map . containsKey ( key ) ) { return val ; } else { return N . emptyList ( ) ; }
public class AnimaQuery { /** * generate between statement , simultaneous setting value * @ param columnName column name * @ param a first range value * @ param b second range value * @ return AnimaQuery */ public AnimaQuery < T > between ( String columnName , Object a , Object b ) { } }
conditionSQL . append ( " AND " ) . append ( columnName ) . append ( " BETWEEN ? and ?" ) ; paramValues . add ( a ) ; paramValues . add ( b ) ; return this ;
public class AfplibPackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EEnum getPGPRGRGLength ( ) { } }
if ( pgprgrgLengthEEnum == null ) { pgprgrgLengthEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( AfplibPackage . eNS_URI ) . getEClassifiers ( ) . get ( 124 ) ; } return pgprgrgLengthEEnum ;
public class TemplateBuilderHelper { /** * Registers and configures a { @ link TemplateParser } through a dedicated * builder . * For example : * < pre > * . register ( ThymeleafEmailBuilder . class ) * . detector ( new ThymeleafEngineDetector ( ) ) ; * < / pre > * Your { @ link Builder } may implement { ...
// if already registered = > provide same instance for ( Builder < ? extends TemplateParser > builder : templateBuilders ) { if ( builderClass . isAssignableFrom ( builder . getClass ( ) ) ) { return ( T ) builder ; } } // create the builder instance try { T builder ; Constructor < T > constructor = builderClass . getC...
public class FactoryMultiView { /** * Creates a trifocal tensor estimation algorithm . * @ param config configuration for the estimator * @ return Trifocal tensor estimator */ public static Estimate1ofTrifocalTensor trifocal_1 ( @ Nullable ConfigTrifocal config ) { } }
if ( config == null ) { config = new ConfigTrifocal ( ) ; } switch ( config . which ) { case LINEAR_7 : return new WrapTrifocalLinearPoint7 ( ) ; case ALGEBRAIC_7 : ConfigConverge cc = config . converge ; UnconstrainedLeastSquares optimizer = FactoryOptimization . levenbergMarquardt ( null , false ) ; TrifocalAlgebraic...
public class BitflyerAdapters { /** * Adapts a list of BitflyerBalance objects to Wallet . * @ param balances Some BitflyerBalances from the API * @ return A Wallet with balances in it */ public static Wallet adaptAccountInfo ( List < BitflyerBalance > balances ) { } }
List < Balance > adaptedBalances = new ArrayList < > ( balances . size ( ) ) ; for ( BitflyerBalance balance : balances ) { adaptedBalances . add ( new Balance ( Currency . getInstance ( balance . getCurrencyCode ( ) ) , balance . getAmount ( ) , balance . getAvailable ( ) ) ) ; } return new Wallet ( adaptedBalances ) ...