signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class ResourceSpecificResult { /** * Additional details about the results of the evaluation decision . When there are both IAM policies and resource * policies , this parameter explains how each set of policies contributes to the final evaluation decision . When * simulating cross - account access to a resource , both the resource - based policy and the caller ' s IAM policy must * grant access . * @ param evalDecisionDetails * Additional details about the results of the evaluation decision . When there are both IAM policies and * resource policies , this parameter explains how each set of policies contributes to the final evaluation * decision . When simulating cross - account access to a resource , both the resource - based policy and the * caller ' s IAM policy must grant access . * @ return Returns a reference to this object so that method calls can be chained together . */ public ResourceSpecificResult withEvalDecisionDetails ( java . util . Map < String , String > evalDecisionDetails ) { } }
setEvalDecisionDetails ( evalDecisionDetails ) ; return this ;
public class QualityAnalyzer { /** * @ param bestSol * @ param topology * @ param cloudCharacteristics * @ return The calculated availability of the system . * This method will be recursive . The availablity of the system will * be the product of the availability of its first module and the * modules it requests . It will not work if there are cycles in the * topology */ public double computeAvailability ( Solution bestSol , Topology topology , SuitableOptions cloudCharacteristics ) { } }
visited = new HashSet < String > ( ) ; TopologyElement initialElement = topology . getInitialElement ( ) ; visited . add ( initialElement . getName ( ) ) ; String cloudUsedInitialElement = bestSol . getCloudOfferNameForModule ( initialElement . getName ( ) ) ; double instancesUsedInitialElement = - 1 ; try { instancesUsedInitialElement = bestSol . getCloudInstancesForModule ( initialElement . getName ( ) ) ; } catch ( Exception E ) { // nothing to do } double availabilityInitialElementInstance = cloudCharacteristics . getCloudCharacteristics ( initialElement . getName ( ) , cloudUsedInitialElement ) . getAvailability ( ) ; double unavailabilityInitialElement = Math . pow ( ( 1.0 - availabilityInitialElementInstance ) , instancesUsedInitialElement ) ; double availabilityInitialElement = 1.0 - unavailabilityInitialElement ; double systemAvailability = availabilityInitialElement ; for ( TopologyElementCalled c : topology . getInitialElement ( ) . getDependences ( ) ) { systemAvailability = systemAvailability * calculateAvailabilityRecursive ( c , bestSol , topology , cloudCharacteristics ) ; } if ( log . isDebugEnabled ( ) ) { log . debug ( "Finished calculation of availability of solution: " + bestSol . toString ( ) ) ; } // after computing , save the availability info in properties . availability properties . setAvailability ( systemAvailability ) ; return systemAvailability ;
public class NameTable { /** * Gets the name of the variable as it is declared in ObjC , fully qualified . */ public String getVariableQualifiedName ( VariableElement var ) { } }
String shortName = getVariableShortName ( var ) ; if ( ElementUtil . isGlobalVar ( var ) ) { String className = getFullName ( ElementUtil . getDeclaringClass ( var ) ) ; if ( ElementUtil . isEnumConstant ( var ) ) { // Enums are declared in an array , so we use a macro to shorten the // array access expression . return "JreEnum(" + className + ", " + shortName + ")" ; } return className + '_' + shortName ; } return shortName ;
public class HeaderHandler { /** * Add the generic value to this handler with no required key . * @ param inputValue * @ return boolean ( true means success adding ) */ public boolean add ( String inputValue ) { } }
String value = Normalizer . normalize ( inputValue , Normalizer . NORMALIZE_LOWER ) ; if ( ! contains ( this . genericValues , value ) ) { addElement ( value ) ; return true ; } return false ;
public class MarkLogicRepositoryConnection { /** * add triple statements * @ param statements * @ param contexts * @ throws RepositoryException */ @ Override public void add ( Iterable < ? extends Statement > statements , Resource ... contexts ) throws RepositoryException { } }
Iterator < ? extends Statement > iter = statements . iterator ( ) ; while ( iter . hasNext ( ) ) { Statement st = iter . next ( ) ; add ( st , mergeResource ( st . getContext ( ) , contexts ) ) ; }
public class StorageAccountsInner { /** * List service SAS credentials of a specific resource . * @ param resourceGroupName The name of the resource group within the user ' s subscription . The name is case insensitive . * @ param accountName The name of the storage account within the specified resource group . Storage account names must be between 3 and 24 characters in length and use numbers and lower - case letters only . * @ param parameters The parameters to provide to list service SAS credentials . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the ListServiceSasResponseInner object */ public Observable < ServiceResponse < ListServiceSasResponseInner > > listServiceSASWithServiceResponseAsync ( String resourceGroupName , String accountName , ServiceSasParameters parameters ) { } }
if ( resourceGroupName == null ) { throw new IllegalArgumentException ( "Parameter resourceGroupName is required and cannot be null." ) ; } if ( accountName == null ) { throw new IllegalArgumentException ( "Parameter accountName is required and cannot be null." ) ; } if ( this . client . subscriptionId ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.subscriptionId() is required and cannot be null." ) ; } if ( parameters == null ) { throw new IllegalArgumentException ( "Parameter parameters is required and cannot be null." ) ; } if ( this . client . apiVersion ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.apiVersion() is required and cannot be null." ) ; } Validator . validate ( parameters ) ; return service . listServiceSAS ( resourceGroupName , accountName , this . client . subscriptionId ( ) , parameters , this . client . apiVersion ( ) , this . client . acceptLanguage ( ) , this . client . userAgent ( ) ) . flatMap ( new Func1 < Response < ResponseBody > , Observable < ServiceResponse < ListServiceSasResponseInner > > > ( ) { @ Override public Observable < ServiceResponse < ListServiceSasResponseInner > > call ( Response < ResponseBody > response ) { try { ServiceResponse < ListServiceSasResponseInner > clientResponse = listServiceSASDelegate ( response ) ; return Observable . just ( clientResponse ) ; } catch ( Throwable t ) { return Observable . error ( t ) ; } } } ) ;
public class ScopedAttributeResolver { /** * side effect : modifies the list */ private static void addDescriptorsToList ( final List < FeatureDescriptor > descriptorList , final Map < String , Object > scopeMap ) { } }
for ( Object name : scopeMap . keySet ( ) ) { String strName = ( String ) name ; Class < ? > runtimeType = scopeMap . get ( strName ) . getClass ( ) ; descriptorList . add ( makeDescriptor ( strName , runtimeType ) ) ; }
public class PHS398ChecklistV1_3Generator { /** * This method will set values to income budget periods */ private static void setIncomeBudgetPeriods ( PHS398Checklist13 phsChecklist , List < ? extends BudgetProjectIncomeContract > projectIncomes ) { } }
if ( projectIncomes . isEmpty ( ) ) { phsChecklist . setProgramIncome ( YesNoDataType . N_NO ) ; } else { phsChecklist . setProgramIncome ( YesNoDataType . Y_YES ) ; } phsChecklist . setIncomeBudgetPeriodArray ( getIncomeBudgetPeriod ( projectIncomes ) ) ;
public class PropNbCC { @ Override public ESat isEntailed ( ) { } }
if ( k . getUB ( ) < minCC ( ) || k . getLB ( ) > maxCC ( ) ) { return ESat . FALSE ; } if ( isCompletelyInstantiated ( ) ) { return ESat . TRUE ; } return ESat . UNDEFINED ;
public class CheckJSDocStyle { /** * Checks that the inline type annotations are correct . */ private void checkInlineParams ( NodeTraversal t , Node function ) { } }
Node paramList = NodeUtil . getFunctionParameters ( function ) ; for ( Node param : paramList . children ( ) ) { JSDocInfo jsDoc = param . getJSDocInfo ( ) ; if ( jsDoc == null ) { t . report ( param , MISSING_PARAMETER_JSDOC ) ; return ; } else { JSTypeExpression paramType = jsDoc . getType ( ) ; checkNotNull ( paramType , "Inline JSDoc info should always have a type" ) ; checkParam ( t , param , null , paramType ) ; } }
public class PolicyQualifierInfo { /** * Returns a DER - encodable representation of this instance . * @ return a < code > DERObject < / code > value */ public DERObject toASN1Object ( ) { } }
ASN1EncodableVector dev = new ASN1EncodableVector ( ) ; dev . add ( policyQualifierId ) ; dev . add ( qualifier ) ; return new DERSequence ( dev ) ;
public class SWTUtil { /** * Sets width and height hint for the button control . * < b > Note : < / b > This is a NOP if the button ' s layout data is not * an instance of < code > GridData < / code > . * @ param buttonthe button for which to set the dimension hint */ public static void setButtonDimensionHint ( Button button ) { } }
Assert . isNotNull ( button ) ; Object gd = button . getLayoutData ( ) ; if ( gd instanceof GridData ) { ( ( GridData ) gd ) . widthHint = getButtonWidthHint ( button ) ; ( ( GridData ) gd ) . horizontalAlignment = GridData . FILL ; }
public class AjaxController { /** * Handles request for deleting account */ @ RequestMapping ( value = "/delete" , method = RequestMethod . POST ) public @ ResponseBody void delete ( @ RequestParam ( value = "username" , required = true ) String username , HttpServletResponse response ) { } }
logger . debug ( "Received request to delete account" ) ; ResponseAccount responseAccount = accountService . getAccountByUsername ( username ) ; if ( responseAccount . getAccount ( ) == null ) { try { response . sendError ( 500 , "No such user exists: " + username ) ; } catch ( IOException e ) { e . printStackTrace ( ) ; return ; } return ; } accountService . delete ( responseAccount . getAccount ( ) ) ;
public class FlowIdSoapCodec { /** * Write flow id to message . * @ param message the message * @ param flowId the flow id */ public static void writeFlowId ( Message message , String flowId ) { } }
if ( ! ( message instanceof SoapMessage ) ) { return ; } SoapMessage soapMessage = ( SoapMessage ) message ; Header hdFlowId = soapMessage . getHeader ( FLOW_ID_QNAME ) ; if ( hdFlowId != null ) { LOG . warning ( "FlowId already existing in soap header, need not to write FlowId header." ) ; return ; } try { soapMessage . getHeaders ( ) . add ( new Header ( FLOW_ID_QNAME , flowId , new JAXBDataBinding ( String . class ) ) ) ; if ( LOG . isLoggable ( Level . FINE ) ) { LOG . fine ( "Stored flowId '" + flowId + "' in soap header: " + FLOW_ID_QNAME ) ; } } catch ( JAXBException e ) { LOG . log ( Level . SEVERE , "Couldn't create flowId header." , e ) ; }
public class CommerceNotificationAttachmentPersistenceImpl { /** * Returns the last commerce notification attachment 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 commerce notification attachment , or < code > null < / code > if a matching commerce notification attachment could not be found */ @ Override public CommerceNotificationAttachment fetchByUuid_Last ( String uuid , OrderByComparator < CommerceNotificationAttachment > orderByComparator ) { } }
int count = countByUuid ( uuid ) ; if ( count == 0 ) { return null ; } List < CommerceNotificationAttachment > list = findByUuid ( uuid , count - 1 , count , orderByComparator ) ; if ( ! list . isEmpty ( ) ) { return list . get ( 0 ) ; } return null ;
public class Graphs { /** * Returns a view of { @ code network } with the direction ( if any ) of every edge reversed . All other * properties remain intact , and further updates to { @ code network } will be reflected in the view . */ public static < N , E > Network < N , E > transpose ( Network < N , E > network ) { } }
if ( ! network . isDirected ( ) ) { return network ; // the transpose of an undirected network is an identical network } if ( network instanceof TransposedNetwork ) { return ( ( TransposedNetwork < N , E > ) network ) . network ; } return new TransposedNetwork < N , E > ( network ) ;
public class ModuleDependency { /** * / * ( non - Javadoc ) * @ see org . jboss . staxmapper . XMLElementWriter # writeContent ( org . jboss . staxmapper . XMLExtendedStreamWriter , java . lang . Object ) */ @ Override public void writeContent ( XMLExtendedStreamWriter writer , Dependency value ) throws XMLStreamException { } }
if ( value != null && this != value ) { throw new IllegalStateException ( "Wrong target dependency." ) ; } writer . writeStartElement ( ModuleConfigImpl . MODULE ) ; writer . writeAttribute ( ModuleConfigImpl . NAME , name ) ; if ( export ) { writer . writeAttribute ( ModuleConfigImpl . EXPORT , "true" ) ; } writer . writeEndElement ( ) ;
public class MjdbcPoolBinder { /** * Returns new Pooled { @ link DataSource } implementation * @ param poolProperties pool properties * @ return new Pooled { @ link DataSource } implementation * @ throws SQLException */ public static DataSource createDataSource ( Properties poolProperties ) throws SQLException { } }
assertNotNull ( poolProperties ) ; try { return BasicDataSourceFactory . createDataSource ( poolProperties ) ; } catch ( Exception e ) { throw new SQLException ( e . getMessage ( ) ) ; }
public class KTypeArrayList { /** * { @ inheritDoc } */ @ Override public void insert ( int index , KType e1 ) { } }
assert ( index >= 0 && index <= size ( ) ) : "Index " + index + " out of bounds [" + 0 + ", " + size ( ) + "]." ; ensureBufferSpace ( 1 ) ; System . arraycopy ( buffer , index , buffer , index + 1 , elementsCount - index ) ; buffer [ index ] = e1 ; elementsCount ++ ;
public class AbstractProvisioner { /** * Removes all previously made attachments to static class . * @ param cls */ public void detach ( Class < ? > cls ) { } }
Iterator < Map . Entry < String , List < InstanceMethod > > > ki = map . entrySet ( ) . iterator ( ) ; while ( ki . hasNext ( ) ) { Map . Entry < String , List < InstanceMethod > > entry = ki . next ( ) ; Iterator < InstanceMethod > li = entry . getValue ( ) . iterator ( ) ; while ( li . hasNext ( ) ) { InstanceMethod im = li . next ( ) ; if ( im . type . equals ( cls ) ) { li . remove ( ) ; } } if ( entry . getValue ( ) . isEmpty ( ) ) { ki . remove ( ) ; } }
public class LinearViterbi { /** * 回溯获得最优路径 * @ param lattice 网格 * @ return 最优路径及其得分 */ protected Predict < int [ ] > getPath ( Node [ ] [ ] lattice ) { } }
Predict < int [ ] > res = new Predict < int [ ] > ( ) ; if ( lattice . length == 0 ) return res ; float max = Float . NEGATIVE_INFINITY ; int cur = 0 ; for ( int c = 0 ; c < ysize ( ) ; c ++ ) { if ( lattice [ lattice . length - 1 ] [ c ] == null ) continue ; if ( lattice [ lattice . length - 1 ] [ c ] . score > max ) { max = lattice [ lattice . length - 1 ] [ c ] . score ; cur = c ; } } int [ ] path = new int [ lattice . length ] ; path [ lattice . length - 1 ] = cur ; for ( int l = lattice . length - 1 ; l > 0 ; l -- ) { cur = lattice [ l ] [ cur ] . prev ; path [ l - 1 ] = cur ; } res . add ( path , max ) ; return res ;
public class SemanticParserExampleLoss { /** * Writes a collection of losses to { @ code filename } in JSON * format . * @ param filename * @ param losses * @ param annotations */ public static void writeJsonToFile ( String filename , List < SemanticParserExampleLoss > losses , List < Map < String , Object > > annotations ) { } }
Preconditions . checkArgument ( annotations . size ( ) == losses . size ( ) ) ; List < String > lines = Lists . newArrayList ( ) ; for ( int i = 0 ; i < losses . size ( ) ; i ++ ) { lines . add ( losses . get ( i ) . toJson ( annotations . get ( i ) ) ) ; } IoUtils . writeLines ( filename , lines ) ;
public class Ifc4FactoryImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public String convertIfcDistributionSystemEnumToString ( EDataType eDataType , Object instanceValue ) { } }
return instanceValue == null ? null : instanceValue . toString ( ) ;
public class CPInstanceUtil { /** * Returns all the cp instances where displayDate & lt ; & # 63 ; and status = & # 63 ; . * @ param displayDate the display date * @ param status the status * @ return the matching cp instances */ public static List < CPInstance > findByLtD_S ( Date displayDate , int status ) { } }
return getPersistence ( ) . findByLtD_S ( displayDate , status ) ;
public class Fields { /** * < p > Filters the { @ link Field } s whose < b > case insensitive < / b > name equals the given name and returns * a new instance of { @ link Fields } that wrap the filtered collection . * @ param fieldName * the { @ link Field } s having this case insensitive name will be filtered * < br > < br > * @ return a < b > new instance < / b > of { @ link Fields } which wraps the filtered { @ link Field } s * < br > < br > * @ since 1.3.0 */ public Fields strictlyNamed ( final String fieldName ) { } }
assertNotEmpty ( fieldName ) ; return new Fields ( filter ( new Criterion ( ) { @ Override public boolean evaluate ( Field field ) { return field . getName ( ) . equalsIgnoreCase ( fieldName ) ; } } ) ) ;
public class ListDocumentClassifiersResult { /** * A list containing the properties of each job returned . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setDocumentClassifierPropertiesList ( java . util . Collection ) } or * { @ link # withDocumentClassifierPropertiesList ( java . util . Collection ) } if you want to override the existing values . * @ param documentClassifierPropertiesList * A list containing the properties of each job returned . * @ return Returns a reference to this object so that method calls can be chained together . */ public ListDocumentClassifiersResult withDocumentClassifierPropertiesList ( DocumentClassifierProperties ... documentClassifierPropertiesList ) { } }
if ( this . documentClassifierPropertiesList == null ) { setDocumentClassifierPropertiesList ( new java . util . ArrayList < DocumentClassifierProperties > ( documentClassifierPropertiesList . length ) ) ; } for ( DocumentClassifierProperties ele : documentClassifierPropertiesList ) { this . documentClassifierPropertiesList . add ( ele ) ; } return this ;
public class FedoraObject { /** * Creates an instance based on the current state of this one . * @ return a deep copy . */ public FedoraObject copy ( ) { } }
FedoraObject copy = new FedoraObject ( ) . pid ( pid ) . state ( state ) . label ( label ) . ownerId ( ownerId ) . createdDate ( Util . copy ( createdDate ) ) . lastModifiedDate ( Util . copy ( lastModifiedDate ) ) ; for ( Datastream ds : datastreams . values ( ) ) { copy . putDatastream ( ds . copy ( ) ) ; } return copy ;
public class Var2Data { /** * This method retrieves a byte array containing the data at the * given offset in the block . If no data is found at the given offset * this method returns null . * @ param offset offset of required data * @ return byte array containing required data */ public byte [ ] getByteArray ( Integer offset ) { } }
byte [ ] result = null ; if ( offset != null ) { result = m_map . get ( offset ) ; } return ( result ) ;
public class JCudaDriver { /** * < code > < pre > * \ brief Suggest a launch configuration with reasonable occupancy * Returns in \ p * blockSize a reasonable block size that can achieve * the maximum occupancy ( or , the maximum number of active warps with * the fewest blocks per multiprocessor ) , and in \ p * minGridSize the * minimum grid size to achieve the maximum occupancy . * If \ p blockSizeLimit is 0 , the configurator will use the maximum * block size permitted by the device / function instead . * If per - block dynamic shared memory allocation is not needed , the * user should leave both \ p blockSizeToDynamicSMemSize and \ p * dynamicSMemSize as 0. * If per - block dynamic shared memory allocation is needed , then if * the dynamic shared memory size is constant regardless of block * size , the size should be passed through \ p dynamicSMemSize , and \ p * blockSizeToDynamicSMemSize should be NULL . * Otherwise , if the per - block dynamic shared memory size varies with * different block sizes , the user needs to provide a unary function * through \ p blockSizeToDynamicSMemSize that computes the dynamic * shared memory needed by \ p func for any given block size . \ p * dynamicSMemSize is ignored . An example signature is : * \ code * / / Take block size , returns dynamic shared memory needed * size _ t blockToSmem ( int blockSize ) ; * \ endcode * \ param minGridSize - Returned minimum grid size needed to achieve the maximum occupancy * \ param blockSize - Returned maximum block size that can achieve the maximum occupancy * \ param func - Kernel for which launch configuration is calulated * \ param blockSizeToDynamicSMemSize - A function that calculates how much per - block dynamic shared memory \ p func uses based on the block size * \ param dynamicSMemSize - Dynamic shared memory usage intended , in bytes * \ param blockSizeLimit - The maximum block size \ p func is designed to handle * \ return * : : CUDA _ SUCCESS , * : : CUDA _ ERROR _ DEINITIALIZED , * : : CUDA _ ERROR _ NOT _ INITIALIZED , * : : CUDA _ ERROR _ INVALID _ CONTEXT , * : : CUDA _ ERROR _ INVALID _ VALUE , * : : CUDA _ ERROR _ UNKNOWN * \ notefnerr * < / pre > < / code > */ public static int cuOccupancyMaxPotentialBlockSize ( int minGridSize [ ] , int blockSize [ ] , CUfunction func , CUoccupancyB2DSize blockSizeToDynamicSMemSize , long dynamicSMemSize , int blockSizeLimit ) { } }
// The callback involves a state on the native side , // so ensure synchronization here synchronized ( OCCUPANCY_LOCK ) { return checkResult ( cuOccupancyMaxPotentialBlockSizeNative ( minGridSize , blockSize , func , blockSizeToDynamicSMemSize , dynamicSMemSize , blockSizeLimit ) ) ; }
public class OptionsProcessorContext { /** * Returns true if the { @ link Options } attached to this context contains the * given feature . * @ param feature * the feature for which to look . * @ return true if the context contains this feature , false if not . */ public boolean containsFeature ( Feature feature ) { } }
switch ( feature ) { case DRILLDOWN : return ! getDrilldownOptions ( ) . isEmpty ( ) ; case GLOBAL : return getGlobal ( ) != null ; case INTERACTION : return ! getInteractionFunctions ( ) . isEmpty ( ) ; case LIVEDATA : return ! getLiveDataSeries ( ) . isEmpty ( ) ; case SELECTION : return ! getSelectionFunctions ( ) . isEmpty ( ) ; default : throw new UnsupportedFeatureException ( feature ) ; }
public class CreateLoggerDefinitionVersionRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( CreateLoggerDefinitionVersionRequest createLoggerDefinitionVersionRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( createLoggerDefinitionVersionRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( createLoggerDefinitionVersionRequest . getAmznClientToken ( ) , AMZNCLIENTTOKEN_BINDING ) ; protocolMarshaller . marshall ( createLoggerDefinitionVersionRequest . getLoggerDefinitionId ( ) , LOGGERDEFINITIONID_BINDING ) ; protocolMarshaller . marshall ( createLoggerDefinitionVersionRequest . getLoggers ( ) , LOGGERS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
public class XmlConfiguration { private synchronized static void initParser ( ) throws IOException { } }
if ( __parser != null ) return ; __parser = new XmlParser ( ) ; URL config13URL = XmlConfiguration . class . getClassLoader ( ) . getResource ( "org/browsermob/proxy/jetty/xml/configure_1_3.dtd" ) ; __parser . redirectEntity ( "configure.dtd" , config13URL ) ; __parser . redirectEntity ( "configure_1_3.dtd" , config13URL ) ; __parser . redirectEntity ( "http://jetty.jetty.org/configure_1_3.dtd" , config13URL ) ; __parser . redirectEntity ( "http://jetty.jetty.org/configure.dtd" , config13URL ) ; __parser . redirectEntity ( "-//Mort Bay Consulting//DTD Configure 1.3//EN" , config13URL ) ; __parser . redirectEntity ( "-//Mort Bay Consulting//DTD Configure//EN" , config13URL ) ; URL config12URL = XmlConfiguration . class . getClassLoader ( ) . getResource ( "org/browsermob/proxy/jetty/xml/configure_1_2.dtd" ) ; __parser . redirectEntity ( "configure_1_2.dtd" , config12URL ) ; __parser . redirectEntity ( "http://jetty.jetty.org/configure_1_2.dtd" , config12URL ) ; __parser . redirectEntity ( "-//Mort Bay Consulting//DTD Configure 1.2//EN" , config12URL ) ; URL config11URL = XmlConfiguration . class . getClassLoader ( ) . getResource ( "org/browsermob/proxy/jetty/xml/configure_1_1.dtd" ) ; __parser . redirectEntity ( "configure_1_1.dtd" , config11URL ) ; __parser . redirectEntity ( "http://jetty.jetty.org/configure_1_1.dtd" , config11URL ) ; __parser . redirectEntity ( "-//Mort Bay Consulting//DTD Configure 1.1//EN" , config11URL ) ; URL config10URL = XmlConfiguration . class . getClassLoader ( ) . getResource ( "org/browsermob/proxy/jetty/xml/configure_1_0.dtd" ) ; __parser . redirectEntity ( "configure_1_0.dtd" , config10URL ) ; __parser . redirectEntity ( "http://jetty.jetty.org/configure_1_0.dtd" , config10URL ) ; __parser . redirectEntity ( "-//Mort Bay Consulting//DTD Configure 1.0//EN" , config10URL ) ;
public class FactoryOrientationAlgs { /** * Estimates the orientation without calculating the image derivative . * @ see ImplOrientationImageAverageIntegral * @ param sampleRadius Radius of the region being considered in terms of samples . Typically 6. * @ param samplePeriod How often the image is sampled . This number is scaled . Typically 1. * @ param sampleWidth How wide of a kernel should be used to sample . Try 4 * @ param weightSigma Sigma for weighting . zero for unweighted . * @ param integralImage Type of image being processed . * @ return OrientationIntegral */ public static < II extends ImageGray < II > > OrientationIntegral < II > image_ii ( double objectRadiusToScale , int sampleRadius , double samplePeriod , int sampleWidth , double weightSigma , Class < II > integralImage ) { } }
return ( OrientationIntegral < II > ) new ImplOrientationImageAverageIntegral ( objectRadiusToScale , sampleRadius , samplePeriod , sampleWidth , weightSigma , integralImage ) ;
public class ThresholdEventWriter { /** * Write an Event via the delegate writer * @ param event the Event to write * @ throws IOException as thrown by the delegate writer */ @ Override public synchronized void write ( final Event event ) throws IOException { } }
if ( ! acceptsEvents ) { log . warn ( "Writer not ready, discarding event: {}" , event ) ; return ; } delegate . write ( event ) ; uncommittedWriteCount ++ ; commitIfNeeded ( ) ;
public class StringList2VarcharFieldConversion { /** * / * ( non - Javadoc ) * @ see org . apache . ojb . broker . accesslayer . conversions . FieldConversion # sqlToJava ( java . lang . Object ) */ public Object sqlToJava ( Object source ) throws ConversionException { } }
if ( source == null ) { return null ; } if ( source . toString ( ) . equals ( NULLVALUE ) ) { return null ; } if ( source . toString ( ) . equals ( EMPTYCOLLEC ) ) { return new ArrayList ( ) ; } List v = new ArrayList ( ) ; StringBuffer input = new StringBuffer ( ) ; StringBuffer newString = new StringBuffer ( ) ; int pos = 0 ; int length ; input . append ( source . toString ( ) ) ; length = input . length ( ) ; while ( pos < length ) { if ( input . charAt ( pos ) != '#' ) { newString . append ( input . charAt ( pos ) ) ; } else { if ( input . charAt ( pos + 1 ) != '#' ) { v . add ( newString . toString ( ) ) ; newString = new StringBuffer ( ) ; } else { newString . append ( '#' ) ; ++ pos ; } } ++ pos ; } v . add ( newString . toString ( ) ) ; return v ;
public class JdbcParameterFactory { /** * { @ link java . sql . Connection # createSQLXML ( ) } のラッパー * @ param conn コネクション * @ return SQLXMLインタフェースを実装しているオブジェクト * @ see java . sql . Connection # createSQLXML ( ) */ public static SQLXML createSQLXML ( final Connection conn ) { } }
try { return conn . createSQLXML ( ) ; } catch ( SQLException e ) { throw new UroborosqlRuntimeException ( e ) ; }
public class CmsXmlContentPropertyHelper { /** * Given a string which might be a id or a ( sitemap or VFS ) URI , this method will return * a bean containing the right ( sitemap or vfs ) root path and ( sitemap entry or structure ) id . < p > * @ param cms the current CMS context * @ param idOrUri a string containing an id or an URI * @ return a bean containing a root path and an id * @ throws CmsException if something goes wrong */ protected static CmsVfsFileValueBean getFileValueForIdOrUri ( CmsObject cms , String idOrUri ) throws CmsException { } }
CmsVfsFileValueBean result ; if ( CmsUUID . isValidUUID ( idOrUri ) ) { CmsUUID id = new CmsUUID ( idOrUri ) ; String uri = getUriForId ( cms , id ) ; result = new CmsVfsFileValueBean ( cms . getRequestContext ( ) . addSiteRoot ( uri ) , id ) ; } else { String uri = idOrUri ; CmsUUID id = getIdForUri ( cms , idOrUri ) ; result = new CmsVfsFileValueBean ( cms . getRequestContext ( ) . addSiteRoot ( uri ) , id ) ; } return result ;
public class TriMarkers { /** * Get the normal vector to this triangle , of length 1. * @ param t input triangle * @ return vector normal to the triangle . */ public static Vector3D getNormalVector ( Triangle t ) throws IllegalArgumentException { } }
if ( Double . isNaN ( t . p0 . z ) || Double . isNaN ( t . p1 . z ) || Double . isNaN ( t . p2 . z ) ) { throw new IllegalArgumentException ( "Z is required, cannot compute triangle normal of " + t ) ; } double dx1 = t . p0 . x - t . p1 . x ; double dy1 = t . p0 . y - t . p1 . y ; double dz1 = t . p0 . z - t . p1 . z ; double dx2 = t . p1 . x - t . p2 . x ; double dy2 = t . p1 . y - t . p2 . y ; double dz2 = t . p1 . z - t . p2 . z ; return Vector3D . create ( dy1 * dz2 - dz1 * dy2 , dz1 * dx2 - dx1 * dz2 , dx1 * dy2 - dy1 * dx2 ) . normalize ( ) ;
public class CathDomain { /** * Returns the chains this domain is defined over ; contains more than 1 element only if this domains is a multi - chain domain . */ public Set < String > getChains ( ) { } }
Set < String > chains = new HashSet < String > ( ) ; List < ResidueRange > rrs = toCanonical ( ) . getResidueRanges ( ) ; for ( ResidueRange rr : rrs ) chains . add ( rr . getChainName ( ) ) ; return chains ; } @ Override public String getIdentifier ( ) { return getCATH ( ) ; } @ Override public SubstructureIdentifier toCanonical ( ) { List < ResidueRange > ranges = new ArrayList < ResidueRange > ( ) ; String chain = String . valueOf ( getDomainName ( ) . charAt ( getDomainName ( ) . length ( ) - 3 ) ) ; for ( CathSegment segment : this . getSegments ( ) ) { ranges . add ( new ResidueRange ( chain , segment . getStart ( ) , segment . getStop ( ) ) ) ; } return new SubstructureIdentifier ( getThePdbId ( ) , ranges ) ; } @ Override public Structure reduce ( Structure input ) throws StructureException { return toCanonical ( ) . reduce ( input ) ; } @ Override public Structure loadStructure ( AtomCache cache ) throws StructureException , IOException { return cache . getStructure ( getThePdbId ( ) ) ; }
public class DockerAgentUtils { /** * Get image ID from imageTag on the current agent . * @ param imageTag * @ return */ public static String getImageIdFromAgent ( Launcher launcher , final String imageTag , final String host ) throws IOException , InterruptedException { } }
return launcher . getChannel ( ) . call ( new MasterToSlaveCallable < String , IOException > ( ) { public String call ( ) throws IOException { return DockerUtils . getImageIdFromTag ( imageTag , host ) ; } } ) ;
public class IscsiWriteTrx { /** * { @ inheritDoc } */ @ Override public void bootstrap ( byte [ ] bytes ) throws TTException { } }
BlockDataElement data = new BlockDataElement ( getPageTransaction ( ) . incrementDataKey ( ) , bytes ) ; if ( mDelegate . getCurrentData ( ) != null ) { getPageTransaction ( ) . setData ( data ) ; mDelegate . moveTo ( data . getDataKey ( ) ) ; } else { getPageTransaction ( ) . setData ( data ) ; mDelegate . moveTo ( data . getDataKey ( ) ) ; }
public class FNORGImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public void setMaxBExt ( Integer newMaxBExt ) { } }
Integer oldMaxBExt = maxBExt ; maxBExt = newMaxBExt ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , AfplibPackage . FNORG__MAX_BEXT , oldMaxBExt , maxBExt ) ) ;
public class PyCodeBuilder { /** * Pops off the current output variable . The previous output variable again becomes the current . */ void popOutputVar ( ) { } }
outputVars . pop ( ) ; OutputVar outputVar = outputVars . peek ( ) ; // null if outputVars is now empty if ( outputVar != null ) { currOutputVarName = outputVar . name ( ) ; currOutputVarIsInited = outputVar . isInited ( ) ; } else { currOutputVarName = null ; currOutputVarIsInited = false ; }
public class AbstractLifecycle { /** * Execute a lifecycle stage . */ @ Override public void execute ( @ Nonnull final LifecycleStage lifecycleStage ) { } }
List < LifecycleListener > lifecycleListeners = listeners . get ( lifecycleStage ) ; if ( lifecycleListeners == null ) { throw illegalStage ( lifecycleStage ) ; } log ( "Stage '%s' starting..." , lifecycleStage . getName ( ) ) ; // Reverse the order for the STOP stage , so that dependencies are torn down in reverse order . if ( lifecycleStage . equals ( LifecycleStage . STOP_STAGE ) ) { lifecycleListeners = Lists . reverse ( lifecycleListeners ) ; } for ( final LifecycleListener listener : lifecycleListeners ) { listener . onStage ( lifecycleStage ) ; } log ( "Stage '%s' complete." , lifecycleStage . getName ( ) ) ;
public class NumberType { /** * Converter from a numeric object to Double . Input is checked to be * within range represented by Double */ private static Double convertToDouble ( Object a ) { } }
double value ; if ( a instanceof java . lang . Double ) { return ( Double ) a ; } else if ( a instanceof BigDecimal ) { BigDecimal bd = ( BigDecimal ) a ; value = bd . doubleValue ( ) ; int signum = bd . signum ( ) ; BigDecimal bdd = new BigDecimal ( value + signum ) ; if ( bdd . compareTo ( bd ) != signum ) { throw Error . error ( ErrorCode . X_22003 ) ; } } else { value = ( ( Number ) a ) . doubleValue ( ) ; } return ValuePool . getDouble ( Double . doubleToLongBits ( value ) ) ;
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link FunctionsType } { @ code > } } */ @ XmlElementDecl ( namespace = "http://www.w3.org/1998/Math/MathML" , name = "ident" ) public JAXBElement < FunctionsType > createIdent ( FunctionsType value ) { } }
return new JAXBElement < FunctionsType > ( _Ident_QNAME , FunctionsType . class , null , value ) ;
public class JsonReaderI { /** * add a value in an array json object . */ public void addValue ( Object current , Object value ) throws ParseException , IOException { } }
throw new RuntimeException ( ERR_MSG + " addValue(Object current, Object value) in " + this . getClass ( ) ) ;
public class IOUtils { /** * Read bytes from an input stream . * This implementation guarantees that it will read as many bytes * as possible before giving up ; this may not always be the case for * subclasses of { @ link InputStream } . * @ param input where to read input from * @ param buffer destination * @ param offset inital offset into buffer * @ param length length to read , must be > = 0 * @ return actual length read ; may be less than requested if EOF was reached * @ throws IOException if a read error occurs * @ since 2.2 */ public static int read ( InputStream input , byte [ ] buffer , int offset , int length ) throws IOException { } }
if ( length < 0 ) { throw new IllegalArgumentException ( "Length must not be negative: " + length ) ; } int remaining = length ; try { while ( remaining > 0 ) { int location = length - remaining ; int count = input . read ( buffer , offset + location , remaining ) ; if ( EOF == count ) { // EOF break ; } remaining -= count ; } } finally { IOUtils . closeQuietly ( input ) ; } return length - remaining ;
public class GoogleCloudStorageFileSystem { /** * If the given item is a directory then the paths of its * children are returned , otherwise the path of the given item is returned . * @ param fileInfo FileInfo of an item . * @ param recursive If true , path of all children are returned ; * else , only immediate children are returned . * @ return Paths of children ( if directory ) or self path . * @ throws IOException */ public List < URI > listFileNames ( FileInfo fileInfo , boolean recursive ) throws IOException { } }
Preconditions . checkNotNull ( fileInfo ) ; URI path = fileInfo . getPath ( ) ; logger . atFine ( ) . log ( "listFileNames(%s)" , path ) ; List < URI > paths = new ArrayList < > ( ) ; List < String > childNames ; // If it is a directory , obtain info about its children . if ( fileInfo . isDirectory ( ) ) { if ( fileInfo . exists ( ) ) { if ( fileInfo . isGlobalRoot ( ) ) { childNames = gcs . listBucketNames ( ) ; // Obtain path for each child . for ( String childName : childNames ) { URI childPath = pathCodec . getPath ( childName , null , true ) ; paths . add ( childPath ) ; logger . atFine ( ) . log ( "listFileNames: added: %s" , childPath ) ; } } else { // A null delimiter asks GCS to return all objects with a given prefix , // regardless of their ' directory depth ' relative to the prefix ; // that is what we want for a recursive list . On the other hand , // when a delimiter is specified , only items with relative depth // of 1 are returned . String delimiter = recursive ? null : PATH_DELIMITER ; GoogleCloudStorageItemInfo itemInfo = fileInfo . getItemInfo ( ) ; // Obtain paths of children . childNames = gcs . listObjectNames ( itemInfo . getBucketName ( ) , itemInfo . getObjectName ( ) , delimiter ) ; // Obtain path for each child . for ( String childName : childNames ) { URI childPath = pathCodec . getPath ( itemInfo . getBucketName ( ) , childName , false ) ; paths . add ( childPath ) ; logger . atFine ( ) . log ( "listFileNames: added: %s" , childPath ) ; } } } } else { paths . add ( path ) ; logger . atFine ( ) . log ( "listFileNames: added single original path since !isDirectory(): %s" , path ) ; } return paths ;
public class ApiOvhXdsl { /** * Return the broken equipment in instantRefund * REST : POST / xdsl / spare / { spare } / returnMerchandise * @ param spare [ required ] The internal name of your spare */ public void spare_spare_returnMerchandise_POST ( String spare ) throws IOException { } }
String qPath = "/xdsl/spare/{spare}/returnMerchandise" ; StringBuilder sb = path ( qPath , spare ) ; exec ( qPath , "POST" , sb . toString ( ) , null ) ;
public class StormConfigUtil { /** * Storm設定オブジェクトから文字列型の設定値を取得する 。 < br > * 存在しない場合は空リストを返す 。 * @ param stormConf Storm設定オブジェクト * @ param key 設定値のキー * @ return 個別設定値 ( { @ literal List < String > } 型 ) */ @ SuppressWarnings ( "unchecked" ) public static List < String > getStringListValue ( Config stormConf , String key ) { } }
List < String > configList = ( List < String > ) stormConf . get ( key ) ; if ( configList == null ) { configList = new ArrayList < String > ( ) ; } return configList ;
public class CassandraClientProperties { /** * Populate client properties . * @ param client the client * @ param properties the properties */ public void populateClientProperties ( Client client , Map < String , Object > properties ) { } }
this . cassandraClientBase = ( CassandraClientBase ) client ; if ( properties != null ) { for ( String key : properties . keySet ( ) ) { Object value = properties . get ( key ) ; if ( checkNull ( key , value ) ) { if ( key . equals ( CONSISTENCY_LEVEL ) ) { setConsistencylevel ( value ) ; } else if ( key . equals ( CQL_VERSION ) && value instanceof String ) { this . cassandraClientBase . setCqlVersion ( ( String ) value ) ; } else if ( key . equals ( TTL_PER_SESSION ) ) { setTTLPerSession ( value ) ; } else if ( key . equals ( TTL_PER_REQUEST ) ) { setTTLPerRequest ( value ) ; } else if ( key . equals ( TTL_VALUES ) && value instanceof Map ) { this . cassandraClientBase . setTtlValues ( ( Map ) value ) ; } else if ( key . equals ( PersistenceProperties . KUNDERA_BATCH_SIZE ) && ! StringUtils . isBlank ( value . toString ( ) ) && StringUtils . isNumeric ( value . toString ( ) ) ) { this . cassandraClientBase . setBatchSize ( value . toString ( ) ) ; } // Add more properties as needed } } }
public class DateUtils { /** * < p > Constructs an < code > Iterator < / code > over each day in a date * range defined by a focus date and range style . < / p > * < p > For instance , passing Thursday , July 4 , 2002 and a * < code > RANGE _ MONTH _ SUNDAY < / code > will return an < code > Iterator < / code > * that starts with Sunday , June 30 , 2002 and ends with Saturday , August 3, * 2002 , returning a Calendar instance for each intermediate day . < / p > * @ param focus the date to work with , either { @ code Date } or { @ code Calendar } , not null * @ param rangeStyle the style constant to use . Must be one of the range * styles listed for the { @ link # iterator ( Calendar , int ) } method . * @ return the date iterator , not null * @ throws IllegalArgumentException if the date is < code > null < / code > * @ throws ClassCastException if the object type is not a { @ code Date } or { @ code Calendar } */ public static Iterator < ? > iterator ( final Object focus , final int rangeStyle ) { } }
if ( focus == null ) { throw new IllegalArgumentException ( "The date must not be null" ) ; } if ( focus instanceof Date ) { return iterator ( ( Date ) focus , rangeStyle ) ; } else if ( focus instanceof Calendar ) { return iterator ( ( Calendar ) focus , rangeStyle ) ; } else { throw new ClassCastException ( "Could not iterate based on " + focus ) ; }
public class UpdateGroupPermissionHandler { /** * Called when a change is the record status is about to happen / has happened . * @ param field If this file change is due to a field , this is the field . * @ param iChangeType The type of change that occurred . * @ param bDisplayOption If true , display any changes . * @ return an error code . * ADD _ TYPE - Before a write . * UPDATE _ TYPE - Before an update . * DELETE _ TYPE - Before a delete . * AFTER _ UPDATE _ TYPE - After a write or update . * LOCK _ TYPE - Before a lock . * SELECT _ TYPE - After a select . * DESELECT _ TYPE - After a deselect . * MOVE _ NEXT _ TYPE - After a move . * AFTER _ REQUERY _ TYPE - Record opened . * SELECT _ EOF _ TYPE - EOF Hit . */ public int doRecordChange ( FieldInfo field , int iChangeType , boolean bDisplayOption ) { } }
if ( ( iChangeType == DBConstants . AFTER_UPDATE_TYPE ) || ( iChangeType == DBConstants . AFTER_ADD_TYPE ) || ( iChangeType == DBConstants . AFTER_DELETE_TYPE ) ) { int iGroupID = ( int ) this . getOwner ( ) . getField ( UserPermission . USER_GROUP_ID ) . getValue ( ) ; if ( m_iOldGroupID != - 1 ) if ( iGroupID != m_iOldGroupID ) this . updateGroupPermission ( m_iOldGroupID ) ; this . updateGroupPermission ( iGroupID ) ; } return super . doRecordChange ( field , iChangeType , bDisplayOption ) ;
public class ChessboardCornerClusterFinder { /** * Greedily select the next edge that will belong to the final graph . * @ param firstIdx Index of the edge CW of the one being considered * @ param splitterSet Set of edges that the splitter can belong to * @ param candidateSet Set of edges that the next edge can belong to * @ param parallel if NaN this is the angle the edge should be parallel to * @ param results Output . * @ return true if successful . */ boolean findNext ( int firstIdx , EdgeSet splitterSet , EdgeSet candidateSet , double parallel , SearchResults results ) { } }
Edge e0 = candidateSet . get ( firstIdx ) ; results . index = - 1 ; results . error = Double . MAX_VALUE ; boolean checkParallel = ! Double . isNaN ( parallel ) ; for ( int i = 0 ; i < candidateSet . size ( ) ; i ++ ) { if ( i == firstIdx ) continue ; // stop considering edges when they are more than 180 degrees away Edge eI = candidateSet . get ( i ) ; double distanceCCW = UtilAngle . distanceCCW ( e0 . direction , eI . direction ) ; if ( distanceCCW >= Math . PI * 0.9 ) // Multiplying by 0.9 helped remove a lot of bad matches continue ; // It was pairing up opposite corners under heavy perspective distortion // It should be parallel to a previously found line if ( checkParallel ) { double a = UtilAngle . boundHalf ( eI . direction ) ; double b = UtilAngle . boundHalf ( parallel ) ; double distanceParallel = UtilAngle . distHalf ( a , b ) ; if ( distanceParallel > parallelTol ) { continue ; } } // find the perpendicular corner which splits these two edges and also find the index of // the perpendicular sets which points towards the splitter . if ( ! findSplitter ( e0 . direction , eI . direction , splitterSet , e0 . dst . perpendicular , eI . dst . perpendicular , tuple3 ) ) continue ; double acute0 = UtilAngle . dist ( candidateSet . get ( firstIdx ) . direction , e0 . dst . perpendicular . get ( tuple3 . b ) . direction ) ; double error0 = UtilAngle . dist ( acute0 , Math . PI / 2.0 ) ; if ( error0 > Math . PI * 0.3 ) continue ; double acute1 = UtilAngle . dist ( candidateSet . get ( i ) . direction , eI . dst . perpendicular . get ( tuple3 . c ) . direction ) ; double error1 = UtilAngle . dist ( acute1 , Math . PI / 2.0 ) ; if ( error1 > Math . PI * 0.3 ) continue ; // Find the edge from corner 0 to corner i . The direction of this vector and the corner ' s // orientation has a known relationship described by ' phaseOri ' int e0_to_eI = e0 . dst . parallel . find ( eI . dst ) ; if ( e0_to_eI < 0 ) continue ; // The quadrilateral with the smallest area is most often the best solution . Area is more expensive // so the perimeter is computed instead . one side is left off since all of them have that side double error = e0 . dst . perpendicular . get ( tuple3 . b ) . distance ; error += eI . dst . perpendicular . get ( tuple3 . c ) . distance ; error += eI . distance ; if ( error < results . error ) { results . error = error ; results . index = i ; } } return results . index != - 1 ;
public class DeleteEntryOnErrorFix { /** * it will report the fixer message , if entry is set to be deleted . */ public ValidationResult check ( Entry entry ) { } }
result = new ValidationResult ( ) ; if ( entry . isDelete ( ) ) { reportMessage ( Severity . FIX , entry . getOrigin ( ) , FIX_ID , entry . getPrimaryAccession ( ) ) ; } return result ;
public class ResourceXMLGenerator { /** * Write Document to a file * @ param output stream * @ param doc document * @ throws IOException on error */ private static void serializeDocToStream ( final OutputStream output , final Document doc ) throws IOException { } }
final OutputFormat format = OutputFormat . createPrettyPrint ( ) ; final XMLWriter writer = new XMLWriter ( output , format ) ; writer . write ( doc ) ; writer . flush ( ) ;
public class DescribeHostReservationsRequest { /** * The host reservation IDs . * @ return The host reservation IDs . */ public java . util . List < String > getHostReservationIdSet ( ) { } }
if ( hostReservationIdSet == null ) { hostReservationIdSet = new com . amazonaws . internal . SdkInternalList < String > ( ) ; } return hostReservationIdSet ;
public class AwsSecurityFindingFilters { /** * The label of a finding ' s severity . * @ param severityLabel * The label of a finding ' s severity . */ public void setSeverityLabel ( java . util . Collection < StringFilter > severityLabel ) { } }
if ( severityLabel == null ) { this . severityLabel = null ; return ; } this . severityLabel = new java . util . ArrayList < StringFilter > ( severityLabel ) ;
public class PatchSchedulesInner { /** * Create or replace the patching schedule for Redis cache ( requires Premium SKU ) . * @ param resourceGroupName The name of the resource group . * @ param name The name of the Redis cache . * @ param scheduleEntries List of patch schedules for a Redis cache . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the RedisPatchScheduleInner object */ public Observable < ServiceResponse < RedisPatchScheduleInner > > createOrUpdateWithServiceResponseAsync ( String resourceGroupName , String name , List < ScheduleEntry > scheduleEntries ) { } }
if ( resourceGroupName == null ) { throw new IllegalArgumentException ( "Parameter resourceGroupName is required and cannot be null." ) ; } if ( name == null ) { throw new IllegalArgumentException ( "Parameter name is required and cannot be null." ) ; } if ( this . client . subscriptionId ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.subscriptionId() is required and cannot be null." ) ; } if ( this . client . apiVersion ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.apiVersion() is required and cannot be null." ) ; } if ( scheduleEntries == null ) { throw new IllegalArgumentException ( "Parameter scheduleEntries is required and cannot be null." ) ; } Validator . validate ( scheduleEntries ) ; final String defaultParameter = "default" ; RedisPatchScheduleInner parameters = new RedisPatchScheduleInner ( ) ; parameters . withScheduleEntries ( scheduleEntries ) ; return service . createOrUpdate ( resourceGroupName , name , defaultParameter , this . client . subscriptionId ( ) , this . client . apiVersion ( ) , this . client . acceptLanguage ( ) , parameters , this . client . userAgent ( ) ) . flatMap ( new Func1 < Response < ResponseBody > , Observable < ServiceResponse < RedisPatchScheduleInner > > > ( ) { @ Override public Observable < ServiceResponse < RedisPatchScheduleInner > > call ( Response < ResponseBody > response ) { try { ServiceResponse < RedisPatchScheduleInner > clientResponse = createOrUpdateDelegate ( response ) ; return Observable . just ( clientResponse ) ; } catch ( Throwable t ) { return Observable . error ( t ) ; } } } ) ;
public class ClassLoaderLeakPreventorFactory { /** * Get instance of { @ link ClassLoaderPreMortemCleanUp } for further configuring . * Please be aware that { @ link ClassLoaderLeakPreventor } s created by the same factory share the same * { @ link PreClassLoaderInitiator } and { @ link ClassLoaderPreMortemCleanUp } instances , in case their config is changed . */ public < C extends ClassLoaderPreMortemCleanUp > C getCleanUp ( Class < C > clazz ) { } }
return ( C ) this . cleanUps . get ( clazz . getName ( ) ) ;
public class JsonWriter { /** * Encodes the property name and date value ( ISO format ) . * Output is for example < code > " theDate " : " 2013-01-24 " < / code > . * @ throws org . sonar . api . utils . text . WriterException on any failure */ public JsonWriter propDate ( String name , @ Nullable Date value ) { } }
return name ( name ) . valueDate ( value ) ;
public class FieldInfo { /** * Initialize this field . * After setting up the input params , initField ( ) is called . * @ param record The parent record . This field is added to the record ' s field list . * @ param strName The field name . * @ param iDataLength The maximum length ( DEFAULT _ FIELD _ LENGTH if default ) . * @ param strDesc The string description ( pass null to use the description in the resource file ) . * @ param objDefault The default ( initial ) field value in string or native format . */ public void init ( Rec record , String strName , int iDataLength , String strDesc , Object objDefault ) { } }
m_record = ( FieldList ) record ; if ( m_record != null ) m_record . addField ( this ) ; m_strFieldName = strName ; m_iMaxLength = iDataLength ; m_strFieldDesc = strDesc ; if ( objDefault != null ) m_classData = objDefault . getClass ( ) ; else m_classData = String . class ; m_bHidden = false ; m_bModified = false ; m_data = null ; // The actual data ! ! ! m_iMinLength = 0 ; m_ibScale = 2 ; m_vScreenField = null ; m_objDefault = objDefault ; super . init ( null ) ; this . initField ( false ) ; // Don ' t display because there can ' t be any sFields yet .
public class StringUtils { /** * Encodes the given string into a sequence of bytes using the UTF - 8 charset , storing the result * into a new byte array . * @ param string the String to encode , may be < code > null < / code > * @ return encoded bytes , or < code > null < / code > if the input string was < code > null < / code > * @ throws IllegalStateException Thrown when the charset is missing , which should be never * according the the Java specification . * @ see < a href = " http : / / download . oracle . com / javase / 7 / docs / api / java / nio / charset / Charset . html " * > Standard charsets < / a > * @ since 1.8 */ public static byte [ ] getBytesUtf8 ( String string ) { } }
if ( string == null ) { return null ; } return string . getBytes ( StandardCharsets . UTF_8 ) ;
public class Factory { /** * Registers a component using its type ( a constructor function ) . * @ param locator a locator to identify component to be created . * @ param type a component type . */ public void registerAsType ( Object locator , Class < ? > type ) { } }
if ( locator == null ) throw new NullPointerException ( "Locator cannot be null" ) ; if ( type == null ) throw new NullPointerException ( "Type cannot be null" ) ; IComponentFactory factory = new DefaultComponentFactory ( type ) ; _registrations . add ( new Registration ( locator , factory ) ) ;
public class HashCodeBuilder { /** * Append a < code > hashCode < / code > for an < code > Object < / code > . * @ param object * the Object to add to the < code > hashCode < / code > * @ return this */ public HashCodeBuilder append ( final Object object ) { } }
if ( object == null ) { iTotal = iTotal * iConstant ; } else { if ( object . getClass ( ) . isArray ( ) ) { // ' Switch ' on type of array , to dispatch to the correct handler // This handles multi dimensional arrays if ( object instanceof long [ ] ) { append ( ( long [ ] ) object ) ; } else if ( object instanceof int [ ] ) { append ( ( int [ ] ) object ) ; } else if ( object instanceof short [ ] ) { append ( ( short [ ] ) object ) ;
public class ge_p3_dbl { /** * r = 2 * p */ public static void ge_p3_dbl ( ge_p1p1 r , ge_p3 p ) { } }
ge_p2 q = new ge_p2 ( ) ; ge_p3_to_p2 . ge_p3_to_p2 ( q , p ) ; ge_p2_dbl . ge_p2_dbl ( r , q ) ;
public class JSDocInfoBuilder { /** * Records that the { @ link JSDocInfo } being built should have its * { @ link JSDocInfo # isDeprecated ( ) } flag set to { @ code true } . */ public boolean recordDeprecated ( ) { } }
if ( ! currentInfo . isDeprecated ( ) ) { currentInfo . setDeprecated ( true ) ; populated = true ; return true ; } else { return false ; }
public class CharTrie { /** * Add char trie . * @ param z the z * @ return the char trie */ public CharTrie add ( CharTrie z ) { } }
return reduceSimple ( z , ( left , right ) -> ( null == left ? 0 : left ) + ( null == right ? 0 : right ) ) ;
public class Context { /** * Set the current locale . * @ see java . util . Locale */ public final Locale setLocale ( Locale loc ) { } }
if ( sealed ) onSealedMutation ( ) ; Locale result = locale ; locale = loc ; return result ;
public class UserApiKeyAuthProviderClientImpl { /** * Creates a user API key that can be used to authenticate as the current user . * @ param name The name of the API key to be created * @ return A { @ link Task } that contains the created API key . */ @ Override public Task < UserApiKey > createApiKey ( @ NonNull final String name ) { } }
return dispatcher . dispatchTask ( new Callable < UserApiKey > ( ) { @ Override public UserApiKey call ( ) { return createApiKeyInternal ( name ) ; } } ) ;
public class SectionedViewSectionDescriptor { /** * Checks if the include regular expression is valid . */ public FormValidation doCheckIncludeRegex ( @ QueryParameter String value ) throws IOException , ServletException , InterruptedException { } }
String v = Util . fixEmpty ( value ) ; if ( v != null ) { try { Pattern . compile ( v ) ; } catch ( PatternSyntaxException pse ) { return FormValidation . error ( pse . getMessage ( ) ) ; } } return FormValidation . ok ( ) ;
public class Criteria { /** * Adds not Null criteria , * customer _ id is not Null * The attribute will NOT be translated into column name * @ param column The column name to be used without translation */ public void addColumnNotNull ( String column ) { } }
// PAW // SelectionCriteria c = ValueCriteria . buildNotNullCriteria ( column , getAlias ( ) ) ; SelectionCriteria c = ValueCriteria . buildNotNullCriteria ( column , getUserAlias ( column ) ) ; c . setTranslateAttribute ( false ) ; addSelectionCriteria ( c ) ;
public class ApplicationPermissionValue { /** * region > implies , refutes */ @ Programmatic public boolean implies ( final ApplicationFeatureId featureId , final ApplicationPermissionMode mode ) { } }
if ( getRule ( ) != ApplicationPermissionRule . ALLOW ) { // only allow rules can imply return false ; } if ( getMode ( ) == ApplicationPermissionMode . VIEWING && mode == ApplicationPermissionMode . CHANGING ) { // an " allow viewing " permission does not imply ability to change return false ; } // determine if this permission is on the path ( ie the feature or one of its parents ) return onPathOf ( featureId ) ;
public class ExtendedBitInput { public static String readAscii ( final BitInput bitInput , final int lengthSize ) throws IOException { } }
return new String ( readBytes ( bitInput , lengthSize , true , 7 ) , "ASCII" ) ;
public class StreamHelpers { /** * Reads a number of bytes from the given InputStream and returns it as the given byte array . * @ param source The InputStream to read . * @ param length The number of bytes to read . * @ return A byte array containing the contents of the Stream . * @ throws IOException If unable to read from the given InputStream . Throws { @ link EOFException } if the number of bytes * remaining in the InputStream is less than length . */ public static byte [ ] readAll ( InputStream source , int length ) throws IOException { } }
byte [ ] ret = new byte [ length ] ; int readBytes = readAll ( source , ret , 0 , ret . length ) ; if ( readBytes < ret . length ) { throw new EOFException ( String . format ( "Was only able to read %d bytes, which is less than the requested length of %d." , readBytes , ret . length ) ) ; } return ret ;
public class GSCAImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public void eSet ( int featureID , Object newValue ) { } }
switch ( featureID ) { case AfplibPackage . GSCA__XPOS : setXPOS ( ( Integer ) newValue ) ; return ; case AfplibPackage . GSCA__YPOS : setYPOS ( ( Integer ) newValue ) ; return ; } super . eSet ( featureID , newValue ) ;
public class SpatialKeyAlgo { /** * This method returns latitude and longitude via latLon - calculated from specified spatialKey * @ param spatialKey is the input */ @ Override public final void decode ( long spatialKey , GHPoint latLon ) { } }
// Performance : calculating ' midLon ' and ' midLat ' on the fly is not slower than using // precalculated values from arrays and for ' bits ' a precalculated array is even slightly slower ! // Use the value in the middle = > start from " min " use " max " as initial step - size double midLat = ( bbox . maxLat - bbox . minLat ) / 2 ; double midLon = ( bbox . maxLon - bbox . minLon ) / 2 ; double lat = bbox . minLat ; double lon = bbox . minLon ; long bits = initialBits ; while ( true ) { if ( ( spatialKey & bits ) != 0 ) { lat += midLat ; } midLat /= 2 ; bits >>>= 1 ; if ( ( spatialKey & bits ) != 0 ) { lon += midLon ; } midLon /= 2 ; if ( bits > 1 ) { bits >>>= 1 ; } else { break ; } } // stable rounding - see testBijection lat += midLat ; lon += midLon ; latLon . lat = lat ; latLon . lon = lon ;
public class CommonCfg { /** * printTrace : This method print the messages to the trace file . * @ param key * @ param value * @ param tabLevel */ @ Trivial public static void printTrace ( String key , Object value , int tabLevel ) { } }
if ( tc . isDebugEnabled ( ) ) { StringBuilder msg = new StringBuilder ( ) ; for ( int count = 0 ; count < tabLevel ; count ++ ) { msg . append ( "\t" ) ; } if ( value != null ) { msg . append ( key ) ; msg . append ( ":" ) ; msg . append ( value ) ; } else { msg . append ( key ) ; } Tr . debug ( tc , msg . toString ( ) ) ; }
public class OidcWebFingerDiscoveryService { /** * Normalize uri components . * @ param resource the resource * @ return the uri components */ protected UriComponents normalize ( final String resource ) { } }
val builder = UriComponentsBuilder . newInstance ( ) ; val matcher = RESOURCE_NORMALIZED_PATTERN . matcher ( resource ) ; if ( ! matcher . matches ( ) ) { LOGGER . error ( "Unable to match the resource [{}] against pattern [{}] for normalization" , resource , matcher . pattern ( ) . pattern ( ) ) ; return null ; } builder . scheme ( matcher . group ( PATTERN_GROUP_INDEX_SCHEME ) ) ; builder . userInfo ( matcher . group ( PATTERN_GROUP_INDEX_USERINFO ) ) ; builder . host ( matcher . group ( PATTERN_GROUP_INDEX_HOST ) ) ; val port = matcher . group ( PATTERN_GROUP_INDEX_PORT ) ; if ( ! StringUtils . isBlank ( port ) ) { builder . port ( Integer . parseInt ( port ) ) ; } builder . path ( matcher . group ( PATTERN_GROUP_INDEX_PATH ) ) ; builder . query ( matcher . group ( PATTERN_GROUP_INDEX_QUERY ) ) ; builder . fragment ( matcher . group ( PATTERN_GROUP_INDEX_FRAGMENT ) ) ; val currentBuilder = builder . build ( ) ; if ( StringUtils . isBlank ( currentBuilder . getScheme ( ) ) ) { if ( ! StringUtils . isBlank ( currentBuilder . getUserInfo ( ) ) && StringUtils . isBlank ( currentBuilder . getPath ( ) ) && StringUtils . isBlank ( currentBuilder . getQuery ( ) ) && currentBuilder . getPort ( ) < 0 ) { builder . scheme ( "acct" ) ; } else { builder . scheme ( "https" ) ; } } builder . fragment ( null ) ; return builder . build ( ) ;
public class ManagementEnforcer { /** * hasNamedPolicy determines whether a named authorization rule exists . * @ param ptype the policy type , can be " p " , " p2 " , " p3 " , . . * @ param params the " p " policy rule . * @ return whether the rule exists . */ public boolean hasNamedPolicy ( String ptype , List < String > params ) { } }
return model . hasPolicy ( "p" , ptype , params ) ;
public class CertificatePoliciesExtension { /** * Get the attribute value . */ public List < PolicyInformation > get ( String name ) throws IOException { } }
if ( name . equalsIgnoreCase ( POLICIES ) ) { // XXXX May want to consider cloning this return certPolicies ; } else { throw new IOException ( "Attribute name [" + name + "] not recognized by " + "CertAttrSet:CertificatePoliciesExtension." ) ; }
public class ApiOvhOrder { /** * Create order * REST : POST / order / overTheBox / new / { duration } * @ param offer [ required ] Offer name * @ param deviceId [ required ] The id of the device * @ param voucher [ required ] An optional voucher * @ param duration [ required ] Duration */ public OvhOrder overTheBox_new_duration_POST ( String duration , String deviceId , String offer , String voucher ) throws IOException { } }
String qPath = "/order/overTheBox/new/{duration}" ; StringBuilder sb = path ( qPath , duration ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "deviceId" , deviceId ) ; addBody ( o , "offer" , offer ) ; addBody ( o , "voucher" , voucher ) ; String resp = exec ( qPath , "POST" , sb . toString ( ) , o ) ; return convertTo ( resp , OvhOrder . class ) ;
public class DefuzzifierFactory { /** * Creates a Defuzzifier by executing the registered constructor * @ param key is the unique name by which constructors are registered * @ param type is the type of a WeightedDefuzzifier * @ return a Defuzzifier by executing the registered constructor and setting * its type */ public Defuzzifier constrDefuzzifier ( String key , WeightedDefuzzifier . Type type ) { } }
Defuzzifier result = constructObject ( key ) ; if ( result instanceof WeightedDefuzzifier ) { ( ( WeightedDefuzzifier ) result ) . setType ( type ) ; } return result ;
public class MakeValidOp { /** * If X or Y is null , return an empty Point */ private Point makePointValid ( Point point ) { } }
CoordinateSequence sequence = point . getCoordinateSequence ( ) ; GeometryFactory factory = point . getFactory ( ) ; CoordinateSequenceFactory csFactory = factory . getCoordinateSequenceFactory ( ) ; if ( sequence . size ( ) == 0 ) { return point ; } else if ( Double . isNaN ( sequence . getOrdinate ( 0 , 0 ) ) || Double . isNaN ( sequence . getOrdinate ( 0 , 1 ) ) ) { return factory . createPoint ( csFactory . create ( 0 , sequence . getDimension ( ) ) ) ; } else if ( sequence . size ( ) == 1 ) { return point ; } else { throw new RuntimeException ( "JTS cannot create a point from a CoordinateSequence containing several points" ) ; }
public class LoadClient { /** * Record the event elapsed time to the histogram and delay initiation of the next event based * on the load distribution . */ void delay ( long alreadyElapsed ) { } }
recorder . recordValue ( alreadyElapsed ) ; if ( distribution != null ) { long nextPermitted = Math . round ( distribution . sample ( ) * 1000000000.0 ) ; if ( nextPermitted > alreadyElapsed ) { LockSupport . parkNanos ( nextPermitted - alreadyElapsed ) ; } }
public class LinkArgs { /** * Custom properties that my be used by application - specific markup builders or processors . * @ param map Property map . Is merged with properties already set . * @ return this */ public @ NotNull LinkArgs properties ( Map < String , Object > map ) { } }
if ( map == null ) { throw new IllegalArgumentException ( "Map argument must not be null." ) ; } getProperties ( ) . putAll ( map ) ; return this ;
public class HttpPushBuilder { /** * Methods required by com . ibm . wsspi . http . ee8 . HttpPushBuilder */ @ Override public Set < HeaderField > getHeaders ( ) { } }
HashSet < HeaderField > headerFields = new HashSet < HeaderField > ( ) ; if ( _headers . size ( ) > 0 ) { Iterator < String > headerNames = _headers . keySet ( ) . iterator ( ) ; while ( headerNames . hasNext ( ) ) { Iterator < HttpHeaderField > headers = _headers . get ( headerNames . next ( ) ) . iterator ( ) ; while ( headers . hasNext ( ) ) { HttpHeaderField field = headers . next ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "getHeaders()" , "add header name = " + field . getName ( ) + ", value = " + field . asString ( ) ) ; } headerFields . add ( field ) ; } } } return headerFields ;
public class PropertyConverter { /** * Converts a string denoting an amount of time into seconds . Strings are expected to follow this form where # equals a digit : # M The following are permitted for denoting time : H = hours , M = minutes , S = seconds * @ param time * time * @ return time in seconds */ public static int convertStringToTimeSeconds ( String time ) { } }
int result = 0 ; if ( time . endsWith ( "H" ) ) { int hoursToAdd = Integer . valueOf ( StringUtils . remove ( time , 'H' ) ) ; result = ( 60 * 60 ) * hoursToAdd ; } else if ( time . endsWith ( "M" ) ) { int minsToAdd = Integer . valueOf ( StringUtils . remove ( time , 'M' ) ) ; result = 60 * minsToAdd ; } else if ( time . endsWith ( "S" ) ) { int secsToAdd = Integer . valueOf ( StringUtils . remove ( time , 'S' ) ) ; result = secsToAdd ; } return result ;
public class FOPServlet { /** * { @ inheritDoc } */ @ Override public void init ( ) throws ServletException { } }
this . uriResolver = new RepositoryURIResolver ( ) ; this . transFactory = TransformerFactory . newInstance ( ) ; this . transFactory . setURIResolver ( this . uriResolver ) ; // Configure FopFactory as desired this . fopFactory = FopFactory . newInstance ( ) ; this . fopFactory . setURIResolver ( this . uriResolver ) ; configureFopFactory ( ) ;
public class UpdateConfigurationTemplateResult { /** * A list of the configuration options and their values in this configuration set . * @ return A list of the configuration options and their values in this configuration set . */ public java . util . List < ConfigurationOptionSetting > getOptionSettings ( ) { } }
if ( optionSettings == null ) { optionSettings = new com . amazonaws . internal . SdkInternalList < ConfigurationOptionSetting > ( ) ; } return optionSettings ;
public class GenericMethod { /** * Generates a request entity from the post parameters , if present . Calls * { @ link EntityEnclosingMethod # generateRequestBody ( ) } if parameters have not been set . * @ since 3.0 */ @ Override protected RequestEntity generateRequestEntity ( ) { } }
if ( ! this . params . isEmpty ( ) ) { // Use a ByteArrayRequestEntity instead of a StringRequestEntity . // This is to avoid potential encoding issues . Form url encoded strings // are ASCII by definition but the content type may not be . Treating the content // as bytes allows us to keep the current charset without worrying about how // this charset will effect the encoding of the form url encoded string . String content = EncodingUtil . formUrlEncode ( getParameters ( ) , getRequestCharSet ( ) ) ; ByteArrayRequestEntity entity = new ByteArrayRequestEntity ( EncodingUtil . getAsciiBytes ( content ) , FORM_URL_ENCODED_CONTENT_TYPE ) ; return entity ; } return super . generateRequestEntity ( ) ;
public class TedDriver { /** * register task ( configuration ) with own retryScheduler */ public void registerTaskConfig ( String taskName , TedProcessorFactory tedProcessorFactory , TedRetryScheduler retryScheduler ) { } }
tedDriverImpl . registerTaskConfig ( taskName , tedProcessorFactory , null , retryScheduler , null ) ;
public class BaseMonetaryCurrenciesSingletonSpi { /** * Allows to check if a { @ link javax . money . CurrencyUnit } instance is defined , i . e . * accessible from { @ link BaseMonetaryCurrenciesSingletonSpi # getCurrency ( String , String . . . ) } . * @ param code the currency code , not { @ code null } . * @ param providers the ( optional ) specification of providers to consider . If not set ( empty ) the providers * as defined by # getDefaultRoundingProviderChain ( ) should be used . * @ return { @ code true } if { @ link BaseMonetaryCurrenciesSingletonSpi # getCurrency ( String , String . . . ) } * would return a result for the given code . */ public boolean isCurrencyAvailable ( String code , String ... providers ) { } }
return ! getCurrencies ( CurrencyQueryBuilder . of ( ) . setCurrencyCodes ( code ) . setProviderNames ( providers ) . build ( ) ) . isEmpty ( ) ;
public class DefaultProviderSelector { /** * Find any provider loaders which are available in the container . */ private Map findLoaders ( ) { } }
Map loaders = getContainer ( ) . getComponentDescriptorMap ( ProviderLoader . class . getName ( ) ) ; if ( loaders == null ) { throw new Error ( "No provider loaders found" ) ; } Set keys = loaders . keySet ( ) ; Map found = null ; ProviderLoader defaultLoader = null ; for ( Iterator iter = keys . iterator ( ) ; iter . hasNext ( ) ; ) { String key = ( String ) iter . next ( ) ; ProviderLoader loader ; try { loader = ( ProviderLoader ) getContainer ( ) . lookup ( ProviderLoader . class . getName ( ) , key ) ; } catch ( Exception e ) { log . warn ( "Failed to lookup provider loader for key: {}" , key , e ) ; continue ; } if ( loader != null ) { if ( found == null ) { // we need an ordered map found = new LinkedHashMap ( ) ; } if ( key . equals ( SELECT_DEFAULT ) ) { defaultLoader = loader ; } else { found . put ( key , loader ) ; } } } // the default should be added at the end ( as fallback ) assert defaultLoader != null ; found . put ( SELECT_DEFAULT , defaultLoader ) ; return found ;
public class AsciiString { /** * Concatenates this string and the specified string . * @ param string the string to concatenate * @ return a new string which is the concatenation of this string and the specified string . */ public AsciiString concat ( CharSequence string ) { } }
int thisLen = length ( ) ; int thatLen = string . length ( ) ; if ( thatLen == 0 ) { return this ; } if ( string . getClass ( ) == AsciiString . class ) { AsciiString that = ( AsciiString ) string ; if ( isEmpty ( ) ) { return that ; } byte [ ] newValue = PlatformDependent . allocateUninitializedArray ( thisLen + thatLen ) ; System . arraycopy ( value , arrayOffset ( ) , newValue , 0 , thisLen ) ; System . arraycopy ( that . value , that . arrayOffset ( ) , newValue , thisLen , thatLen ) ; return new AsciiString ( newValue , false ) ; } if ( isEmpty ( ) ) { return new AsciiString ( string ) ; } byte [ ] newValue = PlatformDependent . allocateUninitializedArray ( thisLen + thatLen ) ; System . arraycopy ( value , arrayOffset ( ) , newValue , 0 , thisLen ) ; for ( int i = thisLen , j = 0 ; i < newValue . length ; i ++ , j ++ ) { newValue [ i ] = c2b ( string . charAt ( j ) ) ; } return new AsciiString ( newValue , false ) ;
public class MoskitoAction { /** * This method allows you to perform some tasks prior to call to the moskitoExecute . * @ param mapping * @ param af * @ param req * @ param res * @ throws Exception */ protected void preProcessExecute ( ActionMapping mapping , ActionForm af , HttpServletRequest req , HttpServletResponse res ) throws Exception { } }
public class LoggingSubsystemParser { /** * Parses a property element . * The { @ code name } attribute is required . If the { @ code value } attribute is not present an * { @ linkplain org . jboss . dmr . ModelNode UNDEFINED ModelNode } will set on the operation . * @ param operation the operation to add the parsed properties to * @ param reader the reader to use * @ param wrapperName the name of the attribute that wraps the key and value attributes * @ throws XMLStreamException if a parsing error occurs */ static void parsePropertyElement ( final ModelNode operation , final XMLExtendedStreamReader reader , final String wrapperName ) throws XMLStreamException { } }
while ( reader . nextTag ( ) != END_ELEMENT ) { final int cnt = reader . getAttributeCount ( ) ; String name = null ; String value = null ; for ( int i = 0 ; i < cnt ; i ++ ) { requireNoNamespaceAttribute ( reader , i ) ; final String attrValue = reader . getAttributeValue ( i ) ; final Attribute attribute = Attribute . forName ( reader . getAttributeLocalName ( i ) ) ; switch ( attribute ) { case NAME : { name = attrValue ; break ; } case VALUE : { value = attrValue ; break ; } default : throw unexpectedAttribute ( reader , i ) ; } } if ( name == null ) { throw missingRequired ( reader , Collections . singleton ( Attribute . NAME . getLocalName ( ) ) ) ; } operation . get ( wrapperName ) . add ( name , ( value == null ? new ModelNode ( ) : new ModelNode ( value ) ) ) ; if ( reader . nextTag ( ) != END_ELEMENT ) { throw unexpectedElement ( reader ) ; } }
public class ContainerAS { /** * This method is called after the ActivitySession associated with * this < code > ContainerAS < / code > has completed . */ public void afterCompletion ( int status ) { } }
final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) // d144064 Tr . entry ( tc , "afterCompletion (" + status + ") : " + this ) ; try { // inform the activator that the session has ended // so the beans can be passivated if necessary BeanO [ ] beanOs = getBeanOs ( ) ; EJBKey [ ] ejbKeys = getEJBKeys ( beanOs ) ; if ( beanOs != null ) { for ( int i = 0 ; i < beanOs . length ; ++ i ) { BeanO beanO = beanOs [ i ] ; try { ivContainer . activator . unitOfWorkEnd ( this , beanO ) ; } catch ( Throwable ex ) { FFDCFilter . processException ( ex , CLASS_NAME + ".afterCompletion" , "214" , this ) ; if ( isTraceOn && tc . isEventEnabled ( ) ) // d144064 Tr . event ( tc , "Exception thrown in afterCompletion()" , new Object [ ] { beanO , ex } ) ; } } } // inform the unit of controller the session has ended // so references that are no longer needed can be released ivContainer . uowCtrl . sessionEnded ( ejbKeys ) ; // d425046 Ensure ContainerAS not available now ContainerTx tx = ivContainer . getCurrentTx ( false ) ; if ( tx != null ) { tx . setContainerAS ( null ) ; // prevent activation strategy finding if ( isTraceOn && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "removed ContainerAS during afterCompletion" ) ; } } catch ( Throwable t ) { FFDCFilter . processException ( t , CLASS_NAME + ".afterCompletion" , "219" , this ) ; if ( isTraceOn && tc . isEventEnabled ( ) ) // d144064 Tr . event ( tc , "Exception during afterCompletion" , t ) ; throw new RuntimeException ( t . toString ( ) ) ; } finally { ivContainer . containerASCompleted ( ivASKey ) ; } if ( isTraceOn && tc . isEntryEnabled ( ) ) // d144064 Tr . exit ( tc , "afterCompletion" ) ;
public class DBaseFileField { /** * Update the sizes with the given ones if and only if * they are greater than the existing ones . * This test is done according to the type of the field . * @ param fieldLength is the size of this field * @ param decimalPointPosition is the position of the decimal point . */ @ SuppressWarnings ( "checkstyle:cyclomaticcomplexity" ) void updateSizes ( int fieldLength , int decimalPointPosition ) { } }
switch ( this . type ) { case STRING : if ( fieldLength > this . length ) { this . length = fieldLength ; } break ; case FLOATING_NUMBER : case NUMBER : if ( decimalPointPosition > this . decimal ) { final int intPart = this . length - this . decimal ; this . decimal = decimalPointPosition ; this . length = intPart + this . decimal ; } if ( fieldLength > this . length ) { this . length = fieldLength ; } break ; // $ CASES - OMITTED $ default : // Do nothing }