signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class HttpsRedirect { /** * Return the full URL that should be redirected to including query parameters . */ private String getRedirectUrl ( HttpServletRequest request , String newScheme ) { } }
String serverName = request . getServerName ( ) ; String uri = request . getRequestURI ( ) ; StringBuilder redirect = new StringBuilder ( 100 ) ; redirect . append ( newScheme ) ; redirect . append ( "://" ) ; redirect . append ( serverName ) ; redirect . append ( uri ) ; String query = request . getQueryString ( ) ; if ( query != null ) { redirect . append ( '?' ) ; redirect . append ( query ) ; } return redirect . toString ( ) ;
public class RuntimeFieldFactory { /** * Returns the factory for inline ( scalar ) values . */ @ SuppressWarnings ( "unchecked" ) public static < T > RuntimeFieldFactory < T > getInline ( Class < T > typeClass ) { } }
return ( RuntimeFieldFactory < T > ) __inlineValues . get ( typeClass . getName ( ) ) ;
public class IterableSubject { /** * Fails if the subject does not have the given size . */ public final void hasSize ( int expectedSize ) { } }
checkArgument ( expectedSize >= 0 , "expectedSize(%s) must be >= 0" , expectedSize ) ; int actualSize = size ( actual ( ) ) ; check ( "size()" ) . that ( actualSize ) . isEqualTo ( expectedSize ) ;
public class ContentTargeting { /** * Gets the targetedContentMetadata value for this ContentTargeting . * @ return targetedContentMetadata * A list of content metadata within hierarchies that are being * targeted by the { @ code LineItem } . */ public com . google . api . ads . admanager . axis . v201808 . ContentMetadataKeyHierarchyTargeting [ ] getTargetedContentMetadata ( ) { } }
return targetedContentMetadata ;
public class SqlInfo { /** * Visible for testing */ static boolean isFollowedOrPrefixedByColon ( String sql , int i ) { } }
return ':' == sql . charAt ( i + 1 ) || ( i > 0 && ':' == sql . charAt ( i - 1 ) ) ;
public class PerformanceMetrics { /** * Creates new instance of performance metrics . Stores the key and correlation id of the parent metrics instance . * Assigns next level . * @ param nextAction a short name of measured operation , typically a first prefix of descriptor * @ param nextActionClass a class which implements the action * @ param nextDescriptor a full description of measured operation * @ return PerformanceMetrics a new instance of performance metrics with stored key and correlationId from the parent * metrics and assigned next level */ public PerformanceMetrics createNext ( String nextAction , String nextDescriptor , Class nextActionClass ) { } }
PerformanceMetrics next = new PerformanceMetrics ( key , level + 1 , nextAction , nextActionClass , nextDescriptor , correlationId ) ; next . previous = this ; return next ;
public class DirectClustering { /** * Performs one iteration of Direct Clustering over the data set . */ private static void clusterIteration ( Matrix matrix , int numClusters , KMeansSeed seedType , CriterionFunction criterion ) { } }
DoubleVector [ ] centers = seedType . chooseSeeds ( numClusters , matrix ) ; // Compute the initial set of assignments for each data point based on // the initial assignments . int [ ] initialAssignments = new int [ matrix . rows ( ) ] ; // If there is to be only one cluster , then everything will be auto // assigned to the first cluster . This is just a special case that only // comes up when comparing other solutions to the non - solution . if ( numClusters != 1 ) { int nc = 0 ; for ( int i = 0 ; i < matrix . rows ( ) ; ++ i ) { DoubleVector vector = matrix . getRowVector ( i ) ; double bestSimilarity = 0 ; for ( int c = 0 ; c < numClusters ; ++ c ) { double similarity = Similarity . cosineSimilarity ( centers [ c ] , vector ) ; nc ++ ; if ( similarity >= bestSimilarity ) { bestSimilarity = similarity ; initialAssignments [ i ] = c ; } } } } // Setup the criterion function with it ' s meta data . criterion . setup ( matrix , initialAssignments , numClusters ) ; // Iteratively swap each data point to a better cluster if such an // assignment exists . List < Integer > indices = new ArrayList < Integer > ( matrix . rows ( ) ) ; for ( int i = 0 ; i < matrix . rows ( ) ; ++ i ) indices . add ( i ) ; // Iterate through each data point in random order . For each data // point , try to assign it to a new cluster . If no data point is moved // in an iteration , end the iterations . boolean changed = true ; while ( changed ) { changed = false ; Collections . shuffle ( indices ) ; for ( int index : indices ) changed |= criterion . update ( index ) ; }
public class FnBigDecimal { /** * It multiplies target by multiplicand and returns its value . The result precision * and { @ link RoundingMode } is specified by the given { @ link MathContext } * @ param multiplicand the multiplicand * @ param mathContext the { @ link MathContext } to define { @ link RoundingMode } and precision * @ return the result of target * multiplicand */ public final static Function < BigDecimal , BigDecimal > multiplyBy ( byte multiplicand , MathContext mathContext ) { } }
return multiplyBy ( Byte . valueOf ( multiplicand ) , mathContext ) ;
public class Base64 { /** * Validate char byte and revalculate to data byte value or throw IllegalArgumentException . * @ param decodabet The decodabet to use . * @ param from The char byte to check . * @ return The value byte . * @ throws IllegalArgumentException If the char is not valid for the alphabet . */ private static int validate ( byte [ ] decodabet , byte from ) { } }
byte b = decodabet [ from & 0x7F ] ; if ( b < 0 ) { throw new IllegalArgumentException ( String . format ( "Bad Base64%s character '%s'" , ( decodabet == _URL_SAFE_DECODABET ? " url safe" : "" ) , escape ( from ) ) ) ; } return b ;
public class Java5 { /** * Synthetic parameters such as those added for inner class constructors may * not be included in the parameter annotations array . This is the case when * at least one parameter of an inner class constructor has an annotation with * a RUNTIME retention ( this occurs for JDK8 and below ) . This method will * normalize the annotations array so that it contains the same number of * elements as the array returned from { @ link Constructor # getParameterTypes ( ) } . * If adjustment is required , the adjusted array will be prepended with a * zero - length element . If no adjustment is required , the original array * from { @ link Constructor # getParameterAnnotations ( ) } will be returned . * @ param constructor the Constructor for which to return parameter annotations * @ return array of arrays containing the annotations on the parameters of the given Constructor */ private Annotation [ ] [ ] getConstructorParameterAnnotations ( Constructor < ? > constructor ) { } }
/* * TODO : Remove after JDK9 is the minimum JDK supported * JDK9 + correctly accounts for the synthetic parameter and when it becomes * the minimum version this method should no longer be required . */ int parameterCount = constructor . getParameterTypes ( ) . length ; Annotation [ ] [ ] annotations = constructor . getParameterAnnotations ( ) ; int diff = parameterCount - annotations . length ; if ( diff > 0 ) { // May happen on JDK8 and below . We add elements to the front of the array to account for the synthetic params : // - for an inner class we expect one param to account for the synthetic outer reference // - for an enum we expect two params to account for the synthetic name and ordinal if ( ( ! constructor . getDeclaringClass ( ) . isEnum ( ) && diff > 1 ) || diff > 2 ) { throw new GroovyBugError ( "Constructor parameter annotations length [" + annotations . length + "] " + "does not match the parameter length: " + constructor ) ; } Annotation [ ] [ ] adjusted = new Annotation [ parameterCount ] [ ] ; for ( int i = 0 ; i < diff ; i ++ ) { adjusted [ i ] = EMPTY_ANNOTATION_ARRAY ; } System . arraycopy ( annotations , 0 , adjusted , diff , annotations . length ) ; return adjusted ; } return annotations ;
public class AbstractNode { /** * Returns a list of the entries . * @ return a list of the entries * @ deprecated Using this method means an extra copy - usually at the cost of * performance . */ @ SuppressWarnings ( "unchecked" ) @ Deprecated public final List < E > getEntries ( ) { } }
List < E > result = new ArrayList < > ( numEntries ) ; for ( Entry entry : entries ) { if ( entry != null ) { result . add ( ( E ) entry ) ; } } return result ;
public class PGPRGImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public void setPGorient ( Integer newPGorient ) { } }
Integer oldPGorient = pGorient ; pGorient = newPGorient ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , AfplibPackage . PGPRG__PGORIENT , oldPGorient , pGorient ) ) ;
public class UndoUtils { /** * Returns an UndoManager with an unlimited history that can undo / redo { @ link PlainTextChange } s . New changes * emitted from the stream will not be merged with the previous change * after { @ link # DEFAULT _ PREVENT _ MERGE _ DELAY } */ public static < PS , SEG , S > UndoManager < List < PlainTextChange > > plainTextUndoManager ( GenericStyledArea < PS , SEG , S > area ) { } }
return plainTextUndoManager ( area , DEFAULT_PREVENT_MERGE_DELAY ) ;
public class XAttributeMapLazyImpl { /** * / * ( non - Javadoc ) * @ see java . util . Map # put ( java . lang . Object , java . lang . Object ) */ public synchronized XAttribute put ( String key , XAttribute value ) { } }
if ( backingStore == null ) { try { backingStore = backingStoreClass . newInstance ( ) ; } catch ( Exception e ) { // Fuckup e . printStackTrace ( ) ; } } return backingStore . put ( key , value ) ;
public class LdapTemplate { /** * { @ inheritDoc } */ @ Override public void search ( final String base , final String filter , final SearchControls controls , NameClassPairCallbackHandler handler , DirContextProcessor processor ) { } }
// Create a SearchExecutor to perform the search . SearchExecutor se = new SearchExecutor ( ) { public NamingEnumeration executeSearch ( DirContext ctx ) throws javax . naming . NamingException { return ctx . search ( base , filter , controls ) ; } } ; if ( handler instanceof ContextMapperCallbackHandler ) { assureReturnObjFlagSet ( controls ) ; } search ( se , handler , processor ) ;
public class Pattern { /** * Appends a new pattern to the existing one . The new pattern enforces non - strict * temporal contiguity . This means that a matching event of this pattern and the * preceding matching event might be interleaved with other events which are ignored . * @ param name Name of the new pattern * @ return A new pattern which is appended to this one */ public Pattern < T , T > followedByAny ( final String name ) { } }
return new Pattern < > ( name , this , ConsumingStrategy . SKIP_TILL_ANY , afterMatchSkipStrategy ) ;
public class ProjectReportScreen { /** * Add to the current level , then * get the record at this level * If the record doesn ' t exist , clone a new one and return it . * @ param record The main record ( that I will clone if I need to ) * @ param iOffsetFromCurrentLevel The amount to bump the level * @ return The record at this ( new ) level . */ public Record getCurrentLevelInfo ( int iOffsetFromCurrentLevel , Record record ) { } }
int dLevel = ( int ) this . getScreenRecord ( ) . getField ( ProjectTaskScreenRecord . CURRENT_LEVEL ) . getValue ( ) ; dLevel = dLevel + iOffsetFromCurrentLevel ; this . getScreenRecord ( ) . getField ( ProjectTaskScreenRecord . CURRENT_LEVEL ) . setValue ( dLevel ) ; if ( m_rgCurrentLevelInfo . size ( ) >= dLevel ) { try { m_rgCurrentLevelInfo . add ( ( Record ) record . clone ( ) ) ; m_rgCurrentLevelInfo . elementAt ( dLevel ) . setKeyArea ( ProjectTask . PARENT_PROJECT_TASK_ID_KEY ) ; } catch ( CloneNotSupportedException ex ) { ex . printStackTrace ( ) ; } } return m_rgCurrentLevelInfo . elementAt ( dLevel ) ;
public class ThriftCodecByteCodeGenerator { /** * Defines the generics bridge method with untyped args to the type specific write method . */ private void defineWriteBridgeMethod ( ) { } }
classDefinition . addMethod ( new MethodDefinition ( a ( PUBLIC , BRIDGE , SYNTHETIC ) , "write" , null , arg ( "struct" , Object . class ) , arg ( "protocol" , TProtocol . class ) ) . addException ( Exception . class ) . loadThis ( ) . loadVariable ( "struct" , structType ) . loadVariable ( "protocol" ) . invokeVirtual ( codecType , "write" , type ( void . class ) , structType , type ( TProtocol . class ) ) . ret ( ) ) ;
public class ImageHandlerBuilder { /** * Resize the image to the given width and height * @ param width * @ param height * @ return */ public ImageHandlerBuilder resize ( int width , int height ) { } }
BufferedImage resize = Scalr . resize ( image , Scalr . Mode . FIT_EXACT , width , height ) ; image . flush ( ) ; image = resize ; return this ;
public class Solo { /** * Clicks a WebElement matching the specified By object . * @ param by the By object . Examples are : { @ code By . id ( " id " ) } and { @ code By . name ( " name " ) } */ public void clickOnWebElement ( By by ) { } }
if ( config . commandLogging ) { Log . d ( config . commandLoggingTag , "clickOnWebElement(" + by + ")" ) ; } clickOnWebElement ( by , 0 , true ) ;
public class Server { /** * Does global scope lookup for host name and context path * @ param hostName * Host name * @ param contextPath * Context path * @ return Global scope */ public IGlobalScope lookupGlobal ( String hostName , String contextPath ) { } }
log . trace ( "{}" , this ) ; log . debug ( "Lookup global scope - host name: {} context path: {}" , hostName , contextPath ) ; // Init mappings key String key = getKey ( hostName , contextPath ) ; // If context path contains slashes get complex key and look for it in mappings while ( contextPath . indexOf ( SLASH ) != - 1 ) { key = getKey ( hostName , contextPath ) ; log . trace ( "Check: {}" , key ) ; String globalName = mapping . get ( key ) ; if ( globalName != null ) { return getGlobal ( globalName ) ; } final int slashIndex = contextPath . lastIndexOf ( SLASH ) ; // Context path is substring from the beginning and till last slash index contextPath = contextPath . substring ( 0 , slashIndex ) ; } // Get global scope key key = getKey ( hostName , contextPath ) ; log . trace ( "Check host and path: {}" , key ) ; // Look up for global scope switching keys if still not found String globalName = mapping . get ( key ) ; if ( globalName != null ) { return getGlobal ( globalName ) ; } key = getKey ( EMPTY , contextPath ) ; log . trace ( "Check wildcard host with path: {}" , key ) ; globalName = mapping . get ( key ) ; if ( globalName != null ) { return getGlobal ( globalName ) ; } key = getKey ( hostName , EMPTY ) ; log . trace ( "Check host with no path: {}" , key ) ; globalName = mapping . get ( key ) ; if ( globalName != null ) { return getGlobal ( globalName ) ; } key = getKey ( EMPTY , EMPTY ) ; log . trace ( "Check default host, default path: {}" , key ) ; return getGlobal ( mapping . get ( key ) ) ;
public class CATBrowseConsumer { /** * Closes the browser . * @ param requestNumber */ @ Override public void close ( int requestNumber ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "close" , "" + requestNumber ) ; BrowserSession browserSession = mainConsumer . getBrowserSession ( ) ; try { browserSession . close ( ) ; } catch ( SIException e ) { // No FFDC code needed // Only FFDC if we haven ' t received a meTerminated event . if ( ! ( ( ConversationState ) getConversation ( ) . getAttachment ( ) ) . hasMETerminated ( ) ) { FFDCFilter . processException ( e , CLASS_NAME + ".close" , CommsConstants . CATBROWSECONSUMER_CLOSE_01 , this ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , e . getMessage ( ) , e ) ; StaticCATHelper . sendExceptionToClient ( e , CommsConstants . CATBROWSECONSUMER_CLOSE_01 , getConversation ( ) , requestNumber ) ; } try { getConversation ( ) . send ( poolManager . allocate ( ) , JFapChannelConstants . SEG_CLOSE_CONSUMER_SESS_R , requestNumber , Conversation . PRIORITY_LOWEST , true , ThrottlingPolicy . BLOCK_THREAD , null ) ; } catch ( SIException e ) { FFDCFilter . processException ( e , CLASS_NAME + ".close" , CommsConstants . CATBROWSECONSUMER_CLOSE_02 , this ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , e . getMessage ( ) , e ) ; // d175222 // Cannot do anything else at this point as a comms exception suggests that the // connection is unusable . } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "close" ) ;
public class MethodCommand { /** * Gets a parameter value as a Java Boolean . * @ param name The parameter name * @ param params The parameters * @ return The boolean */ protected BigDecimal asBigDecimal ( String name , Map < String , Value > params ) { } }
return coerceToBigDecimal ( params . get ( name ) ) ;
public class InputHandler { /** * region . . . Mouse listener methods . . . */ @ Override public void mouseClicked ( MouseEvent e ) { } }
mouseEvents . add ( MouseInputEvent . fromMouseEvent ( MouseAction . CLICKED , e ) ) ;
public class KeySnapshot { /** * Return all the keys of the given class . * @ param clz Class * @ return array of keys in this snapshot with the given class */ public static Key [ ] globalKeysOfClass ( final Class clz ) { } }
return KeySnapshot . globalSnapshot ( ) . filter ( new KeySnapshot . KVFilter ( ) { @ Override public boolean filter ( KeySnapshot . KeyInfo k ) { return Value . isSubclassOf ( k . _type , clz ) ; } } ) . keys ( ) ;
public class DisasterRecoveryConfigurationsInner { /** * Creates or updates a disaster recovery configuration . * @ param resourceGroupName The name of the resource group that contains the resource . You can obtain this value from the Azure Resource Manager API or the portal . * @ param serverName The name of the server . * @ param disasterRecoveryConfigurationName The name of the disaster recovery configuration to be created / updated . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ throws CloudException thrown if the request is rejected by server * @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @ return the DisasterRecoveryConfigurationInner object if successful . */ public DisasterRecoveryConfigurationInner createOrUpdate ( String resourceGroupName , String serverName , String disasterRecoveryConfigurationName ) { } }
return createOrUpdateWithServiceResponseAsync ( resourceGroupName , serverName , disasterRecoveryConfigurationName ) . toBlocking ( ) . last ( ) . body ( ) ;
public class CommercePriceListUtil { /** * Returns the first commerce price list in the ordered set where uuid = & # 63 ; . * @ param uuid the uuid * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) * @ return the first matching commerce price list , or < code > null < / code > if a matching commerce price list could not be found */ public static CommercePriceList fetchByUuid_First ( String uuid , OrderByComparator < CommercePriceList > orderByComparator ) { } }
return getPersistence ( ) . fetchByUuid_First ( uuid , orderByComparator ) ;
public class Parsers { /** * A { @ link Parser } that sequentially runs { @ code p1 } and { @ code p2 } and collects the results in a * { @ link Pair } object . Is equivalent to { @ link # tuple ( Parser , Parser ) } . * @ deprecated Prefer to converting to your own object with a lambda . */ @ Deprecated public static < A , B > Parser < Pair < A , B > > pair ( Parser < ? extends A > p1 , Parser < ? extends B > p2 ) { } }
return sequence ( p1 , p2 , Pair :: new ) ;
public class WikiUser { /** * create a credentials ini file from the command line */ public static void createIniFile ( String ... args ) { } }
try { // open up standard input BufferedReader br = new BufferedReader ( new InputStreamReader ( System . in ) ) ; String wikiid = null ; if ( args . length > 0 ) wikiid = args [ 0 ] ; else wikiid = getInput ( "wiki id" , br ) ; String username = null ; if ( args . length > 1 ) username = args [ 1 ] ; else username = getInput ( "username" , br ) ; String password = null ; if ( args . length > 2 ) password = args [ 2 ] ; else password = getInput ( "password" , br ) ; String email = null ; if ( args . length > 3 ) email = args [ 3 ] ; else email = getInput ( "email" , br ) ; File propFile = getPropertyFile ( wikiid , username ) ; String remember = null ; if ( args . length > 4 ) remember = args [ 4 ] ; else remember = getInput ( "shall i store " + username + "'s credentials encrypted in " + propFile . getName ( ) + " y/n?" , br ) ; if ( remember . trim ( ) . toLowerCase ( ) . startsWith ( "y" ) ) { Crypt lCrypt = Crypt . getRandomCrypt ( ) ; Properties props = new Properties ( ) ; props . setProperty ( "cypher" , lCrypt . getCypher ( ) ) ; props . setProperty ( "salt" , lCrypt . getSalt ( ) ) ; props . setProperty ( "user" , username ) ; props . setProperty ( "email" , email ) ; props . setProperty ( "secret" , lCrypt . encrypt ( password ) ) ; if ( ! propFile . getParentFile ( ) . exists ( ) ) { propFile . getParentFile ( ) . mkdirs ( ) ; } FileOutputStream propsStream = new FileOutputStream ( propFile ) ; props . store ( propsStream , "Mediawiki JAPI credentials for " + wikiid ) ; propsStream . close ( ) ; } } catch ( IOException e1 ) { LOGGER . log ( Level . SEVERE , e1 . getMessage ( ) ) ; } catch ( GeneralSecurityException e1 ) { LOGGER . log ( Level . SEVERE , e1 . getMessage ( ) ) ; }
public class GovernatorComponentProviderFactory { /** * Maps a Guice scope to a Jersey scope . * @ return the map */ public Map < Scope , ComponentScope > createScopeMap ( ) { } }
Map < Scope , ComponentScope > result = new HashMap < Scope , ComponentScope > ( ) ; result . put ( Scopes . SINGLETON , ComponentScope . Singleton ) ; result . put ( Scopes . NO_SCOPE , ComponentScope . PerRequest ) ; result . put ( ServletScopes . REQUEST , ComponentScope . PerRequest ) ; return result ;
public class ClassUtils { /** * Returns the ( initialized ) class represented by { @ code className } * using the { @ code classLoader } . This implementation supports * the syntaxes " { @ code java . util . Map . Entry [ ] } " , * " { @ code java . util . Map $ Entry [ ] } " , " { @ code [ Ljava . util . Map . Entry ; } " , * and " { @ code [ Ljava . util . Map $ Entry ; } " . * @ param classLoader the class loader to use to load the class * @ param className the class name * @ return the class represented by { @ code className } using the { @ code classLoader } * @ throws ClassNotFoundException if the class is not found */ @ GwtIncompatible ( "incompatible method" ) public static Class < ? > getClass ( final ClassLoader classLoader , final String className ) throws ClassNotFoundException { } }
return getClass ( classLoader , className , true ) ;
public class Ifc2x3tc1FactoryImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public IfcDimensionExtentUsage createIfcDimensionExtentUsageFromString ( EDataType eDataType , String initialValue ) { } }
IfcDimensionExtentUsage result = IfcDimensionExtentUsage . get ( initialValue ) ; if ( result == null ) throw new IllegalArgumentException ( "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType . getName ( ) + "'" ) ; return result ;
public class XGMMLUtility { /** * Write an XGMML & lt ; edge & gt ; from { @ code edge } properties . * @ param edge { @ link Edge } , the edge to write * @ param writer { @ link PrintWriter } , the writer */ public static void writeEdge ( Node src , Node tgt , Edge edge , PrintWriter writer ) { } }
StringBuilder sb = new StringBuilder ( ) ; RelationshipType rel = edge . rel ; String reldispval = rel . getDisplayValue ( ) ; sb . append ( " <edge label='" ) ; String dispval = format ( EDGE_LABEL , src . label , rel , tgt . label ) ; sb . append ( dispval ) ; sb . append ( "' source='" ) ; sb . append ( edge . source . toString ( ) ) ; sb . append ( "' target='" ) ; sb . append ( edge . target . toString ( ) ) ; sb . append ( "'>\n" ) ; sb . append ( " <att name='relationship type'" ) ; sb . append ( " value='" ) ; sb . append ( reldispval ) ; sb . append ( "' />\n" ) ; // Edge graphics String color = color ( rel ) ; String graphics = format ( EDGE_GRAPHICS , 1 , color , 1 , reldispval ) ; sb . append ( graphics ) ; sb . append ( " </edge>\n" ) ; writer . write ( sb . toString ( ) ) ;
public class HtmlOutcomeTargetLink { /** * < p > Return the value of the < code > onmousemove < / code > property . < / p > * < p > Contents : Javascript code executed when a pointer button is * moved within this element . */ public java . lang . String getOnmousemove ( ) { } }
return ( java . lang . String ) getStateHelper ( ) . eval ( PropertyKeys . onmousemove ) ;
public class MSDelegatingLocalTransactionSynchronization { public void beforeCompletion ( ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "beforeCompletion" ) ; if ( _state != TransactionState . STATE_ACTIVE ) { MessageStoreRuntimeException mre = new MessageStoreRuntimeException ( nls . getFormattedMessage ( "TRAN_PROTOCOL_ERROR_SIMS1001" , new Object [ ] { } , null ) ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) SibTr . event ( tc , "Cannot complete Transaction. Transaction is complete or completing!" , mre ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "beforeCompletion" ) ; throw mre ; } for ( int i = 0 ; i < _callbacks . size ( ) ; i ++ ) { TransactionCallback callback = ( TransactionCallback ) _callbacks . get ( i ) ; callback . beforeCompletion ( this ) ; } // Do we have work to do ? if ( _workList != null ) { try { _workList . preCommit ( this ) ; } catch ( Throwable t ) { FFDCFilter . processException ( t , "com.ibm.ws.sib.msgstore.transactions.MSDelegatingLocalTransactionSynchronization.beforeCompletion" , "1:103:1.4.1.1" , this ) ; // An error has occurred during preCommit // so we need to trigger a rollback of our // transaction and therefore our connection // by throwing a runtime exception . if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) SibTr . event ( tc , "Throwing exception in beforeCompletion to ensure rollback due to Exception in preCommit!" , t ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "beforeCompletion" ) ; throw new MessageStoreRuntimeException ( nls . getFormattedMessage ( "COMPLETION_EXCEPTION_SIMS1002" , new Object [ ] { t } , null ) , t ) ; } } // Need to change the state after we have // called the callbacks and preCommitted // the workList as they may trigger // an addWork call to add work to the // transaction . _state = TransactionState . STATE_COMMITTING_1PC ; try { // Do we have work to do ? if ( _workList != null ) { // Call the persistence layer to trigger our // database work on the shared connection . _persistence . beforeCompletion ( this ) ; } } catch ( PersistenceException pe ) { FFDCFilter . processException ( pe , "com.ibm.ws.sib.msgstore.transactions.MSDelegatingLocalTransactionSynchronization.beforeCompletion" , "1:134:1.4.1.1" , this ) ; // An error has occurred during the persistence // phase so we need to trigger a rollback of our // transaction and therefore our connection by // throwing a runtime exception . if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) SibTr . event ( tc , "Rollback-only set on transaction due to PersistenceException in beforeCompletion!" , pe ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "beforeCompletion" ) ; throw new MessageStoreRuntimeException ( nls . getFormattedMessage ( "COMPLETION_EXCEPTION_SIMS1002" , new Object [ ] { pe } , null ) , pe ) ; } catch ( SevereMessageStoreException smse ) { FFDCFilter . processException ( smse , "com.ibm.ws.sib.msgstore.transactions.MSDelegatingLocalTransactionSynchronization.beforeCompletion" , "1:145:1.4.1.1" , this ) ; // An error has occurred during the persistence // phase so we need to trigger a rollback of our // transaction and therefore our connection by // throwing a runtime exception . if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) SibTr . event ( tc , "Rollback-only set on transaction due to PersistenceException in beforeCompletion!" , smse ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "beforeCompletion" ) ; throw new MessageStoreRuntimeException ( nls . getFormattedMessage ( "COMPLETION_EXCEPTION_SIMS1002" , new Object [ ] { smse } , null ) , smse ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "beforeCompletion" ) ;
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link String } { @ code > } */ @ XmlElementDecl ( namespace = "http://docs.oasis-open.org/ns/cmis/messaging/200908/" , name = "filter" , scope = GetProperties . class ) public JAXBElement < String > createGetPropertiesFilter ( String value ) { } }
return new JAXBElement < String > ( _GetPropertiesFilter_QNAME , String . class , GetProperties . class , value ) ;
public class Pattern { /** * Splits the given input sequence around matches of this pattern . * < p > The array returned by this method contains each substring of the * input sequence that is terminated by another subsequence that matches * this pattern or is terminated by the end of the input sequence . The * substrings in the array are in the order in which they occur in the * input . If this pattern does not match any subsequence of the input then * the resulting array has just one element , namely the input sequence in * string form . * < p > The < tt > limit < / tt > parameter controls the number of times the * pattern is applied and therefore affects the length of the resulting * array . If the limit < i > n < / i > is greater than zero then the pattern * will be applied at most < i > n < / i > & nbsp ; - & nbsp ; 1 times , the array ' s * length will be no greater than < i > n < / i > , and the array ' s last entry * will contain all input beyond the last matched delimiter . If < i > n < / i > * is non - positive then the pattern will be applied as many times as * possible and the array can have any length . If < i > n < / i > is zero then * the pattern will be applied as many times as possible , the array can * have any length , and trailing empty strings will be discarded . * < p > The input < tt > " boo : and : foo " < / tt > , for example , yields the following * results with these parameters : * < blockquote > < table cellpadding = 1 cellspacing = 0 * summary = " Split examples showing regex , limit , and result " > * < tr > < th > < P align = " left " > < i > Regex & nbsp ; & nbsp ; & nbsp ; & nbsp ; < / i > < / th > * < th > < P align = " left " > < i > Limit & nbsp ; & nbsp ; & nbsp ; & nbsp ; < / i > < / th > * < th > < P align = " left " > < i > Result & nbsp ; & nbsp ; & nbsp ; & nbsp ; < / i > < / th > < / tr > * < tr > < td align = center > : < / td > * < td align = center > 2 < / td > * < td > < tt > { " boo " , " and : foo " } < / tt > < / td > < / tr > * < tr > < td align = center > : < / td > * < td align = center > 5 < / td > * < td > < tt > { " boo " , " and " , " foo " } < / tt > < / td > < / tr > * < tr > < td align = center > : < / td > * < td align = center > - 2 < / td > * < td > < tt > { " boo " , " and " , " foo " } < / tt > < / td > < / tr > * < tr > < td align = center > o < / td > * < td align = center > 5 < / td > * < td > < tt > { " b " , " " , " : and : f " , " " , " " } < / tt > < / td > < / tr > * < tr > < td align = center > o < / td > * < td align = center > - 2 < / td > * < td > < tt > { " b " , " " , " : and : f " , " " , " " } < / tt > < / td > < / tr > * < tr > < td align = center > o < / td > * < td align = center > 0 < / td > * < td > < tt > { " b " , " " , " : and : f " } < / tt > < / td > < / tr > * < / table > < / blockquote > * @ param input * The character sequence to be split * @ param limit * The result threshold , as described above * @ return The array of strings computed by splitting the input * around matches of this pattern */ public String [ ] split ( CharSequence input , int limit ) { } }
String [ ] fast = fastSplit ( pattern , input . toString ( ) , limit ) ; if ( fast != null ) { return fast ; } int index = 0 ; boolean matchLimited = limit > 0 ; ArrayList < String > matchList = new ArrayList < > ( ) ; Matcher m = matcher ( input ) ; // Add segments before each match found while ( m . find ( ) ) { if ( ! matchLimited || matchList . size ( ) < limit - 1 ) { String match = input . subSequence ( index , m . start ( ) ) . toString ( ) ; matchList . add ( match ) ; index = m . end ( ) ; } else if ( matchList . size ( ) == limit - 1 ) { // last one String match = input . subSequence ( index , input . length ( ) ) . toString ( ) ; matchList . add ( match ) ; index = m . end ( ) ; } } // If no match was found , return this if ( index == 0 ) return new String [ ] { input . toString ( ) } ; // Add remaining segment if ( ! matchLimited || matchList . size ( ) < limit ) matchList . add ( input . subSequence ( index , input . length ( ) ) . toString ( ) ) ; // Construct result int resultSize = matchList . size ( ) ; if ( limit == 0 ) while ( resultSize > 0 && matchList . get ( resultSize - 1 ) . equals ( "" ) ) resultSize -- ; String [ ] result = new String [ resultSize ] ; return matchList . subList ( 0 , resultSize ) . toArray ( result ) ;
public class ServletHttpResponse { public void addDateHeader ( String name , long value ) { } }
try { _httpResponse . addDateField ( name , value ) ; } catch ( IllegalStateException e ) { LogSupport . ignore ( log , e ) ; }
public class TimeStampUtils { /** * Gets the current date / time based on the provided { @ code format } * which is a SimpleDateFormat string . If application of the provided * { @ code format } fails a default format is used . * The DEFAULT is defined in Messages . properties . * @ see SimpleDateFormat * @ param format a { @ code String } representing the date format * @ return current formatted time stamp as { @ code String } */ public static String currentFormattedTimeStamp ( String format ) { } }
try { SimpleDateFormat sdf = new SimpleDateFormat ( format ) ; return sdf . format ( new Date ( ) ) ; } catch ( IllegalArgumentException | NullPointerException e ) { return ( TimeStampUtils . currentDefaultFormattedTimeStamp ( ) ) ; }
public class CreateConsumerQuery { /** * / * ( non - Javadoc ) * @ see net . timewalker . ffmq4 . network . packet . AbstractPacket # unserializeFrom ( net . timewalker . ffmq4 . utils . RawDataInputStream ) */ @ Override protected void unserializeFrom ( RawDataBuffer in ) { } }
super . unserializeFrom ( in ) ; consumerId = new IntegerID ( in . readInt ( ) ) ; destination = DestinationSerializer . unserializeFrom ( in ) ; messageSelector = in . readNullableUTF ( ) ; noLocal = in . readBoolean ( ) ;
public class ARPACK { /** * Find k approximate eigen pairs of a symmetric matrix by the * Lanczos algorithm . * @ param k Number of eigenvalues of OP to be computed . 0 < k < N . * @ param ritz Specify which of the Ritz values to compute . */ public static EVD eigen ( Matrix A , int k , Ritz ritz ) { } }
return eigen ( A , k , ritz , 1E-8 , 10 * A . nrows ( ) ) ;
public class GuildManager { /** * Sets the { @ link net . dv8tion . jda . core . entities . Guild . VerificationLevel Verification Level } of this { @ link net . dv8tion . jda . core . entities . Guild Guild } . * @ param level * The new Verification Level for this { @ link net . dv8tion . jda . core . entities . Guild Guild } * @ throws IllegalArgumentException * If the provided level is { @ code null } or UNKNOWN * @ return GuildManager for chaining convenience */ @ CheckReturnValue public GuildManager setVerificationLevel ( Guild . VerificationLevel level ) { } }
Checks . notNull ( level , "Level" ) ; Checks . check ( level != Guild . VerificationLevel . UNKNOWN , "Level must not be UNKNOWN" ) ; this . verificationLevel = level . getKey ( ) ; set |= VERIFICATION_LEVEL ; return this ;
public class FacetInspector { /** * Inspect the given { @ link Class } for any { @ link FacetConstraintType # OPTIONAL } dependency { @ link Facet } types . */ public static < FACETTYPE extends Facet < ? > > Set < Class < FACETTYPE > > getOptionalFacets ( final Class < ? > inspectedType ) { } }
return getRelatedFacets ( inspectedType , FacetConstraintType . OPTIONAL ) ;
public class vpnvserver_cachepolicy_binding { /** * Use this API to fetch vpnvserver _ cachepolicy _ binding resources of given name . */ public static vpnvserver_cachepolicy_binding [ ] get ( nitro_service service , String name ) throws Exception { } }
vpnvserver_cachepolicy_binding obj = new vpnvserver_cachepolicy_binding ( ) ; obj . set_name ( name ) ; vpnvserver_cachepolicy_binding response [ ] = ( vpnvserver_cachepolicy_binding [ ] ) obj . get_resources ( service ) ; return response ;
public class RRBudget10V1_1Generator { /** * This method returns RRBudget10Document object based on proposal development * document which contains the informations such as * DUNSID , OrganizationName , BudgetType , BudgetYear and BudgetSummary . * @ return rrBudgetDocument { @ link XmlObject } of type RRBudget10Document . */ private RRBudget10Document getRRBudget10 ( ) { } }
deleteAutoGenNarratives ( ) ; RRBudget10Document rrBudgetDocument = RRBudget10Document . Factory . newInstance ( ) ; RRBudget10 rrBudget = RRBudget10 . Factory . newInstance ( ) ; rrBudget . setFormVersion ( FormVersion . v1_1 . getVersion ( ) ) ; if ( pdDoc . getDevelopmentProposal ( ) . getApplicantOrganization ( ) != null ) { rrBudget . setDUNSID ( pdDoc . getDevelopmentProposal ( ) . getApplicantOrganization ( ) . getOrganization ( ) . getDunsNumber ( ) ) ; rrBudget . setOrganizationName ( pdDoc . getDevelopmentProposal ( ) . getApplicantOrganization ( ) . getOrganization ( ) . getOrganizationName ( ) ) ; } rrBudget . setBudgetType ( BudgetTypeDataType . PROJECT ) ; List < BudgetPeriodDto > budgetperiodList ; BudgetSummaryDto budgetSummary = null ; try { validateBudgetForForm ( pdDoc ) ; budgetperiodList = s2sBudgetCalculatorService . getBudgetPeriods ( pdDoc ) ; budgetSummary = s2sBudgetCalculatorService . getBudgetInfo ( pdDoc , budgetperiodList ) ; } catch ( S2SException e ) { LOG . error ( e . getMessage ( ) , e ) ; return rrBudgetDocument ; } rrBudget . setBudgetSummary ( getBudgetSummary ( budgetSummary ) ) ; for ( BudgetPeriodDto budgetPeriodData : budgetperiodList ) { setBudgetYearDataType ( rrBudget , budgetPeriodData ) ; } AttachedFileDataType attachedFileDataType = AttachedFileDataType . Factory . newInstance ( ) ; for ( NarrativeContract narrative : pdDoc . getDevelopmentProposal ( ) . getNarratives ( ) ) { if ( narrative . getNarrativeType ( ) . getCode ( ) != null && Integer . parseInt ( narrative . getNarrativeType ( ) . getCode ( ) ) == 132 ) { attachedFileDataType = getAttachedFileType ( narrative ) ; if ( attachedFileDataType != null ) { break ; } } } rrBudget . setBudgetJustificationAttachment ( attachedFileDataType ) ; rrBudgetDocument . setRRBudget10 ( rrBudget ) ; return rrBudgetDocument ;
public class base_resource { /** * Converts netscaler resource to Json string . * @ param service nitro _ service object . * @ param id sessionId . * @ param option Options object . * @ return string in Json format . */ protected String resource_to_string ( nitro_service service , String id , options option ) { } }
Boolean warning = service . get_warning ( ) ; String onerror = service . get_onerror ( ) ; String result = service . get_payload_formatter ( ) . resource_to_string ( this , id , option , warning , onerror ) ; return result ;
public class Excel03SaxReader { /** * - - - - - Read start */ @ Override public Excel03SaxReader read ( File file , int sheetIndex ) throws POIException { } }
try { return read ( new POIFSFileSystem ( file ) , sheetIndex ) ; } catch ( IOException e ) { throw new POIException ( e ) ; }
public class BaseFacebookClient { /** * Gets the URL - encoded version of the given { @ code value } for the parameter named { @ code name } . * Includes special - case handling for access token parameters where we check if the token is already URL - encoded - if * so , we don ' t encode again . All other parameter types are always URL - encoded . * @ param name * The name of the parameter whose value should be URL - encoded and returned . * @ param value * The value of the parameter which should be URL - encoded and returned . * @ return The URL - encoded version of the given { @ code value } . */ protected String urlEncodedValueForParameterName ( String name , String value ) { } }
// Special handling for access _ token - // ' % 7C ' is the pipe character and will be present in any access _ token // parameter that ' s already URL - encoded . If we see this combination , don ' t // URL - encode . Otherwise , URL - encode as normal . return ACCESS_TOKEN_PARAM_NAME . equals ( name ) && value . contains ( "%7C" ) ? value : urlEncode ( value ) ;
public class AuthorizationProcessManager { /** * Handle success in the authorization process . All the response listeners will be updated with * success * @ param response final success response from the server */ private void handleAuthorizationSuccess ( Response response ) { } }
Iterator < ResponseListener > iterator = authorizationQueue . iterator ( ) ; while ( iterator . hasNext ( ) ) { ResponseListener next = iterator . next ( ) ; next . onSuccess ( response ) ; iterator . remove ( ) ; }
public class FileInputFormat { /** * Registers a decompression algorithm through a { @ link org . apache . flink . api . common . io . compression . InflaterInputStreamFactory } * with a file extension for transparent decompression . * @ param fileExtension of the compressed files * @ param factory to create an { @ link java . util . zip . InflaterInputStream } that handles the decompression format */ public static void registerInflaterInputStreamFactory ( String fileExtension , InflaterInputStreamFactory < ? > factory ) { } }
synchronized ( INFLATER_INPUT_STREAM_FACTORIES ) { if ( INFLATER_INPUT_STREAM_FACTORIES . put ( fileExtension , factory ) != null ) { LOG . warn ( "Overwriting an existing decompression algorithm for \"{}\" files." , fileExtension ) ; } }
public class FormatterMojo { /** * Return the options to be passed when creating { @ link CodeFormatter } instance . * @ return the formatting options or null if not config file found * @ throws MojoExecutionException * the mojo execution exception */ private Map < String , String > getFormattingOptions ( String newConfigFile ) throws MojoExecutionException { } }
if ( this . useEclipseDefaults ) { getLog ( ) . info ( "Using Ecipse Defaults" ) ; // Use defaults only for formatting Map < String , String > options = new HashMap < > ( ) ; options . put ( JavaCore . COMPILER_SOURCE , this . compilerSource ) ; options . put ( JavaCore . COMPILER_COMPLIANCE , this . compilerCompliance ) ; options . put ( JavaCore . COMPILER_CODEGEN_TARGET_PLATFORM , this . compilerTargetPlatform ) ; return options ; } return getOptionsFromConfigFile ( newConfigFile ) ;
public class AbstractInjectorCreator { /** * inner class */ protected void writeStatics ( TreeLogger logger , GeneratorContext context , SourceWriter srcWriter ) { } }
for ( InjectorWritterStatic delegate : Iterables . filter ( this . delegates , InjectorWritterStatic . class ) ) { delegate . writeStatic ( srcWriter ) ; }
public class CmsSecurityManager { /** * Gets the groups which constitute a given role . < p > * @ param context the request context * @ param role the role * @ param directUsersOnly if true , only direct users of the role group will be returned * @ return the role ' s groups * @ throws CmsException if something goes wrong */ public Set < CmsGroup > getRoleGroups ( CmsRequestContext context , CmsRole role , boolean directUsersOnly ) throws CmsException { } }
CmsDbContext dbc = m_dbContextFactory . getDbContext ( context ) ; try { return m_driverManager . getRoleGroups ( dbc , role . getGroupName ( ) , directUsersOnly ) ; } catch ( Exception e ) { dbc . report ( null , Messages . get ( ) . container ( Messages . ERR_GET_ROLE_GROUPS_1 , role . toString ( ) ) , e ) ; return null ; // will never be executed } finally { dbc . clear ( ) ; }
public class ActiveMQQueueJmxStats { /** * Return a duplicate of this queue stats structure . * @ return new queue stats structure with the same values . */ public ActiveMQQueueJmxStats dup ( String brokerName ) { } }
ActiveMQQueueJmxStats result = new ActiveMQQueueJmxStats ( brokerName , this . queueName ) ; this . copyOut ( result ) ; return result ;
public class UserCoreDao { /** * Query for values * @ param sql * sql statement * @ param args * arguments * @ return results * @ since 3.1.0 */ public List < List < Object > > queryResults ( String sql , String [ ] args ) { } }
return db . queryResults ( sql , args ) ;
public class DefaultContentHandler { /** * recursively remove a directory , logging warnings if needed . */ private static void rmDir ( File dir ) { } }
for ( File file : dir . listFiles ( ) ) { if ( file . isDirectory ( ) ) { rmDir ( file ) ; } else { if ( ! file . delete ( ) ) { logger . warn ( "Can't delete file " + file ) ; } } } if ( ! dir . delete ( ) ) { logger . warn ( "Can't delete dir " + dir ) ; }
public class HtmlReport { /** * Convert EARL result into HTML report . * @ param outputDir * Location of the test result . * @ return * Return the output file . * @ throws FileNotFoundException * Throws exception if file is not available . */ public static File earlHtmlReport ( String outputDir ) throws FileNotFoundException { } }
ClassLoader cl = Thread . currentThread ( ) . getContextClassLoader ( ) ; String resourceDir = cl . getResource ( "com/occamlab/te/earl/lib" ) . getPath ( ) ; String earlXsl = cl . getResource ( "com/occamlab/te/earl_html_report.xsl" ) . toString ( ) ; File htmlOutput = new File ( outputDir , "result" ) ; htmlOutput . mkdir ( ) ; LOGR . fine ( "HTML output is written to directory " + htmlOutput ) ; File earlResult = new File ( outputDir , "earl-results.rdf" ) ; try { TransformerFactory tf = TransformerFactory . newInstance ( ) ; Transformer transformer = tf . newTransformer ( new StreamSource ( earlXsl ) ) ; transformer . setParameter ( "outputDir" , htmlOutput ) ; File indexHtml = new File ( htmlOutput , "index.html" ) ; indexHtml . createNewFile ( ) ; FileOutputStream outputStream = new FileOutputStream ( indexHtml ) ; transformer . transform ( new StreamSource ( earlResult ) , new StreamResult ( outputStream ) ) ; // Foritfy Mod : Close the outputStream releasing its resources outputStream . close ( ) ; FileUtils . copyDirectory ( new File ( resourceDir ) , htmlOutput ) ; } catch ( Exception e ) { LOGR . log ( Level . SEVERE , "Transformation of EARL to HTML failed." , e ) ; throw new RuntimeException ( e ) ; } if ( ! htmlOutput . exists ( ) ) { throw new FileNotFoundException ( "HTML results not found at " + htmlOutput . getAbsolutePath ( ) ) ; } return htmlOutput ;
public class DefaultSemanticHighlightingCalculator { /** * Actual implementation of the semantic highlighting calculation . It is ensured , that the given resource is not * < code > null < / code > and refers to an initialized parse result . * By default this will visit the elements in the resource recursively and call * { @ link # highlightElement ( EObject , IHighlightedPositionAcceptor , CancelIndicator ) } for each of them . As the * last step , tasks will be highlighted . * Clients can override this method if the default recursive approach does not fit their use case * @ param resource * a valid to - be - processed resource . Is never < code > null < / code > . * @ param acceptor * the acceptor . Is never < code > null < / code > . */ protected void doProvideHighlightingFor ( XtextResource resource , IHighlightedPositionAcceptor acceptor , CancelIndicator cancelIndicator ) { } }
searchAndHighlightElements ( resource , acceptor , cancelIndicator ) ; highlightTasks ( resource , acceptor ) ;
public class Tr { /** * If debug level diagnostic trace is enabled for the specified * < code > TraceComponent < / code > , log the provided trace point . * @ param tc * the non - null < code > TraceComponent < / code > the event is * associated with . * @ param msg * text to include in the event . No translation or conversion is * performed . * @ param objs * a variable number ( zero to n ) of < code > Objects < / code > . * toString ( ) is called on each object and the results are * appended to the message . */ public static final void debug ( TraceComponent tc , String msg , Object ... objs ) { } }
TrConfigurator . getDelegate ( ) . debug ( tc , msg , objs ) ;
public class AbstractQueryRunner { /** * Creates new { @ link PreparedStatement } instance * @ param conn SQL Connection * @ param sql SQL Query string * @ param getGeneratedKeys specifies if generated keys should be returned * @ return new { @ link PreparedStatement } instance * @ throws SQLException if exception would be thrown by Driver / Database */ protected PreparedStatement prepareStatement ( Connection conn , OutputHandler outputHandler , String sql , boolean getGeneratedKeys ) throws SQLException { } }
PreparedStatement result = null ; String [ ] overrideGeneratedKeysArr = null ; Integer resultSetType = null ; Integer resultSetConcurrency = null ; if ( outputHandler instanceof LazyScrollOutputHandler ) { if ( overrider . hasOverride ( MjdbcConstants . OVERRIDE_LAZY_SCROLL_CHANGE_SENSITIVE ) == true ) { // read value overrider . getOverride ( MjdbcConstants . OVERRIDE_LAZY_SCROLL_CHANGE_SENSITIVE ) ; resultSetType = ResultSet . TYPE_SCROLL_SENSITIVE ; } else { resultSetType = ResultSet . TYPE_SCROLL_INSENSITIVE ; } } if ( outputHandler instanceof LazyUpdateOutputHandler ) { resultSetConcurrency = ResultSet . CONCUR_UPDATABLE ; } if ( getGeneratedKeys == true || this . overrider . hasOverride ( MjdbcConstants . OVERRIDE_INT_GET_GENERATED_KEYS ) == true ) { // if generated values should be returned - it cannot be updateable / scrollable if ( outputHandler instanceof LazyUpdateOutputHandler || outputHandler instanceof LazyScrollOutputHandler ) { throw new MjdbcSQLException ( "You are requesting generated values be handled by lazy scrollable and/or updateable handler. " + "Generated values does not support that action. Please use cached output handler or non updateable/scrollable lazy handler." ) ; } if ( this . overrider . hasOverride ( MjdbcConstants . OVERRIDE_GENERATED_COLUMN_NAMES ) == true ) { overrideGeneratedKeysArr = ( String [ ] ) this . overrider . getOverride ( MjdbcConstants . OVERRIDE_GENERATED_COLUMN_NAMES ) ; result = conn . prepareStatement ( sql , overrideGeneratedKeysArr ) ; } else { result = conn . prepareStatement ( sql , Statement . RETURN_GENERATED_KEYS ) ; } if ( this . overrider . hasOverride ( MjdbcConstants . OVERRIDE_INT_GET_GENERATED_KEYS ) == false ) { this . overrider . overrideOnce ( MjdbcConstants . OVERRIDE_INT_GET_GENERATED_KEYS , true ) ; } } else { if ( resultSetType == null && resultSetConcurrency == null ) { result = conn . prepareStatement ( sql ) ; } else { resultSetType = ( resultSetType == null ? ResultSet . TYPE_FORWARD_ONLY : resultSetType ) ; resultSetConcurrency = ( resultSetConcurrency == null ? ResultSet . CONCUR_READ_ONLY : resultSetConcurrency ) ; result = conn . prepareStatement ( sql , resultSetType , resultSetConcurrency ) ; } } return result ;
public class SmartBlurFilter { /** * Convolve with a kernel consisting of one row */ private void thresholdBlur ( Kernel kernel , int [ ] inPixels , int [ ] outPixels , int width , int height , boolean alpha ) { } }
int index = 0 ; float [ ] matrix = kernel . getKernelData ( null ) ; int cols = kernel . getWidth ( ) ; int cols2 = cols / 2 ; for ( int y = 0 ; y < height ; y ++ ) { int ioffset = y * width ; int outIndex = y ; for ( int x = 0 ; x < width ; x ++ ) { float r = 0 , g = 0 , b = 0 , a = 0 ; int moffset = cols2 ; int rgb1 = inPixels [ ioffset + x ] ; int a1 = ( rgb1 >> 24 ) & 0xff ; int r1 = ( rgb1 >> 16 ) & 0xff ; int g1 = ( rgb1 >> 8 ) & 0xff ; int b1 = rgb1 & 0xff ; float af = 0 , rf = 0 , gf = 0 , bf = 0 ; for ( int col = - cols2 ; col <= cols2 ; col ++ ) { float f = matrix [ moffset + col ] ; if ( f != 0 ) { int ix = x + col ; if ( ! ( 0 <= ix && ix < width ) ) ix = x ; int rgb2 = inPixels [ ioffset + ix ] ; int a2 = ( rgb2 >> 24 ) & 0xff ; int r2 = ( rgb2 >> 16 ) & 0xff ; int g2 = ( rgb2 >> 8 ) & 0xff ; int b2 = rgb2 & 0xff ; int d ; d = a1 - a2 ; if ( d >= - threshold && d <= threshold ) { a += f * a2 ; af += f ; } d = r1 - r2 ; if ( d >= - threshold && d <= threshold ) { r += f * r2 ; rf += f ; } d = g1 - g2 ; if ( d >= - threshold && d <= threshold ) { g += f * g2 ; gf += f ; } d = b1 - b2 ; if ( d >= - threshold && d <= threshold ) { b += f * b2 ; bf += f ; } } } a = af == 0 ? a1 : a / af ; r = rf == 0 ? r1 : r / rf ; g = gf == 0 ? g1 : g / gf ; b = bf == 0 ? b1 : b / bf ; int ia = alpha ? PixelUtils . clamp ( ( int ) ( a + 0.5 ) ) : 0xff ; int ir = PixelUtils . clamp ( ( int ) ( r + 0.5 ) ) ; int ig = PixelUtils . clamp ( ( int ) ( g + 0.5 ) ) ; int ib = PixelUtils . clamp ( ( int ) ( b + 0.5 ) ) ; outPixels [ outIndex ] = ( ia << 24 ) | ( ir << 16 ) | ( ig << 8 ) | ib ; outIndex += height ; } }
public class GrapesClient { /** * Return the list of module ancestors * @ param moduleName * @ param moduleVersion * @ return List < Dependency > * @ throws GrapesCommunicationException */ public List < Dependency > getModuleAncestors ( final String moduleName , final String moduleVersion ) throws GrapesCommunicationException { } }
final Client client = getClient ( ) ; final WebResource resource = client . resource ( serverURL ) . path ( RequestUtils . getArtifactAncestors ( moduleName , moduleVersion ) ) ; final ClientResponse response = resource . queryParam ( ServerAPI . SCOPE_COMPILE_PARAM , "true" ) . queryParam ( ServerAPI . SCOPE_PROVIDED_PARAM , "true" ) . queryParam ( ServerAPI . SCOPE_RUNTIME_PARAM , "true" ) . queryParam ( ServerAPI . SCOPE_TEST_PARAM , "true" ) . accept ( MediaType . APPLICATION_JSON ) . get ( ClientResponse . class ) ; client . destroy ( ) ; if ( ClientResponse . Status . OK . getStatusCode ( ) != response . getStatus ( ) ) { final String message = String . format ( FAILED_TO_GET_MODULE , "get module ancestors" , moduleName , moduleVersion ) ; if ( LOG . isErrorEnabled ( ) ) { LOG . error ( String . format ( HTTP_STATUS_TEMPLATE_MSG , message , response . getStatus ( ) ) ) ; } throw new GrapesCommunicationException ( message , response . getStatus ( ) ) ; } return response . getEntity ( new GenericType < List < Dependency > > ( ) { } ) ;
public class UnsortedGrouping { /** * Applies an Aggregate transformation on a grouped { @ link Tuple } { @ link DataSet } . < br / > * < b > Note : Only Tuple DataSets can be aggregated . < / b > * The transformation applies a built - in { @ link Aggregations Aggregation } on a specified field * of a Tuple group . Additional aggregation functions can be added to the resulting * { @ link AggregateOperator } by calling { @ link AggregateOperator # and ( Aggregations , int ) } . * @ param agg The built - in aggregation function that is computed . * @ param field The index of the Tuple field on which the aggregation function is applied . * @ return An AggregateOperator that represents the aggregated DataSet . * @ see Tuple * @ see Aggregations * @ see AggregateOperator * @ see DataSet */ public AggregateOperator < T > aggregate ( Aggregations agg , int field ) { } }
return new AggregateOperator < T > ( this , agg , field ) ;
public class JFapByteBuffer { /** * Puts a byte [ ] into the byte buffer . * @ param item */ public synchronized void put ( byte [ ] item ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "put" , item ) ; checkValid ( ) ; getCurrentByteBuffer ( item . length ) . put ( item ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "put" ) ;
public class AssetCache { /** * Get the asset based on version spec whose name and custom attributes match the parameters . */ public static Asset getAsset ( AssetVersionSpec spec , Map < String , String > attributeValues ) { } }
Asset match = null ; try { for ( Asset asset : getAllAssets ( ) ) { if ( spec . getName ( ) . equals ( asset . getName ( ) ) ) { if ( asset . meetsVersionSpec ( spec . getVersion ( ) ) && ( match == null || asset . getVersion ( ) > match . getVersion ( ) ) ) { boolean attrsMatch = true ; for ( String attrName : attributeValues . keySet ( ) ) { String attrValue = attributeValues . get ( attrName ) ; String rsValue = asset . getAttribute ( attrName ) ; if ( rsValue == null || ! rsValue . equals ( attrValue ) ) { attrsMatch = false ; break ; } } if ( attrsMatch && ( match == null || match . getVersion ( ) < asset . getVersion ( ) ) ) { if ( ! asset . isLoaded ( ) ) { Asset loaded = getAsset ( asset . getId ( ) ) ; asset . setStringContent ( loaded . getStringContent ( ) ) ; } match = asset ; } } } } // TODO If match = = null , check ASSET _ REF DB table to retrieve from git history - For when Asset attributes are implemented } catch ( DataAccessException ex ) { logger . severeException ( "Failed to load asset: " + spec . toString ( ) + " : " + ex . getMessage ( ) , ex ) ; } return match ;
public class HttpRequest { /** * Reconstructs the URL the client used to make the request . The returned URL contains a * protocol , server name , port number , and , but it does not include a path . * Because this method returns a < code > StringBuffer < / code > , not a string , you can modify the * URL easily , for example , to append path and query parameters . * This method is useful for creating redirect messages and for reporting errors . * @ return " scheme : / / host : port " */ public StringBuffer getRootURL ( ) { } }
StringBuffer url = new StringBuffer ( 48 ) ; synchronized ( url ) { String scheme = getScheme ( ) ; int port = getPort ( ) ; url . append ( scheme ) ; url . append ( "://" ) ; if ( _hostPort != null ) url . append ( _hostPort ) ; else { url . append ( getHost ( ) ) ; if ( port > 0 && ( ( scheme . equalsIgnoreCase ( "http" ) && port != 80 ) || ( scheme . equalsIgnoreCase ( "https" ) && port != 443 ) ) ) { url . append ( ':' ) ; url . append ( port ) ; } } return url ; }
public class StringUtil { /** * Unescapes the specified escaped CSV fields according to * < a href = " https : / / tools . ietf . org / html / rfc4180 # section - 2 " > RFC - 4180 < / a > . * @ param value A string with multiple CSV escaped fields which will be unescaped according to * < a href = " https : / / tools . ietf . org / html / rfc4180 # section - 2 " > RFC - 4180 < / a > * @ return { @ link List } the list of unescaped fields */ public static List < CharSequence > unescapeCsvFields ( CharSequence value ) { } }
List < CharSequence > unescaped = new ArrayList < CharSequence > ( 2 ) ; StringBuilder current = InternalThreadLocalMap . get ( ) . stringBuilder ( ) ; boolean quoted = false ; int last = value . length ( ) - 1 ; for ( int i = 0 ; i <= last ; i ++ ) { char c = value . charAt ( i ) ; if ( quoted ) { switch ( c ) { case DOUBLE_QUOTE : if ( i == last ) { // Add the last field and return unescaped . add ( current . toString ( ) ) ; return unescaped ; } char next = value . charAt ( ++ i ) ; if ( next == DOUBLE_QUOTE ) { // 2 double - quotes should be unescaped to one current . append ( DOUBLE_QUOTE ) ; break ; } if ( next == COMMA ) { // This is the end of a field . Let ' s start to parse the next field . quoted = false ; unescaped . add ( current . toString ( ) ) ; current . setLength ( 0 ) ; break ; } // double - quote followed by other character is invalid throw newInvalidEscapedCsvFieldException ( value , i - 1 ) ; default : current . append ( c ) ; } } else { switch ( c ) { case COMMA : // Start to parse the next field unescaped . add ( current . toString ( ) ) ; current . setLength ( 0 ) ; break ; case DOUBLE_QUOTE : if ( current . length ( ) == 0 ) { quoted = true ; break ; } // double - quote appears without being enclosed with double - quotes // fall through case LINE_FEED : // fall through case CARRIAGE_RETURN : // special characters appears without being enclosed with double - quotes throw newInvalidEscapedCsvFieldException ( value , i ) ; default : current . append ( c ) ; } } } if ( quoted ) { throw newInvalidEscapedCsvFieldException ( value , last ) ; } unescaped . add ( current . toString ( ) ) ; return unescaped ;
public class SVGParser { /** * Parse an opacity value ( a float clamped to the range 0 . . 1 ) . */ private static Float parseOpacity ( String val ) { } }
try { float o = parseFloat ( val ) ; return ( o < 0f ) ? 0f : ( o > 1f ) ? 1f : o ; } catch ( SVGParseException e ) { return null ; }
public class ParsedScheduleExpression { /** * Determines the first timeout of the schedule expression . * @ return the first timeout in milliseconds , or - 1 if there are no timeouts * for the expression */ public long getFirstTimeout ( ) { } }
long lastTimeout = Math . max ( System . currentTimeMillis ( ) , start ) ; // d666295 // If we ' re already past the end date , then there is no timeout . if ( lastTimeout > end ) { return - 1 ; } return getTimeout ( lastTimeout , false ) ;
public class Killed { /** * Instantiate discrete constraints for a collection of VMs . * @ param vms the VMs to integrate * @ return the associated list of constraints */ public static List < Killed > newKilled ( Collection < VM > vms ) { } }
return vms . stream ( ) . map ( Killed :: new ) . collect ( Collectors . toList ( ) ) ;
public class ProviGenProvider { /** * Called when the database needs to be upgraded . < / br > < / br > * Call { @ code super . onUpgradeDatabase ( database , oldVersion , newVersion ) } to : * < ul > * < li > Automatically add columns if some are missing . < / li > * < li > Automatically create tables and needed columns for new added { @ link Contract } s . < / li > * < / ul > * Anything else related to database upgrade should be done here . * This method executes within a transaction . If an exception is thrown , all changes * will automatically be rolled back . * @ param database The database . * @ param oldVersion The old database version ( same as contract old version ) . * @ param newVersion The new database version ( same as contract new version ) . */ public void onUpgradeDatabase ( SQLiteDatabase database , int oldVersion , int newVersion ) { } }
for ( ContractHolder contract : contracts ) { if ( ! openHelper . hasTableInDatabase ( database , contract ) ) { openHelper . createTable ( database , contract ) ; } else { openHelper . addMissingColumnsInTable ( database , contract ) ; } }
public class ModelSerializer { /** * Load a computation graph from a InputStream * @ param is the inputstream to get the computation graph from * @ return the loaded computation graph * @ throws IOException */ public static ComputationGraph restoreComputationGraph ( @ NonNull InputStream is , boolean loadUpdater ) throws IOException { } }
checkInputStream ( is ) ; File tmpFile = null ; try { tmpFile = tempFileFromStream ( is ) ; return restoreComputationGraph ( tmpFile , loadUpdater ) ; } finally { if ( tmpFile != null ) { tmpFile . delete ( ) ; } }
public class ActivationMarshaller { /** * Marshall the given parameter object . */ public void marshall ( Activation activation , ProtocolMarshaller protocolMarshaller ) { } }
if ( activation == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( activation . getActivationId ( ) , ACTIVATIONID_BINDING ) ; protocolMarshaller . marshall ( activation . getDescription ( ) , DESCRIPTION_BINDING ) ; protocolMarshaller . marshall ( activation . getDefaultInstanceName ( ) , DEFAULTINSTANCENAME_BINDING ) ; protocolMarshaller . marshall ( activation . getIamRole ( ) , IAMROLE_BINDING ) ; protocolMarshaller . marshall ( activation . getRegistrationLimit ( ) , REGISTRATIONLIMIT_BINDING ) ; protocolMarshaller . marshall ( activation . getRegistrationsCount ( ) , REGISTRATIONSCOUNT_BINDING ) ; protocolMarshaller . marshall ( activation . getExpirationDate ( ) , EXPIRATIONDATE_BINDING ) ; protocolMarshaller . marshall ( activation . getExpired ( ) , EXPIRED_BINDING ) ; protocolMarshaller . marshall ( activation . getCreatedDate ( ) , CREATEDDATE_BINDING ) ; protocolMarshaller . marshall ( activation . getTags ( ) , TAGS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class TimingMarshaller { /** * Marshall the given parameter object . */ public void marshall ( Timing timing , ProtocolMarshaller protocolMarshaller ) { } }
if ( timing == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( timing . getSubmitTimeMillis ( ) , SUBMITTIMEMILLIS_BINDING ) ; protocolMarshaller . marshall ( timing . getStartTimeMillis ( ) , STARTTIMEMILLIS_BINDING ) ; protocolMarshaller . marshall ( timing . getFinishTimeMillis ( ) , FINISHTIMEMILLIS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class LDataObjectQueue { /** * Clears the frame and timestamp queue . * The queue will be empty on return . */ public final synchronized void clear ( ) { } }
timestamps = new long [ max ? timestamps . length : STD_BUFSIZE ] ; value = new CEMILData [ timestamps . length ] ; next = 0 ; size = 0 ;
public class ContextRadialMenu { /** * Shows the < code > ContextRadialMenu < / code > at specified coordinates . * @ param target Target node . This will be sent as parameter to all triggered actions . * @ param x X - coord * @ param y Y - coord */ public void showAt ( Node target , double x , double y ) { } }
requireNonNull ( target , "Parameter 'target' is null" ) ; internalShow ( pointer , target , x , y ) ; pointer . setVisible ( true ) ;
public class DefaultGenerator { /** * ( non - Javadoc ) * @ see org . kie . decisiontable . parser . Generator # generate ( java . lang . String , * org . kie . decisiontable . parser . Row ) */ public void generate ( String templateName , Row row ) { } }
try { CompiledTemplate template = getTemplate ( templateName ) ; VariableResolverFactory factory = new MapVariableResolverFactory ( ) ; Map < String , Object > vars = new HashMap < String , Object > ( ) ; initializePriorCommaConstraints ( vars ) ; initializeHasPriorJunctionConstraint ( vars ) ; vars . put ( "row" , row ) ; for ( Cell cell : row . getCells ( ) ) { cell . addValue ( vars ) ; } String drl = String . valueOf ( TemplateRuntime . execute ( template , vars , factory , registry ) ) ; rules . add ( drl ) ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; }
public class PersistableImpl { /** * This method is used by the task layer to get hold of data from the * cache layer before it is hardened to disk . It should therefore return * the data from the Item and not that from the ManagedObject . * @ return * @ throws SevereMessageStoreException */ @ Override public java . util . List < DataSlice > getData ( ) throws PersistentDataEncodingException , SevereMessageStoreException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getData" ) ; java . util . List < DataSlice > retval = null ; synchronized ( this ) { if ( _link != null ) { retval = _link . getMemberData ( ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "getData" , "return=" + retval ) ; return retval ;
public class PageServiceImpl { /** * Non - peek get . */ @ Override public void getSafe ( RowCursor cursor , Result < Boolean > result ) { } }
result . ok ( getImpl ( cursor ) ) ;
public class TernaryTreeNode { /** * Returns true if the specified node is effectively a child of this node , false otherwise . * @ param potentialChild - the node to test * @ return a boolean , true if the specified node is effectively a child of this node , false otherwise */ @ Pure public boolean hasChild ( N potentialChild ) { } }
if ( ( this . left == potentialChild ) || ( this . middle == potentialChild ) || ( this . right == potentialChild ) ) { return true ; } return false ;
public class CmsMacroResolver { /** * Copies resources , adjust internal links ( if adjustLinks = = true ) and resolves macros ( if keyValue map is set ) . < p > * @ param cms CmsObject * @ param source path * @ param destination path * @ param keyValue map to be used for macro resolver * @ param adjustLinks boolean , true means internal links get adjusted . * @ throws CmsException exception */ public static void copyAndResolveMacro ( CmsObject cms , String source , String destination , Map < String , String > keyValue , boolean adjustLinks ) throws CmsException { } }
copyAndResolveMacro ( cms , source , destination , keyValue , adjustLinks , CmsResource . COPY_AS_NEW ) ;
public class InviteController { /** * Displays the participant invitation dialog . * @ param sessionId The id of the chat session making the invitation request . * @ param exclusions List of participants that should be excluded from user selection . * @ param callback Reports the list of participants that were sent invitations , or null if the * dialog was cancelled . */ @ SuppressWarnings ( "unchecked" ) public static void show ( String sessionId , Collection < IPublisherInfo > exclusions , IResponseCallback < Collection < IPublisherInfo > > callback ) { } }
Map < String , Object > args = new HashMap < > ( ) ; args . put ( "sessionId" , sessionId ) ; args . put ( "exclusions" , exclusions ) ; PopupDialog . show ( DIALOG , args , true , true , true , ( event ) -> { Collection < IPublisherInfo > invitees = ( Collection < IPublisherInfo > ) event . getTarget ( ) . getAttribute ( "invitees" ) ; IResponseCallback . invoke ( callback , invitees ) ;
public class ObjectManager { /** * Waits for one checkpoint to complete . * @ throws ObjectManagerException */ public final void waitForCheckpoint ( ) throws ObjectManagerException { } }
if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , "waitForCheckpoint" ) ; if ( ! testInterfaces ) { if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , "waitForCheckpoint via InterfaceDisabledException" ) ; throw new InterfaceDisabledException ( this , "waitForCheckpoint" ) ; } // if ( ! testInterfaces ) . objectManagerState . waitForCheckpoint ( true ) ; if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , "waitForCheckpoint" ) ;
public class BuildMetrics { /** * Get a description of this profiled build . It contains info about tasks passed to gradle as targets from the command line . */ public String getBuildDescription ( ) { } }
StringBuilder sb = new StringBuilder ( ) ; for ( String name : startParameter . getExcludedTaskNames ( ) ) { sb . append ( "-x " ) ; sb . append ( name ) ; sb . append ( " " ) ; } for ( String name : startParameter . getTaskNames ( ) ) { sb . append ( name ) ; sb . append ( " " ) ; } String tasks = sb . toString ( ) ; if ( tasks . length ( ) == 0 ) { tasks = "(no tasks specified)" ; } return "Profiled build: " + tasks ;
public class ListDataController { /** * Returns the index of the first occurrence of the specified value in this * controller , or - 1 if this controller does not contain the value . * @ param value * @ return found index , or - 1 if value was not found * @ throws NullPointerException * if parameter value is null * @ throws IllegalStateException * if there is no data available */ int getIndexOf ( final V value ) { } }
Validate . notNull ( value , "Value required" ) ; Validate . validState ( getSize ( ) > 0 , "No data" ) ; return getData ( ) . indexOf ( value ) ;
public class ExpressionDecomposer { /** * Perform any rewriting necessary so that the specified expression is { @ code MOVABLE } . * < p > This method is a primary entrypoint into this class . It performs a partial expression * decomposition such that { @ code expression } can be moved to a preceding statement without * changing behaviour . * < p > Exposing { @ code expression } generally doesn ' t mean that { @ code expression } itself will * moved . An expression is exposed within a larger statement if no preceding expression would * interact with it . * @ see { @ link # canExposeExpression } */ void exposeExpression ( Node expression ) { } }
Node expressionRoot = findExpressionRoot ( expression ) ; checkNotNull ( expressionRoot ) ; checkState ( NodeUtil . isStatement ( expressionRoot ) , expressionRoot ) ; exposeExpression ( expressionRoot , expression ) ;
public class Player { /** * 待ちの種類による可符 * @ param comp * @ param last * @ return */ private int calcFuByWait ( MentsuComp comp , Tile last ) { } }
if ( comp . isKanchan ( last ) || comp . isPenchan ( last ) || comp . isTanki ( last ) ) { return 2 ; } return 0 ;
public class AbstractExecutableMemberWriter { /** * Add the parameter for the executable member . * @ param member the member to write parameter for . * @ param param the parameter that needs to be written . * @ param isVarArg true if this is a link to var arg . * @ param tree the content tree to which the parameter information will be added . */ protected void addParam ( ExecutableElement member , VariableElement param , boolean isVarArg , Content tree ) { } }
Content link = writer . getLink ( new LinkInfoImpl ( configuration , EXECUTABLE_MEMBER_PARAM , param . asType ( ) ) . varargs ( isVarArg ) ) ; tree . addContent ( link ) ; if ( name ( param ) . length ( ) > 0 ) { tree . addContent ( Contents . SPACE ) ; tree . addContent ( name ( param ) ) ; }
public class TypeParserBuilder { /** * Register a custom made { @ link Parser } implementation , associated with * the given { @ code targetType } . * @ param targetType associated with given { @ code parser } . * @ param parser custom made { @ link Parser } implementation . * @ return { @ link TypeParserBuilder } * @ throws NullPointerException if any given argument is null . */ public < T > TypeParserBuilder registerParser ( Class < T > targetType , Parser < T > parser ) { } }
if ( parser == null ) { throw new NullPointerException ( makeNullArgumentErrorMsg ( "parser" ) ) ; } if ( targetType == null ) { throw new NullPointerException ( makeNullArgumentErrorMsg ( "targetType" ) ) ; } if ( targetType . isArray ( ) ) { String message = "Cannot register Parser for array class. Register a Parser for " + "the component type '%s' instead, as arrays are handled automatically " + "internally in type-parser." ; Class < ? > componentType = targetType . getComponentType ( ) ; throw new IllegalArgumentException ( String . format ( message , componentType . getName ( ) ) ) ; } parsers . put ( targetType , decorateParser ( targetType , parser ) ) ; return this ;
public class RestUriVariablesFactory { /** * Returns the uri variables needed for a " fastFind " request * @ param query * @ param params * @ return all uriVariables needed for the api call */ public Map < String , String > getUriVariablesForFastFind ( String query , FastFindParams params ) { } }
Map < String , String > uriVariables = params . getParameterMap ( ) ; uriVariables . put ( BH_REST_TOKEN , bullhornApiRest . getBhRestToken ( ) ) ; uriVariables . put ( QUERY , query ) ; return uriVariables ;
public class AbstractConnection { /** * Send a pre - encoded message to a named process on a remote node . * @ param dest * the name of the remote process . * @ param payload * the encoded message to send . * @ exception java . io . IOException * if the connection is not active or a communication error * occurs . */ protected void sendBuf ( final OtpErlangPid from , final String dest , final OtpOutputStream payload ) throws IOException { } }
if ( ! connected ) { throw new IOException ( "Not connected" ) ; } @ SuppressWarnings ( "resource" ) final OtpOutputStream header = new OtpOutputStream ( headerLen ) ; // preamble : 4 byte length + " passthrough " tag + version header . write4BE ( 0 ) ; // reserve space for length header . write1 ( passThrough ) ; header . write1 ( version ) ; // header info header . write_tuple_head ( 4 ) ; header . write_long ( regSendTag ) ; header . write_any ( from ) ; if ( sendCookie ) { header . write_atom ( localNode . cookie ( ) ) ; } else { header . write_atom ( "" ) ; } header . write_atom ( dest ) ; // version for payload header . write1 ( version ) ; // fix up length in preamble header . poke4BE ( 0 , header . size ( ) + payload . size ( ) - 4 ) ; do_send ( header , payload ) ;
public class Namespace { /** * Deserializes given byte array to Object using Kryo instance in pool . * @ param bytes serialized bytes * @ param < T > deserialized Object type * @ return deserialized Object */ public < T > T deserialize ( final byte [ ] bytes ) { } }
return kryoInputPool . run ( input -> { input . setInputStream ( new ByteArrayInputStream ( bytes ) ) ; return kryoPool . run ( kryo -> { @ SuppressWarnings ( "unchecked" ) T obj = ( T ) kryo . readClassAndObject ( input ) ; return obj ; } ) ; } , DEFAULT_BUFFER_SIZE ) ;
public class TrialMeter { /** * Return a new trial measure environment . * @ param name the trial meter name * @ param description the trial meter description , maybe { @ code null } * @ param params the parameters which are tested by this trial meter * @ param dataSetNames the names of the calculated data sets * @ param < T > the parameter type * @ return a new trial measure environment */ public static < T > TrialMeter < T > of ( final String name , final String description , final Params < T > params , final String ... dataSetNames ) { } }
return new TrialMeter < T > ( name , description , Env . of ( ) , params , DataSet . of ( params . size ( ) , dataSetNames ) ) ;
public class AbstractGitFlowMojo { /** * Executes git rebase or git merge - - ff - only or git merge - - no - ff or git merge . * @ param branchName * Branch name to merge . * @ param rebase * Do rebase . * @ param noff * Merge with - - no - ff . * @ param ffonly * Merge with - - ff - only . * @ param message * Merge commit message . * @ param messageProperties * Properties to replace in message . * @ throws MojoFailureException * @ throws CommandLineException */ protected void gitMerge ( final String branchName , boolean rebase , boolean noff , boolean ffonly , String message , Map < String , String > messageProperties ) throws MojoFailureException , CommandLineException { } }
String sign = "" ; if ( gpgSignCommit ) { sign = "-S" ; } String msgParam = "" ; String msg = "" ; if ( StringUtils . isNotBlank ( message ) ) { msgParam = "-m" ; msg = replaceProperties ( message , messageProperties ) ; } if ( rebase ) { getLog ( ) . info ( "Rebasing '" + branchName + "' branch." ) ; executeGitCommand ( "rebase" , sign , branchName ) ; } else if ( ffonly ) { getLog ( ) . info ( "Merging (--ff-only) '" + branchName + "' branch." ) ; executeGitCommand ( "merge" , "--ff-only" , sign , branchName ) ; } else if ( noff ) { getLog ( ) . info ( "Merging (--no-ff) '" + branchName + "' branch." ) ; executeGitCommand ( "merge" , "--no-ff" , sign , branchName , msgParam , msg ) ; } else { getLog ( ) . info ( "Merging '" + branchName + "' branch." ) ; executeGitCommand ( "merge" , sign , branchName , msgParam , msg ) ; }
public class Slf4jLogger { /** * Log an info message . Calls SLF4J { @ link Logger # info ( String , Throwable ) } . * @ param message The message to log . * @ param throwable The exception to log . */ @ Override public void info ( String message , Throwable throwable ) { } }
if ( this . logger . isInfoEnabled ( ) ) { this . logger . info ( buildMessage ( message ) , throwable ) ; }
public class AbstractCollection { /** * { @ inheritDoc } * < p > This implementation iterates over this collection , removing each * element using the < tt > Iterator . remove < / tt > operation . Most * implementations will probably choose to override this method for * efficiency . * < p > Note that this implementation will throw an * < tt > UnsupportedOperationException < / tt > if the iterator returned by this * collection ' s < tt > iterator < / tt > method does not implement the * < tt > remove < / tt > method and this collection is non - empty . * @ throws UnsupportedOperationException { @ inheritDoc } */ public void clear ( ) { } }
Iterator < E > it = iterator ( ) ; while ( it . hasNext ( ) ) { it . next ( ) ; it . remove ( ) ; }
public class WstxInputData { /** * Note : Only public due to sub - classes needing to call this on * base class instance from different package ( confusing ? ) */ public void copyBufferStateFrom ( WstxInputData src ) { } }
mInputBuffer = src . mInputBuffer ; mInputPtr = src . mInputPtr ; mInputEnd = src . mInputEnd ; mCurrInputProcessed = src . mCurrInputProcessed ; mCurrInputRow = src . mCurrInputRow ; mCurrInputRowStart = src . mCurrInputRowStart ;
public class Matrix { /** * Creates a new Matrix that stores the result of { @ code A + c } * @ param c the scalar to add to each value in < i > this < / i > * @ return { @ code A + c } */ public Matrix add ( double c ) { } }
Matrix toReturn = getThisSideMatrix ( null ) ; toReturn . mutableAdd ( c ) ; return toReturn ;
public class Curve25519 { /** * Calculating signature * @ param random random seed for signature * @ param privateKey private key for signature * @ param message message to sign * @ return signature */ public static byte [ ] calculateSignature ( byte [ ] random , byte [ ] privateKey , byte [ ] message ) { } }
byte [ ] result = new byte [ 64 ] ; if ( curve_sigs . curve25519_sign ( SHA512Provider , result , privateKey , message , message . length , random ) != 0 ) { throw new IllegalArgumentException ( "Message exceeds max length!" ) ; } return result ;
public class BaseStrategy { /** * Delegates to the resource . findMatchingResource , see { @ link RepositoryResourceImpl # findMatchingResource ( ) } * @ throws RepositoryBackendException If there was a problem with tbe backend * @ throws RepositoryBadDataException If while checking for matching assets we find one with bad version data * @ throws RepositoryResourceNoConnectionException If no connection has been specified * @ throws RepositoryResourceValidationException If the resource fails a validation check */ @ Override public List < RepositoryResourceImpl > findMatchingResources ( RepositoryResourceImpl resource ) throws RepositoryResourceValidationException , RepositoryBackendException , RepositoryBadDataException , RepositoryResourceNoConnectionException { } }
return resource . findMatchingResource ( ) ;