signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class MainApplication { /** * Set this property in the user ' s property area .
* @ param strLanguage The language code . */
public void setLanguage ( String strLanguage ) { } } | Record recUserInfo = ( Record ) this . getUserInfo ( ) ; if ( recUserInfo != null ) { boolean flag = recUserInfo . getField ( UserInfoModel . PROPERTIES ) . isModified ( ) ; boolean [ ] brgEnabled = recUserInfo . getField ( UserInfoModel . PROPERTIES ) . setEnableListeners ( false ) ; ( ( PropertiesField ) recUserInfo . getField ( UserInfoModel . PROPERTIES ) ) . setProperty ( DBParams . LANGUAGE , strLanguage ) ; recUserInfo . getField ( UserInfoModel . PROPERTIES ) . setModified ( flag ) ; recUserInfo . getField ( UserInfoModel . PROPERTIES ) . setEnableListeners ( brgEnabled ) ; } super . setLanguage ( strLanguage ) ; |
public class CommerceOrderUtil { /** * Returns the first commerce order in the ordered set where billingAddressId = & # 63 ; .
* @ param billingAddressId the billing address ID
* @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > )
* @ return the first matching commerce order , or < code > null < / code > if a matching commerce order could not be found */
public static CommerceOrder fetchByBillingAddressId_First ( long billingAddressId , OrderByComparator < CommerceOrder > orderByComparator ) { } } | return getPersistence ( ) . fetchByBillingAddressId_First ( billingAddressId , orderByComparator ) ; |
public class BaseKvDao { /** * { @ inheritDoc } */
@ Override public void put ( String spaceId , String key , byte [ ] value ) throws IOException { } } | kvStorage . put ( spaceId , key , value , new IPutCallback < byte [ ] > ( ) { @ Override public void onSuccess ( String spaceId , String key , byte [ ] entry ) { // invalidate cache upon successful deletion
invalidateCacheEntry ( spaceId , key , entry ) ; } @ Override public void onError ( String spaceId , String key , byte [ ] entry , Throwable t ) { LOGGER . error ( t . getMessage ( ) , t ) ; } } ) ; |
public class JMSBridgeList { /** * This update the table itens for the source - context and target - context attributes
* The source item may be the user selectable item or the default ( the first ) . */
private void updatePropertiesData ( Property bridge ) { } } | Property selectedItem = getSelectedEntity ( ) ; if ( bridge != null ) { selectedItem = bridge ; } if ( selectedItem != null ) { ModelNode sourceContextNode = selectedItem . getValue ( ) . get ( "source-context" ) ; ModelNode targetContextNode = selectedItem . getValue ( ) . get ( "target-context" ) ; sourceContextEditor . update ( sourceContextNode . asPropertyList ( ) ) ; targetContextEditor . update ( targetContextNode . asPropertyList ( ) ) ; formAssets . getForm ( ) . edit ( selectedItem . getValue ( ) ) ; sourceCredentialRefForm . getForm ( ) . edit ( selectedItem . getValue ( ) . get ( "source-credential-reference" ) ) ; targetCredentialRefForm . getForm ( ) . edit ( selectedItem . getValue ( ) . get ( "target-credential-reference" ) ) ; } else { formAssets . getForm ( ) . clearValues ( ) ; sourceContextEditor . clearValues ( ) ; targetContextEditor . clearValues ( ) ; sourceCredentialRefForm . getForm ( ) . clearValues ( ) ; targetCredentialRefForm . getForm ( ) . clearValues ( ) ; } sourceContextEditor . enableToolButtons ( selectedItem != null ) ; targetContextEditor . enableToolButtons ( selectedItem != null ) ; |
public class DataIO { /** * Converts hexadecimal string into binary data
* @ param s hexadecimal string
* @ return binary data
* @ throws NumberFormatException in case of string format error */
public static byte [ ] fromHexa ( String s ) { } } | byte [ ] ret = new byte [ s . length ( ) / 2 ] ; for ( int i = 0 ; i < ret . length ; i ++ ) { ret [ i ] = ( byte ) Integer . parseInt ( s . substring ( i * 2 , i * 2 + 2 ) , 16 ) ; } return ret ; |
public class GalenJsApi { /** * Needed for Javascript based tests
* @ throws IOException */
public static LayoutReport checkLayout ( WebDriver driver , String fileName , String [ ] includedTags , String [ ] excludedTags , String sectionNameFilter , Properties properties , String screenshotFilePath , JsVariable [ ] vars , JsPageObject [ ] jsPageObjects ) throws IOException { } } | TestSession session = TestSession . current ( ) ; if ( session == null ) { throw new UnregisteredTestSession ( "Cannot check layout as there was no TestSession created" ) ; } TestReport report = session . getReport ( ) ; File screenshotFile = null ; if ( screenshotFilePath != null ) { screenshotFile = new File ( screenshotFilePath ) ; if ( ! screenshotFile . exists ( ) || ! screenshotFile . isFile ( ) ) { throw new IOException ( "Couldn't find screenshot in " + screenshotFilePath ) ; } } if ( fileName == null ) { throw new IOException ( "Spec file name is not defined" ) ; } List < String > includedTagsList = toList ( includedTags ) ; Map < String , Object > jsVariables = convertJsVariables ( vars ) ; LayoutReport layoutReport = Galen . checkLayout ( new SeleniumBrowser ( driver ) , fileName , new SectionFilter ( includedTagsList , toList ( excludedTags ) ) . withSectionName ( sectionNameFilter ) , properties , jsVariables , screenshotFile , session . getListener ( ) , convertObjects ( jsPageObjects ) ) ; GalenUtils . attachLayoutReport ( layoutReport , report , fileName , includedTagsList ) ; return layoutReport ; |
public class AbstractStoreConfigurationBuilder { /** * { @ inheritDoc } */
@ Override public S shared ( boolean b ) { } } | attributes . attribute ( SHARED ) . set ( b ) ; shared = b ; return self ( ) ; |
public class GenericUtils { /** * Debug print the entire input byte [ ] . This will be a sequence of 16 byte
* lines , starting with a line indicator , the hex bytes and then the ASCII
* representation .
* @ param data
* @ return String */
static public String getHexDump ( byte [ ] data ) { } } | return ( null == data ) ? null : getHexDump ( data , data . length ) ; |
public class Spread { /** * Calculates the Spread metric .
* @ param front The front .
* @ param referenceFront The true pareto front . */
public double spread ( Front front , Front referenceFront ) { } } | PointDistance distance = new EuclideanDistance ( ) ; // STEP 1 . Sort normalizedFront and normalizedParetoFront ;
front . sort ( new LexicographicalPointComparator ( ) ) ; referenceFront . sort ( new LexicographicalPointComparator ( ) ) ; // STEP 2 . Compute df and dl ( See specifications in Deb ' s description of the metric )
double df = distance . compute ( front . getPoint ( 0 ) , referenceFront . getPoint ( 0 ) ) ; double dl = distance . compute ( front . getPoint ( front . getNumberOfPoints ( ) - 1 ) , referenceFront . getPoint ( referenceFront . getNumberOfPoints ( ) - 1 ) ) ; double mean = 0.0 ; double diversitySum = df + dl ; int numberOfPoints = front . getNumberOfPoints ( ) ; // STEP 3 . Calculate the mean of distances between points i and ( i - 1 ) .
// ( the points are in lexicografical order )
for ( int i = 0 ; i < ( numberOfPoints - 1 ) ; i ++ ) { mean += distance . compute ( front . getPoint ( i ) , front . getPoint ( i + 1 ) ) ; } mean = mean / ( double ) ( numberOfPoints - 1 ) ; // STEP 4 . If there are more than a single point , continue computing the
// metric . In other case , return the worse value ( 1.0 , see metric ' s description ) .
if ( numberOfPoints > 1 ) { for ( int i = 0 ; i < ( numberOfPoints - 1 ) ; i ++ ) { diversitySum += Math . abs ( distance . compute ( front . getPoint ( i ) , front . getPoint ( i + 1 ) ) - mean ) ; } return diversitySum / ( df + dl + ( numberOfPoints - 1 ) * mean ) ; } else { return 1.0 ; } |
public class AbstractScalaxbMojo { /** * Returns a map of URIs to package name , as specified by the packageNames
* parameter . */
Map < String , String > packageNameMap ( ) { } } | if ( packageNames == null ) { return emptyMap ( ) ; } Map < String , String > names = new LinkedHashMap < String , String > ( ) ; for ( PackageName name : packageNames ) { names . put ( name . getUri ( ) , name . getPackage ( ) ) ; } return names ; |
public class XFunctionTypeRefImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public NotificationChain eInverseRemove ( InternalEObject otherEnd , int featureID , NotificationChain msgs ) { } } | switch ( featureID ) { case XtypePackage . XFUNCTION_TYPE_REF__PARAM_TYPES : return ( ( InternalEList < ? > ) getParamTypes ( ) ) . basicRemove ( otherEnd , msgs ) ; case XtypePackage . XFUNCTION_TYPE_REF__RETURN_TYPE : return basicSetReturnType ( null , msgs ) ; } return super . eInverseRemove ( otherEnd , featureID , msgs ) ; |
public class PathHelper { /** * Transform path from relative oldBase to newBase .
* If oldBase = / a / b and newBase = / q / w / e then path / a / b / c / d will
* transform to / q / w / e / c / d
* @ param oldBase
* @ param newBase
* @ param path
* @ return */
public static final Path transform ( Path oldBase , Path newBase , Path path ) { } } | if ( ! path . startsWith ( oldBase ) ) { throw new IllegalArgumentException ( path + " not in " + oldBase ) ; } return newBase . resolve ( oldBase . relativize ( path ) ) ; |
public class Page { /** * Loads the content of this page from a fetched HttpEntity .
* @ param entity HttpEntity
* @ param maxBytes The maximum number of bytes to read
* @ throws IOException when load fails */
public void load ( HttpEntity entity , int maxBytes ) throws IOException { } } | contentType = null ; Header type = entity . getContentType ( ) ; if ( type != null ) { contentType = type . getValue ( ) ; } contentEncoding = null ; Header encoding = entity . getContentEncoding ( ) ; if ( encoding != null ) { contentEncoding = encoding . getValue ( ) ; } Charset charset ; try { charset = ContentType . getOrDefault ( entity ) . getCharset ( ) ; } catch ( Exception e ) { logger . warn ( "parse charset failed: {}" , e . getMessage ( ) ) ; charset = Charset . forName ( "UTF-8" ) ; } if ( charset != null ) { contentCharset = charset . displayName ( ) ; } contentData = toByteArray ( entity , maxBytes ) ; |
public class SkippingState { /** * { @ inheritDoc } */
public DecodingState decode ( IoBuffer in , ProtocolDecoderOutput out ) throws Exception { } } | int beginPos = in . position ( ) ; int limit = in . limit ( ) ; for ( int i = beginPos ; i < limit ; i ++ ) { byte b = in . get ( i ) ; if ( ! canSkip ( b ) ) { in . position ( i ) ; int answer = this . skippedBytes ; this . skippedBytes = 0 ; return finishDecode ( answer ) ; } skippedBytes ++ ; } in . position ( limit ) ; return this ; |
public class TranscoderDB { /** * / * decorator _ names */
public static int decoratorNames ( int ecflags , byte [ ] [ ] decorators ) { } } | switch ( ecflags & NEWLINE_DECORATOR_MASK ) { case UNIVERSAL_NEWLINE_DECORATOR : case CRLF_NEWLINE_DECORATOR : case CR_NEWLINE_DECORATOR : case 0 : break ; default : return - 1 ; } if ( ( ( ecflags & XML_TEXT_DECORATOR ) != 0 ) && ( ( ecflags & XML_ATTR_CONTENT_DECORATOR ) != 0 ) ) return - 1 ; int numDecorators = 0 ; if ( ( ecflags & XML_TEXT_DECORATOR ) != 0 ) decorators [ numDecorators ++ ] = "xml_text_escape" . getBytes ( ) ; if ( ( ecflags & XML_ATTR_CONTENT_DECORATOR ) != 0 ) decorators [ numDecorators ++ ] = "xml_attr_content_escape" . getBytes ( ) ; if ( ( ecflags & XML_ATTR_QUOTE_DECORATOR ) != 0 ) decorators [ numDecorators ++ ] = "xml_attr_quote" . getBytes ( ) ; if ( ( ecflags & CRLF_NEWLINE_DECORATOR ) != 0 ) decorators [ numDecorators ++ ] = "crlf_newline" . getBytes ( ) ; if ( ( ecflags & CR_NEWLINE_DECORATOR ) != 0 ) decorators [ numDecorators ++ ] = "cr_newline" . getBytes ( ) ; if ( ( ecflags & UNIVERSAL_NEWLINE_DECORATOR ) != 0 ) decorators [ numDecorators ++ ] = "universal_newline" . getBytes ( ) ; return numDecorators ; |
public class Surface { /** * Fills the specified rectangle . */
public Surface fillRect ( float x , float y , float width , float height ) { } } | if ( patternTex != null ) { batch . addQuad ( patternTex , tint , tx ( ) , x , y , width , height ) ; } else { batch . addQuad ( colorTex , Tint . combine ( fillColor , tint ) , tx ( ) , x , y , width , height ) ; } return this ; |
public class BranchFilterModule { /** * Modify and filter topics for branches . These files use an existing file name . */
private void filterTopics ( final Element topicref , final List < FilterUtils > filters ) { } } | final List < FilterUtils > fs = combineFilterUtils ( topicref , filters ) ; final String href = topicref . getAttribute ( ATTRIBUTE_NAME_HREF ) ; final Attr skipFilter = topicref . getAttributeNode ( SKIP_FILTER ) ; final URI srcAbsUri = job . tempDirURI . resolve ( map . resolve ( href ) ) ; if ( ! fs . isEmpty ( ) && skipFilter == null && ! filtered . contains ( srcAbsUri ) && ! href . isEmpty ( ) && ! ATTR_SCOPE_VALUE_EXTERNAL . equals ( topicref . getAttribute ( ATTRIBUTE_NAME_SCOPE ) ) && ! ATTR_PROCESSING_ROLE_VALUE_RESOURCE_ONLY . equals ( topicref . getAttribute ( ATTRIBUTE_NAME_PROCESSING_ROLE ) ) && isDitaFormat ( topicref . getAttributeNode ( ATTRIBUTE_NAME_FORMAT ) ) ) { final ProfilingFilter writer = new ProfilingFilter ( ) ; writer . setLogger ( logger ) ; writer . setJob ( job ) ; writer . setFilterUtils ( fs ) ; writer . setCurrentFile ( srcAbsUri ) ; final List < XMLFilter > pipe = singletonList ( writer ) ; logger . info ( "Filtering " + srcAbsUri ) ; try { xmlUtils . transform ( srcAbsUri , pipe ) ; } catch ( final DITAOTException e ) { logger . error ( "Failed to filter " + srcAbsUri + ": " + e . getMessage ( ) , e ) ; } filtered . add ( srcAbsUri ) ; } if ( skipFilter != null ) { topicref . removeAttributeNode ( skipFilter ) ; } for ( final Element child : getChildElements ( topicref , MAP_TOPICREF ) ) { if ( DITAVAREF_D_DITAVALREF . matches ( child ) ) { continue ; } filterTopics ( child , fs ) ; } |
public class AmazonNeptuneClient { /** * Creates a new DB cluster from a DB snapshot or DB cluster snapshot .
* If a DB snapshot is specified , the target DB cluster is created from the source DB snapshot with a default
* configuration and default security group .
* If a DB cluster snapshot is specified , the target DB cluster is created from the source DB cluster restore point
* with the same configuration as the original source DB cluster , except that the new DB cluster is created with the
* default security group .
* @ param restoreDBClusterFromSnapshotRequest
* @ return Result of the RestoreDBClusterFromSnapshot operation returned by the service .
* @ throws DBClusterAlreadyExistsException
* User already has a DB cluster with the given identifier .
* @ throws DBClusterQuotaExceededException
* User attempted to create a new DB cluster and the user has already reached the maximum allowed DB cluster
* quota .
* @ throws StorageQuotaExceededException
* Request would result in user exceeding the allowed amount of storage available across all DB instances .
* @ throws DBSubnetGroupNotFoundException
* < i > DBSubnetGroupName < / i > does not refer to an existing DB subnet group .
* @ throws DBSnapshotNotFoundException
* < i > DBSnapshotIdentifier < / i > does not refer to an existing DB snapshot .
* @ throws DBClusterSnapshotNotFoundException
* < i > DBClusterSnapshotIdentifier < / i > does not refer to an existing DB cluster snapshot .
* @ throws InsufficientDBClusterCapacityException
* The DB cluster does not have enough capacity for the current operation .
* @ throws InsufficientStorageClusterCapacityException
* There is insufficient storage available for the current action . You may be able to resolve this error by
* updating your subnet group to use different Availability Zones that have more storage available .
* @ throws InvalidDBSnapshotStateException
* The state of the DB snapshot does not allow deletion .
* @ throws InvalidDBClusterSnapshotStateException
* The supplied value is not a valid DB cluster snapshot state .
* @ throws StorageQuotaExceededException
* Request would result in user exceeding the allowed amount of storage available across all DB instances .
* @ throws InvalidVPCNetworkStateException
* DB subnet group does not cover all Availability Zones after it is created because users ' change .
* @ throws InvalidRestoreException
* Cannot restore from vpc backup to non - vpc DB instance .
* @ throws DBSubnetGroupNotFoundException
* < i > DBSubnetGroupName < / i > does not refer to an existing DB subnet group .
* @ throws InvalidSubnetException
* The requested subnet is invalid , or multiple subnets were requested that are not all in a common VPC .
* @ throws OptionGroupNotFoundException
* @ throws KMSKeyNotAccessibleException
* Error accessing KMS key .
* @ sample AmazonNeptune . RestoreDBClusterFromSnapshot
* @ see < a href = " http : / / docs . aws . amazon . com / goto / WebAPI / neptune - 2014-10-31 / RestoreDBClusterFromSnapshot "
* target = " _ top " > AWS API Documentation < / a > */
@ Override public DBCluster restoreDBClusterFromSnapshot ( RestoreDBClusterFromSnapshotRequest request ) { } } | request = beforeClientExecution ( request ) ; return executeRestoreDBClusterFromSnapshot ( request ) ; |
public class ProtobufIDLGenerator { /** * get IDL content from class .
* @ param cls target class to parse for IDL message .
* @ param cachedTypes if type already in set will not generate IDL . if a new type found will add to set
* @ param cachedEnumTypes if enum already in set will not generate IDL . if a new enum found will add to set
* @ param ignoreJava set true to ignore generate package and class name
* @ return protobuf IDL content in string
* @ see Protobuf */
public static String getIDL ( final Class < ? > cls , final Set < Class < ? > > cachedTypes , final Set < Class < ? > > cachedEnumTypes , boolean ignoreJava ) { } } | Ignore ignore = cls . getAnnotation ( Ignore . class ) ; if ( ignore != null ) { LOGGER . info ( "class '{}' marked as @Ignore annotation, create IDL ignored." , cls . getName ( ) ) ; return null ; } Set < Class < ? > > types = cachedTypes ; if ( types == null ) { types = new HashSet < Class < ? > > ( ) ; } Set < Class < ? > > enumTypes = cachedEnumTypes ; if ( enumTypes == null ) { enumTypes = new HashSet < Class < ? > > ( ) ; } if ( types . contains ( cls ) ) { return null ; } StringBuilder code = new StringBuilder ( ) ; code . append ( V3_HEADER ) . append ( ";\n" ) ; if ( ! ignoreJava ) { // define package
code . append ( "package " ) . append ( cls . getPackage ( ) . getName ( ) ) . append ( ";\n" ) ; code . append ( "option java_outer_classname = \"" ) . append ( cls . getSimpleName ( ) ) . append ( "$$ByJProtobuf\";\n" ) ; } // define outer name class
types . add ( cls ) ; generateIDL ( code , cls , types , enumTypes ) ; return code . toString ( ) ; |
public class AndroidLogProvider { @ Override public void w ( String tag , String message ) { } } | Log . w ( tag , message ) ; // writeToFile ( Level . WARNING , tag , message ) ;
// sendLogs ( " w " , tag , message ) ; |
public class IntersectionImpl { /** * Construct a new Intersection target on the java heap .
* @ param seed < a href = " { @ docRoot } / resources / dictionary . html # seed " > See Seed < / a >
* @ return a new IntersectionImpl on the Java heap */
static IntersectionImpl initNewHeapInstance ( final long seed ) { } } | final IntersectionImpl impl = new IntersectionImpl ( null , seed , false ) ; impl . lgArrLongs_ = 0 ; impl . curCount_ = - 1 ; // Universal Set is true
impl . thetaLong_ = Long . MAX_VALUE ; impl . empty_ = false ; // A virgin intersection represents the Universal Set so empty is FALSE !
impl . hashTable_ = null ; return impl ; |
public class EntityDataModelUtil { /** * Gets the OData type for a Java type and checks if the OData type is a complex type ; throws an exception if the
* OData type is not a complex type .
* @ param entityDataModel The entity data model .
* @ param javaType The Java type .
* @ return The OData complex type for the Java type .
* @ throws ODataSystemException If there is no OData type for the specified Java type or if the OData type is not
* a complex type . */
public static ComplexType getAndCheckComplexType ( EntityDataModel entityDataModel , Class < ? > javaType ) { } } | return checkIsComplexType ( getAndCheckType ( entityDataModel , javaType ) ) ; |
public class IndexFile { /** * Get the content length of the given record in bytes , not 16 bit words .
* @ param index
* The index , from 0 to getRecordCount - 1
* @ return The lengh in bytes of the record .
* @ throws java . io . IOException */
public int getContentLength ( int index ) throws IOException { } } | int ret = - 1 ; if ( this . lastIndex != index ) { this . readRecord ( index ) ; } ret = this . recLen ; return ret ; |
public class HashtableOnDisk { /** * Search disk for the indicated entry and return it and its
* predecessor if any . */
private HashtableEntry findEntry ( EvictionTableEntry evt , int retrieveMode , long current , int tableid ) throws IOException , EOFException , FileManagerException , ClassNotFoundException , HashtableOnDiskException { } } | int hashcode = evt . hashcode ; long previous = 0 ; long next = 0 ; int hash = 0 ; initReadBuffer ( current ) ; next = headerin . readLong ( ) ; hash = headerin . readInt ( ) ; while ( current != 0 ) { // System . out . println ( " current : " + current + " next : " + next ) ;
if ( hash == hashcode ) { // hash the same ?
// Need to finish collision resolution and maybe return the object
// System . out . println ( " hashcode matched , hash : " + hashcode ) ;
HashtableEntry entry = readEntry2 ( current , next , hash , previous , retrieveMode , ! CHECK_EXPIRED , tableid , null , evt ) ; // 493877
if ( entry != null ) { // 493877 if entry is NOT null , the entry is found .
return entry ; } } collisions ++ ; // Try for next object in bucket
previous = current ; current = next ; if ( current != 0 ) { // optimize - don ' t read if we know we can ' t use it
initReadBuffer ( current ) ; next = headerin . readLong ( ) ; hash = headerin . readInt ( ) ; } } // If we fall through we did not find it
return null ; |
public class ImageUtils { /** * private static final ClassLoader loader = Thread . currentThread ( ) . getContextClassLoader ( ) ; */
public static Image load ( String path ) { } } | BufferedImage image = null ; try { InputStream in = ImageUtils . class . getClassLoader ( ) . getResourceAsStream ( path ) ; image = ImageIO . read ( in ) ; in . close ( ) ; } catch ( Exception e ) { throw new RuntimeException ( "Could not load image with path: " + path , e ) ; } return image ; |
public class SSOSamlPostProfileHandlerController { /** * Handle SSO HEAD profile redirect request ( not allowed ) .
* @ param response the response
* @ param request the request */
@ RequestMapping ( path = SamlIdPConstants . ENDPOINT_SAML2_SSO_PROFILE_REDIRECT , method = { } } | RequestMethod . HEAD } ) public void handleSaml2ProfileSsoRedirectHeadRequest ( final HttpServletResponse response , final HttpServletRequest request ) { LOGGER . info ( "Endpoint [{}] called with HTTP HEAD returning 400 Bad Request" , SamlIdPConstants . ENDPOINT_SAML2_SSO_PROFILE_REDIRECT ) ; response . setStatus ( HttpServletResponse . SC_BAD_REQUEST ) ; |
public class TaskClient { /** * Retrieve pending tasks by type
* @ param taskType Type of task
* @ param startKey id of the task from where to return the results . NULL to start from the beginning .
* @ param count number of tasks to retrieve
* @ return Returns the list of PENDING tasks by type , starting with a given task Id . */
public List < Task > getPendingTasksByType ( String taskType , String startKey , Integer count ) { } } | Preconditions . checkArgument ( StringUtils . isNotBlank ( taskType ) , "Task type cannot be blank" ) ; Object [ ] params = new Object [ ] { "startKey" , startKey , "count" , count } ; return getForEntity ( "tasks/in_progress/{taskType}" , params , taskList , taskType ) ; |
public class GoConfigFieldWriter { /** * TODO this is duplicated from magical cruiseconfig loader */
private void parseFields ( Element e , Object o ) { } } | for ( GoConfigFieldWriter field : new GoConfigClassWriter ( o . getClass ( ) , configCache , registry ) . getAllFields ( o ) ) { field . setValueIfNotNull ( e , o ) ; } |
public class A_CmsListExplorerDialog { /** * Returns the show explorer flag . < p >
* @ return the show explorer flag */
private boolean getShowExplorer ( ) { } } | if ( getParamShowexplorer ( ) != null ) { return Boolean . valueOf ( getParamShowexplorer ( ) ) . booleanValue ( ) ; } Map < ? , ? > dialogObject = ( Map < ? , ? > ) getSettings ( ) . getDialogObject ( ) ; if ( dialogObject == null ) { return false ; } Boolean storedParam = ( Boolean ) dialogObject . get ( getClass ( ) . getName ( ) ) ; if ( storedParam == null ) { return false ; } return storedParam . booleanValue ( ) ; |
public class MapBindTransformation { /** * / * ( non - Javadoc )
* @ see com . abubusoft . kripton . processor . bind . transform . BindTransform # generateSerializeOnJackson ( com . abubusoft . kripton . processor . bind . BindTypeContext , com . squareup . javapoet . MethodSpec . Builder , java . lang . String , com . squareup . javapoet . TypeName , java . lang . String , com . abubusoft . kripton . processor . bind . model . BindProperty ) */
@ Override public void generateSerializeOnJackson ( BindTypeContext context , MethodSpec . Builder methodBuilder , String serializerName , TypeName beanClass , String beanName , BindProperty property ) { } } | this . generateSerializeOnJacksonInternal ( context , methodBuilder , serializerName , beanClass , beanName , property , false ) ; |
public class TextFormat { /** * Outputs a textual representation of the Protocol Message supplied into
* the parameter output . ( This representation is the new version of the
* classic " ProtocolPrinter " output from the original Protocol Buffer system ) */
public static void print ( final MessageOrBuilder message , final Appendable output ) throws IOException { } } | DEFAULT_PRINTER . print ( message , new TextGenerator ( output ) ) ; |
public class MtasFieldsProducer { /** * ( non - Javadoc )
* @ see org . apache . lucene . index . Fields # terms ( java . lang . String ) */
@ Override public Terms terms ( String field ) throws IOException { } } | return new MtasTerms ( delegateFieldsProducer . terms ( field ) , indexInputList , indexInputOffsetList , version ) ; |
public class IsoInterval { /** * / * [ deutsch ]
* < p > Ermittelt , ob dieses Intervall sich mit dem angegebenen Intervall so & uuml ; berschneidet , da & szlig ;
* mindestens ein gemeinsamer Zeitpunkt existiert . < / p >
* @ param other another interval which might have an intersection with this interval
* @ return { @ code true } if there is an non - empty intersection of this interval and the other one else { @ code false }
* @ since 3.19/4.15
* @ see # findIntersection ( ChronoInterval )
* @ see # overlaps ( IsoInterval )
* @ see # isBefore ( ChronoInterval )
* @ see # isAfter ( ChronoInterval ) */
public boolean intersects ( ChronoInterval < T > other ) { } } | if ( this . isEmpty ( ) || other . isEmpty ( ) ) { return false ; } boolean startALessEqEndB = ( this . getStart ( ) . isInfinite ( ) || other . getEnd ( ) . isInfinite ( ) ) ; if ( ! startALessEqEndB ) { T startA = this . getClosedFiniteStart ( ) ; if ( other . getEnd ( ) . isOpen ( ) ) { startALessEqEndB = startA . isBefore ( other . getEnd ( ) . getTemporal ( ) ) ; } else { startALessEqEndB = ! startA . isAfter ( other . getEnd ( ) . getTemporal ( ) ) ; } } if ( ! startALessEqEndB ) { return false ; } boolean startBLessEqEndA = ( other . getStart ( ) . isInfinite ( ) || this . getEnd ( ) . isInfinite ( ) ) ; if ( ! startBLessEqEndA ) { T startB = getClosedFiniteStart ( other . getStart ( ) , this . getTimeLine ( ) ) ; if ( this . getEnd ( ) . isOpen ( ) ) { startBLessEqEndA = startB . isBefore ( this . getEnd ( ) . getTemporal ( ) ) ; } else { startBLessEqEndA = ! startB . isAfter ( this . getEnd ( ) . getTemporal ( ) ) ; } } return startBLessEqEndA ; |
public class WrappingUtils { /** * Finds the immediate parent of a leaf drawable . */
static DrawableParent findDrawableParentForLeaf ( DrawableParent parent ) { } } | while ( true ) { Drawable child = parent . getDrawable ( ) ; if ( child == parent || ! ( child instanceof DrawableParent ) ) { break ; } parent = ( DrawableParent ) child ; } return parent ; |
public class AbstractExecutor { /** * { @ inheritDoc } */
@ Override public void execute ( ExecutionContext executionContext ) { } } | initialize ( ) ; try { failOnInvalidContext ( executionContext ) ; establishFacts ( executionContext . getFacts ( ) ) ; goSteps ( executionContext . getSteps ( ) ) ; expectResults ( executionContext . getResults ( ) ) ; } finally { shutdown ( ) ; } |
public class MP3FileID3Controller { /** * Set the year of this mp3.
* @ param year of the mp3 */
public void setYear ( String year , int type ) { } } | if ( allow ( type & ID3V1 ) ) { id3v1 . setYear ( year ) ; } if ( allow ( type & ID3V2 ) ) { id3v2 . setTextFrame ( ID3v2Frames . YEAR , year ) ; } |
public class FacesConfigRenderKitTypeImpl { /** * Returns all < code > client - behavior - renderer < / code > elements
* @ return list of < code > client - behavior - renderer < / code > */
public List < FacesConfigClientBehaviorRendererType < FacesConfigRenderKitType < T > > > getAllClientBehaviorRenderer ( ) { } } | List < FacesConfigClientBehaviorRendererType < FacesConfigRenderKitType < T > > > list = new ArrayList < FacesConfigClientBehaviorRendererType < FacesConfigRenderKitType < T > > > ( ) ; List < Node > nodeList = childNode . get ( "client-behavior-renderer" ) ; for ( Node node : nodeList ) { FacesConfigClientBehaviorRendererType < FacesConfigRenderKitType < T > > type = new FacesConfigClientBehaviorRendererTypeImpl < FacesConfigRenderKitType < T > > ( this , "client-behavior-renderer" , childNode , node ) ; list . add ( type ) ; } return list ; |
public class AddressClient { /** * Deletes the specified address resource .
* < p > Sample code :
* < pre > < code >
* try ( AddressClient addressClient = AddressClient . create ( ) ) {
* ProjectRegionAddressName address = ProjectRegionAddressName . of ( " [ PROJECT ] " , " [ REGION ] " , " [ ADDRESS ] " ) ;
* Operation response = addressClient . deleteAddress ( address ) ;
* < / code > < / pre >
* @ param address Name of the address resource to delete .
* @ throws com . google . api . gax . rpc . ApiException if the remote call fails */
@ BetaApi public final Operation deleteAddress ( ProjectRegionAddressName address ) { } } | DeleteAddressHttpRequest request = DeleteAddressHttpRequest . newBuilder ( ) . setAddress ( address == null ? null : address . toString ( ) ) . build ( ) ; return deleteAddress ( request ) ; |
public class DatabaseServiceRamp { /** * Starts a map call on the local node .
* @ param sql the select query for the search
* @ param result callback for the result iterator
* @ param args arguments to the sql */
@ Override public void map ( MethodRef method , String sql , Object ... args ) { } } | _kraken . map ( method , sql , args ) ; |
public class JSLocalConsumerPoint { /** * Set the consumerSession ' s recoverability */
private void setBaseRecoverability ( Reliability unrecoverableReliability ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "setBaseRecoverability" , new Object [ ] { this , unrecoverableReliability } ) ; setUnrecoverability ( unrecoverableReliability ) ; _baseUnrecoverableOptions = _unrecoverableOptions ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "setBaseRecoverability" ) ; |
public class JmxClient { /** * Return an array of the operations associated with the bean name . */
public MBeanOperationInfo [ ] getOperationsInfo ( String domainName , String beanName ) throws JMException { } } | return getOperationsInfo ( ObjectNameUtil . makeObjectName ( domainName , beanName ) ) ; |
public class CacheProviderWrapper { /** * PM21179 */
@ Override public void clearMemory ( boolean clearDisk ) { } } | final String methodName = "clearDisk" ; if ( tc . isDebugEnabled ( ) ) { Tr . debug ( tc , methodName + " cacheName=" + cacheName + " ERROR because it should not be called" ) ; } |
public class WSJobOperatorImpl { /** * @ param appName
* @ param jobXMLName
* @ return newly created JobInstance ( Note : job instance must be started separately )
* Note : Inline JSL takes precedence over JSL within . war */
@ Override public WSJobInstance createJobInstance ( String appName , String jobXMLName , String jsl , String correlationId ) { } } | if ( authService != null ) { authService . authorizedJobSubmission ( ) ; } return batchKernelService . createJobInstance ( appName , jobXMLName , batchSecurityHelper . getRunAsUser ( ) , jsl , correlationId ) ; |
public class FilterFileSystem { /** * { @ inheritDoc } */
@ Override public void setTimes ( Path p , long mtime , long atime ) throws IOException { } } | fs . setTimes ( p , mtime , atime ) ; |
public class HtmlTableRendererBase { /** * Renders everything inside the TBODY tag by iterating over the row objects
* between offsets first and first + rows and applying the UIColumn components
* to those objects .
* This method is separated from the encodeChildren so that it can be overridden by
* subclasses . One class that uses this functionality is autoUpdateDataTable . */
public void encodeInnerHtml ( FacesContext facesContext , UIComponent component ) throws IOException { } } | UIData uiData = ( UIData ) component ; ResponseWriter writer = facesContext . getResponseWriter ( ) ; int rowCount = uiData . getRowCount ( ) ; int newspaperColumns = getNewspaperColumns ( component ) ; if ( rowCount == - 1 && newspaperColumns == 1 ) { encodeInnerHtmlUnknownRowCount ( facesContext , component ) ; return ; } if ( rowCount == 0 ) { // nothing to render , to get valid xhtml we render an empty dummy row
writer . startElement ( HTML . TBODY_ELEM , null ) ; // uiData ) ;
writer . writeAttribute ( HTML . ID_ATTR , component . getClientId ( facesContext ) + ":tbody_element" , null ) ; writer . startElement ( HTML . TR_ELEM , null ) ; // uiData ) ;
writer . startElement ( HTML . TD_ELEM , null ) ; // uiData ) ;
writer . endElement ( HTML . TD_ELEM ) ; writer . endElement ( HTML . TR_ELEM ) ; writer . endElement ( HTML . TBODY_ELEM ) ; return ; } // begin the table
// get the CSS styles
Styles styles = getStyles ( uiData ) ; int first = uiData . getFirst ( ) ; int rows = uiData . getRows ( ) ; int last ; if ( rows <= 0 ) { last = rowCount ; } else { last = first + rows ; if ( last > rowCount ) { last = rowCount ; } } int newspaperRows ; if ( ( last - first ) % newspaperColumns == 0 ) { newspaperRows = ( last - first ) / newspaperColumns ; } else { newspaperRows = ( ( last - first ) / newspaperColumns ) + 1 ; } boolean newspaperHorizontalOrientation = isNewspaperHorizontalOrientation ( component ) ; // get the row indizes for which a new TBODY element should be created
Integer [ ] bodyrows = getBodyRows ( facesContext , component ) ; int bodyrowsCount = 0 ; // walk through the newspaper rows
for ( int nr = 0 ; nr < newspaperRows ; nr ++ ) { boolean rowStartRendered = false ; // walk through the newspaper columns
for ( int nc = 0 ; nc < newspaperColumns ; nc ++ ) { // the current row in the ' real ' table
int currentRow ; if ( newspaperHorizontalOrientation ) { currentRow = nr * newspaperColumns + nc + first ; } else { currentRow = nc * newspaperRows + nr + first ; } // if this row is not to be rendered
if ( currentRow >= last ) { continue ; } // bail if any row does not exist
uiData . setRowIndex ( currentRow ) ; if ( ! uiData . isRowAvailable ( ) ) { log . severe ( "Row is not available. Rowindex = " + currentRow ) ; break ; } if ( nc == 0 ) { // first column in table , start new row
beforeRow ( facesContext , uiData ) ; // is the current row listed in the bodyrows attribute
if ( ArrayUtils . contains ( bodyrows , currentRow ) ) { // close any preopened TBODY element first
if ( bodyrowsCount != 0 ) { writer . endElement ( HTML . TBODY_ELEM ) ; } writer . startElement ( HTML . TBODY_ELEM , null ) ; // uiData ) ;
// Do not attach bodyrowsCount to the first TBODY element , because of backward compatibility
writer . writeAttribute ( HTML . ID_ATTR , component . getClientId ( facesContext ) + ":tbody_element" + ( bodyrowsCount == 0 ? "" : bodyrowsCount ) , null ) ; bodyrowsCount ++ ; } renderRowStart ( facesContext , writer , uiData , styles , nr ) ; rowStartRendered = true ; } List children = null ; int columnStyleIndex = 0 ; for ( int j = 0 , size = getChildCount ( component ) ; j < size ; j ++ ) { if ( children == null ) { children = getChildren ( component ) ; } UIComponent child = ( UIComponent ) children . get ( j ) ; if ( child . isRendered ( ) ) { boolean columnRendering = child instanceof UIColumn ; if ( columnRendering ) { beforeColumn ( facesContext , uiData , columnStyleIndex ) ; } encodeColumnChild ( facesContext , writer , uiData , child , styles , nc * uiData . getChildCount ( ) + columnStyleIndex ) ; if ( columnRendering ) { afterColumn ( facesContext , uiData , columnStyleIndex ) ; } columnStyleIndex = columnStyleIndex + getColumnCountForComponent ( facesContext , uiData , child ) ; } } if ( hasNewspaperTableSpacer ( uiData ) ) { // draw the spacer facet
if ( nc < newspaperColumns - 1 ) { renderSpacerCell ( facesContext , writer , uiData ) ; } } } if ( rowStartRendered ) { renderRowEnd ( facesContext , writer , uiData ) ; afterRow ( facesContext , uiData ) ; } } if ( bodyrowsCount != 0 ) { // close the last TBODY element
writer . endElement ( HTML . TBODY_ELEM ) ; } |
public class XmlSchemaParser { /** * Scan XML for all message definitions and save in map
* @ param document for the XML parsing
* @ param xPath for XPath expression reuse
* @ param typeByNameMap to use for Type objects
* @ return { @ link java . util . Map } of schemaId to Message
* @ throws Exception on parsing error . */
public static Map < Long , Message > findMessages ( final Document document , final XPath xPath , final Map < String , Type > typeByNameMap ) throws Exception { } } | final Map < Long , Message > messageByIdMap = new HashMap < > ( ) ; final ObjectHashSet < String > distinctNames = new ObjectHashSet < > ( ) ; forEach ( ( NodeList ) xPath . compile ( MESSAGE_XPATH_EXPR ) . evaluate ( document , XPathConstants . NODESET ) , ( node ) -> addMessageWithIdCheck ( distinctNames , messageByIdMap , new Message ( node , typeByNameMap ) , node ) ) ; return messageByIdMap ; |
public class Base64 { /** * Encode this string as base64.
* @ param string
* @ return */
@ Deprecated public static byte [ ] encodeToBytes ( byte [ ] bytes ) { } } | try { char [ ] chars = Base64 . encode ( bytes ) ; String string = new String ( chars ) ; return string . getBytes ( DEFAULT_ENCODING ) ; } catch ( UnsupportedEncodingException e ) { e . printStackTrace ( ) ; return null ; } |
public class ProcfsBasedProcessTree { /** * Get a dump of the process - tree .
* @ return a string concatenating the dump of information of all the processes
* in the process - tree */
public String getProcessTreeDump ( ) { } } | StringBuilder ret = new StringBuilder ( ) ; // The header .
ret . append ( String . format ( "\t|- PID PPID PGRPID SESSID CMD_NAME " + "USER_MODE_TIME(MILLIS) SYSTEM_TIME(MILLIS) VMEM_USAGE(BYTES) " + "RSSMEM_USAGE(PAGES) FULL_CMD_LINE\n" ) ) ; for ( ProcessInfo p : processTree . values ( ) ) { if ( p != null ) { ret . append ( String . format ( PROCESSTREE_DUMP_FORMAT , p . getPid ( ) , p . getPpid ( ) , p . getPgrpId ( ) , p . getSessionId ( ) , p . getName ( ) , p . getUtime ( ) , p . getStime ( ) , p . getVmem ( ) , p . getRssmemPage ( ) , p . getCmdLine ( procfsDir ) ) ) ; } } return ret . toString ( ) ; |
public class DeclareTEI { /** * purposely inherit JavaDoc and semantics from TagExtraInfo */
@ Override public VariableInfo [ ] getVariableInfo ( TagData data ) { } } | // construct the relevant VariableInfo object
VariableInfo id = new VariableInfo ( data . getAttributeString ( "id" ) , data . getAttributeString ( "type" ) == null ? "java.lang.Object" : data . getAttributeString ( "type" ) , true , VariableInfo . AT_END ) ; return new VariableInfo [ ] { id } ; |
public class BeanProcessor { /** * Look for the method to create a new instance of the bean . If none are found or the bean is abstract or an interface , we considered it
* as non instantiable .
* @ param typeOracle the oracle
* @ param logger logger
* @ param beanType type to look for constructor
* @ param builder current bean builder */
private static void determineInstanceCreator ( RebindConfiguration configuration , JacksonTypeOracle typeOracle , TreeLogger logger , JClassType beanType , BeanInfoBuilder builder ) { } } | if ( isObjectOrSerializable ( beanType ) ) { return ; } Optional < JClassType > mixinClass = configuration . getMixInAnnotations ( beanType ) ; List < JClassType > accessors = new ArrayList < JClassType > ( ) ; if ( mixinClass . isPresent ( ) ) { accessors . add ( mixinClass . get ( ) ) ; } accessors . add ( beanType ) ; // Look for a builder class
Optional < Annotation > jsonDeserialize = CreatorUtils . getAnnotation ( "com.fasterxml.jackson.databind.annotation.JsonDeserialize" , accessors ) ; if ( jsonDeserialize . isPresent ( ) ) { Optional < JClassType > builderClass = typeOracle . getClassFromJsonDeserializeAnnotation ( logger , jsonDeserialize . get ( ) , "builder" ) ; if ( builderClass . isPresent ( ) ) { builder . setBuilder ( builderClass . get ( ) ) ; return ; } } // we search for @ JsonCreator annotation
JConstructor creatorDefaultConstructor = null ; JConstructor creatorConstructor = null ; // we keep the list containing the mixin creator and the real creator
List < ? extends JAbstractMethod > creators = Collections . emptyList ( ) ; if ( null == beanType . isInterface ( ) && ! beanType . isAbstract ( ) ) { for ( JConstructor constructor : beanType . getConstructors ( ) ) { if ( constructor . getParameters ( ) . length == 0 ) { creatorDefaultConstructor = constructor ; continue ; } // A constructor is considered as a creator if
// - he is annotated with JsonCreator and
// * all its parameters are annotated with JsonProperty
// * or it has only one parameter
// - or all its parameters are annotated with JsonProperty
List < JConstructor > constructors = new ArrayList < JConstructor > ( ) ; if ( mixinClass . isPresent ( ) && null == mixinClass . get ( ) . isInterface ( ) ) { JConstructor mixinConstructor = mixinClass . get ( ) . findConstructor ( constructor . getParameterTypes ( ) ) ; if ( null != mixinConstructor ) { constructors . add ( mixinConstructor ) ; } } constructors . add ( constructor ) ; Optional < JsonIgnore > jsonIgnore = getAnnotation ( JsonIgnore . class , constructors ) ; if ( jsonIgnore . isPresent ( ) && jsonIgnore . get ( ) . value ( ) ) { continue ; } boolean isAllParametersAnnotatedWithJsonProperty = isAllParametersAnnotatedWith ( constructors . get ( 0 ) , JsonProperty . class ) ; if ( ( isAnnotationPresent ( JsonCreator . class , constructors ) && ( ( isAllParametersAnnotatedWithJsonProperty ) || ( constructor . getParameters ( ) . length == 1 ) ) ) || isAllParametersAnnotatedWithJsonProperty ) { creatorConstructor = constructor ; creators = constructors ; break ; } } } JMethod creatorFactory = null ; if ( null == creatorConstructor ) { // searching for factory method
for ( JMethod method : beanType . getMethods ( ) ) { if ( method . isStatic ( ) ) { List < JMethod > methods = new ArrayList < JMethod > ( ) ; if ( mixinClass . isPresent ( ) && null == mixinClass . get ( ) . isInterface ( ) ) { JMethod mixinMethod = mixinClass . get ( ) . findMethod ( method . getName ( ) , method . getParameterTypes ( ) ) ; if ( null != mixinMethod && mixinMethod . isStatic ( ) ) { methods . add ( mixinMethod ) ; } } methods . add ( method ) ; Optional < JsonIgnore > jsonIgnore = getAnnotation ( JsonIgnore . class , methods ) ; if ( jsonIgnore . isPresent ( ) && jsonIgnore . get ( ) . value ( ) ) { continue ; } if ( isAnnotationPresent ( JsonCreator . class , methods ) && ( method . getParameters ( ) . length == 1 || isAllParametersAnnotatedWith ( methods . get ( 0 ) , JsonProperty . class ) ) ) { creatorFactory = method ; creators = methods ; break ; } } } } final Optional < JAbstractMethod > creatorMethod ; boolean defaultConstructor = false ; if ( null != creatorConstructor ) { creatorMethod = Optional . < JAbstractMethod > of ( creatorConstructor ) ; } else if ( null != creatorFactory ) { creatorMethod = Optional . < JAbstractMethod > of ( creatorFactory ) ; } else if ( null != creatorDefaultConstructor ) { defaultConstructor = true ; creatorMethod = Optional . < JAbstractMethod > of ( creatorDefaultConstructor ) ; } else { creatorMethod = Optional . absent ( ) ; } builder . setCreatorMethod ( creatorMethod ) ; builder . setCreatorDefaultConstructor ( defaultConstructor ) ; if ( creatorMethod . isPresent ( ) && ! defaultConstructor ) { if ( creatorMethod . get ( ) . getParameters ( ) . length == 1 && ! isAllParametersAnnotatedWith ( creators . get ( 0 ) , JsonProperty . class ) ) { // delegation constructor
builder . setCreatorDelegation ( true ) ; builder . setCreatorParameters ( ImmutableMap . of ( BeanJsonDeserializerCreator . DELEGATION_PARAM_NAME , creatorMethod . get ( ) . getParameters ( ) [ 0 ] ) ) ; } else { // we want the property name define in the mixin and the parameter defined in the real creator method
ImmutableMap . Builder < String , JParameter > creatorParameters = ImmutableMap . builder ( ) ; for ( int i = 0 ; i < creatorMethod . get ( ) . getParameters ( ) . length ; i ++ ) { creatorParameters . put ( creators . get ( 0 ) . getParameters ( ) [ i ] . getAnnotation ( JsonProperty . class ) . value ( ) , creators . get ( creators . size ( ) - 1 ) . getParameters ( ) [ i ] ) ; } builder . setCreatorParameters ( creatorParameters . build ( ) ) ; } } |
public class JSR303ValidatorEngine { /** * Méthode d ' obtention de l ' instance de moteur de Validation
* @ param validatorFactory Fabrique de valudateurs
* @ return Instance de moteur de Validation */
public static synchronized JSR303ValidatorEngine getInstance ( ValidatorFactory validatorFactory ) { } } | // Si l ' instance est nulle
if ( _instance == null ) _instance = new JSR303ValidatorEngine ( ) ; // On positionne la fabrique de validateur
_instance . setValidatorFactory ( validatorFactory ) ; // On retourne l ' instance
return _instance ; |
public class A_CmsContextMenuItem { /** * Implements the hover over action for a item . < p >
* First closes all sub menus that are not required anymore .
* And then reopens the necessary sub menus and activates the selected item . < p >
* @ param event the mouse over event */
protected void onHoverIn ( MouseOverEvent event ) { } } | if ( ( getParentMenu ( ) . getSelectedItem ( ) != null ) && ( getParentMenu ( ) . getSelectedItem ( ) != this ) && getParentMenu ( ) . getSelectedItem ( ) . hasSubmenu ( ) ) { getParentMenu ( ) . getSelectedItem ( ) . getSubMenu ( ) . onClose ( ) ; getParentMenu ( ) . getSelectedItem ( ) . deselectItem ( ) ; } if ( hasSubmenu ( ) ) { getSubMenu ( ) . openPopup ( this ) ; } selectItem ( ) ; |
public class JavascriptObject { /** * Invoke the specified JavaScript function in the JavaScript runtime .
* @ param function The function to invoke
* @ param args Any arguments to pass to the function
* @ return The result of the function . */
protected Object invokeJavascript ( String function , Object ... args ) { } } | Object [ ] jsArgs = new Object [ args . length ] ; for ( int i = 0 ; i < jsArgs . length ; i ++ ) { if ( args [ i ] instanceof JavascriptObject ) { jsArgs [ i ] = ( ( JavascriptObject ) args [ i ] ) . getJSObject ( ) ; } else if ( args [ i ] instanceof JavascriptEnum ) { jsArgs [ i ] = ( ( JavascriptEnum ) args [ i ] ) . getEnumValue ( ) ; } else { jsArgs [ i ] = args [ i ] ; } } return checkUndefined ( jsObject . call ( function , ( Object [ ] ) jsArgs ) ) ; |
public class SchemaImpl { /** * Gets a mode with the given name from the mode map .
* If not present then it creates a new mode extending the default base mode .
* @ param name The mode to look for or create if it does not exist .
* @ return Always a not null mode . */
private Mode lookupCreateMode ( String name ) { } } | if ( name == null ) return null ; name = name . trim ( ) ; Mode mode = ( Mode ) modeMap . get ( name ) ; if ( mode == null ) { mode = new Mode ( name , defaultBaseMode ) ; modeMap . put ( name , mode ) ; } return mode ; |
public class GeometryRendererImpl { public void onTentativeMove ( GeometryEditTentativeMoveEvent event ) { } } | try { Coordinate [ ] vertices = editingService . getIndexService ( ) . getSiblingVertices ( editingService . getGeometry ( ) , editingService . getInsertIndex ( ) ) ; String geometryType = editingService . getIndexService ( ) . getGeometryType ( editingService . getGeometry ( ) , editingService . getInsertIndex ( ) ) ; if ( vertices != null && Geometry . LINE_STRING . equals ( geometryType ) ) { String identifier = baseName + "." + editingService . getIndexService ( ) . format ( editingService . getInsertIndex ( ) ) ; Object parentGroup = groups . get ( identifier . substring ( 0 , identifier . lastIndexOf ( '.' ) ) + ".edges" ) ; Coordinate temp1 = event . getOrigin ( ) ; Coordinate temp2 = event . getCurrentPosition ( ) ; Coordinate c1 = mapWidget . getMapModel ( ) . getMapView ( ) . getWorldViewTransformer ( ) . worldToPan ( temp1 ) ; Coordinate c2 = mapWidget . getMapModel ( ) . getMapView ( ) . getWorldViewTransformer ( ) . worldToPan ( temp2 ) ; LineString edge = mapWidget . getMapModel ( ) . getGeometryFactory ( ) . createLineString ( new Coordinate [ ] { c1 , c2 } ) ; mapWidget . getVectorContext ( ) . drawLine ( parentGroup , insertMoveEdgeId1 , edge , styleService . getEdgeTentativeMoveStyle ( ) ) ; } else if ( vertices != null && Geometry . LINEAR_RING . equals ( geometryType ) ) { String identifier = baseName + "." + editingService . getIndexService ( ) . format ( editingService . getInsertIndex ( ) ) ; Object parentGroup = groups . get ( identifier . substring ( 0 , identifier . lastIndexOf ( '.' ) ) + ".edges" ) ; // Line 1
Coordinate temp1 = event . getOrigin ( ) ; Coordinate temp2 = event . getCurrentPosition ( ) ; Coordinate c1 = mapWidget . getMapModel ( ) . getMapView ( ) . getWorldViewTransformer ( ) . worldToPan ( temp1 ) ; Coordinate c2 = mapWidget . getMapModel ( ) . getMapView ( ) . getWorldViewTransformer ( ) . worldToPan ( temp2 ) ; LineString edge = mapWidget . getMapModel ( ) . getGeometryFactory ( ) . createLineString ( new Coordinate [ ] { c1 , c2 } ) ; mapWidget . getVectorContext ( ) . drawLine ( parentGroup , insertMoveEdgeId1 , edge , styleService . getEdgeTentativeMoveStyle ( ) ) ; // Line 2
if ( styleService . isCloseRingWhileInserting ( ) ) { temp1 = vertices [ vertices . length - 1 ] ; c1 = mapWidget . getMapModel ( ) . getMapView ( ) . getWorldViewTransformer ( ) . worldToPan ( temp1 ) ; edge = mapWidget . getMapModel ( ) . getGeometryFactory ( ) . createLineString ( new Coordinate [ ] { c1 , c2 } ) ; mapWidget . getVectorContext ( ) . drawLine ( parentGroup , insertMoveEdgeId2 , edge , styleService . getEdgeTentativeMoveStyle ( ) ) ; } } } catch ( GeometryIndexNotFoundException e ) { throw new IllegalStateException ( e ) ; } |
public class CommerceShippingFixedOptionRelLocalServiceBaseImpl { /** * Returns the number of rows matching the dynamic query .
* @ param dynamicQuery the dynamic query
* @ param projection the projection to apply to the query
* @ return the number of rows matching the dynamic query */
@ Override public long dynamicQueryCount ( DynamicQuery dynamicQuery , Projection projection ) { } } | return commerceShippingFixedOptionRelPersistence . countWithDynamicQuery ( dynamicQuery , projection ) ; |
public class TaskConfig { /** * Given the registration domain in the job , and the default registration domain for the agent ,
* figure out what domain we should actually register the job in .
* @ return The full registration domain . */
private String fullyQualifiedRegistrationDomain ( ) { } } | if ( job . getRegistrationDomain ( ) . endsWith ( "." ) ) { return job . getRegistrationDomain ( ) ; } else if ( "" . equals ( job . getRegistrationDomain ( ) ) ) { return defaultRegistrationDomain ; } else { return job . getRegistrationDomain ( ) + "." + defaultRegistrationDomain ; } |
public class CliUtils { /** * Executes the specified command line and blocks until the process has finished . The output of
* the process is captured , returned , as well as logged with info ( stdout ) and error ( stderr )
* level , respectively .
* @ param cli
* the command line
* @ param loggerName
* the name of the logger to use ( passed to { @ link LoggerFactory # getLogger ( String ) } ) ;
* if { @ code null } this class ' name is used
* @ param logMessagePrefix
* if non - { @ code null } consumed lines are prefix with this string
* @ return the process ' output */
public static CliOutput executeCommandLine ( final Commandline cli , final String loggerName , final String logMessagePrefix ) { } } | try { String cliString = CommandLineUtils . toString ( cli . getShellCommandline ( ) ) ; LOGGER . info ( "Executing command-line: {}" , cliString ) ; LoggingStreamConsumer out = new LoggingStreamConsumer ( loggerName , logMessagePrefix , false ) ; LoggingStreamConsumer err = new LoggingStreamConsumer ( loggerName , logMessagePrefix , true ) ; int exitCode = CommandLineUtils . executeCommandLine ( cli , out , err ) ; return new CliOutput ( out . getOutput ( ) , err . getOutput ( ) , exitCode ) ; } catch ( CommandLineException ex ) { throw new CliException ( "Error executing command-line process." , ex ) ; } |
public class PeerUtil { /** * Creates a proxy object implementing the specified provider interface ( a subinterface of
* { @ link InvocationProvider } that forwards requests to the given service implementation
* ( a subinterface of { @ link InvocationService } corresponding to the provider interface )
* on the specified client . This is useful for server entities that need to call a method
* either on the current server ( with < code > null < / code > as the caller parameter ) or on a
* peer server .
* @ param clazz the subclass of { @ link InvocationProvider } desired to be implemented
* @ param svc the implementation of the corresponding subclass of { @ link InvocationService }
* @ param client the client to pass to the service methods */
public static < S extends InvocationProvider , T extends InvocationService < ? > > S createProviderProxy ( Class < S > clazz , final T svc , final Client client ) { } } | return clazz . cast ( Proxy . newProxyInstance ( clazz . getClassLoader ( ) , new Class < ? > [ ] { clazz } , new InvocationHandler ( ) { public Object invoke ( Object proxy , Method method , Object [ ] args ) throws Throwable { Method smethod = _pmethods . get ( method ) ; if ( smethod == null ) { Class < ? > [ ] ptypes = method . getParameterTypes ( ) ; _pmethods . put ( method , smethod = svc . getClass ( ) . getMethod ( method . getName ( ) , ArrayUtil . splice ( ptypes , 0 , 1 ) ) ) ; } return smethod . invoke ( svc , ArrayUtil . splice ( args , 0 , 1 ) ) ; } } ) ) ; |
public class BeanPropertyPathExtension { /** * Emits a bean and its parent beans before if needed .
* Returns the list of beans that were emitted . */
private static Set < TsBeanModel > writeBeanAndParentsFieldSpecs ( Writer writer , Settings settings , TsModel model , Set < TsBeanModel > emittedSoFar , TsBeanModel bean ) { } } | if ( emittedSoFar . contains ( bean ) ) { return new HashSet < > ( ) ; } final TsBeanModel parentBean = getBeanModelByType ( model , bean . getParent ( ) ) ; final Set < TsBeanModel > emittedBeans = parentBean != null ? writeBeanAndParentsFieldSpecs ( writer , settings , model , emittedSoFar , parentBean ) : new HashSet < TsBeanModel > ( ) ; final String parentClassName = parentBean != null ? getBeanModelClassName ( parentBean ) + "Fields" : "Fields" ; writer . writeIndentedLine ( "" ) ; writer . writeIndentedLine ( "class " + getBeanModelClassName ( bean ) + "Fields extends " + parentClassName + " {" ) ; writer . writeIndentedLine ( settings . indentString + "constructor(parent?: Fields, name?: string) { super(parent, name); }" ) ; for ( TsPropertyModel property : bean . getProperties ( ) ) { writeBeanProperty ( writer , settings , model , bean , property ) ; } writer . writeIndentedLine ( "}" ) ; emittedBeans . add ( bean ) ; return emittedBeans ; |
public class WorkflowServiceImpl { /** * Lists workflows for the given correlation id .
* @ param name Name of the workflow .
* @ param includeClosed CorrelationID of the workflow you want to start .
* @ param includeTasks IncludeClosed workflow which are not running .
* @ param correlationIds Includes tasks associated with workflows .
* @ return a { @ link Map } of { @ link String } as key and a list of { @ link Workflow } as value */
@ Service public Map < String , List < Workflow > > getWorkflows ( String name , boolean includeClosed , boolean includeTasks , List < String > correlationIds ) { } } | Map < String , List < Workflow > > workflowMap = new HashMap < > ( ) ; for ( String correlationId : correlationIds ) { List < Workflow > workflows = executionService . getWorkflowInstances ( name , correlationId , includeClosed , includeTasks ) ; workflowMap . put ( correlationId , workflows ) ; } return workflowMap ; |
public class SoyListData { /** * Gets the data value at a given index .
* @ param index The index .
* @ return The data at the given index , or null of the index is undefined . */
@ Override public SoyData get ( int index ) { } } | try { return list . get ( index ) ; } catch ( IndexOutOfBoundsException ioobe ) { return null ; } |
public class WebElementUtils { /** * Escapes characters incorrectly handled by { @ code WebElement . sendKeys } to workaround Selenium issue # 1723.
* @ see WebElement # sendKeys ( CharSequence . . . )
* @ see < a href = " https : / / code . google . com / p / selenium / issues / detail ? id = 1723 " > Issue # 1723 < / a > */
public static CharSequence [ ] escapeKeys ( CharSequence ... keys ) { } } | CharSequence [ ] escapedKeys = new CharSequence [ keys . length ] ; for ( int index = 0 ; index < keys . length ; index ++ ) { escapedKeys [ index ] = escapeKeys ( keys [ index ] ) ; } return escapedKeys ; |
public class StringUtils { /** * Reads the contents of a file into a byte array .
* @ param aFile The file from which to read
* @ return The bytes read from the file
* @ throws IOException If the supplied file could not be read in its entirety */
private static byte [ ] readBytes ( final File aFile ) throws IOException { } } | final FileInputStream fileStream = new FileInputStream ( aFile ) ; final ByteBuffer buf = ByteBuffer . allocate ( ( int ) aFile . length ( ) ) ; final int read = fileStream . getChannel ( ) . read ( buf ) ; if ( read != aFile . length ( ) ) { fileStream . close ( ) ; throw new IOException ( LOGGER . getI18n ( MessageCodes . UTIL_044 , aFile ) ) ; } fileStream . close ( ) ; return buf . array ( ) ; |
public class Behavior { /** * Add the name / value pair to the IBehaviorConsumer parent of the tag .
* @ throws JspException if a JSP exception has occurred */
public void doTag ( ) throws JspException { } } | if ( hasErrors ( ) ) { reportErrors ( ) ; return ; } JspTag tag = SimpleTagSupport . findAncestorWithClass ( this , IBehaviorConsumer . class ) ; if ( tag == null ) { String s = Bundle . getString ( "Tags_BehaviorInvalidParent" ) ; registerTagError ( s , null ) ; reportErrors ( ) ; return ; } IBehaviorConsumer ac = ( IBehaviorConsumer ) tag ; ac . setBehavior ( _name , _value , _facet ) ; return ; |
public class ModuleItem { /** * Return an array of children - synchronized ? */
public ModuleItem [ ] children ( ) { } } | if ( children == null ) return null ; ModuleItem [ ] members = new ModuleItem [ children . size ( ) ] ; children . values ( ) . toArray ( members ) ; return members ; |
public class VFMCSMapper { /** * { @ inheritDoc }
* @ param targetMolecule targetMolecule graph */
@ Override public boolean hasMap ( IAtomContainer targetMolecule ) { } } | IState state = new VFState ( query , new TargetProperties ( targetMolecule ) ) ; maps . clear ( ) ; return mapFirst ( state ) ; |
public class FragmentBundlerCompat { /** * Constructs a FragmentBundlerCompat for the provided Fragment instance
* @ param fragment the fragment instance
* @ return this bundler instance to chain method calls */
public static < F extends Fragment > FragmentBundlerCompat < F > create ( F fragment ) { } } | return new FragmentBundlerCompat < F > ( fragment ) ; |
public class OverrideService { /** * Update the response code for a given enabled override
* @ param overrideId - override ID to update
* @ param pathId - path ID to update
* @ param ordinal - can be null , Index of the enabled override to edit if multiple of the same are enabled
* @ param responseCode - response code for the given response
* @ param clientUUID - clientUUID */
public void updateResponseCode ( int overrideId , int pathId , Integer ordinal , String responseCode , String clientUUID ) { } } | if ( ordinal == null ) { ordinal = 1 ; } try { // get ID of the ordinal
int enabledId = getEnabledEndpoint ( pathId , overrideId , ordinal , clientUUID ) . getId ( ) ; updateResponseCode ( enabledId , responseCode ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } |
public class ModuleExtensionNameProcessor { /** * { @ inheritDoc } */
public void undeploy ( final DeploymentUnit deploymentUnit ) { } } | final ExtensionInfo extensionInfo = deploymentUnit . getAttachment ( Attachments . EXTENSION_INFORMATION ) ; if ( extensionInfo == null ) { return ; } // we need to remove the extension on undeploy
final ServiceController < ? > extensionIndexController = deploymentUnit . getServiceRegistry ( ) . getRequiredService ( Services . JBOSS_DEPLOYMENT_EXTENSION_INDEX ) ; final ExtensionIndex extensionIndexService = ( ExtensionIndex ) extensionIndexController . getValue ( ) ; final ModuleIdentifier moduleIdentifier = deploymentUnit . getAttachment ( Attachments . MODULE_IDENTIFIER ) ; extensionIndexService . removeDeployedExtension ( extensionInfo . getName ( ) , moduleIdentifier ) ; |
public class ResponseImpl { /** * Get the header values for the given header name , if it exists . There can be more than one value
* for a given header name .
* @ param name the name of the header to get
* @ return the values of the given header name */
public List < String > getHeader ( String name ) { } } | if ( headers == null ) { return null ; } return headers . values ( name ) ; |
public class RegisteredServicesEndpoint { /** * Handle and produce a list of services from registry .
* @ return the web async task */
@ ReadOperation ( produces = { } } | ActuatorMediaType . V2_JSON , "application/vnd.cas.services+yaml" , MediaType . APPLICATION_JSON_VALUE } ) public Collection < RegisteredService > handle ( ) { return this . servicesManager . load ( ) ; |
public class MassToFormulaTool { /** * Put in order the elements of the molecular formula .
* @ param formula The IMolecularFormula to put in order
* @ return IMolecularFormula object */
private IMolecularFormula putInOrder ( IMolecularFormula formula ) { } } | IMolecularFormula new_formula = formula . getBuilder ( ) . newInstance ( IMolecularFormula . class ) ; for ( int i = 0 ; i < orderElements . length ; i ++ ) { IElement element = builder . newInstance ( IElement . class , orderElements [ i ] ) ; if ( MolecularFormulaManipulator . containsElement ( formula , element ) ) { Iterator < IIsotope > isotopes = MolecularFormulaManipulator . getIsotopes ( formula , element ) . iterator ( ) ; while ( isotopes . hasNext ( ) ) { IIsotope isotope = isotopes . next ( ) ; new_formula . addIsotope ( isotope , formula . getIsotopeCount ( isotope ) ) ; } } } // new _ mf . setCharge ( charge ) ;
return new_formula ; |
public class TagVFilter { /** * Converts the tag map to a filter list . If a filter already exists for a
* tag group by , then the duplicate is skipped .
* @ param tags A set of tag keys and values . May be null or empty .
* @ param filters A set of filters to add the converted filters to . This may
* not be null . */
public static void tagsToFilters ( final Map < String , String > tags , final List < TagVFilter > filters ) { } } | mapToFilters ( tags , filters , true ) ; |
public class MultiStepGUI { /** * Main method that just spawns the UI .
* @ param args command line parameters */
public static void main ( final String [ ] args ) { } } | GUIUtil . logUncaughtExceptions ( LOG ) ; GUIUtil . setLookAndFeel ( ) ; OutputStep . setDefaultHandlerVisualizer ( ) ; javax . swing . SwingUtilities . invokeLater ( new Runnable ( ) { @ Override public void run ( ) { try { final MultiStepGUI gui = new MultiStepGUI ( ) ; gui . run ( ) ; if ( args != null && args . length > 0 ) { gui . setParameters ( new SerializedParameterization ( args ) ) ; } else { gui . setParameters ( new SerializedParameterization ( ) ) ; } } catch ( Exception | Error e ) { // Restore error handler , as the GUI is likely broken .
LoggingConfiguration . replaceDefaultHandler ( new CLISmartHandler ( ) ) ; LOG . exception ( e ) ; } } } ) ; |
public class Math { /** * Returns the product of the arguments ,
* throwing an exception if the result overflows an { @ code int } .
* @ param x the first value
* @ param y the second value
* @ return the result
* @ throws ArithmeticException if the result overflows an int
* @ since 1.8 */
public static int multiplyExact ( int x , int y ) { } } | long r = ( long ) x * ( long ) y ; if ( ( int ) r != r ) { throw new ArithmeticException ( "integer overflow" ) ; } return ( int ) r ; |
public class BaseClient { /** * Retrieve a user profile .
* @ param credentials the credentials
* @ param context the web context
* @ return the user profile */
protected final Optional < UserProfile > retrieveUserProfile ( final C credentials , final WebContext context ) { } } | final Optional < UserProfile > profile = this . profileCreator . create ( credentials , context ) ; logger . debug ( "profile: {}" , profile ) ; return profile ; |
public class RecordEnvelope { /** * Set the record metadata
* @ param key key for the metadata
* @ param value value of the metadata
* @ implNote should not be called concurrently */
public void setRecordMetadata ( String key , Object value ) { } } | if ( _recordMetadata == null ) { _recordMetadata = new HashMap < > ( ) ; } _recordMetadata . put ( key , value ) ; |
public class VariablesInner { /** * Retrieve a list of variables .
* @ param resourceGroupName Name of an Azure Resource group .
* @ param automationAccountName The name of the automation account .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the PagedList & lt ; VariableInner & gt ; object */
public Observable < Page < VariableInner > > listByAutomationAccountAsync ( final String resourceGroupName , final String automationAccountName ) { } } | return listByAutomationAccountWithServiceResponseAsync ( resourceGroupName , automationAccountName ) . map ( new Func1 < ServiceResponse < Page < VariableInner > > , Page < VariableInner > > ( ) { @ Override public Page < VariableInner > call ( ServiceResponse < Page < VariableInner > > response ) { return response . body ( ) ; } } ) ; |
public class Vertex { /** * 创建一个标点符号实例
* @ param realWord 标点符号对应的真实字串
* @ return 标点符号顶点 */
public static Vertex newPunctuationInstance ( String realWord ) { } } | return new Vertex ( realWord , new CoreDictionary . Attribute ( Nature . w , 1000 ) ) ; |
public class CmsModuleRow { /** * Gets the name of the module . < p >
* @ return the module name */
@ Column ( header = Messages . GUI_MODULES_HEADER_NAME_0 , styleName = OpenCmsTheme . HOVER_COLUMN , width = 350 , order = 10 ) public String getName ( ) { } } | return m_module . getName ( ) ; |
public class Criteria { /** * Crates new { @ link Predicate } without any wildcards . Strings with blanks will be escaped
* { @ code " string \ with \ blank " }
* @ param o
* @ return */
public Criteria is ( @ Nullable Object o ) { } } | if ( o == null ) { return isNull ( ) ; } predicates . add ( new Predicate ( OperationKey . EQUALS , o ) ) ; return this ; |
public class ListPopupWindow { /** * Dismiss the popup window . */
public void dismiss ( ) { } } | mPopup . dismiss ( ) ; removePromptView ( ) ; mPopup . setContentView ( null ) ; mDropDownList = null ; mHandler . removeCallbacks ( mResizePopupRunnable ) ; |
public class UnicodeSet { /** * for internal use only , after checkFrozen has been called */
private final UnicodeSet add_unchecked ( int c ) { } } | if ( c < MIN_VALUE || c > MAX_VALUE ) { throw new IllegalArgumentException ( "Invalid code point U+" + Utility . hex ( c , 6 ) ) ; } // find smallest i such that c < list [ i ]
// if odd , then it is IN the set
// if even , then it is OUT of the set
int i = findCodePoint ( c ) ; // already in set ?
if ( ( i & 1 ) != 0 ) return this ; // HIGH is 0x110000
// assert ( list [ len - 1 ] = = HIGH ) ;
// empty = [ HIGH ]
// [ start _ 0 , limit _ 0 , start _ 1 , limit _ 1 , HIGH ]
// [ . . . , start _ k - 1 , limit _ k - 1 , start _ k , limit _ k , . . . , HIGH ]
// list [ i ]
// i = = 0 means c is before the first range
// TODO : Is the " list [ i ] - 1 " a typo ? Even if you pass MAX _ VALUE into
// add _ unchecked , the maximum value that " c " will be compared to
// is " MAX _ VALUE - 1 " meaning that " if ( c = = MAX _ VALUE ) " will
// never be reached according to this logic .
if ( c == list [ i ] - 1 ) { // c is before start of next range
list [ i ] = c ; // if we touched the HIGH mark , then add a new one
if ( c == MAX_VALUE ) { ensureCapacity ( len + 1 ) ; list [ len ++ ] = HIGH ; } if ( i > 0 && c == list [ i - 1 ] ) { // collapse adjacent ranges
// [ . . . , start _ k - 1 , c , c , limit _ k , . . . , HIGH ]
// list [ i ]
System . arraycopy ( list , i + 1 , list , i - 1 , len - i - 1 ) ; len -= 2 ; } } else if ( i > 0 && c == list [ i - 1 ] ) { // c is after end of prior range
list [ i - 1 ] ++ ; // no need to chcek for collapse here
} else { // At this point we know the new char is not adjacent to
// any existing ranges , and it is not 10FFFF .
// [ . . . , start _ k - 1 , limit _ k - 1 , start _ k , limit _ k , . . . , HIGH ]
// list [ i ]
// [ . . . , start _ k - 1 , limit _ k - 1 , c , c + 1 , start _ k , limit _ k , . . . , HIGH ]
// list [ i ]
// Don ' t use ensureCapacity ( ) to save on copying .
// NOTE : This has no measurable impact on performance ,
// but it might help in some usage patterns .
if ( len + 2 > list . length ) { int [ ] temp = new int [ len + 2 + GROW_EXTRA ] ; if ( i != 0 ) System . arraycopy ( list , 0 , temp , 0 , i ) ; System . arraycopy ( list , i , temp , i + 2 , len - i ) ; list = temp ; } else { System . arraycopy ( list , i , list , i + 2 , len - i ) ; } list [ i ] = c ; list [ i + 1 ] = c + 1 ; len += 2 ; } pat = null ; return this ; |
public class CmsSitesWebserverThread { /** * Creates the new web server configuration files from the given template file . < p >
* @ throws IOException if something goes wrong */
private void createAllWebserverConfigs ( ) throws IOException { } } | List < CmsSite > sites = OpenCms . getSiteManager ( ) . getAvailableSites ( getCms ( ) , true ) ; for ( CmsSite site : sites ) { if ( ( site . getSiteMatcher ( ) != null ) && site . isWebserver ( ) ) { String filename = m_targetPath + m_filePrefix + "_" + generateWebserverConfigName ( site . getSiteMatcher ( ) , "_" ) ; getReport ( ) . println ( Messages . get ( ) . container ( Messages . RPT_CREATING_CONFIG_FOR_SITE_2 , filename , site ) , I_CmsReport . FORMAT_OK ) ; File newFile = new File ( filename ) ; if ( ! newFile . exists ( ) ) { newFile . getParentFile ( ) . mkdirs ( ) ; newFile . createNewFile ( ) ; } String content = createConfigForSite ( site , FileUtils . readFileToString ( new File ( m_templatePath ) ) ) ; if ( site . hasSecureServer ( ) ) { content += createConfigForSite ( site , FileUtils . readFileToString ( new File ( m_secureTemplate ) ) ) ; } FileUtils . writeStringToFile ( newFile , content ) ; m_writtenFiles . add ( newFile . getAbsolutePath ( ) ) ; } } |
public class LdapConnectionWrapper { /** * Formats the principal in username @ domain format or in a custom format if is specified in the config file .
* If LDAP _ AUTH _ USERNAME _ FMT is configured to a non - empty value , the substring % s in this value will be replaced with the entered username .
* The recommended format of this value depends on your LDAP server ( Active Directory , OpenLDAP , etc . ) .
* Examples :
* alpine . ldap . auth . username . format = % s
* alpine . ldap . auth . username . format = % s @ company . com
* @ param username the username
* @ return a formatted user principal
* @ since 1.4.0 */
private static String formatPrincipal ( final String username ) { } } | if ( StringUtils . isNotBlank ( LDAP_AUTH_USERNAME_FMT ) ) { return String . format ( LDAP_AUTH_USERNAME_FMT , username ) ; } return username ; |
public class Validation { /** * method to check the validation of the attachment
* @ param listMonomersOne
* List of Monomers of the source
* @ param listMonomersTwo
* List of Monomers of the target
* @ param not
* ConnectionNotation
* @ param helm2notation
* HELM2Notation object
* @ param interconnection
* InterConnections
* @ param spec
* specificity of the connection
* @ return true if it valid , false otherwise
* @ throws AttachmentException */
private static void checkAttachment ( List < Monomer > listMonomersOne , List < Monomer > listMonomersTwo , ConnectionNotation not , HELM2Notation helm2notation , InterConnections interconnection , boolean spec ) throws AttachmentException { } } | boolean specific = spec ; if ( listMonomersOne . size ( ) > 1 || listMonomersTwo . size ( ) > 1 ) { specific = false ; } for ( Monomer monomerOne : listMonomersOne ) { for ( Monomer monomerTwo : listMonomersTwo ) { if ( monomerOne . getCanSMILES ( ) . equals ( "*|X|N" ) || monomerTwo . getCanSMILES ( ) . equals ( "*|X|N" ) ) { throw new AttachmentException ( "Monomer (canonicalsmiles = *) is undefined and should be defined" ) ; } /* Rna - Basepair - hydrogen bonds */
if ( monomerOne . getPolymerType ( ) . equals ( "RNA" ) && monomerTwo . getPolymerType ( ) . equals ( "RNA" ) && not . getrGroupSource ( ) . equals ( "pair" ) && not . getrGroupTarget ( ) . equals ( "pair" ) ) { LOG . info ( "RNA strand connection" ) ; if ( ! ( monomerOne . getMonomerType ( ) . equals ( "Branch" ) | monomerTwo . getMonomerType ( ) . equals ( "Branch" ) ) ) { LOG . info ( "RNA strand connection is not valid" ) ; throw new AttachmentException ( "RNA strand connection is not valid" ) ; } /* * is the attachment point already occupied by another
* monomer ? */
String detailsource = not . getSourceUnit ( ) + "$" + not . getrGroupSource ( ) ; String detailtarget = not . getTargetUnit ( ) + "$" + not . getrGroupTarget ( ) ; /* * Is the attachment point already occupied by another
* monomer */
/* Intra connections */
if ( helm2notation . getSimplePolymer ( not . getSourceId ( ) . getId ( ) ) . getMapIntraConnection ( ) . containsKey ( detailsource ) ) { LOG . info ( "Attachment point is already occupied" ) ; throw new AttachmentException ( "Attachment point is already occupied" ) ; } if ( helm2notation . getSimplePolymer ( not . getTargetId ( ) . getId ( ) ) . getMapIntraConnection ( ) . containsKey ( detailtarget ) ) { LOG . info ( "Attachment point is already occupied" ) ; throw new AttachmentException ( "Attachment point is already occupied" ) ; } } String detailsource = not . getSourceUnit ( ) + "$" + not . getrGroupSource ( ) ; String detailtarget = not . getTargetUnit ( ) + "$" + not . getrGroupTarget ( ) ; /* Inter connections */
detailsource = not . getSourceId ( ) . getId ( ) + "$" + detailsource ; detailtarget = not . getTargetId ( ) . getId ( ) + "$" + detailtarget ; /* check */
if ( interconnection . hasKey ( detailsource ) ) { LOG . info ( "Attachment point is already occupied" ) ; throw new AttachmentException ( "Attachment point is already occupied" ) ; } if ( interconnection . hasKey ( detailtarget ) ) { LOG . info ( "Attachment point is already occupied" ) ; throw new AttachmentException ( "Attachment point is already occupied" ) ; } /* Inter connections */
detailsource = not . getSourceId ( ) . getId ( ) + "$" + not . getSourceUnit ( ) + "$" + not . getrGroupSource ( ) ; detailtarget = not . getTargetId ( ) . getId ( ) + "$" + not . getTargetUnit ( ) + "$" + not . getrGroupTarget ( ) ; if ( specific ) { /* save only specific interactions */
interconnection . addConnection ( detailsource , "" ) ; interconnection . addConnection ( detailtarget , "" ) ; } } } |
public class CompletableFuture { /** * Traverses stack and unlinks dead Completions . */
final void cleanStack ( ) { } } | for ( Completion p = null , q = stack ; q != null ; ) { Completion s = q . next ; if ( q . isLive ( ) ) { p = q ; q = s ; } else if ( p == null ) { casStack ( q , s ) ; q = stack ; } else { p . next = s ; if ( p . isLive ( ) ) q = s ; else { p = null ; // restart
q = stack ; } } } |
public class JaxWsHttpServletRequestAdapter { /** * ( non - Javadoc )
* @ see javax . servlet . ServletRequest # getParameterMap ( ) */
@ Override public Map < String , String [ ] > getParameterMap ( ) { } } | try { collaborator . preInvoke ( componentMetaData ) ; return request . getParameterMap ( ) ; } finally { collaborator . postInvoke ( ) ; } |
public class ArrayPathToken { /** * Check if model is non - null and array .
* @ param currentPath
* @ param model
* @ param ctx
* @ return false if current evaluation call must be skipped , true otherwise
* @ throws PathNotFoundException if model is null and evaluation must be interrupted
* @ throws InvalidPathException if model is not an array and evaluation must be interrupted */
protected boolean checkArrayModel ( String currentPath , Object model , EvaluationContextImpl ctx ) { } } | if ( model == null ) { if ( ! isUpstreamDefinite ( ) ) { return false ; } else { throw new PathNotFoundException ( "The path " + currentPath + " is null" ) ; } } if ( ! ctx . jsonProvider ( ) . isArray ( model ) ) { if ( ! isUpstreamDefinite ( ) ) { return false ; } else { throw new PathNotFoundException ( format ( "Filter: %s can only be applied to arrays. Current context is: %s" , toString ( ) , model ) ) ; } } return true ; |
public class SimonConsoleRequestProcessor { /** * Add a resource action binding to the { @ link # actionBindings } list .
* @ param actionPath Path of the action
* @ param resourcePath Path of a resource located under */
public void addResourceActionBinding ( final String actionPath , final String resourcePath ) { } } | this . addActionBinding ( new ActionBinding ( ) { public boolean supports ( ActionContext actionContext ) { return actionContext . getPath ( ) . equals ( actionPath ) ; } public Action create ( ActionContext actionContext ) { return new ResourceAction ( actionContext , resourcePath ) ; } } ) ; |
public class SebContextWait { /** * Until method using function functional interface . It solves ambiguity
* when using basic until method without typed parameter .
* Repeatedly applies this instance ' s input value to the given function
* until one of the following occurs :
* < ol >
* < li > the function returns neither null nor false , < / li >
* < li > the function throws an unignored exception , < / li >
* < li > the timeout expires ,
* < li >
* < li > the current thread is interrupted < / li >
* < / ol >
* @ param isTrue
* the parameter to pass to the { @ link ExpectedCondition }
* @ param < V >
* The function ' s expected return type .
* @ return The functions ' return value if the function returned something
* different from null or false before the timeout expired .
* @ throws TimeoutException
* If the timeout expires . */
public < V > V untilValid ( Function < SebContext , V > isTrue ) { } } | return super . until ( new com . google . common . base . Function < SebContext , V > ( ) { @ Override public V apply ( SebContext input ) { return isTrue . apply ( input ) ; } } ) ; |
public class GeoPackageImpl { /** * { @ inheritDoc } */
@ Override public AttributesDao getAttributesDao ( Contents contents ) { } } | if ( contents == null ) { throw new GeoPackageException ( "Non null " + Contents . class . getSimpleName ( ) + " is required to create " + AttributesDao . class . getSimpleName ( ) ) ; } if ( contents . getDataType ( ) != ContentsDataType . ATTRIBUTES ) { throw new GeoPackageException ( Contents . class . getSimpleName ( ) + " is required to be of type " + ContentsDataType . ATTRIBUTES + ". Actual: " + contents . getDataTypeString ( ) ) ; } // Read the existing table and create the dao
AttributesTableReader tableReader = new AttributesTableReader ( contents . getTableName ( ) ) ; AttributesConnection userDb = new AttributesConnection ( database ) ; final AttributesTable attributesTable = tableReader . readTable ( userDb ) ; attributesTable . setContents ( contents ) ; AttributesDao dao = new AttributesDao ( getName ( ) , database , userDb , attributesTable ) ; return dao ; |
public class TableBuilder { /** * Set a border on the outline of the whole table , as well as around the first row .
* @ param style the style to apply
* @ return this , for method chaining */
public TableBuilder addHeaderBorder ( BorderStyle style ) { } } | this . addBorder ( 0 , 0 , 1 , model . getColumnCount ( ) , OUTLINE , style ) ; return addOutlineBorder ( style ) ; |
public class ResourceDMBean { /** * Returns a string with the first letter being lowercase */
protected static String toLowerCase ( String input ) { } } | if ( Character . isUpperCase ( input . charAt ( 0 ) ) ) return input . substring ( 0 , 1 ) . toLowerCase ( ) + input . substring ( 1 ) ; return input ; |
public class Functions { /** * A { @ code Function } that always ignores its argument and returns a constant value .
* @ return a { @ code Function } that always ignores its argument and returns a constant value .
* @ since 0.5 */
public static < T > Function < Object , T > returnConstant ( final T constant ) { } } | return new Function < Object , T > ( ) { @ Override public T apply ( Object ignored ) { return constant ; } } ; |
public class PeerEurekaNode { /** * Send the status information of of the ASG represented by the instance .
* ASG ( Autoscaling group ) names are available for instances in AWS and the
* ASG information is used for determining if the instance should be
* registered as { @ link InstanceStatus # DOWN } or { @ link InstanceStatus # UP } .
* @ param asgName
* the asg name if any of this instance .
* @ param newStatus
* the new status of the ASG . */
public void statusUpdate ( final String asgName , final ASGStatus newStatus ) { } } | long expiryTime = System . currentTimeMillis ( ) + maxProcessingDelayMs ; nonBatchingDispatcher . process ( asgName , new AsgReplicationTask ( targetHost , Action . StatusUpdate , asgName , newStatus ) { public EurekaHttpResponse < ? > execute ( ) { return replicationClient . statusUpdate ( asgName , newStatus ) ; } } , expiryTime ) ; |
public class Config { /** * Gets the value of a property for a given class
* @ param clazz The class
* @ param propertyComponents The components
* @ return The value associated with clazz . propertyName */
public static Val get ( Class < ? > clazz , String ... propertyComponents ) { } } | return get ( clazz . getName ( ) , propertyComponents ) ; |
public class BlockLeaf { /** * Searches for a row matching the cursor ' s key in the block .
* If the key is found , fill the cursor with the row . */
int findAndFill ( RowCursor cursor ) { } } | int ptr = find ( cursor ) ; if ( ptr >= 0 ) { cursor . setRow ( _buffer , ptr ) ; cursor . setLeafBlock ( this , ptr ) ; } return ptr ; |
public class SynchronousReplicator { /** * Completes futures . */
private void completeFutures ( ) { } } | long commitIndex = queues . values ( ) . stream ( ) . map ( queue -> queue . ackedIndex ) . reduce ( Math :: min ) . orElse ( 0L ) ; for ( long i = context . getCommitIndex ( ) + 1 ; i <= commitIndex ; i ++ ) { CompletableFuture < Void > future = futures . remove ( i ) ; if ( future != null ) { future . complete ( null ) ; } } context . setCommitIndex ( commitIndex ) ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.