signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class ProposalLineItemPremium { /** * Gets the premiumRateValue value for this ProposalLineItemPremium . * @ return premiumRateValue * The { @ link PremiumRateValue } triggered by the { @ link ProposalLineItem } . * This attribute is * required . */ public com . google . api . ads . admanager . axis . v201805 . PremiumRateValue getPremiumRateValue ( ) { } }
return premiumRateValue ;
public class Container { /** * Computes the in - place bitwise AND of this container with another ( intersection ) . The current * container is generally modified , whereas the provided container ( x ) is unaffected . May generate * a new container . * @ param x other container * @ return aggregated container */ public Container iand ( Container x ) { } }
if ( x instanceof ArrayContainer ) { return iand ( ( ArrayContainer ) x ) ; } else if ( x instanceof BitmapContainer ) { return iand ( ( BitmapContainer ) x ) ; } return iand ( ( RunContainer ) x ) ;
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link SoapRequestHeader } { @ code > } } */ @ XmlElementDecl ( namespace = "https://www.google.com/apis/ads/publisher/v201902" , name = "RequestHeader" ) public JAXBElement < SoapRequestHeader > createRequestHeader ( SoapRequestHeader value ) { } }
return new JAXBElement < SoapRequestHeader > ( _RequestHeader_QNAME , SoapRequestHeader . class , null , value ) ;
public class Table { /** * Returns list of constraints dependent only on one column */ OrderedHashSet getDependentConstraints ( int colIndex ) { } }
OrderedHashSet set = new OrderedHashSet ( ) ; for ( int i = 0 , size = constraintList . length ; i < size ; i ++ ) { Constraint c = constraintList [ i ] ; if ( c . hasColumnOnly ( colIndex ) ) { set . add ( c ) ; } } return set ;
public class EntityBeanTypeImpl { /** * If not already created , a new < code > query < / code > element will be created and returned . * Otherwise , the first existing < code > query < / code > element will be returned . * @ return the instance defined for the element < code > query < / code > */ public QueryType < EntityBeanType < T > > getOrCreateQuery ( ) { } }
List < Node > nodeList = childNode . get ( "query" ) ; if ( nodeList != null && nodeList . size ( ) > 0 ) { return new QueryTypeImpl < EntityBeanType < T > > ( this , "query" , childNode , nodeList . get ( 0 ) ) ; } return createQuery ( ) ;
public class CmsDefaultXmlContentHandler { /** * Helper method to create a visibility configuration . < p > * @ param className the visibility handler class name * @ param params the parameters for the visibility * @ return the visibility configuration */ protected VisibilityConfiguration createVisibilityConfiguration ( String className , String params ) { } }
I_CmsXmlContentVisibilityHandler handler = this ; if ( className != null ) { try { handler = ( I_CmsXmlContentVisibilityHandler ) ( Class . forName ( className ) . newInstance ( ) ) ; } catch ( Exception e ) { LOG . error ( e . getLocalizedMessage ( ) , e ) ; } } VisibilityConfiguration result = new VisibilityConfiguration ( handler , params ) ; return result ;
public class UIPasswordField { /** * Sets the text . * @ param text the new text */ @ Override public void setText ( String text ) { } }
if ( password == null ) // called from parent ctor return ; if ( filterFunction != null ) text = filterFunction . apply ( text ) ; password . setLength ( 0 ) ; password . append ( text ) ; updateText ( ) ; selectingText = false ; if ( focused ) cursor . jumpToEnd ( ) ;
public class ServiceInstanceQuery { /** * Get a metadata value not in String list QueryCriterion . * Add a QueryCriterion to check ServiceInstance has metadata value * not in the target String list . * @ param key * the metadata key . * @ param list * the target String list that metadata value should not be in . * @ return * the ServiceInstanceQuery . */ public ServiceInstanceQuery getNotInQueryCriterion ( String key , List < String > list ) { } }
QueryCriterion c = new NotInQueryCriterion ( key , list ) ; addQueryCriterion ( c ) ; return this ;
public class SelectorHelper { /** * Return the selector value class . * @ param selector the selector . * @ return the selector class . * @ throws ExecutionException if an error happens . */ public static Class getClass ( Selector selector ) throws ExecutionException { } }
Class returnClass = null ; switch ( selector . getType ( ) ) { case STRING : case COLUMN : returnClass = String . class ; break ; case BOOLEAN : returnClass = Boolean . class ; break ; case INTEGER : returnClass = Long . class ; break ; case FLOATING_POINT : returnClass = Double . class ; break ; case GROUP : returnClass = getClass ( ( ( GroupSelector ) selector ) . getFirstValue ( ) ) ; break ; case LIST : if ( ( ( ListSelector ) selector ) . getSelectorsList ( ) . isEmpty ( ) ) { throw new ExecutionException ( "Selector " + selector . getType ( ) + " not supported get value operation." ) ; } returnClass = getClass ( ( ( ListSelector ) selector ) . getSelectorsList ( ) . get ( 0 ) ) ; break ; default : throw new ExecutionException ( "Selector " + selector . getType ( ) + " not supported get value operation." ) ; } return returnClass ;
public class NetworkService { /** * { @ inheritDoc } */ @ Override public boolean isConnected ( ) { } }
NetworkInfo networkInfo = isAvailable ( ) ; return ( networkInfo == null ) ? false : ( networkInfo . getState ( ) . equals ( State . CONNECTED ) ) ? true : false ;
public class ListServicesRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( ListServicesRequest listServicesRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( listServicesRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( listServicesRequest . getNextToken ( ) , NEXTTOKEN_BINDING ) ; protocolMarshaller . marshall ( listServicesRequest . getMaxResults ( ) , MAXRESULTS_BINDING ) ; protocolMarshaller . marshall ( listServicesRequest . getFilters ( ) , FILTERS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class cacheobject { /** * Use this API to flush cacheobject resources . */ public static base_responses flush ( nitro_service client , cacheobject resources [ ] ) throws Exception { } }
base_responses result = null ; if ( resources != null && resources . length > 0 ) { cacheobject flushresources [ ] = new cacheobject [ resources . length ] ; for ( int i = 0 ; i < resources . length ; i ++ ) { flushresources [ i ] = new cacheobject ( ) ; flushresources [ i ] . locator = resources [ i ] . locator ; flushresources [ i ] . url = resources [ i ] . url ; flushresources [ i ] . host = resources [ i ] . host ; flushresources [ i ] . port = resources [ i ] . port ; flushresources [ i ] . groupname = resources [ i ] . groupname ; flushresources [ i ] . httpmethod = resources [ i ] . httpmethod ; flushresources [ i ] . force = resources [ i ] . force ; } result = perform_operation_bulk_request ( client , flushresources , "flush" ) ; } return result ;
public class ModelExt { /** * Data Count */ public Long dataCount ( ) { } }
SqlPara sql = SqlpKit . select ( this , "count(*) AS cnt" ) ; Record record = Db . findFirst ( sql ) ; if ( null != record ) { return record . get ( "cnt" ) ; } return 0L ;
public class ShortCircuitBlockWriteHandler { /** * Handles complete block request . No exceptions should be thrown . */ public void handleBlockCompleteRequest ( boolean isCanceled ) { } }
final String methodName = isCanceled ? "AbortBlock" : "CommitBlock" ; RpcUtils . streamingRPCAndLog ( LOG , new RpcUtils . StreamingRpcCallable < CreateLocalBlockResponse > ( ) { @ Override public CreateLocalBlockResponse call ( ) throws Exception { if ( mRequest == null ) { return null ; } Context newContext = Context . current ( ) . fork ( ) ; Context previousContext = newContext . attach ( ) ; try { if ( isCanceled ) { mBlockWorker . abortBlock ( mSessionId , mRequest . getBlockId ( ) ) ; } else { mBlockWorker . commitBlock ( mSessionId , mRequest . getBlockId ( ) ) ; } } finally { newContext . detach ( previousContext ) ; } mSessionId = INVALID_SESSION_ID ; return null ; } @ Override public void exceptionCaught ( Throwable throwable ) { mResponseObserver . onError ( GrpcExceptionUtils . fromThrowable ( throwable ) ) ; mSessionId = INVALID_SESSION_ID ; } } , methodName , false , ! isCanceled , mResponseObserver , "Session=%d, Request=%s" , mSessionId , mRequest ) ;
public class MetadataStore { /** * Changes to cluster OR store definition metadata results in routing * strategies changing . These changes need to be propagated to all the * listeners . * @ param cluster The updated cluster metadata * @ param storeDefs The updated list of store definition */ private void updateRoutingStrategies ( Cluster cluster , List < StoreDefinition > storeDefs ) { } }
// acquire write lock writeLock . lock ( ) ; try { VectorClock clock = new VectorClock ( ) ; if ( metadataCache . containsKey ( ROUTING_STRATEGY_KEY ) ) clock = ( VectorClock ) metadataCache . get ( ROUTING_STRATEGY_KEY ) . getVersion ( ) ; logger . info ( "Updating routing strategy for all stores" ) ; HashMap < String , StoreDefinition > storeDefMap = makeStoreDefinitionMap ( storeDefs ) ; HashMap < String , RoutingStrategy > routingStrategyMap = createRoutingStrategyMap ( cluster , storeDefMap ) ; this . metadataCache . put ( ROUTING_STRATEGY_KEY , new Versioned < Object > ( routingStrategyMap , clock . incremented ( getNodeId ( ) , System . currentTimeMillis ( ) ) ) ) ; for ( String storeName : storeNameTolisteners . keySet ( ) ) { RoutingStrategy updatedRoutingStrategy = routingStrategyMap . get ( storeName ) ; if ( updatedRoutingStrategy != null ) { try { for ( MetadataStoreListener listener : storeNameTolisteners . get ( storeName ) ) { listener . updateRoutingStrategy ( updatedRoutingStrategy ) ; listener . updateStoreDefinition ( storeDefMap . get ( storeName ) ) ; } } catch ( Exception e ) { if ( logger . isEnabledFor ( Level . WARN ) ) logger . warn ( e , e ) ; } } } } finally { writeLock . unlock ( ) ; }
public class DateRuleItem { /** * Gets the relativeValue value for this DateRuleItem . * @ return relativeValue * The relative date value of the right hand side . The { @ code * value } field will * override this field when both are present . */ public com . google . api . ads . adwords . axis . v201809 . rm . RelativeDate getRelativeValue ( ) { } }
return relativeValue ;
public class CmsFlexBucketConfiguration { /** * Gets the bucket name for the given bit index . < p > * @ param bitIndex the bit index for the bucket in the bit set representation . < p > * @ return the name of the bucket */ public String getBucketName ( int bitIndex ) { } }
if ( bitIndex == 0 ) { return BUCKET_OTHER ; } else { String result = null ; if ( ( bitIndex - 1 ) < m_bucketNames . size ( ) ) { result = m_bucketNames . get ( bitIndex - 1 ) ; } if ( result == null ) { return "??? " + bitIndex ; } else { return result ; } }
public class BaseRxLoader { /** * Cancels the task . * @ return true if the task was started , false otherwise */ public boolean unsubscribe ( ) { } }
CachingWeakRefSubscriber < T > subscriber = manager . get ( tag ) ; if ( subscriber != null ) { subscriber . unsubscribe ( ) ; return true ; } return false ;
public class MethodSpec { /** * Returns a new method spec builder that overrides { @ code method } . * < p > This will copy its visibility modifiers , type parameters , return type , name , parameters , and * throws declarations . An { @ link Override } annotation will be added . * < p > Note that in JavaPoet 1.2 through 1.7 this method retained annotations from the method and * parameters of the overridden method . Since JavaPoet 1.8 annotations must be added separately . */ public static Builder overriding ( ExecutableElement method ) { } }
checkNotNull ( method , "method == null" ) ; Element enclosingClass = method . getEnclosingElement ( ) ; if ( enclosingClass . getModifiers ( ) . contains ( Modifier . FINAL ) ) { throw new IllegalArgumentException ( "Cannot override method on final class " + enclosingClass ) ; } Set < Modifier > modifiers = method . getModifiers ( ) ; if ( modifiers . contains ( Modifier . PRIVATE ) || modifiers . contains ( Modifier . FINAL ) || modifiers . contains ( Modifier . STATIC ) ) { throw new IllegalArgumentException ( "cannot override method with modifiers: " + modifiers ) ; } String methodName = method . getSimpleName ( ) . toString ( ) ; MethodSpec . Builder methodBuilder = MethodSpec . methodBuilder ( methodName ) ; methodBuilder . addAnnotation ( Override . class ) ; modifiers = new LinkedHashSet < > ( modifiers ) ; modifiers . remove ( Modifier . ABSTRACT ) ; modifiers . remove ( Modifier . DEFAULT ) ; methodBuilder . addModifiers ( modifiers ) ; for ( TypeParameterElement typeParameterElement : method . getTypeParameters ( ) ) { TypeVariable var = ( TypeVariable ) typeParameterElement . asType ( ) ; methodBuilder . addTypeVariable ( TypeVariableName . get ( var ) ) ; } methodBuilder . returns ( TypeName . get ( method . getReturnType ( ) ) ) ; methodBuilder . addParameters ( ParameterSpec . parametersOf ( method ) ) ; methodBuilder . varargs ( method . isVarArgs ( ) ) ; for ( TypeMirror thrownType : method . getThrownTypes ( ) ) { methodBuilder . addException ( TypeName . get ( thrownType ) ) ; } return methodBuilder ;
public class HexUtil { /** * Appends a byte array to a StringBuilder with each byte in a " Big Endian " * hexidecimal format . For example , a byte 0x34 will be appended as a * String in format " 34 " . A byte array of { 0x34 , 035 } would append " 3435 " . * @ param buffer The StringBuilder the byte array in hexidecimal format * will be appended to . If the buffer is null , this method will throw * a NullPointerException . * @ param bytes The byte array that will be converted to a hexidecimal String . * If the byte array is null , this method will append nothing ( a noop ) * @ param offset The offset in the byte array to start from . If the offset * or length combination is invalid , this method will throw an IllegalArgumentException . * @ param length The length ( from the offset ) to conver the bytes . If the offset * or length combination is invalid , this method will throw an IllegalArgumentException . */ static public void appendHexString ( StringBuilder buffer , byte [ ] bytes , int offset , int length ) { } }
assertNotNull ( buffer ) ; if ( bytes == null ) { return ; // do nothing ( a noop ) } assertOffsetLengthValid ( offset , length , bytes . length ) ; int end = offset + length ; for ( int i = offset ; i < end ; i ++ ) { int nibble1 = ( bytes [ i ] & 0xF0 ) >>> 4 ; int nibble0 = ( bytes [ i ] & 0x0F ) ; buffer . append ( HEX_TABLE [ nibble1 ] ) ; buffer . append ( HEX_TABLE [ nibble0 ] ) ; }
public class TimerGroup { /** * Log elapsed time of all named timers if the condition is true . */ private void log ( boolean finalLog , String format , Object ... args ) { } }
if ( m_condition ) { if ( format != null ) { m_logger . debug ( String . format ( format , args ) ) ; } ArrayList < String > timerNames = new ArrayList < String > ( m_timers . keySet ( ) ) ; Collections . sort ( timerNames ) ; for ( String name : timerNames ) { TimerGroupItem timer = m_timers . get ( name ) ; if ( finalLog || timer . changed ( ) ) { m_logger . debug ( timer . toString ( finalLog ) ) ; } } m_logger . debug ( m_total . toString ( finalLog ) ) ; ArrayList < String > counterNames = new ArrayList < String > ( m_counters . keySet ( ) ) ; Collections . sort ( counterNames ) ; for ( String name : counterNames ) { Counter counter = m_counters . get ( name ) ; if ( finalLog || counter . changed ( ) ) { String text = String . format ( "%s: (%s)" , name , counter . toString ( finalLog ) ) ; m_logger . debug ( text ) ; } } }
public class LabelProcessor { /** * Create a new labelBuilder and register label with the default locale . * @ param label the label to be added * @ return the updated label builder */ public static Label buildLabel ( final String label ) { } }
return addLabel ( Label . newBuilder ( ) , Locale . getDefault ( ) , label ) . build ( ) ;
public class CmsAreaSelectPanel { /** * Calculates the matching X ( left / width ) value in case of a fixed height / width ratio . < p > * @ param newX the cursor X offset to the selection area * @ param newY the cursor Y offset to the selection area * @ return the matching X value */ private int getXForY ( int newX , int newY ) { } }
int width = ( int ) Math . floor ( ( newY - m_firstY ) / m_heightToWidth ) ; int result = m_firstX + width ; if ( ( ( m_firstX - newX ) * ( m_firstX - result ) ) < 0 ) { result = m_firstX - width ; } return result ;
public class ImageRetinaApiImpl { /** * { @ inheritDoc } */ @ Override public ByteArrayInputStream getImage ( ImagePlotShape shape , Double sparsity , Model model ) throws JsonProcessingException , ApiException { } }
return getImage ( null , shape , null , sparsity , model ) ;
public class Serializer { /** * Reconstitute the given BagObject representation back to the object it represents , using a * " best - effort " approach to matching the fields of the BagObject to the class being initialized . * @ param bag The input data to reconstruct from , either a BagObject or BagArray * @ param type the Class representing the type to reconstruct * @ return the reconstituted object , or null if the reconstitution failed . */ public static < WorkingType > WorkingType fromBagAsType ( Bag bag , Class type ) { } }
return ( bag != null ) ? ( WorkingType ) deserialize ( type . getName ( ) , bag ) : null ;
public class LBiObjCharConsumerBuilder { /** * One of ways of creating builder . This is possibly the least verbose way where compiler should be able to guess the generic parameters . */ @ Nonnull public static < T1 , T2 > LBiObjCharConsumer < T1 , T2 > biObjCharConsumerFrom ( Consumer < LBiObjCharConsumerBuilder < T1 , T2 > > buildingFunction ) { } }
LBiObjCharConsumerBuilder builder = new LBiObjCharConsumerBuilder ( ) ; buildingFunction . accept ( builder ) ; return builder . build ( ) ;
public class LegacyCompositionHandler { /** * ( non - Javadoc ) * @ see javax . faces . view . facelets . FaceletHandler # apply ( javax . faces . view . facelets . FaceletContext , * javax . faces . component . UIComponent ) */ public void apply ( FaceletContext ctx , UIComponent parent ) throws IOException , FacesException , FaceletException , ELException { } }
if ( _template != null ) { VariableMapper orig = ctx . getVariableMapper ( ) ; AbstractFaceletContext actx = ( AbstractFaceletContext ) ctx ; actx . extendClient ( this ) ; if ( _params != null ) { VariableMapper vm = new VariableMapperWrapper ( orig ) ; ctx . setVariableMapper ( vm ) ; for ( int i = 0 ; i < _params . length ; i ++ ) { _params [ i ] . apply ( ctx , parent ) ; } } try { ctx . includeFacelet ( parent , _template . getValue ( ctx ) ) ; } finally { actx . popExtendedClient ( this ) ; ctx . setVariableMapper ( orig ) ; } } else { this . nextHandler . apply ( ctx , parent ) ; }
public class Nbvcxz { /** * Returns the best combination of matches based on multiple methods . We run the password through the * { @ code findGoodEnoughCombination } method test to see if is considered " random " . If it isn ' t , we * run it through the { @ code findBestCombination } method , which is much more expensive for large * passwords . * @ param configuration the configuration * @ param password the password * @ return the best list of matches , sorted by start index . */ private List < Match > getBestCombination ( final Configuration configuration , final String password ) { } }
this . best_matches . clear ( ) ; this . best_matches_length = 0 ; final List < Match > all_matches = getAllMatches ( configuration , password ) ; final Map < Integer , Match > brute_force_matches = new HashMap < > ( ) ; for ( int i = 0 ; i < password . length ( ) ; i ++ ) { brute_force_matches . put ( i , createBruteForceMatch ( password , configuration , i ) ) ; } final List < Match > good_enough_matches = findGoodEnoughCombination ( password , all_matches , brute_force_matches ) ; if ( all_matches == null || all_matches . size ( ) == 0 || isRandom ( password , good_enough_matches ) ) { List < Match > matches = new ArrayList < > ( ) ; backfillBruteForce ( password , brute_force_matches , matches ) ; Collections . sort ( matches , comparator ) ; return matches ; } Collections . sort ( all_matches , comparator ) ; try { return findBestCombination ( password , all_matches , brute_force_matches ) ; } catch ( TimeoutException e ) { return good_enough_matches ; }
public class AbstractJaxb { /** * add class attribute . If already set , do nothing . */ public < T extends AbstractJaxb > void addCssClass ( String clazz ) { } }
List < String > classList = this . getCssClass ( ) ; if ( ! this . hasCssClass ( clazz ) ) { classList . add ( clazz ) ; }
public class MisoScenePanel { /** * Provides an icon for this tooltip , the default looks up an object action handler for the * action and requests the icon from it . */ protected Icon getTipIcon ( SceneObject scobj , String action ) { } }
ObjectActionHandler oah = ObjectActionHandler . lookup ( action ) ; return ( oah == null ) ? null : oah . getTipIcon ( action ) ;
public class Type { /** * If class passed in represents a primitive type , its object peer is * returned . Otherwise , it is returned unchanged . */ private static Class < ? > convertToObject ( Class < ? > type ) { } }
if ( type == int . class ) { return Integer . class ; } else if ( type == boolean . class ) { return Boolean . class ; } else if ( type == byte . class ) { return Byte . class ; } else if ( type == char . class ) { return Character . class ; } else if ( type == short . class ) { return Short . class ; } else if ( type == long . class ) { return Long . class ; } else if ( type == float . class ) { return Float . class ; } else if ( type == double . class ) { return Double . class ; } else if ( type == void . class ) { return Void . class ; } else { return type ; }
public class Medias { /** * Get the media with an additional suffix , just before the dot of the extension if has . * @ param media The current media reference ( must not be < code > null < / code > ) . * @ param suffix The suffix to add ( must not be < code > null < / code > ) . * @ return The new media with suffix added . * @ throws LionEngineException If invalid parameters . */ public static synchronized Media getWithSuffix ( Media media , String suffix ) { } }
Check . notNull ( media ) ; Check . notNull ( suffix ) ; final String path = media . getPath ( ) ; final int dotIndex = path . lastIndexOf ( Constant . DOT ) ; if ( dotIndex > - 1 ) { return Medias . create ( path . substring ( 0 , dotIndex ) + Constant . UNDERSCORE + suffix + path . substring ( dotIndex ) ) ; } return Medias . create ( path + Constant . UNDERSCORE + suffix ) ;
public class ScanResult { /** * Get the list of all resources found in whitelisted packages that have a path matching the requested pattern . * @ param pattern * A pattern to match { @ link Resource } paths with . * @ return A list of all resources found in whitelisted packages that have a path matching the requested * pattern . */ public ResourceList getResourcesMatchingPattern ( final Pattern pattern ) { } }
if ( closed . get ( ) ) { throw new IllegalArgumentException ( "Cannot use a ScanResult after it has been closed" ) ; } final ResourceList allWhitelistedResources = getAllResources ( ) ; if ( allWhitelistedResources . isEmpty ( ) ) { return ResourceList . EMPTY_LIST ; } else { final ResourceList filteredResources = new ResourceList ( ) ; for ( final Resource classpathResource : allWhitelistedResources ) { final String relativePath = classpathResource . getPath ( ) ; if ( pattern . matcher ( relativePath ) . matches ( ) ) { filteredResources . add ( classpathResource ) ; } } return filteredResources ; }
public class RuleModel { /** * This will get a list of all bound variables ( LHS and RHS ) , including bound fields . . */ public List < String > getAllVariables ( ) { } }
List < String > result = new ArrayList < String > ( ) ; result . addAll ( this . getAllLHSVariables ( ) ) ; result . addAll ( this . getAllRHSVariables ( ) ) ; return result ;
public class Cookies { /** * Parses a " Set - Cookie : " response header value into its cookie representation . The header value is parsed according to the * syntax that ' s defined in RFC2109: * < pre > * < code > * set - cookie = " Set - Cookie : " cookies * cookies = 1 # cookie * cookie = NAME " = " VALUE * ( " ; " cookie - av ) * NAME = attr * VALUE = value * cookie - av = " Comment " " = " value * | " Domain " " = " value * | " Max - Age " " = " value * | " Path " " = " value * | " Secure " * | " Version " " = " 1 * DIGIT * < / code > * < / pre > * @ param headerValue The header value * @ return The cookie * @ see Cookie * @ see < a href = " http : / / tools . ietf . org / search / rfc2109 " > rfc2109 < / a > */ public static Cookie parseSetCookieHeader ( final String headerValue ) { } }
String key = null ; CookieImpl cookie = null ; int state = 0 ; int current = 0 ; for ( int i = 0 ; i < headerValue . length ( ) ; ++ i ) { char c = headerValue . charAt ( i ) ; switch ( state ) { case 0 : { // reading key if ( c == '=' ) { key = headerValue . substring ( current , i ) ; current = i + 1 ; state = 1 ; } else if ( ( c == ';' || c == ' ' ) && current == i ) { current ++ ; } else if ( c == ';' ) { if ( cookie == null ) { throw UndertowMessages . MESSAGES . couldNotParseCookie ( headerValue ) ; } else { handleValue ( cookie , headerValue . substring ( current , i ) , null ) ; } current = i + 1 ; } break ; } case 1 : { if ( c == ';' ) { if ( cookie == null ) { cookie = new CookieImpl ( key , headerValue . substring ( current , i ) ) ; } else { handleValue ( cookie , key , headerValue . substring ( current , i ) ) ; } state = 0 ; current = i + 1 ; key = null ; } else if ( c == '"' && current == i ) { current ++ ; state = 2 ; } break ; } case 2 : { if ( c == '"' ) { if ( cookie == null ) { cookie = new CookieImpl ( key , headerValue . substring ( current , i ) ) ; } else { handleValue ( cookie , key , headerValue . substring ( current , i ) ) ; } state = 0 ; current = i + 1 ; key = null ; } break ; } } } if ( key == null ) { if ( current != headerValue . length ( ) ) { handleValue ( cookie , headerValue . substring ( current , headerValue . length ( ) ) , null ) ; } } else { if ( current != headerValue . length ( ) ) { if ( cookie == null ) { cookie = new CookieImpl ( key , headerValue . substring ( current , headerValue . length ( ) ) ) ; } else { handleValue ( cookie , key , headerValue . substring ( current , headerValue . length ( ) ) ) ; } } else { handleValue ( cookie , key , null ) ; } } return cookie ;
public class BlueprintMarshaller { /** * Marshall the given parameter object . */ public void marshall ( Blueprint blueprint , ProtocolMarshaller protocolMarshaller ) { } }
if ( blueprint == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( blueprint . getBlueprintId ( ) , BLUEPRINTID_BINDING ) ; protocolMarshaller . marshall ( blueprint . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( blueprint . getGroup ( ) , GROUP_BINDING ) ; protocolMarshaller . marshall ( blueprint . getType ( ) , TYPE_BINDING ) ; protocolMarshaller . marshall ( blueprint . getDescription ( ) , DESCRIPTION_BINDING ) ; protocolMarshaller . marshall ( blueprint . getIsActive ( ) , ISACTIVE_BINDING ) ; protocolMarshaller . marshall ( blueprint . getMinPower ( ) , MINPOWER_BINDING ) ; protocolMarshaller . marshall ( blueprint . getVersion ( ) , VERSION_BINDING ) ; protocolMarshaller . marshall ( blueprint . getVersionCode ( ) , VERSIONCODE_BINDING ) ; protocolMarshaller . marshall ( blueprint . getProductUrl ( ) , PRODUCTURL_BINDING ) ; protocolMarshaller . marshall ( blueprint . getLicenseUrl ( ) , LICENSEURL_BINDING ) ; protocolMarshaller . marshall ( blueprint . getPlatform ( ) , PLATFORM_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class ErrorHelper { /** * This method will recycle the given converter . */ public static RESTHandlerJsonException createRESTHandlerJsonException ( Throwable e , JSONConverter converter , int status ) { } }
try { // See if we need to fetch a converter if ( converter == null ) { converter = JSONConverter . getConverter ( ) ; } // Create a new OutputStream to avoid any corrupted data ByteArrayOutputStream os = new ByteArrayOutputStream ( ) ; // Write the exception inside the output stream converter . writeThrowable ( os , e ) ; // Get the message from the output stream String exceptionMessage = os . toString ( "UTF-8" ) ; // return a Web exception with the new response return new RESTHandlerJsonException ( exceptionMessage , status , true ) ; } catch ( IOException innerException ) { // Since we got an exception while converting the error just write the actual exception text with an internal error code . This should never // happen because our JSONErrorOutputStream shouldn ' t ever throw an IOException return new RESTHandlerJsonException ( e . getMessage ( ) , status , true ) ; } finally { JSONConverter . returnConverter ( converter ) ; }
public class TemplateProcessorMojo { /** * Apply templates . */ private void generate ( TemplateFile input , List < OutputFile > outputs , TemplateOptions templateOptions ) throws IOException { } }
final String targetFileName = targetFileName ( templatesPath . relativize ( input . path ) . toString ( ) , templateOptions ) ; final OutputFile output = new OutputFile ( outputPath . resolve ( targetFileName ) . toAbsolutePath ( ) . normalize ( ) ) ; if ( incremental && Files . exists ( output . path ) && Files . getLastModifiedTime ( output . path ) . toMillis ( ) >= Files . getLastModifiedTime ( input . path ) . toMillis ( ) ) { // No need to re - render but mark as generated . output . upToDate = true ; outputs . add ( output ) ; return ; } String template = new String ( Files . readAllBytes ( input . path ) , StandardCharsets . UTF_8 ) ; timeVelocity . start ( ) ; template = filterVelocity ( input , template , templateOptions ) ; timeVelocity . stop ( ) ; // Check if template requested ignoring a given type combination . if ( templateOptions . isIgnored ( ) ) { return ; } getLog ( ) . debug ( "Processing: " + input . getFileName ( ) + " => " + output . path ) ; try { timeIntrinsics . start ( ) ; template = filterIntrinsics ( template , templateOptions ) ; timeIntrinsics . stop ( ) ; timeComments . start ( ) ; template = filterComments ( template ) ; timeComments . stop ( ) ; timeTypeClassRefs . start ( ) ; template = filterTypeClassRefs ( template , templateOptions ) ; template = filterStaticTokens ( template , templateOptions ) ; timeTypeClassRefs . stop ( ) ; } catch ( RuntimeException e ) { getLog ( ) . error ( "Error processing: " + input . getFileName ( ) + " => " + output . path + ":\n\t" + e . getMessage ( ) ) ; throw e ; } Files . createDirectories ( output . path . getParent ( ) ) ; Files . write ( output . path , template . getBytes ( StandardCharsets . UTF_8 ) ) ; outputs . add ( output ) ;
public class EntityHandle { /** * Return < code > EJBObject < / code > reference for this handle . < p > */ public EJBObject getEJBObject ( ) throws RemoteException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "getEJBObject" ) ; if ( object == null ) { try { Class homeClass = null ; try { // If we are running on the server side , then the thread // context loader would have been set appropriately by // the container . If running on a client , then check the // thread context class loader first ClassLoader cl = Thread . currentThread ( ) . getContextClassLoader ( ) ; if ( cl != null ) { homeClass = cl . loadClass ( homeInterface ) ; } else { throw new ClassNotFoundException ( ) ; } } catch ( ClassNotFoundException ex ) { // FFDCFilter . processException ( ex , CLASS _ NAME + " . getEJBObject " , // "147 " , this ) ; try { homeClass = Class . forName ( homeInterface ) ; } catch ( ClassNotFoundException e ) { // FFDCFilter . processException ( e , CLASS _ NAME + " . getEJBObject " , // "155 " , this ) ; throw new ClassNotFoundException ( homeInterface ) ; } } InitialContext ctx = null ; EJBHome home = null ; try { // Locate the home // 91851 begin if ( this . initialContextProperties == null ) { ctx = new InitialContext ( ) ; } else { try { ctx = new InitialContext ( this . initialContextProperties ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) // d144064 Tr . debug ( tc , "Created an initial context with the " + "initialContextProperties, providerURL = " + ( String ) initialContextProperties . get ( "java.naming.provider.url" ) + " INITIAL_CONTEXT_FACTORY = " + ( String ) initialContextProperties . get ( Context . INITIAL_CONTEXT_FACTORY ) ) ; } catch ( NamingException ne ) { // FFDCFilter . processException ( ne , CLASS _ NAME + " . getEJBObject " , // "186 " , this ) ; ctx = new InitialContext ( ) ; } } // 91851 end home = ( EJBHome ) PortableRemoteObject . narrow ( ctx . lookup ( homeJNDIName ) , homeClass ) ; } catch ( NoInitialContextException e ) { // FFDCFilter . processException ( e , CLASS _ NAME + " . getEJBObject " , " 197 " , this ) ; java . util . Properties p = new java . util . Properties ( ) ; p . put ( Context . INITIAL_CONTEXT_FACTORY , "com.ibm.websphere.naming.WsnInitialContextFactory" ) ; ctx = new InitialContext ( p ) ; home = ( EJBHome ) PortableRemoteObject . narrow ( ctx . lookup ( homeJNDIName ) , homeClass ) ; } // Introspect to find and invoke the findByPrimaryKey method Method fbpk = findFindByPrimaryKey ( homeClass ) ; object = ( EJBObject ) fbpk . invoke ( home , new Object [ ] { key } ) ; } catch ( InvocationTargetException e ) { // Unwrap the real exception and pass it back // FFDCFilter . processException ( e , CLASS _ NAME + " . getEJBObject " , " 216 " , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "getEJBObject" , e ) ; Throwable t = e . getTargetException ( ) ; if ( t instanceof RemoteException ) { throw ( RemoteException ) t ; } else { throw new RemoteException ( "Could not find bean" , t ) ; } } catch ( NamingException e ) { // Problem looking up the home // FFDCFilter . processException ( e , CLASS _ NAME + " . getEJBObject " , " 236 " , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "getEJBObject" , e ) ; RemoteException re = new NoSuchObjectException ( "Could not find home in JNDI" ) ; re . detail = e ; throw re ; } catch ( ClassNotFoundException e ) { // We couldn ' t find the home interface ' s class // FFDCFilter . processException ( e , CLASS _ NAME + " . getEJBObject " , " 252 " , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "getEJBObject" , e ) ; throw new RemoteException ( "Could not load home interface" , e ) ; } catch ( IllegalAccessException e ) { // This shouldn ' t happen // FFDCFilter . processException ( e , CLASS _ NAME + " . getEJBObject " , " 262 " , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "getEJBObject" , e ) ; throw new RemoteException ( "Bad home interface definition" , e ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "getEJBObject" ) ; return object ;
public class QueryEngine { /** * Make a new FilterParsingResult after normalizing the query . This FilterParsingResult is not supposed to have * grouping / aggregation . */ private IckleParsingResult < TypeMetadata > makeFilterParsingResult ( IckleParsingResult < TypeMetadata > parsingResult , BooleanExpr normalizedWhereClause , PropertyPath [ ] projection , Class < ? > [ ] projectedTypes , Object [ ] projectedNullMarkers , SortField [ ] sortFields ) { } }
String queryString = SyntaxTreePrinter . printTree ( parsingResult . getTargetEntityName ( ) , projection , normalizedWhereClause , sortFields ) ; return new IckleParsingResult < > ( queryString , parsingResult . getParameterNames ( ) , normalizedWhereClause , null , parsingResult . getTargetEntityName ( ) , parsingResult . getTargetEntityMetadata ( ) , projection , projectedTypes , projectedNullMarkers , null , sortFields ) ;
public class system_settings { /** * < pre > * Use this operation to modify SDX system settings . * < / pre > */ public static system_settings update ( nitro_service client , system_settings resource ) throws Exception { } }
resource . validate ( "modify" ) ; return ( ( system_settings [ ] ) resource . update_resource ( client ) ) [ 0 ] ;
public class Drawer { /** * Draw the divider on the top side of the Item . */ public void drawBottom ( View view , Canvas c ) { } }
int left = view . getLeft ( ) - mWidth ; int top = view . getBottom ( ) ; int right = view . getRight ( ) + mWidth ; int bottom = top + mHeight ; mDivider . setBounds ( left , top , right , bottom ) ; mDivider . draw ( c ) ;
public class UserMessages { /** * Save validation success attribute , derived in validation process , e . g . selected data , < br > * to avoid duplicate database access between validation and main logic . * < pre > * String < span style = " color : # 553000 " > keyOfProduct < / span > = Product . < span style = " color : # 70226C " > class < / span > . getName ( ) ; * ValidationSuccess < span style = " color : # 553000 " > success < / span > = validate ( < span style = " color : # 553000 " > form < / span > , < span style = " color : # 553000 " > messages < / span > < span style = " font - size : 120 % " > - < / span > & gt ; < / span > { * selectProduct ( ) . ifPresent ( < span style = " color : # 553000 " > product < / span > < span style = " font - size : 120 % " > - < / span > & gt ; < / span > { } , ( ) < span style = " font - size : 120 % " > - < / span > & gt ; < / span > { * < span style = " color : # 553000 " > messages < / span > . < span style = " color : # CC4747 " > saveSuccessData < / span > ( < span style = " color : # 553000 " > keyOfProduct < / span > , < span style = " color : # 553000 " > product < / span > ) ; * } ) . orElse ( ( ) < span style = " font - size : 120 % " > - < / span > & gt ; < / span > { } , ( ) < span style = " font - size : 120 % " > - < / span > & gt ; < / span > { * < span style = " color : # 553000 " > messages < / span > . addConstraint . . . ( ) ; * } , ( ) < span style = " font - size : 120 % " > - < / span > & gt ; < / span > { * < span style = " color : # 70226C " > return < / span > asHtml ( path _ Product _ ProductListJsp ) ; * < span style = " color : # 553000 " > success < / span > . < span style = " color : # 994747 " > getAttribute < / span > ( keyOfProduct ) . alwaysPresent ( product < span style = " font - size : 120 % " > - < / span > & gt ; < / span > { * < / pre > * @ param key The string key of the success attribute . ( NotNull ) * @ param value The value of success attribute . ( NotNull ) */ public void saveSuccessAttribute ( String key , Object value ) { } }
assertArgumentNotNull ( "key" , key ) ; assertArgumentNotNull ( "value" , value ) ; assertLocked ( ) ; if ( successAttributeMap == null ) { successAttributeMap = new LinkedHashMap < String , Object > ( 4 ) ; } successAttributeMap . put ( key , value ) ;
public class HistoricTaskInstanceManager { /** * Deletes all data related with tasks , which belongs to specified process instance ids . * @ param processInstanceIds * @ param deleteVariableInstances when true , will also delete variable instances . Can be false when variable instances were deleted separately . */ public void deleteHistoricTaskInstancesByProcessInstanceIds ( List < String > processInstanceIds , boolean deleteVariableInstances ) { } }
CommandContext commandContext = Context . getCommandContext ( ) ; if ( deleteVariableInstances ) { getHistoricVariableInstanceManager ( ) . deleteHistoricVariableInstancesByTaskProcessInstanceIds ( processInstanceIds ) ; } getHistoricDetailManager ( ) . deleteHistoricDetailsByTaskProcessInstanceIds ( processInstanceIds ) ; commandContext . getCommentManager ( ) . deleteCommentsByTaskProcessInstanceIds ( processInstanceIds ) ; getAttachmentManager ( ) . deleteAttachmentsByTaskProcessInstanceIds ( processInstanceIds ) ; getHistoricIdentityLinkManager ( ) . deleteHistoricIdentityLinksLogByTaskProcessInstanceIds ( processInstanceIds ) ; getDbEntityManager ( ) . deletePreserveOrder ( HistoricTaskInstanceEntity . class , "deleteHistoricTaskInstanceByProcessInstanceIds" , processInstanceIds ) ;
public class StreamingEndpoint { /** * Create an operation object that will get the state of the given asset . * @ param assetId * id of asset to retrieve * @ return the get operation */ public static EntityGetOperation < StreamingEndpointInfo > get ( String streamingEndpointId ) { } }
return new DefaultGetOperation < StreamingEndpointInfo > ( ENTITY_SET , streamingEndpointId , StreamingEndpointInfo . class ) ;
public class MailClientHandler { /** * DO NOT synchronize ! */ public void enqueue ( CommandCompletion completion ) { } }
completions . add ( completion ) ; commandTrace . add ( new Date ( ) . toString ( ) + " " + completion . toString ( ) ) ;
public class ResourceResolutionContext { /** * Convenience wrapper for message parameters * @ param params * @ return */ public static Map < String , Object > with ( Object ... params ) { } }
Map < String , Object > map = new HashMap < > ( ) ; for ( int i = 0 ; i < params . length ; i ++ ) { map . put ( String . valueOf ( i ) , params [ i ] ) ; } return map ;
public class VectorRequestMessage { /** * This message is possible to get only as Shard */ @ Override public void processMessage ( ) { } }
VectorAggregation aggregation = new VectorAggregation ( rowIndex , ( short ) voidConfiguration . getNumberOfShards ( ) , getShardIndex ( ) , storage . getArray ( key ) . getRow ( rowIndex ) . dup ( ) ) ; aggregation . setOriginatorId ( this . getOriginatorId ( ) ) ; clipboard . pin ( aggregation ) ; DistributedVectorMessage dvm = new DistributedVectorMessage ( key , rowIndex ) ; dvm . setOriginatorId ( this . originatorId ) ; if ( voidConfiguration . getNumberOfShards ( ) > 1 ) transport . sendMessageToAllShards ( dvm ) ; else { aggregation . extractContext ( this ) ; aggregation . processMessage ( ) ; }
public class Languages { /** * Returns true if the language component is supported by this application . * For example , this application may have Portuguese ( pt ) as a registered * language but not Brazilian Portuguese ( pt - BR ) . In this case , pt - BR would * be supported because of the pt registration . * @ param language * @ return true if the language is supported */ public boolean isSupportedLanguage ( String language ) { } }
String lang = getLanguageComponent ( language ) ; return languageLookup . containsKey ( lang ) ;
public class GPIOEndpoint { /** * Create producer map to an Output PIN */ @ Override public Producer createProducer ( ) throws Exception { } }
LOG . debug ( this . toString ( ) ) ; if ( direction == null || ( direction . compareTo ( "" ) == 0 ) ) { direction = "DIR_OUTPUT_ONLY" ; } if ( mode == null || ( mode . compareTo ( "" ) == 0 ) ) { mode = "MODE_OUTPUT_PUSH_PULL" ; } if ( trigger == null || ( trigger . compareTo ( "" ) == 0 ) ) { trigger = "TRIGGER_NONE" ; } int internalDirection = internalValueWithOR ( direction ) ; int internalMode = internalValueWithOR ( mode ) ; int internalTrigger = internalValueWithOR ( trigger ) ; GPIOPinConfig pinConfig = new GPIOPinConfig ( DeviceConfig . DEFAULT , Integer . parseInt ( this . gpioId ) , internalDirection , internalMode , internalTrigger , state ) ; GPIOPin pin = DeviceManager . open ( GPIOPin . class , pinConfig ) ; return new GPIOProducer ( this , pin ) ;
public class ReloadHandler { /** * / * ( non - Javadoc ) * @ see org . jboss . as . cli . handlers . CommandHandlerWithHelp # doHandle ( org . jboss . as . cli . CommandContext ) */ @ Override protected void doHandle ( CommandContext ctx ) throws CommandLineException { } }
final ModelControllerClient client = ctx . getModelControllerClient ( ) ; if ( client == null ) { throw new CommandLineException ( "Connection is not available." ) ; } if ( embeddedServerRef != null && embeddedServerRef . get ( ) != null ) { doHandleEmbedded ( ctx , client ) ; return ; } if ( ! ( client instanceof AwaiterModelControllerClient ) ) { throw new CommandLineException ( "Unsupported ModelControllerClient implementation " + client . getClass ( ) . getName ( ) ) ; } final AwaiterModelControllerClient cliClient = ( AwaiterModelControllerClient ) client ; final ModelNode op = this . buildRequestWithoutHeaders ( ctx ) ; try { final ModelNode response = cliClient . execute ( op , true ) ; if ( ! Util . isSuccess ( response ) ) { throw new CommandLineException ( Util . getFailureDescription ( response ) ) ; } } catch ( IOException e ) { // if it ' s not connected it ' s assumed the reload is in process if ( cliClient . isConnected ( ) ) { StreamUtils . safeClose ( client ) ; throw new CommandLineException ( "Failed to execute :reload" , e ) ; } } ensureServerRebootComplete ( ctx , client ) ;
public class ComponentBindingsProviderFactoryImpl { /** * ( non - Javadoc ) * @ see * com . sixdimensions . wcm . cq . component . bindings . ComponentBindingsProviderFactory * # getComponentBindingsProviders ( java . lang . String ) */ @ Override public List < ComponentBindingsProvider > getComponentBindingsProviders ( String resourceType ) { } }
List < ComponentBindingsProvider > cis = new ArrayList < ComponentBindingsProvider > ( ) ; for ( ServiceReference reference : getReferences ( resourceType ) ) { ComponentBindingsProvider ci = ComponentBindingsProvider . class . cast ( bundleContext . getService ( reference ) ) ; cis . add ( ci ) ; } if ( cis . size ( ) != 0 && log . isDebugEnabled ( ) ) { log . debug ( "Found {} Component Bindings Providers Services for resource type {}" , cis . size ( ) , resourceType ) ; } return cis ;
public class RouteFilterRulesInner { /** * Updates a route in the specified route filter . * @ param resourceGroupName The name of the resource group . * @ param routeFilterName The name of the route filter . * @ param ruleName The name of the route filter rule . * @ param routeFilterRuleParameters Parameters supplied to the update route filter rule operation . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the RouteFilterRuleInner object */ public Observable < RouteFilterRuleInner > beginUpdateAsync ( String resourceGroupName , String routeFilterName , String ruleName , PatchRouteFilterRule routeFilterRuleParameters ) { } }
return beginUpdateWithServiceResponseAsync ( resourceGroupName , routeFilterName , ruleName , routeFilterRuleParameters ) . map ( new Func1 < ServiceResponse < RouteFilterRuleInner > , RouteFilterRuleInner > ( ) { @ Override public RouteFilterRuleInner call ( ServiceResponse < RouteFilterRuleInner > response ) { return response . body ( ) ; } } ) ;
public class CmsPathMap { /** * Adds an element for the given path , overwriting the previous element for that path if there is one . < p > * @ param path the path * @ param value the element to add */ public void add ( String path , V value ) { } }
m_tree . setValue ( splitPath ( path ) , value ) ;
public class JDBCDatabaseMetaData { /** * # ifdef JAVA4 */ public int getDatabaseMajorVersion ( ) throws SQLException { } }
ResultSet rs = execute ( "call \"org.hsqldb_voltpatches.Library.getDatabaseMajorVersion\"()" ) ; rs . next ( ) ; int result = rs . getInt ( 1 ) ; rs . close ( ) ; return result ;
public class AppServicePlansInner { /** * Reboot a worker machine in an App Service plan . * Reboot a worker machine in an App Service plan . * @ param resourceGroupName Name of the resource group to which the resource belongs . * @ param name Name of the App Service plan . * @ param workerName Name of worker machine , which typically starts with RD . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ throws CloudException thrown if the request is rejected by server * @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent */ public void rebootWorker ( String resourceGroupName , String name , String workerName ) { } }
rebootWorkerWithServiceResponseAsync ( resourceGroupName , name , workerName ) . toBlocking ( ) . single ( ) . body ( ) ;
public class InIsaFragment { /** * A type - safe way to do ` a . choose ( pred , whenTrue , whenFalse ) ` , as ` choose ( a , pred , whenTrue , whenFalse ) ` . * This is because the default signature is too restrictive */ private < S , E1 , E2 > GraphTraversal < S , E2 > choose ( GraphTraversal < S , E1 > traversal , GraphTraversal < E1 , ? > traversalPredicate , GraphTraversal < E1 , ? extends E2 > trueChoice , GraphTraversal < E1 , ? extends E2 > falseChoice ) { } }
// This is safe . The generics for ` GraphTraversal # choose ` are more restrictive than necessary // noinspection unchecked return traversal . choose ( traversalPredicate , ( GraphTraversal < S , E2 > ) trueChoice , ( GraphTraversal < S , E2 > ) falseChoice ) ;
public class CommerceTaxFixedRateAddressRelPersistenceImpl { /** * Returns the first commerce tax fixed rate address rel in the ordered set where commerceTaxMethodId = & # 63 ; . * @ param commerceTaxMethodId the commerce tax method ID * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) * @ return the first matching commerce tax fixed rate address rel * @ throws NoSuchTaxFixedRateAddressRelException if a matching commerce tax fixed rate address rel could not be found */ @ Override public CommerceTaxFixedRateAddressRel findByCommerceTaxMethodId_First ( long commerceTaxMethodId , OrderByComparator < CommerceTaxFixedRateAddressRel > orderByComparator ) throws NoSuchTaxFixedRateAddressRelException { } }
CommerceTaxFixedRateAddressRel commerceTaxFixedRateAddressRel = fetchByCommerceTaxMethodId_First ( commerceTaxMethodId , orderByComparator ) ; if ( commerceTaxFixedRateAddressRel != null ) { return commerceTaxFixedRateAddressRel ; } StringBundler msg = new StringBundler ( 4 ) ; msg . append ( _NO_SUCH_ENTITY_WITH_KEY ) ; msg . append ( "commerceTaxMethodId=" ) ; msg . append ( commerceTaxMethodId ) ; msg . append ( "}" ) ; throw new NoSuchTaxFixedRateAddressRelException ( msg . toString ( ) ) ;
public class FixIntegerQuantityPrecisionsBot { /** * Fetches the current online data for the given item , and fixes the * precision of integer quantities if necessary . * @ param itemIdValue * the id of the document to inspect * @ param propertyId * id of the property to consider */ protected void fixIntegerPrecisions ( ItemIdValue itemIdValue , String propertyId ) { } }
String qid = itemIdValue . getId ( ) ; try { // Fetch the online version of the item to make sure we edit the // current version : ItemDocument currentItemDocument = ( ItemDocument ) dataFetcher . getEntityDocument ( qid ) ; if ( currentItemDocument == null ) { System . out . println ( "*** " + qid + " could not be fetched. Maybe it has been deleted." ) ; return ; } // Get the current statements for the property we want to fix : StatementGroup editPropertyStatements = currentItemDocument . findStatementGroup ( propertyId ) ; if ( editPropertyStatements == null ) { System . out . println ( "*** " + qid + " no longer has any statements for " + propertyId ) ; return ; } PropertyIdValue property = Datamodel . makeWikidataPropertyIdValue ( propertyId ) ; List < Statement > updateStatements = new ArrayList < > ( ) ; for ( Statement s : editPropertyStatements ) { QuantityValue qv = ( QuantityValue ) s . getValue ( ) ; if ( qv != null && isPlusMinusOneValue ( qv ) ) { QuantityValue exactValue = Datamodel . makeQuantityValue ( qv . getNumericValue ( ) , qv . getNumericValue ( ) , qv . getNumericValue ( ) ) ; Statement exactStatement = StatementBuilder . forSubjectAndProperty ( itemIdValue , property ) . withValue ( exactValue ) . withId ( s . getStatementId ( ) ) . withQualifiers ( s . getQualifiers ( ) ) . withReferences ( s . getReferences ( ) ) . withRank ( s . getRank ( ) ) . build ( ) ; updateStatements . add ( exactStatement ) ; } } if ( updateStatements . size ( ) == 0 ) { System . out . println ( "*** " + qid + " quantity values for " + propertyId + " already fixed" ) ; return ; } logEntityModification ( currentItemDocument . getEntityId ( ) , updateStatements , propertyId ) ; dataEditor . updateStatements ( currentItemDocument , updateStatements , Collections . < Statement > emptyList ( ) , "Set exact values for [[Property:" + propertyId + "|" + propertyId + "]] integer quantities (Task MB2)" ) ; } catch ( MediaWikiApiErrorException e ) { e . printStackTrace ( ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; }
public class WTreeRenderer { /** * Paints the given WTree . * @ param component the WTree to paint . * @ param renderContext the RenderContext to paint to . */ @ Override public void doRender ( final WComponent component , final WebXmlRenderContext renderContext ) { } }
WTree tree = ( WTree ) component ; XmlStringBuilder xml = renderContext . getWriter ( ) ; // Check if rendering an open item request String openId = tree . getOpenRequestItemId ( ) ; if ( openId != null ) { handleOpenItemRequest ( tree , xml , openId ) ; return ; } // Check the tree has tree items ( WCAG requirement ) TreeItemModel model = tree . getTreeModel ( ) ; if ( model == null || model . getRowCount ( ) <= 0 ) { LOG . warn ( "Tree not rendered as it has no items." ) ; return ; } xml . appendTagOpen ( "ui:tree" ) ; xml . appendAttribute ( "id" , component . getId ( ) ) ; xml . appendOptionalAttribute ( "class" , component . getHtmlClass ( ) ) ; xml . appendOptionalAttribute ( "track" , component . isTracking ( ) , "true" ) ; xml . appendOptionalAttribute ( "htree" , WTree . Type . HORIZONTAL == tree . getType ( ) , "true" ) ; xml . appendOptionalAttribute ( "multiple" , WTree . SelectMode . MULTIPLE == tree . getSelectMode ( ) , "true" ) ; xml . appendOptionalAttribute ( "disabled" , tree . isDisabled ( ) , "true" ) ; xml . appendOptionalAttribute ( "hidden" , tree . isHidden ( ) , "true" ) ; xml . appendOptionalAttribute ( "required" , tree . isMandatory ( ) , "true" ) ; switch ( tree . getExpandMode ( ) ) { case CLIENT : xml . appendAttribute ( "mode" , "client" ) ; break ; case DYNAMIC : xml . appendAttribute ( "mode" , "dynamic" ) ; break ; case LAZY : xml . appendAttribute ( "mode" , "lazy" ) ; break ; default : throw new IllegalStateException ( "Invalid expand mode: " + tree . getType ( ) ) ; } xml . appendClose ( ) ; // Render margin MarginRendererUtil . renderMargin ( tree , renderContext ) ; if ( tree . getCustomTree ( ) == null ) { handlePaintItems ( tree , xml ) ; } else { handlePaintCustom ( tree , xml ) ; } DiagnosticRenderUtil . renderDiagnostics ( tree , renderContext ) ; xml . appendEndTag ( "ui:tree" ) ;
public class MessageProcessor { /** * Returns the LinkManager . * @ return LinkManager */ public LinkManager getLinkManager ( ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , "getLinkManager" ) ; SibTr . exit ( tc , "getLinkManager" ) ; } return _linkManager ;
public class CreatePrivateVirtualInterfaceRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( CreatePrivateVirtualInterfaceRequest createPrivateVirtualInterfaceRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( createPrivateVirtualInterfaceRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( createPrivateVirtualInterfaceRequest . getConnectionId ( ) , CONNECTIONID_BINDING ) ; protocolMarshaller . marshall ( createPrivateVirtualInterfaceRequest . getNewPrivateVirtualInterface ( ) , NEWPRIVATEVIRTUALINTERFACE_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class AppClassLoader { /** * Spring method to register the given ClassFileTransformer on this ClassLoader */ @ Override public boolean addTransformer ( final ClassFileTransformer cft ) { } }
transformers . add ( cft ) ; // Also recursively register with parent ( s ) , until a non - AppClassLoader or GlobalSharedLibrary loader is encountered . if ( parent instanceof AppClassLoader ) { if ( Util . isGlobalSharedLibraryLoader ( ( ( AppClassLoader ) parent ) ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "addTransformer - skipping parent loader because it is a GlobalSharedLibrary" ) ; } } else { return ( ( AppClassLoader ) parent ) . addTransformer ( cft ) ; } } return true ;
public class JCurand { /** * < pre > * Generate log - normally distributed doubles . * Use generator to generate num double results into the device memory at * outputPtr . The device memory must have been previously allocated and be * large enough to hold all the results . Launches are done with the stream * set using : : curandSetStream ( ) , or the null stream if no stream has been set . * Results are 64 - bit floating point values with log - normal distribution based on * an associated normal distribution with mean mean and standard deviation stddev . * Normally distributed results are generated from pseudorandom generators * with a Box - Muller transform , and so require num to be even . * Quasirandom generators use an inverse cumulative distribution * function to preserve dimensionality . * The normally distributed results are transformed into log - normal distribution . * There may be slight numerical differences between results generated * on the GPU with generators created with : : curandCreateGenerator ( ) * and results calculated on the CPU with generators created with * : : curandCreateGeneratorHost ( ) . These differences arise because of * differences in results for transcendental functions . In addition , * future versions of CURAND may use newer versions of the CUDA math * library , so different versions of CURAND may give slightly different * numerical values . * @ param generator - Generator to use * @ param outputPtr - Pointer to device memory to store CUDA - generated results , or * Pointer to host memory to store CPU - generated results * @ param n - Number of doubles to generate * @ param mean - Mean of normal distribution * @ param stddev - Standard deviation of normal distribution * @ return * CURAND _ STATUS _ NOT _ INITIALIZED if the generator was never created * CURAND _ STATUS _ PREEXISTING _ FAILURE if there was an existing error from * a previous kernel launch * CURAND _ STATUS _ LAUNCH _ FAILURE if the kernel launch failed for any reason * CURAND _ STATUS _ LENGTH _ NOT _ MULTIPLE if the number of output samples is * not a multiple of the quasirandom dimension , or is not a multiple * of two for pseudorandom generators * CURAND _ STATUS _ DOUBLE _ PRECISION _ REQUIRED if the GPU does not support double precision * CURAND _ STATUS _ SUCCESS if the results were generated successfully * < / pre > */ public static int curandGenerateLogNormalDouble ( curandGenerator generator , Pointer outputPtr , long n , double mean , double stddev ) { } }
return checkResult ( curandGenerateLogNormalDoubleNative ( generator , outputPtr , n , mean , stddev ) ) ;
public class AmazonAppStreamClient { /** * Deletes the specified image . You cannot delete an image when it is in use . After you delete an image , you cannot * provision new capacity using the image . * @ param deleteImageRequest * @ return Result of the DeleteImage operation returned by the service . * @ throws ResourceInUseException * The specified resource is in use . * @ throws ResourceNotFoundException * The specified resource was not found . * @ throws OperationNotPermittedException * The attempted operation is not permitted . * @ throws ConcurrentModificationException * An API error occurred . Wait a few minutes and try again . * @ sample AmazonAppStream . DeleteImage * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / appstream - 2016-12-01 / DeleteImage " target = " _ top " > AWS API * Documentation < / a > */ @ Override public DeleteImageResult deleteImage ( DeleteImageRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeDeleteImage ( request ) ;
public class MaxFreeThreads { /** * { @ inheritDoc } */ @ Override public synchronized Address selectDistributedWorkManager ( Address own , DistributableWork work ) { } }
/* TODO String value = getWorkManager ( work ) ; if ( value ! = null ) if ( trace ) log . tracef ( " WorkManager : % s " , value ) ; return value ; */ Map < Address , Long > selectionMap = getSelectionMap ( own . getWorkManagerId ( ) , work ) ; Address result = null ; long freeThread = 0L ; if ( selectionMap != null ) { for ( Map . Entry < Address , Long > entry : selectionMap . entrySet ( ) ) { Address id = entry . getKey ( ) ; if ( ! own . equals ( id ) ) { Long free = entry . getValue ( ) ; if ( free != null && free . longValue ( ) > 0 && free . longValue ( ) > freeThread ) { result = id ; freeThread = free . longValue ( ) ; } } } } if ( trace ) log . tracef ( "WorkManager: %s (%s)" , result , freeThread ) ; return result ;
public class JcString { /** * < div color = ' red ' style = " font - size : 24px ; color : red " > < b > < i > < u > JCYPHER < / u > < / i > < / b > < / div > * < div color = ' red ' style = " font - size : 18px ; color : red " > < i > return the original string in lowercase < / i > < / div > * < br / > */ public JcString lower ( ) { } }
JcString ret = new JcString ( null , this , new FunctionInstance ( FUNCTION . String . LOWER , 1 ) ) ; QueryRecorder . recordInvocationConditional ( this , "lower" , ret ) ; return ret ;
public class Objects { /** * Creates an instance of { @ link ToStringHelper } . * < p > This is helpful for implementing { @ link Object # toString ( ) } . * Specification by example : < pre > { @ code * / / Returns " ClassName { } " * Objects . toStringHelper ( this ) * . toString ( ) ; * / / Returns " ClassName { x = 1 } " * Objects . toStringHelper ( this ) * . add ( " x " , 1) * . toString ( ) ; * / / Returns " MyObject { x = 1 } " * Objects . toStringHelper ( " MyObject " ) * . add ( " x " , 1) * . toString ( ) ; * / / Returns " ClassName { x = 1 , y = foo } " * Objects . toStringHelper ( this ) * . add ( " x " , 1) * . add ( " y " , " foo " ) * . toString ( ) ; * / / Returns " ClassName { x = 1 } " * Objects . toStringHelper ( this ) * . omitNullValues ( ) * . add ( " x " , 1) * . add ( " y " , null ) * . toString ( ) ; * } } < / pre > * < p > Note that in GWT , class names are often obfuscated . * @ param self the object to generate the string for ( typically { @ code this } ) , * used only for its class name * @ since 2.0 * @ deprecated Use { @ link MoreObjects # toStringHelper ( Object ) } instead . This * method is scheduled for removal in June 2016. */ @ Deprecated public static ToStringHelper toStringHelper ( Object self ) { } }
return new ToStringHelper ( MoreObjects . simpleName ( self . getClass ( ) ) ) ;
public class DecimalUtils { /** * e . g . 0.30 equals 0.3 & & 0.30 equals 0.30 & & 0.30 equals 0.300. */ public static boolean isValueEquals ( BigDecimal decimal1 , BigDecimal decimal2 ) { } }
if ( decimal1 == null && decimal2 == null ) return true ; if ( decimal1 == null && decimal2 != null ) return false ; if ( decimal1 != null && decimal2 == null ) return false ; return cutInvalidSacle ( decimal1 ) . equals ( cutInvalidSacle ( decimal2 ) ) ;
public class DescribeDBSubnetGroupsResult { /** * A list of < a > DBSubnetGroup < / a > instances . * @ param dBSubnetGroups * A list of < a > DBSubnetGroup < / a > instances . */ public void setDBSubnetGroups ( java . util . Collection < DBSubnetGroup > dBSubnetGroups ) { } }
if ( dBSubnetGroups == null ) { this . dBSubnetGroups = null ; return ; } this . dBSubnetGroups = new java . util . ArrayList < DBSubnetGroup > ( dBSubnetGroups ) ;
public class ResourceUtil { /** * If the node is file . * @ param node node * @ return true if node is file false if not */ public static boolean isFile ( Node node ) { } }
try { if ( ! node . isNodeType ( "nt:file" ) ) return false ; if ( ! node . getNode ( "jcr:content" ) . isNodeType ( "nt:resource" ) ) return false ; return true ; } catch ( RepositoryException exc ) { LOG . error ( exc . getMessage ( ) , exc ) ; return false ; }
public class JDBC4ResultSet { /** * ResultSet object as a java . io . Reader object . */ @ Override public Reader getNCharacterStream ( int columnIndex ) throws SQLException { } }
checkColumnBounds ( columnIndex ) ; try { String value = table . getString ( columnIndex - 1 ) ; if ( ! wasNull ( ) ) return new StringReader ( value ) ; return null ; } catch ( Exception x ) { throw SQLError . get ( x ) ; }
public class Animation { /** * Check if we need to move to the next frame * @ param delta The amount of time thats passed since last update */ private void nextFrame ( long delta ) { } }
if ( stopped ) { return ; } if ( frames . size ( ) == 0 ) { return ; } nextChange -= delta ; while ( nextChange < 0 && ( ! stopped ) ) { if ( currentFrame == stopAt ) { stopped = true ; break ; } if ( ( currentFrame == frames . size ( ) - 1 ) && ( ! loop ) && ( ! pingPong ) ) { stopped = true ; break ; } currentFrame = ( currentFrame + direction ) % frames . size ( ) ; if ( pingPong ) { if ( currentFrame <= 0 ) { currentFrame = 0 ; direction = 1 ; if ( ! loop ) { stopped = true ; break ; } } else if ( currentFrame >= frames . size ( ) - 1 ) { currentFrame = frames . size ( ) - 1 ; direction = - 1 ; } } int realDuration = ( int ) ( ( ( Frame ) frames . get ( currentFrame ) ) . duration / speed ) ; nextChange = nextChange + realDuration ; }
public class MetaGraphDef { /** * < pre > * signature _ def : Map from user supplied key for a signature to a single * SignatureDef . * < / pre > * < code > map & lt ; string , . tensorflow . SignatureDef & gt ; signature _ def = 5 ; < / code > */ public java . util . Map < java . lang . String , org . tensorflow . framework . SignatureDef > getSignatureDefMap ( ) { } }
return internalGetSignatureDef ( ) . getMap ( ) ;
public class ContentElement { /** * Write the postamble into the given writer . Used by the FinalizeFlusher and by standard write method * @ param util an XML util * @ param writer the destination * @ throws IOException if the postamble could not be written */ public void writePostamble ( final XMLUtil util , final ZipUTF8Writer writer ) throws IOException { } }
if ( this . autofilters != null ) this . appendAutofilters ( writer , util ) ; writer . write ( "</office:spreadsheet>" ) ; writer . write ( "</office:body>" ) ; writer . write ( "</office:document-content>" ) ; writer . flush ( ) ; writer . closeEntry ( ) ;
public class BingMapTileSource { /** * Fire this after you ' ve set up your prefered tile styles and locale * if you forget , it should fire on the first request for tiles . * See issue < a href = " https : / / github . com / osmdroid / osmdroid / issues / 383 " > https : / / github . com / osmdroid / osmdroid / issues / 383 < / a > * It was made public since v5.3 * @ return * @ since 5.3 */ public ImageryMetaDataResource initMetaData ( ) { } }
if ( ! mImageryData . m_isInitialised ) { synchronized ( this ) { if ( ! mImageryData . m_isInitialised ) { final ImageryMetaDataResource imageryData = getMetaData ( ) ; if ( imageryData != null ) { mImageryData = imageryData ; updateBaseUrl ( ) ; } } } } return mImageryData ;
public class RegionUtils { /** * Returns the current set of region metadata for this process , * initializing it if it has not yet been explicitly initialized before . * @ return the current set of region metadata */ public static RegionMetadata getRegionMetadata ( ) { } }
RegionMetadata rval = regionMetadata ; if ( rval != null ) { return rval ; } synchronized ( RegionUtils . class ) { if ( regionMetadata == null ) { initialize ( ) ; } } return regionMetadata ;
public class NonMaxBlock { /** * Detects local minimums and / or maximums in the provided intensity image . * @ param intensityImage ( Input ) Feature intensity image . * @ param localMin ( Output ) storage for found local minimums . * @ param localMax ( Output ) storage for found local maximums . */ public void process ( GrayF32 intensityImage , @ Nullable QueueCorner localMin , @ Nullable QueueCorner localMax ) { } }
if ( localMin != null ) localMin . reset ( ) ; if ( localMax != null ) localMax . reset ( ) ; // the defines the region that can be processed int endX = intensityImage . width - border ; int endY = intensityImage . height - border ; int step = configuration . radius + 1 ; search . initialize ( configuration , intensityImage , localMin , localMax ) ; for ( int y = border ; y < endY ; y += step ) { int y1 = y + step ; if ( y1 > endY ) y1 = endY ; for ( int x = border ; x < endX ; x += step ) { int x1 = x + step ; if ( x1 > endX ) x1 = endX ; search . searchBlock ( x , y , x1 , y1 ) ; } }
public class GobblinClusterManager { /** * Configure Helix quota - based task scheduling */ @ VisibleForTesting void configureHelixQuotaBasedTaskScheduling ( ) { } }
// set up the cluster quota config List < String > quotaConfigList = ConfigUtils . getStringList ( this . config , GobblinClusterConfigurationKeys . HELIX_TASK_QUOTA_CONFIG_KEY ) ; if ( quotaConfigList . isEmpty ( ) ) { return ; } // retrieve the cluster config for updating ClusterConfig clusterConfig = this . multiManager . getJobClusterHelixManager ( ) . getConfigAccessor ( ) . getClusterConfig ( this . clusterName ) ; clusterConfig . resetTaskQuotaRatioMap ( ) ; for ( String entry : quotaConfigList ) { List < String > quotaConfig = Splitter . on ( ":" ) . limit ( 2 ) . trimResults ( ) . omitEmptyStrings ( ) . splitToList ( entry ) ; if ( quotaConfig . size ( ) < 2 ) { throw new IllegalArgumentException ( "Quota configurations must be of the form <key1>:<value1>,<key2>:<value2>,..." ) ; } clusterConfig . setTaskQuotaRatio ( quotaConfig . get ( 0 ) , Integer . parseInt ( quotaConfig . get ( 1 ) ) ) ; } this . multiManager . getJobClusterHelixManager ( ) . getConfigAccessor ( ) . setClusterConfig ( this . clusterName , clusterConfig ) ; // Set the new ClusterConfig
public class OSQLPredicate { /** * Binds parameters . * @ param iArgs */ public void bindParameters ( final Map < Object , Object > iArgs ) { } }
if ( parameterItems == null || iArgs == null || iArgs . size ( ) == 0 ) return ; for ( Entry < Object , Object > entry : iArgs . entrySet ( ) ) { if ( entry . getKey ( ) instanceof Integer ) parameterItems . get ( ( ( Integer ) entry . getKey ( ) ) ) . setValue ( entry . setValue ( entry . getValue ( ) ) ) ; else { String paramName = entry . getKey ( ) . toString ( ) ; for ( OSQLFilterItemParameter value : parameterItems ) { if ( value . getName ( ) . equalsIgnoreCase ( paramName ) ) { value . setValue ( entry . getValue ( ) ) ; break ; } } } }
public class ControllerServiceMain { /** * Awaits until the internal state changes to STARTING , and returns the reference * of current ControllerServiceStarter . */ @ VisibleForTesting public ControllerServiceStarter awaitServiceStarting ( ) { } }
monitor . enterWhenUninterruptibly ( hasReachedStarting ) ; try { if ( serviceState != ServiceState . STARTING ) { throw new IllegalStateException ( "Expected state=" + ServiceState . STARTING + ", but actual state=" + serviceState ) ; } else { return this . starter ; } } finally { monitor . leave ( ) ; }
public class CommerceUserSegmentEntryWrapper { /** * Returns the localized name of this commerce user segment entry in the language , optionally using the default language if no localization exists for the requested language . * @ param languageId the ID of the language * @ param useDefault whether to use the default language if no localization exists for the requested language * @ return the localized name of this commerce user segment entry */ @ Override public String getName ( String languageId , boolean useDefault ) { } }
return _commerceUserSegmentEntry . getName ( languageId , useDefault ) ;
public class MultimediaPickerFragment { /** * Overriding this method allows us to inject a preview image * in the layout * @ param vh to bind data from either a file or directory * @ param position 0 - n , where the header has been subtracted * @ param file to show info about */ @ Override public void onBindViewHolder ( @ NonNull DirViewHolder vh , int position , @ NonNull File file ) { } }
// Let the super method do its thing with checkboxes and text super . onBindViewHolder ( vh , position , file ) ; // Here we load the preview image if it is an image file final int viewType = getItemViewType ( position , file ) ; if ( viewType == VIEWTYPE_IMAGE_CHECKABLE || viewType == VIEWTYPE_IMAGE ) { // Need to set it to visible because the base code will set it to invisible by default vh . icon . setVisibility ( View . VISIBLE ) ; // Just load the image Glide . with ( this ) . load ( file ) . into ( ( ImageView ) vh . icon ) ; }
public class MethodWriterImpl { /** * Add the return type . * @ param method the method being documented . * @ param htmltree the content tree to which the return type will be added */ protected void addReturnType ( MethodDoc method , Content htmltree ) { } }
Type type = method . returnType ( ) ; if ( type != null ) { Content linkContent = writer . getLink ( new LinkInfoImpl ( configuration , LinkInfoImpl . Kind . RETURN_TYPE , type ) ) ; htmltree . addContent ( linkContent ) ; htmltree . addContent ( writer . getSpace ( ) ) ; }
public class MetricManager { /** * Start up the background thread that is processing metrics */ private static synchronized void startup ( ) { } }
try { if ( CONFIG == null ) { CONFIG = ApiConfigurations . fromProperties ( ) ; } ObjectMapper objectMapper = new ObjectMapper ( ) ; AppIdentityService appIdentityService = new AppIdentityService ( CONFIG , objectMapper , true ) ; MetricMonitorService monitorService = new MetricMonitorService ( CONFIG , objectMapper , appIdentityService ) ; MetricSender sender = new MetricSender ( CONFIG , objectMapper , monitorService ) ; BACKGROUND_SERVICE = new MetricBackgroundService ( COLLECTOR , sender ) ; BACKGROUND_SERVICE . start ( ) ; } catch ( Throwable t ) { LOGGER . error ( "Exception starting Stackify Metrics API service" , t ) ; }
public class GenderMarshaller { /** * Marshall the given parameter object . */ public void marshall ( Gender gender , ProtocolMarshaller protocolMarshaller ) { } }
if ( gender == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( gender . getValue ( ) , VALUE_BINDING ) ; protocolMarshaller . marshall ( gender . getConfidence ( ) , CONFIDENCE_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } * { @ link IntegerUserMap } { @ code > } */ @ XmlElementDecl ( namespace = "http://hello.com" , name = "IntegerUserMap" ) public JAXBElement < IntegerUserMap > createIntegerUserMap ( IntegerUserMap value ) { } }
return new JAXBElement < IntegerUserMap > ( _IntegerUserMap_QNAME , IntegerUserMap . class , null , value ) ;
public class WSJdbcResultSet { /** * Gets a BLOB value in the current row of this ResultSet object . * @ param i - the first column is 1 , the second is 2 , . . . * @ return * a Blob object representing the SQL BLOB value in the specified column . */ public Blob getBlob ( int arg0 ) throws SQLException { } }
try { Blob blob = rsetImpl . getBlob ( arg0 ) ; if ( blob != null && freeResourcesOnClose ) blobs . add ( blob ) ; return blob ; } catch ( SQLException ex ) { FFDCFilter . processException ( ex , "com.ibm.ws.rsadapter.jdbc.WSJdbcResultSet.getBlob" , "754" , this ) ; throw WSJdbcUtil . mapException ( this , ex ) ; } catch ( NullPointerException nullX ) { // No FFDC code needed ; we might be closed . throw runtimeXIfNotClosed ( nullX ) ; }
public class nitro_service { /** * Use this API to login into NetScaler SDX . * @ param username Username * @ param password Password for the NetScaler SDX . * @ param timeout timeout for NetScaler SDX session . Default is 30mins * @ return status of the operation performed . * @ throws Exception nitro exception is thrown . */ public login login ( String username , String password , Integer timeout ) throws Exception { } }
this . set_credential ( username , password ) ; this . set_timeout ( timeout ) ; return this . login ( ) ;
public class Admin { /** * @ throws PageException */ private void doGetFLDs ( ) throws PageException { } }
lucee . runtime . type . Query qry = new QueryImpl ( new String [ ] { "displayname" , "namespace" , "namespaceseparator" , "shortname" , "description" , "uri" , "source" } , new String [ ] { "varchar" , "varchar" , "varchar" , "varchar" , "varchar" , "varchar" , "varchar" } , 0 , "tlds" ) ; int dialect = "lucee" . equalsIgnoreCase ( getString ( "dialect" , "cfml" ) ) ? CFMLEngine . DIALECT_LUCEE : CFMLEngine . DIALECT_CFML ; FunctionLib [ ] libs = config . getFLDs ( dialect ) ; for ( int i = 0 ; i < libs . length ; i ++ ) { qry . addRow ( ) ; qry . setAt ( "displayname" , i + 1 , libs [ i ] . getDisplayName ( ) ) ; qry . setAt ( "namespace" , i + 1 , "" ) ; // TODO support for namespace qry . setAt ( "namespaceseparator" , i + 1 , "" ) ; qry . setAt ( "shortname" , i + 1 , libs [ i ] . getShortName ( ) ) ; qry . setAt ( "description" , i + 1 , libs [ i ] . getDescription ( ) ) ; qry . setAt ( "uri" , i + 1 , Caster . toString ( libs [ i ] . getUri ( ) ) ) ; qry . setAt ( "source" , i + 1 , StringUtil . emptyIfNull ( libs [ i ] . getSource ( ) ) ) ; } pageContext . setVariable ( getString ( "admin" , action , "returnVariable" ) , qry ) ;
public class Charge { /** * Retrieves the details of a charge that has previously been created . Supply the unique charge ID * that was returned from your previous request , and Stripe will return the corresponding charge * information . The same information is returned when creating or refunding the charge . */ public static Charge retrieve ( String charge ) throws StripeException { } }
return retrieve ( charge , ( Map < String , Object > ) null , ( RequestOptions ) null ) ;
public class ContrastUtils { /** * Calculates the contrast ratio of two order - independent luminance values . * Derived from formula at http : / / gmazzocato . altervista . org / colorwheel / algo . php * @ param lum1 The first luminance value * @ param lum2 The second luminance value * @ return The contrast ratio of the luminance values * @ throws IllegalArgumentException if luminance values are < 0 */ public static double calculateContrastRatio ( double lum1 , double lum2 ) { } }
if ( ( lum1 < 0.0d ) || ( lum2 < 0.0d ) ) { throw new IllegalArgumentException ( "Luminance values may not be negative." ) ; } return ( Math . max ( lum1 , lum2 ) + 0.05d ) / ( Math . min ( lum1 , lum2 ) + 0.05d ) ;
public class ToStringStyle { /** * < p > Append to the < code > toString < / code > an < code > Object < / code > , * correctly interpreting its type . < / p > * < p > This method performs the main lookup by Class type to correctly * route arrays , < code > Collections < / code > , < code > Maps < / code > and * < code > Objects < / code > to the appropriate method . < / p > * < p > Either detail or summary views can be specified . < / p > * < p > If a cycle is detected , an object will be appended with the * < code > Object . toString ( ) < / code > format . < / p > * @ param buffer the < code > StringBuilder < / code > to populate * @ param fieldName the field name , typically not used as already appended * @ param value the value to add to the < code > toString < / code > , * not < code > null < / code > * @ param detail output detail or not */ protected void appendInternal ( StringBuilder buffer , String fieldName , Object value , boolean detail ) { } }
if ( isRegistered ( value ) && ! ( value instanceof Number || value instanceof Boolean || value instanceof Character ) ) { appendCyclicObject ( buffer , fieldName , value ) ; return ; } register ( value ) ; try { if ( value instanceof Collection < ? > ) { if ( detail ) { appendDetail ( buffer , fieldName , ( Collection < ? > ) value ) ; } else { appendSummarySize ( buffer , fieldName , ( ( Collection < ? > ) value ) . size ( ) ) ; } } else if ( value instanceof Map < ? , ? > ) { if ( detail ) { appendDetail ( buffer , fieldName , ( Map < ? , ? > ) value ) ; } else { appendSummarySize ( buffer , fieldName , ( ( Map < ? , ? > ) value ) . size ( ) ) ; } } else if ( value instanceof long [ ] ) { if ( detail ) { appendDetail ( buffer , fieldName , ( long [ ] ) value ) ; } else { appendSummary ( buffer , fieldName , ( long [ ] ) value ) ; } } else if ( value instanceof int [ ] ) { if ( detail ) { appendDetail ( buffer , fieldName , ( int [ ] ) value ) ; } else { appendSummary ( buffer , fieldName , ( int [ ] ) value ) ; } } else if ( value instanceof short [ ] ) { if ( detail ) { appendDetail ( buffer , fieldName , ( short [ ] ) value ) ; } else { appendSummary ( buffer , fieldName , ( short [ ] ) value ) ; } } else if ( value instanceof byte [ ] ) { if ( detail ) { appendDetail ( buffer , fieldName , ( byte [ ] ) value ) ; } else { appendSummary ( buffer , fieldName , ( byte [ ] ) value ) ; } } else if ( value instanceof char [ ] ) { if ( detail ) { appendDetail ( buffer , fieldName , ( char [ ] ) value ) ; } else { appendSummary ( buffer , fieldName , ( char [ ] ) value ) ; } } else if ( value instanceof double [ ] ) { if ( detail ) { appendDetail ( buffer , fieldName , ( double [ ] ) value ) ; } else { appendSummary ( buffer , fieldName , ( double [ ] ) value ) ; } } else if ( value instanceof float [ ] ) { if ( detail ) { appendDetail ( buffer , fieldName , ( float [ ] ) value ) ; } else { appendSummary ( buffer , fieldName , ( float [ ] ) value ) ; } } else if ( value instanceof boolean [ ] ) { if ( detail ) { appendDetail ( buffer , fieldName , ( boolean [ ] ) value ) ; } else { appendSummary ( buffer , fieldName , ( boolean [ ] ) value ) ; } } else if ( value . getClass ( ) . isArray ( ) ) { if ( detail ) { appendDetail ( buffer , fieldName , ( Object [ ] ) value ) ; } else { appendSummary ( buffer , fieldName , ( Object [ ] ) value ) ; } } else { if ( detail ) { appendDetail ( buffer , fieldName , value ) ; } else { appendSummary ( buffer , fieldName , value ) ; } } } finally { unregister ( value ) ; }
public class RegularExpressionValidator { /** * { @ inheritDoc } check if given string is a valid regular expression . * @ see javax . validation . ConstraintValidator # isValid ( java . lang . Object , * javax . validation . ConstraintValidatorContext ) */ @ Override public final boolean isValid ( final String pvalue , final ConstraintValidatorContext pcontext ) { } }
if ( StringUtils . isEmpty ( pvalue ) ) { return true ; } try { // execute regular expression , result doesn ' t matter "x" . matches ( pvalue ) ; return true ; } catch ( final Exception pexception ) { // regular expression is invalid return false ; }
public class DefaultIoFuture { /** * Sets the result of the asynchronous operation , and mark it as finished . */ public void setValue ( Object newValue ) { } }
synchronized ( lock ) { // Allow only once . if ( ready ) { return ; } result = newValue ; ready = true ; if ( waiters > 0 ) { lock . notifyAll ( ) ; } } notifyListeners ( ) ;
public class Nfs3 { /** * / * ( non - Javadoc ) * @ see com . emc . ecs . nfsclient . nfs . Nfs # makeSetAttrRequest ( byte [ ] , com . emc . ecs . nfsclient . nfs . NfsSetAttributes , com . emc . ecs . nfsclient . nfs . NfsTime ) */ public NfsSetAttrRequest makeSetAttrRequest ( byte [ ] fileHandle , NfsSetAttributes attributes , NfsTime guardTime ) throws FileNotFoundException { } }
return new Nfs3SetAttrRequest ( fileHandle , attributes , guardTime , _credential ) ;
public class RmPath { /** * currently does not support paths with name constrains */ private static List < Segment > parseSegments ( String origPathStr ) { } }
String pathStr = origPathStr ; if ( ! pathStr . startsWith ( "/" ) ) { pathStr = pathStr + "/" ; } List < Segment > result = new ArrayList < > ( ) ; for ( String segmentStr : PATH_SPLITTER . split ( pathStr ) ) { Matcher m = SEGMENT_PATTERN . matcher ( segmentStr ) ; if ( ! m . matches ( ) ) { throw new IllegalArgumentException ( "Bad aql path: " + origPathStr ) ; } Segment segment = new Segment ( ) ; segment . attribute = m . group ( 1 ) ; segment . nodeId = m . groupCount ( ) >= 3 ? m . group ( 3 ) : null ; result . add ( segment ) ; } return result ;
public class LevelRipConverter { /** * Search current tile of image map by checking all surfaces . * @ param map The destination map reference . * @ param tileSprite The tiled sprite * @ param x The location x . * @ param y The location y . * @ return The tile found . */ private static Tile searchForTile ( MapTile map , ImageBuffer tileSprite , int x , int y ) { } }
// Check each tile on each sheet for ( final Integer sheet : map . getSheets ( ) ) { final Tile tile = checkTile ( map , tileSprite , sheet , x , y ) ; if ( tile != null ) { return tile ; } } // No tile found return null ;
public class Policy { /** * clearPolicy clears all current policy . */ public void clearPolicy ( ) { } }
if ( model . containsKey ( "p" ) ) { for ( Assertion ast : model . get ( "p" ) . values ( ) ) { ast . policy = new ArrayList < > ( ) ; } } if ( model . containsKey ( "g" ) ) { for ( Assertion ast : model . get ( "g" ) . values ( ) ) { ast . policy = new ArrayList < > ( ) ; } }
public class CreateIconChoicePopup { /** * used for displaying marker SVG elements in a drawing area . * @ param shape * @ param amountOfMarkers * @ return */ private ClickableMarkerShape translateMarker ( ClickableMarkerShape shape , int amountOfMarkers ) { } }
if ( amountOfMarkers % imagePerRow != 0 ) { int size = choiceListImageSize + 6 ; shape . setTranslation ( size * ( amountOfMarkers % imagePerRow ) , size * ( amountOfMarkers / imagePerRow ) ) ; } return shape ;