signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class MpJwtAppSetupUtils { /** * All of the test apps following the same naming convention . We can build the class names * @ param app1 - test app 1 * @ param app2 - test app 2 * @ param app3 - test app 3 if it exists * @ return * @ throws Exception */ public List < String > createAppClassListBuildAppNames ( String app1 , String app2 , String app3 ) throws Exception { } }
List < String > classList = createAppClassListBuildAppNames ( app1 , app2 ) ; classList . add ( "com.ibm.ws.jaxrs.fat.microProfileApp." + app2 + ".MicroProfileApp" + app3 ) ; return classList ;
public class ArrayListBenchmark { /** * Sets up the benchmark . * @ throws Exception if the setup fails */ @ Setup ( Level . Trial ) public void setup ( ) throws Exception { } }
test = benchmarks . get ( list + "-" + type ) ; if ( test == null ) { throw new RuntimeException ( "Can't find requested test " + list + " " + type ) ; } test . setSize ( size ) ; test . setRandomSeed ( size ) ; // TODO Use iteration some how test . setup ( ) ;
public class AbstractSearch { /** * Adds the performance to the cache and the current list of performances . * @ param performancethe performance to add * @ param foldsthe number of folds */ public void addPerformance ( Performance performance , int folds ) { } }
m_Performances . add ( performance ) ; m_Cache . add ( folds , performance ) ; m_Trace . add ( new AbstractMap . SimpleEntry < Integer , Performance > ( folds , performance ) ) ;
public class ProductTemplate { /** * Sets the builtInTargeting value for this ProductTemplate . * @ param builtInTargeting * Targeting to be included in the created { @ link ProposalLineItem } . * Any type targeted cannot also be used for segmentation . * < p > This attribute is optional . * Note : if { @ link # productType } is { @ link ProductType # DFP } * and { @ link # productSegmentation } is * not specified , this attribute is required . */ public void setBuiltInTargeting ( com . google . api . ads . admanager . axis . v201811 . Targeting builtInTargeting ) { } }
this . builtInTargeting = builtInTargeting ;
public class CreateFpgaImageRequest { /** * This method is intended for internal use only . Returns the marshaled request configured with additional * parameters to enable operation dry - run . */ @ Override public Request < CreateFpgaImageRequest > getDryRunRequest ( ) { } }
Request < CreateFpgaImageRequest > request = new CreateFpgaImageRequestMarshaller ( ) . marshall ( this ) ; request . addParameter ( "DryRun" , Boolean . toString ( true ) ) ; return request ;
public class LocalDateRange { /** * Obtains the length of this range in days . * This returns the number of days between the start and end dates . * If the range is too large , the length will be { @ code Integer . MAX _ VALUE } . * Unbounded ranges return { @ code Integer . MAX _ VALUE } . * @ return the length in days , Integer . MAX _ VALUE if unbounded or too large */ public int lengthInDays ( ) { } }
if ( isUnboundedStart ( ) || isUnboundedEnd ( ) ) { return Integer . MAX_VALUE ; } long length = end . toEpochDay ( ) - start . toEpochDay ( ) ; return length > Integer . MAX_VALUE ? Integer . MAX_VALUE : ( int ) length ;
public class FNMRGImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public void eUnset ( int featureID ) { } }
switch ( featureID ) { case AfplibPackage . FNMRG__CHAR_BOX_WD : setCharBoxWd ( CHAR_BOX_WD_EDEFAULT ) ; return ; case AfplibPackage . FNMRG__CHAR_BOX_HT : setCharBoxHt ( CHAR_BOX_HT_EDEFAULT ) ; return ; case AfplibPackage . FNMRG__PAT_DOSET : setPatDOset ( PAT_DOSET_EDEFAULT ) ; return ; } super . eUnset ( featureID ) ;
public class Graphics { /** * Indicate if we should antialias as we draw primitives * @ param anti * True if we should antialias */ public void setAntiAlias ( boolean anti ) { } }
predraw ( ) ; antialias = anti ; LSR . setAntiAlias ( anti ) ; if ( anti ) { GL . glEnable ( SGL . GL_POLYGON_SMOOTH ) ; } else { GL . glDisable ( SGL . GL_POLYGON_SMOOTH ) ; } postdraw ( ) ;
public class QueryRecord { /** * Set the default key order . * @ param String strKeyName the current index . * @ return The key area you are set to . */ public KeyArea setKeyArea ( String strKeyName ) { } }
KeyArea keyArea = super . setKeyArea ( strKeyName ) ; if ( this . isManualQuery ( ) ) { // Manual table - Special , set target table to this same key TableLink tableLink = ( TableLink ) m_LinkageList . elementAt ( 0 ) ; Record record = tableLink . getLeftRecord ( ) ; if ( keyArea != null ) { // Find the closest matching key and set it KeyArea keyAreaQuery = keyArea ; keyArea = null ; for ( int iKeyArea = 0 ; iKeyArea < record . getKeyAreaCount ( ) ; iKeyArea ++ ) { KeyArea keyAreaTarget = record . getKeyArea ( iKeyArea ) ; if ( keyAreaTarget . getField ( 0 ) . getFieldName ( ) . equals ( keyAreaQuery . getField ( 0 ) . getFieldName ( ) ) ) { // Found matching key area keyArea = keyAreaTarget ; break ; } } } if ( keyArea == null ) { // Try to find this key in the left record keyArea = record . setKeyArea ( strKeyName ) ; } if ( keyArea != null ) record . setKeyArea ( keyArea . getKeyName ( ) ) ; } return keyArea ;
public class CmsEditorBase { /** * Registers the types and entities of the given content definition . < p > * @ param definition the content definition */ public void registerContentDefinition ( CmsContentDefinition definition ) { } }
m_widgetService . addConfigurations ( definition . getConfigurations ( ) ) ; CmsType baseType = definition . getTypes ( ) . get ( definition . getEntityTypeName ( ) ) ; m_entityBackend . registerTypes ( baseType , definition . getTypes ( ) ) ; m_entityBackend . registerEntity ( definition . getEntity ( ) ) ;
public class PHPObject { /** * < p > parse . < / p > * @ param container a { @ link com . greenpepper . phpsud . container . PHPContainer } object . * @ param className a { @ link java . lang . String } object . * @ param s a { @ link java . lang . String } object . * @ return a { @ link java . lang . String } object . */ protected static String parse ( PHPContainer container , String className , String s ) { } }
try { String expr = PHPInterpeter . saveObject ( className + "::parse('" + s + "')" ) ; return container . get ( expr ) ; } catch ( PHPException e ) { LOGGER . error ( "Error when calling parse " + e . toString ( ) ) ; } return null ;
public class DefaultMonetaryAmountFormat { /** * Split into ( potential ) plus , minus patterns */ private String [ ] splitIntoPlusMinusPatterns ( AmountFormatContext amountFormatContext , String pattern ) { } }
DecimalFormatSymbols decimalFormatSymbols = amountFormatContext . get ( DecimalFormatSymbols . class ) ; char patternSeparator = decimalFormatSymbols != null ? decimalFormatSymbols . getPatternSeparator ( ) : SUBPATTERN_BOUNDARY ; return pattern . split ( String . valueOf ( patternSeparator ) ) ;
public class TemporaryTokenCache { /** * Validate a short lived token and returning the associated context * The token is removed if found and valid . * @ param key cacheKey * @ param token temporary token to validate * @ return an optional . The context will be absent if either the token is invalid of the context is null . */ public Optional < Object > getContextForToken ( String key , String token ) { } }
Object context = validateTokenAndGetContext ( key , token ) . second ( ) ; return null != context ? Optional . of ( context ) : Optional . absent ( ) ;
public class DatatypeConverter { /** * Parse duration time units . * Note that we don ' t differentiate between confirmed and unconfirmed * durations . Unrecognised duration types are default the supplied default value . * @ param value BigInteger value * @ param defaultValue if value is null , use this value as the result * @ return Duration units */ public static final TimeUnit parseDurationTimeUnits ( BigInteger value , TimeUnit defaultValue ) { } }
TimeUnit result = defaultValue ; if ( value != null ) { switch ( value . intValue ( ) ) { case 3 : case 35 : { result = TimeUnit . MINUTES ; break ; } case 4 : case 36 : { result = TimeUnit . ELAPSED_MINUTES ; break ; } case 5 : case 37 : { result = TimeUnit . HOURS ; break ; } case 6 : case 38 : { result = TimeUnit . ELAPSED_HOURS ; break ; } case 7 : case 39 : case 53 : { result = TimeUnit . DAYS ; break ; } case 8 : case 40 : { result = TimeUnit . ELAPSED_DAYS ; break ; } case 9 : case 41 : { result = TimeUnit . WEEKS ; break ; } case 10 : case 42 : { result = TimeUnit . ELAPSED_WEEKS ; break ; } case 11 : case 43 : { result = TimeUnit . MONTHS ; break ; } case 12 : case 44 : { result = TimeUnit . ELAPSED_MONTHS ; break ; } case 19 : case 51 : { result = TimeUnit . PERCENT ; break ; } case 20 : case 52 : { result = TimeUnit . ELAPSED_PERCENT ; break ; } default : { result = PARENT_FILE . get ( ) . getProjectProperties ( ) . getDefaultDurationUnits ( ) ; break ; } } } return ( result ) ;
public class ExpressionBuilderImpl { /** * Create an expression but does not change the container . * @ param expression the textual representation of the expression . * @ return the expression . */ @ Pure protected XExpression fromString ( String expression ) { } }
if ( ! Strings . isEmpty ( expression ) ) { ResourceSet resourceSet = this . context . eResource ( ) . getResourceSet ( ) ; URI uri = computeUnusedUri ( resourceSet ) ; Resource resource = getResourceFactory ( ) . createResource ( uri ) ; resourceSet . getResources ( ) . add ( resource ) ; try ( StringInputStream is = new StringInputStream ( generateExpressionCode ( expression ) ) ) { resource . load ( is , null ) ; SarlScript script = resource . getContents ( ) . isEmpty ( ) ? null : ( SarlScript ) resource . getContents ( ) . get ( 0 ) ; SarlEvent topElement = ( SarlEvent ) script . getXtendTypes ( ) . get ( 0 ) ; SarlField member = ( SarlField ) topElement . getMembers ( ) . get ( 0 ) ; return member . getInitialValue ( ) ; } catch ( Throwable exception ) { throw new RuntimeException ( exception ) ; } finally { resourceSet . getResources ( ) . remove ( resource ) ; } } throw new IllegalArgumentException ( "not a valid expression" ) ;
public class Document { /** * Adds the keywords to a Document . * @ param keywords * adds the keywords to the document * @ return < CODE > true < / CODE > if successful , < CODE > false < / CODE > otherwise */ public boolean addKeywords ( String keywords ) { } }
try { return add ( new Meta ( Element . KEYWORDS , keywords ) ) ; } catch ( DocumentException de ) { throw new ExceptionConverter ( de ) ; }
public class AVIMImageMessage { /** * 获取文件的metaData * @ return */ @ Override public Map < String , Object > getFileMetaData ( ) { } }
if ( file == null ) { file = new HashMap < String , Object > ( ) ; } if ( file . containsKey ( FILE_META ) ) { return ( Map < String , Object > ) file . get ( FILE_META ) ; } if ( localFile != null ) { Map < String , Object > meta = AVIMFileMessageAccessor . getImageMeta ( localFile ) ; meta . put ( FILE_SIZE , actualFile . getSize ( ) ) ; file . put ( FILE_META , meta ) ; return meta ; } else if ( actualFile != null ) { Map < String , Object > meta = actualFile . getMetaData ( ) ; file . put ( FILE_META , meta ) ; return meta ; } return null ;
public class AbstractParser { /** * Method used to get log format * @ return list of tag and length for the log format * @ throws CommunicationException communication error */ protected List < TagAndLength > getLogFormat ( ) throws CommunicationException { } }
List < TagAndLength > ret = new ArrayList < TagAndLength > ( ) ; if ( LOGGER . isDebugEnabled ( ) ) { LOGGER . debug ( "GET log format" ) ; } // Get log format byte [ ] data = template . get ( ) . getProvider ( ) . transceive ( new CommandApdu ( CommandEnum . GET_DATA , 0x9F , 0x4F , 0 ) . toBytes ( ) ) ; if ( ResponseUtils . isSucceed ( data ) ) { ret = TlvUtil . parseTagAndLength ( TlvUtil . getValue ( data , EmvTags . LOG_FORMAT ) ) ; } else { LOGGER . warn ( "No Log format found" ) ; } return ret ;
public class A_CmsTreeTabDataPreloader { /** * Finds the common root folder for a collection of resources . < p > * @ param resources the collection of resources * @ throws CmsException if something goes wrong */ protected void findRoot ( Collection < CmsResource > resources ) throws CmsException { } }
m_commonRoot = getCommonSite ( resources ) ; String commonPath = getCommonAncestorPath ( resources ) ; try { m_rootResource = m_cms . readResource ( m_commonRoot , m_filter ) ; } catch ( CmsVfsResourceNotFoundException e ) { String currentPath = commonPath ; String lastWorkingPath = null ; while ( m_cms . existsResource ( currentPath , m_filter ) ) { lastWorkingPath = currentPath ; currentPath = CmsResource . getParentFolder ( currentPath ) ; } m_rootResource = m_cms . readResource ( lastWorkingPath , m_filter ) ; m_commonRoot = lastWorkingPath ; } m_knownResources . add ( m_rootResource ) ;
public class PeerManager { /** * Invokes a node action on a specific node < em > without < / em > executing { @ link * NodeAction # isApplicable } to determine whether the action is applicable . */ public void invokeNodeAction ( String nodeName , NodeAction action ) { } }
PeerNode peer = _peers . get ( nodeName ) ; if ( peer != null ) { if ( peer . nodeobj != null ) { peer . nodeobj . peerService . invokeAction ( flattenAction ( action ) ) ; } else { log . warning ( "Dropped NodeAction" , "nodeName" , nodeName , "action" , action ) ; } } else if ( Objects . equal ( nodeName , _nodeName ) ) { invokeAction ( null , flattenAction ( action ) ) ; }
public class TabularDataConverter { /** * Check for a full table data representation and do some sanity checks */ private boolean checkForFullTabularDataRepresentation ( JSONObject pValue , TabularType pType ) { } }
if ( pValue . containsKey ( "indexNames" ) && pValue . containsKey ( "values" ) && pValue . size ( ) == 2 ) { Object jsonVal = pValue . get ( "indexNames" ) ; if ( ! ( jsonVal instanceof JSONArray ) ) { throw new IllegalArgumentException ( "Index names for tabular data must given as JSON array, not " + jsonVal . getClass ( ) ) ; } JSONArray indexNames = ( JSONArray ) jsonVal ; List < String > tabularIndexNames = pType . getIndexNames ( ) ; if ( indexNames . size ( ) != tabularIndexNames . size ( ) ) { throw new IllegalArgumentException ( "Given array with index names must have " + tabularIndexNames . size ( ) + " entries " + "(given: " + indexNames + ", required: " + tabularIndexNames + ")" ) ; } for ( Object index : indexNames ) { if ( ! tabularIndexNames . contains ( index . toString ( ) ) ) { throw new IllegalArgumentException ( "No index with name '" + index + "' known " + "(given: " + indexNames + ", required: " + tabularIndexNames + ")" ) ; } } return true ; } return false ;
public class CPMeasurementUnitPersistenceImpl { /** * Returns all the cp measurement units where groupId = & # 63 ; and type = & # 63 ; . * @ param groupId the group ID * @ param type the type * @ return the matching cp measurement units */ @ Override public List < CPMeasurementUnit > findByG_T ( long groupId , int type ) { } }
return findByG_T ( groupId , type , QueryUtil . ALL_POS , QueryUtil . ALL_POS , null ) ;
public class Keep { /** * setter for normalizedText - sets * @ generated * @ param v value to set into the feature */ public void setNormalizedText ( String v ) { } }
if ( Keep_Type . featOkTst && ( ( Keep_Type ) jcasType ) . casFeat_normalizedText == null ) jcasType . jcas . throwFeatMissing ( "normalizedText" , "ch.epfl.bbp.uima.types.Keep" ) ; jcasType . ll_cas . ll_setStringValue ( addr , ( ( Keep_Type ) jcasType ) . casFeatCode_normalizedText , v ) ;
public class NShortPath { /** * 初始化 , 主要分配内存 * @ param inGraph 输入图 * @ param nValueKind 希望的N值 */ private void initNShortPath ( Graph inGraph , int nValueKind ) { } }
graph = inGraph ; N = nValueKind ; // 获取顶点的数目 vertexCount = inGraph . vertexes . length ; fromArray = new CQueue [ vertexCount - 1 ] [ ] ; // 不包含起点 weightArray = new double [ vertexCount - 1 ] [ ] ; // 每个节点的最小堆 for ( int i = 0 ; i < vertexCount - 1 ; i ++ ) { fromArray [ i ] = new CQueue [ nValueKind ] ; weightArray [ i ] = new double [ nValueKind ] ; for ( int j = 0 ; j < nValueKind ; j ++ ) fromArray [ i ] [ j ] = new CQueue ( ) ; }
public class ClassUtility { /** * Return the Class object for the given type . * @ param type the given type to cast into Class * @ return the Class casted object */ public static Class < ? > getClassFromType ( final Type type ) { } }
Class < ? > returnClass = null ; if ( type instanceof Class < ? > ) { returnClass = ( Class < ? > ) type ; } else if ( type instanceof ParameterizedType ) { returnClass = getClassFromType ( ( ( ParameterizedType ) type ) . getRawType ( ) ) ; } return returnClass ;
public class ConsistentHashPartitionFilter { /** * Returns a map of { @ link ServiceEndPoint } objects indexed by their ID . */ private Map < String , ServiceEndPoint > indexById ( Iterable < ServiceEndPoint > endPoints ) { } }
Map < String , ServiceEndPoint > map = Maps . newHashMap ( ) ; for ( ServiceEndPoint endPoint : endPoints ) { map . put ( endPoint . getId ( ) , endPoint ) ; } return map ;
public class CmsAttributeHandler { /** * Changes the attribute value . < p > * @ param valueIndex the attribute value index * @ param value the value */ private void changeEntityValue ( String value , int valueIndex ) { } }
if ( getEntityType ( ) . isChoice ( ) ) { CmsEntity choice = m_entity . getAttribute ( CmsType . CHOICE_ATTRIBUTE_NAME ) . getComplexValues ( ) . get ( valueIndex ) ; String attributeName = getChoiceName ( valueIndex ) ; if ( attributeName != null ) { choice . setAttributeValue ( attributeName , value , 0 ) ; } } else { m_entity . setAttributeValue ( m_attributeName , value , valueIndex ) ; }
public class JolokiaServer { /** * Create the HttpServer to use . Can be overridden if a custom or already existing HttpServer should be * used * @ return HttpServer to use * @ throws IOException if something fails during the initialisation */ private HttpServer createHttpServer ( JolokiaServerConfig pConfig ) throws IOException { } }
int port = pConfig . getPort ( ) ; InetAddress address = pConfig . getAddress ( ) ; InetSocketAddress socketAddress = new InetSocketAddress ( address , port ) ; HttpServer server = pConfig . useHttps ( ) ? createHttpsServer ( socketAddress , pConfig ) : HttpServer . create ( socketAddress , pConfig . getBacklog ( ) ) ; // Thread factory which creates only daemon threads ThreadFactory daemonThreadFactory = new DaemonThreadFactory ( pConfig . getThreadNamePrefix ( ) ) ; // Prepare executor pool Executor executor ; String mode = pConfig . getExecutor ( ) ; if ( "fixed" . equalsIgnoreCase ( mode ) ) { executor = Executors . newFixedThreadPool ( pConfig . getThreadNr ( ) , daemonThreadFactory ) ; } else if ( "cached" . equalsIgnoreCase ( mode ) ) { executor = Executors . newCachedThreadPool ( daemonThreadFactory ) ; } else { executor = Executors . newSingleThreadExecutor ( daemonThreadFactory ) ; } server . setExecutor ( executor ) ; return server ;
public class DataUri { /** * @ throws IOException , MalformedURLException */ protected void init ( IRI uri ) throws IOException , MalformedURLException { } }
if ( ! uri . getScheme ( ) . equals ( "data" ) ) { throw new IllegalArgumentException ( "The input did not start with data:." ) ; } if ( uri . getRawFragment ( ) != null ) { throw new MalformedURLException ( "Fragment is not allowed for data: URIs according to RFC 2397. But if strictly comply with RFC 3986, ignore this error." ) ; } InputStream is = new PercentDecodingReaderInputStream ( new StringReader ( uri . getRawPath ( ) ) ) ; StringBuilder sb = new StringBuilder ( ) ; State state = State . AT_START ; int i = 0 ; // string counter for ( ; ; i ++ ) { int b = is . read ( ) ; if ( b == - 1 ) { throw new MalformedURLException ( "Premature end of URI." ) ; } if ( b >= 0x80 ) { throw new MalformedURLException ( "Non-ASCII character in MIME type part of the data URI." ) ; } char c = ( char ) b ; sb . append ( c ) ; switch ( state ) { case AT_START : if ( isTokenChar ( c ) ) { state = State . IN_SUPERTYPE ; continue ; } else if ( c == ';' ) { sb . setLength ( 0 ) ; sb . append ( "text/plain;" ) ; state = State . SEMICOLON_SEEN ; continue ; } else if ( c == ',' ) { contentType = "text/plain;charset=US-ASCII" ; inputStream = is ; return ; } else { throw newDatatypeException ( i , "Expected a token character or a semicolon but saw " , c , " instead." ) ; } case IN_SUPERTYPE : if ( isTokenChar ( c ) ) { continue ; } else if ( c == '/' ) { state = State . AT_SUBTYPE_START ; continue ; } else { throw newDatatypeException ( i , "Expected a token character or \u201C/\u201D but saw " , c , " instead." ) ; } case AT_SUBTYPE_START : if ( isTokenChar ( c ) ) { state = State . IN_SUBTYPE ; continue ; } else { throw newDatatypeException ( i , "Expected a token character but saw " , c , " instead." ) ; } case IN_SUBTYPE : if ( isTokenChar ( c ) ) { continue ; } else if ( c == ';' ) { state = State . SEMICOLON_SEEN ; continue ; } else if ( isWhitespace ( c ) ) { state = State . WS_BEFORE_SEMICOLON ; continue ; } else if ( c == ',' ) { contentType = sb . substring ( 0 , sb . length ( ) - 1 ) ; inputStream = is ; return ; } else { throw newDatatypeException ( i , "Expected a token character, whitespace, a semicolon or a comma but saw " , c , " instead." ) ; } case WS_BEFORE_SEMICOLON : if ( isWhitespace ( c ) ) { continue ; } else if ( c == ';' ) { state = State . SEMICOLON_SEEN ; continue ; } else { throw newDatatypeException ( i , "Expected whitespace or a semicolon but saw " , c , " instead." ) ; } case SEMICOLON_SEEN : if ( isWhitespace ( c ) ) { continue ; } else if ( isTokenChar ( c ) ) { state = State . IN_PARAM_NAME ; continue ; } else { throw newDatatypeException ( i , "Expected whitespace or a token character but saw " , c , " instead." ) ; } case IN_PARAM_NAME : if ( isTokenChar ( c ) ) { continue ; } else if ( c == '=' ) { state = State . EQUALS_SEEN ; continue ; } else if ( c == ',' ) { // let ' s see if we had ; base64, int baseFirst = sb . length ( ) - 8 ; if ( baseFirst >= 0 && ";base64," . equals ( sb . substring ( baseFirst , sb . length ( ) ) ) ) { contentType = sb . substring ( 0 , baseFirst ) ; inputStream = new Base64InputStream ( is ) ; return ; } } else { throw newDatatypeException ( i , "Expected an equals sign, a comma or a token character but saw " , c , " instead." ) ; } case EQUALS_SEEN : if ( c == '\"' ) { state = State . IN_QUOTED_STRING ; continue ; } else if ( isTokenChar ( c ) ) { state = State . IN_UNQUOTED_STRING ; continue ; } else { throw newDatatypeException ( i , "Expected a double quote or a token character but saw " , c , " instead." ) ; } case IN_QUOTED_STRING : if ( c == '\\' ) { state = State . IN_QUOTED_PAIR ; continue ; } else if ( c == '\"' ) { state = State . CLOSE_QUOTE_SEEN ; continue ; } else if ( isQDTextChar ( c ) ) { continue ; } else { throw newDatatypeException ( i , "Expected a non-control ASCII character but saw " , c , " instead." ) ; } case IN_QUOTED_PAIR : if ( c <= 127 ) { state = State . IN_QUOTED_STRING ; continue ; } else { throw newDatatypeException ( i , "Expected an ASCII character but saw " , c , " instead." ) ; } case CLOSE_QUOTE_SEEN : if ( c == ';' ) { state = State . SEMICOLON_SEEN ; continue ; } else if ( isWhitespace ( c ) ) { state = State . WS_BEFORE_SEMICOLON ; continue ; } else if ( c == ',' ) { contentType = sb . substring ( 0 , sb . length ( ) - 1 ) ; inputStream = is ; return ; } else { throw newDatatypeException ( i , "Expected an ASCII character but saw " , c , " instead." ) ; } case IN_UNQUOTED_STRING : if ( isTokenChar ( c ) ) { continue ; } else if ( c == ';' ) { state = State . SEMICOLON_SEEN ; continue ; } else if ( isWhitespace ( c ) ) { state = State . WS_BEFORE_SEMICOLON ; continue ; } else if ( c == ',' ) { contentType = sb . substring ( 0 , sb . length ( ) - 1 ) ; inputStream = is ; return ; } else { throw newDatatypeException ( i , "Expected a token character, whitespace, a semicolon, or a comma but saw " , c , " instead." ) ; } } }
public class PageViewKit { /** * 获取web - inf下面的pageviews目录中pathRefRootViews子目录下面的静态页面 * @ param pathRefRootViews 目录 : 加入到 / WEB - INF / pageviews / pathRefRootViews下 * @ param pageName 页面名称 * @ return */ public static String getHTMLPageViewFromWebInf ( String pathRefRootViews , String pageName ) { } }
return getPageView ( WEBINF_DIR , PAGE_VIEW_PATH + pathRefRootViews , pageName , HTML ) ;
public class NagiosNotifier { /** * logs message with status code 2 - critical */ @ Override public void sendError ( String message ) { } }
System . out . print ( "Critical: " + message ) ; System . exit ( 2 ) ;
public class ValidationControl { /** * validates the text value using the list of validators provided by the user * { { @ link # setValidators ( ValidatorBase . . . ) } * @ return true if the value is valid else false */ @ Override public boolean validate ( ) { } }
for ( ValidatorBase validator : validators ) { // source control must be set to allow validators re - usability validator . setSrcControl ( control ) ; validator . validate ( ) ; if ( validator . getHasErrors ( ) ) { activeValidator . set ( validator ) ; return false ; } } activeValidator . set ( null ) ; return true ;
public class DataSiftClient { /** * Validate the given CSDL string against the DataSift API * @ param csdl the CSDL to validate * @ return the results of the validation , use { @ link com . datasift . client . core . Validation # isSuccessful ( ) } to check if * validation was successful or not */ public FutureData < Validation > validate ( String csdl ) { } }
FutureData < Validation > future = new FutureData < Validation > ( ) ; URI uri = newParams ( ) . forURL ( config . newAPIEndpointURI ( VALIDATE ) ) ; POST request = config . http ( ) . POST ( uri , new PageReader ( newRequestCallback ( future , new Validation ( ) , config ) ) ) . form ( "csdl" , csdl ) ; performRequest ( future , request ) ; return future ;
public class Node { /** * Gets the specified property or null if the property is not configured for this Node . * @ param clazz the type of the property * @ return null if the property is not configured * @ since 2.37 */ @ CheckForNull public < T extends NodeProperty > T getNodeProperty ( Class < T > clazz ) { } }
for ( NodeProperty p : getNodeProperties ( ) ) { if ( clazz . isInstance ( p ) ) { return clazz . cast ( p ) ; } } return null ;
public class TangramEngine { /** * Remove all cells in a card with target index * @ param removeIdx target card ' s index * @ since 2.1.0 */ protected void removeBatchBy ( int removeIdx ) { } }
if ( mGroupBasicAdapter != null ) { Pair < Range < Integer > , Card > cardPair = mGroupBasicAdapter . getCardRange ( removeIdx ) ; if ( cardPair != null ) { removeBatchBy ( cardPair . second ) ; } }
public class RxComapiClient { /** * Initialise ComapiImpl client instance . * @ param application Application context . * @ param adapter Observables to callbacks adapter . * @ return Observable returning client instance . */ < T extends RxComapiClient > Observable < T > initialise ( @ NonNull final Application application , CallbackAdapter adapter , @ NonNull final T instance ) { } }
return super . initialise ( application , instance , adapter ) ;
public class FileSystemUtil { /** * Performs the os command . * @ param cmdAttribs the command line parameters * @ param max The maximum limit for the lines returned * @ param timeout The timeout amount in milliseconds or no timeout if the value * is zero or less * @ return the lines returned by the command , converted to lower - case * @ throws IOException if an error occurs */ List < String > performCommand ( final String [ ] cmdAttribs , final int max , final long timeout ) throws IOException { } }
// this method does what it can to avoid the ' Too many open files ' error // based on trial and error and these links : // http : / / bugs . sun . com / bugdatabase / view _ bug . do ? bug _ id = 4784692 // http : / / bugs . sun . com / bugdatabase / view _ bug . do ? bug _ id = 4801027 // http : / / forum . java . sun . com / thread . jspa ? threadID = 533029 & messageID = 2572018 // however , its still not perfect as the JDK support is so poor // ( see commons - exec or Ant for a better multi - threaded multi - os solution ) final List < String > lines = new ArrayList < String > ( 20 ) ; Process proc = null ; InputStream in = null ; OutputStream out = null ; InputStream err = null ; BufferedReader inr = null ; try { final Thread monitor = ThreadMonitor . start ( timeout ) ; proc = openProcess ( cmdAttribs ) ; in = proc . getInputStream ( ) ; out = proc . getOutputStream ( ) ; err = proc . getErrorStream ( ) ; // default charset is most likely appropriate here inr = new BufferedReader ( new InputStreamReader ( in , Charset . defaultCharset ( ) ) ) ; String line = inr . readLine ( ) ; while ( line != null && lines . size ( ) < max ) { line = line . toLowerCase ( Locale . ENGLISH ) . trim ( ) ; lines . add ( line ) ; line = inr . readLine ( ) ; } proc . waitFor ( ) ; ThreadMonitor . stop ( monitor ) ; if ( proc . exitValue ( ) != 0 ) { // os command problem , throw exception throw new IOException ( "Command line returned OS error code '" + proc . exitValue ( ) + "' for command " + Arrays . asList ( cmdAttribs ) ) ; } if ( lines . isEmpty ( ) ) { // unknown problem , throw exception throw new IOException ( "Command line did not return any info " + "for command " + Arrays . asList ( cmdAttribs ) ) ; } return lines ; } catch ( final InterruptedException ex ) { throw new IOException ( "Command line threw an InterruptedException " + "for command " + Arrays . asList ( cmdAttribs ) + " timeout=" + timeout , ex ) ; } finally { IOUtil . closeQuietly ( in ) ; IOUtil . closeQuietly ( out ) ; IOUtil . closeQuietly ( err ) ; IOUtil . closeQuietly ( inr ) ; if ( proc != null ) { proc . destroy ( ) ; } }
public class BasicModMixer { /** * This Method now takes the current Period ( e . g . 856 < < 4 ) and calculates the * playerTuning to be used . I . e . a value like 2 , which means every second sample in the * current instrument is to be played . A value of 0.5 means , every sample is played twice . * As we use int - values , this again is shiftet . * @ param aktMemo * @ param newPeriod */ protected void setNewPlayerTuningFor ( final ChannelMemory aktMemo , final int newPeriod ) { } }
if ( newPeriod <= 0 ) aktMemo . currentTuning = 0 ; else if ( frequencyTableType == Helpers . XM_LINEAR_TABLE ) { final int xm_period_value = newPeriod >> 2 ; int newFrequency = Helpers . lintab [ xm_period_value % 768 ] >> ( xm_period_value / 768 ) ; aktMemo . currentTuning = ( int ) ( ( ( long ) newFrequency << Helpers . SHIFT ) / sampleRate ) ; } else aktMemo . currentTuning = globalTuning / newPeriod ; // in globalTuning , all constant values are already calculated . ( see above )
public class FileManagerImpl { /** * / * Add a new block to the beginning of a free list data structure */ private void add_block_to_freelist ( Block block , int ql_index ) { } }
block . next = ql_heads [ ql_index ] . first_block ; ql_heads [ ql_index ] . first_block = block ; ql_heads [ ql_index ] . length ++ ; if ( ql_heads [ ql_index ] . length == 1 ) { nonempty_lists ++ ; }
public class GetIntegrationResponsesResult { /** * The elements from this collection . * @ param items * The elements from this collection . */ public void setItems ( java . util . Collection < IntegrationResponse > items ) { } }
if ( items == null ) { this . items = null ; return ; } this . items = new java . util . ArrayList < IntegrationResponse > ( items ) ;
public class AbstractObjectFactory { /** * Creates an object given the fully qualified class name , initialized with the specified constructor arguments * corresponding to the parameter types that specifies the exact signature of the constructor used to construct * the object . * @ param < T > the Class type of the created object . * @ param objectTypeName a String indicating the fully qualified class name for the type of object to create . * @ param parameterTypes an array of Class types indicating the signature of the constructor used to create * the object . * @ param args an array of Objects used as constructor arguments to initialize the object . * @ return a newly created object of the given class type initialized with the specified arguments . * @ see # create ( String , Object . . . ) * @ see org . cp . elements . lang . ClassUtils # loadClass ( String ) * @ see java . lang . Class */ @ Override @ SuppressWarnings ( "unchecked" ) public < T > T create ( final String objectTypeName , final Class [ ] parameterTypes , final Object ... args ) { } }
return ( T ) create ( ClassUtils . loadClass ( objectTypeName ) , parameterTypes , args ) ;
public class GitlabAPI { /** * Creates a Group * @ param name The name of the group * @ param path The path for the group * @ return The GitLab Group * @ throws IOException on gitlab api call error */ public GitlabGroup createGroup ( String name , String path ) throws IOException { } }
return createGroup ( name , path , null , null , null ) ;
public class BshClassManager { /** * Get a resource stream using the BeanShell classpath * @ param path should be an absolute path */ public InputStream getResourceAsStream ( String path ) { } }
Object in = null ; if ( externalClassLoader != null ) // classloader wants no leading slash in = externalClassLoader . getResourceAsStream ( path . substring ( 1 ) ) ; if ( in == null ) return Interpreter . class . getResourceAsStream ( path ) ; return ( InputStream ) in ;
public class Ifc4FactoryImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public String convertIfcTendonAnchorTypeEnumToString ( EDataType eDataType , Object instanceValue ) { } }
return instanceValue == null ? null : instanceValue . toString ( ) ;
public class FeedItemAttributeValue { /** * Sets the moneyWithCurrencyValue value for this FeedItemAttributeValue . * @ param moneyWithCurrencyValue * MoneyWithCurrency value . Should be set if feedAttributeId refers * to a feed attribute of type * PRICE . Leave empty to clear an existing PRICE attribute * value . */ public void setMoneyWithCurrencyValue ( com . google . api . ads . adwords . axis . v201809 . cm . MoneyWithCurrency moneyWithCurrencyValue ) { } }
this . moneyWithCurrencyValue = moneyWithCurrencyValue ;
public class Palette { /** * Generate jet color palette . * @ param n the number of colors in the palette . * @ param alpha the parameter in [ 0,1 ] for transparency . */ public static Color [ ] jet ( int n , float alpha ) { } }
int m = ( int ) Math . ceil ( n / 4 ) ; float [ ] u = new float [ 3 * m ] ; for ( int i = 0 ; i < u . length ; i ++ ) { if ( i == 0 ) { u [ i ] = 0.0f ; } else if ( i <= m ) { u [ i ] = i / ( float ) m ; } else if ( i <= 2 * m - 1 ) { u [ i ] = 1.0f ; } else { u [ i ] = ( 3 * m - i ) / ( float ) m ; } } int m2 = m / 2 + m % 2 ; int mod = n % 4 ; int [ ] r = new int [ n ] ; int [ ] g = new int [ n ] ; int [ ] b = new int [ n ] ; for ( int i = 0 ; i < u . length - 1 ; i ++ ) { if ( m2 - mod + i < n ) { g [ m2 - mod + i ] = i + 1 ; } if ( m2 - mod + i + m < n ) { r [ m2 - mod + i + m ] = i + 1 ; } if ( i > 0 && m2 - mod + i < u . length ) { b [ i ] = m2 - mod + i ; } } Color [ ] palette = new Color [ n ] ; for ( int i = 0 ; i < n ; i ++ ) { palette [ i ] = new Color ( u [ r [ i ] ] , u [ g [ i ] ] , u [ b [ i ] ] , alpha ) ; } return palette ;
public class JMStats { /** * Sum number . * @ param < N > the type parameter * @ param numberList the number list * @ return the number */ public static < N extends Number > Number sum ( List < N > numberList ) { } }
return cal ( numberList , doubleStream -> OptionalDouble . of ( doubleStream . sum ( ) ) ) ;
public class ApiOvhDbaaslogs { /** * Returns details of specified input * REST : GET / dbaas / logs / { serviceName } / input / { inputId } * @ param serviceName [ required ] Service name * @ param inputId [ required ] Input ID */ public OvhInput serviceName_input_inputId_GET ( String serviceName , String inputId ) throws IOException { } }
String qPath = "/dbaas/logs/{serviceName}/input/{inputId}" ; StringBuilder sb = path ( qPath , serviceName , inputId ) ; String resp = exec ( qPath , "GET" , sb . toString ( ) , null ) ; return convertTo ( resp , OvhInput . class ) ;
public class JMStats { /** * Cal stats number . * @ param statsString the stats string * @ param numberStream the number stream * @ return the number */ public static Number calStats ( String statsString , LongStream numberStream ) { } }
return StatsField . valueOfAlias ( statsString ) . calStats ( numberStream ) ;
public class LineHeightProperty { /** * The used value of the property is this < code > value < / code > multiplied by the * element ' s font size . Negative values are illegal . */ public CssSetter with ( Double value ) { } }
return new SimpleCssSetter ( CSS_PROPERTY , value != null ? "" + value : null ) ;
public class SecurityContext { /** * Wrap the given executor so that it takes authentication - information and context are inherited to tasks when they * are submitted . */ public static ExecutorService getSecurityContextAwareExecutor ( ExecutorService original ) { } }
SubjectAwareExecutorService subjectAwareExecutor = new SubjectAwareExecutorService ( original ) ; return ThreadLocalUtil . contextAwareExecutor ( subjectAwareExecutor ) ;
public class StringHtmlEncoder { /** * Encodes complete component by calling { @ link UIComponent # encodeAll ( FacesContext ) } . * @ param component component * @ param context { @ link FacesContext } * @ return the rendered string . * @ throws IOException thrown by writer */ public static String encodeComponentWithSurroundingDiv ( final FacesContext context , final UIComponent component ) throws IOException { } }
return encodeComponentWithSurroundingDiv ( context , component , null ) ;
public class JsonFluentAssert { /** * Creates an assert object that only compares given node . * The path is denoted by JSON path , for example . * < code > * assertThatJson ( " { \ " root \ " : { \ " test \ " : [ 1,2,3 ] } } " ) . node ( " root . test [ 0 ] " ) . isEqualTo ( " 1 " ) ; * < / code > * @ param newPath * @ return object comparing only node given by path . */ public JsonFluentAssert node ( String newPath ) { } }
return new JsonFluentAssert ( actual , path . copy ( newPath ) , description , configuration ) ;
public class ChildViewHolder { /** * Returns the adapter position of the Child associated with this ChildViewHolder * @ return The adapter position of the Child if it still exists in the adapter . * RecyclerView . NO _ POSITION if item has been removed from the adapter , * RecyclerView . Adapter . notifyDataSetChanged ( ) has been called after the last * layout pass or the ViewHolder has already been recycled . */ @ UiThread public int getChildAdapterPosition ( ) { } }
int flatPosition = getAdapterPosition ( ) ; if ( mExpandableAdapter == null || flatPosition == RecyclerView . NO_POSITION ) { return RecyclerView . NO_POSITION ; } return mExpandableAdapter . getChildPosition ( flatPosition ) ;
public class UnsafeRow { /** * Copies this row , returning a self - contained UnsafeRow that stores its data in an internal * byte array rather than referencing data stored in a data page . */ @ Override public UnsafeRow copy ( ) { } }
UnsafeRow rowCopy = new UnsafeRow ( numFields ) ; final byte [ ] rowDataCopy = new byte [ sizeInBytes ] ; Platform . copyMemory ( baseObject , baseOffset , rowDataCopy , Platform . BYTE_ARRAY_OFFSET , sizeInBytes ) ; rowCopy . pointTo ( rowDataCopy , Platform . BYTE_ARRAY_OFFSET , sizeInBytes ) ; return rowCopy ;
public class Ifc2x3tc1FactoryImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public String convertIfcProjectOrderRecordTypeEnumToString ( EDataType eDataType , Object instanceValue ) { } }
return instanceValue == null ? null : instanceValue . toString ( ) ;
public class JOGLTypeConversions { /** * Convert polygon modes from GL constants . * @ param g The GL constant . * @ return The value . */ public static JCGLPolygonMode polygonModeFromGL ( final int g ) { } }
switch ( g ) { case GL2GL3 . GL_FILL : return JCGLPolygonMode . POLYGON_FILL ; case GL2GL3 . GL_LINE : return JCGLPolygonMode . POLYGON_LINES ; case GL2GL3 . GL_POINT : return JCGLPolygonMode . POLYGON_POINTS ; default : throw new UnreachableCodeException ( ) ; }
public class EntryAction { /** * If thread is a synchronous call , wait until operation is complete . * There is a little chance that the call back completes before we get * here as well as some other operation changing the entry again . */ public void asyncOperationStarted ( ) { } }
if ( syncThread == Thread . currentThread ( ) ) { synchronized ( entry ) { while ( entry . isProcessing ( ) ) { try { entry . wait ( ) ; } catch ( InterruptedException ex ) { Thread . currentThread ( ) . interrupt ( ) ; } } } } else { entryLocked = false ; }
public class CmsAvailableRoleOrPrincipalTable { /** * Filters the table according to given search string . < p > * @ param search string to be looked for . */ public void filterTable ( String search ) { } }
m_container . removeAllContainerFilters ( ) ; if ( CmsStringUtil . isNotEmptyOrWhitespaceOnly ( search ) ) { if ( CmsStringUtil . isEmptyOrWhitespaceOnly ( m_dialog . getFurtherColumnId ( ) ) ) { m_container . addContainerFilter ( new Or ( new SimpleStringFilter ( PROP_NAME , search , true , false ) ) ) ; } else { m_container . addContainerFilter ( new Or ( new SimpleStringFilter ( PROP_NAME , search , true , false ) , new SimpleStringFilter ( m_dialog . getFurtherColumnId ( ) , search , true , false ) ) ) ; } } if ( ( getValue ( ) != null ) & ! ( ( Set < String > ) getValue ( ) ) . isEmpty ( ) ) { setCurrentPageFirstItemId ( ( ( Set < String > ) getValue ( ) ) . iterator ( ) . next ( ) ) ; }
public class RollupConfig { /** * Fetches the RollupInterval corresponding to the rollup or pre - agg table * name . * @ param table The name of the table to fetch * @ return The RollupInterval object matching the table * @ throws IllegalArgumentException if the table is null or empty * @ throws NoSuchRollupForTableException if the interval was not configured * for the given table */ public RollupInterval getRollupIntervalForTable ( final String table ) { } }
if ( table == null || table . isEmpty ( ) ) { throw new IllegalArgumentException ( "The table name cannot be null or empty" ) ; } final RollupInterval rollup = reverse_intervals . get ( table ) ; if ( rollup == null ) { throw new NoSuchRollupForTableException ( table ) ; } return rollup ;
public class XmlChangeSetReader { /** * Read a < code > RuleSet < / code > from a < code > Reader < / code > . * @ param reader * The reader containing the rule - set . * @ return The rule - set . */ public ChangeSet read ( final Reader reader ) throws SAXException , IOException { } }
return ( ChangeSet ) this . parser . read ( reader ) ;
public class UdpConnection { /** * { @ inheritDoc } */ @ Override public void send ( final SipMessage msg ) { } }
final DatagramPacket pkt = new DatagramPacket ( toByteBuf ( msg ) , getRemoteAddress ( ) ) ; channel ( ) . writeAndFlush ( pkt ) ;
public class MatrixIO { /** * Converts the format of the input { @ code matrix } , returning a temporary * file containing the matrix ' s data in the desired format . * @ param matrix a file containing a matrix to convert * @ param current the format of the { @ code matrix } file * @ param desired the format of the returned matrix file * @ return a matrix file with the same data in the desired format * @ throws IOException if any error occurs while reading the input matrix or * wring the output matrix */ public static File convertFormat ( File matrix , Format current , Format desired ) throws IOException { } }
return convertFormat ( matrix , current , desired , false ) ;
public class XpathUtils { /** * Same as { @ link # asLong ( String , Node ) } but allows an xpath to be passed * in explicitly for reuse . */ public static Long asLong ( String expression , Node node , XPath xpath ) throws XPathExpressionException { } }
String longString = evaluateAsString ( expression , node , xpath ) ; return ( isEmptyString ( longString ) ) ? null : Long . parseLong ( longString ) ;
public class VectorMath { /** * Adds the values from a { @ code CompactSparseVector } to a { @ code Vector } . * Only the non - zero indices will be traversed to save time . * @ param destination The vector to write new values to . * @ param source The vector to read values from . */ private static void subtractSparseValues ( DoubleVector destination , DoubleVector source ) { } }
int [ ] otherIndices = ( ( SparseVector ) source ) . getNonZeroIndices ( ) ; for ( int index : otherIndices ) destination . add ( index , - 1 * source . get ( index ) ) ;
public class DefaultNodeManager { /** * Deploys a network . */ private void doDeployNetwork ( final Message < JsonObject > message ) { } }
Object network = message . body ( ) . getValue ( "network" ) ; if ( network != null ) { if ( network instanceof String ) { doDeployNetwork ( ( String ) network , message ) ; } else if ( network instanceof JsonObject ) { JsonObject jsonNetwork = ( JsonObject ) network ; try { NetworkConfig config = serializer . deserializeObject ( jsonNetwork , NetworkConfig . class ) ; doDeployNetwork ( config , message ) ; } catch ( SerializationException e ) { message . reply ( new JsonObject ( ) . putString ( "status" , "error" ) . putString ( "message" , e . getMessage ( ) ) ) ; } } else { message . reply ( new JsonObject ( ) . putString ( "status" , "error" ) . putString ( "message" , "Invalid network configuration." ) ) ; } } else { message . reply ( new JsonObject ( ) . putString ( "status" , "error" ) . putString ( "message" , "No network specified." ) ) ; }
public class BackupPlanMarshaller { /** * Marshall the given parameter object . */ public void marshall ( BackupPlan backupPlan , ProtocolMarshaller protocolMarshaller ) { } }
if ( backupPlan == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( backupPlan . getBackupPlanName ( ) , BACKUPPLANNAME_BINDING ) ; protocolMarshaller . marshall ( backupPlan . getRules ( ) , RULES_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class StageStateMarshaller { /** * Marshall the given parameter object . */ public void marshall ( StageState stageState , ProtocolMarshaller protocolMarshaller ) { } }
if ( stageState == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( stageState . getStageName ( ) , STAGENAME_BINDING ) ; protocolMarshaller . marshall ( stageState . getInboundTransitionState ( ) , INBOUNDTRANSITIONSTATE_BINDING ) ; protocolMarshaller . marshall ( stageState . getActionStates ( ) , ACTIONSTATES_BINDING ) ; protocolMarshaller . marshall ( stageState . getLatestExecution ( ) , LATESTEXECUTION_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class EJSContainer { /** * d140003.20 return signature change */ private EJBMethodInfoImpl mapMethodInfo ( EJSDeployedSupport s , EJSWrapperBase wrapper , int methodId , String methodSignature ) { } }
final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; // d532639.2 if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "mapMethodInfo(" + methodId + "," + methodSignature + ")" ) ; EJBMethodInfoImpl rtnInfo = null ; // d122418-1 / / d140003.20 s . methodId = methodId ; // 130230 d140003.19 s . ivWrapper = wrapper ; // d366807.1 if ( methodId < 0 ) { if ( methodId == MID_BUSINESS_REMOVE ) { // Internal remove method for business interfaces . F743-29185 rtnInfo = s . ivThreadData . getEJBMethodInfoStack ( ) . get ( "$remove:" , null , wrapper , wrapper . ivInterface == WrapperInterface . BUSINESS_LOCAL ? MethodInterface . LOCAL : MethodInterface . REMOTE , wrapper . bmd . usesBeanManagedTx ? TransactionAttribute . TX_BEAN_MANAGED : TransactionAttribute . TX_NOT_SUPPORTED ) ; rtnInfo . setClassLoader = true ; // d661827 } else { rtnInfo = ivEntityHelper . getPMMethodInfo ( s , wrapper , methodId , methodSignature ) ; } } else // d122418-1 { // d122418-1 // d206696 - Account for case where // methodInfos array is null ( which occurs if WS invocation // API is used on an SLSB with no service endpoint interface defined ) if ( wrapper . methodInfos == null ) throw new IllegalStateException ( "An attempt was made to invoke a method on a bean interface that is not defined." ) ; rtnInfo = wrapper . methodInfos [ methodId ] ; // d122418-1 } if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "mapMethodInfo" ) ; return rtnInfo ; // d122418-1
public class PseudoClassSpecifierChecker { /** * Add { @ code : only - child } elements . * @ see < a href = " http : / / www . w3 . org / TR / css3 - selectors / # only - child - pseudo " > < code > : only - child < / code > pseudo - class < / a > */ private void addOnlyChildElements ( ) { } }
for ( Node node : nodes ) { Index index = helper . getIndexInParent ( node , false ) ; if ( index . size == 1 ) result . add ( node ) ; }
public class NetworkManager { /** * Unwatches a component instance ' s status and context . */ private void unwatchInstance ( final InstanceContext instance , final CountingCompletionHandler < Void > counter ) { } }
Handler < MapEvent < String , String > > watchHandler = watchHandlers . remove ( instance . address ( ) ) ; if ( watchHandler != null ) { data . unwatch ( instance . status ( ) , watchHandler , new Handler < AsyncResult < Void > > ( ) { @ Override public void handle ( AsyncResult < Void > result ) { data . remove ( instance . address ( ) , new Handler < AsyncResult < String > > ( ) { @ Override public void handle ( AsyncResult < String > result ) { if ( result . failed ( ) ) { counter . fail ( result . cause ( ) ) ; } else { counter . succeed ( ) ; } } } ) ; } } ) ; } else { data . remove ( instance . address ( ) , new Handler < AsyncResult < String > > ( ) { @ Override public void handle ( AsyncResult < String > result ) { if ( result . failed ( ) ) { counter . fail ( result . cause ( ) ) ; } else { counter . succeed ( ) ; } } } ) ; }
public class MinSimilarityAffinityMatrixCreator { /** * { @ inheritDoc } */ public MatrixFile calculate ( MatrixFile input , boolean useColumns ) { } }
File matrixFile = input . getFile ( ) ; MatrixIO . Format format = input . getFormat ( ) ; // IMPLEMENTATION NOTE : since the user has requested the matrix be dealt // with as a file , we need to keep the matrix on disk . However , the // input matrix format may not be conducive to efficiently comparing // rows with each other ( e . g . MATLAB _ SPARSE is inefficient ) , so convert // the matrix to a better format . try { LOG . fine ( "Converting input matrix to new format for faster " + "calculation of the affinity matrix" ) ; // Keep the matrix on disk , but convert it to a transposed SVDLIBC // sparse binary , which allows for easier efficient row - by - row // comparisons ( which are really columns ) . Note that if the data is // already in this format , the conversion is a no - op . // NOTE : the ! useColumns is used for the transpose because if we // want to use the rows , we need the data transposed to begin with // since the SVDLIBC sparse binary will give us column information // to start with File converted = MatrixIO . convertFormat ( matrixFile , format , MatrixIO . Format . SVDLIBC_SPARSE_BINARY , ! useColumns ) ; LOG . fine ( "Calculating the affinity matrix" ) ; // Read off the matrix dimensions DataInputStream dis = new DataInputStream ( new BufferedInputStream ( new FileInputStream ( converted ) ) ) ; // CRITICAL NOTE : because we are interpreting the columns as rows , // the dimensions are read in * reverse order * from how they are // stored in the file . int cols = dis . readInt ( ) ; int rows = dis . readInt ( ) ; dis . close ( ) ; // Once we know the matrix dimensions , create an iterator over the // data , and repeatedly loop through the columns ( which are really // rows in the original matrix ) to create the affinity matrix . File affMatrixFile = File . createTempFile ( "affinity-matrix" , ".dat" ) ; PrintWriter affMatrixWriter = new PrintWriter ( affMatrixFile ) ; // Keep track of the first row and have a reference to the next row . // The nextRow reference avoid us having to advance into data // unnecessarily to retrieval the vector for processing to start SparseDoubleVector curRow = null ; SparseDoubleVector nextRow = null ; SvdlibcSparseBinaryFileRowIterator matrixIter = new SvdlibcSparseBinaryFileRowIterator ( converted ) ; for ( int row = 0 ; row < rows ; ++ row ) { LOG . fine ( "computing affinity for row " + row ) ; // Loop through each of the rows , gathering the statistics // necessary to compute the affinity matrix . for ( int other = 0 ; other < rows ; ++ other ) { // Special case for the very first row if ( row == 0 && curRow == null ) { curRow = matrixIter . next ( ) ; continue ; } SparseDoubleVector otherRow = matrixIter . next ( ) ; // Special case for the similarity threshold , which is // symmetric . In this case , we can skip over processing any // rows that occur before the current row if ( other < row ) continue ; // Save the row that will be used next so we have it to do // comparisons with for earlier rows in the file if ( other == row + 1 ) nextRow = otherRow ; // Determine if the current row and the other row should be // linked in the affinity matrix . For code simplicity , both // the k - nearest neighbors and the similarity threshold code // are supported within the I / O , with the caller specifying // which to use . double dataSimilarity = edgeSim . sim ( curRow , otherRow ) ; if ( dataSimilarity > edgeSimThreshold ) { double edgeWeight = kernelSim . sim ( curRow , otherRow ) ; affMatrixWriter . printf ( "%d %d %f\n" , row + 1 , other + 1 , edgeWeight ) ; // If the kernel metric is symmetric , just reuse the // previously calculated edge weight . Otherwise // recalculate it . edgeWeight = ( kernelSim . isSymmetric ( ) ) ? edgeWeight : kernelSim . sim ( otherRow , curRow ) ; affMatrixWriter . printf ( "%d %d %f\n" , other + 1 , row + 1 , edgeWeight ) ; } } curRow = nextRow ; matrixIter . reset ( ) ; } // Finish writing the matrix affMatrixWriter . close ( ) ; return new MatrixFile ( affMatrixFile , MatrixIO . Format . MATLAB_SPARSE ) ; } catch ( IOException ioe ) { throw new IOError ( ioe ) ; }
public class LocaleSelectorImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public void setLangCode ( String newLangCode ) { } }
String oldLangCode = langCode ; langCode = newLangCode ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , AfplibPackage . LOCALE_SELECTOR__LANG_CODE , oldLangCode , langCode ) ) ;
public class ResourceManager { /** * Find the resources in { @ link # resourcesGraph } matching the given { @ code query } . * @ param query a location eventually containing wildcards * @ param locationResolver the { @ link LocationResolver } to perform the matching of graph nodes against the given * { @ code query } * @ return an unmodifiable list of { @ link Resources } that match the given { @ code query } */ public List < Resource < L > > findResources ( L query , LocationResolver < L > locationResolver ) { } }
graphLockRead . lock ( ) ; try { List < Resource < L > > result = new ArrayList < Resource < L > > ( ) ; GraphIterator < Resource < L > , DefaultEdge > it = new BreadthFirstIterator < Resource < L > , DefaultEdge > ( this . resourcesGraph ) ; while ( it . hasNext ( ) ) { Resource < L > resource = it . next ( ) ; if ( locationResolver . matches ( query , resource . getLocation ( ) ) ) { result . add ( resource ) ; } } return Collections . unmodifiableList ( result ) ; } finally { graphLockRead . unlock ( ) ; }
public class BMSClient { /** * Initializes the SDK with supplied parameters . * This method should be called before you send the first request * @ param context Android application context * @ param bluemixRegion Specifies the Bluemix region to use . Use values in BMSClient . REGION * static props . * @ throws MalformedURLException { @ code backendRoute } could not be parsed as a URL . */ public void initialize ( Context context , String bluemixRegion ) { } }
this . bluemixRegionSuffix = bluemixRegion ; // Change this if we ever support retries with multiple regions if ( null == this . authorizationManager ) { this . authorizationManager = new DummyAuthorizationManager ( context ) ; } Request . setCookieManager ( cookieManager ) ; cookieManager . setCookiePolicy ( CookiePolicy . ACCEPT_ALL ) ;
public class NonLockingAltContainer { /** * this is called directly from tests but shouldn ' t be accessed otherwise . */ @ Override public void dispatch ( final KeyedMessage message , final boolean block ) throws IllegalArgumentException , ContainerException { } }
if ( ! isRunningLazy ) { LOGGER . debug ( "Dispacth called on stopped container" ) ; statCollector . messageFailed ( false ) ; } if ( message == null ) return ; // No . We didn ' t process the null message if ( message . message == null ) throw new IllegalArgumentException ( "the container for " + clusterId + " attempted to dispatch null message." ) ; if ( message . key == null ) throw new ContainerException ( "Message " + objectDescription ( message . message ) + " contains no key." ) ; if ( ! inbound . doesMessageKeyBelongToNode ( message . key ) ) { if ( LOGGER . isDebugEnabled ( ) ) LOGGER . debug ( "Message with key " + SafeString . objectDescription ( message . key ) + " sent to wrong container. " ) ; statCollector . messageFailed ( false ) ; return ; } numBeingWorked . incrementAndGet ( ) ; boolean instanceDone = false ; while ( ! instanceDone ) { instanceDone = true ; final InstanceWrapper wrapper = getInstanceForKey ( message . key ) ; // wrapper will be null if the activate returns ' false ' if ( wrapper != null ) { final MutRef < WorkingQueueHolder > mref = new MutRef < > ( ) ; boolean messageDone = false ; while ( ! messageDone ) { messageDone = true ; final WorkingQueueHolder mailbox = setIfAbsent ( wrapper . mailbox , ( ) -> mref . set ( new WorkingQueueHolder ( false ) ) ) ; // if mailbox is null then I got it . if ( mailbox == null ) { final WorkingQueueHolder box = mref . ref ; // can ' t be null if I got the mailbox final LinkedList < KeyedMessage > q = getQueue ( box ) ; // spin until I get the queue KeyedMessage toProcess = pushPop ( q , message ) ; box . queue . lazySet ( q ) ; // put the queue back while ( toProcess != null ) { invokeOperation ( wrapper . instance , Operation . handle , toProcess ) ; numBeingWorked . getAndDecrement ( ) ; // get the next message final LinkedList < KeyedMessage > queue = getQueue ( box ) ; if ( queue . size ( ) == 0 ) // we need to leave the queue out break ; toProcess = queue . removeFirst ( ) ; box . queue . lazySet ( queue ) ; } // release the mailbox wrapper . mailbox . set ( null ) ; } else { // we didn ' t get exclusive access so let ' s see if we can add the message to the mailbox // make one try at putting the message in the mailbox . final LinkedList < KeyedMessage > q = mailbox . queue . getAndSet ( null ) ; if ( q != null ) { // I got it ! q . add ( message ) ; mailbox . queue . lazySet ( q ) ; } else { // see if we ' re evicted . if ( wrapper . evicted ) { instanceDone = false ; break ; // start back at getting the instance . } messageDone = false ; // start over from the top . } } } } else { // if we got here then the activate on the Mp explicitly returned ' false ' if ( LOGGER . isDebugEnabled ( ) ) LOGGER . debug ( "the container for " + clusterId + " failed to activate the Mp for " + SafeString . valueOf ( prototype ) ) ; // we consider this " processed " break ; // leave the do / while loop } }
public class snmpview { /** * Use this API to delete snmpview . */ public static base_response delete ( nitro_service client , snmpview resource ) throws Exception { } }
snmpview deleteresource = new snmpview ( ) ; deleteresource . name = resource . name ; deleteresource . subtree = resource . subtree ; return deleteresource . delete_resource ( client ) ;
public class VelocityTemplateGroup { /** * Public */ public VelocityTemplate addTemplate ( VelocityTemplate template ) { } }
addTemplateProperties ( template ) ; this . templates . add ( template ) ; return template ;
public class DeviceImpl { /** * Get status * @ return status * @ throws DevFailed */ public String getStatus ( ) throws DevFailed { } }
MDC . setContextMap ( contextMap ) ; xlogger . entry ( ) ; if ( initImpl . isInitInProgress ( ) ) { // set status while init is in progress final String tmp = statusImpl . updateStatus ( DeviceState . getDeviceState ( getState ( ) ) ) ; if ( tmp . equals ( Constants . INIT_IN_PROGRESS ) ) { status = tmp ; } else { status = Constants . INIT_IN_PROGRESS + System . getProperty ( "line.separator" ) + tmp ; } } else if ( isCorrectlyInit . get ( ) && initImpl . isInitDoneCorrectly ( ) ) { // init finished status = statusImpl . updateStatus ( DeviceState . getDeviceState ( getState ( ) ) ) ; } else { // init failed status = statusImpl . getStatus ( ) ; } return status ;
public class FieldCoordinates { /** * Creates new field coordinates * @ param parentType the container of the field * @ param fieldName the field name * @ return new field coordinates represented by the two parameters */ public static FieldCoordinates coordinates ( String parentType , String fieldName ) { } }
assertValidName ( parentType ) ; assertValidName ( fieldName ) ; return new FieldCoordinates ( parentType , fieldName ) ;
public class ProtoNetworkBuilder { /** * Build a { @ link Set } of { @ link AnnotationPair } objects from a { @ link Map } * of { @ link Annotation } values . * @ param protoNetwork { @ link ProtoNetwork } , the proto network * @ param annotationMap { @ link Map } , the annotations map * @ return { @ link Set } , the { @ link Set } of annotation definition and value * pairs */ protected Set < AnnotationPair > buildAnnotationPairs ( ProtoNetwork protoNetwork , Map < String , Annotation > annotationMap ) { } }
// build annotation value to annotation definition map Set < AnnotationPair > valueDefinitions = new LinkedHashSet < AnnotationPair > ( ) ; AnnotationValueTable avt = protoNetwork . getAnnotationValueTable ( ) ; AnnotationDefinitionTable adt = protoNetwork . getAnnotationDefinitionTable ( ) ; Set < Annotation > annotationMapValues = new HashSet < Annotation > ( annotationMap . values ( ) ) ; for ( Annotation a : annotationMapValues ) { int adid = adt . getDefinitionIndex ( ) . get ( new TableAnnotationDefinition ( a . getDefinition ( ) ) ) ; int aid = avt . addAnnotationValue ( adid , a . getValue ( ) ) ; valueDefinitions . add ( new AnnotationPair ( adid , aid ) ) ; } return valueDefinitions ;
public class ClusterManager { /** * Checks if a pending request can be fulfilled . */ private void checkPendingRequests ( ) { } }
final Iterator < Map . Entry < JobID , PendingRequestsMap > > it = this . pendingRequestsOfJob . entrySet ( ) . iterator ( ) ; while ( it . hasNext ( ) ) { final List < AllocatedResource > allocatedResources = new ArrayList < AllocatedResource > ( ) ; final Map . Entry < JobID , PendingRequestsMap > entry = it . next ( ) ; final JobID jobID = entry . getKey ( ) ; final PendingRequestsMap pendingRequestsMap = entry . getValue ( ) ; final Iterator < Map . Entry < InstanceType , Integer > > it2 = pendingRequestsMap . iterator ( ) ; while ( it2 . hasNext ( ) ) { final Map . Entry < InstanceType , Integer > entry2 = it2 . next ( ) ; final InstanceType requestedInstanceType = entry2 . getKey ( ) ; int numberOfPendingInstances = entry2 . getValue ( ) . intValue ( ) ; // Consistency check if ( numberOfPendingInstances <= 0 ) { LOG . error ( "Inconsistency: Job " + jobID + " has " + numberOfPendingInstances + " requests for instance type " + requestedInstanceType . getIdentifier ( ) ) ; continue ; } while ( numberOfPendingInstances > 0 ) { if ( LOG . isDebugEnabled ( ) ) { LOG . debug ( "Trying to allocate instance of type " + requestedInstanceType . getIdentifier ( ) ) ; } // TODO : Introduce topology awareness here final AllocatedSlice slice = getSliceOfType ( jobID , requestedInstanceType ) ; if ( slice == null ) { break ; } else { LOG . info ( "Allocated instance of type " + requestedInstanceType . getIdentifier ( ) + " as a result of pending request for job " + jobID ) ; // Decrease number of pending instances -- numberOfPendingInstances ; pendingRequestsMap . decreaseNumberOfPendingInstances ( requestedInstanceType ) ; List < AllocatedSlice > allocatedSlices = this . slicesOfJobs . get ( jobID ) ; if ( allocatedSlices == null ) { allocatedSlices = new ArrayList < AllocatedSlice > ( ) ; this . slicesOfJobs . put ( jobID , allocatedSlices ) ; } allocatedSlices . add ( slice ) ; allocatedResources . add ( new AllocatedResource ( slice . getHostingInstance ( ) , slice . getType ( ) , slice . getAllocationID ( ) ) ) ; } } } if ( ! allocatedResources . isEmpty ( ) && this . instanceListener != null ) { final ClusterInstanceNotifier clusterInstanceNotifier = new ClusterInstanceNotifier ( this . instanceListener , jobID , allocatedResources ) ; clusterInstanceNotifier . start ( ) ; } }
public class ProjectTaskScreen { /** * Add button ( s ) to the toolbar . */ public void addToolbarButtons ( ToolScreen toolScreen ) { } }
super . addToolbarButtons ( toolScreen ) ; new SCannedBox ( toolScreen . getNextLocation ( ScreenConstants . NEXT_LOGICAL , ScreenConstants . SET_ANCHOR ) , toolScreen , null , ScreenConstants . DEFAULT_DISPLAY , null , ProjectTask . PROJECT_PREDECESSOR_DETAIL_SCREEN , MenuConstants . FORMDETAIL , ProjectTask . PROJECT_PREDECESSOR_DETAIL_SCREEN , ProjectTask . PROJECT_PREDECESSOR_DETAIL_SCREEN ) ; new SCannedBox ( toolScreen . getNextLocation ( ScreenConstants . NEXT_LOGICAL , ScreenConstants . SET_ANCHOR ) , toolScreen , null , ScreenConstants . DEFAULT_DISPLAY , null , ProjectTask . PROJECT_TASK_CALENDAR_SCREEN , JCalendarPopup . CALENDAR_ICON , ProjectTask . PROJECT_TASK_CALENDAR_SCREEN , ProjectTask . PROJECT_TASK_CALENDAR_SCREEN ) ;
public class AbstractSQLUpdateClause { /** * Populate the UPDATE clause with the properties of the given bean using the given Mapper . * @ param obj object to use for population * @ param mapper mapper to use * @ return the current object */ @ SuppressWarnings ( { } }
"rawtypes" , "unchecked" } ) @ WithBridgeMethods ( value = SQLUpdateClause . class , castRequired = true ) public < T > C populate ( T obj , Mapper < T > mapper ) { Collection < ? extends Path < ? > > primaryKeyColumns = entity . getPrimaryKey ( ) != null ? entity . getPrimaryKey ( ) . getLocalColumns ( ) : Collections . < Path < ? > > emptyList ( ) ; Map < Path < ? > , Object > values = mapper . createMap ( entity , obj ) ; for ( Map . Entry < Path < ? > , Object > entry : values . entrySet ( ) ) { if ( ! primaryKeyColumns . contains ( entry . getKey ( ) ) ) { set ( ( Path ) entry . getKey ( ) , entry . getValue ( ) ) ; } } return ( C ) this ;
public class TreeMap { /** * Customized deserialization . * @ param objectInputStreamIn containing the TreeMap . * @ throws java . io . IOException * @ throws java . lang . ClassNotFoundException */ private void readObject ( java . io . ObjectInputStream objectInputStreamIn ) throws java . io . IOException , java . lang . ClassNotFoundException { } }
if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . entry ( this , cclass , "readObject" , "objectInputStreamIn=" + objectInputStreamIn + "(java.io.ObjectInputStream)" ) ; objectInputStreamIn . defaultReadObject ( ) ; availableSize = size ; // Start as last commited . managedObjectsToAdd = new java . util . HashSet ( 1 ) ; managedObjectsToReplace = new java . util . HashSet ( ) ; tokensToNotify = new java . util . HashSet ( 1 ) ; // Holds the set of tokens to notify about replacements . if ( Tracing . isAnyTracingEnabled ( ) && trace . isEntryEnabled ( ) ) trace . exit ( this , cclass , "readObject" ) ;
public class StaleIpPermission { /** * The security group pairs . Returns the ID of the referenced security group and VPC , and the ID and status of the * VPC peering connection . * @ param userIdGroupPairs * The security group pairs . Returns the ID of the referenced security group and VPC , and the ID and status * of the VPC peering connection . */ public void setUserIdGroupPairs ( java . util . Collection < UserIdGroupPair > userIdGroupPairs ) { } }
if ( userIdGroupPairs == null ) { this . userIdGroupPairs = null ; return ; } this . userIdGroupPairs = new com . amazonaws . internal . SdkInternalList < UserIdGroupPair > ( userIdGroupPairs ) ;
public class MD5Digest { /** * Static method to get an MD5Digest from a human - readable string representation * @ param md5String * @ return a filled out MD5Digest */ public static MD5Digest fromString ( String md5String ) { } }
byte [ ] bytes ; try { bytes = Hex . decodeHex ( md5String . toCharArray ( ) ) ; return new MD5Digest ( md5String , bytes ) ; } catch ( DecoderException e ) { throw new IllegalArgumentException ( "Unable to convert md5string" , e ) ; }
public class List { /** * Gets the value of the listItemOrX property . * This accessor method returns a reference to the live list , * not a snapshot . Therefore any modification you make to the * returned list will be present inside the JAXB object . * This is why there is not a < CODE > set < / CODE > method for the listItemOrX property . * For example , to add a new item , do as follows : * < pre > * getListItemOrX ( ) . add ( newItem ) ; * < / pre > * Objects of the following type ( s ) are allowed in the list * { @ link ListItem } * { @ link X } */ public java . util . List < Object > getListItemOrX ( ) { } }
if ( listItemOrX == null ) { listItemOrX = new ArrayList < Object > ( ) ; } return this . listItemOrX ;
public class PromisesArray { /** * Map promises results to new promises * @ param fun mapping function * @ param < R > type of result promises * @ return PromisesArray */ public < R > PromisesArray < R > map ( final Function < T , Promise < R > > fun ) { } }
return mapSourcePromises ( srcPromise -> new Promise < R > ( resolver -> { srcPromise . then ( t -> { Promise < R > mapped = fun . apply ( t ) ; mapped . then ( t2 -> resolver . result ( t2 ) ) ; mapped . failure ( e -> resolver . error ( e ) ) ; } ) ; srcPromise . failure ( e -> resolver . error ( e ) ) ; } ) ) ;
public class CheckpointCoordinator { /** * Adds the given master hook to the checkpoint coordinator . This method does nothing , if * the checkpoint coordinator already contained a hook with the same ID ( as defined via * { @ link MasterTriggerRestoreHook # getIdentifier ( ) } ) . * @ param hook The hook to add . * @ return True , if the hook was added , false if the checkpoint coordinator already * contained a hook with the same ID . */ public boolean addMasterHook ( MasterTriggerRestoreHook < ? > hook ) { } }
checkNotNull ( hook ) ; final String id = hook . getIdentifier ( ) ; checkArgument ( ! StringUtils . isNullOrWhitespaceOnly ( id ) , "The hook has a null or empty id" ) ; synchronized ( lock ) { if ( ! masterHooks . containsKey ( id ) ) { masterHooks . put ( id , hook ) ; return true ; } else { return false ; } }
public class ImplicitObjectUtil { /** * Load the output form bean into the request . * @ param request the request * @ param bean the output form bean */ public static void loadOutputFormBean ( ServletRequest request , Object bean ) { } }
if ( bean != null ) request . setAttribute ( OUTPUT_FORM_BEAN_OBJECT_KEY , bean ) ;
public class JsonParser { /** * Returns the next value from the JSON stream as a parse tree . * @ throws JsonParseException if there is an IOException or if the specified * text is not valid JSON */ public static JsonElement parseReader ( JsonReader reader ) throws JsonIOException , JsonSyntaxException { } }
boolean lenient = reader . isLenient ( ) ; reader . setLenient ( true ) ; try { return Streams . parse ( reader ) ; } catch ( StackOverflowError e ) { throw new JsonParseException ( "Failed parsing JSON source: " + reader + " to Json" , e ) ; } catch ( OutOfMemoryError e ) { throw new JsonParseException ( "Failed parsing JSON source: " + reader + " to Json" , e ) ; } finally { reader . setLenient ( lenient ) ; }
public class PointInTimeRecoverySpecificationMarshaller { /** * Marshall the given parameter object . */ public void marshall ( PointInTimeRecoverySpecification pointInTimeRecoverySpecification , ProtocolMarshaller protocolMarshaller ) { } }
if ( pointInTimeRecoverySpecification == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( pointInTimeRecoverySpecification . getPointInTimeRecoveryEnabled ( ) , POINTINTIMERECOVERYENABLED_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class CommandLine { /** * Delegates to { @ link # call ( Callable , PrintStream , PrintStream , Help . Ansi , String . . . ) } with { @ code System . err } for * diagnostic error messages and { @ link Help . Ansi # AUTO } . * @ param callable the command to call when { @ linkplain # parseArgs ( String . . . ) parsing } succeeds . * @ param out the printStream to print the usage help message to when the user requested help * @ param args the command line arguments to parse * @ param < C > the annotated object must implement Callable * @ param < T > the return type of the most specific command ( must implement { @ code Callable } ) * @ throws InitializationException if the specified command object does not have a { @ link Command } , { @ link Option } or { @ link Parameters } annotation * @ throws ExecutionException if the Callable throws an exception * @ return { @ code null } if an error occurred while parsing the command line options , or if help was requested and printed . Otherwise returns the result of calling the Callable * @ deprecated use { @ link # execute ( String . . . ) } instead * @ see RunLast */ @ Deprecated public static < C extends Callable < T > , T > T call ( C callable , PrintStream out , String ... args ) { } }
return call ( callable , out , System . err , Help . Ansi . AUTO , args ) ;
public class TasksImpl { /** * Terminates the specified task . * When the task has been terminated , it moves to the completed state . For multi - instance tasks , the terminate task operation applies synchronously to the primary task ; subtasks are then terminated asynchronously in the background . * @ param jobId The ID of the job containing the task . * @ param taskId The ID of the task to terminate . * @ param taskTerminateOptions Additional parameters for the operation * @ throws IllegalArgumentException thrown if parameters fail the validation * @ throws BatchErrorException thrown if the request is rejected by server * @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent */ public void terminate ( String jobId , String taskId , TaskTerminateOptions taskTerminateOptions ) { } }
terminateWithServiceResponseAsync ( jobId , taskId , taskTerminateOptions ) . toBlocking ( ) . single ( ) . body ( ) ;
public class AWSGreengrassClient { /** * Retrieves information about a core definition version . * @ param getCoreDefinitionVersionRequest * @ return Result of the GetCoreDefinitionVersion operation returned by the service . * @ throws BadRequestException * invalid request * @ sample AWSGreengrass . GetCoreDefinitionVersion * @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / greengrass - 2017-06-07 / GetCoreDefinitionVersion " * target = " _ top " > AWS API Documentation < / a > */ @ Override public GetCoreDefinitionVersionResult getCoreDefinitionVersion ( GetCoreDefinitionVersionRequest request ) { } }
request = beforeClientExecution ( request ) ; return executeGetCoreDefinitionVersion ( request ) ;
public class CrystalBuilder { /** * Apply the NCS operators in the given Structure adding new chains as needed . * All chains are ( re ) assigned ids of the form : original _ chain _ id + ncs _ operator _ index + { @ value # NCS _ CHAINID _ SUFFIX _ CHAR } . * @ param structure * the structure to expand * @ param chainOrigNames * new chain names mapped to the original chain names * @ param chainNcsOps * new chain names mapped to the ncs operators that was used to generate them * @ since 5.0.0 */ public static void expandNcsOps ( Structure structure , Map < String , String > chainOrigNames , Map < String , Matrix4d > chainNcsOps ) { } }
PDBCrystallographicInfo xtalInfo = structure . getCrystallographicInfo ( ) ; if ( xtalInfo == null ) return ; if ( xtalInfo . getNcsOperators ( ) == null || xtalInfo . getNcsOperators ( ) . length == 0 ) return ; List < Chain > chainsToAdd = new ArrayList < > ( ) ; Matrix4d identity = new Matrix4d ( ) ; identity . setIdentity ( ) ; Matrix4d [ ] ncsOps = xtalInfo . getNcsOperators ( ) ; for ( Chain c : structure . getChains ( ) ) { String cOrigId = c . getId ( ) ; String cOrigName = c . getName ( ) ; for ( int iOperator = 0 ; iOperator < ncsOps . length ; iOperator ++ ) { Matrix4d m = ncsOps [ iOperator ] ; Chain clonedChain = ( Chain ) c . clone ( ) ; String newChainId = cOrigId + ( iOperator + 1 ) + NCS_CHAINID_SUFFIX_CHAR ; String newChainName = cOrigName + ( iOperator + 1 ) + NCS_CHAINID_SUFFIX_CHAR ; clonedChain . setId ( newChainId ) ; clonedChain . setName ( newChainName ) ; setChainIdsInResidueNumbers ( clonedChain , newChainName ) ; Calc . transform ( clonedChain , m ) ; chainsToAdd . add ( clonedChain ) ; c . getEntityInfo ( ) . addChain ( clonedChain ) ; chainOrigNames . put ( newChainName , cOrigName ) ; chainNcsOps . put ( newChainName , m ) ; } chainNcsOps . put ( cOrigName , identity ) ; chainOrigNames . put ( cOrigName , cOrigName ) ; } chainsToAdd . forEach ( structure :: addChain ) ;
public class BitUtil { /** * Returns the popcount or cardinality of the two sets after an intersection . * Neither array is modified . */ public static long pop_intersect ( long [ ] arr1 , long [ ] arr2 , int wordOffset , int numWords ) { } }
long popCount = 0 ; for ( int i = wordOffset , end = wordOffset + numWords ; i < end ; ++ i ) { popCount += Long . bitCount ( arr1 [ i ] & arr2 [ i ] ) ; } return popCount ;
public class EmbeddedProcessFactory { /** * Create an embedded host controller with an already established module loader . * @ param moduleLoader the module loader . Cannot be { @ code null } * @ param jbossHomeDir the location of the root of server installation . Cannot be { @ code null } or empty . * @ param cmdargs any additional arguments to pass to the embedded host controller ( e . g . - b = 192.168.100.10) * @ return the running host controller Will not be { @ code null } */ public static HostController createHostController ( ModuleLoader moduleLoader , File jbossHomeDir , String [ ] cmdargs ) { } }
return createHostController ( Configuration . Builder . of ( jbossHomeDir ) . setModuleLoader ( moduleLoader ) . setCommandArguments ( cmdargs ) . build ( ) ) ;
public class RecurrenceUtility { /** * Converts the string representation of the days bit field into an integer . * @ param days string bit field * @ return integer bit field */ public static Integer getDays ( String days ) { } }
Integer result = null ; if ( days != null ) { result = Integer . valueOf ( Integer . parseInt ( days , 2 ) ) ; } return ( result ) ;