signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class CodeScriptAction { /** * 保存 */
public String save ( ) { } } | Integer codeScriptId = getInt ( "codeScript.id" ) ; CodeScript codeScript = null ; if ( null == codeScriptId ) { codeScript = new CodeScript ( ) ; } else { codeScript = ( CodeScript ) entityDao . get ( CodeScript . class , codeScriptId ) ; } codeScript . setUpdatedAt ( new Date ( System . currentTimeMillis ( ) ) ) ; Mo... |
public class PropertyValueConverter { /** * Converts a string value from the database to the best matching java
* primitive type . */
@ Override public Object convertToEntityAttribute ( String dbData ) { } } | if ( "true" . equalsIgnoreCase ( dbData ) ) { return true ; } else if ( "false" . equalsIgnoreCase ( dbData ) ) { return false ; } else if ( NumberUtils . isParsable ( dbData ) ) { if ( NumberUtils . isDigits ( dbData ) || ( dbData . startsWith ( "-" ) && NumberUtils . isDigits ( dbData . substring ( 1 ) ) ) ) { return... |
public class Workbook { /** * Creates a new workbook object .
* @ param format The format of the workbook ( XLS or XLSX )
* @ param os The output stream to write the workbook to
* @ return The new workbook created
* @ throws IOException if the file cannot be written */
public static Workbook createWorkbook ( Fi... | return createWorkbook ( format , os , null ) ; |
public class AmazonSimpleWorkflowClient { /** * Returns information about the specified workflow execution including its type and some statistics .
* < note >
* This operation is eventually consistent . The results are best effort and may not exactly reflect recent updates
* and changes .
* < / note >
* < b >... | request = beforeClientExecution ( request ) ; return executeDescribeWorkflowExecution ( request ) ; |
public class ToStringBuilder { /** * < p > Append to the < code > toString < / code > a < code > double < / code >
* array . < / p >
* < p > A boolean parameter controls the level of detail to show .
* Setting < code > true < / code > will output the array in full . Setting
* < code > false < / code > will outp... | style . append ( buffer , fieldName , array , Boolean . valueOf ( fullDetail ) ) ; return this ; |
public class MethodWriter { /** * Resizes and replaces the temporary instructions inserted by
* { @ link Label # resolve } for wide forward jumps , while keeping jump offsets
* and instruction addresses consistent . This may require to resize other
* existing instructions , or even to introduce new instructions :... | byte [ ] b = code . data ; // bytecode of the method
int u , v , label ; // indexes in b
int i , j ; // loop indexes
/* * 1st step : As explained above , resizing an instruction may require to
* resize another one , which may require to resize yet another one , and
* so on . The first step of the algorithm consists... |
public class CmsEditSiteForm { /** * Reads parameter from form . < p >
* @ return a Map with Parameter information . */
private Map < String , String > getParameter ( ) { } } | Map < String , String > ret = new TreeMap < String , String > ( ) ; for ( Component c : m_parameter ) { if ( c instanceof CmsRemovableFormRow < ? > ) { String [ ] parameterStringArray = ( ( String ) ( ( CmsRemovableFormRow < ? extends AbstractField < ? > > ) c ) . getInput ( ) . getValue ( ) ) . split ( "=" ) ; ret . p... |
public class Particle { /** * Setter to set the current positions to be the local best positions . */
public void setParticleLocalBeststoCurrent ( ) { } } | for ( int i = 0 ; i < locations . length ; i ++ ) { particleLocalBests [ i ] = locations [ i ] ; } |
public class LongSummaryStatistics { /** * Combines the state of another { @ code LongSummaryStatistics } into this
* one .
* @ param other another { @ code LongSummaryStatistics }
* @ throws NullPointerException if { @ code other } is null */
public void combine ( LongSummaryStatistics other ) { } } | count += other . count ; sum += other . sum ; min = Math . min ( min , other . min ) ; max = Math . max ( max , other . max ) ; |
public class CompositeDateFormat { /** * { @ inheritDoc } */
@ Override public StringBuffer format ( final Date date , final StringBuffer toAppendTo , final FieldPosition fieldPosition ) { } } | return ResqueDateFormatThreadLocal . getInstance ( ) . format ( date , toAppendTo , fieldPosition ) ; |
public class DisasterRecoveryConfigurationsInner { /** * Creates or updates a disaster recovery configuration .
* @ 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 s... | return ServiceFuture . fromResponse ( createOrUpdateWithServiceResponseAsync ( resourceGroupName , serverName , disasterRecoveryConfigurationName ) , serviceCallback ) ; |
public class NetworkWatchersInner { /** * Updates a network watcher tags .
* @ param resourceGroupName The name of the resource group .
* @ param networkWatcherName The name of the network watcher .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the Net... | if ( resourceGroupName == null ) { throw new IllegalArgumentException ( "Parameter resourceGroupName is required and cannot be null." ) ; } if ( networkWatcherName == null ) { throw new IllegalArgumentException ( "Parameter networkWatcherName is required and cannot be null." ) ; } if ( this . client . subscriptionId ( ... |
public class CachedConnectionManagerImpl { /** * { @ inheritDoc } */
public void userTransactionStarted ( ) throws SystemException { } } | Context context = currentContext ( ) ; log . tracef ( "user tx started, context: %s" , context ) ; if ( context != null ) { for ( org . ironjacamar . core . connectionmanager . ConnectionManager cm : context . getConnectionManagers ( ) ) { if ( cm . getTransactionSupport ( ) != TransactionSupportLevel . NoTransaction )... |
public class MembershipHandlerImpl { /** * { @ inheritDoc } */
public Membership findMembership ( String id ) throws Exception { } } | Session session = service . getStorageSession ( ) ; try { return findMembership ( session , id ) . membership ; } finally { session . logout ( ) ; } |
public class GenerateCompatibilityGraph { /** * Generate Compatibility Graph Nodes
* @ return
* @ throws IOException */
protected int compatibilityGraphNodes ( ) throws IOException { } } | compGraphNodes . clear ( ) ; List < IAtom > basicAtomVecA = null ; List < IAtom > basicAtomVecB = null ; IAtomContainer reactant = source ; IAtomContainer product = target ; basicAtomVecA = reduceAtomSet ( reactant ) ; basicAtomVecB = reduceAtomSet ( product ) ; List < List < Integer > > labelListMolA = labelAtoms ( re... |
import java . util . * ; class Main { /** * This function identifies the first duplicate character in a given string .
* If there are no repeated characters , it returns ' None ' as default .
* Examples :
* find _ first _ duplicate _ character ( ' abcabc ' )
* find _ first _ duplicate _ character ( ' abc ' )
... | Map < Character , Integer > characterCountMap = new HashMap < > ( ) ; for ( char c : inputStr . toCharArray ( ) ) { if ( characterCountMap . containsKey ( c ) ) { return Character . toString ( c ) ; } else { characterCountMap . put ( c , 1 ) ; } } return "None" ; |
public class LocationHelper { /** * Remove the listener to receive location updates */
@ RequiresPermission ( anyOf = { } } | Manifest . permission . ACCESS_COARSE_LOCATION , Manifest . permission . ACCESS_FINE_LOCATION } ) public synchronized void stopLocalization ( ) { if ( started ) { AlarmUtils . cancelAlarm ( getCancelPendingIntent ( ) ) ; locationManager . removeUpdates ( this ) ; if ( location == null ) { location = locationManager . g... |
public class BaseCustomDfuImpl { /** * Writes the Init packet to the characteristic . This method is SYNCHRONOUS and wait until the
* { @ link android . bluetooth . BluetoothGattCallback # onCharacteristicWrite ( android . bluetooth . BluetoothGatt , android . bluetooth . BluetoothGattCharacteristic , int ) }
* wil... | if ( mAborted ) throw new UploadAbortedException ( ) ; byte [ ] locBuffer = buffer ; if ( buffer . length != size ) { locBuffer = new byte [ size ] ; System . arraycopy ( buffer , 0 , locBuffer , 0 , size ) ; } mReceivedData = null ; mError = 0 ; mInitPacketInProgress = true ; characteristic . setWriteType ( BluetoothG... |
public class AtomicVariableWidthArray { /** * Gets an array containing all the values in the array . The returned values are not guaranteed to be from the same time instant . < br > If an array is provided and it is the correct length , then
* that array will be used as the destination array .
* @ param array the p... | if ( array == null || array . length != length ( ) ) { array = new int [ length ( ) ] ; } for ( int i = 0 ; i < length ( ) ; i ++ ) { array [ i ] = get ( i ) ; } return array ; |
public class StringHelper { /** * Split the provided string by the provided separator and invoke the consumer
* for each matched element .
* @ param sSep
* The separator to use . May not be < code > null < / code > .
* @ param sElements
* The concatenated String to convert . May be < code > null < / code > or... | explode ( sSep , sElements , - 1 , aConsumer ) ; |
public class DispatcherServlet { /** * Do HTTP response .
* @ param context { @ link RequestContext } */
public static void result ( final RequestContext context ) { } } | final HttpServletResponse response = context . getResponse ( ) ; if ( response . isCommitted ( ) ) { // Response sends redirect or error
return ; } AbstractResponseRenderer renderer = context . getRenderer ( ) ; if ( null == renderer ) { renderer = new Http404Renderer ( ) ; } renderer . render ( context ) ; |
public class PullRequest { /** * The targets of the pull request , including the source branch and destination branch for the pull request .
* @ param pullRequestTargets
* The targets of the pull request , including the source branch and destination branch for the pull request . */
public void setPullRequestTargets... | if ( pullRequestTargets == null ) { this . pullRequestTargets = null ; return ; } this . pullRequestTargets = new java . util . ArrayList < PullRequestTarget > ( pullRequestTargets ) ; |
public class RelationalDatabaseSpec { /** * You can specify alternative versions of the same entity by creating
* sequential entity specs with the same name , different column specs for
* one or more properties or references , and mutually exclusive constraint
* specs . One example of where this is useful is inpa... | if ( constantParameterSpecs == null ) { this . constantSpecs = EMPTY_ES_ARR ; } else { this . constantSpecs = constantParameterSpecs . clone ( ) ; } |
public class RESTClient { /** * Performs PUT request .
* @ param path Request path .
* @ throws IOException If error during HTTP connection or entity parsing occurs .
* @ throws RESTException If HTTP response code is non OK . */
public Response put ( String path ) throws IOException , RESTException { } } | return put ( path , null , null ) ; |
public class JsonBuiltin { /** * - - - PRIVATE PARSER METHODS - - - */
protected static final Object parseNext ( Source src ) throws IOException { } } | skipWhitespaces ( src ) ; switch ( src . ch ) { case '"' : return parseString ( src ) ; case 't' : src . idx += 4 ; return Boolean . TRUE ; case 'f' : src . idx += 5 ; return Boolean . FALSE ; case 'n' : src . idx += 4 ; return null ; case '[' : return parseList ( src ) ; case '{' : return parseMap ( src ) ; case '0' :... |
public class TwillModule { /** * Provider method for instantiating { @ link org . apache . twill . yarn . YarnTwillRunnerService } . */
@ Singleton @ Provides private YarnTwillRunnerService provideYarnTwillRunnerService ( CConfiguration configuration , YarnConfiguration yarnConfiguration , LocationFactory locationFacto... | String zkConnectStr = configuration . get ( Constants . Zookeeper . QUORUM ) + configuration . get ( Constants . CFG_TWILL_ZK_NAMESPACE ) ; // Copy the yarn config and set the max heap ratio .
YarnConfiguration yarnConfig = new YarnConfiguration ( yarnConfiguration ) ; yarnConfig . set ( Constants . CFG_TWILL_RESERVED_... |
public class ControlMessageFactoryImpl { /** * Create a new , empty ControlAck message
* @ return The new ControlAck
* @ exception MessageCreateFailedException Thrown if such a message can not be created */
public final ControlAck createNewControlAck ( ) throws MessageCreateFailedException { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "createNewControlAck" ) ; ControlAck msg = null ; try { msg = new ControlAckImpl ( MfpConstants . CONSTRUCTOR_NO_OP ) ; } catch ( MessageDecodeFailedException e ) { /* No need to FFDC this as JsMsgObject will already have do... |
public class ServerImpl { /** * Update the receive connecting state .
* @ param client The current client .
* @ param buffer The data buffer .
* @ param from The id from .
* @ param expected The expected client state .
* @ throws IOException If error . */
private void receiveConnecting ( ClientSocket client ,... | if ( ServerImpl . checkValidity ( client , from , expected ) ) { // Receive the name
final byte [ ] name = new byte [ buffer . readByte ( ) ] ; if ( buffer . read ( name ) == - 1 ) { throw new IOException ( "Unable to read client name !" ) ; } client . setName ( new String ( name , NetworkMessage . CHARSET ) ) ; // Sen... |
public class ConfigCheckReport { /** * Use { @ link # getWarnsMap ( ) } instead . */
@ java . lang . Deprecated public java . util . Map < java . lang . String , alluxio . grpc . InconsistentProperties > getWarns ( ) { } } | return getWarnsMap ( ) ; |
public class EJBControlImpl { /** * Find the method which has the same signature in the specified class .
* @ param controlBeanMethod Method signature find .
* @ param ejbInterface Class to search for method signature .
* @ return Method from ejbInterface if found , null if not found . */
protected Method findEjb... | final String cbMethodName = controlBeanMethod . getName ( ) ; final Class cbMethodReturnType = controlBeanMethod . getReturnType ( ) ; final Class [ ] cbMethodParams = controlBeanMethod . getParameterTypes ( ) ; Method [ ] ejbMethods = ejbInterface . getMethods ( ) ; for ( Method m : ejbMethods ) { if ( ! cbMethodName ... |
public class DatabasesInner { /** * Returns the list of databases of the given Kusto cluster .
* @ param resourceGroupName The name of the resource group containing the Kusto cluster .
* @ param clusterName The name of the Kusto cluster .
* @ throws IllegalArgumentException thrown if parameters fail the validatio... | if ( resourceGroupName == null ) { throw new IllegalArgumentException ( "Parameter resourceGroupName is required and cannot be null." ) ; } if ( clusterName == null ) { throw new IllegalArgumentException ( "Parameter clusterName is required and cannot be null." ) ; } if ( this . client . subscriptionId ( ) == null ) { ... |
public class InvokeOnPartitions { /** * Executes all the operations on the partitions . */
@ SuppressWarnings ( "unchecked" ) < T > ICompletableFuture < Map < Integer , T > > invokeAsync ( ) { } } | assert ! invoked : "already invoked" ; invoked = true ; ensureNotCallingFromPartitionOperationThread ( ) ; invokeOnAllPartitions ( ) ; return future ; |
public class GraphUtils { /** * Find the leave vertices in the graph . I . E . Vertices that have no outgoing edges
* @ param graph graph to search
* @ return mutable snapshot of all leaf vertices . */
public static < V > Set < V > getLeafVertices ( DirectedGraph < V , DefaultEdge > graph ) { } } | Set < V > vertexSet = graph . vertexSet ( ) ; Set < V > leaves = new HashSet < V > ( vertexSet . size ( ) * 2 ) ; for ( V vertex : vertexSet ) { if ( graph . outgoingEdgesOf ( vertex ) . isEmpty ( ) ) { leaves . add ( vertex ) ; } } return leaves ; |
public class GenericUtils { /** * Take an input byte [ ] and return the long translation . For example , the
* byte [ ] ' 0053 ' would return 53.
* @ param array
* @ param offset into the array to start at
* @ param length number of bytes to review
* @ return long
* @ throws NumberFormatException ( if the d... | if ( null == array || array . length <= offset ) { return - 1L ; } long longVal = 0 ; long mark = 1 ; int digit ; int i = offset + length - 1 ; // ignore trailing whitespace
for ( ; offset <= i ; i -- ) { char c = ( char ) array [ i ] ; if ( BNFHeaders . SPACE != c && BNFHeaders . TAB != c ) { break ; } } for ( ; offse... |
public class LBiObjBytePredicateBuilder { /** * 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 > LBiObjBytePredicateBuilder < T1 , T2 > biObjBytePredicate ( Consumer... | return new LBiObjBytePredicateBuilder ( consumer ) ; |
public class CPDefinitionLinkPersistenceImpl { /** * Returns the last cp definition link in the ordered set where CPDefinitionId = & # 63 ; .
* @ param CPDefinitionId the cp definition ID
* @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > )
* @ return the last mat... | CPDefinitionLink cpDefinitionLink = fetchByCPDefinitionId_Last ( CPDefinitionId , orderByComparator ) ; if ( cpDefinitionLink != null ) { return cpDefinitionLink ; } StringBundler msg = new StringBundler ( 4 ) ; msg . append ( _NO_SUCH_ENTITY_WITH_KEY ) ; msg . append ( "CPDefinitionId=" ) ; msg . append ( CPDefinition... |
public class FloatingPointBitsConverterUtil { /** * Converts a float value to a sortable int .
* @ see # doubleToSortableLong ( double ) */
public static int floatToSortableInt ( float value ) { } } | int bits = Float . floatToIntBits ( value ) ; return bits ^ ( bits >> 31 ) & Integer . MAX_VALUE ; |
public class CaffeineCache { /** * { @ inheritDoc } */
@ Override public V get ( K key ) { } } | U . must ( loading , "No loader was specified for this cache. Please specify one or use getIfExists()!" ) ; return loadingCache . get ( key ) ; |
public class Context { /** * Create an array with a specified initial length .
* @ param scope the scope to create the object in
* @ param length the initial length ( JavaScript arrays may have
* additional properties added dynamically ) .
* @ return the new array object */
public Scriptable newArray ( Scriptab... | NativeArray result = new NativeArray ( length ) ; ScriptRuntime . setBuiltinProtoAndParent ( result , scope , TopLevel . Builtins . Array ) ; return result ; |
public class HashFunctions { /** * Fowler - Noll - Vo 64 bit hash ( FNV - 1a ) for bytes array . < br / > < p / > < h3 > Algorithm < / h3 > < p / >
* < pre >
* hash = offset _ basis
* for each octet _ of _ data to be hashed
* hash = hash xor octet _ of _ data
* hash = hash * FNV _ prime
* return hash < / pr... | long hash = FNV_BASIS ; for ( int i = 0 ; i < bytes . length ; i ++ ) { hash ^= 0xFF & bytes [ i ] ; hash *= FNV_PRIME_64 ; } return hash ; |
public class InternalXtextParser { /** * InternalXtext . g : 3407:1 : entryRuleWildcard returns [ EObject current = null ] : iv _ ruleWildcard = ruleWildcard EOF ; */
public final EObject entryRuleWildcard ( ) throws RecognitionException { } } | EObject current = null ; EObject iv_ruleWildcard = null ; try { // InternalXtext . g : 3407:49 : ( iv _ ruleWildcard = ruleWildcard EOF )
// InternalXtext . g : 3408:2 : iv _ ruleWildcard = ruleWildcard EOF
{ newCompositeNode ( grammarAccess . getWildcardRule ( ) ) ; pushFollow ( FollowSets000 . FOLLOW_1 ) ; iv_ruleWil... |
public class SecurityDomain { /** * Sets the System environment to support the Security Domain ' s settings . This is used for protocols which only read their crypto
* settings via environment variables .
* < br > Also see { @ link # restoreSystemEnvironment ( ) } */
public void setDomainEnvironment ( ) { } } | systemProperties = System . getProperties ( ) ; if ( System . getProperty ( SET_DOMAIN_ENVIRONMENT ) != null ) { logger . debug ( "Setting System environment properties to Security Domain values" ) ; for ( int i = 0 ; i < ENVNAMES . length ; i ++ ) { setOrClearSystemProperties ( ENVNAMES [ i ] , domainProperties ) ; } ... |
public class ManagedCustomerPage { /** * Gets the links value for this ManagedCustomerPage .
* @ return links * Links between manager and client customers . */
public com . google . api . ads . adwords . axis . v201809 . mcm . ManagedCustomerLink [ ] getLinks ( ) { } } | return links ; |
public class VorbisAudioFileReader { /** * Return the AudioInputStream from the given File .
* @ return
* @ throws javax . sound . sampled . UnsupportedAudioFileException
* @ throws java . io . IOException */
@ Override public AudioInputStream getAudioInputStream ( File file ) throws UnsupportedAudioFileException... | LOG . log ( Level . FINE , "getAudioInputStream(File file)" ) ; InputStream inputStream = new FileInputStream ( file ) ; try { return getAudioInputStream ( inputStream ) ; } catch ( UnsupportedAudioFileException | IOException e ) { inputStream . close ( ) ; throw e ; } |
public class Handler { /** * If there is no matching path , the OrchestrationHandler is going to try to start the defaultHandlers .
* If there are default handlers defined , store the chain id within the exchange .
* Otherwise return false .
* @ param httpServerExchange
* The current requests server exchange . ... | // check if defaultHandlers is empty
if ( defaultHandlers != null && defaultHandlers . size ( ) > 0 ) { httpServerExchange . putAttachment ( CHAIN_ID , "defaultHandlers" ) ; httpServerExchange . putAttachment ( CHAIN_SEQ , 0 ) ; return true ; } return false ; |
public class QuantilesCallback { /** * Returns the buckets attribute and sample them . */
public static BucketsSample sampleBuckets ( Stopwatch stopwatch ) { } } | final Buckets buckets = getBuckets ( stopwatch ) ; return buckets == null ? null : buckets . sample ( ) ; |
public class SVGParser { /** * Hue ( degrees ) , saturation [ 0 , 100 ] , lightness [ 0 , 100] */
private static int hslToRgb ( float hue , float sat , float light ) { } } | hue = ( hue >= 0f ) ? hue % 360f : ( hue % 360f ) + 360f ; // positive modulo ( ie . - 10 = > 350)
hue /= 60f ; // [0 , 360 ] - > [ 0 , 6]
sat /= 100 ; // [0 , 100 ] - > [ 0 , 1]
light /= 100 ; // [0 , 100 ] - > [ 0 , 1]
sat = ( sat < 0f ) ? 0f : ( sat > 1f ) ? 1f : sat ; light = ( light < 0f ) ? 0f : ( light > 1f ) ? ... |
public class InternalXbaseWithAnnotationsParser { /** * InternalXbaseWithAnnotations . g : 92:1 : ruleXAnnotationElementValuePair : ( ( rule _ _ XAnnotationElementValuePair _ _ Group _ _ 0 ) ) ; */
public final void ruleXAnnotationElementValuePair ( ) throws RecognitionException { } } | int stackSize = keepStackSize ( ) ; try { // InternalXbaseWithAnnotations . g : 96:2 : ( ( ( rule _ _ XAnnotationElementValuePair _ _ Group _ _ 0 ) ) )
// InternalXbaseWithAnnotations . g : 97:2 : ( ( rule _ _ XAnnotationElementValuePair _ _ Group _ _ 0 ) )
{ // InternalXbaseWithAnnotations . g : 97:2 : ( ( rule _ _ XA... |
public class OWLDataAllValuesFromImpl_CustomFieldSerializer { /** * Deserializes the content of the object from the
* { @ link com . google . gwt . user . client . rpc . SerializationStreamReader } .
* @ param streamReader the { @ link com . google . gwt . user . client . rpc . SerializationStreamReader } to read t... | deserialize ( streamReader , instance ) ; |
public class RestTemplateBuilder { /** * Set a root URL that should be applied to each request that starts with { @ code ' / ' } .
* See { @ link RootUriTemplateHandler } for details .
* @ param rootUri the root URI or { @ code null }
* @ return a new builder instance */
public RestTemplateBuilder rootUri ( Strin... | return new RestTemplateBuilder ( this . detectRequestFactory , rootUri , this . messageConverters , this . requestFactorySupplier , this . uriTemplateHandler , this . errorHandler , this . basicAuthentication , this . restTemplateCustomizers , this . requestFactoryCustomizer , this . interceptors ) ; |
public class CommandLineCompiler { /** * Adds command - line arguments for include directories .
* If relativeArgs is not null will add corresponding relative paths
* include switches to that vector ( for use in building a configuration
* identifier that is consistent between machines ) .
* @ param baseDirPath ... | for ( final File includeDir : includeDirs ) { args . addElement ( getIncludeDirSwitch ( includeDir . getAbsolutePath ( ) , isSystem ) ) ; if ( relativeArgs != null ) { final String relative = CUtil . getRelativePath ( baseDirPath , includeDir ) ; relativeArgs . addElement ( getIncludeDirSwitch ( relative , isSystem ) )... |
public class Log4j2Log { /** * 打印日志 < br >
* 此方法用于兼容底层日志实现 , 通过传入当前包装类名 , 以解决打印日志中行号错误问题
* @ param fqcn 完全限定类名 ( Fully Qualified Class Name ) , 用于纠正定位错误行号
* @ param level 日志级别 , 使用org . apache . logging . log4j . Level中的常量
* @ param t 异常
* @ param msgTemplate 消息模板
* @ param arguments 参数
* @ return 是否支持 Lo... | if ( this . logger instanceof AbstractLogger ) { ( ( AbstractLogger ) this . logger ) . logIfEnabled ( fqcn , level , null , StrUtil . format ( msgTemplate , arguments ) , t ) ; return true ; } else { return false ; } |
public class FA { /** * Inserts a new states to the automaton . New states are
* allocated at the end .
* @ param label label for the state created . */
public int add ( Object label ) { } } | ensureCapacity ( used ) ; states [ used ] = new State ( label ) ; return used ++ ; |
public class InputProcessingConfigurationUpdateMarshaller { /** * Marshall the given parameter object . */
public void marshall ( InputProcessingConfigurationUpdate inputProcessingConfigurationUpdate , ProtocolMarshaller protocolMarshaller ) { } } | if ( inputProcessingConfigurationUpdate == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( inputProcessingConfigurationUpdate . getInputLambdaProcessorUpdate ( ) , INPUTLAMBDAPROCESSORUPDATE_BINDING ) ; } catch ( Exception e ) { throw new Sd... |
public class PostLogin { /** * { @ inheritDoc } */
@ Override public String processAllReturningText ( final String s ) { } } | XmlElement root = XmlConverter . getRootElement ( s ) ; findContent ( root ) ; return s ; |
public class DefaultGroovyMethods { /** * Allows a Map to be iterated through using a closure . If the
* closure takes one parameter then it will be passed the Map . Entry
* otherwise if the closure takes two parameters then it will be
* passed the key and the value .
* < pre class = " groovyTestCase " > def re... | for ( Map . Entry entry : self . entrySet ( ) ) { callClosureForMapEntry ( closure , entry ) ; } return self ; |
public class SessionListener { /** * { @ inheritDoc } */
@ Override public void sessionWillPassivate ( HttpSessionEvent event ) { } } | if ( ! instanceEnabled ) { return ; } // pour getSessionCount
SESSION_COUNT . decrementAndGet ( ) ; // pour invalidateAllSession
removeSession ( event . getSession ( ) ) ; |
public class CommerceCountryPersistenceImpl { /** * Returns a range of all the commerce countries .
* Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and < code > end < / code > are not primary keys , they are indexes in the result set . Thus... | return findAll ( start , end , null ) ; |
public class BackendProviderResolver { /** * Find correct backend provider for the current context classloader . If no context classloader is available , a
* fallback with the classloader of this resolver class is taken
* @ return A bunch of TraceeBackendProvider registered and available in the current classloader ... | // Create a working copy of Cache . Reference is updated upon cache update .
final Map < ClassLoader , Set < TraceeBackendProvider > > cacheCopy = providersPerClassloader ; // Try to determine TraceeBackendProvider by context classloader . Fallback : use classloader of class .
final Set < TraceeBackendProvider > provid... |
public class AbstractDatabaseEngine { /** * Executes the given statement .
* If the statement for some reason fails to execute , the error is logged
* but no exception is thrown .
* @ param statement The statement . */
protected void executeUpdateSilently ( String statement ) { } } | logger . trace ( statement ) ; try ( Statement alter = conn . createStatement ( ) ) { alter . execute ( statement ) ; } catch ( final SQLException e ) { logger . debug ( "Could not execute {}." , statement , e ) ; } |
public class StringGroovyMethods { /** * Support the range subscript operator for CharSequence
* @ param text a CharSequence
* @ param range a Range
* @ return the subsequence CharSequence
* @ since 1.0 */
public static CharSequence getAt ( CharSequence text , Range range ) { } } | RangeInfo info = subListBorders ( text . length ( ) , range ) ; CharSequence sequence = text . subSequence ( info . from , info . to ) ; return info . reverse ? reverse ( sequence ) : sequence ; |
public class AmazonECSClient { /** * Describes the task sets in the specified cluster and service . This is used when a service uses the
* < code > EXTERNAL < / code > deployment controller type . For more information , see < a
* href = " http : / / docs . aws . amazon . com / AmazonECS / latest / developerguide / ... | request = beforeClientExecution ( request ) ; return executeDescribeTaskSets ( request ) ; |
public class ContextUtils { /** * Get the file points to an external movies directory .
* @ param context the context .
* @ return the { @ link java . io . File } . */
@ TargetApi ( Build . VERSION_CODES . FROYO ) public static File getExternalFilesDirForMovies ( Context context ) { } } | return context . getExternalFilesDir ( Environment . DIRECTORY_MOVIES ) ; |
public class ExcelDataProviderImpl { /** * Gets data from Excel sheet by applying the given filter .
* @ param dataFilter
* an implementation class of { @ link DataProviderFilter }
* @ return An iterator over a collection of Object Array to be used with TestNG DataProvider */
@ Override public Iterator < Object [... | logger . entering ( dataFilter ) ; List < Object [ ] > objs = new ArrayList < > ( ) ; Field [ ] fields = resource . getCls ( ) . getDeclaredFields ( ) ; // Extracting number of rows of data to read
// Notice that numRows is returning the actual number of non - blank rows .
// Thus if there are blank rows in the sheet t... |
public class ZWaveController { /** * Send Request Node info message to the controller .
* @ param nodeId the nodeId of the node to identify
* @ throws SerialInterfaceException when timing out or getting an invalid response . */
public void requestNodeInfo ( int nodeId ) { } } | SerialMessage newMessage = new SerialMessage ( nodeId , SerialMessage . SerialMessageClass . RequestNodeInfo , SerialMessage . SerialMessageType . Request , SerialMessage . SerialMessageClass . ApplicationUpdate , SerialMessage . SerialMessagePriority . High ) ; byte [ ] newPayload = { ( byte ) nodeId } ; newMessage . ... |
public class NioOutboundPipeline { /** * Tries to unschedule this pipeline .
* It will only be unscheduled if :
* - there are no pending frames .
* If the outputBuffer is dirty then it will register itself for an OP _ WRITE since we are interested in knowing
* if there is more space in the socket output buffer ... | // since everything is written , we are not interested anymore in write - events , so lets unsubscribe
unregisterOp ( OP_WRITE ) ; // So the outputBuffer is empty , so we are going to unschedule the pipeline .
scheduled . set ( false ) ; if ( writeQueue . isEmpty ( ) && priorityWriteQueue . isEmpty ( ) ) { // there are... |
public class Storage { /** * Storage objects sort such that primaries sort first , mirrors after . */
@ Override public int compareTo ( Storage o ) { } } | return ComparisonChain . start ( ) . compareTrueFirst ( isConsistent ( ) , o . isConsistent ( ) ) // Primaries * must * be consistent .
. compareTrueFirst ( _masterPrimary , o . _masterPrimary ) // Master primary sorts first
. compare ( o . getPromotionId ( ) , getPromotionId ( ) , TimeUUIDs . ordering ( ) . nullsLast ... |
public class CommerceRegionPersistenceImpl { /** * Returns the last commerce region in the ordered set where commerceCountryId = & # 63 ; .
* @ param commerceCountryId the commerce country ID
* @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > )
* @ return the last... | int count = countByCommerceCountryId ( commerceCountryId ) ; if ( count == 0 ) { return null ; } List < CommerceRegion > list = findByCommerceCountryId ( commerceCountryId , count - 1 , count , orderByComparator ) ; if ( ! list . isEmpty ( ) ) { return list . get ( 0 ) ; } return null ; |
public class Main { /** * Runs the print .
* @ param args the cli arguments
* @ throws Exception */
@ VisibleForTesting public static void runMain ( final String [ ] args ) throws Exception { } } | final CliHelpDefinition helpCli = new CliHelpDefinition ( ) ; try { Args . parse ( helpCli , args ) ; if ( helpCli . help ) { printUsage ( 0 ) ; return ; } } catch ( IllegalArgumentException invalidOption ) { // Ignore because it is probably one of the non - help options .
} final CliDefinition cli = new CliDefinition ... |
public class CreateRouteResult { /** * The request models for the route .
* @ param requestModels
* The request models for the route .
* @ return Returns a reference to this object so that method calls can be chained together . */
public CreateRouteResult withRequestModels ( java . util . Map < String , String > ... | setRequestModels ( requestModels ) ; return this ; |
public class PersonBuilderImpl { /** * { @ inheritDoc } */
@ Override public Attribute createPersonEvent ( final Person person , final String type , final String dateString ) { } } | final Attribute event = gedObjectBuilder . createAttribute ( person , type ) ; event . insert ( new Date ( event , dateString ) ) ; return event ; |
public class BigDecimalLiteralDouble { /** * accept multiple unary prefixes . */
private static boolean floatingPointArgument ( ExpressionTree tree ) { } } | if ( tree . getKind ( ) == Kind . UNARY_PLUS || tree . getKind ( ) == Kind . UNARY_MINUS ) { tree = ( ( UnaryTree ) tree ) . getExpression ( ) ; } return tree . getKind ( ) == Kind . DOUBLE_LITERAL || tree . getKind ( ) == Kind . FLOAT_LITERAL ; |
public class CdnClient { /** * Post purge request
* @ param url The URL to be purged .
* @ return Result of the purge operation returned by the service . */
public PurgeResponse purge ( String url ) { } } | return purge ( new PurgeRequest ( ) . addTask ( new PurgeTask ( ) . withUrl ( url ) ) ) ; |
public class ToStream { /** * Receive notification of ignorable whitespace in element content .
* Not sure how to get this invoked quite yet .
* @ param ch The characters from the XML document .
* @ param start The start position in the array .
* @ param length The number of characters to read from the array . ... | if ( 0 == length ) return ; characters ( ch , start , length ) ; |
public class CmsSimpleDecoratedPanel { /** * Internal helper method for initializing the layout of this widget . < p > */
private void init ( ) { } } | int decorationWidth = getDecorationWidth ( ) ; m_decorationBox . setWidth ( decorationWidth + "px" ) ; m_primary . getElement ( ) . getStyle ( ) . setMarginLeft ( decorationWidth , Style . Unit . PX ) ; |
public class ResolveStageBaseImpl { /** * { @ inheritDoc }
* @ see org . jboss . shrinkwrap . resolver . api . ResolveStage # addDependencies ( java . util . Collection ) */
@ Override public RESOLVESTAGETYPE addDependencies ( final Collection < MavenDependency > dependencies ) throws IllegalArgumentException { } } | if ( dependencies == null ) { throw new IllegalArgumentException ( "dependencies must be provided" ) ; } for ( final MavenDependency dep : dependencies ) { this . addDependency ( dep ) ; } return this . covarientReturn ( ) ; |
public class LofResultPrinter { /** * { @ inheritDoc } */
@ Override public void notifyResult ( LofResult result ) { } } | // LOFスコアが閾値以上の場合ログ出力を行う
if ( this . threshold < result . getLofScore ( ) ) { logger . info ( "LOF Score thredhold over. LOF Score=" + result . getLofScore ( ) + ", Data=" + Arrays . toString ( result . getLofPoint ( ) . getDataPoint ( ) ) ) ; } |
public class LabelOperationMetadata { /** * < code >
* . google . cloud . datalabeling . v1beta1 . LabelVideoObjectDetectionOperationMetadata video _ object _ detection _ details = 6;
* < / code > */
public com . google . cloud . datalabeling . v1beta1 . LabelVideoObjectDetectionOperationMetadata getVideoObjectDete... | if ( detailsCase_ == 6 ) { return ( com . google . cloud . datalabeling . v1beta1 . LabelVideoObjectDetectionOperationMetadata ) details_ ; } return com . google . cloud . datalabeling . v1beta1 . LabelVideoObjectDetectionOperationMetadata . getDefaultInstance ( ) ; |
public class UnifiedClassLoader { /** * Spring to register the given ClassFileTransformer on this ClassLoader */
@ Override public boolean addTransformer ( final ClassFileTransformer cft ) { } } | boolean added = false ; for ( ClassLoader loader : followOnClassLoaders ) { if ( loader instanceof SpringLoader ) { added |= ( ( SpringLoader ) loader ) . addTransformer ( cft ) ; } } return added ; |
public class JNPM { /** * map of tag = > version */
protected IPromise < JsonObject > getDistributions ( String module ) { } } | Promise res = new Promise ( ) ; // http : / / registry . npmjs . org / - / package / react / dist - tags
http . getContent ( config . getRepo ( ) + "/-/package/" + module + "/dist-tags" ) . then ( ( cont , err ) -> { if ( cont != null ) { JsonObject parse = Json . parse ( cont ) . asObject ( ) ; res . resolve ( parse )... |
public class AbstractItemLink { /** * ( non - Javadoc )
* @ see com . ibm . ws . sib . msgstore . deliverydelay . DeliveryDelayable # deliveryDelayableIsInStore ( ) */
@ Override public boolean deliveryDelayableIsInStore ( ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "deliveryDelayableIsInStore" ) ; boolean isInStore = isInStore ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "deliveryDelayableIsInStore" , isInStore ) ; r... |
public class ServerStoreCompatibility { /** * Ensure compatibility of a client { @ link ServerStoreConfiguration } with an existing
* server - side { @ code ServerStoreConfiguration } .
* @ param serverConfiguration the existing server - side { @ code ServerStoreConfiguration }
* @ param clientConfiguration the d... | StringBuilder sb = new StringBuilder ( "Existing ServerStore configuration is not compatible with the desired configuration: " ) ; if ( ! serverConfiguration . isCompatible ( clientConfiguration , sb ) ) { throw new InvalidServerStoreConfigurationException ( sb . toString ( ) ) ; } |
public class Revision { /** * Compress time from long - to the integer - format : reduce the resolution to
* " seconds " and zero time to 1th January 2000
* @ param date
* date / time in the long format
* @ return date / time in the compressed integer format */
public static int compressTime ( long date ) { } } | Long lowResolutionDate = new Long ( ( date - TIME_ZERO ) / MS_IN_SEC ) ; return lowResolutionDate . intValue ( ) ; |
public class PeepholeReplaceKnownMethods { /** * Try to fold . split ( ) calls on strings */
private Node tryFoldStringSplit ( Node n , Node stringNode , Node arg1 ) { } } | if ( late ) { return n ; } checkArgument ( n . isCall ( ) ) ; checkArgument ( stringNode . isString ( ) ) ; String separator = null ; String stringValue = stringNode . getString ( ) ; // Maximum number of possible splits
int limit = stringValue . length ( ) + 1 ; if ( arg1 != null ) { if ( arg1 . isString ( ) ) { separ... |
public class PermissionHelper { /** * Similar to { @ link # checkPermission ( ) } , but it allows the AppInfoDialog will be enabled or disabled for this call .
* @ param showAppInfoDialogEnabled true if the AppInfoDialog is enabled , false to disabled it . */
public boolean checkPermission ( boolean showAppInfoDialog... | boolean hasPermission ; if ( permissionRationaleMessageResId != 0 ) { hasPermission = checkPermission ( permissionDelegate , getPermissionRationaleTitleResId ( ) , permissionRationaleMessageResId , permission , permissionRequestCode ) ; } else { hasPermission = checkPermission ( permissionDelegate , permission , permis... |
public class XsdEmitter { /** * Create an XML schema complex type . We want to use Named complex types so
* we add them to the XSD directly . We add complex types before their
* children because its nicer for the XSD layout to list roots before leafs .
* Redefined and redefining elements are grouped into an XML S... | // All complex types are root complex types
XmlSchemaComplexType xmlSchemaComplexType = new XmlSchemaComplexType ( getXsd ( ) , true ) ; XmlSchemaChoice xmlSchemaChoice = null ; XmlSchemaSequence xmlSchemaSequence = new XmlSchemaSequence ( ) ; for ( XsdDataItem child : xsdDataItem . getChildren ( ) ) { XmlSchemaElement... |
public class SocketClientSink { /** * Closes the connection with the Socket server . */
@ Override public void close ( ) throws Exception { } } | // flag this as not running any more
isRunning = false ; // clean up in locked scope , so there is no concurrent change to the stream and client
synchronized ( lock ) { // we notify first ( this statement cannot fail ) . The notified thread will not continue
// anyways before it can re - acquire the lock
lock . notifyA... |
public class IfThenElse { /** * { @ inheritDoc } */
public int getDepth ( ) { } } | return 1 + Math . max ( condition . getDepth ( ) , Math . max ( then . getDepth ( ) , otherwise . getDepth ( ) ) ) ; |
public class FleetAttributes { /** * Names of metric groups that this fleet is included in . In Amazon CloudWatch , you can view metrics for an
* individual fleet or aggregated metrics for fleets that are in a fleet metric group . A fleet can be included in
* only one metric group at a time .
* < b > NOTE : < / b... | if ( this . metricGroups == null ) { setMetricGroups ( new java . util . ArrayList < String > ( metricGroups . length ) ) ; } for ( String ele : metricGroups ) { this . metricGroups . add ( ele ) ; } return this ; |
public class AbstractViewQuery { /** * Change the custom IME action associated with the text view . click the lable will trigger the associateView ' s onClick method
* @ param listener */
public T imeAction ( TextView . OnEditorActionListener listener ) { } } | if ( view instanceof EditText ) { ( ( EditText ) view ) . setOnEditorActionListener ( listener ) ; } return self ( ) ; |
public class BootstrapContextImpl { /** * Declarative Services method for setting a JCAContextProvider service reference
* @ param ref reference to the service */
protected void setContextProvider ( ServiceReference < JCAContextProvider > ref ) { } } | contextProviders . putReference ( ( String ) ref . getProperty ( JCAContextProvider . TYPE ) , ref ) ; |
public class ImagePanel { /** * Draws the checkerboard background to the specified graphics context .
* @ param g2d graphics context to draw on
* @ since 1.4 */
protected void drawCheckerBoard ( Graphics2D g2d ) { } } | g2d . setColor ( getBackground ( ) ) ; g2d . fillRect ( 0 , 0 , getWidth ( ) , getHeight ( ) ) ; g2d . setColor ( getForeground ( ) ) ; final int checkSize = this . checkerSize ; final int halfCheckSize = checkSize / 2 ; final Stroke checker = this . checkerStroke ; final Stroke backup = g2d . getStroke ( ) ; g2d . set... |
public class CouchDBClient { /** * ( non - Javadoc )
* @ see com . impetus . kundera . client . Client # findByRelation ( java . lang . String ,
* java . lang . Object , java . lang . Class ) */
@ Override public List < Object > findByRelation ( String colName , Object colValue , Class entityClazz ) { } } | EntityMetadata m = KunderaMetadataManager . getEntityMetadata ( kunderaMetadata , entityClazz ) ; Object [ ] ids = findIdsByColumn ( m . getSchema ( ) , m . getTableName ( ) , ( ( AbstractAttribute ) m . getIdAttribute ( ) ) . getJPAColumnName ( ) , colName , colValue , m . getEntityClazz ( ) ) ; List < Object > result... |
public class Database { /** * Change the key of a encrypted database . The
* SQLite3 database must have been open ( ) ed .
* Not available in public releases of SQLite .
* @ param skey the key as String */
public void rekey ( String skey ) throws jsqlite . Exception { } } | synchronized ( this ) { byte ekey [ ] = null ; if ( skey != null && skey . length ( ) > 0 ) { ekey = new byte [ skey . length ( ) ] ; for ( int i = 0 ; i < skey . length ( ) ; i ++ ) { char c = skey . charAt ( i ) ; ekey [ i ] = ( byte ) ( ( c & 0xff ) ^ ( c >> 8 ) ) ; } } _rekey ( ekey ) ; } |
public class JmfDevice { /** * Get video format for size .
* @ param device device to get format from
* @ param size specific size to search
* @ return VideoFormat */
private VideoFormat getSizedVideoFormat ( Dimension size ) { } } | Format [ ] formats = device . getFormats ( ) ; VideoFormat format = null ; for ( Format f : formats ) { if ( ! "RGB" . equalsIgnoreCase ( f . getEncoding ( ) ) || ! ( f instanceof VideoFormat ) ) { continue ; } Dimension d = ( ( VideoFormat ) f ) . getSize ( ) ; if ( d . width == size . width && d . height == size . he... |
public class FactoryBlurFilter { /** * Creates a mean filter for the specified image type .
* @ param type Image type .
* @ param radius Size of the filter .
* @ return mean image filter . */
public static < T extends ImageBase < T > > BlurStorageFilter < T > mean ( ImageType < T > type , int radius ) { } } | return new BlurStorageFilter < > ( "mean" , type , radius ) ; |
public class ParameterImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public void eUnset ( int featureID ) { } } | switch ( featureID ) { case SimpleAntlrPackage . PARAMETER__TYPE : setType ( TYPE_EDEFAULT ) ; return ; case SimpleAntlrPackage . PARAMETER__NAME : setName ( NAME_EDEFAULT ) ; return ; } super . eUnset ( featureID ) ; |
public class DefaultResolverRegistry { /** * register card with type and card class
* @ param type
* @ param cardClz */
public void registerCard ( String type , Class < ? extends Card > cardClz ) { } } | mDefaultCardResolver . register ( type , cardClz ) ; |
public class MediaStreaming { /** * { @ inheritDoc } */
@ Override public void write ( OutputStream output ) throws IOException , WebApplicationException { } } | List < Range > ranges = Lists . newArrayList ( ) ; String [ ] acceptRanges = range . split ( "=" ) ; if ( acceptRanges . length != 2 ) { throw new BadRequestException ( RANGE + " header error" ) ; } String accept = acceptRanges [ 0 ] ; for ( String range : acceptRanges [ 1 ] . split ( "," ) ) { String [ ] bounds = rang... |
public class Filter { /** * Applies the given filter to the input and returns only those elements
* that match it .
* @ param filter
* a ( possible compound ) filter ; elements in the input array matching the
* filter will be returned .
* @ param elements
* the collection of objects to filter .
* @ return... | List < T > list = new ArrayList < T > ( ) ; if ( elements != null ) { for ( T element : elements ) { list . add ( element ) ; } } return apply ( filter , list ) ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.