signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class JWTUtils { /** * Username from a given JWT Token * @ param token JWT Token * @ return Username from JWT Token . */ public static String getUsername ( String token ) { } }
String accessTokenPayload = token . substring ( token . indexOf ( "." ) + 1 , token . lastIndexOf ( "." ) ) ; byte [ ] decoded = Base64 . getMimeDecoder ( ) . decode ( accessTokenPayload ) ; String output = new String ( decoded ) ; Map < String , Object > myMap = new HashMap < String , Object > ( ) ; String result = "u...
public class ModelsImpl { /** * Get the explicit list of the pattern . any entity . * @ param appId The application ID . * @ param versionId The version ID . * @ param entityId The Pattern . Any entity Id . * @ param itemId The explicit list item Id . * @ param serviceCallback the async ServiceCallback to han...
return ServiceFuture . fromResponse ( getExplicitListItemWithServiceResponseAsync ( appId , versionId , entityId , itemId ) , serviceCallback ) ;
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } * { @ link CmisExtensionType } { @ code > } */ @ XmlElementDecl ( namespace = "http://docs.oasis-open.org/ns/cmis/messaging/200908/" , name = "extension" , scope = CheckOutResponse . class ) public JAXBElement < CmisExtension...
return new JAXBElement < CmisExtensionType > ( _GetPropertiesExtension_QNAME , CmisExtensionType . class , CheckOutResponse . class , value ) ;
public class EditText { /** * @ return whether or not the cursor is visible ( assuming this TextView is editable ) * @ see # setCursorVisible ( boolean ) * @ attr ref android . R . styleable # TextView _ cursorVisible */ @ TargetApi ( Build . VERSION_CODES . JELLY_BEAN ) public boolean isCursorVisible ( ) { } }
return Build . VERSION . SDK_INT < Build . VERSION_CODES . JELLY_BEAN || mInputView . isCursorVisible ( ) ;
public class UpdateEvaluationRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( UpdateEvaluationRequest updateEvaluationRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( updateEvaluationRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( updateEvaluationRequest . getEvaluationId ( ) , EVALUATIONID_BINDING ) ; protocolMarshaller . marshall ( updateEvaluationRequest . getEvaluationName ( ) , EVALUA...
public class Statistics { /** * < p > tally . < / p > * @ param other a { @ link com . greenpepper . Statistics } object . */ public void tally ( Statistics other ) { } }
rightCount += other . rightCount ( ) ; wrongCount += other . wrongCount ( ) ; ignoredCount += other . ignoredCount ( ) ; exceptionCount += other . exceptionCount ( ) ;
public class YearMonth { /** * { @ inheritDoc } * @ throws DateTimeException { @ inheritDoc } * @ throws ArithmeticException { @ inheritDoc } */ @ Override public YearMonth plus ( long amountToAdd , TemporalUnit unit ) { } }
if ( unit instanceof ChronoUnit ) { switch ( ( ChronoUnit ) unit ) { case MONTHS : return plusMonths ( amountToAdd ) ; case YEARS : return plusYears ( amountToAdd ) ; case DECADES : return plusYears ( Jdk8Methods . safeMultiply ( amountToAdd , 10 ) ) ; case CENTURIES : return plusYears ( Jdk8Methods . safeMultiply ( am...
public class EventsApi { /** * Get a Stream of events for the authenticated user . * < pre > < code > GitLab Endpoint : GET / events < / code > < / pre > * @ param action include only events of a particular action type , optional * @ param targetType include only events of a particular target type , optional * ...
return ( getAuthenticatedUserEvents ( action , targetType , before , after , sortOrder , getDefaultPerPage ( ) ) . stream ( ) ) ;
public class CmsFavoriteTab { /** * Starts the editing . < p > * @ param event the click event */ @ UiHandler ( "m_editButton" ) void editAction ( ClickEvent event ) { } }
m_clipboard . enableFavoritesEdit ( ) ; m_buttonUsePanel . setVisible ( false ) ; m_buttonEditingPanel . setVisible ( true ) ;
public class GraphRunner { /** * Convert a json string written out * by { @ link com . github . os72 . protobuf351 . util . JsonFormat } * to a { @ link org . bytedeco . tensorflow . ConfigProto } * @ param json the json to read * @ return the config proto to use */ public static org . tensorflow . framework . ...
org . tensorflow . framework . ConfigProto . Builder builder = org . tensorflow . framework . ConfigProto . newBuilder ( ) ; try { JsonFormat . parser ( ) . merge ( json , builder ) ; org . tensorflow . framework . ConfigProto build = builder . build ( ) ; ByteString serialized = build . toByteString ( ) ; byte [ ] bin...
public class UserPoolClientType { /** * A list of allowed < code > OAuth < / code > scopes . Currently supported values are < code > " phone " < / code > , * < code > " email " < / code > , < code > " openid " < / code > , and < code > " Cognito " < / code > . * < b > NOTE : < / b > This method appends the values t...
if ( this . allowedOAuthScopes == null ) { setAllowedOAuthScopes ( new java . util . ArrayList < String > ( allowedOAuthScopes . length ) ) ; } for ( String ele : allowedOAuthScopes ) { this . allowedOAuthScopes . add ( ele ) ; } return this ;
public class ClientTransportImpl { /** * Get realm by URL . * @ param sUrl URL string . * @ return realm name or null . * @ throws IOException transport exception . * @ throws ModuleException ModuleException . */ private String getRealm ( String sUrl ) throws IOException , ModuleException { } }
AuthorizationHandler ah = AuthorizationInfo . getAuthHandler ( ) ; try { URL url = new URL ( sUrl ) ; HTTPConnection connection = new HTTPConnection ( url ) ; connection . removeModule ( CookieModule . class ) ; AuthorizationInfo . setAuthHandler ( null ) ; HTTPResponse resp = connection . Get ( url . getFile ( ) ) ; S...
public class ConstrainedExecutorService { /** * Submit a task to be executed in the future . * @ param runnable The task to be executed . */ @ Override public void execute ( Runnable runnable ) { } }
if ( runnable == null ) { throw new NullPointerException ( "runnable parameter is null" ) ; } if ( ! mWorkQueue . offer ( runnable ) ) { throw new RejectedExecutionException ( mName + " queue is full, size=" + mWorkQueue . size ( ) ) ; } final int queueSize = mWorkQueue . size ( ) ; final int maxSize = mMaxQueueSize . ...
public class Client { /** * Generates an access token for a user * @ param userId * Id of the user * @ param expiresIn * Set the duration of the token in seconds . ( default : 259200 seconds = 72h ) * 72 hours is the max value . * @ return Created MFAToken * @ throws OAuthSystemException - if there is a I...
return generateMFAToken ( userId , expiresIn , false ) ;
public class OptGroupDropDownChoice { /** * { @ inheritDoc } */ @ Override protected void appendOptionHtml ( final AppendingStringBuffer buffer , final T choice , final int index , final String selected ) { } }
final T currentOptGroup = choice ; if ( isNewGroup ( currentOptGroup ) ) { if ( ! isFirst ( index ) ) { buffer . append ( CLOSE_OPTGROUP_TAG ) ; } appendOptGroupLabel ( buffer , currentOptGroup ) ; } super . appendOptionHtml ( buffer , choice , index , selected ) ; if ( isLast ( index ) ) { buffer . append ( CLOSE_OPTG...
public class GrpSettings { /** * Sets the provider value for this GrpSettings . * @ param provider * Specifies the GRP provider of the { @ link LineItem } . */ public void setProvider ( com . google . api . ads . admanager . axis . v201811 . GrpProvider provider ) { } }
this . provider = provider ;
public class EmailUtils { /** * Send a job failure alert email . * @ param jobName job name * @ param message email message * @ param failures number of consecutive job failures * @ param jobState a { @ link State } object carrying job configuration properties * @ throws EmailException if there is anything wr...
sendEmail ( jobState , String . format ( "Gobblin alert: job %s has failed %d %s consecutively in the past" , jobName , failures , failures > 1 ? "times" : "time" ) , message ) ;
public class ScanResult { /** * Determine whether the classpath contents have been modified since the last scan . Checks the timestamps of * files and jarfiles encountered during the previous scan to see if they have changed . Does not perform a full * scan , so cannot detect the addition of directories that newly ...
if ( closed . get ( ) ) { throw new IllegalArgumentException ( "Cannot use a ScanResult after it has been closed" ) ; } if ( fileToLastModified == null ) { return true ; } else { for ( final Entry < File , Long > ent : fileToLastModified . entrySet ( ) ) { if ( ent . getKey ( ) . lastModified ( ) != ent . getValue ( ) ...
public class PluginManager { /** * Gets the current instance of plugin manager * @ return PluginManager */ public static PluginManager getInstance ( ) { } }
if ( _instance == null ) { _instance = new PluginManager ( ) ; _instance . classInformation = new HashMap < String , ClassInformation > ( ) ; _instance . methodInformation = new HashMap < String , com . groupon . odo . proxylib . models . Method > ( ) ; _instance . jarInformation = new ArrayList < String > ( ) ; if ( _...
public class AggressiveUrlCanonicalizer { /** * Run a regex against a StringBuilder , removing group 1 if it matches . * Assumes the regex has a form that wants to strip elements of the passed * string . Assumes that if a match , group 1 should be removed * @ param url Url to search in . * @ param matcher Match...
if ( matcher != null && matcher . matches ( ) ) { url . delete ( matcher . start ( 1 ) , matcher . end ( 1 ) ) ; return true ; } return false ;
public class JDBCConnection { /** * # ifdef JAVA6 */ public Array createArrayOf ( String typeName , Object [ ] elements ) throws SQLException { } }
checkClosed ( ) ; throw Util . notSupported ( ) ;
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EEnum getIfcReflectanceMethodEnum ( ) { } }
if ( ifcReflectanceMethodEnumEEnum == null ) { ifcReflectanceMethodEnumEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 1049 ) ; } return ifcReflectanceMethodEnumEEnum ;
public class ResultPartitionMetrics { /** * Iterates over all sub - partitions and collects the minimum number of queued buffers in a * sub - partition in a best - effort way . * @ return minimum number of queued buffers per sub - partition ( < tt > 0 < / tt > if sub - partitions exist ) */ int refreshAndGetMin ( )...
int min = Integer . MAX_VALUE ; ResultSubpartition [ ] allPartitions = partition . getAllPartitions ( ) ; if ( allPartitions . length == 0 ) { // meaningful value when no channels exist : return 0 ; } for ( ResultSubpartition part : allPartitions ) { int size = part . unsynchronizedGetNumberOfQueuedBuffers ( ) ; min = ...
public class nstrafficdomain_vlan_binding { /** * Use this API to fetch nstrafficdomain _ vlan _ binding resources of given name . */ public static nstrafficdomain_vlan_binding [ ] get ( nitro_service service , Long td ) throws Exception { } }
nstrafficdomain_vlan_binding obj = new nstrafficdomain_vlan_binding ( ) ; obj . set_td ( td ) ; nstrafficdomain_vlan_binding response [ ] = ( nstrafficdomain_vlan_binding [ ] ) obj . get_resources ( service ) ; return response ;
public class RemoteFileUtil { /** * Copy a single file from local source to remote destination */ private static void copyToRemote ( Path src , URI dst ) throws IOException { } }
ResourceId dstId = FileSystems . matchNewResource ( dst . toString ( ) , false ) ; WritableByteChannel dstCh = FileSystems . create ( dstId , MimeTypes . BINARY ) ; FileChannel srcCh = FileChannel . open ( src , StandardOpenOption . READ ) ; long srcSize = srcCh . size ( ) ; long copied = 0 ; do { copied += srcCh . tra...
public class CommerceShipmentItemPersistenceImpl { /** * Clears the cache for all commerce shipment items . * The { @ link EntityCache } and { @ link FinderCache } are both cleared by this method . */ @ Override public void clearCache ( ) { } }
entityCache . clearCache ( CommerceShipmentItemImpl . class ) ; finderCache . clearCache ( FINDER_CLASS_NAME_ENTITY ) ; finderCache . clearCache ( FINDER_CLASS_NAME_LIST_WITH_PAGINATION ) ; finderCache . clearCache ( FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION ) ;
public class TextUtils { /** * Parses the following strings : key1 = value1 , value2 , value3 ; key2 = value4 , value5 * @ param data a string of the specified format * @ return a map with parsed keys and values */ public static Map < String , Set < String > > parseAssignment ( String data ) { } }
Map < String , Set < String > > ret = new HashMap < > ( ) ; if ( data != null ) { StringTokenizer stringTokenizer = new StringTokenizer ( data , String . format ( "%s%s%s" , EQUALITY , COMMA , SEMICOLON ) , true ) ; String key = null ; Set < String > value = new HashSet < > ( ) ; int counter = 0 ; while ( stringTokeniz...
public class ClockProPolicy { /** * Delete meta data data , update hands accordingly . */ private void delete ( Node node ) { } }
if ( handHot == node ) { handHot = node . next ; } if ( handCold == node ) { handCold = node . next ; } if ( handTest == node ) { handTest = node . next ; } node . remove ( ) ;
public class SipApplicationSessionImpl { /** * ( non - Javadoc ) * @ see javax . servlet . sip . SipApplicationSession # setExpires ( int ) */ @ SuppressWarnings ( value = "unchecked" ) public int setExpires ( int deltaMinutes ) { } }
if ( ! isValid ( ) ) { throw new IllegalStateException ( "Impossible to change the sip application " + "session timeout when it has been invalidated !" ) ; } expired = false ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Postponing the expiratin of the sip application session " + key + " to expire in " + delt...
public class JumboEnumSet { /** * Recalculates the size of the set . Returns true if it ' s changed . */ private boolean recalculateSize ( ) { } }
int oldSize = size ; size = 0 ; for ( long elt : elements ) size += Long . bitCount ( elt ) ; return size != oldSize ;
public class responderparam { /** * Use this API to fetch all the responderparam resources that are configured on netscaler . */ public static responderparam get ( nitro_service service ) throws Exception { } }
responderparam obj = new responderparam ( ) ; responderparam [ ] response = ( responderparam [ ] ) obj . get_resources ( service ) ; return response [ 0 ] ;
public class BasicBundleRenderer { /** * / * ( non - Javadoc ) * @ see net . jawr . web . resource . bundle . renderer . AbstractBundleLinkRenderer # renderLink ( java . lang . String ) */ protected String renderLink ( String fullPath ) { } }
renderedLinks . add ( new RenderedLink ( fullPath , bundler . getConfig ( ) . isDebugModeOn ( ) ) ) ; return fullPath ;
public class CodeGenerator { /** * generate < code > decode < / code > method source code * @ return */ private String getDecodeMethodCode ( ) { } }
StringBuilder code = new StringBuilder ( ) ; code . append ( "public " ) . append ( ClassHelper . getInternalName ( cls . getCanonicalName ( ) ) ) ; code . append ( " decode(byte[] bb) throws IOException {" ) . append ( LINE_BREAK ) ; code . append ( "CodedInputStream input = CodedInputStream.newInstance(bb, 0, bb.leng...
public class CPDefinitionInventoryPersistenceImpl { /** * Returns the first cp definition inventory in the ordered set where uuid = & # 63 ; and companyId = & # 63 ; . * @ param uuid the uuid * @ param companyId the company ID * @ param orderByComparator the comparator to order the set by ( optionally < code > nu...
CPDefinitionInventory cpDefinitionInventory = fetchByUuid_C_First ( uuid , companyId , orderByComparator ) ; if ( cpDefinitionInventory != null ) { return cpDefinitionInventory ; } StringBundler msg = new StringBundler ( 6 ) ; msg . append ( _NO_SUCH_ENTITY_WITH_KEY ) ; msg . append ( "uuid=" ) ; msg . append ( uuid ) ...
public class JSONs { /** * Read partitions of nodes . * @ param mo the associated model to browse * @ param o the object to parse * @ param id the key in the map that points to the partitions * @ return the parsed partition * @ throws JSONConverterException if the key does not point to partitions of nodes */ ...
Set < Collection < Node > > nodes = new HashSet < > ( ) ; Object x = o . get ( id ) ; if ( ! ( x instanceof JSONArray ) ) { throw new JSONConverterException ( "Set of identifiers sets expected at key '" + id + "'" ) ; } for ( Object obj : ( JSONArray ) x ) { nodes . add ( nodesFromJSON ( mo , ( JSONArray ) obj ) ) ; } ...
public class PartialResponseWriter { /** * < p class = " changed _ added _ 2_0 " > Write the start of an extension operation . < / p > * @ param attributes String name / value pairs for extension element attributes * @ throws IOException if an input / output error occurs * @ since 2.0 */ public void startExtensio...
startChangesIfNecessary ( ) ; ResponseWriter writer = getWrapped ( ) ; writer . startElement ( "extension" , null ) ; if ( attributes != null && ! attributes . isEmpty ( ) ) { for ( Map . Entry < String , String > entry : attributes . entrySet ( ) ) { writer . writeAttribute ( entry . getKey ( ) , entry . getValue ( ) ...
public class AbstractConsoleEditor { /** * Hides the editor screen and restore the { @ link Terminal } . */ public void hide ( ) { } }
console . out ( ) . print ( "\33[" + 1 + ";" + terminal . getHeight ( ) + ";r" ) ; // Erase screen doesn ' t behave well on windows . for ( int l = 1 ; l <= terminal . getHeight ( ) ; l ++ ) { console . out ( ) . print ( ansi ( ) . cursor ( l , 1 ) ) ; console . out ( ) . print ( ansi ( ) . eraseLine ( Erase . FORWARD ...
public class PoolStatisticsImpl { /** * Add delta to total blocking timeout * @ param delta The value */ public void deltaTotalBlockingTime ( long delta ) { } }
if ( enabled . get ( ) && delta > 0 ) { totalBlockingTime . addAndGet ( delta ) ; totalBlockingTimeInvocations . incrementAndGet ( ) ; if ( delta > maxWaitTime . get ( ) ) maxWaitTime . set ( delta ) ; }
public class CmsDialog { /** * Displays the throwable on the error page and logs the error . < p > * @ param wp the workplace class * @ param t the throwable to be displayed on the error page * @ throws JspException if the include of the error page jsp fails */ public void includeErrorpage ( CmsWorkplace wp , Thr...
CmsLog . getLog ( wp ) . error ( Messages . get ( ) . getBundle ( ) . key ( Messages . ERR_WORKPLACE_DIALOG_0 ) , t ) ; getJsp ( ) . getRequest ( ) . setAttribute ( SESSION_WORKPLACE_CLASS , wp ) ; getJsp ( ) . getRequest ( ) . setAttribute ( ATTRIBUTE_THROWABLE , t ) ; getJsp ( ) . include ( FILE_DIALOG_SCREEN_ERRORPA...
public class Resolve { /** * Is class accessible in given evironment ? * @ param env The current environment . * @ param c The class whose accessibility is checked . */ public boolean isAccessible ( Env < AttrContext > env , TypeSymbol c ) { } }
return isAccessible ( env , c , false ) ;
public class AtomicStampedReference { /** * Atomically sets the value of both the reference and stamp * to the given update values if the * current reference is { @ code = = } to the expected reference * and the current stamp is equal to the expected stamp . * @ param expectedReference the expected value of the...
Pair < V > current = pair ; return expectedReference == current . reference && expectedStamp == current . stamp && ( ( newReference == current . reference && newStamp == current . stamp ) || casPair ( current , Pair . of ( newReference , newStamp ) ) ) ;
public class AbstractJacksonBackedStringSerializer { /** * Configure mapper . * @ param mapper the mapper */ protected void configureObjectMapper ( final ObjectMapper mapper ) { } }
mapper . configure ( SerializationFeature . FAIL_ON_EMPTY_BEANS , false ) . configure ( DeserializationFeature . FAIL_ON_UNKNOWN_PROPERTIES , false ) ; mapper . setSerializationInclusion ( JsonInclude . Include . NON_EMPTY ) ; mapper . setVisibility ( PropertyAccessor . SETTER , JsonAutoDetect . Visibility . PROTECTED_...
public class TableSubject { /** * Fails if the table contains the given cell . */ public void doesNotContainCell ( @ NullableDecl Object rowKey , @ NullableDecl Object colKey , @ NullableDecl Object value ) { } }
doesNotContainCell ( Tables . < Object , Object , Object > immutableCell ( rowKey , colKey , value ) ) ;
public class Fragments { /** * Create a traversal that filters to only vertices */ static < T > GraphTraversal < T , Vertex > isVertex ( GraphTraversal < T , ? extends Element > traversal ) { } }
// This cast is safe because we filter only to vertices // noinspection unchecked return ( GraphTraversal < T , Vertex > ) traversal . filter ( e -> e . get ( ) instanceof Vertex ) ;
public class MDDImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ SuppressWarnings ( "unchecked" ) @ Override public void eSet ( int featureID , Object newValue ) { } }
switch ( featureID ) { case AfplibPackage . MDD__XM_BASE : setXmBase ( ( Integer ) newValue ) ; return ; case AfplibPackage . MDD__YM_BASE : setYmBase ( ( Integer ) newValue ) ; return ; case AfplibPackage . MDD__XM_UNITS : setXmUnits ( ( Integer ) newValue ) ; return ; case AfplibPackage . MDD__YM_UNITS : setYmUnits (...
public class EnvironmentResourceDescription { /** * The < code > AutoScalingGroups < / code > used by this environment . * @ return The < code > AutoScalingGroups < / code > used by this environment . */ public java . util . List < AutoScalingGroup > getAutoScalingGroups ( ) { } }
if ( autoScalingGroups == null ) { autoScalingGroups = new com . amazonaws . internal . SdkInternalList < AutoScalingGroup > ( ) ; } return autoScalingGroups ;
public class ActionExecutionResultMarshaller { /** * Marshall the given parameter object . */ public void marshall ( ActionExecutionResult actionExecutionResult , ProtocolMarshaller protocolMarshaller ) { } }
if ( actionExecutionResult == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( actionExecutionResult . getExternalExecutionId ( ) , EXTERNALEXECUTIONID_BINDING ) ; protocolMarshaller . marshall ( actionExecutionResult . getExternalExecutionSu...
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link ArithType } { @ code > } } */ @ XmlElementDecl ( namespace = "http://www.w3.org/1998/Math/MathML" , name = "factorial" ) public JAXBElement < ArithType > createFactorial ( ArithType value ) { } }
return new JAXBElement < ArithType > ( _Factorial_QNAME , ArithType . class , null , value ) ;
public class HelpWriter { /** * Add the help file contents from the resource file to the content tree . While adding the * help file contents it also keeps track of user options . If " - notree " * is used , then the " overview - tree . html " will not get added and hence * help information also will not get adde...
Content heading = HtmlTree . HEADING ( HtmlConstants . TITLE_HEADING , false , HtmlStyle . title , getResource ( "doclet.Help_line_1" ) ) ; Content div = HtmlTree . DIV ( HtmlStyle . header , heading ) ; Content line2 = HtmlTree . DIV ( HtmlStyle . subTitle , getResource ( "doclet.Help_line_2" ) ) ; div . addContent ( ...
public class HamcrestMatchers { /** * Creates a matcher that matches when the examined { @ linkplain Date } has the given values < code > hour < / code > and * < code > ClockPeriod < / code > ( e . g . < em > AM < / em > ) . */ public static Matcher < Date > hasHour ( final int hour , final ClockPeriod clockPeriod ) ...
return IsDateWithTime . hasHour ( hour , clockPeriod ) ;
public class Basic2DMatrix { /** * Parses { @ link Basic2DMatrix } from the given Matrix Market . * @ param is the input stream in Matrix Market format * @ return a parsed matrix * @ exception IOException if an I / O error occurs . */ public static Basic2DMatrix fromMatrixMarket ( InputStream is ) throws IOExcept...
return Matrix . fromMatrixMarket ( is ) . to ( Matrices . BASIC_2D ) ;
public class Tree { /** * Clears the sub - nodes on the specified path . If no matching node exists , * creates a new empty node . Sample code : < br > * < br > * Tree array = node . clear ( " a . b " ) . add ( 1 ) . add ( 2 ) ; * @ param path * path of the sub - node * @ return the empty sub - node at the ...
Tree child = getChild ( path , false ) ; if ( child == null ) { child = putMap ( path ) ; } else { child . clear ( ) ; } return child ;
public class AbstractDatabase { /** * Add the given DocumentChangeListener to the specified document with an executor on which * the changes will be posted to the listener . */ @ NonNull public ListenerToken addDocumentChangeListener ( @ NonNull String id , Executor executor , @ NonNull DocumentChangeListener listene...
if ( id == null ) { throw new IllegalArgumentException ( "id cannot be null." ) ; } if ( listener == null ) { throw new IllegalArgumentException ( "listener cannot be null." ) ; } synchronized ( lock ) { mustBeOpen ( ) ; return addDocumentChangeListener ( executor , listener , id ) ; }
public class DeleteFileExtensions { /** * Checks the File if it is a directory or if its exists or if it is empty . * @ param file * The File to check . * @ return Null if nothing is wrong otherwise an Exception . */ public static Exception checkFile ( final File file ) { } }
Exception ex = null ; String error = null ; // check if the file does not exists . . . if ( ! file . exists ( ) ) { error = "The " + file + " does not exists." ; ex = new FileDoesNotExistException ( error ) ; return ex ; } // check if the file is not a directory . . . if ( ! file . isDirectory ( ) ) { error = "The " + ...
public class DevUtils { /** * Send this JVM process a SIGQUIT ; giving a thread dump and possibly * a heap histogram ( if using - XX : + PrintClassHistogram ) . * Used to automatically dump info , for example when a serious error * is encountered . Would use ' jmap ' / ' jstack ' , but have seen JVM * lockups -...
try { Process p = Runtime . getRuntime ( ) . exec ( new String [ ] { "perl" , "-e" , "print getppid(). \"\n\";" } ) ; BufferedReader br = new BufferedReader ( new InputStreamReader ( p . getInputStream ( ) ) ) ; String ppid = br . readLine ( ) ; Runtime . getRuntime ( ) . exec ( new String [ ] { "sh" , "-c" , "kill -3 ...
public class JedisSortedSet { /** * When all the elements in a sorted set are inserted with the same score , in order to force lexicographical * ordering , this command returns all the elements in the sorted set with a value in the given range . * If the elements in the sorted set have different scores , the return...
return doWithJedis ( new JedisCallable < Set < String > > ( ) { @ Override public Set < String > call ( Jedis jedis ) { if ( lexRange . hasLimit ( ) ) { return jedis . zrangeByLex ( getKey ( ) , lexRange . from ( ) , lexRange . to ( ) , lexRange . offset ( ) , lexRange . count ( ) ) ; } else { return jedis . zrangeByLe...
public class ExtractRegular { /** * 初始化 : * 1 、 从配置管理web服务器获取完整的抽取规则的json表示 * 2 、 抽取json , 构造对应的java对象结构 * @ param serverUrl 配置管理WEB服务器的抽取规则下载地址 */ private synchronized void init ( String serverUrl ) { } }
LOGGER . info ( "开始下载URL抽取规则" ) ; LOGGER . info ( "serverUrl: " + serverUrl ) ; // 从配置管理web服务器获取完整的抽取规则 String json = downJson ( serverUrl ) ; LOGGER . info ( "完成下载URL抽取规则" ) ; // 抽取规则 LOGGER . info ( "开始解析URL抽取规则" ) ; List < UrlPattern > urlPatterns = parseJson ( json ) ; LOGGER . info ( "完成解析URL抽取规则" ) ; init ( urlPa...
public class ProxyController { /** * Generate error view stuffing the code and description * of the error into the model . View name is set to { @ link # failureView } . * @ param code the code * @ param args the msg args * @ return the model and view */ private ModelAndView generateErrorView ( final String cod...
val modelAndView = new ModelAndView ( this . failureView ) ; modelAndView . addObject ( "code" , StringEscapeUtils . escapeHtml4 ( code ) ) ; val desc = StringEscapeUtils . escapeHtml4 ( this . context . getMessage ( code , args , code , request . getLocale ( ) ) ) ; modelAndView . addObject ( "description" , desc ) ; ...
public class SibRaConnection { /** * Deletes a temporary destination . Checks that the connection is valid and * then delegates . * @ param destinationAddress * the destination to delete * @ throws SIErrorException * if the delegation fails * @ throws SIResourceException * if the delegation fails * @ th...
checkValid ( ) ; _delegateConnection . deleteTemporaryDestination ( destinationAddress ) ;
public class HyperLogLogCollector { /** * Returns the number of registers that are no longer zero after the value was added * @ param position The position into the byte buffer , this position represents two " registers " * @ param offsetDiff The difference in offset between the byteToAdd and the current HyperLogLo...
if ( byteToAdd == 0 ) { return 0 ; } final byte currVal = storageBuffer . get ( position ) ; final int upperNibble = currVal & 0xf0 ; final int lowerNibble = currVal & 0x0f ; // subtract the differences so that the nibbles align final int otherUpper = ( byteToAdd & 0xf0 ) - ( offsetDiff << bitsPerBucket ) ; final int o...
public class AmazonConfigClient { /** * Returns the details for the specified configuration recorders . If the configuration recorder is not specified , * this action returns the details for all configuration recorders associated with the account . * < note > * Currently , you can specify only one configuration r...
request = beforeClientExecution ( request ) ; return executeDescribeConfigurationRecorders ( request ) ;
public class GVRAsynchronousResourceLoader { /** * An internal method , public only so that GVRContext can make cross - package * calls . * A synchronous ( blocking ) wrapper around * { @ link android . graphics . BitmapFactory # decodeStream ( InputStream ) * BitmapFactory . decodeStream } that uses an * { @...
return AsyncBitmapTexture . decodeStream ( stream , AsyncBitmapTexture . glMaxTextureSize , AsyncBitmapTexture . glMaxTextureSize , true , null , closeStream ) ;
public class DataHandler { /** * Sends the FCM registration ID to CleverTap . * @ param fcmId The FCM registration ID * @ param register Boolean indicating whether to register * or not for receiving push messages from CleverTap . * Set this to true to receive push messages from CleverTap , * and false to not ...
CleverTapAPI cleverTapAPI = weakReference . get ( ) ; if ( cleverTapAPI == null ) { Logger . d ( "CleverTap Instance is null." ) ; } else { cleverTapAPI . pushFcmRegistrationId ( fcmId , register ) ; }
public class JMStream { /** * Build random number stream double stream . * @ param count the count * @ return the double stream */ public static DoubleStream buildRandomNumberStream ( int count ) { } }
return IntStream . range ( 0 , count ) . mapToDouble ( i -> Math . random ( ) ) ;
public class Schedule { /** * The tags to apply to policy - created resources . These user - defined tags are in addition to the AWS - added lifecycle * tags . * @ param tagsToAdd * The tags to apply to policy - created resources . These user - defined tags are in addition to the AWS - added * lifecycle tags . ...
if ( tagsToAdd == null ) { this . tagsToAdd = null ; return ; } this . tagsToAdd = new java . util . ArrayList < Tag > ( tagsToAdd ) ;
public class MapApi { /** * Walks by map ' s nodes and extracts optional value of type T . * @ param < T > value type * @ param clazz type of value * @ param map subject * @ param path nodes to walk in map * @ return optional value of type T */ public static < T > T getUnsafe ( final Map map , final Class < T...
return get ( map , clazz , path ) . orElseThrow ( ( ) -> new IllegalAccessError ( "Map " + map + " does not have value of type " + clazz . getName ( ) + " by " + Arrays . stream ( path ) . map ( Object :: toString ) . collect ( Collectors . joining ( "." ) ) ) ) ;
public class BaselineContextGenerator { /** * Returns the context for making a pos tag decision at the specified token * index given the specified tokens and previous tags . * @ param index * The index of the token for which the context is provided . * @ param tokens * The tokens in the sentence . * @ param...
String next , nextnext , lex , prev , prevprev ; String tagprev , tagprevprev ; tagprev = tagprevprev = null ; next = nextnext = lex = prev = prevprev = null ; lex = tokens [ index ] . toString ( ) ; if ( tokens . length > index + 1 ) { next = tokens [ index + 1 ] . toString ( ) ; if ( tokens . length > index + 2 ) { n...
public class Zips { /** * 压缩 * @ param source * 源 ( 文件或目录 ) * @ param target * 目标 ( 只能是目录 ) * @ throws IOException */ public static void zip ( File [ ] sources , File target ) throws IOException { } }
zip ( sources , target , null ) ;
public class Commands { /** * Shellifies an option name using the provided style * @ param name * @ param style * @ return */ public static String shellifyOptionNameDashed ( String name ) { } }
String shellName = shellifyName ( name ) ; StringBuilder sb = new StringBuilder ( ) ; for ( int i = 0 ; i < shellName . length ( ) ; i ++ ) { char c = shellName . charAt ( i ) ; if ( Character . isUpperCase ( c ) ) { if ( i > 0 ) { char previousChar = shellName . charAt ( i - 1 ) ; char nextChar = ( i + 1 < shellName ....
public class JMResources { /** * Gets resource uri . * @ param classpath the classpath * @ return the resource uri */ public static URI getResourceURI ( String classpath ) { } }
try { return getResourceURL ( classpath ) . toURI ( ) ; } catch ( Exception e ) { return JMExceptionManager . handleExceptionAndReturnNull ( log , e , "getResourceURI" , classpath ) ; }
public class FileCopyUtils { /** * Copy the contents of the given input File to the given output File . * @ param in the file to copy from * @ param out the file to copy to * @ return the number of bytes copied * @ throws IOException in case of I / O errors */ public static int copy ( File in , File out ) throw...
Assert . notNull ( in , "No input File specified" ) ; Assert . notNull ( out , "No output File specified" ) ; return copy ( new BufferedInputStream ( new FileInputStream ( in ) ) , new BufferedOutputStream ( new FileOutputStream ( out ) ) ) ;
public class PhoneField { /** * Get the HTML Hyperlink ( Change this when the W3C has a standard for dialing the phone ) . * @ return The html link ( null ) . */ public String getHyperlink ( ) { } }
String strMailTo = this . getString ( ) ; if ( strMailTo != null ) if ( strMailTo . length ( ) > 0 ) strMailTo = DBParams . PHONE + ":" + strMailTo ; return strMailTo ;
public class CmsUserSettingsBean { /** * Adds a user setting . < p > * @ param value the current value of the user setting * @ param config the configuration for the user setting * @ param basic true if this is a basic user setting */ public void addSetting ( String value , CmsXmlContentProperty config , boolean ...
m_values . put ( config . getName ( ) , value ) ; m_settingConfiguration . put ( config . getName ( ) , config ) ; if ( basic ) { m_basicOptions . add ( config . getName ( ) ) ; }
public class WTable { /** * Sets the table sort mode . The data model controls which columns are sortable . * @ param sortMode The sort mode to set . */ public void setSortMode ( final SortMode sortMode ) { } }
getOrCreateComponentModel ( ) . sortMode = sortMode == null ? SortMode . NONE : sortMode ;
public class ViewMap { /** * sort views . * Higher @ Priority is a better match . * Closer type match is a better match . */ private int compareView ( ViewRef < ? > viewA , ViewRef < ? > viewB , Class < ? > type ) { } }
int cmp = viewB . priority ( ) - viewA . priority ( ) ; if ( cmp != 0 ) { return cmp ; } cmp = typeDepth ( viewA . type ( ) , type ) - typeDepth ( viewB . type ( ) , type ) ; if ( cmp != 0 ) { return cmp ; } // equivalent views are sorted by name to ensure consistency String nameA = viewA . resolver ( ) . getClass ( ) ...
public class Copyright { /** * Create a new { @ code Copyright } object with the given data . * @ param author copyright holder ( TopoSoft , Inc . ) * @ param year year of copyright . * @ param license link to external file containing license text . * @ return a new { @ code Copyright } object with the given da...
return new Copyright ( author , Year . of ( year ) , parseURI ( license ) ) ;
public class TokenEndpointAuthenticationFilter { /** * If the incoming request contains user credentials in headers or parameters then extract them here into an * Authentication token that can be validated later . This implementation only recognises password grant requests and * extracts the username and password ....
String grantType = request . getParameter ( "grant_type" ) ; if ( grantType != null && grantType . equals ( "password" ) ) { UsernamePasswordAuthenticationToken result = new UsernamePasswordAuthenticationToken ( request . getParameter ( "username" ) , request . getParameter ( "password" ) ) ; result . setDetails ( auth...
public class SwitchPreference { /** * Obtains all attributes from a specific attribute set . * @ param attributeSet * The attribute set , the attributes should be obtained from , as an instance of the type * { @ link AttributeSet } or null , if no attributes should be obtained * @ param defaultStyle * The def...
TypedArray typedArray = getContext ( ) . obtainStyledAttributes ( attributeSet , R . styleable . SwitchPreference , defaultStyle , defaultStyleResource ) ; try { obtainSwitchTextOn ( typedArray ) ; obtainSwitchTextOff ( typedArray ) ; } finally { typedArray . recycle ( ) ; }
public class BitmapAdapter { /** * This function should be called by subclasses once they have actually loaded the bitmap . * @ param position the position of the item * @ param bitmap the bitmap that has been loaded */ protected void onBitmapLoaded ( int position , Bitmap bitmap ) { } }
BitmapCache bc = cachedBitmaps . get ( position ) ; if ( bc != null ) { bc . status = bitmap == null ? SlideStatus . NOT_AVAILABLE : SlideStatus . READY ; bc . bitmap = new WeakReference < Bitmap > ( bitmap ) ; }
public class Reflect { /** * create a class supporter with given class name * @ param clsName full name of the class to be supported * @ return Class supporter * @ see ClassSup */ @ SuppressWarnings ( "unchecked" ) public static < T > ClassSup < T > cls ( String clsName ) { } }
try { return mapper . get ( clsName , ( ) -> ( ClassSup < T > ) cls ( Class . forName ( clsName ) ) ) ; } catch ( Exception e ) { throw $ ( e ) ; }
public class WsFrameEncodingSupport { /** * Encode a WebSocket opcode onto a byte that might have some high bits set . * @ param b * @ param message * @ return */ private static byte doEncodeOpcode ( byte b , WsMessage message ) { } }
switch ( message . getKind ( ) ) { case TEXT : { b |= Opcode . TEXT . getCode ( ) ; break ; } case BINARY : { b |= Opcode . BINARY . getCode ( ) ; break ; } case PING : { b |= Opcode . PING . getCode ( ) ; break ; } case PONG : { b |= Opcode . PONG . getCode ( ) ; break ; } case CLOSE : { b |= Opcode . CLOSE . getCode ...
public class AmazonElastiCacheClient { /** * Modifies a replication group ' s shards ( node groups ) by allowing you to add shards , remove shards , or rebalance * the keyspaces among exisiting shards . * @ param modifyReplicationGroupShardConfigurationRequest * Represents the input for a < code > ModifyReplicati...
request = beforeClientExecution ( request ) ; return executeModifyReplicationGroupShardConfiguration ( request ) ;
public class AuthInfoMarshaller { /** * Marshall the given parameter object . */ public void marshall ( AuthInfo authInfo , ProtocolMarshaller protocolMarshaller ) { } }
if ( authInfo == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( authInfo . getActionType ( ) , ACTIONTYPE_BINDING ) ; protocolMarshaller . marshall ( authInfo . getResources ( ) , RESOURCES_BINDING ) ; } catch ( Exception e ) { throw new Sd...
public class SIPBalancerForwarder { /** * need to verify that comes from external in case of single leg */ protected Boolean comesFromInternalNode ( Response externalResponse , InvocationContext ctx , String host , Integer port , String transport , Boolean isIpV6 ) { } }
boolean found = false ; if ( host != null && port != null ) { if ( ctx . sipNodeMap ( isIpV6 ) . containsKey ( new KeySip ( host , port , isIpV6 ) ) ) found = true ; // for ( Node node : ctx . nodes ) { // if ( node . getIp ( ) . equals ( host ) ) { // if ( port . equals ( node . getProperties ( ) . get ( transport + "...
public class XPathUtils { /** * Evaluates the expression . * @ param node the node . * @ param xPathExpression the expression . * @ param nsContext the context . * @ param returnType * @ return the result . */ public static Object evaluateExpression ( Node node , String xPathExpression , NamespaceContext nsCo...
try { return buildExpression ( xPathExpression , nsContext ) . evaluate ( node , returnType ) ; } catch ( XPathExpressionException e ) { throw new CitrusRuntimeException ( "Can not evaluate xpath expression '" + xPathExpression + "'" , e ) ; }
public class WEditableImageRenderer { /** * Paints the given { @ link WEditableImage } . * @ param component the WEditableImage to paint . * @ param renderContext the RenderContext to paint to . */ @ Override public void doRender ( final WComponent component , final WebXmlRenderContext renderContext ) { } }
WEditableImage editableImage = ( WEditableImage ) component ; XmlStringBuilder xml = renderContext . getWriter ( ) ; // No image set if ( editableImage . getImage ( ) == null && editableImage . getImageUrl ( ) == null ) { return ; } WImageRenderer . renderTagOpen ( editableImage , xml ) ; WComponent uploader = editable...
public class Matcher { /** * Resets the Matcher . A new input sequence and a new region can be * specified . Results of a previous find get lost . The next attempt to find * an occurrence of the Pattern in the string will start at the beginning of * the region . This is the internal version of reset ( ) to which ...
if ( input == null ) { throw new IllegalArgumentException ( "input == null" ) ; } if ( start < 0 || end < 0 || start > input . length ( ) || end > input . length ( ) || start > end ) { throw new IndexOutOfBoundsException ( ) ; } this . input = input ; this . inputChars = input . toCharArray ( ) ; this . regionStart = s...
public class RunnersApi { /** * Deletes a registered Runner . * < pre > < code > GitLab Endpoint : DELETE / runners / < / code > < / pre > * @ param token the runners authentication token * @ throws GitLabApiException if any exception occurs */ public void deleteRunner ( String token ) throws GitLabApiException {...
GitLabApiForm formData = new GitLabApiForm ( ) . withParam ( "token" , token , true ) ; delete ( Response . Status . NO_CONTENT , formData . asMap ( ) , "runners" ) ;
public class Quaterniond { /** * / * ( non - Javadoc ) * @ see org . joml . Quaterniondc # invert ( org . joml . Quaterniond ) */ public Quaterniond invert ( Quaterniond dest ) { } }
double invNorm = 1.0 / ( x * x + y * y + z * z + w * w ) ; dest . x = - x * invNorm ; dest . y = - y * invNorm ; dest . z = - z * invNorm ; dest . w = w * invNorm ; return dest ;
public class SegmentAttributeBTreeIndex { /** * Executes the given Index Operation once , without performing retries . In case of failure with BadOffsetException * ( which indicates a conditional update failure ) , the BTreeIndex is reinitialized to the most up - to - date state . * @ param indexOperation A Functio...
return Futures . exceptionallyCompose ( indexOperation . apply ( timer . getRemaining ( ) ) , ex -> { if ( Exceptions . unwrap ( ex ) instanceof BadOffsetException ) { BadOffsetException boe = ( BadOffsetException ) Exceptions . unwrap ( ex ) ; if ( boe . getExpectedOffset ( ) != this . index . getIndexLength ( ) ) { l...
public class Shell { /** * < p > This code is adapted from java . lang . ProcessBuilder . start ( ) . < / p > * < p > The problem is that Android doesn ' t allow us to modify the map returned by ProcessBuilder . environment ( ) , even * though the JavaDoc indicates that it should . This is because it simply returns...
String [ ] env ; if ( environment != null && environment . size ( ) != 0 ) { Map < String , String > newEnvironment = new HashMap < > ( ) ; newEnvironment . putAll ( System . getenv ( ) ) ; newEnvironment . putAll ( environment ) ; int i = 0 ; env = new String [ newEnvironment . size ( ) ] ; for ( Map . Entry < String ...
public class SslContextFactory { /** * Create the SSLContext */ private void init ( ) throws Exception { } }
if ( sslContext == null ) { if ( keyStoreInputStream == null && sslConfig . getKeyStorePath ( ) == null && trustStoreInputStream == null && sslConfig . getTrustStorePath ( ) == null ) { TrustManager [ ] trust_managers = null ; if ( sslConfig . isTrustAll ( ) ) { logger . debug ( "No keystore or trust store configured. ...
public class VirtualMachineScaleSetExtensionsInner { /** * The operation to get the extension . * @ param resourceGroupName The name of the resource group . * @ param vmScaleSetName The name of the VM scale set containing the extension . * @ param vmssExtensionName The name of the VM scale set extension . * @ p...
return getWithServiceResponseAsync ( resourceGroupName , vmScaleSetName , vmssExtensionName , expand ) . map ( new Func1 < ServiceResponse < VirtualMachineScaleSetExtensionInner > , VirtualMachineScaleSetExtensionInner > ( ) { @ Override public VirtualMachineScaleSetExtensionInner call ( ServiceResponse < VirtualMachin...
public class BytecodeInterface8 { /** * get value from double [ ] using normalized index */ public static double dArrayGet ( double [ ] a , int i ) { } }
try { return a [ i ] ; } catch ( Throwable t ) { return a [ DefaultGroovyMethodsSupport . normaliseIndex ( i , a . length ) ] ; }
public class MessageProtocol { /** * Whether the protocol uses UTF - 8. * @ return true if the charset used by this protocol is UTF - 8 , false if it ' s some other encoding or if no charset is * defined . */ public boolean isUtf8 ( ) { } }
if ( charset . isPresent ( ) ) { return utf8Charset . equals ( Charset . forName ( charset . get ( ) ) ) ; } else { return false ; }
public class KafkaQueueFactory { /** * Setter for { @ link # defaultKafkaClient } . * @ param kafkaClient * @ param setMyOwnKafkaClient * @ return * @ since 0.7.1 */ protected KafkaQueueFactory < T , ID , DATA > setDefaultKafkaClient ( KafkaClient kafkaClient , boolean setMyOwnKafkaClient ) { } }
if ( this . defaultKafkaClient != null && myOwnKafkaClient ) { this . defaultKafkaClient . destroy ( ) ; } this . defaultKafkaClient = kafkaClient ; myOwnKafkaClient = setMyOwnKafkaClient ; return this ;
public class CommerceAccountModelImpl { /** * Converts the soap model instances into normal model instances . * @ param soapModels the soap model instances to convert * @ return the normal model instances */ public static List < CommerceAccount > toModels ( CommerceAccountSoap [ ] soapModels ) { } }
if ( soapModels == null ) { return null ; } List < CommerceAccount > models = new ArrayList < CommerceAccount > ( soapModels . length ) ; for ( CommerceAccountSoap soapModel : soapModels ) { models . add ( toModel ( soapModel ) ) ; } return models ;
public class LOG { /** * @ param e the e * @ param msg the msg * @ param args the args */ public static void d ( final Throwable e , final String msg , final Object ... args ) { } }
LOG . d ( msg + "\n " + LOG . toString ( e ) . replace ( "\n" , "\n " ) , args ) ;
public class ElementBuilder { /** * Adds an { @ code aria - } attribute to the element . * @ param name The name of the aria attribute w / o the { @ code aria - } prefix . However it won ' t be added if it ' s * already present . */ public B aria ( String name , String value ) { } }
String safeName = name . startsWith ( "aria-" ) ? name : "aria-" + name ; return attr ( safeName , value ) ;
public class Mapper { /** * Returns delegate map instance as a entry Gather * @ return */ public Gather < Entry < K , V > > entryGather ( ) { } }
return Gather . from ( delegate . get ( ) . entrySet ( ) ) ;