signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link CreditMemo } { @ code > } } */
@ XmlElementDecl ( namespace = "http://schema.intuit.com/finance/v3" , name = "CreditMemo" , substitutionHeadNamespace = "http://schema.intuit.com/finance/v3" , substitutionHeadName = "IntuitObject" ) public JAXBElement < CreditMemo > createCreditMemo ( CreditMemo value ) { } } | return new JAXBElement < CreditMemo > ( _CreditMemo_QNAME , CreditMemo . class , null , value ) ; |
public class MatchParserImpl { /** * | PrimaryNotPlusMinus */
final public Selector Primary ( boolean negated ) throws ParseException { } } | Selector ans ; int op = Operator . PLUS ; switch ( ( jj_ntk == - 1 ) ? jj_ntk ( ) : jj_ntk ) { case 11 : case TRUE : case FALSE : case IDENTIFIER : case QUOTED_IDENTIFIER : case INTEGER_LITERAL : case FLOATING_POINT_LITERAL : case STRING_LITERAL : ans = PrimaryNotPlusMinus ( negated ) ; break ; case 7 : case 8 : op = PlusMinus ( ) ; negated ^= ( op == Operator . MINUS ) ; ans = Primary ( negated ) ; break ; default : jj_la1 [ 9 ] = jj_gen ; jj_consume_token ( - 1 ) ; throw new ParseException ( ) ; } { if ( true ) return ans ; } throw new Error ( "Missing return statement in function" ) ; |
public class ToolInstaller { /** * Convenience method to find a location to install a tool .
* @ param tool the tool being installed
* @ param node the computer on which to install the tool
* @ return { @ link ToolInstallation # getHome } if specified , else a path within the local
* Jenkins work area named according to { @ link ToolInstallation # getName }
* @ since 1.310 */
protected final FilePath preferredLocation ( ToolInstallation tool , Node node ) { } } | if ( node == null ) { throw new IllegalArgumentException ( "must pass non-null node" ) ; } String home = Util . fixEmptyAndTrim ( tool . getHome ( ) ) ; if ( home == null ) { home = sanitize ( tool . getDescriptor ( ) . getId ( ) ) + File . separatorChar + sanitize ( tool . getName ( ) ) ; } FilePath root = node . getRootPath ( ) ; if ( root == null ) { throw new IllegalArgumentException ( "Node " + node . getDisplayName ( ) + " seems to be offline" ) ; } return root . child ( "tools" ) . child ( home ) ; |
public class RepositoryDownloadUtil { /** * Checks if Feature or Addon has visibility public or install
* OR checks if the resource is a Product sample or open source to see if it is a public asset .
* @ param resourceType - type of repository
* @ param installResource - represents a resouce in a repository
* @ return - true if the resource is visible to the public */
public static boolean isPublicAsset ( ResourceType resourceType , RepositoryResource installResource ) { } } | if ( resourceType . equals ( ResourceType . FEATURE ) || resourceType . equals ( ResourceType . ADDON ) ) { EsaResource esar = ( ( EsaResource ) installResource ) ; if ( esar . getVisibility ( ) . equals ( Visibility . PUBLIC ) || esar . getVisibility ( ) . equals ( Visibility . INSTALL ) ) { return true ; } } else if ( resourceType . equals ( ResourceType . PRODUCTSAMPLE ) || resourceType . equals ( ResourceType . OPENSOURCE ) ) { return true ; } return false ; |
public class SaltBasedExporter { /** * invokes the createAdjacencyMatrix method , if nodeCount ! = null or outputText otherwise */
private void convertSaltProject ( SaltProject p , List < String > annoKeys , Map < String , String > args , boolean alignmc , int offset , Map < String , CorpusConfig > corpusConfigs , Writer out , Integer nodeCount ) throws IOException , IllegalArgumentException { } } | int recordNumber = offset ; if ( p != null && p . getCorpusGraphs ( ) != null ) { Map < String , String > spanAnno2order = null ; boolean virtualTokenizationFromNamespace = false ; Set < String > corpusNames = CommonHelper . getToplevelCorpusNames ( p ) ; if ( ! corpusNames . isEmpty ( ) ) { CorpusConfig config = corpusConfigs . get ( corpusNames . iterator ( ) . next ( ) ) ; if ( config != null ) { if ( "true" . equalsIgnoreCase ( config . getConfig ( "virtual_tokenization_from_namespace" ) ) ) { virtualTokenizationFromNamespace = true ; } else { String mappingRaw = config . getConfig ( "virtual_tokenization_mapping" ) ; if ( mappingRaw != null ) { spanAnno2order = new HashMap < > ( ) ; for ( String singleMapping : Splitter . on ( ',' ) . split ( mappingRaw ) ) { List < String > mappingParts = Splitter . on ( '=' ) . splitToList ( singleMapping ) ; if ( mappingParts . size ( ) >= 2 ) { spanAnno2order . put ( mappingParts . get ( 0 ) , mappingParts . get ( 1 ) ) ; } } } } } } for ( SCorpusGraph corpusGraph : p . getCorpusGraphs ( ) ) { if ( corpusGraph . getDocuments ( ) != null ) { for ( SDocument doc : corpusGraph . getDocuments ( ) ) { if ( virtualTokenizationFromNamespace ) { TimelineReconstructor . removeVirtualTokenizationUsingNamespace ( doc . getDocumentGraph ( ) ) ; } else if ( spanAnno2order != null ) { // there is a definition how to map the virtual tokenization to a real one
TimelineReconstructor . removeVirtualTokenization ( doc . getDocumentGraph ( ) , spanAnno2order ) ; } if ( nodeCount != null ) { createAdjacencyMatrix ( doc . getDocumentGraph ( ) , args , recordNumber ++ , nodeCount ) ; } else { outputText ( doc . getDocumentGraph ( ) , alignmc , recordNumber ++ , out ) ; } } } } } |
public class JTune { /** * Returns the rendition object ( JNote , JChord . . . ) for
* the given notation ( Note , MultiNote ) */
public JScoreElement getRenditionObjectFor ( MusicElement musicElement ) { } } | JScoreElement ret = getRenditionObjectFor ( musicElement . getReference ( ) ) ; // If it ' s a Note , look for chords which may contain this note
/* if ( ( ret = = null ) & & ( musicElement instanceof Note ) ) {
Note note = ( Note ) musicElement ;
Enumeration e = m _ scoreElements . keys ( ) ;
while ( e . hasMoreElements ( ) ) {
MusicElement m = ( MusicElement ) e . nextElement ( ) ;
if ( ( m instanceof MultiNote )
& & ( ( ( MultiNote ) m ) . contains ( note ) ) ) {
JChord chord = ( JChord ) m _ scoreElements . get ( m ) ;
if ( chord . m _ normalizedChords = = null ) {
JNote [ ] jnotes = chord . getScoreElements ( ) ;
for ( int i = 0 ; i < jnotes . length ; i + + ) {
if ( jnotes [ i ] . getMusicElement ( ) . equals ( note ) )
return ( jnotes [ i ] ) ; */
return ret ; |
public class IntelInflater { /** * Sets input data for compression . This should be called whenever
* needsInput ( ) returns true indicating that more input data is required .
* @ param b the input data bytes
* @ param off the start offset of the data
* @ param len the length of the data
* @ see IntelDeflater # needsInput */
@ Override public void setInput ( byte [ ] b , int off , int len ) throws NullPointerException { } } | if ( lz_stream == 0 ) reset ( ) ; if ( b == null ) { throw new NullPointerException ( "Input is null" ) ; } if ( len <= 0 ) { throw new NullPointerException ( "Input buffer length is zero." ) ; } inputBuffer = b ; inputBufferOffset = off ; inputBufferLength = len ; |
public class ChannelUtils { /** * Load channel factories in the framework based on the provided factory
* configurations .
* @ param factories
* @ return List < String > - factories created successfully */
private static List < String > loadFactories ( Map < String , String [ ] > factories ) { } } | final boolean bTrace = TraceComponent . isAnyTracingEnabled ( ) ; final ChannelFramework cf = ChannelFrameworkFactory . getChannelFramework ( ) ; List < String > createdFactories = new ArrayList < String > ( factories . size ( ) ) ; String key , value ; for ( Entry < String , String [ ] > entry : factories . entrySet ( ) ) { Class < ? > factoryType = cf . lookupFactory ( entry . getKey ( ) ) ; if ( null == factoryType ) { if ( bTrace && tc . isEventEnabled ( ) ) { Tr . event ( tc , "Delay; missing factory type " + entry . getKey ( ) ) ; } delayedConfig . put ( FACTORY_PREFIX + entry . getKey ( ) , entry . getValue ( ) ) ; createdFactories . add ( entry . getKey ( ) ) ; continue ; } String [ ] props = entry . getValue ( ) ; for ( int i = 0 ; i < props . length ; i ++ ) { key = extractKey ( props [ i ] ) ; value = extractValue ( props [ i ] ) ; if ( null != key && null != value ) { try { cf . updateChannelFactoryProperty ( factoryType , key , value ) ; } catch ( ChannelFactoryException e ) { FFDCFilter . processException ( e , "ChannelUtils.loadFactories" , "update" , new Object [ ] { entry , cf } ) ; if ( bTrace && tc . isEventEnabled ( ) ) { Tr . event ( tc , "Unable to update factory prop; " + factoryType + " " + key + "=" + value ) ; } } } } try { // Note : this is a find or create api , not just " get "
cf . getChannelFactory ( factoryType ) ; createdFactories . add ( entry . getKey ( ) ) ; } catch ( ChannelFactoryException e ) { // ignore it
} } // end - factories
return createdFactories ; |
public class DefaultErrorReporter { /** * method rewritten for defect 105840 */
public static void printFullStackTrace ( PrintWriter out , ServletException e ) { } } | // determine the absolute root exception
Throwable th = null ; while ( e != null ) { th = e . getRootCause ( ) ; if ( th == null ) { th = e ; break ; } else e = th instanceof ServletException ? ( ServletException ) th : null ; } // now print the root exception
try { // if th is a ServletErrorReport , it ' s already encoded . . . if not , encode it
if ( th instanceof ServletErrorReport ) out . println ( "<HR width=\"100%\">\n" + th . getMessage ( ) + "<BR>" ) ; else out . println ( "<HR width=\"100%\">\n" + encodeChars ( th . getMessage ( ) ) + "<BR>" ) ; // print the stack trace to a string writer so we can encode it if necessary and format
// its output
StringWriter sw = new StringWriter ( ) ; PrintWriter pw = new PrintWriter ( sw ) ; th . printStackTrace ( pw ) ; pw . flush ( ) ; String traceOut ; // if it ' s a ServletErrorReport , it ' s already encoded . . . if not , encode it
if ( th instanceof ServletErrorReport ) traceOut = sw . toString ( ) ; else traceOut = encodeChars ( sw . toString ( ) ) ; // split the stack lines so they ' ll appear right in the browser
StringTokenizer st = new StringTokenizer ( traceOut , "\n" ) ; while ( st . hasMoreTokens ( ) ) { out . println ( st . nextToken ( ) ) ; out . println ( "<BR> " ) ; } out . println ( "<BR>" ) ; } catch ( EmptyStackException ex ) { com . ibm . wsspi . webcontainer . util . FFDCWrapper . processException ( ex , "com.ibm.ws.webcontainer.servlet.DefaultErrorReporter.printFullStackTrace" , "158" ) ; } |
public class ProducerProperties { /** * Set the ttl on the basis of the producer .
* @ param pri */
public void setInTTL ( long ttl ) throws JMSException { } } | if ( inTTL != ttl ) { // Now verify that the value for TTL is valid .
if ( ttl < 0 || ttl > MfpConstants . MAX_TIME_TO_LIVE ) { throw ( JMSException ) JmsErrorUtils . newThrowable ( JMSException . class , "INVALID_VALUE_CWSIA0301" , new Object [ ] { "timeToLive" , "" + ttl } , tc ) ; } inTTL = ttl ; recalcOutTTL ( ) ; } |
public class AbstractScope { /** * Returns the closest container scope . This is equivalent to what the current scope would have
* been for non - ES6 scope creators , and is thus useful for migrating code to use block scopes . */
public final S getClosestContainerScope ( ) { } } | S scope = getClosestHoistScope ( ) ; if ( scope . isBlockScope ( ) ) { scope = scope . getParent ( ) ; checkState ( ! scope . isBlockScope ( ) ) ; } return scope ; |
public class JBossCompatibilityExtension { /** * Adds the JBoss server executor as a dependency to the given service .
* Copied from org . jboss . as . server . Services - JBoss 7.2.0 . Final */
public static void addServerExecutorDependency ( ServiceBuilder < ? > serviceBuilder , InjectedValue < ExecutorService > injector , boolean optional ) { } } | ServiceBuilder . DependencyType type = optional ? ServiceBuilder . DependencyType . OPTIONAL : ServiceBuilder . DependencyType . REQUIRED ; serviceBuilder . addDependency ( type , JBOSS_SERVER_EXECUTOR , ExecutorService . class , injector ) ; |
public class HTTP { /** * Extracts the response data from the open http connection
* @ param connection - the open connection of the http call
* @ return Response : the response provided from the http call */
@ SuppressWarnings ( { } } | "squid:S3776" , "squid:S2093" } ) private Response getResponse ( HttpURLConnection connection ) { int status ; Map headers ; try { status = connection . getResponseCode ( ) ; headers = connection . getHeaderFields ( ) ; } catch ( IOException e ) { log . error ( e ) ; return null ; } JsonObject object = null ; JsonArray array = null ; String data = null ; BufferedReader rd = null ; // unable to use the try - with - resources block , as the rd needs to be read in the finally , and can ' t be closed
try { rd = new BufferedReader ( new InputStreamReader ( connection . getInputStream ( ) ) ) ; } catch ( IOException e ) { log . warn ( e ) ; try { rd = new BufferedReader ( new InputStreamReader ( connection . getErrorStream ( ) ) ) ; } catch ( NullPointerException ee ) { log . warn ( ee ) ; } } finally { StringBuilder sb = new StringBuilder ( ) ; String line ; if ( rd != null ) { try { while ( ( line = rd . readLine ( ) ) != null ) { sb . append ( line ) ; } } catch ( IOException e ) { log . error ( e ) ; } try { rd . close ( ) ; } catch ( IOException e ) { log . error ( e ) ; } data = sb . toString ( ) ; JsonParser parser = new JsonParser ( ) ; try { object = ( JsonObject ) parser . parse ( data ) ; } catch ( JsonSyntaxException | ClassCastException e ) { log . debug ( e ) ; try { array = ( JsonArray ) parser . parse ( data ) ; } catch ( JsonSyntaxException | ClassCastException ee ) { log . debug ( ee ) ; } } } } return new Response ( reporter , headers , status , object , array , data ) ; |
public class ResultUtil { /** * " key " : " demoproject " ,
* " doc _ count " : 30,
* " successsums " : {
* " doc _ count _ error _ upper _ bound " : 0,
* " sum _ other _ doc _ count " : 0,
* " buckets " : [
* " key " : 0,
* " doc _ count " : 30
* @ param map
* @ param metrics successsums
* @ return */
public static Map < String , Object > getAggregationMetrics ( Map < String , ? > map , String metrics ) { } } | if ( map != null ) { return ( Map < String , Object > ) map . get ( metrics ) ; } return ( Map < String , Object > ) null ; |
public class Transform { /** * Build Java code to represent a single . class reference .
* This will be an argument of the form " pkg . Cls1 . class " or " pkg . Cls2 [ ] . class " or " primtype . class "
* @ param builder the builder in which to build the argument
* @ param cls the type for the argument */
protected static void buildClassArgument ( StringBuilder builder , Class cls ) { } } | buildClass ( builder , cls ) ; builder . append ( ".class" ) ; |
public class GetCampaignCriterionBidModifierSimulations { /** * Runs the example .
* @ param adWordsServices the services factory .
* @ param session the session .
* @ param campaignId the ID of the campaign .
* @ throws ApiException if the API request failed with one or more service errors .
* @ throws RemoteException if the API request failed due to other errors . */
public static void runExample ( AdWordsServicesInterface adWordsServices , AdWordsSession session , Long campaignId ) throws RemoteException { } } | // Get the DataService .
DataServiceInterface dataService = adWordsServices . get ( session , DataServiceInterface . class ) ; // Create selector .
Selector selector = new SelectorBuilder ( ) . fields ( DataField . BidModifier , DataField . CampaignId , DataField . CriterionId , DataField . StartDate , DataField . EndDate , DataField . LocalClicks , DataField . LocalCost , DataField . LocalImpressions , DataField . TotalLocalClicks , DataField . TotalLocalCost , DataField . TotalLocalImpressions , DataField . RequiredBudget ) . equals ( DataField . CampaignId , campaignId . toString ( ) ) . limit ( PAGE_SIZE ) . build ( ) ; // Display bid landscapes .
int landscapePointsInPreviousPage = 0 ; int startIndex = 0 ; do { // Offset the start index by the number of landscape points in the last retrieved page ,
// NOT the number of entries ( bid landscapes ) in the page .
startIndex += landscapePointsInPreviousPage ; selector . getPaging ( ) . setStartIndex ( startIndex ) ; // Reset the count of landscape points in preparation for processing the next page .
landscapePointsInPreviousPage = 0 ; // Request the next page of bid landscapes .
CriterionBidLandscapePage page = dataService . getCampaignCriterionBidLandscape ( selector ) ; if ( page . getEntries ( ) != null ) { for ( CriterionBidLandscape criterionBidLandscape : page . getEntries ( ) ) { System . out . printf ( "Found campaign-level criterion bid modifier landscape for" + " criterion with ID %d, start date '%s', end date '%s', and" + " landscape points:%n" , criterionBidLandscape . getCriterionId ( ) , criterionBidLandscape . getStartDate ( ) , criterionBidLandscape . getEndDate ( ) ) ; for ( BidLandscapeLandscapePoint bidLandscapePoint : criterionBidLandscape . getLandscapePoints ( ) ) { landscapePointsInPreviousPage ++ ; System . out . printf ( " {bid modifier: %.2f => clicks: %d, cost: %d, impressions: %d, " + "total clicks: %d, total cost: %d, total impressions: %d, and " + "required budget: %d%n" , bidLandscapePoint . getBidModifier ( ) , bidLandscapePoint . getClicks ( ) , bidLandscapePoint . getCost ( ) . getMicroAmount ( ) , bidLandscapePoint . getImpressions ( ) , bidLandscapePoint . getTotalLocalClicks ( ) , bidLandscapePoint . getTotalLocalCost ( ) . getMicroAmount ( ) , bidLandscapePoint . getTotalLocalImpressions ( ) , bidLandscapePoint . getRequiredBudget ( ) . getMicroAmount ( ) ) ; } } } } while ( landscapePointsInPreviousPage >= PAGE_SIZE ) ; |
public class ChainedTransformationTools { /** * Call when starting a new chain of model versions . This will copy the { @ link ResourceTransformationContext } instance , using the extra resolver
* to resolve the children of the placeholder resource .
* @ param context the context to copy . It should be at a chained placeholder
* @ param placeholderResolver the extra resolver to use to resolve the placeholder ' s children for the first model version delta in the chain
* @ return a new { @ code ResourceTransformationContext } instance using the extra resolver */
public static ResourceTransformationContext initialiseChain ( ResourceTransformationContext context , PlaceholderResolver placeholderResolver ) { } } | assert context instanceof ResourceTransformationContextImpl : "Wrong type of context" ; ResourceTransformationContextImpl ctx = ( ResourceTransformationContextImpl ) context ; return ctx . copy ( placeholderResolver ) ; |
public class OrderableDBInstanceOption { /** * A list of the available processor features for the DB instance class of a DB instance .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setAvailableProcessorFeatures ( java . util . Collection ) } or
* { @ link # withAvailableProcessorFeatures ( java . util . Collection ) } if you want to override the existing values .
* @ param availableProcessorFeatures
* A list of the available processor features for the DB instance class of a DB instance .
* @ return Returns a reference to this object so that method calls can be chained together . */
public OrderableDBInstanceOption withAvailableProcessorFeatures ( AvailableProcessorFeature ... availableProcessorFeatures ) { } } | if ( this . availableProcessorFeatures == null ) { setAvailableProcessorFeatures ( new com . amazonaws . internal . SdkInternalList < AvailableProcessorFeature > ( availableProcessorFeatures . length ) ) ; } for ( AvailableProcessorFeature ele : availableProcessorFeatures ) { this . availableProcessorFeatures . add ( ele ) ; } return this ; |
public class HttpClock { /** * ~ Methoden - - - - - */
@ Override protected Moment doConnect ( ) throws IOException , ParseException { } } | final NetTimeConfiguration cfg = this . getNetTimeConfiguration ( ) ; URL url = new URL ( cfg . getTimeServerAddress ( ) ) ; int timeoutMillis = MathUtils . safeMultiply ( cfg . getConnectionTimeout ( ) , 1000 ) ; HttpURLConnection conn = ( HttpURLConnection ) url . openConnection ( ) ; conn . setConnectTimeout ( timeoutMillis ) ; conn . setReadTimeout ( timeoutMillis ) ; conn . setUseCaches ( false ) ; conn . setRequestMethod ( "HEAD" ) ; int responseCode = conn . getResponseCode ( ) ; if ( responseCode >= 200 && responseCode <= 399 ) { return JAVA_UTIL_DATE . translate ( new Date ( conn . getDate ( ) ) ) ; } throw new IOException ( "HTTP server status: " + responseCode ) ; |
public class CaseInsensitiveIntMap { /** * Puts a new value in the property table with the appropriate flags */
public int get ( char [ ] key , int length ) { } } | if ( key == null ) return NULL ; int hash = hash ( key , length ) & _mask ; while ( true ) { char [ ] mapKey = _keys [ hash ] ; if ( mapKey == null ) return NULL ; else if ( equals ( mapKey , key , length ) ) return _values [ hash ] ; hash = ( hash + 1 ) & _mask ; } |
public class BfsFileImpl { /** * Renames to a destination file */
@ Override @ Direct public void renameTo ( String relPath , Result < Boolean > result , WriteOption ... options ) { } } | _root . renameTo ( _path , toAbsolute ( relPath ) , result , options ) ; |
public class DefaultGroovyMethods { /** * Sorts the given array into sorted order using the given comparator .
* @ param self the array to be sorted
* @ param comparator a Comparator used for the comparison
* @ return the sorted array
* @ since 1.5.5 */
public static < T > T [ ] sort ( T [ ] self , Comparator < T > comparator ) { } } | return sort ( self , true , comparator ) ; |
public class CodeQualityEvaluator { /** * It will return response when codeQuality details not found in given date range .
* @ param codeQualityCollectorItem
* @ return missing details audit - resoonse . */
private CodeQualityAuditResponse codeQualityDetailsForMissingStatus ( CollectorItem codeQualityCollectorItem ) { } } | CodeQualityAuditResponse detailsMissing = new CodeQualityAuditResponse ( ) ; detailsMissing . addAuditStatus ( CodeQualityAuditStatus . CODE_QUALITY_DETAIL_MISSING ) ; detailsMissing . setLastUpdated ( codeQualityCollectorItem . getLastUpdated ( ) ) ; List < CodeQuality > codeQualities = codeQualityRepository . findByCollectorItemIdOrderByTimestampDesc ( codeQualityCollectorItem . getId ( ) ) ; for ( CodeQuality returnCodeQuality : codeQualities ) { detailsMissing . setUrl ( returnCodeQuality . getUrl ( ) ) ; detailsMissing . setName ( returnCodeQuality . getName ( ) ) ; detailsMissing . setLastExecutionTime ( returnCodeQuality . getTimestamp ( ) ) ; } return detailsMissing ; |
public class FoundationLoggingPatternConverter { /** * Format event to string buffer .
* @ param sbuf
* string buffer to receive formatted event , may not be null .
* @ param event
* event to format , may not be null . */
@ Override public void format ( final StringBuffer sbuf , final LoggingEvent event ) { } } | for ( int i = 0 ; i < patternConverters . length ; i ++ ) { final int startField = sbuf . length ( ) ; patternConverters [ i ] . format ( event , sbuf ) ; patternFields [ i ] . format ( startField , sbuf ) ; } |
public class JDBDT { /** * Dump the contents of a data set ( output file variant ) .
* The output file will be GZIP - compressed if it has a < code > . gz < / code > extension .
* @ param data Data set .
* @ param outputFile Output file . */
public static void dump ( DataSet data , File outputFile ) { } } | try ( Log log = Log . create ( outputFile ) ) { log . write ( CallInfo . create ( ) , data ) ; } |
public class UploadCallable { /** * Performs an
* { @ link AmazonS3 # abortMultipartUpload ( AbortMultipartUploadRequest ) }
* operation for the given multi - part upload . */
void performAbortMultipartUpload ( ) { } } | if ( multipartUploadId == null ) { return ; } try { AbortMultipartUploadRequest abortRequest = new AbortMultipartUploadRequest ( origReq . getBucketName ( ) , origReq . getKey ( ) , multipartUploadId ) . withRequesterPays ( origReq . isRequesterPays ( ) ) ; s3 . abortMultipartUpload ( abortRequest ) ; } catch ( Exception e2 ) { log . info ( "Unable to abort multipart upload, you may need to manually remove uploaded parts: " + e2 . getMessage ( ) , e2 ) ; } |
public class DescribeReservedInstancesModificationsRequest { /** * IDs for the submitted modification request .
* @ param reservedInstancesModificationIds
* IDs for the submitted modification request . */
public void setReservedInstancesModificationIds ( java . util . Collection < String > reservedInstancesModificationIds ) { } } | if ( reservedInstancesModificationIds == null ) { this . reservedInstancesModificationIds = null ; return ; } this . reservedInstancesModificationIds = new com . amazonaws . internal . SdkInternalList < String > ( reservedInstancesModificationIds ) ; |
public class ProxyImpl { /** * https : / / code . google . com / p / sipservlets / issues / detail ? id = 238 */
public void removeTransaction ( String txId ) { } } | if ( this . transactionMap . remove ( txId ) != null ) { if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Transaction " + txId + " removed from proxy." ) ; } } checkAndCleanProxy ( ) ; |
public class CPDefinitionOptionRelPersistenceImpl { /** * Caches the cp definition option rel in the entity cache if it is enabled .
* @ param cpDefinitionOptionRel the cp definition option rel */
@ Override public void cacheResult ( CPDefinitionOptionRel cpDefinitionOptionRel ) { } } | entityCache . putResult ( CPDefinitionOptionRelModelImpl . ENTITY_CACHE_ENABLED , CPDefinitionOptionRelImpl . class , cpDefinitionOptionRel . getPrimaryKey ( ) , cpDefinitionOptionRel ) ; finderCache . putResult ( FINDER_PATH_FETCH_BY_UUID_G , new Object [ ] { cpDefinitionOptionRel . getUuid ( ) , cpDefinitionOptionRel . getGroupId ( ) } , cpDefinitionOptionRel ) ; finderCache . putResult ( FINDER_PATH_FETCH_BY_C_C , new Object [ ] { cpDefinitionOptionRel . getCPDefinitionId ( ) , cpDefinitionOptionRel . getCPOptionId ( ) } , cpDefinitionOptionRel ) ; cpDefinitionOptionRel . resetOriginalValues ( ) ; |
public class CmsCmisRenditionFilter { /** * Checks whether this filter accepts a given kind / mimetype combination . < p >
* @ param kind the kind
* @ param mimetype the mime type
* @ return true if the filter accepts the combination */
public boolean accept ( String kind , String mimetype ) { } } | if ( m_includeAll ) { return true ; } int slashpos = mimetype . indexOf ( "/" ) ; String supertype = mimetype . substring ( 0 , slashpos ) ; return m_kinds . contains ( kind ) || m_types . contains ( mimetype ) || m_supertypes . contains ( supertype ) ; |
public class AmazonWorkMailClient { /** * Returns summaries of the customer ' s non - deleted organizations .
* @ param listOrganizationsRequest
* @ return Result of the ListOrganizations operation returned by the service .
* @ throws InvalidParameterException
* One or more of the input parameters don ' t match the service ' s restrictions .
* @ sample AmazonWorkMail . ListOrganizations
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / workmail - 2017-10-01 / ListOrganizations " target = " _ top " > AWS API
* Documentation < / a > */
@ Override public ListOrganizationsResult listOrganizations ( ListOrganizationsRequest request ) { } } | request = beforeClientExecution ( request ) ; return executeListOrganizations ( request ) ; |
public class AbstractIoSession { /** * TODO Add method documentation */
public final void decreaseReadBufferSize ( ) { } } | if ( deferDecreaseReadBuffer ) { deferDecreaseReadBuffer = false ; return ; } if ( AbstractIoSessionConfig . ENABLE_BUFFER_SIZE ) { System . out . println ( "AbstractIoSession.decreaseReadBufferSize()" ) ; if ( getConfig ( ) . getReadBufferSize ( ) > getConfig ( ) . getMinReadBufferSize ( ) ) { getConfig ( ) . setReadBufferSize ( getConfig ( ) . getReadBufferSize ( ) >>> 1 ) ; } } deferDecreaseReadBuffer = true ; |
public class GeomUtil { /** * Shifts the position of the < code > tainer < / code > rectangle to ensure that it contains the
* < code > tained < / code > rectangle . The < code > tainer < / code > rectangle must be larger than or
* equal to the size of the < code > tained < / code > rectangle . */
public static void shiftToContain ( Rectangle tainer , Rectangle tained ) { } } | if ( tained . x < tainer . x ) { tainer . x = tained . x ; } if ( tained . y < tainer . y ) { tainer . y = tained . y ; } if ( tained . x + tained . width > tainer . x + tainer . width ) { tainer . x = tained . x - ( tainer . width - tained . width ) ; } if ( tained . y + tained . height > tainer . y + tainer . height ) { tainer . y = tained . y - ( tainer . height - tained . height ) ; } |
public class WinletManager { /** * 获取Winlet实例 , 如果不存在则创建
* @ param context
* @ param req
* @ param winletDef
* @ return
* @ throws Exception */
public static synchronized Object getWinlet ( ApplicationContext context , WinletDef winletDef ) throws Exception { } } | Object winlet = WINLETS . get ( winletDef . getName ( ) ) ; if ( winlet == null ) { winlet = context . getBean ( winletDef . getName ( ) ) ; WINLETS . put ( winletDef . getName ( ) , winlet ) ; } return winlet ; |
public class ListElasticsearchInstanceTypesResult { /** * List of instance types supported by Amazon Elasticsearch service for given
* < code > < a > ElasticsearchVersion < / a > < / code >
* @ param elasticsearchInstanceTypes
* List of instance types supported by Amazon Elasticsearch service for given
* < code > < a > ElasticsearchVersion < / a > < / code >
* @ return Returns a reference to this object so that method calls can be chained together .
* @ see ESPartitionInstanceType */
public ListElasticsearchInstanceTypesResult withElasticsearchInstanceTypes ( ESPartitionInstanceType ... elasticsearchInstanceTypes ) { } } | java . util . ArrayList < String > elasticsearchInstanceTypesCopy = new java . util . ArrayList < String > ( elasticsearchInstanceTypes . length ) ; for ( ESPartitionInstanceType value : elasticsearchInstanceTypes ) { elasticsearchInstanceTypesCopy . add ( value . toString ( ) ) ; } if ( getElasticsearchInstanceTypes ( ) == null ) { setElasticsearchInstanceTypes ( elasticsearchInstanceTypesCopy ) ; } else { getElasticsearchInstanceTypes ( ) . addAll ( elasticsearchInstanceTypesCopy ) ; } return this ; |
public class PvmExecutionImpl { /** * Instantiates the given set of activities and returns the execution for the bottom - most activity */
public Map < PvmActivity , PvmExecutionImpl > instantiateScopes ( List < PvmActivity > activityStack , boolean skipCustomListeners , boolean skipIoMappings ) { } } | if ( activityStack . isEmpty ( ) ) { return Collections . emptyMap ( ) ; } this . skipCustomListeners = skipCustomListeners ; this . skipIoMapping = skipIoMappings ; ExecutionStartContext executionStartContext = new ExecutionStartContext ( false ) ; InstantiationStack instantiationStack = new InstantiationStack ( new LinkedList < > ( activityStack ) ) ; executionStartContext . setInstantiationStack ( instantiationStack ) ; setStartContext ( executionStartContext ) ; performOperation ( PvmAtomicOperation . ACTIVITY_INIT_STACK_AND_RETURN ) ; Map < PvmActivity , PvmExecutionImpl > createdExecutions = new HashMap < > ( ) ; PvmExecutionImpl currentExecution = this ; for ( PvmActivity instantiatedActivity : activityStack ) { // there must exactly one child execution
currentExecution = currentExecution . getNonEventScopeExecutions ( ) . get ( 0 ) ; if ( currentExecution . isConcurrent ( ) ) { // there may be a non - scope execution that we have to skip ( e . g . multi - instance )
currentExecution = currentExecution . getNonEventScopeExecutions ( ) . get ( 0 ) ; } createdExecutions . put ( instantiatedActivity , currentExecution ) ; } return createdExecutions ; |
public class BottomSheet { /** * Replaces the item at a specific index with another item .
* @ param index
* The index of the item , which should be replaced , as an { @ link Integer } value
* @ param id
* The id of the item , which should be added , as an { @ link Integer } value . The id must
* be at least 0
* @ param title
* The title of the item , which should be added , as an instance of the type { @ link
* CharSequence } . The title may neither be null , nor empty */
public final void setItem ( final int index , final int id , @ NonNull final CharSequence title ) { } } | Item item = new Item ( id , title ) ; adapter . set ( index , item ) ; adaptGridViewHeight ( ) ; |
public class AsciiTable { /** * Sets the right padding for all cells in the table .
* @ param paddingRight new padding , ignored if smaller than 0
* @ return this to allow chaining */
public AsciiTable setPaddingRight ( int paddingRight ) { } } | for ( AT_Row row : this . rows ) { if ( row . getType ( ) == TableRowType . CONTENT ) { row . setPaddingRight ( paddingRight ) ; } } return this ; |
public class DirectoryConnection { /** * On the session close . */
private void onSessionClose ( ) { } } | synchronized ( pendingQueue ) { while ( ! pendingQueue . isEmpty ( ) ) { Packet p = pendingQueue . remove ( ) ; onLossPacket ( p ) ; } } |
public class WindowsRealm { /** * Returns a simple username without any domain prefixes .
* @ param username
* @ return a simple username */
private String getSimpleUsername ( String username ) { } } | String simpleUsername = username ; if ( defaultDomain != null ) { // sanitize username
if ( username . startsWith ( defaultDomain + "\\" ) ) { // strip default domain from domain \ username
simpleUsername = username . substring ( defaultDomain . length ( ) + 1 ) ; } else if ( username . endsWith ( "@" + defaultDomain ) ) { // strip default domain from username @ domain
simpleUsername = username . substring ( 0 , username . lastIndexOf ( '@' ) ) ; } } return simpleUsername ; |
public class XlsxWorksheet { /** * Returns the sheets from the given Excel XLSX file .
* @ param stream The input stream with the XLSX file
* @ return The sheet names from the XLSX file
* @ throws IOException if the file cannot be opened */
public static String [ ] getXlsxWorksheets ( InputStream stream ) throws IOException { } } | XlsxWorkbook workbook = XlsxWorkbook . getWorkbook ( stream ) ; String [ ] sheets = workbook . getSheetNames ( ) ; workbook . close ( ) ; return sheets ; |
public class DeviceAppearanceImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public void setDevApp ( Integer newDevApp ) { } } | Integer oldDevApp = devApp ; devApp = newDevApp ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , AfplibPackage . DEVICE_APPEARANCE__DEV_APP , oldDevApp , devApp ) ) ; |
public class ApiOvhEmaildomain { /** * Get this object properties
* REST : GET / email / domain / delegatedAccount / { email }
* @ param email [ required ] Email */
public OvhAccountDelegated delegatedAccount_email_GET ( String email ) throws IOException { } } | String qPath = "/email/domain/delegatedAccount/{email}" ; StringBuilder sb = path ( qPath , email ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , OvhAccountDelegated . class ) ; |
public class ActivityConstraint { /** * Checks if the PhysicalEntity controls anything .
* @ param match current match to validate
* @ param ind mapped index
* @ return true if it controls anything */
@ Override public boolean satisfies ( Match match , int ... ind ) { } } | PhysicalEntity pe = ( PhysicalEntity ) match . get ( ind [ 0 ] ) ; return pe . getControllerOf ( ) . isEmpty ( ) == active ; |
public class ResourceAdapterService { /** * Deletes the directory and its contents or the file that is specified
* @ param path to cache directory to delete
* @ return true if path was deleted or if it did not exist */
private boolean deleteBundleCacheDir ( File path ) { } } | final boolean trace = TraceComponent . isAnyTracingEnabled ( ) ; if ( FileUtils . fileExists ( path ) ) { if ( trace && tc . isDebugEnabled ( ) ) { Tr . debug ( this , tc , "Path specified exists: " + path . getPath ( ) ) ; } } else { if ( trace && tc . isDebugEnabled ( ) ) { Tr . debug ( this , tc , "Path specified does not exist: " + path . getPath ( ) ) ; } return true ; } boolean deleteWorked = true ; for ( File file : FileUtils . listFiles ( path ) ) { if ( FileUtils . fileIsDirectory ( file ) ) { if ( trace && tc . isDebugEnabled ( ) ) { Tr . debug ( this , tc , "Delete directory contents: " + file . toString ( ) ) ; } deleteWorked &= deleteBundleCacheDir ( file ) ; } else { if ( trace && tc . isDebugEnabled ( ) ) { Tr . debug ( this , tc , "Delete file: " + file . toString ( ) ) ; } if ( ! FileUtils . fileDelete ( file ) ) { deleteWorked = false ; if ( trace && tc . isDebugEnabled ( ) ) { Tr . debug ( this , tc , "Directory or file not deleted" ) ; } } } } if ( trace && tc . isDebugEnabled ( ) ) { Tr . debug ( this , tc , "Delete path: " + path ) ; } if ( ! FileUtils . fileDelete ( path ) ) { deleteWorked = false ; if ( trace && tc . isDebugEnabled ( ) ) { Tr . debug ( this , tc , "Path not deleted" ) ; } } return deleteWorked ; |
public class BotmReflectionUtil { /** * Get the public method .
* @ param clazz The type of class that defines the method . ( NotNull )
* @ param methodName The name of method . ( NotNull )
* @ param argTypes The type of argument . ( NotNull )
* @ return The instance of method . ( NullAllowed : if null , not found ) */
public static Method getPublicMethod ( Class < ? > clazz , String methodName , Class < ? > [ ] argTypes ) { } } | assertObjectNotNull ( "clazz" , clazz ) ; assertStringNotNullAndNotTrimmedEmpty ( "methodName" , methodName ) ; return findMethod ( clazz , methodName , argTypes , VisibilityType . PUBLIC , false ) ; |
public class ProxyRegistry { /** * Creates a DistributedObject proxy if it is not created yet
* @ param name The name of the distributedObject proxy object .
* @ param publishEvent true if a DistributedObjectEvent should be fired .
* @ param initialize true if he DistributedObject proxy object should be initialized .
* @ return The DistributedObject instance if it is created by this method , null otherwise . */
public DistributedObjectFuture createProxy ( String name , boolean publishEvent , boolean initialize ) { } } | if ( proxies . containsKey ( name ) ) { return null ; } if ( ! proxyService . nodeEngine . isRunning ( ) ) { throw new HazelcastInstanceNotActiveException ( ) ; } DistributedObjectFuture proxyFuture = new DistributedObjectFuture ( ) ; if ( proxies . putIfAbsent ( name , proxyFuture ) != null ) { return null ; } return doCreateProxy ( name , publishEvent , initialize , proxyFuture ) ; |
public class BasicParallelSearch { /** * When disposing a basic parallel search , each of the searches that have been added to the parallel
* algorithm are disposed and the thread pool used for concurrent search execution is released . */
@ Override protected void searchDisposed ( ) { } } | // release thread pool
pool . shutdown ( ) ; // dispose contained searches
searches . forEach ( s -> s . dispose ( ) ) ; // dispose super
super . searchDisposed ( ) ; |
public class Config { /** * Reads and parses configuration file Initializes the configuration , reloading all data */
public synchronized static void initConfig ( ) { } } | SeLionLogger . getLogger ( ) . entering ( ) ; Map < ConfigProperty , String > initialValues = new HashMap < > ( ) ; initConfig ( initialValues ) ; SeLionLogger . getLogger ( ) . exiting ( ) ; |
public class RoaringBitmap { /** * Generate a new bitmap with all integers in [ rangeStart , rangeEnd ) removed .
* @ param rb initial bitmap ( will not be modified )
* @ param rangeStart inclusive beginning of range
* @ param rangeEnd exclusive ending of range
* @ return new bitmap
* @ deprecated use the version where longs specify the range */
@ Deprecated public static RoaringBitmap remove ( RoaringBitmap rb , final int rangeStart , final int rangeEnd ) { } } | if ( rangeStart >= 0 ) { return remove ( rb , ( long ) rangeStart , ( long ) rangeEnd ) ; } // rangeStart being - ve and rangeEnd being positive is not expected )
// so assume both - ve
return remove ( rb , rangeStart & 0xFFFFFFFFL , rangeEnd & 0xFFFFFFFFL ) ; |
public class CmsObject { /** * Changes the resource type of a resource . < p >
* OpenCms handles resources according to the resource type ,
* not the file suffix . This is e . g . why a JSP in OpenCms can have the
* suffix " . html " instead of " . jsp " only . Changing the resource type
* makes sense e . g . if you want to make a plain text file a JSP resource ,
* or a binary file an image , etc . < p >
* @ param resourcename the name of the resource to change the type for ( full current site relative path )
* @ param type the new resource type for this resource
* @ throws CmsException if something goes wrong */
public void chtype ( String resourcename , I_CmsResourceType type ) throws CmsException { } } | CmsResource resource = readResource ( resourcename , CmsResourceFilter . IGNORE_EXPIRATION ) ; getResourceType ( resource ) . chtype ( this , m_securityManager , resource , type ) ; |
public class DictionaryImpl { /** * ( non - Javadoc )
* @ see org . jdiameter . api . validation . Dictionary # getMessage ( int , long , boolean ) */
@ Override public MessageRepresentation getMessage ( int commandCode , long applicationId , boolean isRequest ) { } } | if ( ! this . configured ) { return null ; } MessageRepresentation key = new MessageRepresentationImpl ( commandCode , applicationId , isRequest ) ; return this . commandMap . get ( key ) ; |
public class autoscalepolicy_binding { /** * Use this API to fetch autoscalepolicy _ binding resource of given name . */
public static autoscalepolicy_binding get ( nitro_service service , String name ) throws Exception { } } | autoscalepolicy_binding obj = new autoscalepolicy_binding ( ) ; obj . set_name ( name ) ; autoscalepolicy_binding response = ( autoscalepolicy_binding ) obj . get_resource ( service ) ; return response ; |
public class Model { /** * 如果 attrOrNot 是表中的字段则调用 set ( . . . ) 放入数据
* 否则调用 put ( . . . ) 放入数据 */
public M setOrPut ( String attrOrNot , Object value ) { } } | Table table = _getTable ( ) ; if ( table != null && table . hasColumnLabel ( attrOrNot ) ) { _getModifyFlag ( ) . add ( attrOrNot ) ; // Add modify flag , update ( ) need this flag .
} attrs . put ( attrOrNot , value ) ; return ( M ) this ; |
public class RedisClientFactory { /** * ( non - Javadoc )
* @ see
* com . impetus . kundera . loader . GenericClientFactory # createPoolOrConnection ( ) */
@ Override protected Object createPoolOrConnection ( ) { } } | logger . info ( "Initializing Redis connection pool" ) ; final byte WHEN_EXHAUSTED_FAIL = 0 ; PersistenceUnitMetadata puMetadata = kunderaMetadata . getApplicationMetadata ( ) . getPersistenceUnitMetadata ( getPersistenceUnit ( ) ) ; Properties props = puMetadata . getProperties ( ) ; String contactNode = null ; String defaultPort = null ; String password = null ; String maxActivePerNode = null ; String maxIdlePerNode = null ; String minIdlePerNode = null ; String maxTotal = null ; String txTimeOut = null ; if ( externalProperties != null ) { contactNode = ( String ) externalProperties . get ( PersistenceProperties . KUNDERA_NODES ) ; defaultPort = ( String ) externalProperties . get ( PersistenceProperties . KUNDERA_PORT ) ; password = ( String ) externalProperties . get ( PersistenceProperties . KUNDERA_PASSWORD ) ; maxActivePerNode = ( String ) externalProperties . get ( PersistenceProperties . KUNDERA_POOL_SIZE_MAX_ACTIVE ) ; maxIdlePerNode = ( String ) externalProperties . get ( PersistenceProperties . KUNDERA_POOL_SIZE_MAX_IDLE ) ; minIdlePerNode = ( String ) externalProperties . get ( PersistenceProperties . KUNDERA_POOL_SIZE_MIN_IDLE ) ; maxTotal = ( String ) externalProperties . get ( PersistenceProperties . KUNDERA_POOL_SIZE_MAX_TOTAL ) ; txTimeOut = ( String ) externalProperties . get ( PersistenceProperties . KUNDERA_TRANSACTION_TIMEOUT ) ; } if ( contactNode == null ) { contactNode = RedisPropertyReader . rsmd . getHost ( ) != null ? RedisPropertyReader . rsmd . getHost ( ) : ( String ) props . get ( PersistenceProperties . KUNDERA_NODES ) ; } if ( defaultPort == null ) { defaultPort = RedisPropertyReader . rsmd . getPort ( ) != null ? RedisPropertyReader . rsmd . getPort ( ) : ( String ) props . get ( PersistenceProperties . KUNDERA_PORT ) ; } if ( password == null ) { password = RedisPropertyReader . rsmd . getPassword ( ) != null ? RedisPropertyReader . rsmd . getPassword ( ) : ( String ) props . get ( PersistenceProperties . KUNDERA_PASSWORD ) ; } if ( maxActivePerNode == null ) { maxActivePerNode = props . getProperty ( PersistenceProperties . KUNDERA_POOL_SIZE_MAX_ACTIVE ) ; } if ( maxIdlePerNode == null ) { maxIdlePerNode = props . getProperty ( PersistenceProperties . KUNDERA_POOL_SIZE_MAX_IDLE ) ; } if ( minIdlePerNode == null ) { minIdlePerNode = props . getProperty ( PersistenceProperties . KUNDERA_POOL_SIZE_MIN_IDLE ) ; } if ( maxTotal == null ) { maxTotal = props . getProperty ( PersistenceProperties . KUNDERA_POOL_SIZE_MAX_TOTAL ) ; } if ( txTimeOut == null ) { txTimeOut = props . getProperty ( PersistenceProperties . KUNDERA_TRANSACTION_TIMEOUT ) ; } JedisPoolConfig poolConfig = onPoolConfig ( WHEN_EXHAUSTED_FAIL , maxActivePerNode , maxIdlePerNode , minIdlePerNode , maxTotal ) ; JedisPool pool = null ; onValidation ( contactNode , defaultPort ) ; if ( poolConfig != null ) { if ( password != null ) { pool = new JedisPool ( poolConfig , contactNode , Integer . parseInt ( defaultPort ) , txTimeOut != null && StringUtils . isNumeric ( txTimeOut ) ? Integer . parseInt ( txTimeOut ) : - 1 , password ) ; } else { pool = new JedisPool ( poolConfig , contactNode , Integer . parseInt ( defaultPort ) , txTimeOut != null && StringUtils . isNumeric ( txTimeOut ) ? Integer . parseInt ( txTimeOut ) : - 1 ) ; } return pool ; } else { // Jedis connection = new Jedis ( contactNode ,
// Integer . valueOf ( defaultPort ) ) ;
// if ( password ! = null )
// / / connection . auth ( password ) ;
// connection . connect ( ) ;
// Connection to made available at the time of getConnection ( ) . YCSB
// performance fixes and ideally it is needed at that time only .
// No need to cache it at factory level as needed to managed within
// entity manager boundary !
return null ; } |
public class FctBnPublicTradeProcessors { /** * < p > Lazy get PrCart . < / p >
* @ param pAddParam additional param
* @ return requested PrCart
* @ throws Exception - an exception */
protected final PrCart < RS > lazyGetPrCart ( final Map < String , Object > pAddParam ) throws Exception { } } | String beanName = PrCart . class . getSimpleName ( ) ; @ SuppressWarnings ( "unchecked" ) PrCart < RS > proc = ( PrCart < RS > ) this . processorsMap . get ( beanName ) ; if ( proc == null ) { proc = new PrCart < RS > ( ) ; proc . setSrvOrm ( getSrvOrm ( ) ) ; proc . setSrvCart ( getSrvShoppingCart ( ) ) ; proc . setProcessorsFactory ( this ) ; // assigning fully initialized object :
this . processorsMap . put ( beanName , proc ) ; this . logger . info ( null , FctBnPublicTradeProcessors . class , beanName + " has been created." ) ; } return proc ; |
public class IntTuples { /** * Compares two tuples lexicographically , starting with
* the elements of the lowest index .
* @ param t0 The first tuple
* @ param t1 The second tuple
* @ return - 1 if the first tuple is lexicographically
* smaller than the second , + 1 if it is larger , and
* 0 if they are equal .
* @ throws IllegalArgumentException If the given tuples do not
* have the same { @ link Tuple # getSize ( ) size } */
public static int compareLexicographically ( IntTuple t0 , IntTuple t1 ) { } } | Utils . checkForEqualSize ( t0 , t1 ) ; for ( int i = 0 ; i < t0 . getSize ( ) ; i ++ ) { if ( t0 . get ( i ) < t1 . get ( i ) ) { return - 1 ; } else if ( t0 . get ( i ) > t1 . get ( i ) ) { return 1 ; } } return 0 ; |
public class dnsmxrec { /** * Use this API to fetch dnsmxrec resource of given name . */
public static dnsmxrec get ( nitro_service service , String domain ) throws Exception { } } | dnsmxrec obj = new dnsmxrec ( ) ; obj . set_domain ( domain ) ; dnsmxrec response = ( dnsmxrec ) obj . get_resource ( service ) ; return response ; |
public class HandlerEvaluator { /** * Retrieves the handler associated with the event .
* @ param eventType
* the given event
* @ return the associated handler , < code > null < / code > if not found */
private JClassType getHandlerForEvent ( JClassType eventType ) { } } | // All handlers event must have an overrided method getAssociatedType ( ) .
// We take advantage of this information to get the associated handler .
// Ex :
// com . google . gwt . event . dom . client . ClickEvent
// - - - > com . google . gwt . event . dom . client . ClickHandler
// com . google . gwt . event . dom . client . BlurEvent
// - - - > com . google . gwt . event . dom . client . BlurHandler
if ( eventType == null ) { return null ; } JMethod method = eventType . findMethod ( "getAssociatedType" , new JType [ 0 ] ) ; if ( method == null ) { logger . warn ( "Method 'getAssociatedType()' could not be found in the event '%s'." , eventType . getName ( ) ) ; return null ; } JType returnType = method . getReturnType ( ) ; if ( returnType == null ) { logger . warn ( "The method 'getAssociatedType()' in the event '%s' returns void." , eventType . getName ( ) ) ; return null ; } JParameterizedType isParameterized = returnType . isParameterized ( ) ; if ( isParameterized == null ) { logger . warn ( "The method 'getAssociatedType()' in '%s' does not return Type<? extends EventHandler>." , eventType . getName ( ) ) ; return null ; } JClassType [ ] argTypes = isParameterized . getTypeArgs ( ) ; if ( ( argTypes . length != 1 ) && ! argTypes [ 0 ] . isAssignableTo ( eventHandlerJClass ) ) { logger . warn ( "The method 'getAssociatedType()' in '%s' does not return Type<? extends EventHandler>." , eventType . getName ( ) ) ; return null ; } return argTypes [ 0 ] ; |
public class A_CmsWorkplaceAction { /** * Returns if there are any blocking locks within the context resources . < p >
* Will open the blocking locks dialog if required . < p >
* @ param context the dialog context
* @ return < code > true < / code > in case of blocking locks */
protected boolean hasBlockingLocks ( final I_CmsDialogContext context ) { } } | CmsObject cms = context . getCms ( ) ; List < CmsResource > resources = context . getResources ( ) ; List < CmsResource > blocked = Lists . newArrayList ( ) ; for ( CmsResource resource : resources ) { try { blocked . addAll ( cms . getBlockingLockedResources ( resource ) ) ; } catch ( CmsException e ) { LOG . error ( e . getLocalizedMessage ( ) , e ) ; } } if ( blocked . isEmpty ( ) ) { return false ; } else { CmsLockedResourcesList dialog = new CmsLockedResourcesList ( cms , blocked , CmsVaadinUtils . getMessageText ( Messages . GUI_CANT_PERFORM_OPERATION_BECAUSE_OF_LOCKED_RESOURCES_0 ) , new Runnable ( ) { public void run ( ) { List < CmsUUID > noStructureIds = Collections . emptyList ( ) ; context . finish ( noStructureIds ) ; } } , null ) ; context . start ( CmsVaadinUtils . getMessageText ( org . opencms . workplace . explorer . Messages . GUI_EXPLORER_CONTEXT_LOCKS_0 ) , dialog ) ; return true ; } |
public class AsynchronousBeanEngine { /** * Assigns the given activity to a worker thread in the JavaEE application
* server , returning the task ' s Future object .
* @ param callable
* the callable object for the { @ code Activity } to be executed asynchronously .
* @ return
* the activity ' s { @ code Future } object , for result retrieval .
* @ see
* org . dihedron . patterns . activities . concurrent . ActivityExecutor # submit ( org . dihedron . patterns . activities . Activity ) */
@ Override protected Future < ActivityData > submit ( ActivityCallable callable ) { } } | try { if ( getEjb ( ) == null ) { logger . info ( "locating AsynchronousBean EJB through service locator" ) ; setEjb ( ServiceLocator . getService ( asynchBeanName , AsynchronousBean . class ) ) ; } else { logger . info ( "asynchronousBean EJB correctly initialized through dependency injection" ) ; } return getEjb ( ) . submit ( callable ) ; } catch ( Exception e ) { logger . error ( "error in the AsynchronousBean service locator lookup" , e ) ; } return null ; |
public class IonTextWriterBuilder { /** * Declares the length beyond which string and clob content will be rendered
* as triple - quoted " long strings " .
* At present , such content will only line - break on extant newlines .
* @ param threshold the new threshold ; zero means none .
* @ see # getLongStringThreshold ( )
* @ see # setLongStringThreshold ( int )
* @ return this instance , if mutable ;
* otherwise a mutable copy of this instance . */
public final IonTextWriterBuilder withLongStringThreshold ( int threshold ) { } } | IonTextWriterBuilder b = mutable ( ) ; b . setLongStringThreshold ( threshold ) ; return b ; |
public class PushApi { /** * Get all available push topics .
* ( this method is experimental and may change )
* This method does not require authentication .
* @ return all the different flavors of topics .
* @ throws JinxException if there are any errors .
* @ see < a href = " https : / / www . flickr . com / services / api / flickr . push . getTopics . html " > flickr . push . getTopics < / a > */
public Topics getTopics ( ) throws JinxException { } } | Map < String , String > params = new TreeMap < > ( ) ; params . put ( "method" , "flickr.push.getTopics" ) ; return jinx . flickrGet ( params , Topics . class ) ; |
public class VirtualNetworkGatewayConnectionsInner { /** * Gets the specified virtual network gateway connection by resource group .
* @ param resourceGroupName The name of the resource group .
* @ param virtualNetworkGatewayConnectionName The name of the virtual network gateway connection .
* @ param serviceCallback the async ServiceCallback to handle successful and failed responses .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the { @ link ServiceFuture } object */
public ServiceFuture < VirtualNetworkGatewayConnectionInner > getByResourceGroupAsync ( String resourceGroupName , String virtualNetworkGatewayConnectionName , final ServiceCallback < VirtualNetworkGatewayConnectionInner > serviceCallback ) { } } | return ServiceFuture . fromResponse ( getByResourceGroupWithServiceResponseAsync ( resourceGroupName , virtualNetworkGatewayConnectionName ) , serviceCallback ) ; |
public class Job { /** * User - defined metadata that you want to associate with an Elastic Transcoder job . You specify metadata in
* < code > key / value < / code > pairs , and you can add up to 10 < code > key / value < / code > pairs per job . Elastic Transcoder
* does not guarantee that < code > key / value < / code > pairs are returned in the same order in which you specify them .
* Metadata < code > keys < / code > and < code > values < / code > must use characters from the following list :
* < ul >
* < li >
* < code > 0-9 < / code >
* < / li >
* < li >
* < code > A - Z < / code > and < code > a - z < / code >
* < / li >
* < li >
* < code > Space < / code >
* < / li >
* < li >
* The following symbols : < code > _ . : / = + - % @ < / code >
* < / li >
* < / ul >
* @ param userMetadata
* User - defined metadata that you want to associate with an Elastic Transcoder job . You specify metadata in
* < code > key / value < / code > pairs , and you can add up to 10 < code > key / value < / code > pairs per job . Elastic
* Transcoder does not guarantee that < code > key / value < / code > pairs are returned in the same order in which
* you specify them . < / p >
* Metadata < code > keys < / code > and < code > values < / code > must use characters from the following list :
* < ul >
* < li >
* < code > 0-9 < / code >
* < / li >
* < li >
* < code > A - Z < / code > and < code > a - z < / code >
* < / li >
* < li >
* < code > Space < / code >
* < / li >
* < li >
* The following symbols : < code > _ . : / = + - % @ < / code >
* < / li >
* @ return Returns a reference to this object so that method calls can be chained together . */
public Job withUserMetadata ( java . util . Map < String , String > userMetadata ) { } } | setUserMetadata ( userMetadata ) ; return this ; |
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link Person } { @ code > } } */
@ XmlElementDecl ( namespace = PROV_NS , name = "person" ) public JAXBElement < Person > createPerson ( Person value ) { } } | return new JAXBElement < Person > ( _Person_QNAME , Person . class , null , value ) ; |
public class VoltTableUtil { /** * Utility to aggregate a list of tables sharing a schema . Common for
* sysprocs to do this , to aggregate results . */
public static VoltTable unionTables ( Collection < VoltTable > operands ) { } } | VoltTable result = null ; // Locate the first non - null table to get the schema
for ( VoltTable vt : operands ) { if ( vt != null ) { result = new VoltTable ( vt . getTableSchema ( ) ) ; result . setStatusCode ( vt . getStatusCode ( ) ) ; break ; } } if ( result != null ) { result . addTables ( operands ) ; result . resetRowPosition ( ) ; } return result ; |
public class AbstractResultSetWrapper { /** * { @ inheritDoc }
* @ see java . sql . ResultSet # updateDate ( java . lang . String , java . sql . Date ) */
@ Override public void updateDate ( final String columnLabel , final Date x ) throws SQLException { } } | wrapped . updateDate ( columnLabel , x ) ; |
public class DMNCompilerImpl { /** * For the purpose of Compilation , in the DMNModel the DRGElements are stored with their full ID , so an ElementReference might reference in two forms :
* - # id ( a local to the model ID )
* - namespace # id ( an imported DRGElement ID )
* This method now returns in the first case the proper ID , while leave unchanged in the latter case , in order for the ID to be reconciliable on the DMNModel . */
public static String getId ( DMNElementReference er ) { } } | String href = er . getHref ( ) ; return href . startsWith ( "#" ) ? href . substring ( 1 ) : href ; |
public class RuleModel { /** * This will return a List < String > of all ActionInsertFact bindings
* @ return The bindings or an empty list if no bindings are found . */
public List < String > getRHSBoundFacts ( ) { } } | if ( this . rhs == null ) { return null ; } final List < String > list = new ArrayList < String > ( ) ; for ( int i = 0 ; i < this . rhs . length ; i ++ ) { if ( this . rhs [ i ] instanceof ActionInsertFact ) { final ActionInsertFact p = ( ActionInsertFact ) this . rhs [ i ] ; if ( p . getBoundName ( ) != null ) { list . add ( p . getBoundName ( ) ) ; } } } return list ; |
public class GetDifferencesResult { /** * A differences data type object that contains information about the differences , including whether the difference
* is added , modified , or deleted ( A , D , M ) .
* @ param differences
* A differences data type object that contains information about the differences , including whether the
* difference is added , modified , or deleted ( A , D , M ) . */
public void setDifferences ( java . util . Collection < Difference > differences ) { } } | if ( differences == null ) { this . differences = null ; return ; } this . differences = new java . util . ArrayList < Difference > ( differences ) ; |
public class SipServlet { /** * Invoked to handle incoming requests . This method dispatched requests to one of the doXxx methods where Xxx is the SIP method used in the request . Servlets will not usually need to override this method . */
protected void doRequest ( javax . servlet . sip . SipServletRequest req ) throws javax . servlet . ServletException , java . io . IOException { } } | String m = req . getMethod ( ) ; if ( "INVITE" . equals ( m ) ) doInvite ( req ) ; else if ( "ACK" . equals ( m ) ) doAck ( req ) ; else if ( "OPTIONS" . equals ( m ) ) doOptions ( req ) ; else if ( "BYE" . equals ( m ) ) doBye ( req ) ; else if ( "CANCEL" . equals ( m ) ) doCancel ( req ) ; else if ( "REGISTER" . equals ( m ) ) doRegister ( req ) ; else if ( "SUBSCRIBE" . equals ( m ) ) doSubscribe ( req ) ; else if ( "NOTIFY" . equals ( m ) ) doNotify ( req ) ; else if ( "MESSAGE" . equals ( m ) ) doMessage ( req ) ; else if ( "INFO" . equals ( m ) ) doInfo ( req ) ; else if ( "REFER" . equals ( m ) ) doRefer ( req ) ; else if ( "PUBLISH" . equals ( m ) ) doPublish ( req ) ; else if ( "UPDATE" . equals ( m ) ) doUpdate ( req ) ; else if ( "PRACK" . equals ( m ) ) doPrack ( req ) ; else if ( req . isInitial ( ) ) notHandled ( req ) ; |
public class ns_vserver_appflow_config { /** * < pre >
* modify virtual server policy .
* < / pre > */
public static ns_vserver_appflow_config modify ( nitro_service client , ns_vserver_appflow_config resource ) throws Exception { } } | resource . validate ( "modify" ) ; return ( ( ns_vserver_appflow_config [ ] ) resource . update_resource ( client ) ) [ 0 ] ; |
public class CFFFontSubset { /** * Function computes the size of an index
* @ param indexOffset The offset for the computed index
* @ return The size of the index */
protected int countEntireIndexRange ( int indexOffset ) { } } | // Go to the beginning of the index
seek ( indexOffset ) ; // Read the count field
int count = getCard16 ( ) ; // If count = = 0 - > size = 2
if ( count == 0 ) return 2 ; else { // Read the offsize field
int indexOffSize = getCard8 ( ) ; // Go to the last element of the offset array
seek ( indexOffset + 2 + 1 + count * indexOffSize ) ; // The size of the object array is the value of the last element - 1
int size = getOffset ( indexOffSize ) - 1 ; // Return the size of the entire index
return 2 + 1 + ( count + 1 ) * indexOffSize + size ; } |
public class Matrix4x3d { /** * Set all the values within this matrix to 0.
* @ return this */
public Matrix4x3d zero ( ) { } } | m00 = 0.0 ; m01 = 0.0 ; m02 = 0.0 ; m10 = 0.0 ; m11 = 0.0 ; m12 = 0.0 ; m20 = 0.0 ; m21 = 0.0 ; m22 = 0.0 ; m30 = 0.0 ; m31 = 0.0 ; m32 = 0.0 ; properties = 0 ; return this ; |
public class CmsUpdateDBManager { /** * Updates the database . < p >
* @ param pool the database pool to update */
public void updateDatabase ( String pool ) { } } | Map < String , String > dbPoolData = new HashMap < String , String > ( m_dbPools . get ( pool ) ) ; // display info
System . out . println ( "JDBC Driver: " + getDbDriver ( pool ) ) ; System . out . println ( "JDBC Connection Url: " + getDbUrl ( pool ) ) ; System . out . println ( "JDBC Connection Url Params: " + getDbParams ( pool ) ) ; System . out . println ( "Database User: " + getDbUser ( pool ) ) ; // get the db implementation name
String dbName = getDbName ( ) ; String name = null ; if ( dbName . indexOf ( "mysql" ) > - 1 ) { getMySqlEngine ( dbPoolData ) ; name = "mysql" ; } else if ( dbName . indexOf ( "oracle" ) > - 1 ) { getOracleTablespaces ( dbPoolData ) ; name = "oracle" ; } else if ( dbName . indexOf ( "postgresql" ) > - 1 ) { getPostgreSqlTablespaces ( dbPoolData ) ; name = "postgresql" ; } else { System . out . println ( "db " + dbName + " not supported" ) ; return ; } // execute update
Iterator < I_CmsUpdateDBPart > it = m_plugins . iterator ( ) ; while ( it . hasNext ( ) ) { I_CmsUpdateDBPart updatePart = it . next ( ) ; I_CmsUpdateDBPart dbUpdater = getInstanceForDb ( updatePart , name ) ; if ( dbUpdater != null ) { dbUpdater . execute ( dbPoolData ) ; } } |
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link EnvironmentsType } { @ code > } } */
@ XmlElementDecl ( namespace = "urn:oasis:names:tc:xacml:2.0:policy:schema:os" , name = "Environments" ) public JAXBElement < EnvironmentsType > createEnvironments ( EnvironmentsType value ) { } } | return new JAXBElement < EnvironmentsType > ( _Environments_QNAME , EnvironmentsType . class , null , value ) ; |
public class ReferenceStreamLink { /** * / * ( non - Javadoc )
* @ see com . ibm . ws . sib . msgstore . ItemCollection # findFirstMatching ( com . ibm . ws . sib . msgstore . Filter ) */
public final AbstractItem findFirstMatching ( Filter filter ) throws MessageStoreException { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "findFirstMatching" , filter ) ; AbstractItem item = _references ( ) . findFirstMatching ( filter ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "findFirstMatching" , item ) ; return item ; |
public class RomanianProblem { /** * Heuristic function required to define search problems to be used with Hipster .
* @ see es . usc . citius . hipster . model . problem . SearchProblem
* @ return { @ link es . usc . citius . hipster . model . function . HeuristicFunction } with the { @ link # heuristics ( ) } values . */
public static HeuristicFunction < City , Double > heuristicFunction ( ) { } } | return new HeuristicFunction < City , Double > ( ) { @ Override public Double estimate ( City state ) { return heuristics ( ) . get ( state ) ; } } ; |
public class OmdbBuilder { /** * Set the search term
* @ param searchTerm The text to build for
* @ return
* @ throws com . omertron . omdbapi . OMDBException */
public OmdbBuilder setSearchTerm ( final String searchTerm ) throws OMDBException { } } | if ( StringUtils . isBlank ( searchTerm ) ) { throw new OMDBException ( ApiExceptionType . UNKNOWN_CAUSE , "Must provide a search term!" ) ; } params . add ( Param . SEARCH , searchTerm ) ; return this ; |
public class Table { /** * akede @ users - 1.7.2 patch Files readonly */
public void setDataReadOnly ( boolean value ) { } } | // Changing the Read - Only mode for the table is only allowed if the
// the database can realize it .
if ( ! value && database . isFilesReadOnly ( ) && isFileBased ( ) ) { throw Error . error ( ErrorCode . DATA_IS_READONLY ) ; } isReadOnly = value ; |
public class AbstractGitFlowMojo { /** * Executes Maven command .
* @ param args
* Maven command line arguments .
* @ throws CommandLineException
* @ throws MojoFailureException */
private void executeMvnCommand ( final String ... args ) throws CommandLineException , MojoFailureException { } } | executeCommand ( cmdMvn , true , argLine , args ) ; |
public class Options { /** * Returns the { @ link IProcessableOption } s that were marked by calling
* { @ link # markForProcessing ( IProcessableOption ) } with the given key .
* @ param processingKey the key with which the options in questions were marked .
* @ return list of marked { @ link IProcessableOption } s , or an empty list , if
* none were marked */
public List < IProcessableOption > getMarkedForProcessing ( final String processingKey ) { } } | List < IProcessableOption > result = this . processingRegistry . get ( processingKey ) ; if ( result == null ) { return new ArrayList < IProcessableOption > ( ) ; } else { return result ; } |
public class CollectionUtils { /** * Null - safe method returning the given { @ link Iterator } or an empty { @ link Iterator } if null .
* @ param < T > Class type of the elements in the { @ link Iterator } .
* @ param iterator { @ link Iterator } to evaluate .
* @ return the given { @ link Iterator } or an empty { @ link Iterator } if null .
* @ see java . util . Collections # emptyIterator ( )
* @ see java . util . Iterator */
@ NullSafe public static < T > Iterator < T > nullSafeIterator ( Iterator < T > iterator ) { } } | return iterator != null ? iterator : Collections . emptyIterator ( ) ; |
public class ModifyVpcEndpointServiceConfigurationRequest { /** * The Amazon Resource Names ( ARNs ) of Network Load Balancers to add to your service configuration .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setAddNetworkLoadBalancerArns ( java . util . Collection ) } or
* { @ link # withAddNetworkLoadBalancerArns ( java . util . Collection ) } if you want to override the existing values .
* @ param addNetworkLoadBalancerArns
* The Amazon Resource Names ( ARNs ) of Network Load Balancers to add to your service configuration .
* @ return Returns a reference to this object so that method calls can be chained together . */
public ModifyVpcEndpointServiceConfigurationRequest withAddNetworkLoadBalancerArns ( String ... addNetworkLoadBalancerArns ) { } } | if ( this . addNetworkLoadBalancerArns == null ) { setAddNetworkLoadBalancerArns ( new com . amazonaws . internal . SdkInternalList < String > ( addNetworkLoadBalancerArns . length ) ) ; } for ( String ele : addNetworkLoadBalancerArns ) { this . addNetworkLoadBalancerArns . add ( ele ) ; } return this ; |
public class ChatHistory { /** * Prunes all messages from this history which are expired . */
protected void prune ( long now , List < Entry > history ) { } } | int prunepos = 0 ; for ( int ll = history . size ( ) ; prunepos < ll ; prunepos ++ ) { Entry entry = history . get ( prunepos ) ; if ( now - entry . message . timestamp < HISTORY_EXPIRATION ) { break ; // stop when we get to the first valid message
} } history . subList ( 0 , prunepos ) . clear ( ) ; |
public class ClassLister { /** * Returns the all superclasses that define class hierarchies .
* @ returnthe superclasses */
public String [ ] getSuperclasses ( ) { } } | List < String > result ; result = new ArrayList < > ( m_CacheNames . keySet ( ) ) ; Collections . sort ( result ) ; return result . toArray ( new String [ result . size ( ) ] ) ; |
public class Handshaker { /** * Set the active protocol version and propagate it to the SSLSocket
* and our handshake streams . Called from ClientHandshaker
* and ServerHandshaker with the negotiated protocol version . */
void setVersion ( ProtocolVersion protocolVersion ) { } } | this . protocolVersion = protocolVersion ; setVersionSE ( protocolVersion ) ; output . r . setVersion ( protocolVersion ) ; |
public class DateUtils { /** * Gets a calendar using the default time zone and locale . The Calendar
* returned is based on the current time in the default time zone with the
* default locale .
* @ return a Calendar object . */
private static Calendar buildCalendar ( ) { } } | Calendar calendar = calendarCache . get ( ) ; if ( calendar == null ) { calendar = GregorianCalendar . getInstance ( ) ; calendarCache . set ( calendar ) ; } return calendar ; |
public class HtmlWriter { /** * Get the configuration string as a content .
* @ param key the key to look for in the configuration file
* @ param o1 string or content argument added to configuration text
* @ param o2 string or content argument added to configuration text
* @ return a content tree for the text */
public Content getResource ( String key , Object o0 , Object o1 ) { } } | return configuration . getResource ( key , o0 , o1 ) ; |
public class CommonMpJwtFat { /** * Set good app check expectations - sets checks for good status code and for a message indicating what if any app class was invoked successfully
* @ param theUrl - the url that the test invoked
* @ param appClass - the app class that should have been invoked
* @ return - newly created Expectations
* @ throws Exception */
public Expectations goodAppExpectations ( String theUrl , String appClass ) throws Exception { } } | Expectations expectations = new Expectations ( ) ; expectations . addExpectations ( CommonExpectations . successfullyReachedUrl ( theUrl ) ) ; expectations . addExpectation ( new ResponseFullExpectation ( MpJwtFatConstants . STRING_CONTAINS , appClass , "Did not invoke the app " + appClass + "." ) ) ; return expectations ; |
public class StringUtils { /** * Replace all occurrences of a substring within a string with another string .
* @ param str { @ code String } to examine
* @ param search { @ code String } array to replace
* @ param replace { @ code String } array to insert
* @ return a { @ code String } with the replacements */
public static String replace ( String str , String [ ] search , String [ ] replace ) { } } | if ( str == null || search == null || replace == null ) { return str ; } StringBuilder sb = new StringBuilder ( str ) ; int loop = ( search . length <= replace . length ) ? search . length : replace . length ; int start = 0 ; int end ; int searchLen ; int replaceLen ; for ( int i = 0 ; i < loop ; i ++ ) { if ( search [ i ] == null || replace [ i ] == null ) { continue ; } searchLen = search [ i ] . length ( ) ; replaceLen = replace [ i ] . length ( ) ; while ( true ) { if ( sb . length ( ) == 0 ) { break ; } start = sb . indexOf ( search [ i ] , start + replaceLen ) ; if ( start == - 1 ) { break ; } end = start + searchLen ; sb . replace ( start , end , replace [ i ] ) ; } } return sb . toString ( ) ; |
public class Model { /** * Find a specific object from its id .
* TODO : Figure out how to make this accesible without . . .
* creating a dummy instance .
* @ param id Object ' s id .
* @ return The object if found , null otherwise .
* @ throws com . mauriciogiordano . easydb . exception . NoContextFoundException in case of null context . */
public T find ( String id ) { } } | SharedPreferences prefs = loadSharedPreferences ( "object" ) ; JSONObject object = null ; try { String json = prefs . getString ( String . valueOf ( id ) , null ) ; if ( json == null ) return null ; object = new JSONObject ( json ) ; } catch ( JSONException e ) { e . printStackTrace ( ) ; } return fromJson ( object ) ; |
public class MetaModel { /** * Checks if there is association to the target model class . ,
* @ param targetModelClass class of a model that will be checked for association from current model .
* @ return true if any association exists such that the current model is a source and targetModelClass is a target . */
public boolean isAssociatedTo ( Class < ? extends Model > targetModelClass ) { } } | if ( targetModelClass == null ) { throw new NullPointerException ( ) ; } for ( Association association : associations ) { if ( association . getTargetClass ( ) . getName ( ) . equals ( targetModelClass . getName ( ) ) ) { return true ; } } return false ; |
public class QueryCriteriaUtil { /** * When there are multiple range criteria in a query ( in the same group ) , it is more efficient to
* submit a JPA " between " criteria than 2 different criteria .
* @ param intersectionCriteria A { @ link List } of { @ link QueryCriteria } instances that are range criteria */
@ SuppressWarnings ( "unchecked" ) private void combineIntersectingRangeCriteria ( List < QueryCriteria > intersectionCriteria ) { } } | Map < String , QueryCriteria > intersectingRangeCriteria = new HashMap < String , QueryCriteria > ( ) ; Iterator < QueryCriteria > iter = intersectionCriteria . iterator ( ) ; while ( iter . hasNext ( ) ) { QueryCriteria criteria = iter . next ( ) ; if ( QueryCriteriaType . RANGE . equals ( criteria . getType ( ) ) ) { QueryCriteria previousCriteria = intersectingRangeCriteria . put ( criteria . getListId ( ) , criteria ) ; if ( previousCriteria != null ) { Object [ ] prevCritValues , thisCritValues ; assert previousCriteria . hasValues ( ) || previousCriteria . hasDateValues ( ) : "Previous criteria has neither values nor date values!" ; assert ! ( previousCriteria . hasValues ( ) && previousCriteria . hasDateValues ( ) ) : "Previous criteria has BOTH values and date values!" ; assert ( previousCriteria . hasValues ( ) && criteria . hasValues ( ) ) || ( previousCriteria . hasDateValues ( ) && criteria . hasDateValues ( ) ) : "Previous and current criteria should have either both have values or both have date values!" ; boolean dateValues = false ; if ( previousCriteria . hasValues ( ) ) { prevCritValues = previousCriteria . getValues ( ) . toArray ( ) ; thisCritValues = criteria . getValues ( ) . toArray ( ) ; } else { dateValues = true ; prevCritValues = previousCriteria . getDateValues ( ) . toArray ( ) ; thisCritValues = criteria . getDateValues ( ) . toArray ( ) ; } List values = dateValues ? previousCriteria . getDateValues ( ) : previousCriteria . getValues ( ) ; if ( prevCritValues [ 0 ] == null && thisCritValues [ 1 ] == null ) { values . set ( 0 , thisCritValues [ 0 ] ) ; intersectingRangeCriteria . put ( previousCriteria . getListId ( ) , previousCriteria ) ; iter . remove ( ) ; } else if ( prevCritValues [ 1 ] == null && thisCritValues [ 0 ] == null ) { values . set ( 1 , thisCritValues [ 1 ] ) ; intersectingRangeCriteria . put ( previousCriteria . getListId ( ) , previousCriteria ) ; iter . remove ( ) ; } } } } |
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public EEnum getIfcMemberTypeEnum ( ) { } } | if ( ifcMemberTypeEnumEEnum == null ) { ifcMemberTypeEnumEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 858 ) ; } return ifcMemberTypeEnumEEnum ; |
public class FlexiantComputeClient { /** * Returns all images .
* @ param locationUUID optional location of the image , if null it will be ignored .
* @ return all images .
* @ throws FlexiantException */
public Set < de . uniulm . omi . cloudiator . flexiant . client . domain . Image > getImages ( @ Nullable final String locationUUID ) throws FlexiantException { } } | return this . getResources ( ResourceType . IMAGE , Image . class , locationUUID ) . stream ( ) . map ( de . uniulm . omi . cloudiator . flexiant . client . domain . Image :: new ) . collect ( Collectors . toSet ( ) ) ; |
public class VirtualRoot { /** * discarded before another WatchedDirectory is being unregistered . */
public synchronized void removeRoot ( final WatchedDirectory pWatchedDirectory ) { } } | requireNonNull ( pWatchedDirectory , WATCHED_DIRECTORY_IS_NULL ) ; final Object key = requireNonNull ( pWatchedDirectory . getKey ( ) , KEY_IS_NULL ) ; final Path directory = requireNonNull ( pWatchedDirectory . getDirectory ( ) , DIRECTORY_IS_NULL ) ; // It ' s already checked that nothing is null
final DedicatedFileSystem fs = children . get ( directory . getFileSystem ( ) ) ; if ( fs == null ) { LOG . warn ( format ( "No dedicated file system registered! Path: %s" , directory ) ) ; } else { fs . unregisterRootDirectory ( pWatchedDirectory . getDirectory ( ) , pWatchedDirectory ) ; // IMPORTANT : remove watched - directory with key specified .
watchedDirectories . remove ( key ) ; pWatchedDirectory . removeObserver ( this ) ; LOG . info ( "Removed [{}:{}]" , key , directory ) ; } |
public class BuildStepsInner { /** * List the build arguments for a step including the secret arguments .
* @ param nextPageLink The NextLink from the previous successful call to List operation .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the PagedList & lt ; BuildArgumentInner & gt ; object */
public Observable < ServiceResponse < Page < BuildArgumentInner > > > listBuildArgumentsNextWithServiceResponseAsync ( final String nextPageLink ) { } } | return listBuildArgumentsNextSinglePageAsync ( nextPageLink ) . concatMap ( new Func1 < ServiceResponse < Page < BuildArgumentInner > > , Observable < ServiceResponse < Page < BuildArgumentInner > > > > ( ) { @ Override public Observable < ServiceResponse < Page < BuildArgumentInner > > > call ( ServiceResponse < Page < BuildArgumentInner > > page ) { String nextPageLink = page . body ( ) . nextPageLink ( ) ; if ( nextPageLink == null ) { return Observable . just ( page ) ; } return Observable . just ( page ) . concatWith ( listBuildArgumentsNextWithServiceResponseAsync ( nextPageLink ) ) ; } } ) ; |
public class WDataRenderer { /** * The preparePaintComponent method has been overridden to keep the data object bound to this wcomponent in sync
* with any changes that control logic ( Action implementations ) or other wcomponents have made to the data .
* @ param request the Request being responded to . */
@ Override protected void preparePaintComponent ( final Request request ) { } } | // Let the wcomponent do its own preparation first , if any .
super . preparePaintComponent ( request ) ; Object data = getData ( ) ; if ( data != null ) { // Now update this wcomponent and its children with the data contained
// in the data object .
updateComponent ( data ) ; } |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.