signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class ComponentEnhancer { /** * Manage unique { @ link WaveType } subscription ( from value field of { @ link OnWave } annotation ) .
* @ param component the wave ready
* @ param waveActionName the { @ link WaveType } unique name
* @ param method the wave handler method */
private static void manageUniqueW... | // Get the WaveType from the WaveType registry
final WaveType wt = WaveTypeRegistry . getWaveType ( waveActionName ) ; if ( wt == null ) { throw new CoreRuntimeException ( "WaveType '" + waveActionName + "' not found into WaveTypeRegistry." ) ; } else { // Method is not defined or is the default fallback one
if ( metho... |
public class ProjectManager { /** * DEPRECATED . use membership . delete ( ) instead . */
@ Deprecated public void deleteProjectMembership ( int membershipId ) throws RedmineException { } } | transport . deleteObject ( Membership . class , Integer . toString ( membershipId ) ) ; |
public class OperatorSimplifyLocalHelper { /** * Simplifies geometries for storing in OGC format :
* MultiPoint : check that no points coincide . tolerance is ignored .
* Polyline : ensure there no segments degenerate segments . Polygon : cracks and
* clusters using cluster tolerance and resolves all self interse... | if ( geometry . isEmpty ( ) ) return geometry ; Geometry . Type gt = geometry . getType ( ) ; if ( gt == Geometry . Type . Point ) return geometry ; double tolerance = InternalUtils . calculateToleranceFromGeometry ( spatialReference , geometry , false ) ; if ( gt == Geometry . Type . Envelope ) { Envelope env = ( Enve... |
public class AbstractInjectAnnotationProcessor { /** * Produce a compile warning for the given element and message .
* @ param e The element
* @ param msg The message
* @ param args The string format args */
protected final void warning ( Element e , String msg , Object ... args ) { } } | if ( messager == null ) { illegalState ( ) ; } messager . printMessage ( Diagnostic . Kind . WARNING , String . format ( msg , args ) , e ) ; |
public class DefaultJsonWriter { /** * { @ inheritDoc } */
@ Override public DefaultJsonWriter value ( Number value ) { } } | if ( value == null ) { return nullValue ( ) ; } writeDeferredName ( ) ; String string = value . toString ( ) ; if ( ! lenient && ( string . equals ( "-Infinity" ) || string . equals ( "Infinity" ) || string . equals ( "NaN" ) ) ) { throw new IllegalArgumentException ( "Numeric values must be finite, but was " + value )... |
public class ArrayUtility { /** * Returns the total number of non array items held in the specified array ,
* recursively descending in every array item .
* @ param items
* comma separated sequence of { @ link Object } items
* @ return integer specifying the total number of itemsnew */
public static int getFlat... | return stream ( items ) . map ( item -> item . getClass ( ) . isArray ( ) ? getFlattenedItemsCount ( ( Object [ ] ) item ) : 1 ) . reduce ( 0 , Integer :: sum ) ; |
public class CPSpecificationOptionUtil { /** * Returns the first cp specification option 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 cp specificatio... | return getPersistence ( ) . findByGroupId_First ( groupId , orderByComparator ) ; |
public class InternationalizedRuntimeException { /** * Gets the arguments to this exception ' s message . Arguments allow a
* < code > InternationalizedRuntimeException < / code > to have a compound message , made up of
* multiple parts that are concatenated in a language - neutral way .
* @ return the arguments ... | if ( mArguments == null ) return new Object [ 0 ] ; Object [ ] result = new Object [ mArguments . length ] ; System . arraycopy ( mArguments , 0 , result , 0 , mArguments . length ) ; return result ; |
public class S3TaskClientImpl { /** * { @ inheritDoc } */
@ Override public DisableStreamingTaskResult disableStreaming ( String spaceId ) throws ContentStoreException { } } | DisableStreamingTaskParameters taskParams = new DisableStreamingTaskParameters ( ) ; taskParams . setSpaceId ( spaceId ) ; return DisableStreamingTaskResult . deserialize ( contentStore . performTask ( StorageTaskConstants . DISABLE_STREAMING_TASK_NAME , taskParams . serialize ( ) ) ) ; |
public class Options { /** * Puts an IModel & lt ; Double & gt ; value for the given option name .
* @ param key
* the option name .
* @ param value
* the float value . */
public Options putDouble ( String key , IModel < Double > value ) { } } | putOption ( key , new DoubleOption ( value ) ) ; return this ; |
public class Keyword { /** * setter for source - sets Tthe keyword source ( terminology ) , O
* @ generated
* @ param v value to set into the feature */
public void setSource ( String v ) { } } | if ( Keyword_Type . featOkTst && ( ( Keyword_Type ) jcasType ) . casFeat_source == null ) jcasType . jcas . throwFeatMissing ( "source" , "de.julielab.jules.types.Keyword" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( Keyword_Type ) jcasType ) . casFeatCode_source , v ) ; |
public class QueueService { /** * A static factory method that returns an instance implementing
* { @ link com . microsoft . windowsazure . services . queue . QueueContract } using the specified { @ link Configuration } instance
* and profile prefix for service settings . The { @ link Configuration }
* instance m... | return config . create ( profile , QueueContract . class ) ; |
public class EgressFilterMarshaller { /** * Marshall the given parameter object . */
public void marshall ( EgressFilter egressFilter , ProtocolMarshaller protocolMarshaller ) { } } | if ( egressFilter == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( egressFilter . getType ( ) , TYPE_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class CmsScrollPanelImpl { /** * Set the scrollbar used for vertical scrolling .
* @ param scrollbar the scrollbar , or null to clear it
* @ param width the width of the scrollbar in pixels */
private void setVerticalScrollbar ( final CmsScrollBar scrollbar , int width ) { } } | // Validate .
if ( ( scrollbar == m_scrollbar ) || ( scrollbar == null ) ) { return ; } // Detach new child .
scrollbar . asWidget ( ) . removeFromParent ( ) ; // Remove old child .
if ( m_scrollbar != null ) { if ( m_verticalScrollbarHandlerRegistration != null ) { m_verticalScrollbarHandlerRegistration . removeHandle... |
public class HyphenationAuto { /** * Hyphenates a word and returns the first part of it . To get
* the second part of the hyphenated word call < CODE > getHyphenatedWordPost ( ) < / CODE > .
* @ param word the word to hyphenate
* @ param font the font used by this word
* @ param fontSize the font size used by t... | post = word ; String hyphen = getHyphenSymbol ( ) ; float hyphenWidth = font . getWidthPoint ( hyphen , fontSize ) ; if ( hyphenWidth > remainingWidth ) return "" ; Hyphenation hyphenation = hyphenator . hyphenate ( word ) ; if ( hyphenation == null ) { return "" ; } int len = hyphenation . length ( ) ; int k ; for ( k... |
public class Library { /** * Return the build string of this instance of finmath - lib .
* Currently this is the Git commit hash .
* @ return The build string of this instance of finmath - lib . */
public static String getBuildString ( ) { } } | String versionString = "UNKNOWN" ; Properties propeties = getProperites ( ) ; if ( propeties != null ) { versionString = propeties . getProperty ( "finmath-lib.build" ) ; } return versionString ; |
public class PoolResizeOptions { /** * Set a timestamp indicating the last modified time of the resource known to the client . The operation will be performed only if the resource on the service has not been modified since the specified time .
* @ param ifUnmodifiedSince the ifUnmodifiedSince value to set
* @ retur... | if ( ifUnmodifiedSince == null ) { this . ifUnmodifiedSince = null ; } else { this . ifUnmodifiedSince = new DateTimeRfc1123 ( ifUnmodifiedSince ) ; } return this ; |
public class DistributedFileSystem { /** * { @ inheritDoc } */
public void setTimes ( Path p , long mtime , long atime ) throws IOException { } } | dfs . setTimes ( getPathName ( p ) , mtime , atime ) ; |
public class JmsConnectionFactoryImpl { /** * ( non - Javadoc )
* @ see com . ibm . websphere . sib . api . jms . JmsConnectionFactory # setReadAhead ( java . lang . String ) */
@ Override public void setDurableSubscriptionHome ( String value ) throws JMSException { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "setDurableSubscriptionHome" , value ) ; jcaManagedConnectionFactory . setDurableSubscriptionHome ( value ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "setD... |
public class CacheProxy { /** * Associates the specified value with the specified key in the cache if there is no existing
* mapping .
* @ param key key with which the specified value is to be associated
* @ param value value to be associated with the specified key
* @ param publishToWriter if the writer should... | boolean [ ] absent = { false } ; cache . asMap ( ) . compute ( copyOf ( key ) , ( k , expirable ) -> { if ( ( expirable != null ) && ! expirable . isEternal ( ) && expirable . hasExpired ( currentTimeMillis ( ) ) ) { dispatcher . publishExpired ( this , key , expirable . get ( ) ) ; statistics . recordEvictions ( 1L ) ... |
public class SystemViewContentExporter { /** * ( non - Javadoc )
* @ see
* org . exoplatform . services . jcr . dataflow . ItemDataTraversingVisitor # entering ( org . exoplatform . services
* . jcr . datamodel . PropertyData , int ) */
@ Override protected void entering ( PropertyData property , int level ) thro... | try { // set name and type of property
AttributesImpl atts = new AttributesImpl ( ) ; atts . addAttribute ( getSvNamespaceUri ( ) , "name" , "sv:name" , "CDATA" , getExportName ( property , false ) ) ; atts . addAttribute ( getSvNamespaceUri ( ) , "type" , "sv:type" , "CDATA" , ExtendedPropertyType . nameFromValue ( pr... |
public class HessenbergSimilarDecomposition_ZDRM { /** * Computes the decomposition of the provided matrix . If no errors are detected then true is returned ,
* false otherwise .
* @ param A The matrix that is being decomposed . Not modified .
* @ return If it detects any errors or not . */
@ Override public bool... | if ( A . numRows != A . numCols ) throw new IllegalArgumentException ( "A must be square." ) ; if ( A . numRows <= 0 ) return false ; QH = A ; N = A . numCols ; if ( b . length < N * 2 ) { b = new double [ N * 2 ] ; gammas = new double [ N ] ; u = new double [ N * 2 ] ; } return _decompose ( ) ; |
public class Repository { /** * < p > asDocumentRepository . < / p >
* @ param env a { @ link com . greenpepper . server . domain . EnvironmentType } object .
* @ param user a { @ link java . lang . String } object .
* @ param pwd a { @ link java . lang . String } object .
* @ return a { @ link com . greenpeppe... | return ( DocumentRepository ) new FactoryConverter ( ) . convert ( type . asFactoryArguments ( this , env , true , user , pwd ) ) ; |
public class Cluster { /** * Check if the cluster health status is not { @ literal RED } and that the
* { @ link IndexSetRegistry # isUp ( ) deflector is up } .
* @ return { @ code true } if the the cluster is healthy and the deflector is up , { @ code false } otherwise */
public boolean isHealthy ( ) { } } | return health ( ) . map ( health -> ! "red" . equals ( health . path ( "status" ) . asText ( ) ) && indexSetRegistry . isUp ( ) ) . orElse ( false ) ; |
public class HTMLFileWriter { /** * Prints summary of Test API methods , excluding old - style verbs , in HTML format .
* @ param classDoc the classDoc of the Test API component */
public void printMethodsSummary ( ClassDoc classDoc ) { } } | MethodDoc [ ] methodDocs = TestAPIDoclet . getTestAPIComponentMethods ( classDoc ) ; if ( methodDocs . length > 0 ) { mOut . println ( "<P>" ) ; mOut . println ( "<TABLE BORDER=\"1\" WIDTH=\"100%\" CELLPADDING=\"3\" CELLSPACING=\"0\" SUMMARY=\"\">" ) ; mOut . println ( "<TR BGCOLOR=\"#CCCCFF\"><TH ALIGN=\"left\" COLSPA... |
public class OsClientV3Factory { /** * This method tries to determine if the authentication should happen by using the user provided
* information as domain ID or domain name resp . project ID or project name .
* It does so by brute forcing the four different possible combinations .
* Returns early on success .
... | // we try all four cases and return the one that works
Set < Identifiers > possibleIdentifiers = new HashSet < Identifiers > ( ) { { add ( new Identifiers ( Identifier . byName ( domainIdOrName ) , Identifier . byName ( projectIdOrName ) ) ) ; add ( new Identifiers ( Identifier . byId ( domainIdOrName ) , Identifier . ... |
public class HDFSUtil { /** * Recover the lease from HDFS , retrying multiple times . */
public void recoverFileLease ( final FileSystem fs , final Path p , Configuration conf ) throws IOException { } } | // lease recovery not needed for local file system case .
if ( ! ( fs instanceof DistributedFileSystem ) ) { return ; } recoverDFSFileLease ( ( DistributedFileSystem ) fs , p , conf ) ; |
public class Node { /** * Add or override a named attribute . < br / >
* @ param name
* The attribute name
* @ param value
* The given value
* @ return This { @ link Node } */
public Node attribute ( final String name , final String value ) { } } | this . attributes . put ( name , value ) ; return this ; |
public class JSONWriter { /** * Pop an array or object scope . < p >
* @ param c the scope to close
* @ throws JSONException zf nesting is wrong */
private void pop ( char c ) throws JSONException { } } | if ( ( m_top <= 0 ) || ( m_stack [ m_top - 1 ] != c ) ) { throw new JSONException ( "Nesting error." ) ; } m_top -= 1 ; m_mode = m_top == 0 ? 'd' : m_stack [ m_top - 1 ] ; |
public class AbstractDefinitionComparator { /** * Compare definitions
* @ param ancestorDefinition
* @ param recipientDefinition
* @ param sameDefinitionData
* @ param changedDefinitionData
* @ param newDefinitionData
* @ param removedDefinitionData */
protected void init ( T [ ] ancestorDefinition , T [ ] ... | for ( int i = 0 ; i < recipientDefinition . length ; i ++ ) { boolean isNew = true ; for ( int j = 0 ; j < ancestorDefinition . length ; j ++ ) { if ( recipientDefinition [ i ] . getName ( ) . equals ( ancestorDefinition [ j ] . getName ( ) ) ) { isNew = false ; if ( recipientDefinition [ i ] . equals ( ancestorDefinit... |
public class AnimatedImageResult { /** * Gets a decoded frame . This will only return non - null if the { @ code ImageDecodeOptions }
* were configured to decode all frames at decode time .
* @ param index the index of the frame to get
* @ return a reference to the preview bitmap which must be released by the cal... | if ( mDecodedFrames != null ) { return CloseableReference . cloneOrNull ( mDecodedFrames . get ( index ) ) ; } return null ; |
public class RelatedTablesCoreExtension { /** * Adds a media relationship between the base table and user media related
* table . Creates a default user mapping table and the media table if
* needed .
* @ param baseTableName
* base table name
* @ param mediaTable
* user media table
* @ param mappingTableN... | return addRelationship ( baseTableName , mediaTable , mappingTableName ) ; |
public class IOHelper { /** * Reads the data from the stream .
* @ param inputStream
* The inputStream
* @ return The data read from the provided stream
* @ throws IOException
* Any IO exception */
public static byte [ ] readStream ( InputStream inputStream ) throws IOException { } } | // create output stream
ByteArrayOutputStream outputStream = new ByteArrayOutputStream ( 5000 ) ; // read / write
IOHelper . readAndWriteStreams ( inputStream , outputStream ) ; // get data
byte [ ] data = outputStream . toByteArray ( ) ; return data ; |
public class SimpleDateFormat { /** * check whether the i - th item ' s level is lower than the input ' level '
* It is supposed to be used only by CLDR survey tool .
* It is used by intervalFormatByAlgorithm ( ) .
* @ param items the pattern items
* @ param i the i - th item in pattern items
* @ param level ... | if ( items [ i ] instanceof String ) { return false ; } PatternItem item = ( PatternItem ) items [ i ] ; char ch = item . type ; int patternCharIndex = getLevelFromChar ( ch ) ; if ( patternCharIndex == - 1 ) { throw new IllegalArgumentException ( "Illegal pattern character " + "'" + ch + "' in \"" + pattern + '"' ) ; ... |
public class CmsXMLSearchConfigurationParser { /** * Helper to read an optional Boolean value .
* @ param path The XML path of the element to read .
* @ return The Boolean value stored in the XML , or < code > null < / code > if the value could not be read . */
protected Boolean parseOptionalBooleanValue ( final St... | final I_CmsXmlContentValue value = m_xml . getValue ( path , m_locale ) ; if ( value == null ) { return null ; } else { final String stringValue = value . getStringValue ( null ) ; try { final Boolean boolValue = Boolean . valueOf ( stringValue ) ; return boolValue ; } catch ( final NumberFormatException e ) { LOG . in... |
public class PluginRepositoryUtil { /** * Parse an XML plugin definition .
* @ param cl
* The classloader to be used to load classes
* @ param plugin
* The plugin XML element
* @ return the parsed plugin definition * @ throws PluginConfigurationException */
@ SuppressWarnings ( "rawtypes" ) private static Plu... | // Check if the plugin definition is inside its own file
if ( getAttributeValue ( plugin , "definedIn" , false ) != null ) { StreamManager sm = new StreamManager ( ) ; String sFileName = getAttributeValue ( plugin , "definedIn" , false ) ; try { InputStream in = sm . handle ( cl . getResourceAsStream ( sFileName ) ) ; ... |
public class LocationMarshaller { /** * Marshall the given parameter object . */
public void marshall ( Location location , ProtocolMarshaller protocolMarshaller ) { } } | if ( location == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( location . getJdbc ( ) , JDBC_BINDING ) ; protocolMarshaller . marshall ( location . getS3 ( ) , S3_BINDING ) ; protocolMarshaller . marshall ( location . getDynamoDB ( ) , DYN... |
public class UiCompat { /** * Returns a themed color state list associated with a particular resource
* ID . The resource may contain either a single raw color value or a
* complex { @ link ColorStateList } holding multiple possible colors .
* @ param resources Resources
* @ param id The desired resource identi... | if ( Build . VERSION . SDK_INT >= Build . VERSION_CODES . M ) { return resources . getColorStateList ( id , null ) ; } else { return resources . getColorStateList ( id ) ; } |
public class ProtoBufJSonProcessor { /** * Deserialise a JSon string representation for a protobuf message given the class of the type .
* @ param jsonStringRep the string representation of the rst value
* @ param messageClass the message class of the type .
* @ return the deserialized message .
* @ throws org ... | try { try { Message . Builder builder = ( Message . Builder ) messageClass . getMethod ( "newBuilder" ) . invoke ( null ) ; jsonFormat . merge ( new ByteArrayInputStream ( jsonStringRep . getBytes ( Charset . forName ( UTF8 ) ) ) , builder ) ; return ( M ) builder . build ( ) ; } catch ( IOException ex ) { throw new Co... |
public class CreateIssueParams { /** * Sets the single list type custom field with Map .
* @ param customFieldMap set of the custom field identifiers and custom field item identifiers
* @ return CreateIssueParams instance */
public CreateIssueParams singleListCustomFieldMap ( Map < Long , Long > customFieldMap ) { ... | Set < Long > keySet = customFieldMap . keySet ( ) ; for ( Long key : keySet ) { parameters . add ( new NameValuePair ( "customField_" + key . toString ( ) , customFieldMap . get ( key ) . toString ( ) ) ) ; } return this ; |
public class Matchers { /** * Returns a matcher that matches attribute maps that include the given
* attribute entry .
* @ param key attribute name
* @ param value attribute value
* @ return a { @ code Map < String , Object > } matcher */
public static Matcher < Map < String , Object > > hasAttribute ( final St... | return new Matcher < Map < String , Object > > ( ) { @ Override protected boolean matchesSafely ( Map < String , Object > object ) { return object . containsKey ( key ) && value . equals ( object . get ( key ) ) ; } } ; |
public class PerServerConnectionPool { /** * function to run when a connection is acquired before returning it to caller . */
private void onAcquire ( final PooledConnection conn , String httpMethod , String uriStr , int attemptNum , CurrentPassport passport ) { } } | passport . setOnChannel ( conn . getChannel ( ) ) ; removeIdleStateHandler ( conn ) ; conn . setInUse ( ) ; if ( LOG . isDebugEnabled ( ) ) LOG . debug ( "PooledConnection acquired: " + conn . toString ( ) ) ; |
public class ObservableDataBuilder { /** * Defines the function for evaluating whether two objects have the same contents , for the purpose of determining
* notifications .
* By default , content equality is evaluated using { @ link Object # equals ( Object ) } . */
@ NonNull public ObservableDataBuilder < T > cont... | mContentEqualityFunction = contentEqualityFunction ; return this ; |
public class Activator { /** * { @ inheritDoc } */
@ Override public void stop ( BundleContext context ) throws Exception { } } | if ( hpelConfigService != null ) { for ( AbstractHPELConfigService service : hpelConfigService ) { service . stop ( ) ; } hpelConfigService = null ; } |
public class Request { /** * Creates a new Request that is configured to perform a search for places near a specified location via the Graph
* API . At least one of location or searchText must be specified .
* @ param session
* the Session to use , or null ; if non - null , the session must be in an opened state ... | if ( location == null && Utility . isNullOrEmpty ( searchText ) ) { throw new FacebookException ( "Either location or searchText must be specified." ) ; } Bundle parameters = new Bundle ( 5 ) ; parameters . putString ( "type" , "place" ) ; parameters . putInt ( "limit" , resultsLimit ) ; if ( location != null ) { param... |
public class Bzip2HuffmanStageEncoder { /** * Encodes and writes the block data . */
void encode ( ByteBuf out ) { } } | // Create optimised selector list and Huffman tables
generateHuffmanOptimisationSeeds ( ) ; for ( int i = 3 ; i >= 0 ; i -- ) { optimiseSelectorsAndHuffmanTables ( i == 0 ) ; } assignHuffmanCodeSymbols ( ) ; // Write out the tables and the block data encoded with them
writeSelectorsAndHuffmanTables ( out ) ; writeBlock... |
public class WalkerFactory { /** * Tell if the pattern can be ' walked ' with the iteration steps in natural
* document order , without duplicates .
* @ param compiler non - null reference to compiler object that has processed
* the XPath operations into an opcode map .
* @ param stepOpCodePos The opcode positi... | if ( canCrissCross ( analysis ) ) return false ; // Namespaces can present some problems , so just punt if we ' re looking for
// these .
if ( isSet ( analysis , BIT_NAMESPACE ) ) return false ; // The following , preceding , following - sibling , and preceding sibling can
// be found in doc order if we get to this poi... |
public class JKSecurityManager { /** * Check allowed privilige .
* @ param privilige the privilige
* @ throws SecurityException the security exception */
public static void checkAllowedPrivilige ( final JKPrivilige privilige ) { } } | logger . debug ( "checkAllowedPrivilige() : " , privilige ) ; final JKAuthorizer auth = getAuthorizer ( ) ; auth . checkAllowed ( privilige ) ; |
public class NodeTypeClient { /** * Returns the specified node type . Gets a list of available node types by making a list ( )
* request .
* < p > Sample code :
* < pre > < code >
* try ( NodeTypeClient nodeTypeClient = NodeTypeClient . create ( ) ) {
* ProjectZoneNodeTypeName nodeType = ProjectZoneNodeTypeNa... | GetNodeTypeHttpRequest request = GetNodeTypeHttpRequest . newBuilder ( ) . setNodeType ( nodeType ) . build ( ) ; return getNodeType ( request ) ; |
public class GoogleCloudStorageReadChannel { /** * When an IOException is thrown , depending on if the exception is caused by non - existent object
* generation , and depending on the generation read consistency setting , either retry the read ( of
* the latest generation ) , or handle the exception directly .
* ... | if ( errorExtractor . itemNotFound ( e ) ) { if ( retryWithLiveVersion ) { generation = null ; footerContent = null ; getObject . setGeneration ( null ) ; try { return getObject . executeMedia ( ) ; } catch ( IOException e1 ) { return handleExecuteMediaException ( e1 , getObject , /* retryWithLiveVersion = */
false ) ;... |
public class CommandLineApplication { /** * Invokes { @ link # exit ( ExitCode ) exit } with the provided status code .
* @ param e Exit code */
protected final void bail ( final ExitCode e ) { } } | if ( e . isFailure ( ) ) { final StringBuilder bldr = new StringBuilder ( ) ; bldr . append ( "\n" ) ; bldr . append ( getApplicationShortName ( ) ) ; bldr . append ( " failed with error " ) ; bldr . append ( e ) ; bldr . append ( "." ) ; err . println ( bldr . toString ( ) ) ; } systemExit ( e ) ; |
public class CmsExportpointsList { /** * Deletes a module exportpoint from a module . < p >
* @ param module the module to delete the dependency from
* @ param exportpoint the name of the exportpoint to delete */
private void deleteExportpoint ( CmsModule module , String exportpoint ) { } } | List oldExportpoints = module . getExportPoints ( ) ; List newExportpoints = new ArrayList ( ) ; Iterator i = oldExportpoints . iterator ( ) ; while ( i . hasNext ( ) ) { CmsExportPoint exp = ( CmsExportPoint ) i . next ( ) ; if ( ! exp . getUri ( ) . equals ( exportpoint ) ) { newExportpoints . add ( exp ) ; } } modul... |
public class WriterFactoryImpl { /** * { @ inheritDoc } */
public AnnotationTypeWriter getAnnotationTypeWriter ( AnnotationTypeDoc annotationType , Type prevType , Type nextType ) throws Exception { } } | return new AnnotationTypeWriterImpl ( configuration , annotationType , prevType , nextType ) ; |
public class TopologyBuilder { /** * Creates a platform specific stream .
* @ param sourcePi
* source processing item .
* @ return */
private Stream createStream ( IProcessingItem sourcePi ) { } } | Stream stream = this . componentFactory . createStream ( sourcePi ) ; this . topology . addStream ( stream ) ; return stream ; |
public class Initiator { /** * Invokes a write operation for the session < code > targetName < / code > and transmits the bytes in the buffer
* < code > dst < / code > . Start writing at the logical block address and transmit < code > transferLength < / code > blocks .
* @ param targetName The name of the session t... | try { multiThreadedWrite ( targetName , src , logicalBlockAddress , transferLength ) . get ( ) ; } catch ( final InterruptedException exc ) { throw new TaskExecutionException ( exc ) ; } catch ( final ExecutionException exc ) { throw new TaskExecutionException ( exc ) ; } |
public class TemplateSourceImpl { /** * provides a default class injector using the contextType ' s ClassLoader
* as a parent . */
protected ClassInjector createClassInjector ( ) throws Exception { } } | return new ResolvingInjector ( mConfig . getContextSource ( ) . getContextType ( ) . getClassLoader ( ) , new File [ ] { mCompiledDir } , mConfig . getPackagePrefix ( ) , false ) ; |
public class HttpURI { public void decodeQueryTo ( MultiMap < String > parameters , String encoding ) throws UnsupportedEncodingException { } } | decodeQueryTo ( parameters , Charset . forName ( encoding ) ) ; |
public class SipResourceAdaptor { /** * ( non - Javadoc )
* @ see javax . slee . resource . ResourceAdaptor # activityEnded ( javax . slee . resource . ActivityHandle ) */
public void activityEnded ( ActivityHandle activityHandle ) { } } | final Wrapper activity = activityManagement . remove ( ( SipActivityHandle ) activityHandle ) ; if ( activity != null ) { activity . clear ( ) ; } |
public class Input { /** * Reads the length and string of UTF8 characters , or null . This can read strings written by
* { @ link Output # writeString ( String ) } and { @ link Output # writeAscii ( String ) } .
* @ return May be null . */
public String readString ( ) { } } | if ( ! readVarIntFlag ( ) ) return readAsciiString ( ) ; // ASCII .
// Null , empty , or UTF8.
int charCount = readVarIntFlag ( true ) ; switch ( charCount ) { case 0 : return null ; case 1 : return "" ; } charCount -- ; readUtf8Chars ( charCount ) ; return new String ( chars , 0 , charCount ) ; |
public class FailureDetailsMarshaller { /** * Marshall the given parameter object . */
public void marshall ( FailureDetails failureDetails , ProtocolMarshaller protocolMarshaller ) { } } | if ( failureDetails == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( failureDetails . getType ( ) , TYPE_BINDING ) ; protocolMarshaller . marshall ( failureDetails . getMessage ( ) , MESSAGE_BINDING ) ; protocolMarshaller . marshall ( fail... |
public class MtasFunctionParserFunctionDefault { /** * ( non - Javadoc )
* @ see
* mtas . parser . function . util . MtasFunctionParserFunction # getValueDouble ( long [ ] ,
* long ) */
@ Override public double getValueDouble ( long [ ] args , long n ) throws IOException { } } | double value = 0 ; if ( args != null ) { for ( long a : args ) { value += a ; } } return value ; |
public class TTripleInt21ObjectHashMap { /** * Removes the mapping for a key from this map if it is present ( optional operation ) . More formally , if this map contains a mapping from key < code > k < / code > to value < code > v < / code > such that
* < code > key . equals ( k ) < / code > , that mapping is removed... | long key = Int21TripleHashed . key ( x , y , z ) ; return map . remove ( key ) ; |
public class CmsFlexRequest { /** * Sets the specified Map as attribute map of the request . < p >
* The map should be immutable .
* This will completely replace the attribute map .
* Use this in combination with { @ link # getAttributeMap ( ) } and
* { @ link # addAttributeMap ( Map ) } in case you want to set... | m_attributes = new HashMap < String , Object > ( map ) ; |
public class GenericStyledArea { /** * Private methods * */
private Cell < Paragraph < PS , SEG , S > , ParagraphBox < PS , SEG , S > > createCell ( Paragraph < PS , SEG , S > paragraph , BiConsumer < TextFlow , PS > applyParagraphStyle , Function < StyledSegment < SEG , S > , Node > nodeFactory ) { } } | ParagraphBox < PS , SEG , S > box = new ParagraphBox < > ( paragraph , applyParagraphStyle , nodeFactory ) ; box . highlightTextFillProperty ( ) . bind ( highlightTextFill ) ; box . wrapTextProperty ( ) . bind ( wrapTextProperty ( ) ) ; box . graphicFactoryProperty ( ) . bind ( paragraphGraphicFactoryProperty ( ) ) ; b... |
public class SchemeUtils { /** * Resolves model class hierarchy ( types recognized by orient ) .
* @ param type model class
* @ return class hierarchy */
public static List < Class < ? > > resolveHierarchy ( final Class < ? > type ) { } } | final List < Class < ? > > res = Lists . newArrayList ( ) ; Class < ? > current = type ; while ( ! Object . class . equals ( current ) && current != null ) { res . add ( current ) ; current = current . getSuperclass ( ) ; } return res ; |
public class GzipOutputHandler { /** * Write the gzip header onto the output list .
* @ param list
* @ return List < WsByteBuffer > */
private List < WsByteBuffer > writeHeader ( List < WsByteBuffer > list ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Writing gzip header information" ) ; } WsByteBuffer hdr = HttpDispatcher . getBufferManager ( ) . allocateDirect ( GZIP_Header . length ) ; hdr . put ( GZIP_Header ) ; hdr . flip ( ) ; list . add ( hdr ) ; this . haveWritten... |
public class SharedObjectService { /** * { @ inheritDoc } */
public ISharedObject getSharedObject ( IScope scope , String name , boolean persistent ) { } } | if ( ! hasSharedObject ( scope , name ) ) { createSharedObject ( scope , name , persistent ) ; } return getSharedObject ( scope , name ) ; |
public class UniqueId { /** * Attempts to convert the given string to a type enumerator
* @ param type The string to convert
* @ return a valid UniqueIdType if matched
* @ throws IllegalArgumentException if the string did not match a type
* @ since 2.0 */
public static UniqueIdType stringToUniqueIdType ( final ... | if ( type . toLowerCase ( ) . equals ( "metric" ) || type . toLowerCase ( ) . equals ( "metrics" ) ) { return UniqueIdType . METRIC ; } else if ( type . toLowerCase ( ) . equals ( "tagk" ) ) { return UniqueIdType . TAGK ; } else if ( type . toLowerCase ( ) . equals ( "tagv" ) ) { return UniqueIdType . TAGV ; } else { t... |
public class BaseTableLayout { /** * Padding at the right edge of the table . */
public BaseTableLayout < C , T > padRight ( float padRight ) { } } | this . padRight = new FixedValue < C , T > ( toolkit , padRight ) ; sizeInvalid = true ; return this ; |
public class FLVReader { /** * Load enough bytes from channel to buffer . After the loading process , the caller can make sure the amount in buffer is of size
* ' amount ' if we haven ' t reached the end of channel .
* @ param amount
* The amount of bytes in buffer after returning , no larger than bufferSize
* ... | try { if ( amount > bufferSize ) { amount = bufferSize ; } log . debug ( "Buffering amount: {} buffer size: {}" , amount , bufferSize ) ; // Read all remaining bytes if the requested amount reach the end of channel
if ( channelSize - channel . position ( ) < amount ) { amount = channelSize - channel . position ( ) ; } ... |
public class CertificateReader { /** * Make the request to the Twilio API to perform the read .
* @ param client TwilioRestClient with which to make the request
* @ return Certificate ResourceSet */
@ Override public ResourceSet < Certificate > read ( final TwilioRestClient client ) { } } | return new ResourceSet < > ( this , client , firstPage ( client ) ) ; |
public class CommerceNotificationTemplatePersistenceImpl { /** * Returns an ordered range of all the commerce notification templates where groupId = & # 63 ; and enabled = & # 63 ; .
* Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and < cod... | return findByG_E ( groupId , enabled , start , end , orderByComparator , true ) ; |
public class GenIncrementalDomCodeVisitor { /** * Visit an { @ link PrintNode } , with special cases for a variable being printed within an attribute
* declaration or as HTML content .
* < p > For attributes , if the variable is of kind attributes , it is invoked . Any other kind of
* variable is an error .
* <... | List < Expression > chunks = genJsExprsVisitor . exec ( node ) ; switch ( node . getHtmlContext ( ) ) { case HTML_TAG : getJsCodeBuilder ( ) . append ( SOY_IDOM_PRINT_DYNAMIC_ATTR . call ( INCREMENTAL_DOM , CodeChunkUtils . concatChunks ( chunks ) ) ) ; break ; case JS : // fall through
case CSS : // fall through
case ... |
public class StreamEx { /** * Creates a stream from the given input sequence around matches of the
* given pattern represented as String .
* This method is equivalent to
* { @ code StreamEx . split ( str , Pattern . compile ( regex ) ) } .
* @ param str The character sequence to be split
* @ param regex The r... | if ( str . length ( ) == 0 ) return of ( "" ) ; if ( regex . isEmpty ( ) ) { return IntStreamEx . ofChars ( str ) . mapToObj ( ch -> new String ( new char [ ] { ( char ) ch } ) ) ; } char ch = regex . charAt ( 0 ) ; if ( regex . length ( ) == 1 && ".$|()[{^?*+\\" . indexOf ( ch ) == - 1 ) { return split ( str , ch ) ; ... |
public class Languages { /** * Returns the default language as derived from PippoSettings .
* @ param applicationLanguages
* @ return the default language */
private String getDefaultLanguage ( List < String > applicationLanguages ) { } } | if ( applicationLanguages . isEmpty ( ) ) { String NO_LANGUAGES_TEXT = "Please specify the supported languages in 'application.properties'." + " For example 'application.languages=en, ro, de, pt-BR' makes 'en' your default language." ; log . error ( NO_LANGUAGES_TEXT ) ; return "en" ; } // the first language specified ... |
public class UriUtils { /** * Returns a string that encodes a collection of key / value parameters for
* URL use .
* @ param parameters The collection of key / value parameters .
* @ return A string that encodes the collection of key / value parameters for
* URL use . */
private static String getUrlParameters (... | final StringBuilder sb = new StringBuilder ( ) ; final Iterator < Pair < String , String > > i = parameters . iterator ( ) ; if ( i . hasNext ( ) ) { final Pair < String , String > first = i . next ( ) ; sb . append ( '?' ) ; sb . append ( getKeyValuePair ( first , formEncoding ) ) ; while ( i . hasNext ( ) ) { final P... |
public class EdgeIntensityPolygon { /** * Checks to see if its a valid polygon or a false positive by looking at edge intensity
* @ param polygon The polygon being tested
* @ param ccw True if the polygon is counter clockwise
* @ return true if it could compute the edge intensity , otherwise false */
public boole... | averageInside = 0 ; averageOutside = 0 ; double tangentSign = ccw ? 1 : - 1 ; int totalSides = 0 ; for ( int i = polygon . size ( ) - 1 , j = 0 ; j < polygon . size ( ) ; i = j , j ++ ) { Point2D_F64 a = polygon . get ( i ) ; Point2D_F64 b = polygon . get ( j ) ; double dx = b . x - a . x ; double dy = b . y - a . y ; ... |
public class ElasticIP { /** * Identify if the string is an IP address , e . g . x . x . x . x or x : x : x : x : x : x : x : x
* @ param address IP address to test
* @ return true if parameter is a normal IPv4 or IPv6 address */
private boolean isIPAddress ( @ Nonnull String address ) { } } | return ( InetAddressUtils . isIPv4Address ( address ) || InetAddressUtils . isIPv6Address ( address ) ) ; |
public class UniqueClassNameValidator { /** * Marks a type as already defined .
* @ param type - the type to mark already defined .
* @ param fileName - a file where the type is already defined .
* If fileName is null this information will not be part of the message . */
protected void addIssue ( final JvmDeclare... | StringConcatenation _builder = new StringConcatenation ( ) ; _builder . append ( "The type " ) ; String _simpleName = type . getSimpleName ( ) ; _builder . append ( _simpleName ) ; _builder . append ( " is already defined" ) ; { if ( ( fileName != null ) ) { _builder . append ( " in " ) ; _builder . append ( fileName )... |
public class UIComponentBase { /** * < p class = " changed _ added _ 2_0 " > This is a default implementation of
* { @ link javax . faces . component . behavior . ClientBehaviorHolder # getClientBehaviors } .
* < code > UIComponent < / code > does not implement the
* { @ link javax . faces . component . behavior ... | if ( null == behaviors ) { return Collections . emptyMap ( ) ; } return behaviors ; |
public class SequentialEvent { /** * Adds a { @ linkplain SuppressedEvent } to the set of suppressed events of
* this Event . If a capable EventProvider determines that a certain event
* has been prevented because its listener class has been registered on this
* event using { @ link # preventCascade ( Class ) } ,... | if ( e == null ) { throw new IllegalArgumentException ( "e is null" ) ; } else if ( this . suppressedEvents == null ) { this . suppressedEvents = new HashSet < > ( ) ; } this . suppressedEvents . add ( e ) ; |
public class TypeChecker { /** * Creates a recursing type checker for a { @ link java . util . List } .
* @ param elementChecker The typechecker to check the elements with
* @ return a typechecker for a List containing elements passing the specified type checker */
public static < T > TypeChecker < List < ? extends... | return new CollectionTypeChecker < > ( List . class , elementChecker ) ; |
public class Prober { /** * Start probing , waiting for { @ code condition } to become true .
* < p > This method is blocking : It returns when condition becomes true or throws an exception if timeout is reached . < / p >
* @ param timeoutInMs wait time in milliseconds */
public void probe ( long timeoutInMs ) { } ... | long start = System . nanoTime ( ) ; try { while ( ! condition . call ( ) && ( elapsedMs ( start ) < timeoutInMs ) ) { Thread . yield ( ) ; } if ( ! condition . call ( ) ) { throw new IllegalStateException ( "probe condition not true after " + timeoutInMs ) ; } } catch ( Exception e ) { throw new RuntimeException ( e )... |
public class LogManager { /** * we return the given default value . */
int getIntProperty ( String name , int defaultValue ) { } } | String val = getProperty ( name ) ; if ( val == null ) { return defaultValue ; } try { return Integer . parseInt ( val . trim ( ) ) ; } catch ( Exception ex ) { return defaultValue ; } |
public class CompactDecimalDataCache { /** * Fetch data for a particular locale . Clients must not modify any part of the returned data . Portions of returned
* data may be shared so modifying it will have unpredictable results . */
DataBundle get ( ULocale locale ) { } } | DataBundle result = cache . get ( locale ) ; if ( result == null ) { result = load ( locale ) ; cache . put ( locale , result ) ; } return result ; |
public class AwsSecurityFinding { /** * A list of malware related to a finding .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setMalware ( java . util . Collection ) } or { @ link # withMalware ( java . util . Collection ) } if you want to override
* the... | if ( this . malware == null ) { setMalware ( new java . util . ArrayList < Malware > ( malware . length ) ) ; } for ( Malware ele : malware ) { this . malware . add ( ele ) ; } return this ; |
public class SelectAlgorithmAndInputPanel { /** * Enables / disables the ability to interact with the algorithms GUI . */
private void setActiveGUI ( final boolean isEnabled ) { } } | SwingUtilities . invokeLater ( new Runnable ( ) { public void run ( ) { toolbar . setEnabled ( isEnabled ) ; for ( JComboBox b : algBoxes ) { b . setEnabled ( isEnabled ) ; } for ( JComponent b : addedComponents ) { b . setEnabled ( isEnabled ) ; } imageBox . setEnabled ( isEnabled ) ; } } ) ; |
public class ChangesListener { /** * What to do if data size exceeded quota limit . Throwing exception or logging only .
* Depends on preconfigured parameter .
* @ param message
* the detail message for exception or log operation
* @ throws ExceededQuotaLimitException
* if current behavior is { @ link Exceede... | switch ( exceededQuotaBehavior ) { case EXCEPTION : throw new ExceededQuotaLimitException ( message ) ; case WARNING : LOG . warn ( message ) ; break ; } |
public class Reflect { /** * Class new instance or null , wrap exception handling and
* instance cache . */
public static Object getNewInstance ( Class < ? > type ) { } } | if ( instanceCache . containsKey ( type ) ) return instanceCache . get ( type ) ; try { instanceCache . put ( type , type . getConstructor ( ) . newInstance ( ) ) ; } catch ( IllegalArgumentException | ReflectiveOperationException | SecurityException e ) { instanceCache . put ( type , null ) ; } return instanceCache . ... |
public class BootstrapSocketConnector { /** * Connects to an OOo server using the specified host and port for the
* socket and returns a component context for using the connection to the
* OOo server .
* @ param host The host
* @ param port The port
* @ return The component context */
public XComponentContext... | String unoConnectString = "uno:socket,host=" + host + ",port=" + port + ";urp;StarOffice.ComponentContext" ; return connect ( unoConnectString ) ; |
public class MMapBuffer { /** * this is not particularly useful , the syscall takes forever */
public void advise ( long position , long length ) throws IOException { } } | final long ap = address + position ; final long a = ( ap ) / PAGE_SIZE * PAGE_SIZE ; final long l = Math . min ( length + ( ap - a ) , address + memory . length ( ) - ap ) ; final int err = madvise ( a , l ) ; if ( err != 0 ) { throw new IOException ( "madvise failed with error code: " + err ) ; } |
public class CipherSupplier { /** * visible for testing */
Cipher forMode ( int ciphermode , SecretKey key , AlgorithmParameterSpec params ) { } } | final Cipher cipher = threadLocal . get ( ) ; try { cipher . init ( ciphermode , key , params ) ; return cipher ; } catch ( InvalidKeyException e ) { throw new IllegalArgumentException ( "Invalid key." , e ) ; } catch ( InvalidAlgorithmParameterException e ) { throw new IllegalArgumentException ( "Algorithm parameter n... |
public class ResponseSetCookieDissector { @ Override public void dissect ( final Parsable < ? > parsable , final String inputname ) throws DissectionFailure { } } | final ParsedField field = parsable . getParsableField ( INPUT_TYPE , inputname ) ; final String fieldValue = field . getValue ( ) . getString ( ) ; if ( fieldValue == null || fieldValue . isEmpty ( ) ) { return ; // Nothing to do here
} String [ ] parts = fieldValue . split ( ";" ) ; for ( int i = 0 ; i < parts . lengt... |
public class MethodValidator { /** * Returns the internacionalized message for this constraint violation . */
protected String extractInternacionalizedMessage ( ConstraintViolation < Object > v ) { } } | return interpolator . interpolate ( v . getMessageTemplate ( ) , new BeanValidatorContext ( v ) , locale . get ( ) ) ; |
public class CommitsApi { /** * Get a list of repository commits in a project .
* < pre > < code > GitLab Endpoint : GET / projects / : id / repository / commits < / code > < / pre >
* @ param projectIdOrPath the project in the form of an Integer ( ID ) , String ( path ) , or Project instance
* @ param ref the na... | Form formData = new GitLabApiForm ( ) . withParam ( "ref_name" , ref ) . withParam ( "since" , ISO8601 . toString ( since , false ) ) . withParam ( "until" , ISO8601 . toString ( until , false ) ) . withParam ( "path" , ( path == null ? null : urlEncode ( path ) ) ) . withParam ( PAGE_PARAM , page ) . withParam ( PER_P... |
public class DirectoryCodeBase { /** * ( non - Javadoc )
* @ see
* edu . umd . cs . findbugs . classfile . ICodeBase # lookupResource ( java . lang . String ) */
@ Override public ICodeBaseEntry lookupResource ( String resourceName ) { } } | // Translate resource name , in case a resource name
// has been overridden and the resource is being accessed
// using the overridden name .
resourceName = translateResourceName ( resourceName ) ; File file = getFullPathOfResource ( resourceName ) ; if ( ! file . exists ( ) ) { return null ; } return new DirectoryCode... |
public class ManagementResource { /** * ( non - Javadoc )
* @ see net . roboconf . dm . rest . services . internal . resources . IManagementResource
* # loadUploadedZippedApplicationTemplate ( java . io . InputStream , com . sun . jersey . core . header . FormDataContentDisposition ) */
@ Override public Response l... | this . logger . fine ( "Request: load application from an uploaded ZIP file (" + fileDetail . getFileName ( ) + ")." ) ; File tempZipFile = new File ( System . getProperty ( "java.io.tmpdir" ) , fileDetail . getFileName ( ) ) ; Response response ; try { // Copy the uploaded ZIP file on the disk
Utils . copyStream ( upl... |
public class BaseUpdateProvider { /** * 通过主键更新全部字段
* @ param ms */
public String updateByPrimaryKey ( MappedStatement ms ) { } } | Class < ? > entityClass = getEntityClass ( ms ) ; StringBuilder sql = new StringBuilder ( ) ; sql . append ( SqlHelper . updateTable ( entityClass , tableName ( entityClass ) ) ) ; sql . append ( SqlHelper . updateSetColumns ( entityClass , null , false , false ) ) ; sql . append ( SqlHelper . wherePKColumns ( entityCl... |
public class BytecodeUtils { /** * Returns an { @ link Expression } that evaluates to the { @ link ContentKind } value that is
* equivalent to the given { @ link SanitizedContentKind } , or null . */
public static Expression constantSanitizedContentKindAsContentKind ( @ Nullable SanitizedContentKind kind ) { } } | return ( kind == null ) ? BytecodeUtils . constantNull ( CONTENT_KIND_TYPE ) : FieldRef . enumReference ( ContentKind . valueOf ( kind . name ( ) ) ) . accessor ( ) ; |
public class AndroidVariantEndpoint { /** * Update Android Variant
* @ param id id of { @ link PushApplication }
* @ param androidID id of { @ link AndroidVariant }
* @ param updatedAndroidApplication new info of { @ link AndroidVariant }
* @ return updated { @ link AndroidVariant }
* @ statuscode 200 The And... | AndroidVariant androidVariant = ( AndroidVariant ) variantService . findByVariantID ( androidID ) ; if ( androidVariant != null ) { // some validation
try { validateModelClass ( updatedAndroidApplication ) ; } catch ( ConstraintViolationException cve ) { logger . info ( "Unable to update Android Variant '{}'" , android... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.