signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class SibRaActivationSpecImpl { /** * Set the useServerSubject property . * @ param useServerSubject */ public void setUseServerSubject ( Boolean useServerSubject ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && TRACE . isDebugEnabled ( ) ) { SibTr . debug ( this , TRACE , "setUseServerSubject" , useServerSubject ) ; } _useServerSubject = useServerSubject ;
public class UriUtils { /** * Encodes the given HTTP URI into an encoded String . All various URI components are * encoded according to their respective valid character sets . * < p > < strong > Note < / strong > that this method does not support fragments ( { @ code # } ) , * as these are not supposed to be sent to the server , but retained by the client . * < p > < strong > Note < / strong > that this method does not attempt to encode " = " and " & " * characters in query parameter names and query parameter values because they cannot * be parsed in a reliable way . Instead use : * < pre class = " code " > * UriComponents uriComponents = UriComponentsBuilder . fromHttpUrl ( " / path ? name = { value } " ) . buildAndExpand ( " a = b " ) ; * String encodedUri = uriComponents . encode ( ) . toUriString ( ) ; * < / pre > * @ param httpUrl the HTTP URL to be encoded * @ param encoding the character encoding to encode to * @ return the encoded URL * @ throws IllegalArgumentException when the given uri parameter is not a valid URI * @ throws UnsupportedEncodingException when the given encoding parameter is not supported * @ deprecated in favor of { @ link UriComponentsBuilder } ; see note about query param encoding */ @ Deprecated public static String encodeHttpUrl ( String httpUrl , String encoding ) throws UnsupportedEncodingException { } }
Assert . notNull ( httpUrl , "HTTP URL must not be null" ) ; Assert . hasLength ( encoding , "Encoding must not be empty" ) ; Matcher matcher = HTTP_URL_PATTERN . matcher ( httpUrl ) ; if ( matcher . matches ( ) ) { String scheme = matcher . group ( 1 ) ; String authority = matcher . group ( 2 ) ; String userinfo = matcher . group ( 4 ) ; String host = matcher . group ( 5 ) ; String portString = matcher . group ( 7 ) ; String path = matcher . group ( 8 ) ; String query = matcher . group ( 10 ) ; return encodeUriComponents ( scheme , authority , userinfo , host , portString , path , query , null , encoding ) ; } else { throw new IllegalArgumentException ( "[" + httpUrl + "] is not a valid HTTP URL" ) ; }
public class ProviderManager { /** * Returns the stanza extension provider registered to the specified XML element name * and namespace . For example , if a provider was registered to the element name " x " and the * namespace " jabber : x : event " , then the following stanza would trigger the provider : * < pre > * & lt ; message to = ' romeo @ montague . net ' id = ' message _ 1 ' & gt ; * & lt ; body & gt ; Art thou not Romeo , and a Montague ? & lt ; / body & gt ; * & lt ; x xmlns = ' jabber : x : event ' & gt ; * & lt ; composing / & gt ; * & lt ; / x & gt ; * & lt ; / message & gt ; < / pre > * < p > Note : this method is generally only called by the internal Smack classes . * @ param elementName element name associated with extension provider . * @ param namespace namespace associated with extension provider . * @ return the extension provider . */ public static ExtensionElementProvider < ExtensionElement > getExtensionProvider ( String elementName , String namespace ) { } }
String key = getKey ( elementName , namespace ) ; return extensionProviders . get ( key ) ;
public class TcpClientTransport { /** * Creates a new instance * @ param bindAddress the address to connect to * @ param port the port to connect to * @ return a new instance * @ throws NullPointerException if { @ code bindAddress } is { @ code null } */ public static TcpClientTransport create ( String bindAddress , int port ) { } }
Objects . requireNonNull ( bindAddress , "bindAddress must not be null" ) ; TcpClient tcpClient = TcpClient . create ( ) . host ( bindAddress ) . port ( port ) ; return create ( tcpClient ) ;
public class QuartzScheduler { /** * Returns the name of the thread group for Quartz ' s main threads . */ public ThreadGroup getSchedulerThreadGroup ( ) { } }
if ( threadGroup == null ) { threadGroup = new ThreadGroup ( "QuartzScheduler" ) ; if ( quartzSchedulerResources . getMakeSchedulerThreadDaemon ( ) ) { threadGroup . setDaemon ( true ) ; } } return threadGroup ;
public class JaegerTraceExporter { /** * Creates and registers the Jaeger Trace exporter to the OpenCensus library . Only one Jaeger * exporter can be registered at any point . * @ param thriftEndpoint the Thrift endpoint of your Jaeger instance , e . g . : * " http : / / 127.0.0.1:14268 / api / traces " * @ param serviceName the local service name of the process . * @ throws IllegalStateException if a Jaeger exporter is already registered . * @ since 0.13 */ public static void createAndRegister ( final String thriftEndpoint , final String serviceName ) { } }
synchronized ( monitor ) { checkState ( handler == null , "Jaeger exporter is already registered." ) ; final SpanExporter . Handler newHandler = newHandler ( thriftEndpoint , serviceName ) ; JaegerTraceExporter . handler = newHandler ; register ( Tracing . getExportComponent ( ) . getSpanExporter ( ) , newHandler ) ; }
public class ParameterizationFunction { /** * Computes the function value at < code > alpha < / code > . * @ param alpha the values of the d - 1 angles * @ return the function value at alpha */ public double function ( double [ ] alpha ) { } }
final int d = vec . getDimensionality ( ) ; if ( alpha . length != d - 1 ) { throw new IllegalArgumentException ( "Parameter alpha must have a dimensionality of " + ( d - 1 ) + ", read: " + alpha . length ) ; } double result = 0 ; for ( int i = 0 ; i < d ; i ++ ) { double alpha_i = i == d - 1 ? 0 : alpha [ i ] ; result += vec . doubleValue ( i ) * sinusProduct ( 0 , i , alpha ) * FastMath . cos ( alpha_i ) ; } return result ;
public class WorkManagerImpl { /** * Set the executor for short running tasks * @ param executor The executor */ public void setShortRunningThreadPool ( BlockingExecutor executor ) { } }
if ( trace ) log . trace ( "short running executor:" + ( executor != null ? executor . getClass ( ) : "null" ) ) ; if ( executor != null ) { if ( executor instanceof StatisticsExecutor ) { this . shortRunningExecutor = ( StatisticsExecutor ) executor ; } else { this . shortRunningExecutor = new StatisticsExecutorImpl ( executor ) ; } }
public class ReadWriteMultipleRequest { /** * getRegister - Returns the specified < tt > Register < / tt > . * @ param index the index of the < tt > Register < / tt > . * @ return the register as < tt > Register < / tt > . * @ throws IndexOutOfBoundsException if the index is out of bounds . */ public Register getRegister ( int index ) throws IndexOutOfBoundsException { } }
if ( index < 0 ) { throw new IndexOutOfBoundsException ( index + " < 0" ) ; } if ( index >= getWriteWordCount ( ) ) { throw new IndexOutOfBoundsException ( index + " > " + getWriteWordCount ( ) ) ; } return registers [ index ] ;
public class Utils4Swing { /** * Initializes the look and feel and wraps exceptions into a runtime * exception . It ' s executed in the calling thread . * @ param className * Full qualified name of the look and feel class . */ private static void initLookAndFeelIntern ( final String className ) { } }
try { UIManager . setLookAndFeel ( className ) ; } catch ( final Exception e ) { throw new RuntimeException ( "Error initializing the Look And Feel!" , e ) ; }
public class ResourceGroupsInner { /** * Gets all the resource groups for a subscription . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the PagedList & lt ; ResourceGroupInner & gt ; object */ public Observable < Page < ResourceGroupInner > > listAsync ( ) { } }
return listWithServiceResponseAsync ( ) . map ( new Func1 < ServiceResponse < Page < ResourceGroupInner > > , Page < ResourceGroupInner > > ( ) { @ Override public Page < ResourceGroupInner > call ( ServiceResponse < Page < ResourceGroupInner > > response ) { return response . body ( ) ; } } ) ;
public class JdbcQueue { /** * Reset retry counter . * @ return old retry counter . * @ since 0.7.1.1 */ public Map < String , Long > resetRetryCounter ( ) { } }
Map < String , Long > result = retryCounter . asMap ( ) ; retryCounter . clear ( ) ; return result ;
public class ResourceCache { /** * Get a resource from the context . * Cached Resources are returned if the resource fits within the LRU * cache . Directories may have CachedResources returned , but the * caller must use the CachedResource . setCachedData method to set the * formatted directory content . * @ param pathInContext * @ return Resource * @ exception IOException */ public Resource getResource ( String pathInContext ) throws IOException { } }
if ( log . isTraceEnabled ( ) ) log . trace ( "getResource " + pathInContext ) ; if ( _resourceBase == null ) return null ; Resource resource = null ; // Cache operations synchronized ( _cache ) { // Look for it in the cache CachedResource cached = ( CachedResource ) _cache . get ( pathInContext ) ; if ( cached != null ) { if ( log . isTraceEnabled ( ) ) log . trace ( "CACHE HIT: " + cached ) ; CachedMetaData cmd = ( CachedMetaData ) cached . getAssociate ( ) ; if ( cmd != null && cmd . isValid ( ) ) return cached ; } // Make the resource resource = _resourceBase . addPath ( _resourceBase . encode ( pathInContext ) ) ; if ( log . isTraceEnabled ( ) ) log . trace ( "CACHE MISS: " + resource ) ; if ( resource == null ) return null ; // Check for file aliasing if ( resource . getAlias ( ) != null ) { log . warn ( "Alias request of '" + resource . getAlias ( ) + "' for '" + resource + "'" ) ; return null ; } // Is it an existing file ? long len = resource . length ( ) ; if ( resource . exists ( ) ) { // Is it badly named ? if ( ! resource . isDirectory ( ) && pathInContext . endsWith ( "/" ) ) return null ; // Guess directory length . if ( resource . isDirectory ( ) ) { if ( resource . list ( ) != null ) len = resource . list ( ) . length * 100 ; else len = 0 ; } // Is it cacheable ? if ( len > 0 && len < _maxCachedFileSize && len < _maxCacheSize ) { int needed = _maxCacheSize - ( int ) len ; while ( _cacheSize > needed ) _leastRecentlyUsed . invalidate ( ) ; cached = resource . cache ( ) ; if ( log . isTraceEnabled ( ) ) log . trace ( "CACHED: " + resource ) ; new CachedMetaData ( cached , pathInContext ) ; return cached ; } } } // Non cached response new ResourceMetaData ( resource ) ; return resource ;
public class AbstractPluginManager { /** * Check if this plugin is valid ( satisfies " requires " param ) for a given system version . * @ param pluginWrapper the plugin to check * @ return true if plugin satisfies the " requires " or if requires was left blank */ protected boolean isPluginValid ( PluginWrapper pluginWrapper ) { } }
String requires = pluginWrapper . getDescriptor ( ) . getRequires ( ) . trim ( ) ; if ( ! isExactVersionAllowed ( ) && requires . matches ( "^\\d+\\.\\d+\\.\\d+$" ) ) { // If exact versions are not allowed in requires , rewrite to > = expression requires = ">=" + requires ; } if ( systemVersion . equals ( "0.0.0" ) || versionManager . checkVersionConstraint ( systemVersion , requires ) ) { return true ; } PluginDescriptor pluginDescriptor = pluginWrapper . getDescriptor ( ) ; log . warn ( "Plugin '{}' requires a minimum system version of {}, and you have {}" , getPluginLabel ( pluginDescriptor ) , pluginWrapper . getDescriptor ( ) . getRequires ( ) , getSystemVersion ( ) ) ; return false ;
public class FailoverGroupsInner { /** * Updates a failover group . * @ param resourceGroupName The name of the resource group that contains the resource . You can obtain this value from the Azure Resource Manager API or the portal . * @ param serverName The name of the server containing the failover group . * @ param failoverGroupName The name of the failover group . * @ param parameters The failover group parameters . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable for the request */ public Observable < FailoverGroupInner > updateAsync ( String resourceGroupName , String serverName , String failoverGroupName , FailoverGroupUpdate parameters ) { } }
return updateWithServiceResponseAsync ( resourceGroupName , serverName , failoverGroupName , parameters ) . map ( new Func1 < ServiceResponse < FailoverGroupInner > , FailoverGroupInner > ( ) { @ Override public FailoverGroupInner call ( ServiceResponse < FailoverGroupInner > response ) { return response . body ( ) ; } } ) ;
public class ProtoParser { /** * com / dyuproject / protostuff / parser / ProtoParser . g : 553:1 : enum _ options [ Proto proto , EnumGroup enumGroup , EnumGroup . Value v ] : LEFTSQUARE field _ options _ keyval [ proto , null , v . field , false ] ( COMMA field _ options _ keyval [ proto , null , v . field , false ] ) * RIGHTSQUARE ; */ public final ProtoParser . enum_options_return enum_options ( Proto proto , EnumGroup enumGroup , EnumGroup . Value v ) throws RecognitionException { } }
ProtoParser . enum_options_return retval = new ProtoParser . enum_options_return ( ) ; retval . start = input . LT ( 1 ) ; Object root_0 = null ; Token LEFTSQUARE132 = null ; Token COMMA134 = null ; Token RIGHTSQUARE136 = null ; ProtoParser . field_options_keyval_return field_options_keyval133 = null ; ProtoParser . field_options_keyval_return field_options_keyval135 = null ; Object LEFTSQUARE132_tree = null ; Object COMMA134_tree = null ; Object RIGHTSQUARE136_tree = null ; try { // com / dyuproject / protostuff / parser / ProtoParser . g : 554:5 : ( LEFTSQUARE field _ options _ keyval [ proto , null , v . field , false ] ( COMMA field _ options _ keyval [ proto , null , v . field , false ] ) * RIGHTSQUARE ) // com / dyuproject / protostuff / parser / ProtoParser . g : 554:9 : LEFTSQUARE field _ options _ keyval [ proto , null , v . field , false ] ( COMMA field _ options _ keyval [ proto , null , v . field , false ] ) * RIGHTSQUARE { root_0 = ( Object ) adaptor . nil ( ) ; LEFTSQUARE132 = ( Token ) match ( input , LEFTSQUARE , FOLLOW_LEFTSQUARE_in_enum_options2218 ) ; if ( state . failed ) return retval ; if ( state . backtracking == 0 ) { LEFTSQUARE132_tree = ( Object ) adaptor . create ( LEFTSQUARE132 ) ; adaptor . addChild ( root_0 , LEFTSQUARE132_tree ) ; } pushFollow ( FOLLOW_field_options_keyval_in_enum_options2220 ) ; field_options_keyval133 = field_options_keyval ( proto , null , v . field , false ) ; state . _fsp -- ; if ( state . failed ) return retval ; if ( state . backtracking == 0 ) adaptor . addChild ( root_0 , field_options_keyval133 . getTree ( ) ) ; // com / dyuproject / protostuff / parser / ProtoParser . g : 555:9 : ( COMMA field _ options _ keyval [ proto , null , v . field , false ] ) * loop26 : do { int alt26 = 2 ; switch ( input . LA ( 1 ) ) { case COMMA : { alt26 = 1 ; } break ; } switch ( alt26 ) { case 1 : // com / dyuproject / protostuff / parser / ProtoParser . g : 555:10 : COMMA field _ options _ keyval [ proto , null , v . field , false ] { COMMA134 = ( Token ) match ( input , COMMA , FOLLOW_COMMA_in_enum_options2233 ) ; if ( state . failed ) return retval ; if ( state . backtracking == 0 ) { COMMA134_tree = ( Object ) adaptor . create ( COMMA134 ) ; adaptor . addChild ( root_0 , COMMA134_tree ) ; } pushFollow ( FOLLOW_field_options_keyval_in_enum_options2235 ) ; field_options_keyval135 = field_options_keyval ( proto , null , v . field , false ) ; state . _fsp -- ; if ( state . failed ) return retval ; if ( state . backtracking == 0 ) adaptor . addChild ( root_0 , field_options_keyval135 . getTree ( ) ) ; } break ; default : break loop26 ; } } while ( true ) ; RIGHTSQUARE136 = ( Token ) match ( input , RIGHTSQUARE , FOLLOW_RIGHTSQUARE_in_enum_options2240 ) ; if ( state . failed ) return retval ; if ( state . backtracking == 0 ) { RIGHTSQUARE136_tree = ( Object ) adaptor . create ( RIGHTSQUARE136 ) ; adaptor . addChild ( root_0 , RIGHTSQUARE136_tree ) ; } } retval . stop = input . LT ( - 1 ) ; if ( state . backtracking == 0 ) { retval . tree = ( Object ) adaptor . rulePostProcessing ( root_0 ) ; adaptor . setTokenBoundaries ( retval . tree , retval . start , retval . stop ) ; } } catch ( RecognitionException re ) { reportError ( re ) ; recover ( input , re ) ; retval . tree = ( Object ) adaptor . errorNode ( input , retval . start , input . LT ( - 1 ) , re ) ; } finally { } return retval ;
public class Form { /** * Adds an additional item to the value list * @ param key The name of the form element * @ param value The value to store */ public void addValueList ( String key , String value ) { } }
Objects . requireNonNull ( key , Required . KEY . toString ( ) ) ; if ( ! valueMap . containsKey ( key ) ) { List < String > values = new ArrayList < > ( ) ; values . add ( value ) ; valueMap . put ( key , values ) ; } else { List < String > values = valueMap . get ( key ) ; values . add ( value ) ; valueMap . put ( key , values ) ; }
public class WSJdbcPreparedStatement { /** * See JDBC 4.0 JavaDoc API for details . */ public void setNCharacterStream ( int i , Reader x ) throws SQLException { } }
final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "setNCharacterStream #" + i ) ; try { pstmtImpl . setCharacterStream ( i , x ) ; } catch ( SQLException sqlX ) { FFDCFilter . processException ( sqlX , getClass ( ) . getName ( ) + ".setNCharacterStream" , "1499" , this ) ; throw WSJdbcUtil . mapException ( this , sqlX ) ; } catch ( NullPointerException nullX ) { // No FFDC code needed ; we might be closed . throw runtimeXIfNotClosed ( nullX ) ; } catch ( AbstractMethodError methError ) { // No FFDC code needed ; wrong JDBC level . throw AdapterUtil . notSupportedX ( "PreparedStatement.setNCharacterStream" , methError ) ; } catch ( RuntimeException runX ) { FFDCFilter . processException ( runX , getClass ( ) . getName ( ) + ".setNCharacterStream" , "1853" , this ) ; if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "setNCharacterStream" , runX ) ; throw runX ; } catch ( Error err ) { FFDCFilter . processException ( err , getClass ( ) . getName ( ) + ".setNCharacterStream" , "1860" , this ) ; if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "setNCharacterStream" , err ) ; throw err ; }
public class HttpClientMockBuilder { /** * Adds action which returns provided JSON in provided encoding and status 200 . Additionally it sets " Content - type " header to " application / json " . * @ param response JSON to return * @ return response builder */ public HttpClientResponseBuilder doReturnJSON ( String response , Charset charset ) { } }
return responseBuilder . doReturnJSON ( response , charset ) ;
public class UIUtils { /** * Returns the size in pixels of an attribute dimension * @ param context the context to get the resources from * @ param attr is the attribute dimension we want to know the size from * @ return the size in pixels of an attribute dimension */ public static int getThemeAttributeDimensionSize ( Context context , int attr ) { } }
TypedArray a = null ; try { a = context . getTheme ( ) . obtainStyledAttributes ( new int [ ] { attr } ) ; return a . getDimensionPixelSize ( 0 , 0 ) ; } finally { if ( a != null ) { a . recycle ( ) ; } }
public class InternalMailUtil { /** * 编码中文字符 < br > * 编码失败返回原字符串 * @ param text 被编码的文本 * @ param charset 编码 * @ return 编码后的结果 */ public static String encodeText ( String text , Charset charset ) { } }
try { return MimeUtility . encodeText ( text , charset . name ( ) , null ) ; } catch ( UnsupportedEncodingException e ) { // ignore } return text ;
public class OutlierAlgoPanel { /** * This method is called from within the constructor to * initialize the form . * WARNING : Do NOT modify this code . The content of this method is * always regenerated by the Form Editor . */ @ SuppressWarnings ( "unchecked" ) // < editor - fold defaultstate = " collapsed " desc = " Generated Code " > / / GEN - BEGIN : initComponents private void initComponents ( ) { } }
setBorder ( javax . swing . BorderFactory . createTitledBorder ( null , "Cluster Algorithm Setup" , javax . swing . border . TitledBorder . DEFAULT_JUSTIFICATION , javax . swing . border . TitledBorder . DEFAULT_POSITION , new java . awt . Font ( "Tahoma" , 1 , 11 ) ) ) ; // NOI18N setLayout ( new java . awt . GridBagLayout ( ) ) ;
public class CryptoFileSystemUri { /** * visible for testing */ static Path uncCompatibleUriToPath ( URI uri ) { } }
String in = uri . toString ( ) ; Matcher m = UNC_URI_PATTERN . matcher ( in ) ; if ( m . find ( ) && ( m . group ( 1 ) != null || m . group ( 2 ) != null ) ) { // this is an UNC path ! String out = in . substring ( "file:" . length ( ) ) . replace ( '/' , '\\' ) ; return Paths . get ( out ) ; } else { return Paths . get ( uri ) ; }
public class JAXBSerialiser { /** * Deserialise an input and cast to a particular type * @ param clazz * @ param source * @ return */ public < T > T deserialise ( final Class < T > clazz , final InputSource source ) { } }
final Object obj = deserialise ( source ) ; if ( clazz . isInstance ( obj ) ) return clazz . cast ( obj ) ; else throw new JAXBRuntimeException ( "XML deserialised to " + obj . getClass ( ) + ", could not cast to the expected " + clazz ) ;
public class ContextStructurePanel { /** * Save the data from this panel to the provided context . * @ param context the context * @ param updateSiteStructure { @ code true } if the nodes of the context should be restructured , { @ code false } otherwise * @ see Context # restructureSiteTree ( ) */ private void saveToContext ( Context context , boolean updateSiteStructure ) { } }
ParameterParser urlParamParser = context . getUrlParamParser ( ) ; ParameterParser formParamParser = context . getPostParamParser ( ) ; List < String > structParams = new ArrayList < String > ( ) ; List < StructuralNodeModifier > ddns = new ArrayList < StructuralNodeModifier > ( ) ; for ( StructuralNodeModifier snm : this . ddnTableModel . getElements ( ) ) { if ( snm . getType ( ) . equals ( StructuralNodeModifier . Type . StructuralParameter ) ) { structParams . add ( snm . getName ( ) ) ; } else { ddns . add ( snm ) ; } } if ( urlParamParser instanceof StandardParameterParser ) { StandardParameterParser urlStdParamParser = ( StandardParameterParser ) urlParamParser ; urlStdParamParser . setKeyValuePairSeparators ( this . getUrlKvPairSeparators ( ) . getText ( ) ) ; urlStdParamParser . setKeyValueSeparators ( this . getUrlKeyValueSeparators ( ) . getText ( ) ) ; urlStdParamParser . setStructuralParameters ( structParams ) ; context . setUrlParamParser ( urlStdParamParser ) ; urlStdParamParser . setContext ( context ) ; } if ( formParamParser instanceof StandardParameterParser ) { StandardParameterParser formStdParamParser = ( StandardParameterParser ) formParamParser ; formStdParamParser . setKeyValuePairSeparators ( this . getPostKvPairSeparators ( ) . getText ( ) ) ; formStdParamParser . setKeyValueSeparators ( this . getPostKeyValueSeparators ( ) . getText ( ) ) ; context . setPostParamParser ( formStdParamParser ) ; formStdParamParser . setContext ( context ) ; } context . setDataDrivenNodes ( ddns ) ; if ( updateSiteStructure ) { context . restructureSiteTree ( ) ; }
public class ChatChannelManager { /** * Called periodically to check for and close any channels that have been idle too long . */ protected void closeIdleChannels ( ) { } }
long now = System . currentTimeMillis ( ) ; Iterator < Map . Entry < ChatChannel , ChannelInfo > > iter = _channels . entrySet ( ) . iterator ( ) ; while ( iter . hasNext ( ) ) { Map . Entry < ChatChannel , ChannelInfo > entry = iter . next ( ) ; if ( now - entry . getValue ( ) . lastMessage > IDLE_CHANNEL_CLOSE_TIME ) { ( ( CrowdNodeObject ) _peerMan . getNodeObject ( ) ) . removeFromHostedChannels ( entry . getKey ( ) ) ; iter . remove ( ) ; } }
public class CommerceVirtualOrderItemUtil { /** * Returns all the commerce virtual order items where uuid = & # 63 ; and companyId = & # 63 ; . * @ param uuid the uuid * @ param companyId the company ID * @ return the matching commerce virtual order items */ public static List < CommerceVirtualOrderItem > findByUuid_C ( String uuid , long companyId ) { } }
return getPersistence ( ) . findByUuid_C ( uuid , companyId ) ;
public class DescribeReplicationInstanceTaskLogsResult { /** * An array of replication task log metadata . Each member of the array contains the replication task name , ARN , and * task log size ( in bytes ) . * @ param replicationInstanceTaskLogs * An array of replication task log metadata . Each member of the array contains the replication task name , * ARN , and task log size ( in bytes ) . */ public void setReplicationInstanceTaskLogs ( java . util . Collection < ReplicationInstanceTaskLog > replicationInstanceTaskLogs ) { } }
if ( replicationInstanceTaskLogs == null ) { this . replicationInstanceTaskLogs = null ; return ; } this . replicationInstanceTaskLogs = new java . util . ArrayList < ReplicationInstanceTaskLog > ( replicationInstanceTaskLogs ) ;
public class IslamicCalendar { /** * Return the length ( in days ) of the given month . * @ param extendedYear The hijri year * @ param month The hijri month , 0 - based */ @ Override protected int handleGetMonthLength ( int extendedYear , int month ) { } }
int length ; if ( cType == CalculationType . ISLAMIC_CIVIL || cType == CalculationType . ISLAMIC_TBLA || ( cType == CalculationType . ISLAMIC_UMALQURA && ( extendedYear < UMALQURA_YEAR_START || extendedYear > UMALQURA_YEAR_END ) ) ) { length = 29 + ( month + 1 ) % 2 ; if ( month == DHU_AL_HIJJAH && civilLeapYear ( extendedYear ) ) { length ++ ; } } else if ( cType == CalculationType . ISLAMIC ) { month = 12 * ( extendedYear - 1 ) + month ; length = ( int ) ( trueMonthStart ( month + 1 ) - trueMonthStart ( month ) ) ; } else { // cType = = CalculationType . ISLAMIC _ UMALQURA should be true at this point and not null . int idx = ( extendedYear - UMALQURA_YEAR_START ) ; // calculate year offset into bit map array int mask = ( 0x01 << ( 11 - month ) ) ; // set mask for bit corresponding to month if ( ( UMALQURA_MONTHLENGTH [ idx ] & mask ) == 0 ) { length = 29 ; } else { length = 30 ; } } return length ;
public class NetworkClassLoader { /** * Utility function to convert Class - - > byte [ ] < br > * call { @ link ClassLoader # getResource ( String ) } internally to find the class * file and then dump the bytes [ ] * @ param cl The class * @ return Byte representation of the class * @ throws IOException */ public byte [ ] dumpClass ( Class < ? > cl ) throws IOException { } }
// get class fileName // Using File . separatorChar in Windows fails . paths for // Class # getResource ( ) must be forward slashes in order to work // correctly . // See : // https : / / blogs . atlassian . com / 2006/12 / how _ to _ use _ file _ separator _ when / String filename = cl . getName ( ) . replace ( '.' , '/' ) + ".class" ; InputStream in = null ; logger . debug ( "NetworkClassloader dumpClass() :" + cl . getCanonicalName ( ) ) ; try { in = this . getResourceAsStream ( filename ) ; byte [ ] classBytes = IOUtils . toByteArray ( in ) ; return classBytes ; } finally { if ( null != in ) in . close ( ) ; }
public class ZWaveNode { /** * Resets the resend counter and possibly resets the * node stage to DONE when previous initialization was * complete . */ public void resetResendCount ( ) { } }
this . resendCount = 0 ; if ( this . initializationComplete ) this . nodeStage = NodeStage . NODEBUILDINFO_DONE ; this . lastUpdated = Calendar . getInstance ( ) . getTime ( ) ;
public class StandardsSubscriptionMarshaller { /** * Marshall the given parameter object . */ public void marshall ( StandardsSubscription standardsSubscription , ProtocolMarshaller protocolMarshaller ) { } }
if ( standardsSubscription == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( standardsSubscription . getStandardsSubscriptionArn ( ) , STANDARDSSUBSCRIPTIONARN_BINDING ) ; protocolMarshaller . marshall ( standardsSubscription . getStandardsArn ( ) , STANDARDSARN_BINDING ) ; protocolMarshaller . marshall ( standardsSubscription . getStandardsInput ( ) , STANDARDSINPUT_BINDING ) ; protocolMarshaller . marshall ( standardsSubscription . getStandardsStatus ( ) , STANDARDSSTATUS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class PostgisGeoPlugin { /** * 在初始化阶段 , 检查所有字段的JdbcType为OTHER的字段 , 获取其类型名称 ( TYPE _ NAME ) * 根据其类型名称确定其实际的地理信息类型 */ @ Override public void initialized ( IntrospectedTable introspectedTable ) { } }
for ( IntrospectedColumn introspectedColumn : introspectedTable . getAllColumns ( ) ) { if ( introspectedColumn . getJdbcType ( ) == Types . OTHER ) { String typeName = fetchTypeName ( introspectedColumn ) ; // System . out . println ( " postgis type : " + typeName ) ; switch ( typeName . toLowerCase ( ) ) { case "geometry" : { introspectedColumn . setFullyQualifiedJavaType ( new FullyQualifiedJavaType ( "org.geolatte.geom.Geometry" ) ) ; // introspectedColumn . setJdbcTypeName ( typeName . toUpperCase ( ) ) ; break ; } } } }
public class KeenQueryClient { /** * Minimum query with only the required arguments . * Query API info here : https : / / keen . io / docs / api / # minimum * @ param eventCollection The name of the event collection you are analyzing . * @ param targetProperty The name of the property you are analyzing . * @ param timeframe The { @ link RelativeTimeframe } or { @ link AbsoluteTimeframe } . * @ return The minimum query response . * @ throws IOException If there was an error communicating with the server or * an error message received from the server . */ public double minimum ( String eventCollection , String targetProperty , Timeframe timeframe ) throws IOException { } }
Query queryParams = new Query . Builder ( QueryType . MINIMUM ) . withEventCollection ( eventCollection ) . withTargetProperty ( targetProperty ) . withTimeframe ( timeframe ) . build ( ) ; QueryResult result = execute ( queryParams ) ; return queryResultToDouble ( result ) ;
public class CoreAPI { /** * Tells whether or not the given { @ code uri } is valid for the current { @ link Mode } . * The { @ code uri } is not valid if the mode is { @ code safe } or if in { @ code protect } mode is not in scope . * @ param uri the { @ code URI } that will be validated * @ return { @ code true } if the given { @ code uri } is valid , { @ code false } otherwise . */ private static boolean isValidForCurrentMode ( URI uri ) { } }
switch ( Control . getSingleton ( ) . getMode ( ) ) { case safe : return false ; case protect : return Model . getSingleton ( ) . getSession ( ) . isInScope ( uri . toString ( ) ) ; default : return true ; }
public class ASrvDatabase { /** * < p > Evaluate single Float result . < / p > * @ param pQuery Query * @ param pColumnName Column Name * @ return Float result e . g 1.1231 or NULL * @ throws Exception - an exception */ @ Override public final Float evalFloatResult ( final String pQuery , final String pColumnName ) throws Exception { } }
Float result = null ; IRecordSet < RS > recordSet = null ; try { recordSet = retrieveRecords ( pQuery ) ; if ( recordSet . moveToFirst ( ) ) { result = recordSet . getFloat ( pColumnName ) ; } } finally { if ( recordSet != null ) { recordSet . close ( ) ; } } return result ;
public class SettingsUtils { /** * Whether the settings indicate a ES 5.0 . x ( which introduces breaking changes ) or otherwise . * @ deprecated Prefer to use { @ link Settings # getClusterInfoOrThrow ( ) } to check version is on or after 5 . X */ @ Deprecated public static boolean isEs50 ( Settings settings ) { } }
EsMajorVersion version = settings . getInternalVersionOrLatest ( ) ; return version . onOrAfter ( EsMajorVersion . V_5_X ) ;
public class DefaultQueryLogEntryCreator { /** * Write query parameters . * < p > default for prepared : Params : [ ( foo , 100 ) , ( bar , 101 ) ] , * < p > default for callable : Params : [ ( 1 = foo , key = 100 ) , ( 1 = bar , key = 101 ) ] , * @ param sb StringBuilder to write * @ param execInfo execution info * @ param queryInfoList query info list * @ since 1.3.3 */ protected void writeParamsEntry ( StringBuilder sb , ExecutionInfo execInfo , List < QueryInfo > queryInfoList ) { } }
boolean isPrepared = execInfo . getStatementType ( ) == StatementType . PREPARED ; sb . append ( "Params:[" ) ; for ( QueryInfo queryInfo : queryInfoList ) { for ( List < ParameterSetOperation > parameters : queryInfo . getParametersList ( ) ) { SortedMap < String , String > paramMap = getParametersToDisplay ( parameters ) ; // parameters per batch . // for prepared : ( val1 , val2 , . . . ) // for callable : ( key1 = val1 , key2 = val2 , . . . ) if ( isPrepared ) { writeParamsForSinglePreparedEntry ( sb , paramMap , execInfo , queryInfoList ) ; } else { writeParamsForSingleCallableEntry ( sb , paramMap , execInfo , queryInfoList ) ; } } } chompIfEndWith ( sb , ',' ) ; sb . append ( "]" ) ;
public class PermissionAction { /** * 保存模块级权限 */ public String save ( ) { } }
Role role = entityDao . get ( Role . class , getInt ( "role.id" ) ) ; MenuProfile menuProfile = ( MenuProfile ) entityDao . get ( MenuProfile . class , getInt ( "menuProfileId" ) ) ; Set < FuncResource > newResources = CollectUtils . newHashSet ( entityDao . get ( FuncResource . class , Strings . splitToInt ( get ( "resourceId" ) ) ) ) ; // 管理员拥有的菜单权限和系统资源 User manager = userService . get ( SecurityUtils . getUsername ( ) ) ; Set < Menu > mngMenus = null ; Set < Resource > mngResources = CollectUtils . newHashSet ( ) ; if ( isAdmin ( ) ) { mngMenus = CollectUtils . newHashSet ( menuProfile . getMenus ( ) ) ; } else { mngMenus = CollectUtils . newHashSet ( securityHelper . getMenuService ( ) . getMenus ( menuProfile , manager , manager . getProfiles ( ) ) ) ; } for ( final Menu m : mngMenus ) { mngResources . addAll ( m . getResources ( ) ) ; } newResources . retainAll ( mngResources ) ; securityHelper . getFuncPermissionService ( ) . authorize ( role , newResources ) ; authorityManager . refreshRolePermissions ( new GrantedAuthorityBean ( role . getId ( ) ) ) ; Action redirect = Action . to ( this ) . method ( "edit" ) ; redirect . param ( "role.id" , role . getId ( ) ) . param ( "menuProfileId" , menuProfile . getId ( ) ) ; String displayFreezen = get ( "displayFreezen" ) ; if ( null != displayFreezen ) redirect . param ( "displayFreezen" , displayFreezen ) ; return redirect ( redirect , "info.save.success" ) ;
public class OpenSSLFactory { /** * Sets the caRevocationFile . */ public void setCARevocationFile ( Path caRevocationFile ) { } }
try { _caRevocationFile = caRevocationFile . toRealPath ( ) . toString ( ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; }
public class RTMPConnection { /** * When the connection has been closed , notify any remaining pending service calls that they have failed because the connection is * broken . Implementors of IPendingServiceCallback may only deduce from this notification that it was not possible to read a result for * this service call . It is possible that ( 1 ) the service call was never written to the service , or ( 2 ) the service call was written to * the service and although the remote method was invoked , the connection failed before the result could be read , or ( 3 ) although the * remote method was invoked on the service , the service implementor detected the failure of the connection and performed only partial * processing . The caller only knows that it cannot be confirmed that the callee has invoked the service call and returned a result . */ public void sendPendingServiceCallsCloseError ( ) { } }
if ( pendingCalls != null && ! pendingCalls . isEmpty ( ) ) { if ( log . isDebugEnabled ( ) ) { log . debug ( "Connection calls pending: {}" , pendingCalls . size ( ) ) ; } for ( IPendingServiceCall call : pendingCalls . values ( ) ) { call . setStatus ( Call . STATUS_NOT_CONNECTED ) ; for ( IPendingServiceCallback callback : call . getCallbacks ( ) ) { callback . resultReceived ( call ) ; } } }
public class ExtendedPalette { /** * factory method for the remove component * @ return remove component */ protected Component newRemoveComponent ( ) { } }
return new PaletteButton ( "removeButton" ) { private static final long serialVersionUID = 1L ; @ Override protected void onComponentTag ( ComponentTag tag ) { super . onComponentTag ( tag ) ; tag . getAttributes ( ) . put ( "onclick" , getRemoveOnClickJS ( ) ) ; } } ;
public class TimeSeriesWritableUtils { /** * Get the { @ link RecordDetails } * detailing the length of the time series * @ param record the input time series * to get the details for * @ return the record details for the record */ public static RecordDetails getDetails ( List < List < List < Writable > > > record ) { } }
int maxTimeSeriesLength = 0 ; for ( List < List < Writable > > step : record ) { maxTimeSeriesLength = Math . max ( maxTimeSeriesLength , step . size ( ) ) ; } return RecordDetails . builder ( ) . minValues ( record . size ( ) ) . maxTSLength ( maxTimeSeriesLength ) . build ( ) ;
public class GetIndexingConfigurationRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( GetIndexingConfigurationRequest getIndexingConfigurationRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( getIndexingConfigurationRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class ListPoliciesResult { /** * An array of < code > PolicySummary < / code > objects . * @ param policyList * An array of < code > PolicySummary < / code > objects . */ public void setPolicyList ( java . util . Collection < PolicySummary > policyList ) { } }
if ( policyList == null ) { this . policyList = null ; return ; } this . policyList = new java . util . ArrayList < PolicySummary > ( policyList ) ;
public class DistributedWorkManagerImpl { /** * { @ inheritDoc } */ @ Override protected void deltaScheduleWorkRejected ( ) { } }
if ( trace ) log . trace ( "deltaScheduleWorkRejected" ) ; super . deltaScheduleWorkRejected ( ) ; if ( distributedStatisticsEnabled && distributedStatistics != null && transport != null ) { try { checkTransport ( ) ; distributedStatistics . sendDeltaScheduleWorkRejected ( ) ; } catch ( WorkException we ) { log . debugf ( "deltaScheduleWorkRejected: %s" , we . getMessage ( ) , we ) ; } }
public class ServletSecurityElement { /** * Checks for duplicate method names in methodConstraints . * @ param methodConstraints * @ retrun Set of method names * @ throws IllegalArgumentException if duplicate method names are * detected */ private Collection < String > checkMethodNames ( Collection < HttpMethodConstraintElement > methodConstraints ) { } }
Collection < String > methodNames = new HashSet < String > ( ) ; for ( HttpMethodConstraintElement methodConstraint : methodConstraints ) { String methodName = methodConstraint . getMethodName ( ) ; if ( ! methodNames . add ( methodName ) ) { throw new IllegalArgumentException ( "Duplicate HTTP method name: " + methodName ) ; } } return methodNames ;
public class CliOptions { /** * Copies the parsed command line options to the { @ link Config } class * @ param config Configuration instance to override * @ since 2.0 */ static void overloadConfig ( final ArgP argp , final Config config ) { } }
// loop and switch so we can map cli options to tsdb options for ( Map . Entry < String , String > entry : argp . getParsed ( ) . entrySet ( ) ) { // map the overrides if ( entry . getKey ( ) . toLowerCase ( ) . equals ( "--auto-metric" ) ) { config . overrideConfig ( "tsd.core.auto_create_metrics" , "true" ) ; } else if ( entry . getKey ( ) . toLowerCase ( ) . equals ( "--disable-ui" ) ) { config . overrideConfig ( "tsd.core.enable_ui" , "false" ) ; } else if ( entry . getKey ( ) . toLowerCase ( ) . equals ( "--disable-api" ) ) { config . overrideConfig ( "tsd.core.enable_api" , "false" ) ; } else if ( entry . getKey ( ) . toLowerCase ( ) . equals ( "--table" ) ) { config . overrideConfig ( "tsd.storage.hbase.data_table" , entry . getValue ( ) ) ; } else if ( entry . getKey ( ) . toLowerCase ( ) . equals ( "--uidtable" ) ) { config . overrideConfig ( "tsd.storage.hbase.uid_table" , entry . getValue ( ) ) ; } else if ( entry . getKey ( ) . toLowerCase ( ) . equals ( "--zkquorum" ) ) { config . overrideConfig ( "tsd.storage.hbase.zk_quorum" , entry . getValue ( ) ) ; } else if ( entry . getKey ( ) . toLowerCase ( ) . equals ( "--zkbasedir" ) ) { config . overrideConfig ( "tsd.storage.hbase.zk_basedir" , entry . getValue ( ) ) ; } else if ( entry . getKey ( ) . toLowerCase ( ) . equals ( "--port" ) ) { config . overrideConfig ( "tsd.network.port" , entry . getValue ( ) ) ; } else if ( entry . getKey ( ) . toLowerCase ( ) . equals ( "--staticroot" ) ) { config . overrideConfig ( "tsd.http.staticroot" , entry . getValue ( ) ) ; } else if ( entry . getKey ( ) . toLowerCase ( ) . equals ( "--cachedir" ) ) { config . overrideConfig ( "tsd.http.cachedir" , entry . getValue ( ) ) ; } else if ( entry . getKey ( ) . toLowerCase ( ) . equals ( "--flush-interval" ) ) { config . overrideConfig ( "tsd.core.flushinterval" , entry . getValue ( ) ) ; } else if ( entry . getKey ( ) . toLowerCase ( ) . equals ( "--backlog" ) ) { config . overrideConfig ( "tsd.network.backlog" , entry . getValue ( ) ) ; } else if ( entry . getKey ( ) . toLowerCase ( ) . equals ( "--read-only" ) ) { config . overrideConfig ( "tsd.mode" , "ro" ) ; } else if ( entry . getKey ( ) . toLowerCase ( ) . equals ( "--bind" ) ) { config . overrideConfig ( "tsd.network.bind" , entry . getValue ( ) ) ; } else if ( entry . getKey ( ) . toLowerCase ( ) . equals ( "--async-io" ) ) { config . overrideConfig ( "tsd.network.async_io" , entry . getValue ( ) ) ; } else if ( entry . getKey ( ) . toLowerCase ( ) . equals ( "--worker-threads" ) ) { config . overrideConfig ( "tsd.network.worker_threads" , entry . getValue ( ) ) ; } else if ( entry . getKey ( ) . toLowerCase ( ) . equals ( "--use-otsdb-ts" ) ) { config . overrideConfig ( "tsd.storage.use_otsdb_timestamp" , "true" ) ; } else if ( entry . getKey ( ) . toLowerCase ( ) . equals ( "--dtc-ts" ) ) { config . overrideConfig ( "tsd.storage.get_date_tiered_compaction_start" , entry . getValue ( ) ) ; } }
public class VecmathUtil { /** * Average a collection of vectors . * @ param vectors one or more vectors * @ return average vector */ static Vector2d average ( final Collection < Vector2d > vectors ) { } }
final Vector2d average = new Vector2d ( 0 , 0 ) ; for ( final Vector2d vector : vectors ) { average . add ( vector ) ; } average . scale ( 1d / vectors . size ( ) ) ; return average ;
public class RedoLog { /** * Clears the redo log . * @ throws IOException if the redo log cannot be cleared . */ synchronized void clear ( ) throws IOException { } }
if ( out != null ) { out . close ( ) ; out = null ; } try { if ( dir . fileExists ( REDO_LOG ) ) { dir . deleteFile ( REDO_LOG ) ; } } catch ( IOException e ) { log . error ( e . getLocalizedMessage ( ) , e ) ; throw e ; } entryCount = 0 ;
public class AmazonChimeClient { /** * Associates a phone number with the specified Amazon Chime Voice Connector . * @ param associatePhoneNumbersWithVoiceConnectorRequest * @ return Result of the AssociatePhoneNumbersWithVoiceConnector operation returned by the service . * @ throws UnauthorizedClientException * The client is not currently authorized to make the request . * @ throws NotFoundException * One or more of the resources in the request does not exist in the system . * @ throws ForbiddenException * The client is permanently forbidden from making the request . For example , when a user tries to create an * account from an unsupported region . * @ throws BadRequestException * The input parameters don ' t match the service ' s restrictions . * @ throws ThrottledClientException * The client exceeded its request rate limit . * @ throws ServiceUnavailableException * The service is currently unavailable . * @ throws ServiceFailureException * The service encountered an unexpected error . * @ sample AmazonChime . AssociatePhoneNumbersWithVoiceConnector * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / chime - 2018-05-01 / AssociatePhoneNumbersWithVoiceConnector " * target = " _ top " > AWS API Documentation < / a > */ @ Override public AssociatePhoneNumbersWithVoiceConnectorResult associatePhoneNumbersWithVoiceConnector ( AssociatePhoneNumbersWithVoiceConnectorRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeAssociatePhoneNumbersWithVoiceConnector ( request ) ;
public class AuditLogConvention { /** * Is this entity the ' audit log ' entity ? */ private AuditLogAttribute attributes ( Entity e ) { } }
AuditLogAttribute auditLogAttributes = new AuditLogAttribute ( ) ; matchAuthor ( e , auditLogAttributes ) ; matchEvent ( e , auditLogAttributes ) ; matchEventDate ( e , auditLogAttributes ) ; matchStringAttribute1 ( e , auditLogAttributes ) ; matchStringAttribute2 ( e , auditLogAttributes ) ; matchStringAttribute3 ( e , auditLogAttributes ) ; return auditLogAttributes ;
public class BaseMessageRecordDesc { /** * This utility sets this field to the param ' s raw data . */ public int getRawFieldData ( Convert field ) { } }
String strKey = this . getFullKey ( field . getFieldName ( ) ) ; Class < ? > classData = field . getField ( ) . getDataClass ( ) ; Object objValue = this . getMessage ( ) . getNative ( strKey ) ; try { objValue = DataConverters . convertObjectToDatatype ( objValue , classData , null ) ; // I do this just to be careful . } catch ( Exception ex ) { objValue = null ; } return field . setData ( objValue ) ;
public class MappedBuffer { /** * Allocates a fixed capacity mapped buffer in the given { @ link FileChannel . MapMode } . * Memory will be mapped by opening and expanding the given { @ link File } to the desired { @ code capacity } and mapping the * file contents into memory via { @ link FileChannel # map ( FileChannel . MapMode , long , long ) } . * The resulting buffer will have a capacity of { @ code capacity } . The underlying { @ link MappedBytes } will be * initialized to the next power of { @ code 2 } . * @ param file The file to map into memory . * @ param mode The mode with which to map the file . * @ param capacity The fixed capacity of the buffer to allocate ( in bytes ) . * @ return The mapped buffer . * @ throws NullPointerException If { @ code file } is { @ code null } * @ throws IllegalArgumentException If the { @ code capacity } is greater than { @ link Integer # MAX _ VALUE } . * @ see # allocate ( File ) * @ see # allocate ( File , FileChannel . MapMode ) * @ see # allocate ( File , int ) * @ see # allocate ( File , int , int ) * @ see # allocate ( File , FileChannel . MapMode , int , int ) */ public static MappedBuffer allocate ( File file , FileChannel . MapMode mode , int capacity ) { } }
return allocate ( file , mode , capacity , capacity ) ;
public class QueryParserKraken { /** * Parses a + / - expression . */ private ExprKraken parseOrExpr ( ) { } }
ExprKraken left = parseAndExpr ( ) ; while ( true ) { Token token = scanToken ( ) ; switch ( token ) { case OR : left = new BinaryExpr ( BinaryOp . OR , left , parseAndExpr ( ) ) ; break ; default : _token = token ; return left ; } }
public class XmlTransformer { /** * Transforms the source XML to the result . * If no stylesheet was specified , the result is * identical with the source . * @ param source * the XML input to transform . * @ param result * the result of transforming the source . * @ throws XmlException * if the transformation fails . */ public void transform ( final Source source , final Result result ) { } }
Transformer transformer = _newTransformer ( ) ; // throws XmlException try { transformer . transform ( source , result ) ; // throws TransformerException } catch ( Exception ex ) { throw new XmlException ( ex ) ; }
public class Caster { /** * cast a Object to a DateTime Object * @ param str String to cast * @ param alsoNumbers define if also numbers will casted to a datetime value * @ param tz * @ param defaultValue * @ return casted DateTime Object */ public static DateTime toDate ( String str , boolean alsoNumbers , TimeZone tz , DateTime defaultValue ) { } }
return DateCaster . toDateAdvanced ( str , alsoNumbers ? DateCaster . CONVERTING_TYPE_OFFSET : DateCaster . CONVERTING_TYPE_NONE , tz , defaultValue ) ;
public class PushSelectCriteria { /** * Determine whether all of the nodes between the criteria node and its originating node are criteria ( SELECT ) nodes . * @ param criteriaNode the criteria node ; may not be null * @ param originatingNode the originating node * @ return true if all nodes between the criteria and originating nodes are SELECT nodes */ protected boolean atBoundary ( PlanNode criteriaNode , PlanNode originatingNode ) { } }
// Walk from source node to critNode to check each intervening node PlanNode currentNode = originatingNode . getParent ( ) ; while ( currentNode != criteriaNode ) { if ( currentNode . getType ( ) != Type . SELECT ) return false ; currentNode = currentNode . getParent ( ) ; } return true ;
public class WRadioButtonInRepeater { /** * { @ inheritDoc } */ @ Override protected void preparePaintComponent ( final Request request ) { } }
if ( ! isInitialised ( ) ) { repeater . setData ( Arrays . asList ( new String [ ] { "A" , "B" , "C" } ) ) ; setInitialised ( true ) ; } text . setText ( "Selected: " + ( group . getSelectedValue ( ) == null ? "" : group . getSelectedValue ( ) . toString ( ) ) ) ;
public class AbstractDecimal { /** * This method calculates the mod between to T values by first casting to * doubles and then by performing the % operation on the two primitives . * @ param modulus * The other value to apply the mod to . * @ return result of performing the mod calculation * @ throws IllegalArgumentException if the given modulus is null */ public T mod ( T modulus ) { } }
if ( modulus == null ) { throw new IllegalArgumentException ( "invalid (null) modulus" ) ; } double difference = this . value . doubleValue ( ) % modulus . doubleValue ( ) ; return newInstance ( BigDecimal . valueOf ( difference ) , this . value . scale ( ) ) ;
public class KeyVaultClientCustomImpl { /** * Gets information about a specified certificate . * @ param certificateIdentifier * The certificate identifier * @ param serviceCallback * the async ServiceCallback to handle successful and failed * responses . * @ return the { @ link ServiceFuture } object */ public ServiceFuture < CertificateBundle > getCertificateAsync ( String certificateIdentifier , final ServiceCallback < CertificateBundle > serviceCallback ) { } }
CertificateIdentifier id = new CertificateIdentifier ( certificateIdentifier ) ; return getCertificateAsync ( id . vault ( ) , id . name ( ) , id . version ( ) == null ? "" : id . version ( ) , serviceCallback ) ;
public class JSONArray { /** * Get the double value associated with an index . * @ param index * The index must be between 0 and length ( ) - 1. * @ return The value . * @ throws JSONException * If the key is not found or if the value cannot be converted to a number . */ public double getDouble ( int index ) throws JSONException { } }
Object o = get ( index ) ; try { return o instanceof Number ? ( ( Number ) o ) . doubleValue ( ) : Double . valueOf ( ( String ) o ) . doubleValue ( ) ; } catch ( Exception e ) { throw new JSONException ( "JSONArray[" + index + "] is not a number." ) ; }
public class PathTemplate { /** * Returns a template where all variable bindings have been replaced by wildcards , but which is * equivalent regards matching to this one . */ public PathTemplate withoutVars ( ) { } }
StringBuilder result = new StringBuilder ( ) ; ListIterator < Segment > iterator = segments . listIterator ( ) ; boolean start = true ; while ( iterator . hasNext ( ) ) { Segment seg = iterator . next ( ) ; switch ( seg . kind ( ) ) { case BINDING : case END_BINDING : break ; default : if ( ! start ) { result . append ( seg . separator ( ) ) ; } else { start = false ; } result . append ( seg . value ( ) ) ; } } return create ( result . toString ( ) , urlEncoding ) ;
public class NavigationViewModel { /** * Used to update an existing { @ link FeedbackItem } * with a feedback type and description . * Uses cached feedbackId to ensure the proper item is updated . * @ param feedbackItem item to be updated * @ since 0.7.0 */ public void updateFeedback ( FeedbackItem feedbackItem ) { } }
if ( ! TextUtils . isEmpty ( feedbackId ) ) { navigation . updateFeedback ( feedbackId , feedbackItem . getFeedbackType ( ) , feedbackItem . getDescription ( ) , screenshot ) ; sendEventFeedback ( feedbackItem ) ; feedbackId = null ; screenshot = null ; }
public class AbstractInterpolation { /** * Given a value x , return a value j such that x is ( insofar as possible ) * centered in the subrange xx [ j . . j + m - 1 ] , where xx is the stored data . The * returned value is not less than 0 , nor greater than n - 1 , where n is the * length of xx . */ private int locate ( double x ) { } }
int ju , jm , jl ; boolean ascnd = ( xx [ n - 1 ] >= xx [ 0 ] ) ; jl = 0 ; ju = n - 1 ; while ( ju - jl > 1 ) { jm = ( ju + jl ) >> 1 ; if ( x >= xx [ jm ] == ascnd ) { jl = jm ; } else { ju = jm ; } } cor = Math . abs ( jl - jsav ) <= dj ; jsav = jl ; return Math . max ( 0 , Math . min ( n - 2 , jl ) ) ;
public class AvroDriverInfoSerializer { /** * Build AvroDriverInfo object . */ @ Override public AvroDriverInfo toAvro ( final String id , final String startTime , final List < AvroReefServiceInfo > services ) { } }
return AvroDriverInfo . newBuilder ( ) . setRemoteId ( id ) . setStartTime ( startTime ) . setServices ( services ) . build ( ) ;
public class KeyArea { /** * Any of these key fields modified ? * @ param iAreaDesc The key field area to get the values from . * @ param iStartKeyFieldSeq The starting key field to check ( from here on ) . * @ return true if any have been modified . */ public int lastModified ( int iAreaDesc , boolean bForceUniqueKey ) { } }
// Set up the end key int iLastKeyField = this . getKeyFields ( bForceUniqueKey , false ) - 1 ; for ( int iKeyFieldSeq = iLastKeyField ; iKeyFieldSeq >= DBConstants . MAIN_KEY_FIELD ; iKeyFieldSeq -- ) { KeyField keyField = this . getKeyField ( iKeyFieldSeq , bForceUniqueKey ) ; if ( keyField . getField ( iAreaDesc ) . isModified ( ) ) return iKeyFieldSeq ; } return - 1 ;
public class AbstractChunkTopicParser { /** * Generate output file . * @ return absolute temporary file */ URI generateOutputFile ( final URI ref ) { } }
final FileInfo srcFi = job . getFileInfo ( ref ) ; final URI newSrc = srcFi . src . resolve ( generateFilename ( ) ) ; final URI tmp = tempFileNameScheme . generateTempFileName ( newSrc ) ; if ( job . getFileInfo ( tmp ) == null ) { job . add ( new FileInfo . Builder ( ) . result ( newSrc ) . uri ( tmp ) . build ( ) ) ; } return job . tempDirURI . resolve ( tmp ) ;
public class FbBot { /** * This method gets invoked when a user clicks on the " Get Started " button or just when someone simply types * hi , hello or hey . When it is the former , the event type is { @ code EventType . POSTBACK } with the payload " hi " * and when latter , the event type is { @ code EventType . MESSAGE } . * @ param event */ @ Controller ( events = { } }
EventType . MESSAGE , EventType . POSTBACK } , pattern = "^(?i)(hi|hello|hey)$" ) public void onGetStarted ( Event event ) { // quick reply buttons Button [ ] quickReplies = new Button [ ] { new Button ( ) . setContentType ( "text" ) . setTitle ( "Sure" ) . setPayload ( "yes" ) , new Button ( ) . setContentType ( "text" ) . setTitle ( "Nope" ) . setPayload ( "no" ) } ; reply ( event , new Message ( ) . setText ( "Hello, I am JBot. Would you like to see more?" ) . setQuickReplies ( quickReplies ) ) ;
public class CmsEditSiteForm { /** * Checks if all required fields are set correctly at first Tab . < p > * @ return true if all inputs are valid . */ boolean isValidInputSimple ( ) { } }
return ( m_simpleFieldFolderName . isValid ( ) & m_simpleFieldServer . isValid ( ) & m_simpleFieldTitle . isValid ( ) & m_simpleFieldParentFolderName . isValid ( ) & m_fieldSelectOU . isValid ( ) & m_simpleFieldSiteRoot . isValid ( ) ) ;
public class AntClassLoader { /** * Finds the resource with the given name . A resource is * some data ( images , audio , text , etc ) that can be accessed by class * code in a way that is independent of the location of the code . * @ param name The name of the resource for which a stream is required . * Must not be < code > null < / code > . * @ return a URL for reading the resource , or < code > null < / code > if the * resource could not be found or the caller doesn ' t have * adequate privileges to get the resource . */ public URL getResource ( String name ) { } }
// we need to search the components of the path to see if // we can find the class we want . URL url = null ; if ( isParentFirst ( name ) ) { url = parent == null ? super . getResource ( name ) : parent . getResource ( name ) ; } if ( url != null ) { log ( "Resource " + name + " loaded from parent loader" , Project . MSG_DEBUG ) ; } else { // try and load from this loader if the parent either didn ' t find // it or wasn ' t consulted . Enumeration e = pathComponents . elements ( ) ; while ( e . hasMoreElements ( ) && url == null ) { File pathComponent = ( File ) e . nextElement ( ) ; url = getResourceURL ( pathComponent , name ) ; if ( url != null ) { log ( "Resource " + name + " loaded from ant loader" , Project . MSG_DEBUG ) ; } } } if ( url == null && ! isParentFirst ( name ) ) { // this loader was first but it didn ' t find it - try the parent if ( ignoreBase ) { url = getRootLoader ( ) == null ? null : getRootLoader ( ) . getResource ( name ) ; } else { url = parent == null ? super . getResource ( name ) : parent . getResource ( name ) ; } if ( url != null ) { log ( "Resource " + name + " loaded from parent loader" , Project . MSG_DEBUG ) ; } } if ( url == null ) { log ( "Couldn't load Resource " + name , Project . MSG_DEBUG ) ; } return url ;
public class PvmExecutionImpl { /** * Dispatches the delayed variable event , if the target scope and replaced by scope ( if target scope was replaced ) have the * same activity Id ' s and activity instance id ' s . * @ param targetScope the target scope on which the event should be dispatched * @ param replacedBy the replaced by pointer which should have the same state * @ param activityIds the map which maps scope to activity id * @ param activityInstanceIds the map which maps scope to activity instance id * @ param delayedVariableEvent the delayed variable event which should be dispatched */ private void dispatchOnSameActivity ( PvmExecutionImpl targetScope , PvmExecutionImpl replacedBy , Map < PvmExecutionImpl , String > activityIds , Map < PvmExecutionImpl , String > activityInstanceIds , DelayedVariableEvent delayedVariableEvent ) { } }
// check if the target scope has the same activity id and activity instance id // since the dispatching was started String currentActivityInstanceId = getActivityInstanceId ( targetScope ) ; String currentActivityId = targetScope . getActivityId ( ) ; final String lastActivityInstanceId = activityInstanceIds . get ( targetScope ) ; final String lastActivityId = activityIds . get ( targetScope ) ; boolean onSameAct = isOnSameActivity ( lastActivityInstanceId , lastActivityId , currentActivityInstanceId , currentActivityId ) ; // If not we have to check the replace pointer , // which was set if a concurrent execution was created during the dispatching . if ( targetScope != replacedBy && ! onSameAct ) { currentActivityInstanceId = getActivityInstanceId ( replacedBy ) ; currentActivityId = replacedBy . getActivityId ( ) ; onSameAct = isOnSameActivity ( lastActivityInstanceId , lastActivityId , currentActivityInstanceId , currentActivityId ) ; } // dispatching if ( onSameAct && isOnDispatchableState ( targetScope ) ) { targetScope . dispatchEvent ( delayedVariableEvent . getEvent ( ) ) ; }
public class InputsInner { /** * Creates an input or replaces an already existing input under an existing streaming job . * @ param resourceGroupName The name of the resource group that contains the resource . You can obtain this value from the Azure Resource Manager API or the portal . * @ param jobName The name of the streaming job . * @ param inputName The name of the input . * @ param input The definition of the input that will be used to create a new input or replace the existing one under the streaming job . * @ param ifMatch The ETag of the input . Omit this value to always overwrite the current input . Specify the last - seen ETag value to prevent accidentally overwritting concurrent changes . * @ param ifNoneMatch Set to ' * ' to allow a new input to be created , but to prevent updating an existing input . Other values will result in a 412 Pre - condition Failed response . * @ param serviceCallback the async ServiceCallback to handle successful and failed responses . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the { @ link ServiceFuture } object */ public ServiceFuture < InputInner > createOrReplaceAsync ( String resourceGroupName , String jobName , String inputName , InputInner input , String ifMatch , String ifNoneMatch , final ServiceCallback < InputInner > serviceCallback ) { } }
return ServiceFuture . fromHeaderResponse ( createOrReplaceWithServiceResponseAsync ( resourceGroupName , jobName , inputName , input , ifMatch , ifNoneMatch ) , serviceCallback ) ;
public class StorePackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getServiceParameter ( ) { } }
if ( serviceParameterEClass == null ) { serviceParameterEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( StorePackage . eNS_URI ) . getEClassifiers ( ) . get ( 65 ) ; } return serviceParameterEClass ;
public class PrimitiveUtils { /** * Write character . * @ param value the value * @ return the string */ public static String writeCharacter ( Character value ) { } }
if ( value == null ) return null ; return Integer . toString ( ( int ) value ) ;
public class StreamResponse { @ Override public StreamResponse header ( String name , String ... values ) { } }
assertArgumentNotNull ( "name" , name ) ; assertArgumentNotNull ( "values" , values ) ; assertDefinedState ( "header" ) ; if ( headerMap . containsKey ( name ) ) { throw new IllegalStateException ( "Already exists the header: name=" + name + " existing=" + headerMap ) ; } headerMap . put ( name , values ) ; return this ;
public class LinkBehavior { /** * { @ inheritDoc } */ @ Override public void onComponentTag ( final Component component , final ComponentTag tag ) { } }
tag . put ( "onmouseover" , "this.style.backgroundColor = '" + onmouseoverColor + "';this.style.cursor = 'pointer';" ) ; tag . put ( "onmouseout" , "this.style.backgroundColor = '" + onmouseoutColor + "';this.style.cursor ='default';" ) ; tag . put ( "onclick" , "document.location.href = '" + absolutePath + "';" ) ;
public class DataPipeline { /** * Gets multiple data elements from the { @ link com . merakianalytics . datapipelines . DataPipeline } * @ param < T > * the type of the data that should be retrieved * @ param type * the type of the data that should be retrieved * @ param query * a query specifying the details of what data should fulfill this request * @ param streaming * whether to stream the results . If streaming is enabled , results from the { @ link com . merakianalytics . datapipelines . sources . DataSource } will be * converted and provided to the { @ link com . merakianalytics . datapipelines . sinks . DataSink } s one - by - one as they are requested from the * { @ link com . merakianalytics . datapipelines . iterators . CloseableIterator } instead of converting and storing them all at once . * @ return a { @ link com . merakianalytics . datapipelines . iterators . CloseableIterator } of the request type if the query had a result , or null */ @ SuppressWarnings ( "unchecked" ) // Pipeline ensures the proper type will be returned from getMany public < T > CloseableIterator < T > getMany ( final Class < T > type , final Map < String , Object > query , final boolean streaming ) { } }
final List < SourceHandler < ? , ? > > handlers = getSourceHandlers ( type ) ; if ( handlers . isEmpty ( ) ) { return null ; } final PipelineContext context = newContext ( ) ; for ( final SourceHandler < ? , ? > handler : handlers ) { final CloseableIterator < T > result = ( CloseableIterator < T > ) handler . getMany ( query , context , streaming ) ; if ( result != null ) { return result ; } } return null ;
public class StaticCATConsumer { /** * Stop the Synchronous Consumer Session provided by the client . * Fields : * BIT16 ConnectionObjectId * BIT16 SyncConsumerSessionId * Note : The client reply is done by the CAT consumer instance * @ param request * @ param conversation * @ param requestNumber * @ param allocatedFromBufferPool * @ param partOfExchange */ static void rcvStopSess ( CommsByteBuffer request , Conversation conversation , int requestNumber , boolean allocatedFromBufferPool , boolean partOfExchange ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "rcvStopSess" , new Object [ ] { request , conversation , "" + requestNumber , "" + allocatedFromBufferPool } ) ; short connectionObjectID = request . getShort ( ) ; // BIT16 ConnectionObjectId short consumerObjectID = request . getShort ( ) ; // BIT16 SyncConsumerSessionId if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { SibTr . debug ( tc , "connectionObjectID" , connectionObjectID ) ; SibTr . debug ( tc , "consumerObjectID" , consumerObjectID ) ; } CATMainConsumer mainConsumer = ( ( CATMainConsumer ) ( ( ConversationState ) conversation . getAttachment ( ) ) . getObject ( consumerObjectID ) ) ; mainConsumer . stop ( requestNumber ) ; request . release ( allocatedFromBufferPool ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "rcvStopSess" ) ;
public class Configuration { /** * Fallback to clear text passwords in configuration . * @ param name * @ return clear text password or null */ protected char [ ] getPasswordFromConfig ( String name ) { } }
char [ ] pass = null ; if ( getBoolean ( CredentialProvider . CLEAR_TEXT_FALLBACK , true ) ) { String passStr = get ( name ) ; if ( passStr != null ) { pass = passStr . toCharArray ( ) ; } } return pass ;
public class ClipBuffer { /** * Instructs this buffer to resolve its underlying clip and be ready * to be played ASAP . */ public void resolve ( Observer observer ) { } }
// if we were waiting to unload , cancel that if ( _state == UNLOADING ) { _state = LOADED ; _manager . restoreClip ( this ) ; } // if we ' re already loaded , this is easy if ( _state == LOADED ) { if ( observer != null ) { observer . clipLoaded ( this ) ; } return ; } // queue up the observer if ( observer != null ) { _observers . add ( observer ) ; } // if we ' re already loading , we can stop here if ( _state == LOADING ) { return ; } // create our OpenAL buffer and then queue ourselves up to have // our clip data loaded AL10 . alGetError ( ) ; // throw away any unchecked error prior to an op we want to check _buffer = new Buffer ( _manager ) ; int errno = AL10 . alGetError ( ) ; if ( errno != AL10 . AL_NO_ERROR ) { log . warning ( "Failed to create buffer [key=" + getKey ( ) + ", errno=" + errno + "]." ) ; _buffer = null ; // queue up a failure notification so that we properly return // from this method and our sound has a chance to register // itself as an observer before we jump up and declare failure _manager . queueClipFailure ( this ) ; } else { _state = LOADING ; _manager . queueClipLoad ( this ) ; }
public class ImmatureClass { /** * determines if class has a runtime annotation . If it does it is likely to be a * singleton , or handled specially where hashCode / equals isn ' t of importance . * @ param cls the class to check * @ return if runtime annotations are found */ private static boolean classHasRuntimeVisibleAnnotation ( JavaClass cls ) { } }
AnnotationEntry [ ] annotations = cls . getAnnotationEntries ( ) ; if ( annotations != null ) { for ( AnnotationEntry annotation : annotations ) { if ( annotation . isRuntimeVisible ( ) ) { return true ; } } } return false ;
public class VisualRecognition { /** * Retrieve classifier details . * Retrieve information about a custom classifier . * @ param getClassifierOptions the { @ link GetClassifierOptions } containing the options for the call * @ return a { @ link ServiceCall } with a response type of { @ link Classifier } */ public ServiceCall < Classifier > getClassifier ( GetClassifierOptions getClassifierOptions ) { } }
Validator . notNull ( getClassifierOptions , "getClassifierOptions cannot be null" ) ; String [ ] pathSegments = { "v3/classifiers" } ; String [ ] pathParameters = { getClassifierOptions . classifierId ( ) } ; RequestBuilder builder = RequestBuilder . get ( RequestBuilder . constructHttpUrl ( getEndPoint ( ) , pathSegments , pathParameters ) ) ; builder . query ( "version" , versionDate ) ; Map < String , String > sdkHeaders = SdkCommon . getSdkHeaders ( "watson_vision_combined" , "v3" , "getClassifier" ) ; for ( Entry < String , String > header : sdkHeaders . entrySet ( ) ) { builder . header ( header . getKey ( ) , header . getValue ( ) ) ; } builder . header ( "Accept" , "application/json" ) ; return createServiceCall ( builder . build ( ) , ResponseConverterUtils . getObject ( Classifier . class ) ) ;
public class LBiObjSrtConsumerBuilder { /** * One of ways of creating builder . This might be the only way ( considering all _ functional _ builders ) that might be utilize to specify generic params only once . */ @ Nonnull public static < T1 , T2 > LBiObjSrtConsumerBuilder < T1 , T2 > biObjSrtConsumer ( Consumer < LBiObjSrtConsumer < T1 , T2 > > consumer ) { } }
return new LBiObjSrtConsumerBuilder ( consumer ) ;
public class CommerceAvailabilityEstimateUtil { /** * Returns the first commerce availability estimate in the ordered set where groupId = & # 63 ; . * @ param groupId the group ID * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) * @ return the first matching commerce availability estimate , or < code > null < / code > if a matching commerce availability estimate could not be found */ public static CommerceAvailabilityEstimate fetchByGroupId_First ( long groupId , OrderByComparator < CommerceAvailabilityEstimate > orderByComparator ) { } }
return getPersistence ( ) . fetchByGroupId_First ( groupId , orderByComparator ) ;
public class GBSIterator { /** * Optimistically find the next key in the index after an eof condition . */ private boolean optimisticSearchNext ( DeleteStack stack ) { } }
int v1 = _index . vno ( ) ; int x1 = _index . xno ( ) ; if ( ( v1 & 1 ) != 0 ) return pessimisticNeeded ; synchronized ( this ) { } try { internalSearchNext ( stack , v1 , x1 ) ; } catch ( NullPointerException npe ) { // No FFDC Code Needed . _nullPointerExceptions ++ ; return GBSTree . checkForPossibleIndexChange ( v1 , _index . vno ( ) , npe , "optimisticSearchNext" ) ; } catch ( OptimisticDepthException ode ) { // No FFDC Code Needed . _optimisticDepthExceptions ++ ; return GBSTree . checkForPossibleIndexChange ( v1 , _index . vno ( ) , ode , "optimisticSearchNext" ) ; } if ( v1 != _index . vno ( ) ) { _current1 . setVersion ( 1 ) ; return pessimisticNeeded ; } _optimisticSearchNexts ++ ; return optimisticWorked ;
public class DcerpcHandle { /** * Bind the handle * @ throws DcerpcException * @ throws IOException */ public void bind ( ) throws DcerpcException , IOException { } }
synchronized ( this ) { try { this . state = 1 ; DcerpcMessage bind = new DcerpcBind ( this . binding , this ) ; sendrecv ( bind ) ; } catch ( IOException ioe ) { this . state = 0 ; throw ioe ; } }
public class MessageFieldUtil { /** * Returns a java field default value for proto field . */ public static String getDefaultValue ( Field field ) { } }
FieldType type = field . getType ( ) ; if ( type instanceof ScalarFieldType ) { return ScalarFieldTypeUtil . getDefaultValue ( ( ScalarFieldType ) type ) ; } if ( type instanceof Message ) { Message m = ( Message ) type ; return UserTypeUtil . getCanonicalName ( m ) + ".getDefaultInstance()" ; } if ( type instanceof Enum ) { Enum anEnum = ( Enum ) type ; String defaultValue ; List < EnumConstant > constants = anEnum . getConstants ( ) ; if ( constants . isEmpty ( ) ) { defaultValue = "UNRECOGNIZED" ; } else { DynamicMessage options = field . getOptions ( ) ; defaultValue = options . containsKey ( DEFAULT ) ? options . get ( DEFAULT ) . getEnumName ( ) : constants . get ( 0 ) . getName ( ) ; } return UserTypeUtil . getCanonicalName ( anEnum ) + "." + defaultValue ; } throw new IllegalArgumentException ( String . valueOf ( type ) ) ;
public class BaseApplet { /** * Get the application session that goes with this task ( applet ) . * @ return The application parent . */ @ Override public Application getApplication ( ) { } }
if ( m_application != null ) return m_application ; if ( this . getApplet ( ) != null ) if ( this . getApplet ( ) != this ) return ( ( BaseApplet ) this . getApplet ( ) ) . getApplication ( ) ; return null ;
public class DispatcherServlet { /** * HTTP PUT routing . * @ param uriTemplate the specified request URI template * @ param handler the specified handler * @ return router */ public static Router put ( final String uriTemplate , final ContextHandler handler ) { } }
return route ( ) . put ( uriTemplate , handler ) ;
public class MaterialCameraCapture { /** * Native call to the streams API */ protected void nativePlay ( Element video ) { } }
MediaStream stream = null ; if ( Navigator . getUserMedia != null ) { stream = Navigator . getUserMedia ; GWT . log ( "Uses Default user Media" ) ; } else if ( Navigator . webkitGetUserMedia != null ) { stream = Navigator . webkitGetUserMedia ; GWT . log ( "Uses Webkit User Media" ) ; } else if ( Navigator . mozGetUserMedia != null ) { stream = Navigator . mozGetUserMedia ; GWT . log ( "Uses Moz User Media" ) ; } else if ( Navigator . msGetUserMedia != null ) { stream = Navigator . msGetUserMedia ; GWT . log ( "Uses Microsoft user Media" ) ; } else { GWT . log ( "No supported media found in your browser" ) ; } if ( stream != null ) { Navigator . getMedia = stream ; Constraints constraints = new Constraints ( ) ; constraints . audio = false ; MediaTrackConstraints mediaTrackConstraints = new MediaTrackConstraints ( ) ; mediaTrackConstraints . width = width ; mediaTrackConstraints . height = height ; mediaTrackConstraints . facingMode = facingMode . getName ( ) ; constraints . video = mediaTrackConstraints ; Navigator . mediaDevices . getUserMedia ( constraints ) . then ( streamObj -> { mediaStream = ( MediaStream ) streamObj ; if ( URL . createObjectURL ( mediaStream ) != null ) { $ ( video ) . attr ( "src" , URL . createObjectURL ( mediaStream ) ) ; } else if ( WebkitURL . createObjectURL ( mediaStream ) != null ) { $ ( video ) . attr ( "src" , WebkitURL . createObjectURL ( mediaStream ) ) ; } if ( video instanceof VideoElement ) { ( ( VideoElement ) video ) . play ( ) ; } onCameraCaptureLoad ( ) ; return null ; } ) . catchException ( error -> { GWT . log ( "MaterialCameraCapture: An error occured! " + error ) ; onCameraCaptureError ( error . toString ( ) ) ; return null ; } ) ; }
public class SeverityClassificationPulldownAction { /** * ( non - Javadoc ) * @ see * org . eclipse . ui . IActionDelegate # selectionChanged ( org . eclipse . jface . action * . IAction , org . eclipse . jface . viewers . ISelection ) */ @ Override public void selectionChanged ( IAction action , ISelection selection ) { } }
bugInstance = null ; // TODO learn to deal with ALL elements IMarker marker = MarkerUtil . getMarkerFromSingleSelection ( selection ) ; if ( marker == null ) { return ; } bugInstance = MarkerUtil . findBugInstanceForMarker ( marker ) ;
public class ApplicationsResponseMarshaller { /** * Marshall the given parameter object . */ public void marshall ( ApplicationsResponse applicationsResponse , ProtocolMarshaller protocolMarshaller ) { } }
if ( applicationsResponse == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( applicationsResponse . getItem ( ) , ITEM_BINDING ) ; protocolMarshaller . marshall ( applicationsResponse . getNextToken ( ) , NEXTTOKEN_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class DescribeInstanceStatusResult { /** * Information about the status of the instances . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setInstanceStatuses ( java . util . Collection ) } or { @ link # withInstanceStatuses ( java . util . Collection ) } if you * want to override the existing values . * @ param instanceStatuses * Information about the status of the instances . * @ return Returns a reference to this object so that method calls can be chained together . */ public DescribeInstanceStatusResult withInstanceStatuses ( InstanceStatus ... instanceStatuses ) { } }
if ( this . instanceStatuses == null ) { setInstanceStatuses ( new com . amazonaws . internal . SdkInternalList < InstanceStatus > ( instanceStatuses . length ) ) ; } for ( InstanceStatus ele : instanceStatuses ) { this . instanceStatuses . add ( ele ) ; } return this ;
public class Utilities { /** * Returns a string made up of repetitions of the specified string . */ public static String repeatString ( String pattern , int repeats ) { } }
StringBuilder buffer = new StringBuilder ( pattern . length ( ) * repeats ) ; for ( int i = 0 ; i < repeats ; i ++ ) { buffer . append ( pattern ) ; } return new String ( buffer ) ;
public class DepictionGenerator { /** * Highlights are shown as an outer glow around the atom symbols and bonds * rather than recoloring . * @ param width width of the outer glow relative to the bond stroke * @ return new generator for method chaining * @ see StandardGenerator . Highlighting * @ see StandardGenerator . HighlightStyle */ public DepictionGenerator withOuterGlowHighlight ( double width ) { } }
return withParam ( StandardGenerator . Highlighting . class , StandardGenerator . HighlightStyle . OuterGlow ) . withParam ( StandardGenerator . OuterGlowWidth . class , width ) ;
public class AbstractMojo { /** * Execute an operation with the store . * This method enforces thread safety based on the store factory . * @ param storeOperation The store . * @ param rootModule The root module to use for store initialization . * @ throws MojoExecutionException On execution errors . * @ throws MojoFailureException On execution failures . */ protected void execute ( StoreOperation storeOperation , MavenProject rootModule , Set < MavenProject > executedModules ) throws MojoExecutionException , MojoFailureException { } }
synchronized ( cachingStoreProvider ) { Store store = getStore ( rootModule ) ; if ( isResetStoreBeforeExecution ( ) && executedModules . isEmpty ( ) ) { store . reset ( ) ; } try { storeOperation . run ( rootModule , store ) ; } finally { releaseStore ( store ) ; } }
public class XlsxWorkbook { /** * Returns an existing workbook object . * @ param file The file with the workbook * @ return The existing workbook object * @ throws IOException if the workbook cannot be opened */ public static XlsxWorkbook getWorkbook ( File file ) throws IOException { } }
try { return new XlsxWorkbook ( file ) ; } catch ( Docx4JException e ) { if ( e . getCause ( ) != null && e . getCause ( ) instanceof IOException ) throw ( IOException ) e . getCause ( ) ; else throw new IOException ( e ) ; }
public class ICalTimeZone { /** * Gets the observance that a date is effected by . * @ param year the year * @ param month the month ( 1-12) * @ param day the day of the month * @ param hour the hour * @ param minute the minute * @ param second the second * @ return the observance or null if an observance cannot be found */ private Observance getObservance ( int year , int month , int day , int hour , int minute , int second ) { } }
Boundary boundary = getObservanceBoundary ( year , month , day , hour , minute , second ) ; return ( boundary == null ) ? null : boundary . getObservanceIn ( ) ;
public class IsoInterval { /** * / * [ deutsch ] * < p > Ermittelt , ob dieses Intervall das angegebene Intervall so ber & uuml ; hrt , da & szlig ; * weder eine & Uuml ; berlappung noch eine L & uuml ; cke dazwischen existieren . < / p > * < p > & Auml ; quivalent zum Ausdruck { @ code this . meets ( other ) | | this . metBy ( other ) } . Leere Intervalle * ber & uuml ; hren sich nie . < / p > * @ param other another interval which might abut this interval * @ return { @ code true } if there is no intersection and no gap between else { @ code false } * @ since 3.19/4.15 * @ see # meets ( IsoInterval ) * @ see # metBy ( IsoInterval ) */ public boolean abuts ( ChronoInterval < T > other ) { } }
if ( this . isEmpty ( ) || other . isEmpty ( ) ) { return false ; } T startA = this . getClosedFiniteStart ( ) ; T startB = getClosedFiniteStart ( other . getStart ( ) , this . getTimeLine ( ) ) ; T endA = this . getOpenFiniteEnd ( ) ; T endB = getOpenFiniteEnd ( other . getEnd ( ) , this . getTimeLine ( ) ) ; if ( ( endA == null ) || ( startB == null ) ) { return ( ( startA != null ) && ( endB != null ) && startA . isSimultaneous ( endB ) ) ; } else if ( ( startA == null ) || ( endB == null ) ) { return endA . isSimultaneous ( startB ) ; } return ( endA . isSimultaneous ( startB ) ^ startA . isSimultaneous ( endB ) ) ;