signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class AuthorizationEndpoint { /** * We can grant a token and return it with implicit approval . */ private ModelAndView getImplicitGrantResponse ( AuthorizationRequest authorizationRequest ) { } }
try { TokenRequest tokenRequest = getOAuth2RequestFactory ( ) . createTokenRequest ( authorizationRequest , "implicit" ) ; OAuth2Request storedOAuth2Request = getOAuth2RequestFactory ( ) . createOAuth2Request ( authorizationRequest ) ; OAuth2AccessToken accessToken = getAccessTokenForImplicitGrant ( tokenRequest , storedOAuth2Request ) ; if ( accessToken == null ) { throw new UnsupportedResponseTypeException ( "Unsupported response type: token" ) ; } return new ModelAndView ( new RedirectView ( appendAccessToken ( authorizationRequest , accessToken ) , false , true , false ) ) ; } catch ( OAuth2Exception e ) { return new ModelAndView ( new RedirectView ( getUnsuccessfulRedirect ( authorizationRequest , e , true ) , false , true , false ) ) ; }
public class ClassFile { /** * Returns all the methods defined in this class , not including * constructors and static initializers . */ public MethodInfo [ ] getMethods ( ) { } }
int size = mMethods . size ( ) ; List < MethodInfo > methodsOnly = new ArrayList < MethodInfo > ( size ) ; for ( int i = 0 ; i < size ; i ++ ) { MethodInfo method = mMethods . get ( i ) ; String name = method . getName ( ) ; if ( ! "<init>" . equals ( name ) && ! "<clinit>" . equals ( name ) ) { methodsOnly . add ( method ) ; } } MethodInfo [ ] methodsArray = new MethodInfo [ methodsOnly . size ( ) ] ; return methodsOnly . toArray ( methodsArray ) ;
public class CPOptionCategoryPersistenceImpl { /** * Returns the cp option category with the primary key or returns < code > null < / code > if it could not be found . * @ param primaryKey the primary key of the cp option category * @ return the cp option category , or < code > null < / code > if a cp option category with the primary key could not be found */ @ Override public CPOptionCategory fetchByPrimaryKey ( Serializable primaryKey ) { } }
Serializable serializable = entityCache . getResult ( CPOptionCategoryModelImpl . ENTITY_CACHE_ENABLED , CPOptionCategoryImpl . class , primaryKey ) ; if ( serializable == nullModel ) { return null ; } CPOptionCategory cpOptionCategory = ( CPOptionCategory ) serializable ; if ( cpOptionCategory == null ) { Session session = null ; try { session = openSession ( ) ; cpOptionCategory = ( CPOptionCategory ) session . get ( CPOptionCategoryImpl . class , primaryKey ) ; if ( cpOptionCategory != null ) { cacheResult ( cpOptionCategory ) ; } else { entityCache . putResult ( CPOptionCategoryModelImpl . ENTITY_CACHE_ENABLED , CPOptionCategoryImpl . class , primaryKey , nullModel ) ; } } catch ( Exception e ) { entityCache . removeResult ( CPOptionCategoryModelImpl . ENTITY_CACHE_ENABLED , CPOptionCategoryImpl . class , primaryKey ) ; throw processException ( e ) ; } finally { closeSession ( session ) ; } } return cpOptionCategory ;
public class IdentityChecker { /** * Method that sets the identity of the certificate path . Also checks if * limited proxy is acceptable . * @ throws CertPathValidatorException If limited proxies are not accepted * and the chain has a limited proxy . */ public void invoke ( X509Certificate cert , GSIConstants . CertificateType certType ) throws CertPathValidatorException { } }
if ( proxyCertValidator . getIdentityCertificate ( ) == null ) { // check if limited if ( ProxyCertificateUtil . isLimitedProxy ( certType ) ) { proxyCertValidator . setLimited ( true ) ; if ( proxyCertValidator . isRejectLimitedProxy ( ) ) { throw new CertPathValidatorException ( "Limited proxy not accepted" ) ; } } // set the identity cert if ( ! ProxyCertificateUtil . isImpersonationProxy ( certType ) ) { proxyCertValidator . setIdentityCert ( cert ) ; } }
public class AsyncFileLogger { /** * - - - ADD TO QUEUE - - - */ @ Override public void publish ( LogRecord record ) { } }
if ( ! isLoggable ( record ) ) { return ; } synchronized ( messages ) { messages . addLast ( record ) ; messages . notifyAll ( ) ; }
public class JsonByteBufferReader { /** * 读取一个int值 * @ return int值 */ @ Override public final int readInt ( ) { } }
char firstchar = nextGoodChar ( ) ; boolean quote = false ; if ( firstchar == '"' || firstchar == '\'' ) { quote = true ; firstchar = nextGoodChar ( ) ; if ( firstchar == '"' || firstchar == '\'' ) return 0 ; } int value = 0 ; final boolean negative = firstchar == '-' ; if ( ! negative ) { if ( firstchar < '0' || firstchar > '9' ) throw new ConvertException ( "illegal escape(" + firstchar + ") (position = " + position + ")" ) ; value = firstchar - '0' ; } for ( ; ; ) { char ch = nextChar ( ) ; if ( ch == 0 ) break ; if ( ch >= '0' && ch <= '9' ) { value = ( value << 3 ) + ( value << 1 ) + ( ch - '0' ) ; } else if ( ch == '"' || ch == '\'' ) { } else if ( quote && ch <= ' ' ) { } else if ( ch == ',' || ch == '}' || ch == ']' || ch <= ' ' || ch == ':' ) { backChar ( ch ) ; break ; } else { throw new ConvertException ( "illegal escape(" + ch + ") (position = " + position + ")" ) ; } } return negative ? - value : value ;
public class OrmLiteConfigUtil { /** * Write a configuration file to an output stream with the configuration for classes . * @ param sortClasses * Set to true to sort the classes and fields by name before the file is generated . */ public static void writeConfigFile ( OutputStream outputStream , Class < ? > [ ] classes , boolean sortClasses ) throws SQLException , IOException { } }
if ( sortClasses ) { // sort our class list to make the output more deterministic Class < ? > [ ] sortedClasses = new Class < ? > [ classes . length ] ; System . arraycopy ( classes , 0 , sortedClasses , 0 , classes . length ) ; Arrays . sort ( sortedClasses , classComparator ) ; classes = sortedClasses ; } BufferedWriter writer = new BufferedWriter ( new OutputStreamWriter ( outputStream ) , 4096 ) ; try { writeHeader ( writer ) ; for ( Class < ? > clazz : classes ) { writeConfigForTable ( writer , clazz , sortClasses ) ; } // NOTE : done is here because this is public System . out . println ( "Done." ) ; } finally { writer . close ( ) ; }
public class GetRegexMatchSetRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( GetRegexMatchSetRequest getRegexMatchSetRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( getRegexMatchSetRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( getRegexMatchSetRequest . getRegexMatchSetId ( ) , REGEXMATCHSETID_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class ProblemSummaryService { /** * Gets lists of { @ link ProblemSummary } objects organized by { @ link IssueCategoryModel } . */ public static Map < IssueCategoryModel , List < ProblemSummary > > getProblemSummaries ( GraphContext graphContext , Set < ProjectModel > projectModels , Set < String > includeTags , Set < String > excludeTags , boolean strictComparison , boolean strictExclude ) { } }
// The key is the severity as a String Map < IssueCategoryModel , List < ProblemSummary > > results = new TreeMap < > ( new IssueCategoryModel . IssueSummaryPriorityComparator ( ) ) ; Map < RuleSummaryKey , ProblemSummary > ruleToSummary = new HashMap < > ( ) ; InlineHintService hintService = new InlineHintService ( graphContext ) ; final Iterable < InlineHintModel > hints = projectModels == null ? hintService . findAll ( ) : hintService . getHintsForProjects ( new ArrayList < > ( projectModels ) ) ; for ( InlineHintModel hint : hints ) { if ( hint . getIssueDisplayMode ( ) == IssueDisplayMode . DETAIL_ONLY ) continue ; Set < String > tags = hint . getTags ( ) ; boolean hasTagMatch ; if ( strictComparison ) { hasTagMatch = TagUtil . strictCheckMatchingTags ( tags , includeTags , excludeTags ) ; } else { hasTagMatch = TagUtil . checkMatchingTags ( tags , includeTags , excludeTags , strictExclude ) ; } if ( ! hasTagMatch ) { continue ; } RuleSummaryKey key = new RuleSummaryKey ( hint . getEffort ( ) , hint . getRuleID ( ) , hint . getTitle ( ) ) ; ProblemSummary summary = ruleToSummary . get ( key ) ; if ( summary == null ) { summary = new ProblemSummary ( UUID . randomUUID ( ) . toString ( ) , hint . getIssueCategory ( ) , hint . getRuleID ( ) , hint . getTitle ( ) , 1 , hint . getEffort ( ) ) ; for ( LinkModel link : hint . getLinks ( ) ) { summary . addLink ( link . getDescription ( ) , link . getLink ( ) ) ; } ruleToSummary . put ( key , summary ) ; addToResults ( results , summary ) ; } else { summary . setNumberFound ( summary . getNumberFound ( ) + 1 ) ; } summary . addFile ( hint . getHint ( ) , hint . getFile ( ) ) ; } ClassificationService classificationService = new ClassificationService ( graphContext ) ; for ( ClassificationModel classification : classificationService . findAll ( ) ) { if ( classification . getIssueDisplayMode ( ) == IssueDisplayMode . DETAIL_ONLY ) continue ; Set < String > tags = classification . getTags ( ) ; if ( ! TagUtil . checkMatchingTags ( tags , includeTags , excludeTags , false ) ) continue ; List < FileModel > newFileModels = new ArrayList < > ( ) ; for ( FileModel file : classification . getFileModels ( ) ) { if ( projectModels != null ) { // make sure this one is in the project if ( ! projectModels . contains ( file . getProjectModel ( ) ) ) continue ; } newFileModels . add ( file ) ; } if ( newFileModels . isEmpty ( ) ) continue ; RuleSummaryKey key = new RuleSummaryKey ( classification . getEffort ( ) , classification . getRuleID ( ) , classification . getClassification ( ) ) ; ProblemSummary summary = ruleToSummary . get ( key ) ; if ( summary == null ) { summary = new ProblemSummary ( UUID . randomUUID ( ) . toString ( ) , classification . getIssueCategory ( ) , classification . getRuleID ( ) , classification . getClassification ( ) , 0 , classification . getEffort ( ) ) ; for ( LinkModel link : classification . getLinks ( ) ) { summary . addLink ( link . getDescription ( ) , link . getLink ( ) ) ; } ruleToSummary . put ( key , summary ) ; addToResults ( results , summary ) ; } for ( FileModel file : newFileModels ) summary . addFile ( classification . getDescription ( ) , file ) ; summary . setNumberFound ( summary . getNumberFound ( ) + newFileModels . size ( ) ) ; } return results ;
public class RasterData { /** * Load raster data from node . * @ param root The raster node . * @ param color The raster color name . * @ return The raster data . */ public static RasterData load ( Xml root , String color ) { } }
final Xml node = root . getChild ( color ) ; final double force = node . readDouble ( ATT_FORCE ) ; final int amplitude = node . readInteger ( ATT_AMPLITUDE ) ; final int offset = node . readInteger ( ATT_OFFSET ) ; final int type = node . readInteger ( ATT_TYPE ) ; return new RasterData ( force , amplitude , offset , type ) ;
public class ElementsExceptionsFactory { /** * Constructs and initializes a new { @ link AssertionException } with the given { @ link Throwable cause } * and { @ link String message } formatted with the given { @ link Object [ ] arguments } . * @ param cause { @ link Throwable } identified as the reason this { @ link AssertionException } was thrown . * @ param message { @ link String } describing the { @ link AssertionException exception } . * @ param args { @ link Object [ ] arguments } used to replace format placeholders in the { @ link String message } . * @ return a new { @ link AssertionException } with the given { @ link Throwable cause } and { @ link String message } . * @ see org . cp . elements . lang . AssertionException */ public static AssertionException newAssertionException ( Throwable cause , String message , Object ... args ) { } }
return new AssertionException ( format ( message , args ) , cause ) ;
public class JDBCStateRepository { /** * Method for creating / migrating the database schema */ protected void migrateSchema ( ) { } }
try { Connection connection = dataSource . getConnection ( ) ; try { beforeSchemaMigration ( connection ) ; SchemaUpdater updater = new SchemaUpdater ( connection , tableName , serializer ) ; if ( ! updater . doesTableExist ( ) ) { updater . migrateToVersion1 ( ) ; } if ( updater . isSchemaVersion1 ( ) ) { updater . migrateToVersion2 ( ) ; } afterSchemaMigration ( connection ) ; } finally { DbUtils . closeQuietly ( connection ) ; } } catch ( SQLException e ) { throw new IllegalStateException ( "Failed to migrate the database schema" , e ) ; }
public class Environment { /** * Map to Environment * @ param map config map * @ return return Environment instance */ public static Environment of ( @ NonNull Map < String , String > map ) { } }
var environment = new Environment ( ) ; map . forEach ( ( key , value ) -> environment . props . setProperty ( key , value ) ) ; return environment ;
public class dnspolicylabel_stats { /** * Use this API to fetch the statistics of all dnspolicylabel _ stats resources that are configured on netscaler . */ public static dnspolicylabel_stats [ ] get ( nitro_service service , options option ) throws Exception { } }
dnspolicylabel_stats obj = new dnspolicylabel_stats ( ) ; dnspolicylabel_stats [ ] response = ( dnspolicylabel_stats [ ] ) obj . stat_resources ( service , option ) ; return response ;
public class ProvidersInner { /** * Get available application frameworks and their versions . * Get available application frameworks and their versions . * @ param nextPageLink The NextLink from the previous successful call to List operation . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the PagedList & lt ; ApplicationStackInner & gt ; object */ public Observable < Page < ApplicationStackInner > > getAvailableStacksNextAsync ( final String nextPageLink ) { } }
return getAvailableStacksNextWithServiceResponseAsync ( nextPageLink ) . map ( new Func1 < ServiceResponse < Page < ApplicationStackInner > > , Page < ApplicationStackInner > > ( ) { @ Override public Page < ApplicationStackInner > call ( ServiceResponse < Page < ApplicationStackInner > > response ) { return response . body ( ) ; } } ) ;
public class AdminunitSecondlineBuilder { /** * { @ inheritDoc } */ @ Override public AdminunitSecondline buildObject ( String namespaceURI , String localName , String namespacePrefix ) { } }
return new AdminunitSecondlineImpl ( namespaceURI , localName , namespacePrefix ) ;
public class Counters { /** * PriorityQueue */ public static < E > String toBiggestValuesFirstString ( Counter < E > c , int k ) { } }
PriorityQueue < E > pq = toPriorityQueue ( c ) ; PriorityQueue < E > largestK = new BinaryHeapPriorityQueue < E > ( ) ; // TODO : Is there any reason the original ( commented out ) line is better // than the one replacing it ? // while ( largestK . size ( ) < k & & ( ( Iterator < E > ) pq ) . hasNext ( ) ) { while ( largestK . size ( ) < k && ! pq . isEmpty ( ) ) { double firstScore = pq . getPriority ( pq . getFirst ( ) ) ; E first = pq . removeFirst ( ) ; largestK . changePriority ( first , firstScore ) ; } return largestK . toString ( ) ;
public class NodeOutput { /** * < code > optional . tensorflow . TensorDescription tensor _ description = 3 ; < / code > */ public org . tensorflow . framework . TensorDescription getTensorDescription ( ) { } }
return tensorDescription_ == null ? org . tensorflow . framework . TensorDescription . getDefaultInstance ( ) : tensorDescription_ ;
public class Binder { /** * Apply the chain of transforms and bind them to an object field retrieval specified * using the end signature plus the given class and name . The field must * match the end signature ' s return value and the end signature must take * the target class or a subclass as its only argument . * If the final handle ' s type does not exactly match the initial type for * this Binder , an additional cast will be attempted . * This version is " quiet " in that it throws an unchecked InvalidTransformException * if the target method does not exist or is inaccessible . * @ param lookup the MethodHandles . Lookup to use to look up the field * @ param name the field ' s name * @ return the full handle chain , bound to the given field access */ public MethodHandle getFieldQuiet ( MethodHandles . Lookup lookup , String name ) { } }
try { return getField ( lookup , name ) ; } catch ( IllegalAccessException | NoSuchFieldException e ) { throw new InvalidTransformException ( e ) ; }
public class Table { /** * Returns a table with n by m + 1 cells . The first column contains labels , the other cells contains the proportion * for a unique combination of values from the two specified columns in this table */ public Table xTabTablePercents ( String column1Name , String column2Name ) { } }
return CrossTab . tablePercents ( this , column1Name , column2Name ) ;
public class Token { /** * Determines if this token was triggered by one of the given triggers . * @ param triggers a list of possible triggers to compare to * @ return < tt > true < / tt > if this token was triggered by one of the given triggers , < tt > false < / tt > otherwise */ @ SuppressWarnings ( "squid:S1698" ) public boolean wasTriggeredBy ( String ... triggers ) { } }
if ( triggers . length == 0 ) { return false ; } for ( String aTrigger : triggers ) { if ( aTrigger != null && aTrigger . intern ( ) == getTrigger ( ) ) { return true ; } } return false ;
public class PackageManagerUtils { /** * Checks if the device has a NFC that can emulate host card . * @ param context the context . * @ return { @ code true } if the device has a NFC that can emulate host card . */ @ TargetApi ( Build . VERSION_CODES . KITKAT ) public static boolean hasHostCardEmulationNfcFeature ( Context context ) { } }
return hasHostCardEmulationNfcFeature ( context . getPackageManager ( ) ) ;
public class Paginator { /** * Search for objects with a partial response . * A convenience method that allows the client code to specify the value of * { @ link GenomicsRequest # setFields } using a { @ link GenomicsRequestInitializer } . * @ param request The search request . * @ param fields The fields to set . * @ return the stream of search results . */ public final Iterable < ItemT > search ( final RequestT request , final String fields ) { } }
return search ( request , setFieldsInitializer ( fields ) , RetryPolicy . defaultPolicy ( ) ) ;
public class SummernotePasteEvent { /** * Fires a summernote paste event on all registered handlers in the handler * manager . If no such handlers exist , this method will do nothing . * @ param source the source of the handlers */ public static void fire ( final HasSummernotePasteHandlers source ) { } }
if ( TYPE != null ) { SummernotePasteEvent event = new SummernotePasteEvent ( ) ; source . fireEvent ( event ) ; }
public class XStreamConverters { /** * Method used to register all the XStream converters scanned to a XStream instance * @ param xstream */ public void registerComponents ( XStream xstream ) { } }
for ( Converter converter : converters ) { xstream . registerConverter ( converter ) ; logger . debug ( "registered Xstream converter for {}" , converter . getClass ( ) . getName ( ) ) ; } for ( SingleValueConverter converter : singleValueConverters ) { xstream . registerConverter ( converter ) ; logger . debug ( "registered Xstream converter for {}" , converter . getClass ( ) . getName ( ) ) ; }
public class AnnotationModel { /** * Initializes the type */ protected void initType ( EnhancedAnnotation < T > annotatedAnnotation ) { } }
if ( ! Annotation . class . isAssignableFrom ( getRawType ( ) ) ) { throw MetadataLogger . LOG . metaAnnotationOnWrongType ( getMetaAnnotationTypes ( ) , getRawType ( ) ) ; }
public class ArithmeticUtils { /** * Compare two numbers */ public static Boolean greaterThan ( Number n1 , Number n2 ) { } }
Class < ? > type = getComputationType ( n1 , n2 ) ; Number val1 = convertTo ( n1 , type ) ; Number val2 = convertTo ( n2 , type ) ; if ( type == Long . class ) return val1 . longValue ( ) > val2 . longValue ( ) ? Boolean . TRUE : Boolean . FALSE ; return val1 . doubleValue ( ) > val2 . doubleValue ( ) ? Boolean . TRUE : Boolean . FALSE ;
public class CatalogSizing { /** * Produce a sizing of all significant database objects . * @ param dbCatalog database catalog * @ param isXDCR Is XDCR enabled * @ return database size result object tree */ public static DatabaseSizes getCatalogSizes ( Database dbCatalog , boolean isXDCR ) { } }
DatabaseSizes dbSizes = new DatabaseSizes ( ) ; for ( Table table : dbCatalog . getTables ( ) ) { dbSizes . addTable ( getTableSize ( table , isXDCR ) ) ; } return dbSizes ;
public class WXBizMsgCrypt { /** * 对明文进行加密 . * @ param text 需要加密的明文 * @ return 加密后base64编码的字符串 * @ throws AesException aes加密失败 */ String encrypt ( String randomStr , String text ) throws AesException { } }
ByteGroup byteCollector = new ByteGroup ( ) ; byte [ ] randomStrBytes = randomStr . getBytes ( CHARSET ) ; byte [ ] textBytes = text . getBytes ( CHARSET ) ; byte [ ] networkBytesOrder = getNetworkBytesOrder ( textBytes . length ) ; byte [ ] appidBytes = appId . getBytes ( CHARSET ) ; // randomStr + networkBytesOrder + text + appid byteCollector . addBytes ( randomStrBytes ) ; byteCollector . addBytes ( networkBytesOrder ) ; byteCollector . addBytes ( textBytes ) ; byteCollector . addBytes ( appidBytes ) ; // . . . + pad : 使用自定义的填充方式对明文进行补位填充 byte [ ] padBytes = PKCS7Encoder . encode ( byteCollector . size ( ) ) ; byteCollector . addBytes ( padBytes ) ; // 获得最终的字节流 , 未加密 byte [ ] unencrypted = byteCollector . toBytes ( ) ; try { // 设置加密模式为AES的CBC模式 Cipher cipher = Cipher . getInstance ( "AES/CBC/NoPadding" ) ; SecretKeySpec keySpec = new SecretKeySpec ( aesKey , "AES" ) ; IvParameterSpec iv = new IvParameterSpec ( aesKey , 0 , 16 ) ; cipher . init ( Cipher . ENCRYPT_MODE , keySpec , iv ) ; // 加密 byte [ ] encrypted = cipher . doFinal ( unencrypted ) ; // 使用BASE64对加密后的字符串进行编码 String base64Encrypted = base64 . encodeToString ( encrypted ) ; return base64Encrypted ; } catch ( Exception e ) { e . printStackTrace ( ) ; throw new AesException ( AesException . EncryptAESError ) ; }
public class ColumnText { /** * Replaces the current text array with this < CODE > Phrase < / CODE > . * Anything added previously with addElement ( ) is lost . * @ param phrase the text */ public void setText ( Phrase phrase ) { } }
bidiLine = null ; composite = false ; compositeColumn = null ; compositeElements = null ; listIdx = 0 ; splittedRow = false ; waitPhrase = phrase ;
public class PreferencesFxModel { /** * Unregisters a previously registered event handler . One handler might have been registered for * different event types , so the caller needs to specify the particular event type from which to * unregister the handler . * @ param eventType the event type from which to unregister * @ param eventHandler the handler to unregister * @ throws NullPointerException if the event type or handler is null */ public void removeEventHandler ( EventType < PreferencesFxEvent > eventType , EventHandler < ? super PreferencesFxEvent > eventHandler ) { } }
if ( eventType == null ) { throw new NullPointerException ( "Argument eventType must not be null" ) ; } if ( eventHandler == null ) { throw new NullPointerException ( "Argument eventHandler must not be null" ) ; } List < EventHandler < ? super PreferencesFxEvent > > list = this . eventHandlers . get ( eventType ) ; if ( list != null ) { list . remove ( eventHandler ) ; }
public class GZIPOutputStream { /** * Writes array of bytes to the compressed output stream . This method * will block until all the bytes are written . * @ param buf the data to be written * @ param off the start offset of the data * @ param len the length of the data * @ exception IOException If an I / O error has occurred . */ public synchronized void write ( byte [ ] buf , int off , int len ) throws IOException { } }
super . write ( buf , off , len ) ; crc . update ( buf , off , len ) ;
public class JmxUtils { /** * Returns the object name for the Jawr MBean * @ param contextPath * the context path * @ param objectType * the type of the MBean object * @ param mBeanPrefix * the MBean prefix * @ param resourceType * the resource type * @ return the object name for the Jawr MBean * @ throws Exception * if an exception occurs */ private static ObjectName getMBeanObjectName ( final String contextPath , final String objectType , final String mBeanPrefix , final String resourceType ) { } }
String curCtxPath = contextPath ; if ( StringUtils . isEmpty ( curCtxPath ) ) { curCtxPath = ServletContextUtils . getContextPath ( null ) ; } if ( curCtxPath . charAt ( 0 ) == ( '/' ) ) { curCtxPath = curCtxPath . substring ( 1 ) ; } String prefix = mBeanPrefix ; if ( prefix == null ) { prefix = DEFAULT_PREFIX ; } StringBuilder objectNameStr = new StringBuilder ( "net.jawr.web.jmx:type=" + objectType + ",prefix=" + prefix + ",webappContext=" + curCtxPath ) ; if ( resourceType != null ) { objectNameStr . append ( ",name=" ) . append ( resourceType ) . append ( "MBean" ) ; } return getObjectName ( objectNameStr . toString ( ) ) ;
public class CPDefinitionInventoryPersistenceImpl { /** * Clears the cache for the cp definition inventory . * The { @ link EntityCache } and { @ link FinderCache } are both cleared by this method . */ @ Override public void clearCache ( CPDefinitionInventory cpDefinitionInventory ) { } }
entityCache . removeResult ( CPDefinitionInventoryModelImpl . ENTITY_CACHE_ENABLED , CPDefinitionInventoryImpl . class , cpDefinitionInventory . getPrimaryKey ( ) ) ; finderCache . clearCache ( FINDER_CLASS_NAME_LIST_WITH_PAGINATION ) ; finderCache . clearCache ( FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION ) ; clearUniqueFindersCache ( ( CPDefinitionInventoryModelImpl ) cpDefinitionInventory , true ) ;
public class PackageServlet { /** * setup of the servlet operation set for this servlet instance */ @ Override public void init ( ) throws ServletException { } }
super . init ( ) ; // GET operations . setOperation ( ServletOperationSet . Method . GET , Extension . json , Operation . list , new ListOperation ( ) ) ; operations . setOperation ( ServletOperationSet . Method . GET , Extension . json , Operation . tree , new TreeOperation ( ) ) ; operations . setOperation ( ServletOperationSet . Method . GET , Extension . json , Operation . query , new QueryOperation ( ) ) ; operations . setOperation ( ServletOperationSet . Method . GET , Extension . json , Operation . filterList , new ListFiltersOperation ( ) ) ; operations . setOperation ( ServletOperationSet . Method . GET , Extension . json , Operation . coverage , new CoverageOperation ( ) ) ; operations . setOperation ( ServletOperationSet . Method . GET , Extension . zip , Operation . download , new DownloadOperation ( ) ) ; operations . setOperation ( ServletOperationSet . Method . GET , Extension . html , Operation . download , new DownloadOperation ( ) ) ; // POST operations . setOperation ( ServletOperationSet . Method . POST , Extension . html , Operation . service , new ServiceOperation ( ) ) ; operations . setOperation ( ServletOperationSet . Method . POST , Extension . json , Operation . create , new CreateOperation ( ) ) ; operations . setOperation ( ServletOperationSet . Method . POST , Extension . json , Operation . update , new UpdateOperation ( ) ) ; operations . setOperation ( ServletOperationSet . Method . POST , Extension . json , Operation . upload , new UploadOperation ( ) ) ; operations . setOperation ( ServletOperationSet . Method . POST , Extension . json , Operation . install , new InstallOperation ( ) ) ; operations . setOperation ( ServletOperationSet . Method . POST , Extension . json , Operation . uninstall , new UninstallOperation ( ) ) ; operations . setOperation ( ServletOperationSet . Method . POST , Extension . json , Operation . deploy , new ServiceOperation ( ) ) ; operations . setOperation ( ServletOperationSet . Method . POST , Extension . html , Operation . filterChange , new ChangeFilterOperation ( ) ) ; operations . setOperation ( ServletOperationSet . Method . POST , Extension . html , Operation . filterAdd , new AddFilterOperation ( ) ) ; operations . setOperation ( ServletOperationSet . Method . POST , Extension . html , Operation . filterRemove , new RemoveFilterOperation ( ) ) ; operations . setOperation ( ServletOperationSet . Method . POST , Extension . html , Operation . filterMoveUp , new MoveFilterOperation ( true ) ) ; operations . setOperation ( ServletOperationSet . Method . POST , Extension . html , Operation . filterMoveDown , new MoveFilterOperation ( false ) ) ; // PUT operations . setOperation ( ServletOperationSet . Method . PUT , Extension . json , Operation . update , new JsonUpdateOperation ( ) ) ; // DELETE operations . setOperation ( ServletOperationSet . Method . DELETE , Extension . json , Operation . delete , new DeleteOperation ( ) ) ;
public class Resolver { /** * Resolve edge based on a subject { @ link KamNode } , * { @ link RelationshipType } , and an object { @ link KamNode } . * @ param kam { @ link Kam } , the kam to resolve into * @ param subjectKamNode { @ link KamNode } , the subject kam node * @ param rtype { @ link RelationshipType } , the relationship type * @ param objectKamNode { @ link KamNode } , the object kam node * @ return the resolved { @ link KamEdge } , or null if it does not exist in * the { @ link Kam } */ private KamEdge resolveEdge ( final Kam kam , final KamNode subjectKamNode , final RelationshipType rtype , final KamNode objectKamNode ) { } }
final KamEdge resolvedEdge = kam . findEdge ( subjectKamNode , rtype , objectKamNode ) ; return resolvedEdge ;
public class CommonOps_ZDRM { /** * Performs the following operation : < br > * < br > * c = & alpha ; * a * b < sup > H < / sup > < br > * c < sub > ij < / sub > = & alpha ; & sum ; < sub > k = 1 : n < / sub > { a < sub > ik < / sub > * b < sub > jk < / sub > } * @ param realAlpha Real component of scaling factor . * @ param imagAlpha Imaginary component of scaling factor . * @ param a The left matrix in the multiplication operation . Not modified . * @ param b The right matrix in the multiplication operation . Not modified . * @ param c Where the results of the operation are stored . Modified . */ public static void multTransB ( double realAlpha , double imagAlpha , ZMatrixRMaj a , ZMatrixRMaj b , ZMatrixRMaj c ) { } }
// TODO add a matrix vectory multiply here MatrixMatrixMult_ZDRM . multTransB ( realAlpha , imagAlpha , a , b , c ) ;
public class BeanDefinitionUtils { /** * Creates a bean definition for the specified bean name . If the parent context of the current context contains a * bean definition with the same name , the definition is created as a bean copy of the parent definition . This * method is useful for config parsers that want to create a bean definition from configuration but also want to * retain the default properties of the original bean . * @ param applicationContext the current application context * @ param beanName * @ return the bean definition */ public static BeanDefinition createBeanDefinitionFromOriginal ( ApplicationContext applicationContext , String beanName ) { } }
ApplicationContext parentContext = applicationContext . getParent ( ) ; BeanDefinition parentDefinition = null ; if ( parentContext != null && parentContext . getAutowireCapableBeanFactory ( ) instanceof ConfigurableListableBeanFactory ) { ConfigurableListableBeanFactory parentBeanFactory = ( ConfigurableListableBeanFactory ) parentContext . getAutowireCapableBeanFactory ( ) ; try { parentDefinition = parentBeanFactory . getBeanDefinition ( beanName ) ; } catch ( NoSuchBeanDefinitionException e ) { } } if ( parentDefinition != null ) { return new GenericBeanDefinition ( parentDefinition ) ; } else { return new GenericBeanDefinition ( ) ; }
public class AbstractTagger { /** * 序列标注方法 , 输入输出为文件 * @ param input 输入文件 UTF8编码 * @ param output 输出文件 UTF8编码 */ public void tagFile ( String input , String output , String sep ) { } }
String s = tagFile ( input , "\n" ) ; try { OutputStreamWriter writer = new OutputStreamWriter ( new FileOutputStream ( output ) , "utf-8" ) ; BufferedWriter bw = new BufferedWriter ( writer ) ; bw . write ( s ) ; bw . close ( ) ; } catch ( Exception e ) { System . out . println ( "写输出文件错误" ) ; e . printStackTrace ( ) ; }
public class FineUploader5Blobs { /** * The default name to be used for nameless Blobs . * @ param sDefaultName * New value . May neither be < code > null < / code > nor empty . * @ return this for chaining */ @ Nonnull public FineUploader5Blobs setDefaultName ( @ Nonnull @ Nonempty final String sDefaultName ) { } }
ValueEnforcer . notEmpty ( sDefaultName , "DefaultName" ) ; m_sBlobsDefaultName = sDefaultName ; return this ;
public class JKXmlHandler { public < T > T parse ( InputStream in , Class < ? > ... clas ) { } }
try { JAXBContext jaxbContext = JAXBContext . newInstance ( clas ) ; Unmarshaller jaxbUnmarshaller = jaxbContext . createUnmarshaller ( ) ; T t = ( T ) jaxbUnmarshaller . unmarshal ( in ) ; return t ; } catch ( JAXBException e ) { throw new JKException ( e ) ; }
public class JSONWriter { /** * Append a number value * @ param number * @ return */ public JSONWriter value ( Number number ) { } }
return number != null ? append ( number . toString ( ) ) : valueNull ( ) ;
public class CmsUgcSession { /** * Loads the existing edit resource . < p > * @ param fileName the resource file name * @ return the edit resource * @ throws CmsUgcException if reading the resource fails */ public CmsResource loadXmlContent ( String fileName ) throws CmsUgcException { } }
checkNotFinished ( ) ; checkEditResourceNotSet ( ) ; if ( fileName . contains ( "/" ) ) { String message = Messages . get ( ) . container ( Messages . ERR_INVALID_FILE_NAME_TO_LOAD_1 , fileName ) . key ( getCmsObject ( ) . getRequestContext ( ) . getLocale ( ) ) ; throw new CmsUgcException ( CmsUgcConstants . ErrorCode . errMisc , message ) ; } try { String contentSitePath = m_cms . getRequestContext ( ) . removeSiteRoot ( m_configuration . getContentParentFolder ( ) . getRootPath ( ) ) ; String path = CmsStringUtil . joinPaths ( contentSitePath , fileName ) ; m_editResource = m_cms . readResource ( path ) ; CmsLock lock = m_cms . getLock ( m_editResource ) ; if ( ! lock . isOwnedBy ( m_cms . getRequestContext ( ) . getCurrentUser ( ) ) ) { m_cms . lockResourceTemporary ( m_editResource ) ; } return m_editResource ; } catch ( CmsException e ) { throw new CmsUgcException ( CmsUgcConstants . ErrorCode . errMisc , e . getLocalizedMessage ( ) ) ; }
public class CPOptionCategoryUtil { /** * Returns the last cp option category in the ordered set where uuid = & # 63 ; . * @ param uuid the uuid * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) * @ return the last matching cp option category , or < code > null < / code > if a matching cp option category could not be found */ public static CPOptionCategory fetchByUuid_Last ( String uuid , OrderByComparator < CPOptionCategory > orderByComparator ) { } }
return getPersistence ( ) . fetchByUuid_Last ( uuid , orderByComparator ) ;
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link ElementaryFunctionsType } { @ code > } } */ @ XmlElementDecl ( namespace = "http://www.w3.org/1998/Math/MathML" , name = "arccosh" ) public JAXBElement < ElementaryFunctionsType > createArccosh ( ElementaryFunctionsType value ) { } }
return new JAXBElement < ElementaryFunctionsType > ( _Arccosh_QNAME , ElementaryFunctionsType . class , null , value ) ;
public class AttributeValue { /** * A set of strings . * Returns a reference to this object so that method calls can be chained together . * @ param sS A set of strings . * @ return A reference to this updated object so that method calls can be chained * together . */ public AttributeValue withSS ( java . util . Collection < String > sS ) { } }
if ( sS == null ) { this . sS = null ; } else { java . util . List < String > sSCopy = new java . util . ArrayList < String > ( sS . size ( ) ) ; sSCopy . addAll ( sS ) ; this . sS = sSCopy ; } return this ;
public class FileSystemView { /** * Creates a new directory at the given path . The given attributes will be set on the new file if * possible . */ public Directory createDirectory ( JimfsPath path , FileAttribute < ? > ... attrs ) throws IOException { } }
return ( Directory ) createFile ( path , store . directoryCreator ( ) , true , attrs ) ;
public class Projection { /** * Initialize base coordinates on Java2D screen . */ private void initBaseCoordsProjection ( ) { } }
baseScreenCoords = new int [ canvas . base . baseCoords . length ] [ 2 ] ; for ( int i = 0 ; i < canvas . base . dimension + 1 ; i ++ ) { double [ ] ratio = baseCoordsScreenProjectionRatio ( canvas . base . baseCoords [ i ] ) ; baseScreenCoords [ i ] [ 0 ] = ( int ) ( canvas . getWidth ( ) * ( canvas . margin + ( 1 - 2 * canvas . margin ) * ratio [ 0 ] ) ) ; baseScreenCoords [ i ] [ 1 ] = ( int ) ( canvas . getHeight ( ) - canvas . getHeight ( ) * ( canvas . margin + ( 1 - 2 * canvas . margin ) * ratio [ 1 ] ) ) ; }
public class TextUtil { /** * Join the elements of the given array with the given join text . * @ param < T > is the type of the elements * @ param joinText the text to use for joining . * @ param elements the parts of text to join . * @ return the joining text */ @ Pure @ Inline ( value = "TextUtil.join($1, null, null, Arrays.asList($2))" , imported = { } }
TextUtil . class , Arrays . class } ) public static < T > String join ( String joinText , @ SuppressWarnings ( "unchecked" ) T ... elements ) { return join ( joinText , null , null , elements ) ;
public class LabelService { /** * Returns the set of labels . * @ param queryParams The query parameters * @ return The set of labels */ public Collection < Label > list ( List < String > queryParams ) { } }
return HTTP . GET ( "/v2/labels.json" , null , queryParams , LABELS ) . get ( ) ;
public class IndexedCache { /** * Invalidate all entries which ( may ) overlap with the given geometry . * @ param envelope envelope to test */ public void invalidate ( Envelope envelope ) { } }
List < String > keys = index . getOverlappingKeys ( envelope ) ; if ( CacheIndexService . ALL_KEYS == keys ) { log . debug ( "clear all keys from cache" ) ; clear ( ) ; } else { log . debug ( "invalidate keys {}" , keys ) ; for ( String key : keys ) { remove ( key ) ; } }
public class LastaJobStarter { protected LaJobScheduler findAppScheduler ( ) { } }
final List < LaJobScheduler > schedulerList = new ArrayList < LaJobScheduler > ( ) ; // to check not found final List < String > derivedNameList = new ArrayList < String > ( ) ; // for exception message final NamingConvention convention = getNamingConvention ( ) ; for ( String root : convention . getRootPackageNames ( ) ) { final String schedulerName = buildSchedulerName ( root ) ; derivedNameList . add ( schedulerName ) ; final Class < ? > schedulerType ; try { schedulerType = forSchedulerName ( schedulerName ) ; } catch ( ClassNotFoundException ignored ) { continue ; } final LaJobScheduler scheduler = createScheduler ( schedulerType ) ; schedulerList . add ( scheduler ) ; } if ( schedulerList . isEmpty ( ) ) { throwJobSchedulerNotFoundException ( derivedNameList ) ; } else if ( schedulerList . size ( ) >= 2 ) { throw new IllegalStateException ( "Duplicate scheduler object: " + schedulerList ) ; } return schedulerList . get ( 0 ) ;
public class CompiledTemplates { /** * Adds all transitively called templates to { @ code visited } */ private void collectTransitiveCallees ( TemplateData templateData , Set < TemplateData > visited ) { } }
if ( ! visited . add ( templateData ) ) { return ; // avoids chasing recursive cycles } for ( String callee : templateData . callees ) { collectTransitiveCallees ( getTemplateData ( callee ) , visited ) ; } for ( String delCallee : templateData . delCallees ) { // for { delcalls } we consider all possible targets for ( TemplateData potentialCallee : selector . delTemplateNameToValues ( ) . get ( delCallee ) ) { collectTransitiveCallees ( potentialCallee , visited ) ; } }
public class ProxyBuilderDefaultImpl { /** * ( non - Javadoc ) * @ see * io . joynr . proxy . ProxyBuilder # setDiscoveryQos ( io . joynr . arbitration . DiscoveryQos */ @ Override public ProxyBuilder < T > setDiscoveryQos ( final DiscoveryQos discoveryQos ) throws DiscoveryException { } }
if ( discoveryQos . getDiscoveryTimeoutMs ( ) < 0 && discoveryQos . getDiscoveryTimeoutMs ( ) != DiscoveryQos . NO_VALUE ) { throw new DiscoveryException ( "Discovery timeout cannot be less than zero" ) ; } if ( discoveryQos . getRetryIntervalMs ( ) < 0 && discoveryQos . getRetryIntervalMs ( ) != DiscoveryQos . NO_VALUE ) { throw new DiscoveryException ( "Discovery retry interval cannot be less than zero" ) ; } applyDefaultValues ( discoveryQos ) ; this . discoveryQos = discoveryQos ; // TODO which interfaceName should be used here ? arbitrator = ArbitratorFactory . create ( domains , interfaceName , interfaceVersion , discoveryQos , localDiscoveryAggregator ) ; return this ;
public class EventListenerListHelper { /** * Invokes the method with the given name on each of the listeners registered with this list * helper . The given arguments are passed to each method invocation . * @ param methodName The name of the method to be invoked on the listeners . * @ param eventArgs The arguments that will be passed to each method invocation . The number * of arguments is also used to determine the method to be invoked . * @ throws EventBroadcastException if an error occurs invoking the event method on any of the * listeners . */ private void fireEventByReflection ( String methodName , Object [ ] eventArgs ) { } }
Method eventMethod = ( Method ) methodCache . get ( new MethodCacheKey ( listenerClass , methodName , eventArgs . length ) ) ; Object [ ] listenersCopy = listeners ; for ( int i = 0 ; i < listenersCopy . length ; i ++ ) { try { eventMethod . invoke ( listenersCopy [ i ] , eventArgs ) ; } catch ( InvocationTargetException e ) { throw new EventBroadcastException ( "Exception thrown by listener" , e . getCause ( ) ) ; } catch ( IllegalAccessException e ) { throw new EventBroadcastException ( "Unable to invoke listener" , e ) ; } }
public class ParallelIterate { /** * Returns a brand new ExecutorService using the specified poolName with the specified maximum thread pool size . The * same poolName may be used more than once resulting in multiple pools with the same name . * The pool will be initialised with newPoolSize threads . If that number of threads are in use and another thread * is requested , the pool will reject execution and the submitting thread will execute the task . */ public static ExecutorService newPooledExecutor ( int newPoolSize , String poolName , boolean useDaemonThreads ) { } }
return new ThreadPoolExecutor ( newPoolSize , newPoolSize , 0L , TimeUnit . MILLISECONDS , new SynchronousQueue < Runnable > ( ) , new CollectionsThreadFactory ( poolName , useDaemonThreads ) , new ThreadPoolExecutor . CallerRunsPolicy ( ) ) ;
public class ExpectExec { /** * { @ inheritDoc } * Upon creation , configure the input and output streams for the { @ link ExpectSupportImpl } * instance and * call the { @ link ExpectSupportImpl # execute ( ) } method . * @ return an execute instance */ @ Override protected Execute prepareExec ( ) { } }
Execute original = super . prepareExec ( ) ; Execute exec = new Execute ( this , createWatchdog ( ) ) { @ Override protected void waitFor ( Process process ) { try { expectSupport . execute ( ) ; if ( destroyProcess ) { process . destroy ( ) ; } } catch ( Exception e ) { process . destroy ( ) ; throw new BuildException ( e ) ; } finally { super . waitFor ( process ) ; } } } ; exec . setNewenvironment ( newEnvironment ) ; exec . setAntRun ( getProject ( ) ) ; exec . setWorkingDirectory ( original . getWorkingDirectory ( ) ) ; exec . setEnvironment ( original . getEnvironment ( ) ) ; return exec ;
public class ServersInner { /** * Creates or updates a server . * @ param resourceGroupName The name of the resource group that contains the resource . You can obtain this value from the Azure Resource Manager API or the portal . * @ param serverName The name of the server . * @ param parameters The requested server resource state . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the ServerInner object */ public Observable < ServerInner > beginCreateOrUpdateAsync ( String resourceGroupName , String serverName , ServerInner parameters ) { } }
return beginCreateOrUpdateWithServiceResponseAsync ( resourceGroupName , serverName , parameters ) . map ( new Func1 < ServiceResponse < ServerInner > , ServerInner > ( ) { @ Override public ServerInner call ( ServiceResponse < ServerInner > response ) { return response . body ( ) ; } } ) ;
public class SchemaToJava { /** * Bind to the directory , read and process the schema */ private static ObjectSchema readSchema ( String url , String user , String pass , SyntaxToJavaClass syntaxToJavaClass , Set < String > binarySet , Set < String > objectClasses ) throws NamingException , ClassNotFoundException { } }
// Set up environment Hashtable < String , String > env = new Hashtable < String , String > ( ) ; env . put ( Context . PROVIDER_URL , url ) ; env . put ( Context . INITIAL_CONTEXT_FACTORY , "com.sun.jndi.ldap.LdapCtxFactory" ) ; if ( user != null ) { env . put ( Context . SECURITY_PRINCIPAL , user ) ; } if ( pass != null ) { env . put ( Context . SECURITY_CREDENTIALS , pass ) ; } DirContext context = new InitialDirContext ( env ) ; DirContext schemaContext = context . getSchema ( "" ) ; SchemaReader reader = new SchemaReader ( schemaContext , syntaxToJavaClass , binarySet ) ; ObjectSchema schema = reader . getObjectSchema ( objectClasses ) ; if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( String . format ( "Schema - %1$s" , schema . toString ( ) ) ) ; } return schema ;
public class AddressbookQuery { /** * Limit the number of results in the response , if supported by the server . A negative value will remove the limit . * @ param limit * The maximum number of result in the response if this is a positive integer . * @ return This instance . */ public AddressbookQuery limitNumberOfResults ( int limit ) { } }
if ( limit > 0 ) { addLimit ( WebDavSearch . NRESULTS , limit ) ; } else { removeLimit ( WebDavSearch . NRESULTS ) ; } return this ;
public class ConfigurationsInner { /** * List all the configurations in a given server . * @ param resourceGroupName The name of the resource group that contains the resource . You can obtain this value from the Azure Resource Manager API or the portal . * @ param serverName The name of the server . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the List & lt ; ConfigurationInner & gt ; object */ public Observable < List < ConfigurationInner > > listByServerAsync ( String resourceGroupName , String serverName ) { } }
return listByServerWithServiceResponseAsync ( resourceGroupName , serverName ) . map ( new Func1 < ServiceResponse < List < ConfigurationInner > > , List < ConfigurationInner > > ( ) { @ Override public List < ConfigurationInner > call ( ServiceResponse < List < ConfigurationInner > > response ) { return response . body ( ) ; } } ) ;
public class UpdateObjectAttributesRequest { /** * The attributes update structure . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setAttributeUpdates ( java . util . Collection ) } or { @ link # withAttributeUpdates ( java . util . Collection ) } if you * want to override the existing values . * @ param attributeUpdates * The attributes update structure . * @ return Returns a reference to this object so that method calls can be chained together . */ public UpdateObjectAttributesRequest withAttributeUpdates ( ObjectAttributeUpdate ... attributeUpdates ) { } }
if ( this . attributeUpdates == null ) { setAttributeUpdates ( new java . util . ArrayList < ObjectAttributeUpdate > ( attributeUpdates . length ) ) ; } for ( ObjectAttributeUpdate ele : attributeUpdates ) { this . attributeUpdates . add ( ele ) ; } return this ;
public class ProjectResolver { /** * Returns the directory containing rules . * @ param rootModule The root module of the project . * @ param rulesDirectory The name of the directory used for identifying the root module . * @ return The file representing the directory . */ static File getRulesDirectory ( MavenProject rootModule , String rulesDirectory ) { } }
File rules = new File ( rulesDirectory ) ; return rules . isAbsolute ( ) ? rules : new File ( rootModule . getBasedir ( ) . getAbsolutePath ( ) + File . separator + rulesDirectory ) ;
public class BinderExtension { /** * / * @ Override */ public < S , T > T convertTo ( ConverterKey < S , T > key , Object object ) { } }
return BINDING . convertTo ( key , object ) ;
public class AmazonTranslateClient { /** * Creates or updates a custom terminology , depending on whether or not one already exists for the given terminology * name . Importing a terminology with the same name as an existing one will merge the terminologies based on the * chosen merge strategy . Currently , the only supported merge strategy is OVERWRITE , and so the imported terminology * will overwrite an existing terminology of the same name . * If you import a terminology that overwrites an existing one , the new terminology take up to 10 minutes to fully * propagate and be available for use in a translation due to cache policies with the DataPlane service that * performs the translations . * @ param importTerminologyRequest * @ return Result of the ImportTerminology operation returned by the service . * @ throws InvalidParameterValueException * The value of the parameter is invalid . Review the value of the parameter you are using to correct it , and * then retry your operation . * @ throws LimitExceededException * The specified limit has been exceeded . Review your request and retry it with a quantity below the stated * limit . * @ throws TooManyRequestsException * You have made too many requests within a short period of time . Wait for a short time and then try your * request again . * @ throws InternalServerException * An internal server error occurred . Retry your request . * @ sample AmazonTranslate . ImportTerminology * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / translate - 2017-07-01 / ImportTerminology " target = " _ top " > AWS * API Documentation < / a > */ @ Override public ImportTerminologyResult importTerminology ( ImportTerminologyRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeImportTerminology ( request ) ;
public class BuildContext { /** * Replaces the given global variable with the given value . The flag * indicates whether or not the variable should be marked as final . Note , * however , that this routine does not respect the final flag and replaces * the value unconditionally . The function returns the old value of the * variable or null if it didn ' t exist . */ public GlobalVariable replaceGlobalVariable ( String name , Element value , boolean finalFlag ) { } }
assert ( name != null ) ; GlobalVariable oldVariable = globalVariables . get ( name ) ; GlobalVariable newVariable = new GlobalVariable ( finalFlag , value ) ; globalVariables . put ( name , newVariable ) ; return oldVariable ;
public class GeoPackageCoreCache { /** * Close the GeoPackage if it is cached ( same GeoPackage instance ) * @ param geoPackage * GeoPackage * @ return true if closed * @ since 3.1.0 */ public boolean closeIfCached ( T geoPackage ) { } }
boolean closed = false ; if ( geoPackage != null ) { T cached = get ( geoPackage . getName ( ) ) ; if ( cached != null && cached == geoPackage ) { closed = close ( geoPackage . getName ( ) ) ; } } return closed ;
public class UserHandlerImpl { /** * Notifying listeners before user deletion . * @ param user * the user which is used in delete operation * @ throws Exception * if any listener failed to handle the event */ private void preDelete ( User user ) throws Exception { } }
for ( UserEventListener listener : listeners ) { listener . preDelete ( user ) ; }
public class Console { /** * Writes a formatted string to the console using * the specified format string and arguments . * @ param format the format string ( see { @ link java . util . Formatter # format } ) * @ param args * the list of arguments passed to the formatter . If there are * more arguments than required by { @ code format } , * additional arguments are ignored . * @ return the console instance . */ public Console format ( String format , Object ... args ) { } }
try ( Formatter f = new Formatter ( writer ) ) { f . format ( format , args ) ; f . flush ( ) ; return this ; }
public class ResultMatchers { /** * Matches if the result has exactly one failure , and it contains { @ code string } */ public static Matcher < Object > hasSingleFailureContaining ( final String string ) { } }
return new BaseMatcher < Object > ( ) { public boolean matches ( Object item ) { return item . toString ( ) . contains ( string ) && failureCountIs ( 1 ) . matches ( item ) ; } public void describeTo ( Description description ) { description . appendText ( "has single failure containing " + string ) ; } } ;
public class AbstractLongObjectMap { /** * Returns the first key the given value is associated with . * It is often a good idea to first check with { @ link # containsValue ( Object ) } whether there exists an association from a key to this value . * Search order is guaranteed to be < i > identical < / i > to the order used by method { @ link # forEachKey ( LongProcedure ) } . * @ param value the value to search for . * @ return the first key for which holds < tt > get ( key ) = = value < / tt > ; * returns < tt > Long . MIN _ VALUE < / tt > if no such key exists . */ public long keyOf ( final Object value ) { } }
final long [ ] foundKey = new long [ 1 ] ; boolean notFound = forEachPair ( new LongObjectProcedure ( ) { public boolean apply ( long iterKey , Object iterValue ) { boolean found = value == iterValue ; if ( found ) foundKey [ 0 ] = iterKey ; return ! found ; } } ) ; if ( notFound ) return Long . MIN_VALUE ; return foundKey [ 0 ] ;
public class ODatabasePojoAbstract { /** * Register a new POJO */ public void registerUserObject ( final Object iObject , final ORecordInternal < ? > iRecord ) { } }
if ( ! ( iRecord instanceof ODocument ) ) return ; final ODocument doc = ( ODocument ) iRecord ; if ( retainObjects ) { if ( iObject != null ) { objects2Records . put ( iObject , doc ) ; records2Objects . put ( doc , ( T ) iObject ) ; OObjectSerializerHelper . setObjectID ( iRecord . getIdentity ( ) , iObject ) ; OObjectSerializerHelper . setObjectVersion ( iRecord . getVersion ( ) , iObject ) ; } final ORID rid = iRecord . getIdentity ( ) ; if ( rid . isValid ( ) ) rid2Records . put ( rid , doc ) ; }
public class CartesianCategoryTicks { /** * Write the options of cartesian category ticks * @ return options as JSON object * @ throws java . io . IOException If an I / O error occurs */ @ Override public String encode ( ) throws IOException { } }
FastStringWriter fsw = new FastStringWriter ( ) ; try { fsw . write ( super . encode ( ) ) ; ChartUtils . writeDataValue ( fsw , "labels" , this . labels , true ) ; ChartUtils . writeDataValue ( fsw , "min" , this . min , true ) ; ChartUtils . writeDataValue ( fsw , "max" , this . max , true ) ; } finally { fsw . close ( ) ; } return fsw . toString ( ) ;
public class OgmTableGenerator { /** * Used in the cases where { @ link # determineSegmentValue } is unable to * determine the value to use . * @ param params The params supplied in the generator config ( plus some standard useful extras ) . * @ return The default segment value to use . */ protected String determineDefaultSegmentValue ( Properties params ) { } }
boolean preferSegmentPerEntity = ConfigurationHelper . getBoolean ( CONFIG_PREFER_SEGMENT_PER_ENTITY , params , false ) ; String defaultToUse = preferSegmentPerEntity ? params . getProperty ( PersistentIdentifierGenerator . TABLE ) : DEF_SEGMENT_VALUE ; log . infof ( "explicit segment value for id generator [%1$s.%2$s] suggested; using default [%3$s]" , tableName , segmentColumnName , defaultToUse ) ; return defaultToUse ;
public class CheckParameterizables { /** * Validate all " Parameterizable " objects for parts of the API contract that * cannot be specified in Java interfaces ( such as constructors , static * methods ) */ public void checkParameterizables ( ) { } }
LoggingConfiguration . setVerbose ( Level . VERBOSE ) ; knownParameterizables = new ArrayList < > ( ) ; try { Enumeration < URL > us = getClass ( ) . getClassLoader ( ) . getResources ( ELKIServiceLoader . RESOURCE_PREFIX ) ; while ( us . hasMoreElements ( ) ) { URL u = us . nextElement ( ) ; if ( "file" . equals ( u . getProtocol ( ) ) ) { for ( String prop : new File ( u . toURI ( ) ) . list ( ) ) { try { knownParameterizables . add ( Class . forName ( prop ) ) ; } catch ( ClassNotFoundException e ) { LOG . warning ( "Service file name is not a class name: " + prop ) ; continue ; } } } else if ( ( "jar" . equals ( u . getProtocol ( ) ) ) ) { JarURLConnection con = ( JarURLConnection ) u . openConnection ( ) ; try ( JarFile jar = con . getJarFile ( ) ) { Enumeration < JarEntry > entries = jar . entries ( ) ; while ( entries . hasMoreElements ( ) ) { String prop = entries . nextElement ( ) . getName ( ) ; if ( prop . startsWith ( ELKIServiceLoader . RESOURCE_PREFIX ) ) { prop = prop . substring ( ELKIServiceLoader . RESOURCE_PREFIX . length ( ) ) ; } else if ( prop . startsWith ( ELKIServiceLoader . FILENAME_PREFIX ) ) { prop = prop . substring ( ELKIServiceLoader . FILENAME_PREFIX . length ( ) ) ; } else { continue ; } try { knownParameterizables . add ( Class . forName ( prop ) ) ; } catch ( ClassNotFoundException e ) { LOG . warning ( "Service file name is not a class name: " + prop ) ; continue ; } } } } } } catch ( IOException | URISyntaxException e ) { throw new AbortException ( "Error enumerating service folders." , e ) ; } final String internal = de . lmu . ifi . dbs . elki . utilities . optionhandling . Parameterizer . class . getPackage ( ) . getName ( ) ; for ( final Class < ? > cls : ELKIServiceRegistry . findAllImplementations ( Object . class , false , false ) ) { // Classes in the same package are special and don ' t cause warnings . if ( cls . getName ( ) . startsWith ( internal ) ) { continue ; } try { State state = State . NO_CONSTRUCTOR ; state = checkV3Parameterization ( cls , state ) ; if ( state == State . ERROR ) { continue ; } state = checkDefaultConstructor ( cls , state ) ; if ( state == State . ERROR ) { continue ; } boolean expectedParameterizer = checkSupertypes ( cls ) ; if ( state == State . NO_CONSTRUCTOR && expectedParameterizer ) { LOG . verbose ( "Class " + cls . getName ( ) + " implements a parameterizable interface, but doesn't have a public and parameterless constructor!" ) ; } if ( state == State . INSTANTIABLE && ! expectedParameterizer ) { LOG . verbose ( "Class " + cls . getName ( ) + " has a parameterizer, but there is no service file for any of its interfaces." ) ; } } catch ( NoClassDefFoundError e ) { LOG . verbose ( "Class discovered but not found: " + cls . getName ( ) + " (missing: " + e . getMessage ( ) + ")" ) ; } }
public class SimpleHadoopFilesystemConfigStore { /** * Retrieves all the { @ link ConfigKeyPath } s that are imported by the given { @ link ConfigKeyPath } . This method does this * by reading the { @ link # INCLUDES _ CONF _ FILE _ NAME } file associated with the dataset specified by the given * { @ link ConfigKeyPath } . If the { @ link Path } described by the { @ link ConfigKeyPath } does not exist , then an empty * { @ link List } is returned . * @ param configKey the config key path whose tags are needed * @ param version the configuration version in the configuration store . * @ return a { @ link List } of { @ link ConfigKeyPath } s where each entry is a { @ link ConfigKeyPath } imported by the dataset * specified by the configKey . * @ throws VersionDoesNotExistException if the version specified cannot be found in the { @ link ConfigStore } . */ public List < ConfigKeyPath > getOwnImports ( ConfigKeyPath configKey , String version , Optional < Config > runtimeConfig ) throws VersionDoesNotExistException { } }
Preconditions . checkNotNull ( configKey , "configKey cannot be null!" ) ; Preconditions . checkArgument ( ! Strings . isNullOrEmpty ( version ) , "version cannot be null or empty!" ) ; List < ConfigKeyPath > configKeyPaths = new ArrayList < > ( ) ; Path datasetDir = getDatasetDirForKey ( configKey , version ) ; Path includesFile = new Path ( datasetDir , INCLUDES_CONF_FILE_NAME ) ; try { if ( ! this . fs . exists ( includesFile ) ) { return configKeyPaths ; } FileStatus includesFileStatus = this . fs . getFileStatus ( includesFile ) ; if ( ! includesFileStatus . isDirectory ( ) ) { try ( InputStream includesConfInStream = this . fs . open ( includesFileStatus . getPath ( ) ) ) { configKeyPaths . addAll ( getResolvedConfigKeyPaths ( includesConfInStream , runtimeConfig ) ) ; } } } catch ( IOException e ) { throw new RuntimeException ( String . format ( "Error while getting config for configKey: \"%s\"" , configKey ) , e ) ; } return configKeyPaths ;
public class MindMapTreePanel { /** * GEN - LAST : event _ buttonExpandAllActionPerformed */ private void buttonCollapseAllActionPerformed ( java . awt . event . ActionEvent evt ) { } }
// GEN - FIRST : event _ buttonCollapseAllActionPerformed Utils . foldUnfoldTree ( this . treeMindMap , false ) ;
public class DelegatingClassResolver { /** * { @ inheritDoc } */ public Class < ? > resolveClass ( final String classname ) throws ClassNotFoundException { } }
LOGGER . trace ( "Try to resolve {} from {} resolvers" , classname , resolvers . size ( ) ) ; for ( IClassResolver resolver : resolvers ) { try { Class < ? > candidate = resolver . resolveClass ( classname ) ; if ( candidate != null ) { return candidate ; } } catch ( ClassNotFoundException e ) { LOGGER . trace ( "ClassResolver {} could not find class: {}" , resolver , classname ) ; } catch ( RuntimeException e ) { LOGGER . warn ( "ClassResolver {} threw an unexpected exception." , resolver , e ) ; } } throw new ClassNotFoundException ( String . format ( "Class [%s] can't be resolved." , classname ) ) ;
public class CmsJspStandardContextBean { /** * Returns the container page bean for the give page and locale . < p > * @ param page the container page resource as id , path or already as resource * @ param locale the content locale as locale or string * @ return the container page bean */ public CmsContainerPageBean getPage ( Object page , Object locale ) { } }
CmsResource pageResource = null ; CmsContainerPageBean result = null ; if ( m_cms != null ) { try { pageResource = CmsJspElFunctions . convertRawResource ( m_cms , page ) ; Locale l = CmsJspElFunctions . convertLocale ( locale ) ; result = getPage ( pageResource ) ; if ( result != null ) { CmsADEConfigData adeConfig = OpenCms . getADEManager ( ) . lookupConfiguration ( m_cms , pageResource . getRootPath ( ) ) ; for ( CmsContainerBean container : result . getContainers ( ) . values ( ) ) { for ( CmsContainerElementBean element : container . getElements ( ) ) { boolean isGroupContainer = element . isGroupContainer ( m_cms ) ; boolean isInheritedContainer = element . isInheritedContainer ( m_cms ) ; I_CmsFormatterBean formatterConfig = null ; if ( ! isGroupContainer && ! isInheritedContainer ) { element . initResource ( m_cms ) ; // ensure that the formatter configuration id is added to the element settings , so it will be persisted on save formatterConfig = CmsJspTagContainer . getFormatterConfigurationForElement ( m_cms , element , adeConfig , container . getName ( ) , "" , 0 ) ; if ( formatterConfig != null ) { element . initSettings ( m_cms , formatterConfig , l , m_request , null ) ; } } } } } } catch ( Exception e ) { LOG . warn ( e . getLocalizedMessage ( ) , e ) ; } } return result ;
public class BatchGetApplicationRevisionsResult { /** * Additional information about the revisions , including the type and location . * @ param revisions * Additional information about the revisions , including the type and location . */ public void setRevisions ( java . util . Collection < RevisionInfo > revisions ) { } }
if ( revisions == null ) { this . revisions = null ; return ; } this . revisions = new com . amazonaws . internal . SdkInternalList < RevisionInfo > ( revisions ) ;
public class Maxent { /** * Returns the dot product between weight vector and x ( augmented with 1 ) . */ private static double dot ( int [ ] x , double [ ] w , int j , int p ) { } }
int pos = j * ( p + 1 ) ; double dot = w [ pos + p ] ; for ( int i : x ) { dot += w [ pos + i ] ; } return dot ;
public class URL { /** * Makes a copy of a given URL with some additional components . * @ param protocol protocol name * @ return a copy of a given URL with some additional components */ public URL copyWithProtocol ( String protocol ) { } }
return new URL ( protocol , this . adapterAddress , this . deviceAddress , this . deviceAttributes , this . serviceUUID , this . characteristicUUID , this . fieldName ) ;
public class ServiceEndpointPoliciesInner { /** * Gets the specified service Endpoint Policies in a specified resource group . * @ param resourceGroupName The name of the resource group . * @ param serviceEndpointPolicyName The name of the service endpoint policy . * @ param expand Expands referenced resources . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ throws CloudException thrown if the request is rejected by server * @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent * @ return the ServiceEndpointPolicyInner object if successful . */ public ServiceEndpointPolicyInner getByResourceGroup ( String resourceGroupName , String serviceEndpointPolicyName , String expand ) { } }
return getByResourceGroupWithServiceResponseAsync ( resourceGroupName , serviceEndpointPolicyName , expand ) . toBlocking ( ) . single ( ) . body ( ) ;
public class ResultInterpreter { /** * Interprets the class results . * @ return All REST resources */ public Resources interpret ( final Set < ClassResult > classResults ) { } }
resources = new Resources ( ) ; resources . setBasePath ( PathNormalizer . getApplicationPath ( classResults ) ) ; javaTypeAnalyzer = new JavaTypeAnalyzer ( resources . getTypeRepresentations ( ) ) ; dynamicTypeAnalyzer = new DynamicTypeAnalyzer ( resources . getTypeRepresentations ( ) ) ; stringParameterResolver = new StringParameterResolver ( resources . getTypeRepresentations ( ) , javaTypeAnalyzer ) ; classResults . stream ( ) . filter ( c -> c . getResourcePath ( ) != null ) . forEach ( this :: interpretClassResult ) ; resources . consolidateMultiplePaths ( ) ; return resources ;
public class AdminFailureurlAction { private HtmlResponse asListHtml ( ) { } }
return asHtml ( path_AdminFailureurl_AdminFailureurlJsp ) . renderWith ( data -> { RenderDataUtil . register ( data , "failureUrlItems" , failureUrlService . getFailureUrlList ( failureUrlPager ) ) ; // page navi } ) . useForm ( SearchForm . class , setup -> { setup . setup ( form -> { copyBeanToBean ( failureUrlPager , form , op -> op . include ( "url" , "errorCountMin" , "errorCountMax" , "errorName" ) ) ; } ) ; } ) ;
public class ParameterImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public Object eGet ( int featureID , boolean resolve , boolean coreType ) { } }
switch ( featureID ) { case XtextPackage . PARAMETER__NAME : return getName ( ) ; } return super . eGet ( featureID , resolve , coreType ) ;
public class Context { /** * Find the outermost context from this one . * @ return The outermost context . */ public Context getGlobal ( ) { } }
Context op = this ; while ( op . outer != null ) { op = op . outer ; } return op ;
public class DistributionUpdater { /** * Downloads the given artifact , extracts it and replaces current Windup directory ( as given by PathUtil ) * with the content from the artifact ( assuming it really is a Windup distribution zip ) . */ public void replaceWindupDirectoryWithDistribution ( Coordinate distCoordinate ) throws WindupException { } }
try { final CoordinateBuilder coord = CoordinateBuilder . create ( distCoordinate ) ; File tempFolder = OperatingSystemUtils . createTempDir ( ) ; this . updater . extractArtifact ( coord , tempFolder ) ; File newDistWindupDir = getWindupDistributionSubdir ( tempFolder ) ; if ( null == newDistWindupDir ) throw new WindupException ( "Distribution update failed: " + "The distribution archive did not contain the windup-distribution-* directory: " + coord . toString ( ) ) ; Path addonsDir = PathUtil . getWindupAddonsDir ( ) ; Path binDir = PathUtil . getWindupHome ( ) . resolve ( PathUtil . BINARY_DIRECTORY_NAME ) ; Path libDir = PathUtil . getWindupHome ( ) . resolve ( PathUtil . LIBRARY_DIRECTORY_NAME ) ; FileUtils . deleteDirectory ( addonsDir . toFile ( ) ) ; FileUtils . deleteDirectory ( libDir . toFile ( ) ) ; FileUtils . deleteDirectory ( binDir . toFile ( ) ) ; FileUtils . moveDirectory ( new File ( newDistWindupDir , PathUtil . ADDONS_DIRECTORY_NAME ) , addonsDir . toFile ( ) ) ; FileUtils . moveDirectory ( new File ( newDistWindupDir , PathUtil . BINARY_DIRECTORY_NAME ) , binDir . toFile ( ) ) ; FileUtils . moveDirectory ( new File ( newDistWindupDir , PathUtil . LIBRARY_DIRECTORY_NAME ) , libDir . toFile ( ) ) ; // Rulesets Path rulesDir = PathUtil . getWindupHome ( ) . resolve ( PathUtil . RULES_DIRECTORY_NAME ) ; // PathUtil . getWindupRulesDir ( ) ; File coreDir = rulesDir . resolve ( RulesetsUpdater . RULESET_CORE_DIRECTORY ) . toFile ( ) ; // This is for testing purposes . The releases do not contain migration - core / . if ( coreDir . exists ( ) ) { // migration - core / exists - > Only replace that one . FileUtils . deleteDirectory ( coreDir ) ; final File coreDirNew = newDistWindupDir . toPath ( ) . resolve ( PathUtil . RULES_DIRECTORY_NAME ) . resolve ( RulesetsUpdater . RULESET_CORE_DIRECTORY ) . toFile ( ) ; FileUtils . moveDirectory ( coreDirNew , rulesDir . resolve ( RulesetsUpdater . RULESET_CORE_DIRECTORY ) . toFile ( ) ) ; } else { // Otherwise replace the whole rules directory ( backing up the old one ) . final String newName = "rules-" + new SimpleDateFormat ( "yyyy-MM-dd_HH-mm-ss" ) . format ( new Date ( ) ) ; FileUtils . moveDirectory ( rulesDir . toFile ( ) , rulesDir . getParent ( ) . resolve ( newName ) . toFile ( ) ) ; FileUtils . moveDirectory ( new File ( newDistWindupDir , PathUtil . RULES_DIRECTORY_NAME ) , rulesDir . toFile ( ) ) ; } FileUtils . deleteDirectory ( tempFolder ) ; } catch ( IllegalStateException | DependencyException | IOException ex ) { throw new WindupException ( "Distribution update failed: " + ex . getMessage ( ) , ex ) ; }
public class ViewNode { /** * 增加子节点 * @ param child * @ throws java . lang . IllegalArgumentException */ public void addChild ( ViewNode child ) throws IllegalArgumentException { } }
tree . addNode ( child ) ; child . setParent ( this ) ; this . leaf = false ; // 一旦增加子节点 , 该节点就不是叶了 。 int n = children . size ( ) ; if ( n > 0 ) { ViewNode node = ( ViewNode ) children . get ( n - 1 ) ; node . setLast ( false ) ; } child . setLast ( true ) ; children . add ( child ) ;
public class RunGraphResponse { /** * < code > optional . tensorflow . CostGraphDef cost _ graph = 3 ; < / code > */ public org . tensorflow . framework . CostGraphDef getCostGraph ( ) { } }
return costGraph_ == null ? org . tensorflow . framework . CostGraphDef . getDefaultInstance ( ) : costGraph_ ;
public class LetNode { /** * Visits this node , the variable list , and if present , the body * expression or statement . */ @ Override public void visit ( NodeVisitor v ) { } }
if ( v . visit ( this ) ) { variables . visit ( v ) ; if ( body != null ) { body . visit ( v ) ; } }
public class CmsDriverManager { /** * Deletes a project . < p > * Only the admin or the owner of the project can do this . * @ param dbc the current database context * @ param deleteProject the project to be deleted * @ throws CmsException if something goes wrong */ public void deleteProject ( CmsDbContext dbc , CmsProject deleteProject ) throws CmsException { } }
deleteProject ( dbc , deleteProject , true ) ;
public class DestinationTools { /** * Check the validity of a queue name */ public static void checkQueueName ( String queueName ) throws JMSException { } }
if ( queueName == null ) throw new FFMQException ( "Queue name is not set" , "INVALID_DESTINATION_NAME" ) ; if ( queueName . length ( ) > FFMQConstants . MAX_QUEUE_NAME_SIZE ) throw new FFMQException ( "Queue name '" + queueName + "' is too long (" + queueName . length ( ) + " > " + FFMQConstants . MAX_QUEUE_NAME_SIZE + ")" , "INVALID_DESTINATION_NAME" ) ; checkDestinationName ( queueName ) ;
public class PackageManagerUtils { /** * Checks if the device has a jazzhand multi touch screen . * @ param context the context . * @ return { @ code true } if the device has a jazzhand multi touch screen . */ @ TargetApi ( Build . VERSION_CODES . GINGERBREAD ) public static boolean hasJazzhandMultiTouchScreenFeature ( Context context ) { } }
return hasJazzhandMultiTouchScreenFeature ( context . getPackageManager ( ) ) ;
public class InitiateDeviceClaimRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( InitiateDeviceClaimRequest initiateDeviceClaimRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( initiateDeviceClaimRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( initiateDeviceClaimRequest . getDeviceId ( ) , DEVICEID_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class ApiOvhEmaildomain { /** * Create new responder in server * REST : POST / email / domain / { domain } / responder * @ param copyTo [ required ] Account where copy emails * @ param account [ required ] Account of domain * @ param from [ required ] Date of start responder * @ param content [ required ] Content of responder * @ param copy [ required ] If false , emails will be dropped . If true and copyTo field is empty , emails will be delivered to your mailbox . If true and copyTo is set with an address , emails will be delivered to this address * @ param to [ required ] Date of end responder * @ param domain [ required ] Name of your domain name */ public OvhTaskSpecialAccount domain_responder_POST ( String domain , String account , String content , Boolean copy , String copyTo , Date from , Date to ) throws IOException { } }
String qPath = "/email/domain/{domain}/responder" ; StringBuilder sb = path ( qPath , domain ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "account" , account ) ; addBody ( o , "content" , content ) ; addBody ( o , "copy" , copy ) ; addBody ( o , "copyTo" , copyTo ) ; addBody ( o , "from" , from ) ; addBody ( o , "to" , to ) ; String resp = exec ( qPath , "POST" , sb . toString ( ) , o ) ; return convertTo ( resp , OvhTaskSpecialAccount . class ) ;
public class BundleUtils { /** * Returns a optional { @ link android . util . SparseArray } value . In other words , returns the value mapped by key if it exists and is a { @ link android . util . SparseArray } . * The bundle argument is allowed to be { @ code null } . If the bundle is null , this method returns null . * @ param bundle a bundle . If the bundle is null , this method will return null . * @ param key a key for the value . * @ param fallback fallback value . * @ return a { @ link android . util . SparseArray } value if exists , null otherwise . * @ see android . os . Bundle # getSparseParcelableArray ( String ) */ @ Nullable public static < T extends Parcelable > SparseArray < T > optSparseParcelableArray ( @ Nullable Bundle bundle , @ Nullable String key , @ Nullable SparseArray < T > fallback ) { } }
if ( bundle == null ) { return fallback ; } return bundle . getSparseParcelableArray ( key ) ;
public class CmsTabbedPanel { /** * Enables the tab with the given index . < p > * @ param tabContent the content of the tab that should be enabled */ public void enableTab ( E tabContent ) { } }
Integer index = new Integer ( m_tabPanel . getWidgetIndex ( tabContent ) ) ; Element tab = getTabElement ( index . intValue ( ) ) ; if ( ( tab != null ) && m_disabledTabIndexes . containsKey ( index ) ) { tab . removeClassName ( I_CmsLayoutBundle . INSTANCE . tabbedPanelCss ( ) . tabDisabled ( ) ) ; tab . setTitle ( m_disabledTabIndexes . get ( index ) ) ; m_disabledTabIndexes . remove ( index ) ; }
public class TypeIntoStep { /** * { @ inheritDoc } */ @ Override public void setVariables ( Map < String , String > variables ) { } }
injectVariables ( variables , element ) ; if ( keysVariable != null ) { keys = keysVariable . getConvertedValue ( variables ) ; }
public class GZipUtils { /** * 数据压缩 * @ param data * @ throws Exception */ public static byte [ ] compress ( byte [ ] data ) throws Exception { } }
ByteArrayInputStream bais = new ByteArrayInputStream ( data ) ; ByteArrayOutputStream baos = new ByteArrayOutputStream ( ) ; compress ( bais , baos ) ; byte [ ] output = baos . toByteArray ( ) ; baos . flush ( ) ; baos . close ( ) ; bais . close ( ) ; return output ;