signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class GoogleApacheHttpTransport { /** * Returns a new instance of { @ link ApacheHttpTransport } that uses
* { @ link GoogleUtils # getCertificateTrustStore ( ) } for the trusted certificates . */
public static ApacheHttpTransport newTrustedTransport ( ) throws GeneralSecurityException , IOException { } } | // Set socket buffer sizes to 8192
SocketConfig socketConfig = SocketConfig . custom ( ) . setRcvBufSize ( 8192 ) . setSndBufSize ( 8192 ) . build ( ) ; PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager ( - 1 , TimeUnit . MILLISECONDS ) ; // Disable the stale connection check ( previously configured in the HttpConnectionParams
connectionManager . setValidateAfterInactivity ( - 1 ) ; // Use the included trust store
KeyStore trustStore = GoogleUtils . getCertificateTrustStore ( ) ; SSLContext sslContext = SslUtils . getTlsSslContext ( ) ; SslUtils . initSslContext ( sslContext , trustStore , SslUtils . getPkixTrustManagerFactory ( ) ) ; LayeredConnectionSocketFactory socketFactory = new SSLConnectionSocketFactory ( sslContext ) ; HttpClient client = HttpClientBuilder . create ( ) . useSystemProperties ( ) . setSSLSocketFactory ( socketFactory ) . setDefaultSocketConfig ( socketConfig ) . setMaxConnTotal ( 200 ) . setMaxConnPerRoute ( 20 ) . setRoutePlanner ( new SystemDefaultRoutePlanner ( ProxySelector . getDefault ( ) ) ) . setConnectionManager ( connectionManager ) . disableRedirectHandling ( ) . disableAutomaticRetries ( ) . build ( ) ; return new ApacheHttpTransport ( client ) ; |
public class SarlBehaviorUnitBuilderImpl { /** * Change the guard .
* @ param value the value of the guard . It may be < code > null < / code > . */
@ Pure public IExpressionBuilder getGuard ( ) { } } | IExpressionBuilder exprBuilder = this . expressionProvider . get ( ) ; exprBuilder . eInit ( getSarlBehaviorUnit ( ) , new Procedures . Procedure1 < XExpression > ( ) { public void apply ( XExpression expr ) { getSarlBehaviorUnit ( ) . setGuard ( expr ) ; } } , getTypeResolutionContext ( ) ) ; return exprBuilder ; |
public class Sentence { /** * As already described , but if separator is not null , then objects
* such as TaggedWord
* @ param separator The string used to separate Word and Tag
* in TaggedWord , etc */
public static < T > String listToString ( List < T > list , final boolean justValue , final String separator ) { } } | StringBuilder s = new StringBuilder ( ) ; for ( Iterator < T > wordIterator = list . iterator ( ) ; wordIterator . hasNext ( ) ; ) { T o = wordIterator . next ( ) ; s . append ( wordToString ( o , justValue , separator ) ) ; if ( wordIterator . hasNext ( ) ) { s . append ( ' ' ) ; } } return s . toString ( ) ; |
public class Triangle3d { /** * { @ inheritDoc } */
public void setProperties ( Point3d point1 , Point3d point2 , Point3d point3 ) { } } | this . p1 . setProperties ( point1 . xProperty , point1 . yProperty , point1 . zProperty ) ; this . p2 . setProperties ( point2 . xProperty , point2 . yProperty , point2 . zProperty ) ; this . p3 . setProperties ( point3 . xProperty , point3 . yProperty , point3 . zProperty ) ; clearBufferedData ( ) ; |
public class RefundService { /** * This function refunds a { @ link Transaction } that has been created previously and was refunded in parts or wasn ' t refunded at
* all . The inserted amount will be refunded to the credit card / direct debit of the original { @ link Transaction } . There will
* be some fees for the merchant for every refund .
* Note :
* < ul >
* < li > You can refund parts of a transaction until the transaction amount is fully refunded . But be careful there will be a fee
* for every refund < / li >
* < li > There is no need to define a currency for refunds , because they will be in the same currency as the original transaction < / li >
* < / ul >
* @ param transaction
* The { @ link Transaction } , which will be refunded .
* @ param amount
* Amount ( in cents ) which will be charged .
* @ param description
* Additional description for this refund .
* @ return A { @ link Refund } for the given { @ link Transaction } . */
public Refund refundTransaction ( Transaction transaction , Integer amount , String description ) { } } | ValidationUtils . validatesAmount ( amount ) ; ParameterMap < String , String > params = new ParameterMap < String , String > ( ) ; params . add ( "amount" , String . valueOf ( amount ) ) ; if ( StringUtils . isNotBlank ( description ) ) params . add ( "description" , description ) ; return RestfulUtils . create ( RefundService . PATH + "/" + transaction . getId ( ) , params , Refund . class , super . httpClient ) ; |
public class UpdateJobRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( UpdateJobRequest updateJobRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( updateJobRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( updateJobRequest . getJobName ( ) , JOBNAME_BINDING ) ; protocolMarshaller . marshall ( updateJobRequest . getJobUpdate ( ) , JOBUPDATE_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class SwaggerMethodParser { /** * Checks whether or not the Swagger method expects the response to contain a body .
* @ return true if Swagger method expects the response to contain a body , false otherwise */
public boolean expectsResponseBody ( ) { } } | boolean result = true ; if ( TypeUtil . isTypeOrSubTypeOf ( returnType , Void . class ) ) { result = false ; } else if ( TypeUtil . isTypeOrSubTypeOf ( returnType , Mono . class ) || TypeUtil . isTypeOrSubTypeOf ( returnType , Flux . class ) ) { final ParameterizedType asyncReturnType = ( ParameterizedType ) returnType ; final Type syncReturnType = asyncReturnType . getActualTypeArguments ( ) [ 0 ] ; if ( TypeUtil . isTypeOrSubTypeOf ( syncReturnType , Void . class ) ) { result = false ; } else if ( TypeUtil . isTypeOrSubTypeOf ( syncReturnType , Response . class ) ) { result = TypeUtil . restResponseTypeExpectsBody ( ( ParameterizedType ) TypeUtil . getSuperType ( syncReturnType , Response . class ) ) ; } } else if ( TypeUtil . isTypeOrSubTypeOf ( returnType , Response . class ) ) { result = TypeUtil . restResponseTypeExpectsBody ( ( ParameterizedType ) returnType ) ; } return result ; |
public class BasicSourceMapConsumer { /** * Returns the original source , line , and column information for the generated source ' s line and column positions provided . The only argument is
* an object with the following properties :
* < ul >
* < li > line : The line number in the generated source . < / li >
* < li > column : The column number in the generated source . < / li >
* < li > bias : Either ' SourceMapConsumer . GREATEST _ LOWER _ BOUND ' or ' SourceMapConsumer . LEAST _ UPPER _ BOUND ' . Specifies whether to return the closest
* element that is smaller than or greater than the one we are searching for , respectively , if the exact element cannot be found . Defaults to
* ' SourceMapConsumer . GREATEST _ LOWER _ BOUND ' . < / li >
* < / ul >
* and an object is returned with the following properties :
* < ul >
* < li > source : The original source file , or null . < / li >
* < li > line : The line number in the original source , or null . < / li >
* < li > column : The column number in the original source , or null . < / li >
* < li > name : The original identifier , or null . < / li >
* < / ul > */
@ Override public OriginalPosition originalPositionFor ( int line , int column , Bias bias ) { } } | ParsedMapping needle = new ParsedMapping ( line , column ) ; if ( bias == null ) { bias = Bias . GREATEST_LOWER_BOUND ; } int index = this . _findMapping ( needle , this . _generatedMappings ( ) , "generatedLine" , "generatedColumn" , ( mapping1 , mapping2 ) -> Util . compareByGeneratedPositionsDeflated ( mapping1 , mapping2 , true ) , bias ) ; if ( index >= 0 ) { ParsedMapping mapping = this . _generatedMappings ( ) . get ( index ) ; if ( mapping . generatedLine == needle . generatedLine ) { Integer source = mapping . source ; String source_ = null ; if ( source != null ) { source_ = this . _sources . at ( source ) ; if ( this . sourceRoot != null ) { source_ = Util . join ( this . sourceRoot , source_ ) ; } } Integer name = mapping . name ; String name_ = null ; if ( name != null ) { name_ = this . _names . at ( name ) ; } return new OriginalPosition ( mapping . originalLine , mapping . originalColumn , source_ , name_ ) ; } } return new OriginalPosition ( ) ; |
public class DefaultGroovyMethods { /** * Drops the given number of elements from the tail of this Iterable .
* < pre class = " groovyTestCase " >
* def strings = [ ' a ' , ' b ' , ' c ' ]
* assert strings . dropRight ( 0 ) = = [ ' a ' , ' b ' , ' c ' ]
* assert strings . dropRight ( 2 ) = = [ ' a ' ]
* assert strings . dropRight ( 5 ) = = [ ]
* class AbcIterable implements Iterable < String > {
* Iterator < String > iterator ( ) { " abc " . iterator ( ) }
* def abc = new AbcIterable ( )
* assert abc . dropRight ( 0 ) = = [ ' a ' , ' b ' , ' c ' ]
* assert abc . dropRight ( 1 ) = = [ ' a ' , ' b ' ]
* assert abc . dropRight ( 3 ) = = [ ]
* assert abc . dropRight ( 5 ) = = [ ]
* < / pre >
* @ param self the original Iterable
* @ param num the number of elements to drop from this Iterable
* @ return a Collection consisting of all the elements of this Iterable minus the last < code > num < / code > elements ,
* or an empty list if it has less then < code > num < / code > elements .
* @ since 2.4.0 */
public static < T > Collection < T > dropRight ( Iterable < T > self , int num ) { } } | Collection < T > selfCol = self instanceof Collection ? ( Collection < T > ) self : toList ( self ) ; if ( selfCol . size ( ) <= num ) { return createSimilarCollection ( selfCol , 0 ) ; } if ( num <= 0 ) { Collection < T > ret = createSimilarCollection ( selfCol , selfCol . size ( ) ) ; ret . addAll ( selfCol ) ; return ret ; } Collection < T > ret = createSimilarCollection ( selfCol , selfCol . size ( ) - num ) ; ret . addAll ( asList ( ( Iterable < T > ) selfCol ) . subList ( 0 , selfCol . size ( ) - num ) ) ; return ret ; |
public class CharsetDetector { /** * Return an array of all charsets that appear to be plausible
* matches with the input data . The array is ordered with the
* best quality match first .
* Raise an exception if
* < ul >
* < li > no charsets appear to match the input data . < / li >
* < li > no input text has been provided < / li >
* < / ul >
* @ return An array of CharsetMatch objects representing possibly matching charsets . */
public CharsetMatch [ ] detectAll ( ) { } } | ArrayList < CharsetMatch > matches = new ArrayList < CharsetMatch > ( ) ; MungeInput ( ) ; // Strip html markup , collect byte stats .
// Iterate over all possible charsets , remember all that
// give a match quality > 0.
for ( int i = 0 ; i < ALL_CS_RECOGNIZERS . size ( ) ; i ++ ) { CSRecognizerInfo rcinfo = ALL_CS_RECOGNIZERS . get ( i ) ; boolean active = ( fEnabledRecognizers != null ) ? fEnabledRecognizers [ i ] : rcinfo . isDefaultEnabled ; if ( active ) { CharsetMatch m = rcinfo . recognizer . match ( this ) ; if ( m != null ) { matches . add ( m ) ; } } } Collections . sort ( matches ) ; // CharsetMatch compares on confidence
Collections . reverse ( matches ) ; // Put best match first .
CharsetMatch [ ] resultArray = new CharsetMatch [ matches . size ( ) ] ; resultArray = matches . toArray ( resultArray ) ; return resultArray ; |
public class NamespaceDefinitionMessage { /** * Checks that there aren ' t namespaces that depend on namespaces that don ' t exist in the list ,
* and creates a list of all Namespace Objects in the list .
* @ throws XmlException if there are any dependencies missing . */
protected Map < Namespace , List < String > > createNamespaceMap ( List < NamespaceDefinition > namespaceDefs ) throws XmlException { } } | ArrayList < Namespace > namespaces = new ArrayList < Namespace > ( ) ; // add all root namespaces
for ( NamespaceDefinition namespaceDef : namespaceDefs ) { Namespace node = new Namespace ( namespaceDef ) ; if ( namespaces . contains ( node ) ) { throw new XmlException ( "duplicate NamespaceDefinitions found: " + node . getId ( ) ) ; } namespaces . add ( node ) ; } // go through each namespace ' s dependencies to see if any are missing
for ( Namespace namespace : namespaces ) { List < String > dependencyIds = namespace . getDirectDependencyIds ( ) ; for ( String id : dependencyIds ) { if ( find ( namespaces , id ) == null ) { throw new XmlException ( "Found missing dependency: " + id ) ; } } } HashMap < Namespace , List < String > > namespaceFullDependencyMap = new HashMap < Namespace , List < String > > ( ) ; for ( Namespace namespace : namespaces ) { ArrayList < String > fullDependencies = new ArrayList < String > ( ) ; for ( String directDependencyId : namespace . getDirectDependencyIds ( ) ) { addDependenciesRecursively ( namespace , namespaces , directDependencyId , fullDependencies ) ; } namespaceFullDependencyMap . put ( namespace , fullDependencies ) ; } return ( namespaceFullDependencyMap ) ; |
public class ResultSetUtility { /** * Convert all rows of the ResultSet to a list of beans of a dynamically generated class . It requires CGLIB .
* @ param rs the ResultSet
* @ return a list of beans
* @ throws SQLException */
public List < ? > convertAllToDynamicBeans ( ResultSet rs ) throws SQLException { } } | ResultSetMetaData rsmd = rs . getMetaData ( ) ; Map < String , ColumnMetaData > columnToPropertyMappings = createColumnToPropertyMappings ( rsmd ) ; Class < ? > beanClass = reuseOrBuildBeanClass ( rsmd , columnToPropertyMappings ) ; BeanProcessor beanProcessor = new BeanProcessor ( simpleColumnToPropertyMappings ( columnToPropertyMappings ) ) ; return beanProcessor . toBeanList ( rs , beanClass ) ; |
public class ResourceToModelAdapterUpdater { /** * Obtains all { @ link OsgiModelSource model sources } from the
* { @ link io . neba . core . resourcemodels . registration . ModelRegistrar } and adds the { @ link OsgiModelSource # getModelType ( )
* model type name } as well as the type name of all of its superclasses and
* interfaces to the set .
* @ return never null but rather an empty set .
* @ see org . apache . commons . lang3 . ClassUtils # getAllInterfaces ( Class )
* @ see org . apache . commons . lang3 . ClassUtils # getAllSuperclasses ( Class ) */
@ SuppressWarnings ( "unchecked" ) private Set < String > getAdapterTypeNames ( ) { } } | List < OsgiModelSource < ? > > modelSources = this . registry . getModelSources ( ) ; Set < String > modelNames = new HashSet < > ( ) ; for ( OsgiModelSource < ? > source : modelSources ) { Class < ? > c = source . getModelType ( ) ; modelNames . add ( c . getName ( ) ) ; modelNames . addAll ( toClassnameList ( getAllInterfaces ( c ) ) ) ; List < Class < ? > > allSuperclasses = getAllSuperclasses ( c ) ; // Remove Object . class - it is always the topmost element .
allSuperclasses . remove ( allSuperclasses . size ( ) - 1 ) ; modelNames . addAll ( toClassnameList ( allSuperclasses ) ) ; } return modelNames ; |
public class WebSecurityValidatorImpl { /** * { @ inheritDoc } */
@ Override public boolean checkDataConstraints ( String contextId , Object httpServletRequest , WebUserDataPermission webUDPermission ) { } } | HttpServletRequest req = null ; if ( httpServletRequest != null ) { try { req = ( HttpServletRequest ) httpServletRequest ; } catch ( ClassCastException cce ) { Tr . error ( tc , "JACC_WEB_SPI_PARAMETER_ERROR" , new Object [ ] { httpServletRequest . getClass ( ) . getName ( ) , "checkDataConstraints" , "HttpServletRequest" } ) ; return false ; } } // In this method , we check for the following constraints
// 1 . Data Constraints ( is SSL required ? )
Boolean result = Boolean . FALSE ; try { final WebUserDataPermission wudp = webUDPermission ; final String fci = contextId ; final HashMap < String , HttpServletRequest > handlerObjects = new HashMap < String , HttpServletRequest > ( ) ; final HttpServletRequest hsr = req ; result = AccessController . doPrivileged ( new PrivilegedExceptionAction < Boolean > ( ) { @ Override public Boolean run ( ) throws javax . security . jacc . PolicyContextException { PolicyContext . setContextID ( fci ) ; for ( String jaccHandlerKey : jaccHandlerKeyArray ) { PolicyContext . registerHandler ( jaccHandlerKey , pch , true ) ; } handlerObjects . put ( jaccHandlerKeyArray [ 1 ] , hsr ) ; PolicyContext . setHandlerData ( handlerObjects ) ; if ( tc . isDebugEnabled ( ) ) Tr . debug ( tc , "Calling JACC implies" ) ; return Boolean . valueOf ( ( Policy . getPolicy ( ) . implies ( nullPd , wudp ) ) ) ; } } ) ; } catch ( PrivilegedActionException e ) { Tr . error ( tc , "JACC_WEB_IMPLIES_FAILURE" , new Object [ ] { contextId , e . getException ( ) } ) ; result = Boolean . FALSE ; } return result . booleanValue ( ) ; |
public class FNNRG2Impl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public void eUnset ( int featureID ) { } } | switch ( featureID ) { case AfplibPackage . FNNRG2__TSID_LEN : setTSIDLen ( TSID_LEN_EDEFAULT ) ; return ; case AfplibPackage . FNNRG2__TSID : setTSID ( TSID_EDEFAULT ) ; return ; } super . eUnset ( featureID ) ; |
public class DefaultGroovyMethods { /** * Iterates over the collection of items and returns each item that matches
* the given filter - calling the < code > { @ link # isCase ( java . lang . Object , java . lang . Object ) } < / code >
* method used by switch statements . This method can be used with different
* kinds of filters like regular expressions , classes , ranges etc .
* Example :
* < pre class = " groovyTestCase " >
* def list = [ ' a ' , ' b ' , ' aa ' , ' bc ' , 3 , 4.5]
* assert list . grep ( ~ / a + / ) = = [ ' a ' , ' aa ' ]
* assert list . grep ( ~ / . . / ) = = [ ' aa ' , ' bc ' ]
* assert list . grep ( Number ) = = [ 3 , 4.5 ]
* assert list . grep { it . toString ( ) . size ( ) = = 1 } = = [ ' a ' , ' b ' , 3 ]
* < / pre >
* @ param self a List
* @ param filter the filter to perform on each element of the collection ( using the { @ link # isCase ( java . lang . Object , java . lang . Object ) } method )
* @ return a List of objects which match the filter
* @ since 2.4.0 */
public static < T > List < T > grep ( List < T > self , Object filter ) { } } | return ( List < T > ) grep ( ( Collection < T > ) self , filter ) ; |
public class UpdateCore { /** * Take a list of list of table names and collapse into a map
* which maps all table names to false . We will set the correct
* values later on . We just want to get the structure right now .
* Note that tables may be named multiple time in the lists of
* lists of tables . Everything gets mapped to false , so we don ' t
* care .
* @ param allTableSets
* @ return */
private Map < String , Boolean > collapseSets ( List < List < String > > allTableSets ) { } } | Map < String , Boolean > answer = new TreeMap < > ( ) ; for ( List < String > tables : allTableSets ) { for ( String table : tables ) { answer . put ( table , false ) ; } } return answer ; |
public class BlurImageOps { /** * Applies mean box filter to a { @ link Planar }
* @ param input Input image . Not modified .
* @ param output ( Optional ) Storage for output image , Can be null . Modified .
* @ param radius Radius of the box blur function .
* @ param storage ( Optional ) Storage for intermediate results . Same size as input image . Can be null .
* @ param < T > Input image type .
* @ return Output blurred image . */
public static < T extends ImageGray < T > > Planar < T > mean ( Planar < T > input , @ Nullable Planar < T > output , int radius , @ Nullable T storage , @ Nullable WorkArrays workVert ) { } } | if ( storage == null ) storage = GeneralizedImageOps . createSingleBand ( input . getBandType ( ) , input . width , input . height ) ; if ( output == null ) output = input . createNew ( input . width , input . height ) ; for ( int band = 0 ; band < input . getNumBands ( ) ; band ++ ) { GBlurImageOps . mean ( input . getBand ( band ) , output . getBand ( band ) , radius , storage , workVert ) ; } return output ; |
public class HomographyDirectLinearTransform { /** * More versatile process function . Lets any of the supporting data structures be passed in .
* @ param points2D List of 2D point associations . Can be null .
* @ param points3D List of 3D point or 2D line associations . Can be null .
* @ param conics List of conics . Can be null
* @ param foundH ( Output ) The estimated homography
* @ return True if successful . False if it failed . */
public boolean process ( @ Nullable List < AssociatedPair > points2D , @ Nullable List < AssociatedPair3D > points3D , @ Nullable List < AssociatedPairConic > conics , DMatrixRMaj foundH ) { } } | // no sanity check is done to see if the minimum number of points and conics has been provided because
// that is actually really complex to determine . Especially for conics
int num2D = points2D != null ? points2D . size ( ) : 0 ; int num3D = points3D != null ? points3D . size ( ) : 0 ; int numConic = conics != null ? conics . size ( ) : 0 ; int numRows = computeTotalRows ( num2D , num3D , numConic ) ; // only 2D points need to be normalzied because of the implicit z = 1
// 3D points are homogenous or lines and the vector can be normalized to 1
// same goes for the conic equation
shouldNormalize = false ; // normalize & & points2D ! = null ;
if ( shouldNormalize ) { LowLevelMultiViewOps . computeNormalization ( points2D , N1 , N2 ) ; } A . reshape ( numRows , 9 ) ; A . zero ( ) ; int rows = 0 ; if ( points2D != null ) rows = addPoints2D ( points2D , A , rows ) ; if ( points3D != null ) rows = addPoints3D ( points3D , A , rows ) ; if ( conics != null ) addConics ( conics , A , rows ) ; // compute the homograph matrix up to a scale factor
if ( computeH ( A , foundH ) ) return false ; if ( shouldNormalize ) undoNormalizationH ( foundH , N1 , N2 ) ; // pick a good scale and sign for H
if ( points2D != null ) adjust . adjust ( foundH , points2D . get ( 0 ) ) ; return true ; |
public class Files { /** * Reads the contents of a file into a String .
* The file is always closed . */
public static String readFileToString ( File file , Charset charset ) throws IOException { } } | InputStream in = null ; try { in = new FileInputStream ( file ) ; StringBuilderWriter sw = new StringBuilderWriter ( ) ; if ( null == charset ) IOs . copy ( new InputStreamReader ( in ) , sw ) ; else IOs . copy ( new InputStreamReader ( in , charset . name ( ) ) , sw ) ; return sw . toString ( ) ; } finally { IOs . close ( in ) ; } |
public class MPSImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public void eUnset ( int featureID ) { } } | switch ( featureID ) { case AfplibPackage . MPS__RG_LENGTH : setRGLength ( RG_LENGTH_EDEFAULT ) ; return ; case AfplibPackage . MPS__RESERVED : setReserved ( RESERVED_EDEFAULT ) ; return ; case AfplibPackage . MPS__FIXED_LENGTH_RG : getFixedLengthRG ( ) . clear ( ) ; return ; } super . eUnset ( featureID ) ; |
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public EClass getIfcAirTerminalBoxType ( ) { } } | if ( ifcAirTerminalBoxTypeEClass == null ) { ifcAirTerminalBoxTypeEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 7 ) ; } return ifcAirTerminalBoxTypeEClass ; |
public class Snackbar { /** * Displays the { @ link Snackbar } at the bottom of the
* { @ link android . view . ViewGroup } provided .
* @ param parent
* @ param usePhoneLayout */
public void show ( ViewGroup parent , boolean usePhoneLayout ) { } } | MarginLayoutParams params = init ( parent . getContext ( ) , null , parent , usePhoneLayout ) ; updateLayoutParamsMargins ( null , params ) ; showInternal ( null , params , parent ) ; |
public class OptionalInt { /** * Invokes mapping function on inner value if present .
* @ param < U > the type of result value
* @ param mapper mapping function
* @ return an { @ code Optional } with transformed value if present ,
* otherwise an empty { @ code Optional }
* @ throws NullPointerException if value is present and
* { @ code mapper } is { @ code null }
* @ since 1.1.3 */
@ NotNull public < U > Optional < U > mapToObj ( @ NotNull IntFunction < U > mapper ) { } } | if ( ! isPresent ( ) ) return Optional . empty ( ) ; return Optional . ofNullable ( mapper . apply ( value ) ) ; |
public class ReportBreakScreen { /** * Print this field ' s data in XML format .
* @ return true if default params were found for this form .
* @ param out The http output stream .
* @ exception DBException File exception . */
public boolean printData ( PrintWriter out , int iPrintOptions ) { } } | this . setLastBreak ( this . isBreak ( ) ) ; if ( ! this . isLastBreak ( ) ) return false ; if ( ( iPrintOptions & HtmlConstants . FOOTING_SCREEN ) != HtmlConstants . FOOTING_SCREEN ) this . setLastBreak ( false ) ; // For footers only
boolean bInputFound = super . printData ( out , iPrintOptions ) ; return bInputFound ; |
public class ConsoleAnnotatorFactory { /** * For which context type does this annotator work ? */
public Class < ? > type ( ) { } } | Type type = Types . getBaseClass ( getClass ( ) , ConsoleAnnotatorFactory . class ) ; if ( type instanceof ParameterizedType ) return Types . erasure ( Types . getTypeArgument ( type , 0 ) ) ; else return Object . class ; |
public class LetContentNode { /** * Creates a LetContentNode for a compiler - generated variable . Use this in passes that rewrite the
* tree and introduce local temporary variables . */
public static LetContentNode forVariable ( int id , SourceLocation sourceLocation , String varName , SourceLocation varNameLocation , @ Nullable SanitizedContentKind contentKind ) { } } | LetContentNode node = new LetContentNode ( id , sourceLocation , varName , varNameLocation , contentKind ) ; SoyType type = ( contentKind != null ) ? SanitizedType . getTypeForContentKind ( contentKind ) : StringType . getInstance ( ) ; node . getVar ( ) . setType ( type ) ; return node ; |
public class BinaryLog { /** * note that the string is already trim ( ) ' d by command - line parsing unless user explicitly escaped a space */
private static boolean looksLikeHelp ( String taskname ) { } } | if ( taskname == null ) return false ; // applied paranoia , since this isn ' t in a performance path
int start = 0 , len = taskname . length ( ) ; while ( start < len && ! Character . isLetter ( taskname . charAt ( start ) ) ) ++ start ; return ACTION_HELP . equalsIgnoreCase ( taskname . substring ( start ) . toLowerCase ( ) ) ; |
public class SharedSymbolTable { /** * Constructs a new shared symbol table from the parameters .
* As per { @ link IonSystem # newSharedSymbolTable ( String , int , Iterator , SymbolTable . . . ) } ,
* any duplicate or null symbol texts are skipped .
* Therefore , < b > THIS METHOD IS NOT SUITABLE WHEN READING SERIALIZED
* SHARED SYMBOL TABLES < / b > since that scenario must preserve all sids .
* @ param name the name of the new shared symbol table
* @ param version the version of the new shared symbol table
* @ param priorSymtab may be null
* @ param symbols never null */
static SymbolTable newSharedSymbolTable ( String name , int version , SymbolTable priorSymtab , Iterator < String > symbols ) { } } | if ( name == null || name . length ( ) < 1 ) { throw new IllegalArgumentException ( "name must be non-empty" ) ; } if ( version < 1 ) { throw new IllegalArgumentException ( "version must be at least 1" ) ; } List < String > symbolsList = new ArrayList < String > ( ) ; Map < String , Integer > symbolsMap = new HashMap < String , Integer > ( ) ; assert version == ( priorSymtab == null ? 1 : priorSymtab . getVersion ( ) + 1 ) ; prepSymbolsListAndMap ( priorSymtab , symbols , symbolsList , symbolsMap ) ; // We have all necessary data , pass it over to the private constructor .
return new SharedSymbolTable ( name , version , symbolsList , symbolsMap ) ; |
public class BaseXmlParser { /** * Adds all attributes of the specified elements as properties in the current builder .
* @ param element Element whose attributes are to be added .
* @ param builder Target builder . */
protected void addProperties ( Element element , BeanDefinitionBuilder builder ) { } } | NamedNodeMap attributes = element . getAttributes ( ) ; for ( int i = 0 ; i < attributes . getLength ( ) ; i ++ ) { Node node = attributes . item ( i ) ; String attrName = getNodeName ( node ) ; attrName = "class" . equals ( attrName ) ? "clazz" : attrName ; builder . addPropertyValue ( attrName , node . getNodeValue ( ) ) ; } |
public class FieldUtils { /** * Writes a { @ code public } { @ link Field } . Only the specified class will be considered .
* @ param target
* the object to reflect , must not be { @ code null }
* @ param fieldName
* the field name to obtain
* @ param value
* to set
* @ throws IllegalArgumentException
* if { @ code target } is { @ code null } , { @ code fieldName } is blank or empty or could not be found , or
* { @ code value } is not assignable
* @ throws IllegalAccessException
* if the field is not made accessible */
public static void writeDeclaredField ( final Object target , final String fieldName , final Object value ) throws IllegalAccessException { } } | writeDeclaredField ( target , fieldName , value , false ) ; |
public class InternalSARLParser { /** * InternalSARL . g : 9915:1 : ruleInnerVarID returns [ AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken ( ) ] : ( this _ ID _ 0 = RULE _ ID | kw = ' abstract ' | kw = ' annotation ' | kw = ' class ' | kw = ' create ' | kw = ' def ' | kw = ' dispatch ' | kw = ' enum ' | kw = ' extends ' | kw = ' final ' | kw = ' implements ' | kw = ' import ' | kw = ' interface ' | kw = ' override ' | kw = ' package ' | kw = ' public ' | kw = ' private ' | kw = ' protected ' | kw = ' static ' | kw = ' throws ' | kw = ' strictfp ' | kw = ' native ' | kw = ' volatile ' | kw = ' synchronized ' | kw = ' transient ' | kw = ' AFTER ' | kw = ' BEFORE ' | kw = ' SEPARATOR ' ) ; */
public final AntlrDatatypeRuleToken ruleInnerVarID ( ) throws RecognitionException { } } | AntlrDatatypeRuleToken current = new AntlrDatatypeRuleToken ( ) ; Token this_ID_0 = null ; Token kw = null ; enterRule ( ) ; try { // InternalSARL . g : 9921:2 : ( ( this _ ID _ 0 = RULE _ ID | kw = ' abstract ' | kw = ' annotation ' | kw = ' class ' | kw = ' create ' | kw = ' def ' | kw = ' dispatch ' | kw = ' enum ' | kw = ' extends ' | kw = ' final ' | kw = ' implements ' | kw = ' import ' | kw = ' interface ' | kw = ' override ' | kw = ' package ' | kw = ' public ' | kw = ' private ' | kw = ' protected ' | kw = ' static ' | kw = ' throws ' | kw = ' strictfp ' | kw = ' native ' | kw = ' volatile ' | kw = ' synchronized ' | kw = ' transient ' | kw = ' AFTER ' | kw = ' BEFORE ' | kw = ' SEPARATOR ' ) )
// InternalSARL . g : 9922:2 : ( this _ ID _ 0 = RULE _ ID | kw = ' abstract ' | kw = ' annotation ' | kw = ' class ' | kw = ' create ' | kw = ' def ' | kw = ' dispatch ' | kw = ' enum ' | kw = ' extends ' | kw = ' final ' | kw = ' implements ' | kw = ' import ' | kw = ' interface ' | kw = ' override ' | kw = ' package ' | kw = ' public ' | kw = ' private ' | kw = ' protected ' | kw = ' static ' | kw = ' throws ' | kw = ' strictfp ' | kw = ' native ' | kw = ' volatile ' | kw = ' synchronized ' | kw = ' transient ' | kw = ' AFTER ' | kw = ' BEFORE ' | kw = ' SEPARATOR ' )
{ // InternalSARL . g : 9922:2 : ( this _ ID _ 0 = RULE _ ID | kw = ' abstract ' | kw = ' annotation ' | kw = ' class ' | kw = ' create ' | kw = ' def ' | kw = ' dispatch ' | kw = ' enum ' | kw = ' extends ' | kw = ' final ' | kw = ' implements ' | kw = ' import ' | kw = ' interface ' | kw = ' override ' | kw = ' package ' | kw = ' public ' | kw = ' private ' | kw = ' protected ' | kw = ' static ' | kw = ' throws ' | kw = ' strictfp ' | kw = ' native ' | kw = ' volatile ' | kw = ' synchronized ' | kw = ' transient ' | kw = ' AFTER ' | kw = ' BEFORE ' | kw = ' SEPARATOR ' )
int alt257 = 28 ; switch ( input . LA ( 1 ) ) { case RULE_ID : { alt257 = 1 ; } break ; case 81 : { alt257 = 2 ; } break ; case 44 : { alt257 = 3 ; } break ; case 39 : { alt257 = 4 ; } break ; case 92 : { alt257 = 5 ; } break ; case 90 : { alt257 = 6 ; } break ; case 83 : { alt257 = 7 ; } break ; case 43 : { alt257 = 8 ; } break ; case 28 : { alt257 = 9 ; } break ; case 84 : { alt257 = 10 ; } break ; case 36 : { alt257 = 11 ; } break ; case 96 : { alt257 = 12 ; } break ; case 42 : { alt257 = 13 ; } break ; case 91 : { alt257 = 14 ; } break ; case 25 : { alt257 = 15 ; } break ; case 78 : { alt257 = 16 ; } break ; case 79 : { alt257 = 17 ; } break ; case 80 : { alt257 = 18 ; } break ; case 82 : { alt257 = 19 ; } break ; case 51 : { alt257 = 20 ; } break ; case 85 : { alt257 = 21 ; } break ; case 86 : { alt257 = 22 ; } break ; case 87 : { alt257 = 23 ; } break ; case 88 : { alt257 = 24 ; } break ; case 89 : { alt257 = 25 ; } break ; case 93 : { alt257 = 26 ; } break ; case 94 : { alt257 = 27 ; } break ; case 95 : { alt257 = 28 ; } break ; default : if ( state . backtracking > 0 ) { state . failed = true ; return current ; } NoViableAltException nvae = new NoViableAltException ( "" , 257 , 0 , input ) ; throw nvae ; } switch ( alt257 ) { case 1 : // InternalSARL . g : 9923:3 : this _ ID _ 0 = RULE _ ID
{ this_ID_0 = ( Token ) match ( input , RULE_ID , FOLLOW_2 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { current . merge ( this_ID_0 ) ; } if ( state . backtracking == 0 ) { newLeafNode ( this_ID_0 , grammarAccess . getInnerVarIDAccess ( ) . getIDTerminalRuleCall_0 ( ) ) ; } } break ; case 2 : // InternalSARL . g : 9931:3 : kw = ' abstract '
{ kw = ( Token ) match ( input , 81 , FOLLOW_2 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { current . merge ( kw ) ; newLeafNode ( kw , grammarAccess . getInnerVarIDAccess ( ) . getAbstractKeyword_1 ( ) ) ; } } break ; case 3 : // InternalSARL . g : 9937:3 : kw = ' annotation '
{ kw = ( Token ) match ( input , 44 , FOLLOW_2 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { current . merge ( kw ) ; newLeafNode ( kw , grammarAccess . getInnerVarIDAccess ( ) . getAnnotationKeyword_2 ( ) ) ; } } break ; case 4 : // InternalSARL . g : 9943:3 : kw = ' class '
{ kw = ( Token ) match ( input , 39 , FOLLOW_2 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { current . merge ( kw ) ; newLeafNode ( kw , grammarAccess . getInnerVarIDAccess ( ) . getClassKeyword_3 ( ) ) ; } } break ; case 5 : // InternalSARL . g : 9949:3 : kw = ' create '
{ kw = ( Token ) match ( input , 92 , FOLLOW_2 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { current . merge ( kw ) ; newLeafNode ( kw , grammarAccess . getInnerVarIDAccess ( ) . getCreateKeyword_4 ( ) ) ; } } break ; case 6 : // InternalSARL . g : 9955:3 : kw = ' def '
{ kw = ( Token ) match ( input , 90 , FOLLOW_2 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { current . merge ( kw ) ; newLeafNode ( kw , grammarAccess . getInnerVarIDAccess ( ) . getDefKeyword_5 ( ) ) ; } } break ; case 7 : // InternalSARL . g : 9961:3 : kw = ' dispatch '
{ kw = ( Token ) match ( input , 83 , FOLLOW_2 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { current . merge ( kw ) ; newLeafNode ( kw , grammarAccess . getInnerVarIDAccess ( ) . getDispatchKeyword_6 ( ) ) ; } } break ; case 8 : // InternalSARL . g : 9967:3 : kw = ' enum '
{ kw = ( Token ) match ( input , 43 , FOLLOW_2 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { current . merge ( kw ) ; newLeafNode ( kw , grammarAccess . getInnerVarIDAccess ( ) . getEnumKeyword_7 ( ) ) ; } } break ; case 9 : // InternalSARL . g : 9973:3 : kw = ' extends '
{ kw = ( Token ) match ( input , 28 , FOLLOW_2 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { current . merge ( kw ) ; newLeafNode ( kw , grammarAccess . getInnerVarIDAccess ( ) . getExtendsKeyword_8 ( ) ) ; } } break ; case 10 : // InternalSARL . g : 9979:3 : kw = ' final '
{ kw = ( Token ) match ( input , 84 , FOLLOW_2 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { current . merge ( kw ) ; newLeafNode ( kw , grammarAccess . getInnerVarIDAccess ( ) . getFinalKeyword_9 ( ) ) ; } } break ; case 11 : // InternalSARL . g : 9985:3 : kw = ' implements '
{ kw = ( Token ) match ( input , 36 , FOLLOW_2 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { current . merge ( kw ) ; newLeafNode ( kw , grammarAccess . getInnerVarIDAccess ( ) . getImplementsKeyword_10 ( ) ) ; } } break ; case 12 : // InternalSARL . g : 9991:3 : kw = ' import '
{ kw = ( Token ) match ( input , 96 , FOLLOW_2 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { current . merge ( kw ) ; newLeafNode ( kw , grammarAccess . getInnerVarIDAccess ( ) . getImportKeyword_11 ( ) ) ; } } break ; case 13 : // InternalSARL . g : 9997:3 : kw = ' interface '
{ kw = ( Token ) match ( input , 42 , FOLLOW_2 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { current . merge ( kw ) ; newLeafNode ( kw , grammarAccess . getInnerVarIDAccess ( ) . getInterfaceKeyword_12 ( ) ) ; } } break ; case 14 : // InternalSARL . g : 10003:3 : kw = ' override '
{ kw = ( Token ) match ( input , 91 , FOLLOW_2 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { current . merge ( kw ) ; newLeafNode ( kw , grammarAccess . getInnerVarIDAccess ( ) . getOverrideKeyword_13 ( ) ) ; } } break ; case 15 : // InternalSARL . g : 10009:3 : kw = ' package '
{ kw = ( Token ) match ( input , 25 , FOLLOW_2 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { current . merge ( kw ) ; newLeafNode ( kw , grammarAccess . getInnerVarIDAccess ( ) . getPackageKeyword_14 ( ) ) ; } } break ; case 16 : // InternalSARL . g : 10015:3 : kw = ' public '
{ kw = ( Token ) match ( input , 78 , FOLLOW_2 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { current . merge ( kw ) ; newLeafNode ( kw , grammarAccess . getInnerVarIDAccess ( ) . getPublicKeyword_15 ( ) ) ; } } break ; case 17 : // InternalSARL . g : 10021:3 : kw = ' private '
{ kw = ( Token ) match ( input , 79 , FOLLOW_2 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { current . merge ( kw ) ; newLeafNode ( kw , grammarAccess . getInnerVarIDAccess ( ) . getPrivateKeyword_16 ( ) ) ; } } break ; case 18 : // InternalSARL . g : 10027:3 : kw = ' protected '
{ kw = ( Token ) match ( input , 80 , FOLLOW_2 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { current . merge ( kw ) ; newLeafNode ( kw , grammarAccess . getInnerVarIDAccess ( ) . getProtectedKeyword_17 ( ) ) ; } } break ; case 19 : // InternalSARL . g : 10033:3 : kw = ' static '
{ kw = ( Token ) match ( input , 82 , FOLLOW_2 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { current . merge ( kw ) ; newLeafNode ( kw , grammarAccess . getInnerVarIDAccess ( ) . getStaticKeyword_18 ( ) ) ; } } break ; case 20 : // InternalSARL . g : 10039:3 : kw = ' throws '
{ kw = ( Token ) match ( input , 51 , FOLLOW_2 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { current . merge ( kw ) ; newLeafNode ( kw , grammarAccess . getInnerVarIDAccess ( ) . getThrowsKeyword_19 ( ) ) ; } } break ; case 21 : // InternalSARL . g : 10045:3 : kw = ' strictfp '
{ kw = ( Token ) match ( input , 85 , FOLLOW_2 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { current . merge ( kw ) ; newLeafNode ( kw , grammarAccess . getInnerVarIDAccess ( ) . getStrictfpKeyword_20 ( ) ) ; } } break ; case 22 : // InternalSARL . g : 10051:3 : kw = ' native '
{ kw = ( Token ) match ( input , 86 , FOLLOW_2 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { current . merge ( kw ) ; newLeafNode ( kw , grammarAccess . getInnerVarIDAccess ( ) . getNativeKeyword_21 ( ) ) ; } } break ; case 23 : // InternalSARL . g : 10057:3 : kw = ' volatile '
{ kw = ( Token ) match ( input , 87 , FOLLOW_2 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { current . merge ( kw ) ; newLeafNode ( kw , grammarAccess . getInnerVarIDAccess ( ) . getVolatileKeyword_22 ( ) ) ; } } break ; case 24 : // InternalSARL . g : 10063:3 : kw = ' synchronized '
{ kw = ( Token ) match ( input , 88 , FOLLOW_2 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { current . merge ( kw ) ; newLeafNode ( kw , grammarAccess . getInnerVarIDAccess ( ) . getSynchronizedKeyword_23 ( ) ) ; } } break ; case 25 : // InternalSARL . g : 10069:3 : kw = ' transient '
{ kw = ( Token ) match ( input , 89 , FOLLOW_2 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { current . merge ( kw ) ; newLeafNode ( kw , grammarAccess . getInnerVarIDAccess ( ) . getTransientKeyword_24 ( ) ) ; } } break ; case 26 : // InternalSARL . g : 10075:3 : kw = ' AFTER '
{ kw = ( Token ) match ( input , 93 , FOLLOW_2 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { current . merge ( kw ) ; newLeafNode ( kw , grammarAccess . getInnerVarIDAccess ( ) . getAFTERKeyword_25 ( ) ) ; } } break ; case 27 : // InternalSARL . g : 10081:3 : kw = ' BEFORE '
{ kw = ( Token ) match ( input , 94 , FOLLOW_2 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { current . merge ( kw ) ; newLeafNode ( kw , grammarAccess . getInnerVarIDAccess ( ) . getBEFOREKeyword_26 ( ) ) ; } } break ; case 28 : // InternalSARL . g : 10087:3 : kw = ' SEPARATOR '
{ kw = ( Token ) match ( input , 95 , FOLLOW_2 ) ; if ( state . failed ) return current ; if ( state . backtracking == 0 ) { current . merge ( kw ) ; newLeafNode ( kw , grammarAccess . getInnerVarIDAccess ( ) . getSEPARATORKeyword_27 ( ) ) ; } } break ; } } if ( state . backtracking == 0 ) { leaveRule ( ) ; } } catch ( RecognitionException re ) { recover ( input , re ) ; appendSkippedTokens ( ) ; } finally { } return current ; |
public class Marshaller { /** * Marshals both created and updated timestamp fields . */
private void marshalCreatedAndUpdatedTimestamp ( ) { } } | PropertyMetadata createdTimestampMetadata = entityMetadata . getCreatedTimestampMetadata ( ) ; PropertyMetadata updatedTimestampMetadata = entityMetadata . getUpdatedTimestampMetadata ( ) ; long millis = System . currentTimeMillis ( ) ; if ( createdTimestampMetadata != null ) { applyAutoTimestamp ( createdTimestampMetadata , millis ) ; } if ( updatedTimestampMetadata != null ) { applyAutoTimestamp ( updatedTimestampMetadata , millis ) ; } |
public class CmsPublishNotification { /** * Appends the contents of a list to the buffer with every entry in a new line . < p >
* @ param buffer The buffer were the entries of the list will be appended .
* @ param list The list with the entries to append to the buffer . */
private void appendList ( StringBuffer buffer , List < Object > list ) { } } | Iterator < Object > iter = list . iterator ( ) ; while ( iter . hasNext ( ) ) { Object entry = iter . next ( ) ; buffer . append ( entry ) . append ( "<br/>\n" ) ; } |
public class LifecycleQueryApprovalStatusRequest { /** * The chaincode endorsment policy for the approval being queried for . Only this or { link { @ link # setValidationParameter ( byte [ ] ) } }
* may be used in a request .
* @ param lifecycleChaincodeEndorsementPolicy
* @ throws InvalidArgumentException */
public void setChaincodeEndorsementPolicy ( LifecycleChaincodeEndorsementPolicy lifecycleChaincodeEndorsementPolicy ) throws InvalidArgumentException { } } | if ( null == lifecycleChaincodeEndorsementPolicy ) { throw new InvalidArgumentException ( "The parameter lifecycleChaincodeEndorsementPolicy may not be null." ) ; } this . validationParameter = lifecycleChaincodeEndorsementPolicy . getByteString ( ) ; |
public class OrExpressionImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public NotificationChain basicSetLeft ( Expression newLeft , NotificationChain msgs ) { } } | Expression oldLeft = left ; left = newLeft ; if ( eNotificationRequired ( ) ) { ENotificationImpl notification = new ENotificationImpl ( this , Notification . SET , SimpleExpressionsPackage . OR_EXPRESSION__LEFT , oldLeft , newLeft ) ; if ( msgs == null ) msgs = notification ; else msgs . add ( notification ) ; } return msgs ; |
public class Feature { /** * Sets additional information and calculates values which should be calculated during object creation .
* @ param jsonFileNo index of the JSON file
* @ param configuration configuration for the report */
public void setMetaData ( int jsonFileNo , Configuration configuration ) { } } | for ( Element element : elements ) { element . setMetaData ( this ) ; if ( element . isScenario ( ) ) { scenarios . add ( element ) ; } } reportFileName = calculateReportFileName ( jsonFileNo ) ; featureStatus = calculateFeatureStatus ( ) ; calculateSteps ( ) ; |
public class VisualizeAssociationScoreApp { /** * Detects the locations of the features in the image and extracts descriptions of each of
* the features . */
private void extractImageFeatures ( final ProgressMonitor progressMonitor , final int progress , T image , List < TupleDesc > descs , List < Point2D_F64 > locs ) { } } | SwingUtilities . invokeLater ( new Runnable ( ) { public void run ( ) { progressMonitor . setNote ( "Detecting" ) ; } } ) ; detector . detect ( image ) ; SwingUtilities . invokeLater ( new Runnable ( ) { public void run ( ) { progressMonitor . setProgress ( progress + 1 ) ; progressMonitor . setNote ( "Describing" ) ; } } ) ; describe . setImage ( image ) ; orientation . setImage ( image ) ; // See if the detector can detect the feature ' s scale
if ( detector . hasScale ( ) ) { for ( int i = 0 ; i < detector . getNumberOfFeatures ( ) ; i ++ ) { double yaw = 0 ; Point2D_F64 pt = detector . getLocation ( i ) ; double radius = detector . getRadius ( i ) ; if ( describe . requiresOrientation ( ) ) { orientation . setObjectRadius ( radius ) ; yaw = orientation . compute ( pt . x , pt . y ) ; } TupleDesc d = describe . createDescription ( ) ; if ( describe . process ( pt . x , pt . y , yaw , radius , d ) ) { descs . add ( d ) ; locs . add ( pt . copy ( ) ) ; } } } else { // just set the radius to one in this case
orientation . setObjectRadius ( 1 ) ; for ( int i = 0 ; i < detector . getNumberOfFeatures ( ) ; i ++ ) { double yaw = 0 ; Point2D_F64 pt = detector . getLocation ( i ) ; if ( describe . requiresOrientation ( ) ) { yaw = orientation . compute ( pt . x , pt . y ) ; } TupleDesc d = describe . createDescription ( ) ; if ( describe . process ( pt . x , pt . y , yaw , 1 , d ) ) { descs . add ( d ) ; locs . add ( pt . copy ( ) ) ; } } } SwingUtilities . invokeLater ( new Runnable ( ) { public void run ( ) { progressMonitor . setProgress ( progress + 2 ) ; } } ) ; |
public class EntityHomeHandle { /** * Return < code > EJBHome < / code > reference for this HomeHandle . < p > */
public EJBHome getEJBHome ( ) throws RemoteException { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "getEJBHome" ) ; if ( home == null ) { try { Class homeClass = null ; try { // If we are running on the server side , then the thread
// context loader would have been set appropriately by
// the container . If running on a client , then check the
// thread context class loader first
ClassLoader cl = Thread . currentThread ( ) . getContextClassLoader ( ) ; if ( cl != null ) { homeClass = cl . loadClass ( homeInterface ) ; } else { throw new ClassNotFoundException ( ) ; } } catch ( ClassNotFoundException ex ) { // FFDCFilter . processException ( ex , CLASS _ NAME + " . getEJBHome " , " 141 " , this ) ;
try { homeClass = Class . forName ( homeInterface ) ; } catch ( ClassNotFoundException e ) { // FFDCFilter . processException ( e , CLASS _ NAME + " . getEJBHome " ,
// "148 " , this ) ;
throw new ClassNotFoundException ( homeInterface ) ; } } InitialContext ctx = null ; try { // Locate the home
// 91851 begin
if ( this . initialContextProperties == null ) { ctx = new InitialContext ( ) ; } else { try { ctx = new InitialContext ( this . initialContextProperties ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) // d144064
Tr . debug ( tc , "Created an initial context with the " + "initialContextProperties, providerURL = " + ( String ) initialContextProperties . get ( "java.naming.provider.url" ) + " INITIAL_CONTEXT_FACTORY = " + ( String ) initialContextProperties . get ( Context . INITIAL_CONTEXT_FACTORY ) ) ; } catch ( NamingException ne ) { // FFDCFilter . processException ( ne , CLASS _ NAME + " . getEJBHome " ,
// "177 " , this ) ;
ctx = new InitialContext ( ) ; } } // 91851 end
home = ( EJBHome ) PortableRemoteObject . narrow ( ctx . lookup ( homeJNDIName ) , homeClass ) ; } catch ( NoInitialContextException e ) { // FFDCFilter . processException ( e , CLASS _ NAME + " . getEJBHome " , " 188 " , this ) ;
java . util . Properties p = new java . util . Properties ( ) ; p . put ( Context . INITIAL_CONTEXT_FACTORY , "com.ibm.websphere.naming.WsnInitialContextFactory" ) ; ctx = new InitialContext ( p ) ; home = ( EJBHome ) PortableRemoteObject . narrow ( ctx . lookup ( homeJNDIName ) , homeClass ) ; } } catch ( NamingException e ) { // Problem looking up the home
// FFDCFilter . processException ( e , CLASS _ NAME + " . getEJBHome " , " 201 " , this ) ;
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "getEJBHome" , e ) ; RemoteException re = new NoSuchObjectException ( "Could not find home in JNDI" ) ; re . detail = e ; throw re ; } catch ( ClassNotFoundException e ) { // We couldn ' t find the home interface ' s class
// FFDCFilter . processException ( e , CLASS _ NAME + " . getEJBHome " , " 213 " , this ) ;
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "getEJBHome" , e ) ; throw new RemoteException ( "Could not load home interface" , e ) ; } } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "getEJBHome" ) ; return home ; |
public class AbstractChannelFactory { /** * Configures the compression options that should be used by the channel .
* @ param builder The channel builder to configure .
* @ param name The name of the client to configure . */
protected void configureCompression ( final T builder , final String name ) { } } | final GrpcChannelProperties properties = getPropertiesFor ( name ) ; if ( properties . isFullStreamDecompression ( ) ) { builder . enableFullStreamDecompression ( ) ; } |
public class ManagedClustersInner { /** * Gets access profile of a managed cluster .
* Gets the accessProfile for the specified role name of the managed cluster with a specified resource group and name .
* @ param resourceGroupName The name of the resource group .
* @ param resourceName The name of the managed cluster resource .
* @ param roleName The name of the role for managed cluster accessProfile resource .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the ManagedClusterAccessProfileInner object */
public Observable < ManagedClusterAccessProfileInner > getAccessProfilesAsync ( String resourceGroupName , String resourceName , String roleName ) { } } | return getAccessProfilesWithServiceResponseAsync ( resourceGroupName , resourceName , roleName ) . map ( new Func1 < ServiceResponse < ManagedClusterAccessProfileInner > , ManagedClusterAccessProfileInner > ( ) { @ Override public ManagedClusterAccessProfileInner call ( ServiceResponse < ManagedClusterAccessProfileInner > response ) { return response . body ( ) ; } } ) ; |
public class DefaultJsonMapper { /** * Given a { @ code json } value of something like { @ code MyValue } or { @ code 123 } , return a representation of that value
* of type { @ code type } .
* This is to support non - legal JSON served up by Facebook for API calls like { @ code Friends . get } ( example result :
* { @ code [ 222333,1240079 ] } ) .
* @ param < T >
* The Java type to map to .
* @ param json
* The non - legal JSON to map to the Java type .
* @ param type
* Type token .
* @ return Java representation of { @ code json } .
* @ throws FacebookJsonMappingException
* If an error occurs while mapping JSON to Java . */
@ SuppressWarnings ( "unchecked" ) protected < T > T toPrimitiveJavaType ( String json , Class < T > type ) { } } | // cleanup the json string
if ( json . length ( ) > 1 && json . startsWith ( "\"" ) && json . endsWith ( "\"" ) ) { json = json . replaceFirst ( "\"" , "" ) ; json = json . substring ( 0 , json . length ( ) - 1 ) ; } if ( String . class . equals ( type ) ) { return ( T ) json ; } if ( Integer . class . equals ( type ) || Integer . TYPE . equals ( type ) ) { return ( T ) Integer . valueOf ( json ) ; } if ( Boolean . class . equals ( type ) || Boolean . TYPE . equals ( type ) ) { return ( T ) Boolean . valueOf ( json ) ; } if ( Long . class . equals ( type ) || Long . TYPE . equals ( type ) ) { return ( T ) Long . valueOf ( json ) ; } if ( Double . class . equals ( type ) || Double . TYPE . equals ( type ) ) { return ( T ) Double . valueOf ( json ) ; } if ( Float . class . equals ( type ) || Float . TYPE . equals ( type ) ) { return ( T ) Float . valueOf ( json ) ; } if ( BigInteger . class . equals ( type ) ) { return ( T ) new BigInteger ( json ) ; } if ( BigDecimal . class . equals ( type ) ) { return ( T ) new BigDecimal ( json ) ; } throw new FacebookJsonMappingException ( "Don't know how to map JSON to " + type + ". Are you sure you're mapping to the right class?\nOffending JSON is '" + json + "'." ) ; |
public class RemoteQueueBrowser { /** * / * ( non - Javadoc )
* @ see net . timewalker . ffmq4 . common . session . AbstractQueueBrowser # onQueueBrowserClose ( ) */
@ Override protected void onQueueBrowserClose ( ) { } } | super . onQueueBrowserClose ( ) ; try { CloseBrowserQuery query = new CloseBrowserQuery ( ) ; query . setSessionId ( session . getId ( ) ) ; query . setBrowserId ( id ) ; transportEndpoint . blockingRequest ( query ) ; } catch ( JMSException e ) { ErrorTools . log ( e , log ) ; } |
public class SortedLists { /** * Searches the specified list for the specified object using the binary search algorithm . The
* list must be sorted into ascending order according to the specified comparator ( as by the
* { @ link Collections # sort ( List , Comparator ) Collections . sort ( List , Comparator ) } method ) , prior
* to making this call . If it is not sorted , the results are undefined .
* < p > If there are elements in the list which compare as equal to the key , the choice of
* { @ link KeyPresentBehavior } decides which index is returned . If no elements compare as equal to
* the key , the choice of { @ link KeyAbsentBehavior } decides which index is returned .
* < p > This method runs in log ( n ) time on random - access lists , which offer near - constant - time
* access to each list element .
* @ param list the list to be searched .
* @ param key the value to be searched for .
* @ param comparator the comparator by which the list is ordered .
* @ param presentBehavior the specification for what to do if at least one element of the list
* compares as equal to the key .
* @ param absentBehavior the specification for what to do if no elements of the list compare as
* equal to the key .
* @ return the index determined by the { @ code KeyPresentBehavior } , if the key is in the list ;
* otherwise the index determined by the { @ code KeyAbsentBehavior } . */
public static < E > int binarySearch ( List < ? extends E > list , @ Nullable E key , Comparator < ? super E > comparator , KeyPresentBehavior presentBehavior , KeyAbsentBehavior absentBehavior ) { } } | checkNotNull ( comparator ) ; checkNotNull ( list ) ; checkNotNull ( presentBehavior ) ; checkNotNull ( absentBehavior ) ; if ( ! ( list instanceof RandomAccess ) ) { list = Lists . newArrayList ( list ) ; } // TODO ( user ) : benchmark when it ' s best to do a linear search
int lower = 0 ; int upper = list . size ( ) - 1 ; while ( lower <= upper ) { int middle = ( lower + upper ) >>> 1 ; int c = comparator . compare ( key , list . get ( middle ) ) ; if ( c < 0 ) { upper = middle - 1 ; } else if ( c > 0 ) { lower = middle + 1 ; } else { return lower + presentBehavior . resultIndex ( comparator , key , list . subList ( lower , upper + 1 ) , middle - lower ) ; } } return absentBehavior . resultIndex ( lower ) ; |
public class LNGBoundedIntQueue { /** * Grows this queue to a given size .
* @ param size the size */
private void growTo ( int size ) { } } | this . elems . growTo ( size , 0 ) ; this . first = 0 ; this . maxSize = size ; this . queueSize = 0 ; this . last = 0 ; |
public class MessageProcessor { /** * Invokes the activation method of the passed instance . */
@ Override public void activate ( final T instance , final Object key ) throws DempsyException { } } | wrap ( ( ) -> activationMethod . invoke ( instance , key ) ) ; |
public class AdminBadwordAction { @ Execute public HtmlResponse details ( final int crudMode , final String id ) { } } | verifyCrudMode ( crudMode , CrudMode . DETAILS ) ; saveToken ( ) ; return asDetailsHtml ( ) . useForm ( EditForm . class , op -> { op . setup ( form -> { badWordService . getBadWord ( id ) . ifPresent ( entity -> { copyBeanToBean ( entity , form , copyOp -> { copyOp . excludeNull ( ) ; } ) ; form . crudMode = crudMode ; } ) . orElse ( ( ) -> { throwValidationError ( messages -> messages . addErrorsCrudCouldNotFindCrudTable ( GLOBAL , id ) , ( ) -> asListHtml ( ) ) ; } ) ; } ) ; } ) ; |
public class GeoCodeLoader { /** * Read places from an input stream . The format is | separated . It may
* contain just a historical place name or both historical and modern
* places names .
* @ param istream the input stream */
public final void loadAndFind ( final InputStream istream ) { } } | load ( istream , ( s1 , s2 ) -> gcc . find ( s1 , s2 ) ) ; |
public class SoyAutoescapeException { /** * Creates a SoyAutoescapeException , with meta info filled in based on the given Soy node .
* @ param message The error message .
* @ param cause The cause of this exception .
* @ param node The node from which to derive the exception meta info .
* @ return The new SoyAutoescapeException object . */
static SoyAutoescapeException createCausedWithNode ( String message , Throwable cause , SoyNode node ) { } } | return new SoyAutoescapeException ( message , cause , node ) ; |
public class MarkLogicClientImpl { /** * clears triples from named graph
* @ param tx
* @ param contexts */
public void performClear ( Transaction tx , Resource ... contexts ) { } } | if ( notNull ( contexts ) ) { for ( int i = 0 ; i < contexts . length ; i ++ ) { if ( notNull ( contexts [ i ] ) ) { graphManager . delete ( contexts [ i ] . stringValue ( ) , tx ) ; } else { graphManager . delete ( DEFAULT_GRAPH_URI , tx ) ; } } } else { graphManager . delete ( DEFAULT_GRAPH_URI , tx ) ; } |
public class StAXEncoder { /** * Writes an xml comment with the data enclosed
* ( non - Javadoc )
* @ see javax . xml . stream . XMLStreamWriter # writeComment ( java . lang . String ) */
public void writeComment ( String data ) throws XMLStreamException { } } | if ( preserveComment ) { try { this . checkPendingATEvents ( ) ; // TODO improve EXI API
char [ ] chars = data . toCharArray ( ) ; encoder . encodeComment ( chars , 0 , chars . length ) ; } catch ( Exception e ) { throw new XMLStreamException ( e . getLocalizedMessage ( ) , e ) ; } } |
public class XMLUtil { /** * Read an XML fragment from an XML file .
* The XML file is well - formed . It means that the fragment will contains a single element : the root element
* within the input file .
* @ param file is the file to read
* @ param skipRoot if { @ code true } the root element itself is not part of the fragment , and the children
* of the root element are directly added within the fragment .
* @ return the fragment from the { @ code file } .
* @ throws IOException if the stream cannot be read .
* @ throws SAXException if the stream does not contains valid XML data .
* @ throws ParserConfigurationException if the parser cannot be configured . */
public static DocumentFragment readXMLFragment ( String file , boolean skipRoot ) throws IOException , SAXException , ParserConfigurationException { } } | assert file != null : AssertMessages . notNullParameter ( ) ; try ( FileInputStream fis = new FileInputStream ( file ) ) { return readXMLFragment ( fis , skipRoot ) ; } |
public class FixedFatJarExportPage { /** * Open an appropriate ant script browser so that the user can specify a source
* to import from */
private void handleAntScriptBrowseButtonPressed ( ) { } } | FileDialog dialog = new FileDialog ( getContainer ( ) . getShell ( ) , SWT . SAVE ) ; dialog . setFilterExtensions ( new String [ ] { "*." + ANTSCRIPT_EXTENSION } ) ; // $ NON - NLS - 1 $
String currentSourceString = getAntScriptValue ( ) ; int lastSeparatorIndex = currentSourceString . lastIndexOf ( File . separator ) ; if ( lastSeparatorIndex != - 1 ) { dialog . setFilterPath ( currentSourceString . substring ( 0 , lastSeparatorIndex ) ) ; dialog . setFileName ( currentSourceString . substring ( lastSeparatorIndex + 1 , currentSourceString . length ( ) ) ) ; } String selectedFileName = dialog . open ( ) ; if ( selectedFileName != null ) fAntScriptNamesCombo . setText ( selectedFileName ) ; |
public class MethodlessRouter { /** * This method does nothing if the path pattern has already been added .
* A path pattern can only point to one target . */
public MethodlessRouter < T > addRoute ( String pathPattern , T target ) { } } | PathPattern p = new PathPattern ( pathPattern ) ; if ( routes . containsKey ( p ) ) { return this ; } routes . put ( p , target ) ; return this ; |
public class VersionTreeResponseEntity { /** * { @ inheritDoc } */
public void write ( OutputStream outputStream ) throws IOException { } } | try { this . xmlStreamWriter = XMLOutputFactory . newInstance ( ) . createXMLStreamWriter ( outputStream , Constants . DEFAULT_ENCODING ) ; xmlStreamWriter . setNamespaceContext ( namespaceContext ) ; xmlStreamWriter . writeStartDocument ( ) ; xmlStreamWriter . writeStartElement ( "D" , "multistatus" , "DAV:" ) ; xmlStreamWriter . writeNamespace ( "D" , "DAV:" ) ; xmlStreamWriter . writeAttribute ( "xmlns:b" , "urn:uuid:c2f41010-65b3-11d1-a29f-00aa00c14882/" ) ; Iterator < VersionResource > versionIterator = versions . iterator ( ) ; while ( versionIterator . hasNext ( ) ) { VersionResource versionResource = versionIterator . next ( ) ; xmlStreamWriter . writeStartElement ( "DAV:" , "response" ) ; xmlStreamWriter . writeStartElement ( "DAV:" , "href" ) ; xmlStreamWriter . writeCharacters ( versionResource . getIdentifier ( ) . toASCIIString ( ) ) ; xmlStreamWriter . writeEndElement ( ) ; PropstatGroupedRepresentation propstat = new PropstatGroupedRepresentation ( versionResource , properties , false ) ; PropertyWriteUtil . writePropStats ( xmlStreamWriter , propstat . getPropStats ( ) ) ; xmlStreamWriter . writeEndElement ( ) ; } xmlStreamWriter . writeEndElement ( ) ; xmlStreamWriter . writeEndDocument ( ) ; } catch ( XMLStreamException exc ) { log . error ( exc . getMessage ( ) , exc ) ; throw new IOException ( exc . getMessage ( ) , exc ) ; } catch ( RepositoryException exc ) { log . error ( exc . getMessage ( ) , exc ) ; throw new IOException ( exc . getMessage ( ) , exc ) ; } |
public class EglCore { /** * Returns true if our context and the specified surface are current . */
public boolean isCurrent ( EGLSurface eglSurface ) { } } | return mEGLContext . equals ( EGL14 . eglGetCurrentContext ( ) ) && eglSurface . equals ( EGL14 . eglGetCurrentSurface ( EGL14 . EGL_DRAW ) ) ; |
public class JGTProcessingRegion { /** * Reprojects a { @ link JGTProcessingRegion region } .
* @ param sourceCRS
* the original { @ link CoordinateReferenceSystem crs } of the
* region .
* @ param targetCRS
* the target { @ link CoordinateReferenceSystem crs } of the
* region .
* @ param lenient
* defines whether to apply a lenient transformation or not .
* @ return a new { @ link JGTProcessingRegion region } .
* @ throws Exception
* exception that may be thrown when applying the
* transformation . */
public JGTProcessingRegion reproject ( CoordinateReferenceSystem sourceCRS , CoordinateReferenceSystem targetCRS , boolean lenient ) throws Exception { } } | MathTransform transform = CRS . findMathTransform ( sourceCRS , targetCRS , lenient ) ; Envelope envelope = getEnvelope ( ) ; Envelope targetEnvelope = JTS . transform ( envelope , transform ) ; return new JGTProcessingRegion ( targetEnvelope . getMinX ( ) , targetEnvelope . getMaxX ( ) , targetEnvelope . getMinY ( ) , targetEnvelope . getMaxY ( ) , getRows ( ) , getCols ( ) ) ; |
public class SLF4JLog { /** * Converts the first input parameter to String and then delegates to the
* wrapped < code > org . slf4j . Logger < / code > instance .
* @ param message
* the message to log . Converted to { @ link String }
* @ param t
* the exception to log */
public void debug ( Object message , Throwable t ) { } } | logger . debug ( String . valueOf ( message ) , t ) ; |
public class ResourceBundlesHandlerImpl { /** * ( non - Javadoc )
* @ seenet . jawr . web . resource . bundle . handler . ResourceBundlesHandler #
* getGlobalResourceBundlePaths
* ( net . jawr . web . resource . bundle . iterator . ConditionalCommentCallbackHandler ,
* java . lang . String ) */
@ Override public ResourceBundlePathsIterator getGlobalResourceBundlePaths ( String bundleId , ConditionalCommentCallbackHandler commentCallbackHandler , Map < String , String > variants ) { } } | List < JoinableResourceBundle > currentBundles = new ArrayList < > ( ) ; for ( JoinableResourceBundle bundle : globalBundles ) { if ( bundle . getId ( ) . equals ( bundleId ) ) { currentBundles . add ( bundle ) ; break ; } } return getBundleIterator ( getDebugMode ( ) , currentBundles , commentCallbackHandler , variants ) ; |
public class JNote { /** * Moves the note to a new position in order to set the new stem
* begin position to the new location . */
public void setStemBeginPosition ( Point2D newStemBeginPos ) { } } | double xDelta = newStemBeginPos . getX ( ) - getStemBeginPosition ( ) . getX ( ) ; double yDelta = newStemBeginPos . getY ( ) - getStemBeginPosition ( ) . getY ( ) ; // System . out . println ( " translating " + this + " with " + xDelta + " / " + yDelta ) ;
Point2D newBase = new Point2D . Double ( getBase ( ) . getX ( ) + xDelta , getBase ( ) . getY ( ) + yDelta ) ; setBase ( newBase ) ; |
public class RestRequest { /** * Executes the request . This will automatically retry if we hit a ratelimit .
* @ param function A function which processes the rest response to the requested object .
* @ return A future which will contain the output of the function . */
public CompletableFuture < T > execute ( Function < RestRequestResult , T > function ) { } } | api . getRatelimitManager ( ) . queueRequest ( this ) ; CompletableFuture < T > future = new CompletableFuture < > ( ) ; result . whenComplete ( ( result , throwable ) -> { if ( throwable != null ) { future . completeExceptionally ( throwable ) ; return ; } try { future . complete ( function . apply ( result ) ) ; } catch ( Throwable t ) { future . completeExceptionally ( t ) ; } } ) ; return future ; |
public class FixBondOrdersTool { /** * kekuliseAromaticRings - function to add double / single bond order information for molecules having rings containing all atoms marked SP2 or Planar3 hybridisation .
* @ param molecule The { @ link IAtomContainer } to kekulise
* @ return The { @ link IAtomContainer } with kekule structure
* @ throws CDKException */
public IAtomContainer kekuliseAromaticRings ( IAtomContainer molecule ) throws CDKException { } } | IAtomContainer mNew = null ; try { mNew = ( IAtomContainer ) molecule . clone ( ) ; } catch ( Exception e ) { throw new CDKException ( "Failed to clone source molecule" ) ; } IRingSet ringSet ; try { ringSet = removeExtraRings ( mNew ) ; } catch ( CDKException x ) { throw x ; } catch ( Exception x ) { throw new CDKException ( "failure in SSSRFinder.findAllRings" , x ) ; } if ( ringSet == null ) { throw new CDKException ( "failure in SSSRFinder.findAllRings" ) ; } // We need to establish which rings share bonds and set up sets of such interdependant rings
List < Integer [ ] > rBondsArray = null ; List < List < Integer > > ringGroups = null ; // Start by getting a list ( same dimensions and ordering as ringset ) of all the ring bond numbers in the reduced ring set
rBondsArray = getRingSystem ( mNew , ringSet ) ; // Now find out which share a bond and assign them accordingly to groups
ringGroups = assignRingGroups ( rBondsArray ) ; // Loop through each group of rings checking all choices of double bond combis and seeing if you can get a
// proper molecule .
for ( int i = 0 ; i < ringGroups . size ( ) ; i ++ ) { // Set all ring bonds with single order to allow Matrix solving to work
setAllRingBondsSingleOrder ( ringGroups . get ( i ) , ringSet ) ; // Set up lists of atoms , bonds and atom pairs for this ringGroup
List < Integer > atomNos = null ; atomNos = getAtomNosForRingGroup ( mNew , ringGroups . get ( i ) , ringSet ) ; List < Integer > bondNos = null ; bondNos = getBondNosForRingGroup ( mNew , ringGroups . get ( i ) , ringSet ) ; // Array of same dimensions as bondNos ( cols in Matrix )
List < Integer [ ] > atomNoPairs = null ; atomNoPairs = getAtomNoPairsForRingGroup ( mNew , bondNos ) ; // Set up ajacency Matrix
Matrix M = new Matrix ( atomNos . size ( ) , bondNos . size ( ) ) ; for ( int x = 0 ; x < M . getRows ( ) ; x ++ ) { for ( int y = 0 ; y < M . getCols ( ) ; y ++ ) { if ( Objects . equals ( atomNos . get ( x ) , atomNoPairs . get ( y ) [ 0 ] ) ) { M . set ( x , y , 1 ) ; } else { if ( Objects . equals ( atomNos . get ( x ) , atomNoPairs . get ( y ) [ 1 ] ) ) { M . set ( x , y , 1 ) ; } else { M . set ( x , y , 0 ) ; } } } } // Array of same dimensions as atomNos ( rows in Matrix )
List < Integer > freeValencies = null ; freeValencies = getFreeValenciesForRingGroup ( mNew , atomNos , M , ringSet ) ; // Array of " answers "
List < Integer > bondOrders = new ArrayList < Integer > ( ) ; for ( int j = 0 ; j < bondNos . size ( ) ; j ++ ) { bondOrders . add ( 0 ) ; } if ( solveMatrix ( M , atomNos , bondNos , freeValencies , atomNoPairs , bondOrders ) ) { for ( int j = 0 ; j < bondOrders . size ( ) ; j ++ ) { mNew . getBond ( bondNos . get ( j ) ) . setOrder ( bondOrders . get ( j ) == 1 ? IBond . Order . SINGLE : IBond . Order . DOUBLE ) ; } } else { // TODO Put any failure code here
} } return mNew ; |
public class JSType { /** * Coerces this type to an Object type , then gets the type of the property whose name is given .
* < p > Unlike { @ link ObjectType # getPropertyType } , returns null if the property is not found .
* @ return The property ' s type . { @ code null } if the current type cannot have properties , or if the
* type is not found . */
@ Nullable public final JSType findPropertyType ( String propertyName ) { } } | @ Nullable JSType propertyType = findPropertyTypeWithoutConsideringTemplateTypes ( propertyName ) ; if ( propertyType == null ) { return null ; } // Do templatized type replacing logic here , and make this method final , to prevent a subclass
// from forgetting to replace template types
if ( getTemplateTypeMap ( ) . isEmpty ( ) || ! propertyType . hasAnyTemplateTypes ( ) ) { return propertyType ; } TemplateTypeMap typeMap = getTemplateTypeMap ( ) ; TemplateTypeMapReplacer replacer = new TemplateTypeMapReplacer ( registry , typeMap ) ; return propertyType . visit ( replacer ) ; |
public class ServiceAgentManagedService { /** * Update the SLP service agent ' s configuration , unregistering from the
* OSGi service registry and stopping it if it had already started . The
* new SLP service agent will be started with the new configuration and
* registered in the OSGi service registry using the configuration
* parameters as service properties .
* @ param dictionary The dictionary used to configure the SLP service agent .
* @ throws ConfigurationException Thrown if an error occurs during the SLP service agent ' s configuration . */
public void updated ( Dictionary dictionary ) throws ConfigurationException { } } | LOGGER . entering ( CLASS_NAME , "updated" , dictionary ) ; synchronized ( lock ) { if ( serviceAgent != null ) { serviceRegistration . unregister ( ) ; if ( LOGGER . isLoggable ( Level . FINER ) ) LOGGER . finer ( "Server " + this + " stopping..." ) ; serviceAgent . stop ( ) ; if ( LOGGER . isLoggable ( Level . FINE ) ) LOGGER . fine ( "Server " + this + " stopped successfully" ) ; } serviceAgent = SLP . newServiceAgent ( dictionary == null ? null : DictionarySettings . from ( dictionary ) ) ; if ( LOGGER . isLoggable ( Level . FINER ) ) LOGGER . finer ( "Server " + this + " starting..." ) ; serviceAgent . start ( ) ; if ( LOGGER . isLoggable ( Level . FINE ) ) LOGGER . fine ( "Server " + this + " started successfully" ) ; serviceRegistration = bundleContext . registerService ( IServiceAgent . class . getName ( ) , serviceAgent , dictionary ) ; } LOGGER . exiting ( CLASS_NAME , "updated" ) ; |
public class MtasSolrComponentPrefix { /** * ( non - Javadoc )
* @ see
* mtas . solr . handler . component . util . MtasSolrComponent # distributedProcess ( org .
* apache . solr . handler . component . ResponseBuilder ,
* mtas . codec . util . CodecComponent . ComponentFields ) */
@ SuppressWarnings ( "unchecked" ) public void distributedProcess ( ResponseBuilder rb , ComponentFields mtasFields ) throws IOException { } } | // rewrite
NamedList < Object > mtasResponse = null ; try { mtasResponse = ( NamedList < Object > ) rb . rsp . getValues ( ) . get ( "mtas" ) ; } catch ( ClassCastException e ) { log . debug ( e ) ; mtasResponse = null ; } if ( mtasResponse != null ) { ArrayList < Object > mtasResponsePrefix ; try { mtasResponsePrefix = ( ArrayList < Object > ) mtasResponse . get ( NAME ) ; if ( mtasResponsePrefix != null ) { NamedList < Object > mtasResponsePrefixItem ; for ( Object mtasResponsePrefixItemRaw : mtasResponsePrefix ) { mtasResponsePrefixItem = ( NamedList < Object > ) mtasResponsePrefixItemRaw ; repairPrefixItems ( mtasResponsePrefixItem ) ; MtasSolrResultUtil . rewrite ( mtasResponsePrefixItem , searchComponent ) ; } } } catch ( ClassCastException e ) { log . debug ( e ) ; mtasResponse . remove ( NAME ) ; } } |
public class DefaultEntityTagFunction { /** * Appends a 64 - bit integer without its leading zero bytes . */
private static int appendLong ( byte [ ] data , int offset , long value ) { } } | offset = appendByte ( data , offset , value >>> 56 ) ; offset = appendByte ( data , offset , value >>> 48 ) ; offset = appendByte ( data , offset , value >>> 40 ) ; offset = appendByte ( data , offset , value >>> 32 ) ; offset = appendInt ( data , offset , value ) ; return offset ; |
public class NormalizerSerializer { /** * Check if a serializer strategy supports a normalizer . If the normalizer is a custom opType , it checks if the
* supported normalizer class matches .
* @ param strategy
* @ param normalizerType
* @ param normalizerClass
* @ return whether the strategy supports the normalizer */
private boolean strategySupportsNormalizer ( NormalizerSerializerStrategy strategy , NormalizerType normalizerType , Class < ? extends Normalizer > normalizerClass ) { } } | if ( ! strategy . getSupportedType ( ) . equals ( normalizerType ) ) { return false ; } if ( strategy . getSupportedType ( ) . equals ( NormalizerType . CUSTOM ) ) { // Strategy should be instance of CustomSerializerStrategy
if ( ! ( strategy instanceof CustomSerializerStrategy ) ) { throw new IllegalArgumentException ( "Strategies supporting CUSTOM opType must be instance of CustomSerializerStrategy, got" + strategy . getClass ( ) ) ; } return ( ( CustomSerializerStrategy ) strategy ) . getSupportedClass ( ) . equals ( normalizerClass ) ; } return true ; |
public class RequeryOnUpdateHandler { /** * Set the field or file that owns this listener .
* @ param owner My owner . */
public void setOwner ( ListenerOwner owner ) { } } | super . setOwner ( owner ) ; if ( owner != null ) if ( m_recordToSync != null ) m_recordToSync . addListener ( new FileRemoveBOnCloseHandler ( this ) ) ; |
public class StreamSet { /** * Set the persistent data for a specific stream
* @ param priority
* @ param reliability
* @ param completedPrefix
* @ throws SIResourceException */
protected void setPersistentData ( int priority , Reliability reliability , long completedPrefix ) throws SIResourceException { } } | getSubset ( reliability ) . setPersistentData ( priority , completedPrefix ) ; |
public class Quicksort { /** * Routine that arranges the elements in ascending order around a pivot . This routine
* runs in O ( n ) time .
* @ param < E > the type of elements in this list .
* @ param list array that we want to sort
* @ param start index of the starting point to sort
* @ param end index of the end point to sort
* @ return an integer that represent the index of the pivot */
private static < E extends Comparable < E > > int partition ( List < E > list , int start , int end ) { } } | E pivot = list . get ( end ) ; int index = start - 1 ; for ( int j = start ; j < end ; j ++ ) { if ( list . get ( j ) . compareTo ( pivot ) <= 0 ) { index ++ ; TrivialSwap . swap ( list , index , j ) ; } } TrivialSwap . swap ( list , index + 1 , end ) ; return index + 1 ; |
public class Entity { /** * Returns the internationalized entity title */
public String getTitle ( ) { } } | final String key = String . format ( "pm.entity.%s" , getId ( ) ) ; final String message = pm . message ( key ) ; if ( key . equals ( message ) ) { if ( getExtendzEntity ( ) != null ) { return getExtendzEntity ( ) . getTitle ( ) ; } } return message ; |
public class CmsJSONSearchConfigurationParser { /** * Returns a map with additional request parameters , mapping the parameter names to Solr query parts .
* @ return A map with additional request parameters , mapping the parameter names to Solr query parts . */
protected Map < String , String > getAdditionalParameters ( ) { } } | Map < String , String > result ; try { JSONArray additionalParams = m_configObject . getJSONArray ( JSON_KEY_ADDITIONAL_PARAMETERS ) ; result = new HashMap < String , String > ( additionalParams . length ( ) ) ; for ( int i = 0 ; i < additionalParams . length ( ) ; i ++ ) { try { JSONObject currentParam = additionalParams . getJSONObject ( i ) ; String param = currentParam . getString ( JSON_KEY_ADDITIONAL_PARAMETERS_PARAM ) ; String solrQuery = currentParam . getString ( JSON_KEY_ADDITIONAL_PARAMETERS_SOLRQUERY ) ; result . put ( param , solrQuery ) ; } catch ( JSONException e ) { LOG . error ( Messages . get ( ) . getBundle ( ) . key ( Messages . ERR_ADDITIONAL_PARAMETER_CONFIG_WRONG_0 ) , e ) ; continue ; } } } catch ( JSONException e ) { LOG . info ( Messages . get ( ) . getBundle ( ) . key ( Messages . LOG_ADDITIONAL_PARAMETER_CONFIG_NOT_PARSED_0 ) , e ) ; return null != m_baseConfig ? m_baseConfig . getGeneralConfig ( ) . getAdditionalParameters ( ) : new HashMap < String , String > ( ) ; } return result ; |
public class MethodUtils { /** * < p > Return an accessible method ( that is , one that can be invoked via
* reflection ) that implements the specified Method . If no such method
* can be found , return < code > null < / code > . < / p >
* @ param clazz The class of the object
* @ param method The method that we wish to call
* @ return The accessible method
* @ since 1.8.0 */
public static Method getAccessibleMethod ( Class < ? > clazz , Method method ) { } } | // Make sure we have a method to check
if ( method == null ) { return ( null ) ; } // If the requested method is not public we cannot call it
if ( ! Modifier . isPublic ( method . getModifiers ( ) ) ) { return ( null ) ; } boolean sameClass = true ; if ( clazz == null ) { clazz = method . getDeclaringClass ( ) ; } else { sameClass = clazz . equals ( method . getDeclaringClass ( ) ) ; if ( ! method . getDeclaringClass ( ) . isAssignableFrom ( clazz ) ) { throw new IllegalArgumentException ( clazz . getName ( ) + " is not assignable from " + method . getDeclaringClass ( ) . getName ( ) ) ; } } // If the class is public , we are done
if ( Modifier . isPublic ( clazz . getModifiers ( ) ) ) { if ( ! sameClass && ! Modifier . isPublic ( method . getDeclaringClass ( ) . getModifiers ( ) ) ) { setMethodAccessible ( method ) ; // Default access superclass workaround
} return ( method ) ; } String methodName = method . getName ( ) ; Class < ? > [ ] parameterTypes = method . getParameterTypes ( ) ; // Check the implemented interfaces and subinterfaces
method = getAccessibleMethodFromInterfaceNest ( clazz , methodName , parameterTypes ) ; // Check the superclass chain
if ( method == null ) { method = getAccessibleMethodFromSuperclass ( clazz , methodName , parameterTypes ) ; } return ( method ) ; |
public class DRL5Expressions { /** * src / main / resources / org / drools / compiler / lang / DRL5Expressions . g : 603:1 : creator : ( nonWildcardTypeArguments ) ? createdName ( arrayCreatorRest | classCreatorRest ) ; */
public final void creator ( ) throws RecognitionException { } } | try { // src / main / resources / org / drools / compiler / lang / DRL5Expressions . g : 604:5 : ( ( nonWildcardTypeArguments ) ? createdName ( arrayCreatorRest | classCreatorRest ) )
// src / main / resources / org / drools / compiler / lang / DRL5Expressions . g : 604:7 : ( nonWildcardTypeArguments ) ? createdName ( arrayCreatorRest | classCreatorRest )
{ // src / main / resources / org / drools / compiler / lang / DRL5Expressions . g : 604:7 : ( nonWildcardTypeArguments ) ?
int alt66 = 2 ; int LA66_0 = input . LA ( 1 ) ; if ( ( LA66_0 == LESS ) ) { alt66 = 1 ; } switch ( alt66 ) { case 1 : // src / main / resources / org / drools / compiler / lang / DRL5Expressions . g : 604:7 : nonWildcardTypeArguments
{ pushFollow ( FOLLOW_nonWildcardTypeArguments_in_creator3440 ) ; nonWildcardTypeArguments ( ) ; state . _fsp -- ; if ( state . failed ) return ; } break ; } pushFollow ( FOLLOW_createdName_in_creator3443 ) ; createdName ( ) ; state . _fsp -- ; if ( state . failed ) return ; // src / main / resources / org / drools / compiler / lang / DRL5Expressions . g : 605:9 : ( arrayCreatorRest | classCreatorRest )
int alt67 = 2 ; int LA67_0 = input . LA ( 1 ) ; if ( ( LA67_0 == LEFT_SQUARE ) ) { alt67 = 1 ; } else if ( ( LA67_0 == LEFT_PAREN ) ) { alt67 = 2 ; } else { if ( state . backtracking > 0 ) { state . failed = true ; return ; } NoViableAltException nvae = new NoViableAltException ( "" , 67 , 0 , input ) ; throw nvae ; } switch ( alt67 ) { case 1 : // src / main / resources / org / drools / compiler / lang / DRL5Expressions . g : 605:10 : arrayCreatorRest
{ pushFollow ( FOLLOW_arrayCreatorRest_in_creator3454 ) ; arrayCreatorRest ( ) ; state . _fsp -- ; if ( state . failed ) return ; } break ; case 2 : // src / main / resources / org / drools / compiler / lang / DRL5Expressions . g : 605:29 : classCreatorRest
{ pushFollow ( FOLLOW_classCreatorRest_in_creator3458 ) ; classCreatorRest ( ) ; state . _fsp -- ; if ( state . failed ) return ; } break ; } } } catch ( RecognitionException re ) { throw re ; } finally { // do for sure before leaving
} |
public class PdfTransparencyGroup { /** * Determining the initial backdrop against which its stack is composited .
* @ param isolated */
public void setIsolated ( boolean isolated ) { } } | if ( isolated ) put ( PdfName . I , PdfBoolean . PDFTRUE ) ; else remove ( PdfName . I ) ; |
public class EditableNamespaceContext { /** * Returns all prefixes with a namespace binding . */
@ Override public Iterator < String > getPrefixes ( String namespaceURI ) { } } | // per javax . xml . namespace . NamespaceContext doc
if ( namespaceURI == null ) throw new IllegalArgumentException ( "Cannot find prefix for null namespace URI" ) ; List < String > list = new ArrayList < > ( ) ; if ( XMLConstants . XML_NS_URI . equals ( namespaceURI ) ) list . add ( XMLConstants . XML_NS_PREFIX ) ; else if ( XMLConstants . XMLNS_ATTRIBUTE_NS_URI . equals ( namespaceURI ) ) list . add ( XMLConstants . XMLNS_ATTRIBUTE ) ; else for ( Map . Entry < String , String > entry : bindings . entrySet ( ) ) { if ( namespaceURI . equals ( entry . getValue ( ) ) ) list . add ( entry . getKey ( ) ) ; } return Collections . unmodifiableList ( list ) . iterator ( ) ; |
public class AfplibPackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public EClass getGSLE ( ) { } } | if ( gsleEClass == null ) { gsleEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( AfplibPackage . eNS_URI ) . getEClassifiers ( ) . get ( 486 ) ; } return gsleEClass ; |
public class ByteArrayUtil { /** * Put the source < i > float < / i > into the destination byte array starting at the given offset
* in little endian order .
* There is no bounds checking .
* @ param array destination byte array
* @ param offset destination offset
* @ param value source < i > float < / i > */
public static void putFloatLE ( final byte [ ] array , final int offset , final float value ) { } } | putIntLE ( array , offset , Float . floatToRawIntBits ( value ) ) ; |
public class ByteBufferOutputStream { /** * Write byte range to start of the buffer .
* @ param b
* @ param offset
* @ param length */
public void prewrite ( byte [ ] b , int offset , int length ) { } } | ensureReserve ( length ) ; System . arraycopy ( b , offset , _buf , _start - length , length ) ; _start -= length ; |
public class PatchedRuntimeEnvironmentBuilder { /** * Adds and asset .
* @ param asset asset
* @ param type type
* @ return this RuntimeEnvironmentBuilder */
public RuntimeEnvironmentBuilder addAsset ( Resource asset , ResourceType type ) { } } | if ( asset == null || type == null ) { return this ; } _runtimeEnvironment . addAsset ( asset , type ) ; return this ; |
public class Jronn { /** * Convert raw scores to ranges . Gives ranges for given probability of disorder value
* @ param scores the raw probability of disorder scores for each residue in the sequence .
* @ param probability the cut off threshold . Include all residues with the probability of disorder greater then this value
* @ return the array of ranges if there are any residues predicted to have the
* probability of disorder greater then { @ code probability } , null otherwise . */
public static Range [ ] scoresToRanges ( float [ ] scores , float probability ) { } } | assert scores != null && scores . length > 0 ; assert probability > 0 && probability < 1 ; int count = 0 ; int regionLen = 0 ; List < Range > ranges = new ArrayList < Range > ( ) ; for ( float score : scores ) { count ++ ; // Round to 2 decimal points before comparison
score = ( float ) ( Math . round ( score * 100.0 ) / 100.0 ) ; if ( score > probability ) { regionLen ++ ; } else { if ( regionLen > 0 ) { ranges . add ( new Range ( count - regionLen , count - 1 , score ) ) ; } regionLen = 0 ; } } // In case of the range to boundary runs to the very end of the sequence
if ( regionLen > 1 ) { ranges . add ( new Range ( count - regionLen + 1 , count , scores [ scores . length - 1 ] ) ) ; } return ranges . toArray ( new Range [ ranges . size ( ) ] ) ; |
public class HtmlTableRendererBase { /** * Renders the start of a new row of body content .
* @ param facesContext the < code > FacesContext < / code > .
* @ param writer the < code > ResponseWriter < / code > .
* @ param uiData the < code > UIData < / code > being rendered .
* @ throws IOException if an exceptoin occurs . */
protected void renderRowStart ( FacesContext facesContext , ResponseWriter writer , UIData uiData , Styles styles , int rowStyleIndex ) throws IOException { } } | writer . startElement ( HTML . TR_ELEM , null ) ; // uiData ) ;
renderRowStyle ( facesContext , writer , uiData , styles , rowStyleIndex ) ; Object rowId = uiData . getAttributes ( ) . get ( org . apache . myfaces . shared . renderkit . JSFAttr . ROW_ID ) ; if ( rowId != null ) { writer . writeAttribute ( HTML . ID_ATTR , rowId . toString ( ) , null ) ; } |
public class AnalyzerJobHelper { /** * Gets the " best candidate " analyzer job based on search criteria offered
* in parameters .
* @ param descriptorName
* @ param analyzerName
* @ param analyzerInputName
* @ return */
public AnalyzerJob getAnalyzerJob ( final String descriptorName , final String analyzerName , final String analyzerInputName ) { } } | List < AnalyzerJob > candidates = new ArrayList < > ( _jobs ) ; // filter analyzers of the corresponding type
candidates = CollectionUtils2 . refineCandidates ( candidates , o -> { final String actualDescriptorName = o . getDescriptor ( ) . getDisplayName ( ) ; return descriptorName . equals ( actualDescriptorName ) ; } ) ; if ( analyzerName != null ) { // filter analyzers with a particular name
candidates = CollectionUtils2 . refineCandidates ( candidates , o -> { final String actualAnalyzerName = o . getName ( ) ; return analyzerName . equals ( actualAnalyzerName ) ; } ) ; } if ( analyzerInputName != null ) { // filter analyzers with a particular input
candidates = CollectionUtils2 . refineCandidates ( candidates , o -> { final InputColumn < ? > inputColumn = getIdentifyingInputColumn ( o ) ; if ( inputColumn == null ) { return false ; } return analyzerInputName . equals ( inputColumn . getName ( ) ) ; } ) ; } if ( candidates . isEmpty ( ) ) { logger . error ( "No more AnalyzerJob candidates to choose from" ) ; return null ; } else if ( candidates . size ( ) > 1 ) { logger . warn ( "Multiple ({}) AnalyzerJob candidates to choose from, picking first" ) ; } return candidates . iterator ( ) . next ( ) ; |
public class SerializerMarshaller { /** * Marshall the given parameter object . */
public void marshall ( Serializer serializer , ProtocolMarshaller protocolMarshaller ) { } } | if ( serializer == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( serializer . getParquetSerDe ( ) , PARQUETSERDE_BINDING ) ; protocolMarshaller . marshall ( serializer . getOrcSerDe ( ) , ORCSERDE_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class DateTimeUtils { /** * Generates a DateTimeFormatter using a custom pattern with the default locale or a new one
* according to what language and country are provided as params .
* @ param format the pattern
* @ param lang the language
* @ param country the country
* @ return the DateTimeFormatter generated */
public static DateTimeFormatter getDateFormatter ( String format , String lang , String country ) { } } | if ( StringUtils . isNotBlank ( format ) ) { DateTimeFormatter dateFormat = DateTimeFormat . forPattern ( format ) ; if ( StringUtils . isNotBlank ( lang ) ) { return dateFormat . withLocale ( DateTimeUtils . getLocaleByCountry ( lang , country ) ) ; } return dateFormat ; } return formatWithDefault ( lang , country ) ; |
public class ModelFactory { /** * Constructor - method to use when services with inbound and outbound services
* @ param groupId
* @ param artifactId
* @ param version
* @ param service
* @ return the new model instance */
public static IModel newModel ( String groupId , String artifactId , String version , String service , MuleVersionEnum muleVersion , TransportEnum inboundTransport , TransportEnum outboundTransport , TransformerEnum transformerType ) { } } | return doCreateNewModel ( groupId , artifactId , version , service , muleVersion , null , null , inboundTransport , outboundTransport , transformerType , null , null ) ; |
public class FlashImpl { /** * Get the proper map according to the current phase :
* Normal case :
* - First request , restore view phase ( create a new one ) : render map n
* - First request , execute phase : Skipped
* - First request , render phase : render map n
* Render map n saved and put as execute map n
* - Second request , execute phase : execute map n
* - Second request , render phase : render map n + 1
* Post Redirect Get case : Redirect is triggered by a call to setRedirect ( true ) from NavigationHandler
* or earlier using c : set tag .
* - First request , restore view phase ( create a new one ) : render map n
* - First request , execute phase : Skipped
* - First request , render phase : render map n
* Render map n saved and put as execute map n
* POST
* - Second request , execute phase : execute map n
* Note that render map n + 1 is also created here to perform keep ( ) .
* REDIRECT
* - NavigationHandler do the redirect , requestMap data lost , called Flash . setRedirect ( true )
* Render map n + 1 saved and put as render map n + 1 on GET request .
* GET
* - Third request , restore view phase ( create a new one ) : render map n + 1 ( restorred )
* ( isRedirect ( ) should return true as javadoc says )
* - Third request , execute phase : skipped
* - Third request , render phase : render map n + 1
* In this way proper behavior is preserved even in the case of redirect , since the GET part is handled as
* the " render " part of the current traversal , keeping the semantic of flash object .
* @ return */
private Map < String , Object > _getActiveFlashMap ( ) { } } | FacesContext facesContext = FacesContext . getCurrentInstance ( ) ; if ( PhaseId . RENDER_RESPONSE . equals ( facesContext . getCurrentPhaseId ( ) ) || ! facesContext . isPostback ( ) ) { return _getRenderFlashMap ( facesContext ) ; } else { return _getExecuteFlashMap ( facesContext ) ; } |
public class JavaUtil { /** * Equals with null checking
* @ param a first argument
* @ param b second argument
* @ return is equals result */
public static < T > boolean equalsE ( T a , T b ) { } } | if ( a == null && b == null ) { return true ; } if ( a != null && b == null ) { return false ; } if ( a == null ) { return false ; } return a . equals ( b ) ; |
public class InsertToSeries { /** * Get body parameters
* @ return Values of body parameters ( name of parameter : value of the parameter ) */
@ Override public Map < String , Object > getBodyParameters ( ) { } } | HashMap < String , Object > params = new HashMap < String , Object > ( ) ; params . put ( "itemType" , this . itemType ) ; params . put ( "itemId" , this . itemId ) ; params . put ( "time" , this . time ) ; if ( this . cascadeCreate != null ) { params . put ( "cascadeCreate" , this . cascadeCreate ) ; } return params ; |
public class XmlBeanAssert { /** * Compares the attributes of the elements at the current position of two XmlCursors .
* The ordering of the attributes is ignored in the comparison . Fails the JUnit test
* case if the attributes or their values are different .
* @ param message to display on test failure ( may be null )
* @ param expected
* @ param actual */
private static void assertAttributesEqual ( String message , XmlCursor expected , XmlCursor actual ) { } } | Map < QName , String > map1 = new HashMap < QName , String > ( ) ; Map < QName , String > map2 = new HashMap < QName , String > ( ) ; boolean attr1 = expected . toFirstAttribute ( ) ; boolean attr2 = actual . toFirstAttribute ( ) ; if ( attr1 != attr2 ) { if ( expected . isAttr ( ) || actual . isAttr ( ) ) { expected . toParent ( ) ; } fail ( message , "Differing number of attributes for element: '" + QNameHelper . pretty ( expected . getName ( ) ) + "'" ) ; } else if ( ! attr1 ) { return ; } else { map1 . put ( expected . getName ( ) , expected . getTextValue ( ) ) ; map2 . put ( actual . getName ( ) , actual . getTextValue ( ) ) ; } while ( true ) { attr1 = expected . toNextAttribute ( ) ; attr2 = actual . toNextAttribute ( ) ; if ( attr1 != attr2 ) { if ( expected . isAttr ( ) || actual . isAttr ( ) ) { expected . toParent ( ) ; } fail ( message , "Differing number of attributes for element: '" + QNameHelper . pretty ( expected . getName ( ) ) + "'" ) ; } else if ( ! attr1 ) { break ; } else { map1 . put ( expected . getName ( ) , expected . getTextValue ( ) ) ; map2 . put ( actual . getName ( ) , actual . getTextValue ( ) ) ; } } expected . toParent ( ) ; actual . toParent ( ) ; // check that attribute maps match , neglecting order
Iterator < QName > iter = map1 . keySet ( ) . iterator ( ) ; while ( iter . hasNext ( ) ) { QName name = iter . next ( ) ; String value1 = map1 . get ( name ) ; String value2 = map2 . get ( name ) ; if ( value2 == null ) { fail ( message , "Expected attribute value missing for element: " + QNameHelper . pretty ( expected . getName ( ) ) + "--> '" + name + "'" ) ; } else if ( ! value2 . equals ( value1 ) ) { fail ( message , "Attribute values for element '" + QNameHelper . pretty ( expected . getName ( ) ) + "': Expected '" + value1 + "', Actual '" + value2 + "'" ) ; } } |
public class XMLUtils { /** * Look up namespace attribute declarations in the specified node and
* store them in a binding map , where the key is the namespace prefix and the value
* is the namespace uri .
* @ param referenceNode XML node to search for namespace declarations .
* @ return map containing namespace prefix - namespace url pairs . */
public static Map < String , String > lookupNamespaces ( Node referenceNode ) { } } | Map < String , String > namespaces = new HashMap < String , String > ( ) ; Node node ; if ( referenceNode . getNodeType ( ) == Node . DOCUMENT_NODE ) { node = referenceNode . getFirstChild ( ) ; } else { node = referenceNode ; } if ( node != null && node . hasAttributes ( ) ) { for ( int i = 0 ; i < node . getAttributes ( ) . getLength ( ) ; i ++ ) { Node attribute = node . getAttributes ( ) . item ( i ) ; if ( attribute . getNodeName ( ) . startsWith ( XMLConstants . XMLNS_ATTRIBUTE + ":" ) ) { namespaces . put ( attribute . getNodeName ( ) . substring ( ( XMLConstants . XMLNS_ATTRIBUTE + ":" ) . length ( ) ) , attribute . getNodeValue ( ) ) ; } else if ( attribute . getNodeName ( ) . startsWith ( XMLConstants . XMLNS_ATTRIBUTE ) ) { // default namespace
namespaces . put ( XMLConstants . DEFAULT_NS_PREFIX , attribute . getNodeValue ( ) ) ; } } } return namespaces ; |
public class JmxUtils { /** * Create a model mbean from an object using the description given in the
* Jmx annotation if present . Only operations are supported so far , no
* attributes , constructors , or notifications
* @ param o The object to create an MBean for
* @ return The ModelMBean for the given object */
public static ModelMBean createModelMBean ( Object o ) { } } | try { ModelMBean mbean = new RequiredModelMBean ( ) ; JmxManaged annotation = o . getClass ( ) . getAnnotation ( JmxManaged . class ) ; String description = annotation == null ? "" : annotation . description ( ) ; ModelMBeanInfo info = new ModelMBeanInfoSupport ( o . getClass ( ) . getName ( ) , description , extractAttributeInfo ( o ) , new ModelMBeanConstructorInfo [ 0 ] , extractOperationInfo ( o ) , new ModelMBeanNotificationInfo [ 0 ] ) ; mbean . setModelMBeanInfo ( info ) ; mbean . setManagedResource ( o , "ObjectReference" ) ; return mbean ; } catch ( MBeanException e ) { throw new VoldemortException ( e ) ; } catch ( InvalidTargetObjectTypeException e ) { throw new VoldemortException ( e ) ; } catch ( InstanceNotFoundException e ) { throw new VoldemortException ( e ) ; } |
public class Bot { /** * / * Type */
public static void type ( String text , WebElement webElement ) { } } | if ( text == null ) { return ; } webElement . sendKeys ( text ) ; |
public class MalmoEnv { /** * Convenience method to load a Malmo mission specification from an XML - file
* @ param filename name of XML file
* @ return Mission specification loaded from XML - file */
public static MissionSpec loadMissionXML ( String filename ) { } } | MissionSpec mission = null ; try { String xml = new String ( Files . readAllBytes ( Paths . get ( filename ) ) ) ; mission = new MissionSpec ( xml , true ) ; } catch ( Exception e ) { // e . printStackTrace ( ) ;
throw new RuntimeException ( e ) ; } return mission ; |
public class SessionApi { /** * Login to get private token . This functionality is not available on GitLab servers 10.2 and above .
* < pre > < code > GitLab Endpoint : POST / session < / code > < / pre >
* @ param username the username to login
* @ param email the email address to login
* @ param password the password of the user
* @ return a Session instance with info on the logged in user
* @ throws GitLabApiException if any exception occurs */
public Session login ( String username , String email , String password ) throws GitLabApiException { } } | if ( ( username == null || username . trim ( ) . length ( ) == 0 ) && ( email == null || email . trim ( ) . length ( ) == 0 ) ) { throw new IllegalArgumentException ( "both username and email cannot be empty or null" ) ; } Form formData = new Form ( ) ; addFormParam ( formData , "email" , email , false ) ; addFormParam ( formData , "password" , password , true ) ; addFormParam ( formData , "login" , username , false ) ; Response response = post ( Response . Status . CREATED , formData , "session" ) ; return ( response . readEntity ( Session . class ) ) ; |
public class AuthConfig { /** * Retrieves the resource id of the given Style index .
* @ param context a valid Context
* @ param index The index to search on the Style definition .
* @ return the id if found or - 1. */
int getIdForResource ( @ NonNull Context context , @ StyleableRes int index ) { } } | final int [ ] attrs = new int [ ] { index } ; final TypedArray typedArray = context . getTheme ( ) . obtainStyledAttributes ( styleRes , attrs ) ; int id = typedArray . getResourceId ( 0 , - 1 ) ; typedArray . recycle ( ) ; return id ; |
public class FieldUtils { /** * Returns a set of all fields matching the supplied filter
* declared in the target class or any of its super classes .
* @ param filter Filter to use .
* @ return All matching fields declared by the target class . */
public static Set < Field > getFields ( Class < ? > target , FieldFilter filter ) { } } | Class < ? > clazz = target ; Set < Field > fields = getDeclaredFields ( clazz , filter ) ; while ( ( clazz = clazz . getSuperclass ( ) ) != null ) { fields . addAll ( getDeclaredFields ( clazz , filter ) ) ; } return fields ; |
public class AbbreviationManager { /** * A get a java . nio . file . Path object from a file name .
* @ param fileName The file name
* @ return The Path object
* @ throws IOException
* @ throws URISyntaxException */
private Path getPath ( String fileName ) throws IOException , URISyntaxException { } } | Path path ; URL url = getClass ( ) . getClassLoader ( ) . getResource ( fileName ) ; if ( url == null ) { throw new IOException ( String . format ( "File %s is not existing" , fileName ) ) ; } URI uri = url . toURI ( ) ; Map < String , String > env = new HashMap < > ( ) ; if ( uri . toString ( ) . contains ( "!" ) ) { String [ ] parts = uri . toString ( ) . split ( "!" ) ; if ( fs == null ) { fs = FileSystems . newFileSystem ( URI . create ( parts [ 0 ] ) , env ) ; } path = fs . getPath ( parts [ 1 ] ) ; } else { path = Paths . get ( uri ) ; } return path ; |
public class AWSCognitoIdentityProviderClient { /** * Resends the confirmation ( for confirmation of registration ) to a specific user in the user pool .
* @ param resendConfirmationCodeRequest
* Represents the request to resend the confirmation code .
* @ return Result of the ResendConfirmationCode operation returned by the service .
* @ throws ResourceNotFoundException
* This exception is thrown when the Amazon Cognito service cannot find the requested resource .
* @ throws InvalidParameterException
* This exception is thrown when the Amazon Cognito service encounters an invalid parameter .
* @ throws UnexpectedLambdaException
* This exception is thrown when the Amazon Cognito service encounters an unexpected exception with the AWS
* Lambda service .
* @ throws UserLambdaValidationException
* This exception is thrown when the Amazon Cognito service encounters a user validation exception with the
* AWS Lambda service .
* @ throws NotAuthorizedException
* This exception is thrown when a user is not authorized .
* @ throws InvalidLambdaResponseException
* This exception is thrown when the Amazon Cognito service encounters an invalid AWS Lambda response .
* @ throws TooManyRequestsException
* This exception is thrown when the user has made too many requests for a given operation .
* @ throws LimitExceededException
* This exception is thrown when a user exceeds the limit for a requested AWS resource .
* @ throws InvalidSmsRoleAccessPolicyException
* This exception is returned when the role provided for SMS configuration does not have permission to
* publish using Amazon SNS .
* @ throws InvalidSmsRoleTrustRelationshipException
* This exception is thrown when the trust relationship is invalid for the role provided for SMS
* configuration . This can happen if you do not trust < b > cognito - idp . amazonaws . com < / b > or the external ID
* provided in the role does not match what is provided in the SMS configuration for the user pool .
* @ throws InvalidEmailRoleAccessPolicyException
* This exception is thrown when Amazon Cognito is not allowed to use your email identity . HTTP status code :
* 400.
* @ throws CodeDeliveryFailureException
* This exception is thrown when a verification code fails to deliver successfully .
* @ throws UserNotFoundException
* This exception is thrown when a user is not found .
* @ throws InternalErrorException
* This exception is thrown when Amazon Cognito encounters an internal error .
* @ sample AWSCognitoIdentityProvider . ResendConfirmationCode
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / cognito - idp - 2016-04-18 / ResendConfirmationCode "
* target = " _ top " > AWS API Documentation < / a > */
@ Override public ResendConfirmationCodeResult resendConfirmationCode ( ResendConfirmationCodeRequest request ) { } } | request = beforeClientExecution ( request ) ; return executeResendConfirmationCode ( request ) ; |
public class GetAccountSummaryResult { /** * A set of key – value pairs containing information about IAM entity usage and IAM quotas .
* @ param summaryMap
* A set of key – value pairs containing information about IAM entity usage and IAM quotas .
* @ return Returns a reference to this object so that method calls can be chained together . */
public GetAccountSummaryResult withSummaryMap ( java . util . Map < String , Integer > summaryMap ) { } } | setSummaryMap ( summaryMap ) ; return this ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.