signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class MultiDbJDBCConnection { /** * { @ inheritDoc } */
protected void deleteLockProperties ( ) throws SQLException { } } | PreparedStatement removeValuesStatement = null ; PreparedStatement removeItemsStatement = null ; try { removeValuesStatement = dbConnection . prepareStatement ( "DELETE FROM " + JCR_VALUE + " WHERE PROPERTY_ID IN " + "(SELECT ID FROM " + JCR_ITEM + " WHERE NAME = '[http://www.jcp.org/jcr/1.0]lockIsDeep' OR" + " NAME = '[http://www.jcp.org/jcr/1.0]lockOwner')" ) ; removeItemsStatement = dbConnection . prepareStatement ( "DELETE FROM " + JCR_ITEM + " WHERE NAME = '[http://www.jcp.org/jcr/1.0]lockIsDeep'" + " OR NAME = '[http://www.jcp.org/jcr/1.0]lockOwner'" ) ; removeValuesStatement . executeUpdate ( ) ; removeItemsStatement . executeUpdate ( ) ; } finally { if ( removeValuesStatement != null ) { try { removeValuesStatement . close ( ) ; } catch ( SQLException e ) { LOG . error ( "Can't close statement" , e ) ; } } if ( removeItemsStatement != null ) { try { removeItemsStatement . close ( ) ; } catch ( SQLException e ) { LOG . error ( "Can't close statement" , e ) ; } } } |
public class ProgressFragment { /** * Detach from view . */
@ Override public void onDestroyView ( ) { } } | mContentShown = false ; mIsContentEmpty = false ; mProgressContainer = mContentContainer = mContentView = mEmptyView = null ; super . onDestroyView ( ) ; |
public class AbstractEdgeGridRequestSigner { /** * Signs { @ code request } with appropriate credentials using EdgeGrid signer algorithm and
* replaces { @ code request } ' s host name with the one specified by the credential .
* @ param request an HTTP request with data used to sign
* @ param requestToUpdate an HTTP request to update with signature
* @ throws RequestSigningException if failed to sign a request
* @ throws NoMatchingCredentialException if acquiring a { @ link ClientCredential } throws { @ code
* NoMatchingCredentialException } or returns { @ code null } */
public void sign ( RequestT request , MutableRequestT requestToUpdate ) throws RequestSigningException { } } | Request req = map ( request ) ; ClientCredential credential ; try { credential = clientCredentialProvider . getClientCredential ( req ) ; } catch ( NoMatchingCredentialException e ) { throw e ; } if ( credential == null ) { throw new NoMatchingCredentialException ( ) ; } String newHost = credential . getHost ( ) ; URI originalUri = Objects . requireNonNull ( requestUri ( request ) , "Request-URI cannot be null" ) ; URI newUri = withNewHost ( originalUri , newHost ) ; setHost ( requestToUpdate , newHost , newUri ) ; String authorization = edgeGridSigner . getSignature ( req , credential ) ; setAuthorization ( requestToUpdate , authorization ) ; |
public class ContextUtils { /** * Get the { @ link android . os . DropBoxManager } service for this context .
* @ param context the context .
* @ return the { @ link android . os . DropBoxManager } */
@ TargetApi ( Build . VERSION_CODES . FROYO ) public static DropBoxManager getDropBoxManager ( Context context ) { } } | return ( DropBoxManager ) context . getSystemService ( Context . DROPBOX_SERVICE ) ; |
public class CmsJspTagResourceLoad { /** * Returns the resource name currently processed . < p >
* @ param cms the current OpenCms user context
* @ param contentContainer the current resource container
* @ return the resource name currently processed */
protected static String getResourceName ( CmsObject cms , I_CmsResourceContainer contentContainer ) { } } | if ( ( contentContainer != null ) && ( contentContainer . getResourceName ( ) != null ) ) { return contentContainer . getResourceName ( ) ; } else if ( cms != null ) { return cms . getRequestContext ( ) . getUri ( ) ; } else { return null ; } |
public class TimePoint { /** * / * [ deutsch ]
* < p > Addiert den angegebenen Betrag der entsprechenden Zeiteinheit
* zu dieser Bezugszeit und liefert das Additionsergebnis zur & uuml ; ck . < / p >
* < p > & Auml ; hnlich wie { @ link # plus ( TimeSpan ) } , aber mit dem Unterschied ,
* da & szlig ; die Zeitspanne in nur einer Zeiteinheit angegeben wird .
* Beispiel in Pseudo - Code : < / p >
* < ul >
* < li > [ 2011-05-31 ] . plus ( 1 , & lt ; MONTHS & gt ; ) = [ 2011-06-30 ] < / li >
* < li > [ 2011-05-31 ] . plus ( 4 , & lt ; DAYS & gt ; ) = [ 2011-06-04 ] < / li >
* < li > [ 2011-06-04 ] . plus ( - 4 , & lt ; DAYS & gt ; ) = [ 2011-05-31 ] < / li >
* < li > [ 2010-04-29 ] . plus ( 397 , & lt ; DAYS & gt ; ) = [ 2011-05-31 ] < / li >
* < li > [ 2010-04-29 ] . plus ( 13 , & lt ; MONTHS & gt ; ) = [ 2011-05-29 ] < / li >
* < li > [ 2010-04-29 ] . plus ( - 2 , & lt ; MONTHS & gt ; ) = [ 2010-02-28 ] < / li >
* < li > [ 2010-04-29 ] . plus ( 1 , & lt ; YEARS & gt ; ) = [ 2011-04-29 ] < / li >
* < / ul >
* @ param amount amount to be added ( maybe negative )
* @ param unit time unit
* @ return result of addition as changed copy , this instance
* remains unaffected
* @ throws RuleNotFoundException if given time unit is not registered
* and does also not implement { @ link BasicUnit } to yield
* a suitable unit rule for the underlying time axis
* @ throws ArithmeticException in case of numerical overflow
* @ see # plus ( TimeSpan ) */
public T plus ( long amount , U unit ) { } } | if ( amount == 0 ) { return this . getContext ( ) ; } try { return this . getChronology ( ) . getRule ( unit ) . addTo ( this . getContext ( ) , amount ) ; } catch ( IllegalArgumentException iae ) { ArithmeticException ex = new ArithmeticException ( "Result beyond boundaries of time axis." ) ; ex . initCause ( iae ) ; throw ex ; } |
public class CassandraDataHandlerBase { /** * On column or super column thrift row .
* @ param m
* the m
* @ param e
* the e
* @ param id
* the id
* @ param timestamp
* the timestamp2
* @ param columnTTLs
* TODO
* @ return the collection */
private Collection < ThriftRow > onColumnOrSuperColumnThriftRow ( EntityMetadata m , Object e , Object id , long timestamp , Object columnTTLs ) { } } | // Iterate through Super columns
Map < String , ThriftRow > thriftRows = new HashMap < String , ThriftRow > ( ) ; MetamodelImpl metaModel = ( MetamodelImpl ) kunderaMetadata . getApplicationMetadata ( ) . getMetamodel ( m . getPersistenceUnit ( ) ) ; EntityType entityType = metaModel . entity ( m . getEntityClazz ( ) ) ; Set < Attribute > attributes = entityType . getAttributes ( ) ; for ( Attribute attribute : attributes ) { String tableName = ( ( AbstractAttribute ) attribute ) . getTableName ( ) != null ? ( ( AbstractAttribute ) attribute ) . getTableName ( ) : m . getTableName ( ) ; ThriftRow tr = getThriftRow ( id , tableName , thriftRows ) ; if ( ! attribute . getName ( ) . equals ( m . getIdAttribute ( ) . getName ( ) ) && ! attribute . isAssociation ( ) ) { Field field = ( Field ) ( ( Attribute ) attribute ) . getJavaMember ( ) ; byte [ ] name = ByteBufferUtil . bytes ( ( ( AbstractAttribute ) attribute ) . getJPAColumnName ( ) ) . array ( ) ; // if attribute is embeddable .
if ( metaModel . isEmbeddable ( attribute . isCollection ( ) ? ( ( PluralAttribute ) attribute ) . getBindableJavaType ( ) : attribute . getJavaType ( ) ) ) { Map < String , Object > thriftSuperColumns = onEmbeddable ( timestamp , tr , m , e , id , attribute ) ; if ( thriftSuperColumns != null ) { for ( String columnFamilyName : thriftSuperColumns . keySet ( ) ) { ThriftRow thriftRow = getThriftRow ( id , columnFamilyName , thriftRows ) ; if ( m . isCounterColumnType ( ) ) { thriftRow . addCounterSuperColumn ( ( CounterSuperColumn ) thriftSuperColumns . get ( columnFamilyName ) ) ; } else { thriftRow . addSuperColumn ( ( SuperColumn ) thriftSuperColumns . get ( columnFamilyName ) ) ; } } } } else { Object value = getColumnValue ( m , e , attribute ) ; if ( m . getType ( ) . equals ( Type . SUPER_COLUMN_FAMILY ) ) { prepareSuperColumn ( tr , m , value , name , timestamp ) ; } else { int ttl = getTTLForColumn ( columnTTLs , attribute ) ; prepareColumn ( tr , m , value , name , timestamp , ttl ) ; } } } } // Add discriminator column .
onDiscriminatorColumn ( thriftRows . get ( m . getTableName ( ) ) , timestamp , entityType ) ; return thriftRows . values ( ) ; |
public class CmsForm { /** * Default handler for value change events of form fields . < p >
* @ param field the form field for which the event has been fired
* @ param inhibitValidation prevents validation of the edited field
* @ param newValue the new value */
protected void defaultHandleValueChange ( I_CmsFormField field , String newValue , boolean inhibitValidation ) { } } | m_editedFields . add ( field . getId ( ) ) ; I_CmsStringModel model = field . getModel ( ) ; if ( model != null ) { model . setValue ( newValue , true ) ; } field . setValidationStatus ( I_CmsFormField . ValidationStatus . unknown ) ; // if the user presses enter , the keypressed event is fired before the change event ,
// so we use a flag to keep track of whether enter was pressed .
if ( ! m_pressedEnter ) { if ( ! inhibitValidation ) { validateField ( field ) ; } } else { validateAndSubmit ( ) ; } |
public class Position { /** * Calculate the three - dimensional distance between this and another position .
* This method assumes that the coordinates are WGS84.
* @ param other position
* @ return 3d distance in meters or null if lat , lon , or alt is missing */
public Double distance3d ( Position other ) { } } | if ( other == null || latitude == null || longitude == null || altitude == null ) return null ; double [ ] xyz1 = this . toECEF ( ) ; double [ ] xyz2 = other . toECEF ( ) ; return Math . sqrt ( Math . pow ( xyz2 [ 0 ] - xyz1 [ 0 ] , 2 ) + Math . pow ( xyz2 [ 1 ] - xyz1 [ 1 ] , 2 ) + Math . pow ( xyz2 [ 2 ] - xyz1 [ 2 ] , 2 ) ) ; |
public class WriteResourceClass { /** * Get the file name . */
public String getFileName ( String strClassName , String strPackage , CodeType codeType , ClassProject recClassProject ) { } } | boolean bResourceListBundle = ResourceTypeField . LIST_RESOURCE_BUNDLE . equals ( this . getRecord ( ProgramControl . PROGRAM_CONTROL_FILE ) . getField ( ProgramControl . CLASS_RESOURCE_TYPE ) . toString ( ) ) ; codeType = bResourceListBundle ? CodeType . RESOURCE_CODE : CodeType . RESOURCE_PROPERTIES ; // For now , put this type of resource in the main code base
codeType = CodeType . THICK ; String strFileName = super . getFileName ( strClassName , strPackage , codeType , recClassProject ) ; if ( ! bResourceListBundle ) strFileName . replace ( ".java" , ".properties" ) ; return strFileName ; |
public class Datatype_Builder { /** * Sets the value to be returned by { @ link Datatype # getBuilder ( ) } .
* @ return this { @ code Builder } object
* @ throws NullPointerException if { @ code builder } is null */
public Datatype . Builder setBuilder ( Type builder ) { } } | this . builder = Objects . requireNonNull ( builder ) ; _unsetProperties . remove ( Property . BUILDER ) ; return ( Datatype . Builder ) this ; |
public class Configuration { /** * Adds the handler .
* @ param handler
* the handler
* @ since 2.2.0 */
public void addHandler ( Handler handler ) { } } | if ( null == handlers ) { handlers = new ArrayList < > ( ) ; } handlers . add ( handler ) ; |
public class ChangeStack { /** * Push the given value onto the stack . This will invalidate all future
* changes , which removes redo capability until an undo is called . < br >
* < br >
* Note that this method will do nothing if the new value is the same as the
* current value .
* @ param value
* the new value to push
* @ return < code > true < / code > if { @ link # getCurrentValue ( ) } changes as a
* result of this call ; < code > false < / code > otherwise
* @ throws NullPointerException
* if the given value is < code > null < / code > */
public synchronized boolean push ( T value ) throws NullPointerException { } } | if ( value . equals ( getCurrentValue ( ) ) ) { return false ; } if ( stack . size ( ) > currentLoc + 1 ) { Iterator < T > iter = stack . listIterator ( currentLoc + 1 ) ; while ( iter . hasNext ( ) ) { iter . next ( ) ; iter . remove ( ) ; } } stack . add ( value ) ; currentLoc ++ ; return true ; |
public class HtmlDocletWriter { /** * Adds the navigation bar for the Html page at the top and and the bottom .
* @ param header If true print navigation bar at the top of the page else
* @ param body the HtmlTree to which the nav links will be added */
protected void addNavLinks ( boolean header , Content body ) { } } | if ( ! configuration . nonavbar ) { String allClassesId = "allclasses_" ; HtmlTree navDiv = new HtmlTree ( HtmlTag . DIV ) ; Content skipNavLinks = configuration . getResource ( "doclet.Skip_navigation_links" ) ; if ( header ) { body . addContent ( HtmlConstants . START_OF_TOP_NAVBAR ) ; navDiv . addStyle ( HtmlStyle . topNav ) ; allClassesId += "navbar_top" ; Content a = getMarkerAnchor ( SectionName . NAVBAR_TOP ) ; // WCAG - Hyperlinks should contain text or an image with alt text - for AT tools
navDiv . addContent ( a ) ; Content skipLinkContent = HtmlTree . DIV ( HtmlStyle . skipNav , getHyperLink ( getDocLink ( SectionName . SKIP_NAVBAR_TOP ) , skipNavLinks , skipNavLinks . toString ( ) , "" ) ) ; navDiv . addContent ( skipLinkContent ) ; } else { body . addContent ( HtmlConstants . START_OF_BOTTOM_NAVBAR ) ; navDiv . addStyle ( HtmlStyle . bottomNav ) ; allClassesId += "navbar_bottom" ; Content a = getMarkerAnchor ( SectionName . NAVBAR_BOTTOM ) ; navDiv . addContent ( a ) ; Content skipLinkContent = HtmlTree . DIV ( HtmlStyle . skipNav , getHyperLink ( getDocLink ( SectionName . SKIP_NAVBAR_BOTTOM ) , skipNavLinks , skipNavLinks . toString ( ) , "" ) ) ; navDiv . addContent ( skipLinkContent ) ; } if ( header ) { navDiv . addContent ( getMarkerAnchor ( SectionName . NAVBAR_TOP_FIRSTROW ) ) ; } else { navDiv . addContent ( getMarkerAnchor ( SectionName . NAVBAR_BOTTOM_FIRSTROW ) ) ; } HtmlTree navList = new HtmlTree ( HtmlTag . UL ) ; navList . addStyle ( HtmlStyle . navList ) ; navList . addAttr ( HtmlAttr . TITLE , configuration . getText ( "doclet.Navigation" ) ) ; if ( configuration . createoverview ) { navList . addContent ( getNavLinkContents ( ) ) ; } if ( configuration . packages . length == 1 ) { navList . addContent ( getNavLinkPackage ( configuration . packages [ 0 ] ) ) ; } else if ( configuration . packages . length > 1 ) { navList . addContent ( getNavLinkPackage ( ) ) ; } navList . addContent ( getNavLinkClass ( ) ) ; if ( configuration . classuse ) { navList . addContent ( getNavLinkClassUse ( ) ) ; } if ( configuration . createtree ) { navList . addContent ( getNavLinkTree ( ) ) ; } if ( ! ( configuration . nodeprecated || configuration . nodeprecatedlist ) ) { navList . addContent ( getNavLinkDeprecated ( ) ) ; } if ( configuration . createindex ) { navList . addContent ( getNavLinkIndex ( ) ) ; } if ( ! configuration . nohelp ) { navList . addContent ( getNavLinkHelp ( ) ) ; } navDiv . addContent ( navList ) ; Content aboutDiv = HtmlTree . DIV ( HtmlStyle . aboutLanguage , getUserHeaderFooter ( header ) ) ; navDiv . addContent ( aboutDiv ) ; body . addContent ( navDiv ) ; Content ulNav = HtmlTree . UL ( HtmlStyle . navList , getNavLinkPrevious ( ) ) ; ulNav . addContent ( getNavLinkNext ( ) ) ; Content subDiv = HtmlTree . DIV ( HtmlStyle . subNav , ulNav ) ; Content ulFrames = HtmlTree . UL ( HtmlStyle . navList , getNavShowLists ( ) ) ; ulFrames . addContent ( getNavHideLists ( filename ) ) ; subDiv . addContent ( ulFrames ) ; HtmlTree ulAllClasses = HtmlTree . UL ( HtmlStyle . navList , getNavLinkClassIndex ( ) ) ; ulAllClasses . addAttr ( HtmlAttr . ID , allClassesId . toString ( ) ) ; subDiv . addContent ( ulAllClasses ) ; subDiv . addContent ( getAllClassesLinkScript ( allClassesId . toString ( ) ) ) ; addSummaryDetailLinks ( subDiv ) ; if ( header ) { subDiv . addContent ( getMarkerAnchor ( SectionName . SKIP_NAVBAR_TOP ) ) ; body . addContent ( subDiv ) ; body . addContent ( HtmlConstants . END_OF_TOP_NAVBAR ) ; } else { subDiv . addContent ( getMarkerAnchor ( SectionName . SKIP_NAVBAR_BOTTOM ) ) ; body . addContent ( subDiv ) ; body . addContent ( HtmlConstants . END_OF_BOTTOM_NAVBAR ) ; } } |
public class OptionalParamMap { /** * getLong will successfully return for both Long values and Integer values
* it will convert the Integer to a Long */
public Long getLong ( String key , Long defaultValue ) { } } | Object o = get ( key ) ; if ( o != null ) { if ( o instanceof Long ) { return ( Long ) o ; } else if ( o instanceof Integer ) { return new Long ( ( Integer ) o ) ; } } return defaultValue ; |
public class TaxNumberValidator { /** * check the Tax Identification Number number , country version for countries using unique master
* citizen number .
* @ param ptaxNumber vat id to check
* @ return true if checksum is ok */
private boolean checkUniqueMasterCitizenNumber ( final String ptaxNumber ) { } } | final int checkSum = ptaxNumber . charAt ( 12 ) - '0' ; final int sum = ( ( ptaxNumber . charAt ( 0 ) - '0' + ptaxNumber . charAt ( 6 ) - '0' ) * 7 + ( ptaxNumber . charAt ( 1 ) - '0' + ptaxNumber . charAt ( 7 ) - '0' ) * 6 + ( ptaxNumber . charAt ( 2 ) - '0' + ptaxNumber . charAt ( 8 ) - '0' ) * 5 + ( ptaxNumber . charAt ( 3 ) - '0' + ptaxNumber . charAt ( 9 ) - '0' ) * 4 + ( ptaxNumber . charAt ( 4 ) - '0' + ptaxNumber . charAt ( 10 ) - '0' ) * 3 + ( ptaxNumber . charAt ( 5 ) - '0' + ptaxNumber . charAt ( 11 ) - '0' ) * 2 ) % MODULO_11 ; int calculatedCheckSum = MODULO_11 - sum ; if ( calculatedCheckSum == 10 ) { calculatedCheckSum = 0 ; } return checkSum == calculatedCheckSum ; |
public class OWLDataHasValueImpl_CustomFieldSerializer { /** * Serializes the content of the object into the
* { @ link com . google . gwt . user . client . rpc . SerializationStreamWriter } .
* @ param streamWriter the { @ link com . google . gwt . user . client . rpc . SerializationStreamWriter } to write the
* object ' s content to
* @ param instance the object instance to serialize
* @ throws com . google . gwt . user . client . rpc . SerializationException
* if the serialization operation is not
* successful */
@ Override public void serializeInstance ( SerializationStreamWriter streamWriter , OWLDataHasValueImpl instance ) throws SerializationException { } } | serialize ( streamWriter , instance ) ; |
public class ClassCollector { /** * Initialises the class collector . It is expected that only
* directories or archive files ( * . zip , * . jar ) are provided !
* @ param files */
public void initialise ( File [ ] files , ClassLoader loader ) throws MalformedURLException { } } | _loader = loader ; // TODO : remove this debugging stuff
_filters = new LinkedList < IFilter > ( ) ; _filters . add ( new IgnoreFilter ( ) ) ; _filters . add ( new ServiceFilter ( ) ) ; // _ filters . add ( new AgentElementFilter ( ) ) ;
// _ filters . add ( new NodeFilter ( ) ) ;
// _ filters . add ( new AgentFilter ( ) ) ;
// initialise enumerators
_classEnumerations = new LinkedList < Enumeration < Class < ? > > > ( ) ; for ( File current : files ) { if ( current . isDirectory ( ) ) { _classEnumerations . add ( new DirectoryClassEnumerator ( current , _loader ) ) ; } else { _classEnumerations . add ( new ArchiveClassEnumerator ( current , _loader ) ) ; } } |
public class LazyGenerator { /** * used by benchmark harness */
private void generateDoneMethod ( SourceWriter sw , JClassType nonLazyType , TreeLogger treeLogger ) { } } | sw . indent ( ) ; sw . println ( "public Function done() {" ) ; sw . indent ( ) ; sw . println ( "return new Function() {" ) ; sw . indent ( ) ; sw . println ( "public void f() {" ) ; sw . indent ( ) ; String classID = nonLazyType . getSimpleSourceName ( ) ; if ( "GQuery" . equals ( classID ) ) { classID = "GQUERY" ; } sw . println ( "ctx = GQuery.$((Element) getElement()).as(" + nonLazyType . getQualifiedSourceName ( ) + "." + classID + ");" ) ; sw . println ( "for (int i = 0; i < closures.length(); i++) {" ) ; sw . indent ( ) ; sw . println ( "closures.get(i).invoke();" ) ; sw . outdent ( ) ; sw . println ( "}" ) ; sw . outdent ( ) ; sw . println ( "}" ) ; sw . outdent ( ) ; sw . println ( "};" ) ; sw . outdent ( ) ; sw . println ( "}" ) ; |
public class Ifc2x3tc1FactoryImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public String convertIfcReflectanceMethodEnumToString ( EDataType eDataType , Object instanceValue ) { } } | return instanceValue == null ? null : instanceValue . toString ( ) ; |
public class U { /** * Documented , # chain */
public static < T > Chain < T > chain ( final List < T > list ) { } } | return new U . Chain < T > ( list ) ; |
public class XMLUtils { /** * Only return child nodes that are elements - text nodes are ignored .
* @ param node We will take the children from this node .
* @ return New ordered list of child elements . */
public static ArrayList < Element > getChildElements ( Node node ) { } } | ArrayList < Element > childElements = new ArrayList < > ( ) ; NodeList childNodes = node . getChildNodes ( ) ; for ( int i = 0 ; i < childNodes . getLength ( ) ; i ++ ) { if ( childNodes . item ( i ) instanceof Element ) { childElements . add ( ( Element ) childNodes . item ( i ) ) ; } } return childElements ; |
public class BaseOperation { /** * Updates the list or single item if it has a missing or incorrect apiGroupVersion
* @ param resource resource object */
protected void updateApiVersionResource ( Object resource ) { } } | if ( resource instanceof HasMetadata ) { HasMetadata hasMetadata = ( HasMetadata ) resource ; updateApiVersion ( hasMetadata ) ; } else if ( resource instanceof KubernetesResourceList ) { KubernetesResourceList list = ( KubernetesResourceList ) resource ; updateApiVersion ( list ) ; } |
public class PathFinderImpl { /** * Update the current neighbor on search .
* @ param mover The entity that will be moving along the path .
* @ param dtx The x coordinate of the destination location .
* @ param dty The y coordinate of the destination location .
* @ param current The current node .
* @ param xp The x coordinate of the destination location .
* @ param yp The y coordinate of the destination location .
* @ param maxDepth The last max depth .
* @ return The next max depth . */
private int updateNeighbour ( Pathfindable mover , int dtx , int dty , Node current , int xp , int yp , int maxDepth ) { } } | int nextDepth = maxDepth ; final double nextStepCost = current . getCost ( ) + getMovementCost ( mover , current . getX ( ) , current . getY ( ) ) ; final Node neighbour = nodes [ yp ] [ xp ] ; if ( nextStepCost < neighbour . getCost ( ) ) { open . remove ( neighbour ) ; closed . remove ( neighbour ) ; } if ( ! open . contains ( neighbour ) && ! closed . contains ( neighbour ) ) { neighbour . setCost ( nextStepCost ) ; neighbour . setHeuristic ( getHeuristicCost ( xp , yp , dtx , dty ) ) ; nextDepth = Math . max ( maxDepth , neighbour . setParent ( current ) ) ; open . add ( neighbour ) ; } return nextDepth ; |
public class TableBuilder { /** * Find the default cell style for a column
* @ param columnIndex the column index
* @ return the style , null if none */
public TableCellStyle findDefaultCellStyle ( final int columnIndex ) { } } | TableCellStyle s = this . columnStyles . get ( columnIndex ) . getDefaultCellStyle ( ) ; if ( s == null ) s = TableCellStyle . DEFAULT_CELL_STYLE ; return s ; |
public class DefaultBlockMaster { /** * Updates the worker and block metadata for blocks removed from a worker .
* @ param workerInfo The worker metadata object
* @ param removedBlockIds A list of block ids removed from the worker */
@ GuardedBy ( "workerInfo" ) private void processWorkerRemovedBlocks ( MasterWorkerInfo workerInfo , Collection < Long > removedBlockIds ) { } } | for ( long removedBlockId : removedBlockIds ) { try ( LockResource lr = lockBlock ( removedBlockId ) ) { Optional < BlockMeta > block = mBlockStore . getBlock ( removedBlockId ) ; if ( block . isPresent ( ) ) { LOG . info ( "Block {} is removed on worker {}." , removedBlockId , workerInfo . getId ( ) ) ; mBlockStore . removeLocation ( removedBlockId , workerInfo . getId ( ) ) ; if ( mBlockStore . getLocations ( removedBlockId ) . size ( ) == 0 ) { mLostBlocks . add ( removedBlockId ) ; } } // Remove the block even if its metadata has been deleted already .
workerInfo . removeBlock ( removedBlockId ) ; } } |
public class Utilities { /** * Create the classpath library linked to the bundle with the given name .
* @ param bundle the bundle to point to . Never < code > null < / code > .
* @ param precomputedBundlePath the path to the bundle that is already available . If < code > null < / code > ,
* the path is computed from the bundle with { @ link BundleUtil } .
* @ param javadocURLs the mappings from the bundle to the javadoc URL . It is used for linking the javadoc to the bundle if
* the bundle platform does not know the Javadoc file . If < code > null < / code > , no mapping is defined .
* @ return the classpath entry . */
public static IClasspathEntry newLibraryEntry ( Bundle bundle , IPath precomputedBundlePath , BundleURLMappings javadocURLs ) { } } | assert bundle != null ; final IPath bundlePath ; if ( precomputedBundlePath == null ) { bundlePath = BundleUtil . getBundlePath ( bundle ) ; } else { bundlePath = precomputedBundlePath ; } final IPath sourceBundlePath = BundleUtil . getSourceBundlePath ( bundle , bundlePath ) ; final IPath javadocPath = BundleUtil . getJavadocBundlePath ( bundle , bundlePath ) ; final IClasspathAttribute [ ] extraAttributes ; if ( javadocPath == null ) { if ( javadocURLs != null ) { final String url = javadocURLs . getURLForBundle ( bundle ) ; if ( ! Strings . isNullOrEmpty ( url ) ) { final IClasspathAttribute attr = JavaCore . newClasspathAttribute ( IClasspathAttribute . JAVADOC_LOCATION_ATTRIBUTE_NAME , url ) ; extraAttributes = new IClasspathAttribute [ ] { attr } ; } else { extraAttributes = ClasspathEntry . NO_EXTRA_ATTRIBUTES ; } } else { extraAttributes = ClasspathEntry . NO_EXTRA_ATTRIBUTES ; } } else { final IClasspathAttribute attr = JavaCore . newClasspathAttribute ( IClasspathAttribute . JAVADOC_LOCATION_ATTRIBUTE_NAME , javadocPath . makeAbsolute ( ) . toOSString ( ) ) ; extraAttributes = new IClasspathAttribute [ ] { attr } ; } return JavaCore . newLibraryEntry ( bundlePath , sourceBundlePath , null , null , extraAttributes , false ) ; |
public class XMLSerializer { /** * Write non - negative non - zero long as UTF - 8 bytes .
* @ param mValue
* Value to write
* @ throws IOException
* if can ' t write to string */
private void write ( final long mValue ) throws IOException { } } | final int length = ( int ) Math . log10 ( ( double ) mValue ) ; int digit = 0 ; long remainder = mValue ; for ( int i = length ; i >= 0 ; i -- ) { digit = ( byte ) ( remainder / LONG_POWERS [ i ] ) ; mOut . write ( ( byte ) ( digit + ASCII_OFFSET ) ) ; remainder -= digit * LONG_POWERS [ i ] ; } |
public class WDataTable { /** * Handles a request containing row expansion data .
* @ param request the request containing row expansion data . */
private void handleExpansionRequest ( final Request request ) { } } | String [ ] paramValue = request . getParameterValues ( getId ( ) + ".expanded" ) ; if ( paramValue == null ) { paramValue = new String [ 0 ] ; } String [ ] expandedRows = removeEmptyStrings ( paramValue ) ; List < Integer > oldExpansions = getExpandedRows ( ) ; List < Integer > expansions ; TableDataModel model = getDataModel ( ) ; if ( model . getRowCount ( ) == 0 ) { setExpandedRows ( new ArrayList < Integer > ( ) ) ; return ; } else if ( getPaginationMode ( ) == PaginationMode . NONE || getPaginationMode ( ) == PaginationMode . CLIENT || oldExpansions == null ) { expansions = new ArrayList < > ( expandedRows . length ) ; } else { // row expansions only apply to the current page
expansions = new ArrayList < > ( oldExpansions ) ; int startRow = getCurrentPageStartRow ( ) ; int endRow = getCurrentPageEndRow ( ) ; expansions . removeAll ( getRowIds ( startRow , endRow ) ) ; } for ( String expandedRow : expandedRows ) { try { expansions . add ( Integer . parseInt ( expandedRow ) ) ; } catch ( NumberFormatException e ) { LOG . warn ( "Invalid row id for expansion: " + expandedRow ) ; } } // For tree tables , we also have to tell the nodes to expand themselves
if ( model instanceof TreeTableDataModel ) { TreeTableDataModel treeModel = ( TreeTableDataModel ) model ; // We need the expanded indices sorted , as expanding / collapsing sections alters row indices
Collections . sort ( expansions ) ; for ( int row = 0 ; row < treeModel . getRowCount ( ) ; row ++ ) { for ( Iterator < TreeNode > i = treeModel . getNodeAtLine ( row ) . depthFirst ( ) ; i . hasNext ( ) ; ) { TableTreeNode node = ( TableTreeNode ) i . next ( ) ; node . setExpanded ( false ) ; } } for ( int i = expansions . size ( ) - 1 ; i >= 0 ; i -- ) { treeModel . getNodeAtLine ( expansions . get ( i ) ) . setExpanded ( true ) ; } } setExpandedRows ( expansions ) ; |
public class FunctionWrapper { /** * 得到对象的所有FunctionWrapper , 改对象的所有Public 方法都将注册到Beetl里
* @ param ns
* @ param o
* @ return */
public static List < FunctionWrapper > getFunctionWrapper ( String ns , Class c , Object o ) { } } | ObjectInfo info = ObjectUtil . getObjectInfo ( c ) ; Map < String , List < Method > > map = info . getMap ( ) ; List < FunctionWrapper > fwList = new ArrayList < FunctionWrapper > ( ) ; for ( Entry < String , List < Method > > entry : map . entrySet ( ) ) { if ( entry . getValue ( ) . size ( ) == 1 ) { Method method = entry . getValue ( ) . get ( 0 ) ; FunctionWrapper fw = new SingleFunctionWrapper ( ns . concat ( "." ) . concat ( method . getName ( ) ) , c , o , method ) ; fwList . add ( fw ) ; } else { Method method = entry . getValue ( ) . get ( 0 ) ; String name = method . getName ( ) ; FunctionWrapper fw = new MutipleFunctionWrapper ( ns . concat ( "." ) . concat ( name ) , c , o , entry . getValue ( ) . toArray ( new Method [ 0 ] ) ) ; fwList . add ( fw ) ; } } return fwList ; |
public class OpenIdProviderController { /** * Handle request internal model and view .
* @ param request the request
* @ param response the response
* @ return the model and view */
@ GetMapping ( "/openid/*" ) protected ModelAndView handleRequestInternal ( final HttpServletRequest request , final HttpServletResponse response ) { } } | return new ModelAndView ( "openIdProviderView" , CollectionUtils . wrap ( "openid_server" , casProperties . getServer ( ) . getPrefix ( ) ) ) ; |
public class GeometryUtil { /** * Checks whether line ( x1 , y1 ) - ( x2 , y2 ) and line ( x3 , y3 ) - ( x4 , y4 ) intersect . If lines
* intersect then the result parameters are saved to point array . The size of { @ code point }
* must be at least 2.
* @ return 1 if two lines intersect in the defined interval , otherwise 0. */
public static int intersectLines ( double x1 , double y1 , double x2 , double y2 , double x3 , double y3 , double x4 , double y4 , double [ ] point ) { } } | double A1 = - ( y2 - y1 ) ; double B1 = ( x2 - x1 ) ; double C1 = x1 * y2 - x2 * y1 ; double A2 = - ( y4 - y3 ) ; double B2 = ( x4 - x3 ) ; double C2 = x3 * y4 - x4 * y3 ; double coefParallel = A1 * B2 - A2 * B1 ; // double comparison
if ( x3 == x4 && y3 == y4 && ( A1 * x3 + B1 * y3 + C1 == 0 ) && ( x3 >= Math . min ( x1 , x2 ) ) && ( x3 <= Math . max ( x1 , x2 ) ) && ( y3 >= Math . min ( y1 , y2 ) ) && ( y3 <= Math . max ( y1 , y2 ) ) ) { return 1 ; } if ( Math . abs ( coefParallel ) < EPSILON ) { return 0 ; } point [ 0 ] = ( B1 * C2 - B2 * C1 ) / coefParallel ; point [ 1 ] = ( A2 * C1 - A1 * C2 ) / coefParallel ; if ( point [ 0 ] >= Math . min ( x1 , x2 ) && point [ 0 ] >= Math . min ( x3 , x4 ) && point [ 0 ] <= Math . max ( x1 , x2 ) && point [ 0 ] <= Math . max ( x3 , x4 ) && point [ 1 ] >= Math . min ( y1 , y2 ) && point [ 1 ] >= Math . min ( y3 , y4 ) && point [ 1 ] <= Math . max ( y1 , y2 ) && point [ 1 ] <= Math . max ( y3 , y4 ) ) { return 1 ; } return 0 ; |
public class CompactInterner { /** * Returns either the input , or an instance that equals it that was previously passed to this
* method .
* < p > This operation performs in amortized constant time . */
@ SuppressWarnings ( "unchecked" ) // If a . equals ( b ) then a and b have the same type .
public synchronized < T > T intern ( T value ) { } } | Preconditions . checkNotNull ( value ) ; // Use a pseudo - random number generator to mix up the high and low bits of the hash code .
Random generator = new java . util . Random ( value . hashCode ( ) ) ; int tries = 0 ; while ( true ) { int index = generator . nextInt ( table . length ) ; Object candidate = table [ index ] ; if ( candidate == null ) { // Found a good place to hash it .
count ++ ; collisions += tries ; table [ index ] = value ; rehashIfNeeded ( ) ; return value ; } if ( candidate . equals ( value ) ) { Preconditions . checkArgument ( value . getClass ( ) == candidate . getClass ( ) , "Interned objects are equals() but different classes: %s and %s" , value , candidate ) ; return ( T ) candidate ; } tries ++ ; } |
public class BigtableTableAdminClient { /** * Drops rows by the specified key prefix and tableId asynchronously
* < p > Please note that this method is considered part of the admin API and is rate limited .
* < p > Sample code :
* < pre > { @ code
* ApiFuture < Void > dropFuture = client . dropRowRangeAsync ( " my - table " , ByteString . copyFromUtf8 ( " prefix " ) ) ;
* ApiFutures . addCallback (
* dropFuture ,
* new ApiFutureCallback < Void > ( ) {
* public void onSuccess ( Void tableNames ) {
* System . out . println ( " Successfully dropped row range . " ) ;
* public void onFailure ( Throwable t ) {
* t . printStackTrace ( ) ;
* MoreExecutors . directExecutor ( )
* } < / pre > */
@ SuppressWarnings ( "WeakerAccess" ) public ApiFuture < Void > dropRowRangeAsync ( String tableId , ByteString rowKeyPrefix ) { } } | DropRowRangeRequest request = DropRowRangeRequest . newBuilder ( ) . setName ( getTableName ( tableId ) ) . setRowKeyPrefix ( rowKeyPrefix ) . build ( ) ; return transformToVoid ( this . stub . dropRowRangeCallable ( ) . futureCall ( request ) ) ; |
public class CouchDatabaseBase { /** * Invokes an Update Handler .
* < pre >
* Params params = new Params ( )
* . addParam ( " field " , " foo " )
* . addParam ( " value " , " bar " ) ;
* String output = dbClient . invokeUpdateHandler ( " designDoc / update1 " , " docId " , params ) ;
* < / pre >
* @ param updateHandlerUri The Update Handler URI , in the format : < code > designDoc / update1 < / code >
* @ param docId The document id to update .
* @ param params The query parameters as { @ link Params } .
* @ return The output of the request . */
public String invokeUpdateHandler ( String updateHandlerUri , String docId , Params params ) { } } | assertNotEmpty ( updateHandlerUri , "uri" ) ; final String [ ] v = updateHandlerUri . split ( "/" ) ; final InputStream response ; final URI uri ; DatabaseURIHelper uriHelper = new DatabaseURIHelper ( dbUri ) . path ( "_design" ) . path ( v [ 0 ] ) . path ( "_update" ) . path ( v [ 1 ] ) . query ( params ) ; if ( docId != null && ! docId . isEmpty ( ) ) { // Create PUT request using doc Id
uri = uriHelper . path ( docId ) . build ( ) ; response = couchDbClient . put ( uri ) ; } else { // If no doc Id , create POST request
uri = uriHelper . build ( ) ; response = couchDbClient . post ( uri , null ) ; } return streamToString ( response ) ; |
public class JmsJMSContextImpl { /** * ( non - Javadoc )
* @ see javax . jms . JMSContext # createStreamMessage ( ) */
@ Override public StreamMessage createStreamMessage ( ) throws JMSRuntimeException { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "createStreamMessage" ) ; StreamMessage streamMessage = null ; try { streamMessage = jmsSession . createStreamMessage ( ) ; } catch ( JMSException jmse ) { throw ( JMSRuntimeException ) JmsErrorUtils . getJMS2Exception ( jmse , JMSRuntimeException . class ) ; } finally { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "createStreamMessage" , new Object [ ] { streamMessage } ) ; } return streamMessage ; |
public class JobOperations { /** * Lists the status of { @ link JobPreparationTask } and { @ link JobReleaseTask } tasks for the specified job .
* @ param jobId The ID of the job .
* @ return A list of { @ link JobPreparationAndReleaseTaskExecutionInformation } instances .
* @ throws BatchErrorException Exception thrown when an error response is received from the Batch service .
* @ throws IOException Exception thrown when there is an error in serialization / deserialization of data sent to / received from the Batch service . */
public PagedList < JobPreparationAndReleaseTaskExecutionInformation > listPreparationAndReleaseTaskStatus ( String jobId ) throws BatchErrorException , IOException { } } | return listPreparationAndReleaseTaskStatus ( jobId , null ) ; |
public class RRBudgetV1_0Generator { /** * This method gets Travel cost information including
* DomesticTravelCost , ForeignTravelCost and TotalTravelCost in the
* BudgetYearDataType based on BudgetPeriodInfo for the RRBudget .
* @ param periodInfo
* ( BudgetPeriodInfo ) budget period entry .
* @ return Travel travel cost corresponding to the BudgetPeriodInfo object . */
private Travel getTravel ( BudgetPeriodDto periodInfo ) { } } | Travel travel = Travel . Factory . newInstance ( ) ; if ( periodInfo != null ) { if ( periodInfo . getDomesticTravelCost ( ) != null ) { travel . setDomesticTravelCost ( periodInfo . getDomesticTravelCost ( ) . bigDecimalValue ( ) ) ; } if ( periodInfo . getForeignTravelCost ( ) != null ) { travel . setForeignTravelCost ( periodInfo . getForeignTravelCost ( ) . bigDecimalValue ( ) ) ; } if ( periodInfo . getTotalTravelCost ( ) != null ) { travel . setTotalTravelCost ( periodInfo . getTotalTravelCost ( ) . bigDecimalValue ( ) ) ; } } return travel ; |
public class FileServletWrapper { /** * WebAppServletInvocationEvent evt ) throws IOException , ServletException ; */
public void service ( ServletRequest req , ServletResponse res , WebAppServletInvocationEvent evt ) throws IOException , ServletException { } } | // 569469
if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . entering ( CLASS_NAME , "service " + this . toString ( ) ) ; } // 569469
HttpServletRequest request = ( HttpServletRequest ) req ; HttpServletResponse response = ( HttpServletResponse ) res ; HttpServletRequest httpRequest = null ; IExtendedRequest wasreq = null ; if ( useOriginalRequestState ) { WebContainerRequestState reqStateSaveFilteredRequest = WebContainerRequestState . getInstance ( false ) ; if ( reqStateSaveFilteredRequest != null ) { httpRequest = ( HttpServletRequest ) reqStateSaveFilteredRequest . getAttribute ( "unFilteredRequestObject" ) ; // remove attribute
reqStateSaveFilteredRequest . removeAttribute ( "unFilteredRequestObject" ) ; if ( httpRequest != null ) { wasreq = ( IExtendedRequest ) ServletUtil . unwrapRequest ( httpRequest ) ; } } } // if httpRequest is null then get it from unwrapped
if ( httpRequest == null ) { wasreq = ( IExtendedRequest ) ServletUtil . unwrapRequest ( request ) ; } // IExtendedRequest wasreq = ( IExtendedRequest ) ServletUtil . unwrapRequest ( req ) ;
WebAppDispatcherContext dispatchContext = ( WebAppDispatcherContext ) wasreq . getWebAppDispatcherContext ( ) ; boolean writeResponseBody = true ; // PK55965 Start
boolean notify = notifyInvocationListeners && ( evt != null ) ; long curLastAccessTime = 0 ; long endTime = 0 ; if ( notify ) { evtSource . onServletStartService ( evt ) ; curLastAccessTime = System . currentTimeMillis ( ) ; } // PK55965 End
try { synchronized ( this ) { nServicing ++ ; } boolean isInclude = dispatchContext . isInclude ( ) ; if ( ! isInclude ) { writeResponseBody = setResponseHeaders ( request , response ) ; } if ( writeResponseBody ) { // begin pq65763
// < ! - - move response writing into separate method - - >
writeResponseToClient ( request , response , wasreq ) ; // end pq65763
} // PK55965 Start
if ( notify ) { endTime = System . currentTimeMillis ( ) ; evt . setResponseTime ( endTime - curLastAccessTime ) ; evtSource . onServletFinishService ( evt ) ; } } catch ( Throwable e ) { if ( notify ) { if ( endTime == 0 ) { endTime = System . currentTimeMillis ( ) ; evt . setResponseTime ( endTime - curLastAccessTime ) ; if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "service" , "Notify onServletFinishService : response time " + ( endTime - curLastAccessTime ) + " milliseconds" ) ; } evtSource . onServletFinishService ( evt ) ; } ServletErrorEvent errorEvent = new ServletErrorEvent ( this , getServletContext ( ) , getServletName ( ) , "FileServletWrapper" , e ) ; if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . logp ( Level . FINE , CLASS_NAME , "service" , "Notify onServletServiceError : " + errorEvent . toString ( ) ) ; } evtSource . onServletServiceError ( errorEvent ) ; } throw new ServletException ( e ) ; } finally { synchronized ( this ) { nServicing -- ; } // 569469
if ( com . ibm . ejs . ras . TraceComponent . isAnyTracingEnabled ( ) && logger . isLoggable ( Level . FINE ) ) { logger . exiting ( CLASS_NAME , "service" ) ; } // 569469
} |
public class KerasModelBuilder { /** * Build a KerasModel ( corresponding to ComputationGraph ) from this model builder .
* @ return KerasModel
* @ throws IOException I / O exception
* @ throws InvalidKerasConfigurationException Invalid configuration
* @ throws UnsupportedKerasConfigurationException Unsupported configuration */
public KerasModel buildModel ( ) throws IOException , InvalidKerasConfigurationException , UnsupportedKerasConfigurationException { } } | KerasModel model = new KerasModel ( this ) ; close ( ) ; return model ; |
public class GobblinAWSClusterLauncher { /** * Callback method that deletes { @ link AutoScalingGroup } s
* @ return Callback method that deletes { @ link AutoScalingGroup } s */
private AsyncCallback shutdownASG ( ) { } } | Optional < List < String > > optionalLaunchConfigurationNames = Optional . of ( Arrays . asList ( this . masterLaunchConfigName , this . workerLaunchConfigName ) ) ; Optional < List < String > > optionalAutoScalingGroupNames = Optional . of ( Arrays . asList ( this . masterAutoScalingGroupName , this . workerAutoScalingGroupName ) ) ; return new AWSShutdownHandler ( this . awsSdkClient , optionalLaunchConfigurationNames , optionalAutoScalingGroupNames ) ; |
public class LocalBufferPool { /** * Returns a buffer to the buffer pool and notifies listeners about the availability of a new buffer .
* @ param buffer buffer to return to the buffer pool */
private void recycleBuffer ( MemorySegment buffer ) { } } | synchronized ( this . buffers ) { if ( this . isDestroyed ) { this . globalBufferPool . returnBuffer ( buffer ) ; this . numRequestedBuffers -- ; } else { // if the number of designated buffers changed in the meantime , make sure
// to return the buffer to the global buffer pool
if ( this . numRequestedBuffers > this . numDesignatedBuffers ) { this . globalBufferPool . returnBuffer ( buffer ) ; this . numRequestedBuffers -- ; } else if ( ! this . listeners . isEmpty ( ) ) { Buffer availableBuffer = new Buffer ( buffer , buffer . size ( ) , this . recycler ) ; try { this . listeners . poll ( ) . bufferAvailable ( availableBuffer ) ; } catch ( Exception e ) { this . buffers . add ( buffer ) ; this . buffers . notify ( ) ; } } else { this . buffers . add ( buffer ) ; this . buffers . notify ( ) ; } } } |
public class ColorPicker { /** * Change the color of the center which indicates the new color .
* @ param color int of the color . */
public void setNewCenterColor ( int color ) { } } | mCenterNewColor = color ; mCenterNewPaint . setColor ( color ) ; if ( mCenterOldColor == 0 ) { mCenterOldColor = color ; mCenterOldPaint . setColor ( color ) ; } if ( onColorChangedListener != null && color != oldChangedListenerColor ) { onColorChangedListener . onColorChanged ( color ) ; oldChangedListenerColor = color ; } invalidate ( ) ; |
public class CommerceShippingMethodWrapper { /** * Returns the localized description of this commerce shipping method in the language , optionally using the default language if no localization exists for the requested language .
* @ param languageId the ID of the language
* @ param useDefault whether to use the default language if no localization exists for the requested language
* @ return the localized description of this commerce shipping method */
@ Override public String getDescription ( String languageId , boolean useDefault ) { } } | return _commerceShippingMethod . getDescription ( languageId , useDefault ) ; |
public class SpringPlugin { /** * the initHandlerMethods below we will get an error about already existing mappings */
private void clearMappingRegistry ( Object o , Class < ? > clazz_AbstractHandlerMethodMapping ) { } } | if ( debug ) { System . out . println ( "SPRING_PLUGIN: clearing out mapping registry..." ) ; } Object mappingRegistryInstance = null ; try { Field field_mappingRegistry = clazz_AbstractHandlerMethodMapping . getDeclaredField ( "mappingRegistry" ) ; field_mappingRegistry . setAccessible ( true ) ; mappingRegistryInstance = field_mappingRegistry . get ( o ) ; } catch ( NoSuchFieldException e ) { if ( debug ) { System . out . println ( "SPRING_PLUGIN: Unable to get mappingRegistry field on AbstractHandlerMethodMapping" ) ; } } catch ( IllegalAccessException e ) { if ( GlobalConfiguration . debugplugins || debug ) { System . out . println ( "SPRING_PLUGIN: Problem accessing mappingRegistry field on AbstractHandlerMethodMapping: " ) ; e . printStackTrace ( System . out ) ; } } if ( mappingRegistryInstance == null ) { return ; } Class mappingRegistryClass = mappingRegistryInstance . getClass ( ) ; clearMapField ( mappingRegistryClass , mappingRegistryInstance , "registry" ) ; clearMapField ( mappingRegistryClass , mappingRegistryInstance , "mappingLookup" ) ; clearMapField ( mappingRegistryClass , mappingRegistryInstance , "urlLookup" ) ; clearMapField ( mappingRegistryClass , mappingRegistryInstance , "nameLookup" ) ; clearMapField ( mappingRegistryClass , mappingRegistryInstance , "corsLookup" ) ; if ( debug ) { System . out . println ( "SPRING_PLUGIN: ... cleared out the mapping registry contents" ) ; } |
public class FilePersistedCredentials { /** * Store information from the credential .
* @ param userId user ID whose credential needs to be stored
* @ param credential credential whose { @ link Credential # getAccessToken access token } ,
* { @ link Credential # getRefreshToken refresh token } , and
* { @ link Credential # getExpirationTimeMilliseconds expiration time } need to be stored */
void store ( String userId , Credential credential ) { } } | Preconditions . checkNotNull ( userId ) ; FilePersistedCredential fileCredential = credentials . get ( userId ) ; if ( fileCredential == null ) { fileCredential = new FilePersistedCredential ( ) ; credentials . put ( userId , fileCredential ) ; } fileCredential . store ( credential ) ; |
public class NotificationsApi { /** * CometD disconnect
* CometD disconnect , see https : / / docs . cometd . org / current / reference / # _ bayeux _ meta _ disconnect
* @ return ApiResponse & lt ; Void & gt ;
* @ throws ApiException If fail to call the API , e . g . server error or cannot deserialize the response body */
public ApiResponse < Void > disconnectWithHttpInfo ( ) throws ApiException { } } | com . squareup . okhttp . Call call = disconnectValidateBeforeCall ( null , null ) ; return apiClient . execute ( call ) ; |
public class HelloWorldHttp2Handler { /** * Handles the cleartext HTTP upgrade event . If an upgrade occurred , sends a simple response via HTTP / 2
* on stream 1 ( the stream specifically reserved for cleartext HTTP upgrade ) . */
@ Override public void userEventTriggered ( ChannelHandlerContext ctx , Object evt ) throws Exception { } } | if ( evt instanceof HttpServerUpgradeHandler . UpgradeEvent ) { HttpServerUpgradeHandler . UpgradeEvent upgradeEvent = ( HttpServerUpgradeHandler . UpgradeEvent ) evt ; onHeadersRead ( ctx , 1 , http1HeadersToHttp2Headers ( upgradeEvent . upgradeRequest ( ) ) , 0 , true ) ; } super . userEventTriggered ( ctx , evt ) ; |
public class DefaultGroovyMethods { /** * Integer Divide two Numbers .
* @ param left a Number
* @ param right another Number
* @ return a Number ( an Integer ) resulting from the integer division operation
* @ since 1.0 */
public static Number intdiv ( Number left , Number right ) { } } | return NumberMath . intdiv ( left , right ) ; |
public class JsonHash { /** * Retrieves the corresponding value of the given key as integer . < br >
* If it is neither { @ code null } nor a { @ link Long } , { @ link IllegalStateException } will be thrown .
* @ param key
* @ return The value
* @ throws IllegalStateException The given index points neither { @ code null } nor a { @ link Long } .
* @ author vvakame */
public Long getLongOrNull ( String key ) throws IllegalStateException { } } | Type type = stateMap . get ( key ) ; if ( type == null ) { return null ; } switch ( type ) { case NULL : return null ; case LONG : Object obj = get ( key ) ; if ( obj instanceof Integer ) { return ( long ) ( Integer ) obj ; } else if ( obj instanceof Long ) { return ( Long ) obj ; } else if ( obj instanceof Byte ) { return ( long ) ( Byte ) obj ; } else if ( obj instanceof Short ) { return ( long ) ( Short ) obj ; } else { throw new IllegalStateException ( "unexpected class. class=" + obj . getClass ( ) . getCanonicalName ( ) ) ; } default : throw new IllegalStateException ( "unexpected token. token=" + type ) ; } |
public class Version { /** * Gets the pre release identifier parts of this version as array . Modifying the
* resulting array will have no influence on the internal state of this object .
* @ return Pre release version as array . Array is empty if this version has no pre
* release part . */
public String [ ] getPreReleaseParts ( ) { } } | if ( this . preReleaseParts . length == 0 ) { return EMPTY_ARRAY ; } return Arrays . copyOf ( this . preReleaseParts , this . preReleaseParts . length ) ; |
public class DockerVolumeConfigurationMarshaller { /** * Marshall the given parameter object . */
public void marshall ( DockerVolumeConfiguration dockerVolumeConfiguration , ProtocolMarshaller protocolMarshaller ) { } } | if ( dockerVolumeConfiguration == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( dockerVolumeConfiguration . getScope ( ) , SCOPE_BINDING ) ; protocolMarshaller . marshall ( dockerVolumeConfiguration . getAutoprovision ( ) , AUTOPROVISION_BINDING ) ; protocolMarshaller . marshall ( dockerVolumeConfiguration . getDriver ( ) , DRIVER_BINDING ) ; protocolMarshaller . marshall ( dockerVolumeConfiguration . getDriverOpts ( ) , DRIVEROPTS_BINDING ) ; protocolMarshaller . marshall ( dockerVolumeConfiguration . getLabels ( ) , LABELS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class Envelope { /** * Sets the boolean values corresponding to the flag value
* XM - Version
* @ since 19.06.2006
* @ param flag */
public void setXMType ( int flag ) { } } | on = ( flag & 0x01 ) != 0 ; sustain = ( flag & 0x02 ) != 0 ; loop = ( flag & 0x04 ) != 0 ; carry = filter = false ; |
public class LinkedWorkspaceStorageCacheImpl { /** * Put item in cache C .
* @ param data */
protected void putItem ( final ItemData data ) { } } | cache . put ( new CacheId ( data . getIdentifier ( ) ) , new CacheValue ( data , System . currentTimeMillis ( ) + liveTime ) ) ; cache . put ( new CacheQPath ( data . getParentIdentifier ( ) , data . getQPath ( ) , ItemType . getItemType ( data ) ) , new CacheValue ( data , System . currentTimeMillis ( ) + liveTime ) ) ; |
public class MemcachedClient { /** * Get the given key to reset its expiration time .
* @ param key the key to fetch
* @ param exp the new expiration to set for the given key
* @ return a future that will hold the return value of the fetch
* @ throws IllegalStateException in the rare circumstance where queue is too
* full to accept any more requests */
@ Override public OperationFuture < CASValue < Object > > asyncGetAndTouch ( final String key , final int exp ) { } } | return asyncGetAndTouch ( key , exp , transcoder ) ; |
public class DatabaseTaskStore { /** * Appends conditions to a JPA query to filter based on the presence or absence of the specified state .
* This method optimizes to avoid the MOD function if possible .
* @ param sb string builder for the query
* @ param state a task state . For example , TaskState . CANCELED
* @ param inState indicates whether to include or exclude results with the specified state
* @ return map of parameters and values that must be set on the query . */
@ Trivial private final Map < String , Object > appendStateComparison ( StringBuilder sb , TaskState state , boolean inState ) { } } | Map < String , Object > params = new HashMap < String , Object > ( ) ; switch ( state ) { case SCHEDULED : sb . append ( "t.STATES" ) . append ( inState ? "<" : ">=" ) . append ( ":s" ) ; params . put ( "s" , TaskState . SUSPENDED . bit ) ; break ; case SUSPENDED : sb . append ( inState ? "t.STATES>=:s1 AND t.STATES<:s2" : "(t.STATES<:s1 OR t.STATES>=:s2)" ) ; params . put ( "s1" , TaskState . SUSPENDED . bit ) ; params . put ( "s2" , TaskState . ENDED . bit ) ; break ; case ENDED : case CANCELED : sb . append ( "t.STATES" ) . append ( inState ? ">=" : "<" ) . append ( ":s" ) ; params . put ( "s" , state . bit ) ; break ; case SUCCESSFUL : sb . append ( inState ? "t.STATES>=:s1 AND t.STATES<:s2" : "(t.STATES<:s1 OR t.STATES>=:s2)" ) ; params . put ( "s1" , TaskState . SUCCESSFUL . bit ) ; params . put ( "s2" , TaskState . FAILURE_LIMIT_REACHED . bit ) ; break ; case FAILURE_LIMIT_REACHED : sb . append ( inState ? "t.STATES>=:s1 AND t.STATES<:s2" : "(t.STATES<:s1 OR t.STATES>=:s2)" ) ; params . put ( "s1" , TaskState . FAILURE_LIMIT_REACHED . bit ) ; params . put ( "s2" , TaskState . CANCELED . bit ) ; break ; default : sb . append ( "MOD(t.STATES,:s*2)" ) . append ( inState ? ">=" : "<" ) . append ( ":s" ) ; params . put ( "s" , state . bit ) ; } return params ; |
public class ProfileServiceClient { /** * Deletes the specified profile . Prerequisite : The profile has no associated applications or
* assignments associated .
* < p > Sample code :
* < pre > < code >
* try ( ProfileServiceClient profileServiceClient = ProfileServiceClient . create ( ) ) {
* ProfileName name = ProfileName . of ( " [ PROJECT ] " , " [ TENANT ] " , " [ PROFILE ] " ) ;
* profileServiceClient . deleteProfile ( name . toString ( ) ) ;
* < / code > < / pre >
* @ param name Required .
* < p > Resource name of the profile to be deleted .
* < p > The format is " projects / { project _ id } / tenants / { tenant _ id } / profiles / { profile _ id } " , for
* example , " projects / api - test - project / tenants / foo / profiles / bar " .
* @ throws com . google . api . gax . rpc . ApiException if the remote call fails */
public final void deleteProfile ( String name ) { } } | DeleteProfileRequest request = DeleteProfileRequest . newBuilder ( ) . setName ( name ) . build ( ) ; deleteProfile ( request ) ; |
public class MultiRowIterator { /** * OR if that row does not exist , it is the last row prior to it */
private int compareToLastRow ( int depth ) { } } | for ( int i = 0 ; i <= depth ; i ++ ) { int p = currentRow [ i ] , l = lastRow [ i ] , r = clusteringComponents [ i ] . size ( ) ; if ( ( p == l ) | ( r == 1 ) ) continue ; return p - l ; } return 0 ; |
public class SoundStore { /** * Initialise the sound effects stored . This must be called
* before anything else will work */
public void init ( ) { } } | if ( inited ) { return ; } Log . info ( "Initialising sounds.." ) ; inited = true ; AccessController . doPrivileged ( new PrivilegedAction ( ) { public Object run ( ) { try { AL . create ( ) ; soundWorks = true ; sounds = true ; music = true ; Log . info ( "- Sound works" ) ; } catch ( Exception e ) { Log . error ( "Sound initialisation failure." ) ; Log . error ( e ) ; soundWorks = false ; sounds = false ; music = false ; } return null ; } } ) ; if ( soundWorks ) { sourceCount = 0 ; sources = BufferUtils . createIntBuffer ( maxSources ) ; while ( AL10 . alGetError ( ) == AL10 . AL_NO_ERROR ) { IntBuffer temp = BufferUtils . createIntBuffer ( 1 ) ; try { AL10 . alGenSources ( temp ) ; if ( AL10 . alGetError ( ) == AL10 . AL_NO_ERROR ) { sourceCount ++ ; sources . put ( temp . get ( 0 ) ) ; if ( sourceCount > maxSources - 1 ) { break ; } } } catch ( OpenALException e ) { // expected at the end
break ; } } Log . info ( "- " + sourceCount + " OpenAL source available" ) ; if ( AL10 . alGetError ( ) != AL10 . AL_NO_ERROR ) { sounds = false ; music = false ; soundWorks = false ; Log . error ( "- AL init failed" ) ; } else { FloatBuffer listenerOri = BufferUtils . createFloatBuffer ( 6 ) . put ( new float [ ] { 0.0f , 0.0f , - 1.0f , 0.0f , 1.0f , 0.0f } ) ; FloatBuffer listenerVel = BufferUtils . createFloatBuffer ( 3 ) . put ( new float [ ] { 0.0f , 0.0f , 0.0f } ) ; FloatBuffer listenerPos = BufferUtils . createFloatBuffer ( 3 ) . put ( new float [ ] { 0.0f , 0.0f , 0.0f } ) ; listenerPos . flip ( ) ; listenerVel . flip ( ) ; listenerOri . flip ( ) ; AL10 . alListener ( AL10 . AL_POSITION , listenerPos ) ; AL10 . alListener ( AL10 . AL_VELOCITY , listenerVel ) ; AL10 . alListener ( AL10 . AL_ORIENTATION , listenerOri ) ; Log . info ( "- Sounds source generated" ) ; } } |
public class ToolProvider { /** * Get an instance of a system tool using the service loader .
* @ implNote By default , this returns the implementation in the specified module .
* For limited backward compatibility , if this code is run on an older version
* of the Java platform that does not support modules , this method will
* try and create an instance of the named class . Note that implies the
* class must be available on the system class path .
* @ param < T > the interface of the tool
* @ param clazz the interface of the tool
* @ param moduleName the name of the module containing the desired implementation
* @ param className the class name of the desired implementation
* @ return the specified implementation of the tool */
private static < T > T getSystemTool ( Class < T > clazz , String moduleName , String className ) { } } | if ( useLegacy ) { try { return Class . forName ( className , true , ClassLoader . getSystemClassLoader ( ) ) . asSubclass ( clazz ) . getConstructor ( ) . newInstance ( ) ; } catch ( ReflectiveOperationException e ) { throw new Error ( e ) ; } } try { ServiceLoader < T > sl = ServiceLoader . load ( clazz , ClassLoader . getSystemClassLoader ( ) ) ; for ( Iterator < T > iter = sl . iterator ( ) ; iter . hasNext ( ) ; ) { T tool = iter . next ( ) ; if ( matches ( tool , moduleName ) ) return tool ; } } catch ( ServiceConfigurationError e ) { throw new Error ( e ) ; } return null ; |
public class ZonedDateTime { /** * Returns a copy of this { @ code ZonedDateTime } with the specified number of weeks subtracted .
* This operates on the local time - line ,
* { @ link LocalDateTime # minusWeeks ( long ) subtracting weeks } to the local date - time .
* This is then converted back to a { @ code ZonedDateTime } , using the zone ID
* to obtain the offset .
* When converting back to { @ code ZonedDateTime } , if the local date - time is in an overlap ,
* then the offset will be retained if possible , otherwise the earlier offset will be used .
* If in a gap , the local date - time will be adjusted forward by the length of the gap .
* This instance is immutable and unaffected by this method call .
* @ param weeks the weeks to subtract , may be negative
* @ return a { @ code ZonedDateTime } based on this date - time with the weeks subtracted , not null
* @ throws DateTimeException if the result exceeds the supported date range */
public ZonedDateTime minusWeeks ( long weeks ) { } } | return ( weeks == Long . MIN_VALUE ? plusWeeks ( Long . MAX_VALUE ) . plusWeeks ( 1 ) : plusWeeks ( - weeks ) ) ; |
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public EClass getIfcElectricCapacitanceMeasure ( ) { } } | if ( ifcElectricCapacitanceMeasureEClass == null ) { ifcElectricCapacitanceMeasureEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 669 ) ; } return ifcElectricCapacitanceMeasureEClass ; |
public class DistributedLayoutManager { /** * Compares the new folder description object with the old folder description object to
* determine what items were changed and if those changes are allowed . Once all changes are
* verified as being allowed changes then they are pushed into both the ILF and the PLF as
* appropriate . No changes are made until we determine that all changes are allowed .
* @ param nodeId
* @ param newFolderDesc
* @ param oldFolderDesc
* @ throws PortalException */
private void updateFolderNode ( String nodeId , IUserLayoutFolderDescription newFolderDesc , IUserLayoutFolderDescription oldFolderDesc ) throws PortalException { } } | Element ilfNode = ( Element ) getUserLayoutDOM ( ) . getElementById ( nodeId ) ; List < ILayoutProcessingAction > pendingActions = new ArrayList < ILayoutProcessingAction > ( ) ; /* * see what structure attributes changed if any and see if allowed .
* CHANNEL ATTRIBUTES that currently can be EDITED in DLM are :
* name - in both fragments and regular layouts
* dlm : moveAllowed - only on fragments
* dlm : editAllowed - only on fragments
* dlm : deleteAllowed - only on fragments
* dlm : addChildAllowed - only on fragments */
// ATT : DLM Restrictions
if ( isFragmentOwner && ( newFolderDesc . isDeleteAllowed ( ) != oldFolderDesc . isDeleteAllowed ( ) || newFolderDesc . isEditAllowed ( ) != oldFolderDesc . isEditAllowed ( ) || newFolderDesc . isAddChildAllowed ( ) != oldFolderDesc . isAddChildAllowed ( ) || newFolderDesc . isMoveAllowed ( ) != oldFolderDesc . isMoveAllowed ( ) ) ) { pendingActions . add ( new LPAEditRestriction ( owner , ilfNode , newFolderDesc . isMoveAllowed ( ) , newFolderDesc . isDeleteAllowed ( ) , newFolderDesc . isEditAllowed ( ) , newFolderDesc . isAddChildAllowed ( ) ) ) ; } // ATT : Name
updateNodeAttribute ( ilfNode , nodeId , Constants . ATT_NAME , newFolderDesc . getName ( ) , oldFolderDesc . getName ( ) , pendingActions ) ; /* * if we make it to this point then all edits made are allowed so
* process the actions to push the edits into the layout */
for ( Iterator itr = pendingActions . iterator ( ) ; itr . hasNext ( ) ; ) { ILayoutProcessingAction action = ( ILayoutProcessingAction ) itr . next ( ) ; action . perform ( ) ; } |
public class FieldCriteria { /** * static FieldCriteria buildGreaterCriteria ( Object anAttribute , Object aValue , String anAlias ) */
static FieldCriteria buildGreaterCriteria ( Object anAttribute , Object aValue , UserAlias anAlias ) { } } | return new FieldCriteria ( anAttribute , aValue , GREATER , anAlias ) ; |
public class ExampleResourceLocator { /** * Locate the groovy - all - n . n . n . jar file on the classpath .
* The ScriptModuleLoader will attempt to load the scripting runtimes into their own classloaders .
* To accomplish this , the loader requires the actual file location of the groovy runtime jar .
* This method is an example of a strategy for locating the groovy jar file in a programmatic way .
* This strategy assumes that the classloader of this example application has the
* script runtime somewhere in it ' s classpath .
* This is not necessarily true of all applications , depending on disposition of the deployed application artifacts .
* It further assumes that the groovy runtime contains the file " groovy - release - info . properties "
* which was true of the time of groovy - all - 2.1.6 . jar */
public static Path getGroovyRuntime ( ) { } } | Path path = ClassPathUtils . findRootPathForResource ( "META-INF/groovy-release-info.properties" , ExampleResourceLocator . class . getClassLoader ( ) ) ; if ( path == null ) { throw new IllegalStateException ( "couldn't find groovy-all.n.n.n.jar in the classpath." ) ; } return path ; |
public class BatchModifyParser { /** * Write a log of what happened when a directive fails .
* @ param sourcePID
* - The PID of the object being processed .
* @ param directive
* - The name of the directive being processed .
* @ param e
* - The Exception that was thrown .
* @ param msg
* - A message providing additional info if no Exception was thrown . */
private static void logFailedDirective ( String sourcePID , String directive , Exception e , String msg ) { } } | out . println ( " <failed directive=\"" + directive + "\" sourcePID=\"" + sourcePID + "\">" ) ; if ( e != null ) { String message = e . getMessage ( ) ; if ( message == null ) { message = e . getClass ( ) . getName ( ) ; } out . println ( " " + StreamUtility . enc ( message ) ) ; } else { out . println ( " " + StreamUtility . enc ( msg ) ) ; } out . println ( " </failed>" ) ; |
public class MBeanRoutedNotificationHelper { /** * Null - safe event posting to eventAdminRef .
* @ param event */
private void safePostEvent ( Event event ) { } } | EventAdmin ea = eventAdminRef . getService ( ) ; if ( ea != null ) { ea . postEvent ( event ) ; } else if ( tc . isEventEnabled ( ) ) { Tr . event ( tc , "The EventAdmin service is unavailable. Unable to post the Event: " + event ) ; } |
public class Geometry { /** * This will build a PathPartList of lines and arcs from the Point2DArray .
* The radius is the size of the arc for the line joins .
* For each join the radius is capped at 1/2 the length of the smallest line in the three points
* Collinear points are detected and handled as a straight line
* If p0 and plast are the same it will close of the shape with an arc .
* If p0 and plast are not the same , they will be left as lines starting at p0
* and ending at plast .
* For convention p0 , p2 and p4 are used for the three points in the line .
* p1 and p2 refer to the calculated arc offsets for the new start and end points of the two lines .
* For maths see Example 1 http : / / www . rasmus . is / uk / t / F / Su55k02 . htm
* @ param list
* @ param points
* @ param radius */
public static final void drawArcJoinedLines ( final PathPartList list , final Point2DArray points , final double radius ) { } } | final int size = points . size ( ) ; Point2D p0 = points . get ( 0 ) ; Point2D p2 = points . get ( 1 ) ; Point2D p0new = null ; Point2D plast = points . get ( size - 1 ) ; final Point2D plastmin1 = points . get ( size - 2 ) ; double closingRadius = 0 ; // check if start and finish have same point ( i . e . is the line closed )
boolean closed = false ; if ( ( p0 . getX ( ) == plast . getX ( ) ) && ( p0 . getY ( ) == plast . getY ( ) ) ) { closed = true ; } if ( closed && ( false == Geometry . collinear ( plastmin1 , p0 , p2 ) ) ) { p0new = new Point2D ( 0 , 0 ) ; plast = new Point2D ( 0 , 0 ) ; closingRadius = closingArc ( list , plastmin1 , p0 , p2 , plast , p0new , radius ) ; } for ( int i = 2 ; i < size ; i ++ ) { final Point2D p4 = points . get ( i ) ; if ( Geometry . collinear ( p0 , p2 , p4 ) ) { list . L ( p2 . getX ( ) , p2 . getY ( ) ) ; } else { drawLines ( list , p0 , p2 , p4 , radius ) ; } p0 = p2 ; p2 = p4 ; } list . L ( plast . getX ( ) , plast . getY ( ) ) ; if ( p0new != null ) { p0 = points . get ( 0 ) ; list . A ( p0 . getX ( ) , p0 . getY ( ) , p0new . getX ( ) , p0new . getY ( ) , closingRadius ) ; list . Z ( ) ; } |
public class Store { /** * Method to get a instance of the resource .
* @ param _ instance instance the resource is wanted for
* @ return Resource
* @ throws EFapsException on error */
public Resource getResource ( final Instance _instance ) throws EFapsException { } } | Resource ret = null ; try { Store . LOG . debug ( "Getting resource for: {} with properties: {}" , this . resource , this . resourceProperties ) ; ret = ( Resource ) Class . forName ( this . resource ) . newInstance ( ) ; ret . initialize ( _instance , this ) ; } catch ( final InstantiationException e ) { throw new EFapsException ( Store . class , "getResource.InstantiationException" , e , this . resource ) ; } catch ( final IllegalAccessException e ) { throw new EFapsException ( Store . class , "getResource.IllegalAccessException" , e , this . resource ) ; } catch ( final ClassNotFoundException e ) { throw new EFapsException ( Store . class , "getResource.ClassNotFoundException" , e , this . resource ) ; } return ret ; |
public class AbstractBundleLinkRenderer { /** * Renders the bundle links for the bundle dependencies
* @ param requestedPath
* the request path
* @ param ctx
* the context
* @ param out
* the writer
* @ param debugOn
* the debug flag
* @ param dependencies
* the dependencies
* @ throws IOException
* if an IOException occurs . */
private void renderBundleDependenciesLinks ( String requestedPath , BundleRendererContext ctx , Writer out , boolean debugOn , List < JoinableResourceBundle > dependencies ) throws IOException { } } | if ( dependencies != null && ! dependencies . isEmpty ( ) ) { for ( JoinableResourceBundle dependencyBundle : dependencies ) { if ( debugOn ) { addComment ( "Start adding dependency '" + dependencyBundle . getId ( ) + "'" , out ) ; } renderBundleLinks ( dependencyBundle , requestedPath , ctx , out , debugOn , false ) ; if ( debugOn ) { addComment ( "Finished adding dependency '" + dependencyBundle . getId ( ) + "'" , out ) ; } } } |
public class TreeWriter { /** * Add the links to all the package tree files .
* @ param contentTree the content tree to which the links will be added */
protected void addPackageTreeLinks ( Content contentTree ) { } } | // Do nothing if only unnamed package is used
if ( packages . length == 1 && packages [ 0 ] . name ( ) . length ( ) == 0 ) { return ; } if ( ! classesonly ) { Content span = HtmlTree . SPAN ( HtmlStyle . packageHierarchyLabel , getResource ( "doclet.Package_Hierarchies" ) ) ; contentTree . addContent ( span ) ; HtmlTree ul = new HtmlTree ( HtmlTag . UL ) ; ul . addStyle ( HtmlStyle . horizontal ) ; for ( int i = 0 ; i < packages . length ; i ++ ) { // If the package name length is 0 or if - nodeprecated option
// is set and the package is marked as deprecated , do not include
// the page in the list of package hierarchies .
if ( packages [ i ] . name ( ) . length ( ) == 0 || ( configuration . nodeprecated && Util . isDeprecated ( packages [ i ] ) ) ) { continue ; } DocPath link = pathString ( packages [ i ] , DocPaths . PACKAGE_TREE ) ; Content li = HtmlTree . LI ( getHyperLink ( link , new StringContent ( packages [ i ] . name ( ) ) ) ) ; if ( i < packages . length - 1 ) { li . addContent ( ", " ) ; } ul . addContent ( li ) ; } contentTree . addContent ( ul ) ; } |
public class PolicyStatesInner { /** * Queries policy states for the resources under the subscription .
* @ param policyStatesResource The virtual resource under PolicyStates resource type . In a given time range , ' latest ' represents the latest policy state ( s ) , whereas ' default ' represents all policy state ( s ) . Possible values include : ' default ' , ' latest '
* @ param subscriptionId Microsoft Azure subscription ID .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ throws QueryFailureException thrown if the request is rejected by server
* @ throws RuntimeException all other wrapped checked exceptions if the request fails to be sent
* @ return the PolicyStatesQueryResultsInner object if successful . */
public PolicyStatesQueryResultsInner listQueryResultsForSubscription ( PolicyStatesResource policyStatesResource , String subscriptionId ) { } } | return listQueryResultsForSubscriptionWithServiceResponseAsync ( policyStatesResource , subscriptionId ) . toBlocking ( ) . single ( ) . body ( ) ; |
public class SessionData { /** * Perform crossover checking */
private void crossoverCheck ( String method ) { } } | if ( _sessCtx . _smc . isDebugSessionCrossover ( ) ) { if ( _sessCtx . crossoverCheck ( this ) ) { Object parms [ ] = new Object [ ] { appName , getId ( ) , method , _sessCtx . getCurrentSessionId ( ) } ; // Needed to create a LogRecord so we could have parameters and a
// throwable in the same log
LoggingUtil . logParamsAndException ( LoggingUtil . SESSION_LOGGER_CORE , Level . SEVERE , methodClassName , "crossoverCheck" , "SessionContext.CrossoverOnReference" , parms , new SessionCrossoverStackTrace ( ) ) ; } } |
public class ResourceManagerRuntimeServicesConfiguration { /** * - - - - - Static methods - - - - - */
public static ResourceManagerRuntimeServicesConfiguration fromConfiguration ( Configuration configuration ) throws ConfigurationException { } } | final String strJobTimeout = configuration . getString ( ResourceManagerOptions . JOB_TIMEOUT ) ; final Time jobTimeout ; try { jobTimeout = Time . milliseconds ( Duration . apply ( strJobTimeout ) . toMillis ( ) ) ; } catch ( NumberFormatException e ) { throw new ConfigurationException ( "Could not parse the resource manager's job timeout " + "value " + ResourceManagerOptions . JOB_TIMEOUT + '.' , e ) ; } final SlotManagerConfiguration slotManagerConfiguration = SlotManagerConfiguration . fromConfiguration ( configuration ) ; return new ResourceManagerRuntimeServicesConfiguration ( jobTimeout , slotManagerConfiguration ) ; |
public class CmsUsersAllOrgUnitsList { /** * Gets the search parameters . < p >
* @ return the search parameters
* @ throws CmsException if something goes wrong */
protected CmsUserSearchParameters getSearchParams ( ) throws CmsException { } } | CmsListState state = getListState ( ) ; List < CmsOrganizationalUnit > ous = OpenCms . getRoleManager ( ) . getManageableOrgUnits ( getCms ( ) , "" , true , false ) ; CmsUserSearchParameters params = new CmsUserSearchParameters ( ) ; params . setAllowedOus ( ous ) ; String searchFilter = state . getFilter ( ) ; params . addSearch ( SearchKey . email ) ; params . addSearch ( SearchKey . orgUnit ) ; params . setSearchFilter ( searchFilter ) ; params . setFilterCore ( true ) ; params . setPaging ( getList ( ) . getMaxItemsPerPage ( ) , state . getPage ( ) ) ; params . setSorting ( getSortKey ( state . getColumn ( ) ) , state . getOrder ( ) . equals ( CmsListOrderEnum . ORDER_ASCENDING ) ) ; return params ; |
public class SerializerMessages_pt_BR { /** * The lookup table for error messages . */
public Object [ ] [ ] getContents ( ) { } } | Object [ ] [ ] contents = new Object [ ] [ ] { { MsgKey . BAD_MSGKEY , "A chave de mensagem ''{0}'' n\u00e3o est\u00e1 na classe de mensagem ''{1}''" } , { MsgKey . BAD_MSGFORMAT , "O formato da mensagem ''{0}'' na classe de mensagem ''{1}'' falhou." } , { MsgKey . ER_SERIALIZER_NOT_CONTENTHANDLER , "A classe de serializador ''{0}'' n\u00e3o implementa org.xml.sax.ContentHandler." } , { MsgKey . ER_RESOURCE_COULD_NOT_FIND , "O recurso [ {0} ] n\u00e3o p\u00f4de ser encontrado.\n{1}" } , { MsgKey . ER_RESOURCE_COULD_NOT_LOAD , "O recurso [ {0} ] n\u00e3o p\u00f4de carregar: {1} \n {2} \t {3}" } , { MsgKey . ER_BUFFER_SIZE_LESSTHAN_ZERO , "Tamanho do buffer <=0" } , { MsgKey . ER_INVALID_UTF16_SURROGATE , "Detectado substituto UTF-16 inv\u00e1lido: {0} ?" } , { MsgKey . ER_OIERROR , "Erro de E/S" } , { MsgKey . ER_ILLEGAL_ATTRIBUTE_POSITION , "Imposs\u00edvel incluir atributo {0} depois de n\u00f3s filhos ou antes da gera\u00e7\u00e3o de um elemento. O atributo ser\u00e1 ignorado." } , /* * Note to translators : The stylesheet contained a reference to a
* namespace prefix that was undefined . The value of the substitution
* text is the name of the prefix . */
{ MsgKey . ER_NAMESPACE_PREFIX , "O espa\u00e7o de nomes do prefixo ''{0}'' n\u00e3o foi declarado. " } , /* * Note to translators : This message is reported if the stylesheet
* being processed attempted to construct an XML document with an
* attribute in a place other than on an element . The substitution text
* specifies the name of the attribute . */
{ MsgKey . ER_STRAY_ATTRIBUTE , "Atributo ''{0}'' fora do elemento. " } , /* * Note to translators : As with the preceding message , a namespace
* declaration has the form of an attribute and is only permitted to
* appear on an element . The substitution text { 0 } is the namespace
* prefix and { 1 } is the URI that was being used in the erroneous
* namespace declaration . */
{ MsgKey . ER_STRAY_NAMESPACE , "Declara\u00e7\u00e3o de espa\u00e7o de nomes ''{0}''=''{1}'' fora do elemento. " } , { MsgKey . ER_COULD_NOT_LOAD_RESOURCE , "N\u00e3o foi poss\u00edvel carregar ''{0}'' (verifique CLASSPATH) agora , utilizando somente os padr\u00f5es" } , { MsgKey . ER_ILLEGAL_CHARACTER , "Tentativa de processar o caractere de um valor integral {0} que n\u00e3o \u00e9 representado na codifica\u00e7\u00e3o de sa\u00edda especificada de {1}." } , { MsgKey . ER_COULD_NOT_LOAD_METHOD_PROPERTY , "N\u00e3o foi poss\u00edvel carregar o arquivo de propriedade ''{0}'' para o m\u00e9todo de sa\u00edda ''{1}'' (verifique CLASSPATH)" } , { MsgKey . ER_INVALID_PORT , "N\u00famero de porta inv\u00e1lido" } , { MsgKey . ER_PORT_WHEN_HOST_NULL , "A porta n\u00e3o pode ser definida quando o host \u00e9 nulo" } , { MsgKey . ER_HOST_ADDRESS_NOT_WELLFORMED , "O host n\u00e3o \u00e9 um endere\u00e7o formado corretamente" } , { MsgKey . ER_SCHEME_NOT_CONFORMANT , "O esquema n\u00e3o est\u00e1 em conformidade." } , { MsgKey . ER_SCHEME_FROM_NULL_STRING , "Imposs\u00edvel definir esquema a partir da cadeia nula" } , { MsgKey . ER_PATH_CONTAINS_INVALID_ESCAPE_SEQUENCE , "O caminho cont\u00e9m seq\u00fc\u00eancia de escape inv\u00e1lida" } , { MsgKey . ER_PATH_INVALID_CHAR , "O caminho cont\u00e9m caractere inv\u00e1lido: {0}" } , { MsgKey . ER_FRAG_INVALID_CHAR , "O fragmento cont\u00e9m caractere inv\u00e1lido" } , { MsgKey . ER_FRAG_WHEN_PATH_NULL , "O fragmento n\u00e3o pode ser definido quando o caminho \u00e9 nulo" } , { MsgKey . ER_FRAG_FOR_GENERIC_URI , "O fragmento s\u00f3 pode ser definido para um URI gen\u00e9rico" } , { MsgKey . ER_NO_SCHEME_IN_URI , "Nenhum esquema encontrado no URI" } , { MsgKey . ER_CANNOT_INIT_URI_EMPTY_PARMS , "Imposs\u00edvel inicializar URI com par\u00e2metros vazios" } , { MsgKey . ER_NO_FRAGMENT_STRING_IN_PATH , "O fragmento n\u00e3o pode ser especificado no caminho e fragmento" } , { MsgKey . ER_NO_QUERY_STRING_IN_PATH , "A cadeia de consulta n\u00e3o pode ser especificada na cadeia de consulta e caminho" } , { MsgKey . ER_NO_PORT_IF_NO_HOST , "Port n\u00e3o pode ser especificado se host n\u00e3o for especificado" } , { MsgKey . ER_NO_USERINFO_IF_NO_HOST , "Userinfo n\u00e3o pode ser especificado se host n\u00e3o for especificado" } , { MsgKey . ER_XML_VERSION_NOT_SUPPORTED , "Aviso: A vers\u00e3o do documento de sa\u00edda precisa ser ''{0}''. Essa vers\u00e3o do XML n\u00e3o \u00e9 suportada. A vers\u00e3o do documento de sa\u00edda ser\u00e1 ''1.0''." } , { MsgKey . ER_SCHEME_REQUIRED , "O esquema \u00e9 obrigat\u00f3rio!" } , /* * Note to translators : The words ' Properties ' and
* ' SerializerFactory ' in this message are Java class names
* and should not be translated . */
{ MsgKey . ER_FACTORY_PROPERTY_MISSING , "O objeto Properties transmitido para SerializerFactory n\u00e3o tem uma propriedade ''{0}''." } , { MsgKey . ER_ENCODING_NOT_SUPPORTED , "Aviso: A codifica\u00e7\u00e3o ''{0}'' n\u00e3o \u00e9 suportada pelo Java Runtime." } , { MsgKey . ER_FEATURE_NOT_FOUND , "O par\u00e2metro ''{0}'' n\u00e3o \u00e9 reconhecido." } , { MsgKey . ER_FEATURE_NOT_SUPPORTED , "O par\u00e2metro ''{0}'' \u00e9 reconhecido, mas o valor pedido n\u00e3o pode ser definido. " } , { MsgKey . ER_STRING_TOO_LONG , "A cadeia resultante \u00e9 muito longa para caber em uma DOMString: ''{0}''. " } , { MsgKey . ER_TYPE_MISMATCH_ERR , "O tipo de valor para este nome de par\u00e2metro \u00e9 incompat\u00edvel com o tipo de valor esperado. " } , { MsgKey . ER_NO_OUTPUT_SPECIFIED , "O destino de sa\u00edda para os dados a serem gravados era nulo. " } , { MsgKey . ER_UNSUPPORTED_ENCODING , "Uma codifica\u00e7\u00e3o n\u00e3o suportada foi encontrada. " } , { MsgKey . ER_UNABLE_TO_SERIALIZE_NODE , "O n\u00f3 n\u00e3o p\u00f4de ser serializado." } , { MsgKey . ER_CDATA_SECTIONS_SPLIT , "A Se\u00e7\u00e3o CDATA cont\u00e9m um ou mais marcadores de t\u00e9rmino ']]>'." } , { MsgKey . ER_WARNING_WF_NOT_CHECKED , "Uma inst\u00e2ncia do verificador Well-Formedness n\u00e3o p\u00f4de ser criada. O par\u00e2metro well-formed foi definido como true, mas a verifica\u00e7\u00e3o well-formedness n\u00e3o pode ser executada." } , { MsgKey . ER_WF_INVALID_CHARACTER , "O n\u00f3 ''{0}'' cont\u00e9m caracteres XML inv\u00e1lidos. " } , { MsgKey . ER_WF_INVALID_CHARACTER_IN_COMMENT , "Um caractere XML inv\u00e1lido (Unicode: 0x{0}) foi encontrado no coment\u00e1rio. " } , { MsgKey . ER_WF_INVALID_CHARACTER_IN_PI , "Um caractere XML inv\u00e1lido (Unicode: 0x{0}) foi encontrado no processo instructiondata." } , { MsgKey . ER_WF_INVALID_CHARACTER_IN_CDATA , "Um caractere XML inv\u00e1lido (Unicode: 0x{0}) foi encontrado nos conte\u00fados do CDATASection. " } , { MsgKey . ER_WF_INVALID_CHARACTER_IN_TEXT , "Um caractere XML inv\u00e1lido (Unicode: 0x{0}) foi encontrado no conte\u00fado dos dados de caractere dos n\u00f3s. " } , { MsgKey . ER_WF_INVALID_CHARACTER_IN_NODE_NAME , "Um caractere inv\u00e1lido foi encontrado no {0} do n\u00f3 denominado ''{1}''." } , { MsgKey . ER_WF_DASH_IN_COMMENT , "A cadeia \"--\" n\u00e3o \u00e9 permitida dentro dos coment\u00e1rios. " } , { MsgKey . ER_WF_LT_IN_ATTVAL , "O valor do atributo \"{1}\" associado a um tipo de elemento \"{0}\" n\u00e3o deve conter o caractere ''<''. " } , { MsgKey . ER_WF_REF_TO_UNPARSED_ENT , "A refer\u00eancia de entidade n\u00e3o analisada \"&{0};\" n\u00e3o \u00e9 permitida. " } , { MsgKey . ER_WF_REF_TO_EXTERNAL_ENT , "A refer\u00eancia de entidade externa \"&{0};\" n\u00e3o \u00e9 permitida em um valor de atributo. " } , { MsgKey . ER_NS_PREFIX_CANNOT_BE_BOUND , "O prefixo \"{0}\" n\u00e3o pode ser vinculado ao espa\u00e7o de nomes \"{1}\"." } , { MsgKey . ER_NULL_LOCAL_ELEMENT_NAME , "O nome local do elemento \"{0}\" \u00e9 nulo." } , { MsgKey . ER_NULL_LOCAL_ATTR_NAME , "O nome local do atributo \"{0}\" \u00e9 nulo." } , { MsgKey . ER_ELEM_UNBOUND_PREFIX_IN_ENTREF , "O texto de substitui\u00e7\u00e3o do n\u00f3 de entidade \"{0}\" cont\u00e9m um n\u00f3 de elemento \"{1}\" com um prefixo n\u00e3o vinculado \"{2}\"." } , { MsgKey . ER_ATTR_UNBOUND_PREFIX_IN_ENTREF , "O texto de substitui\u00e7\u00e3o do n\u00f3 de entidade \"{0}\" cont\u00e9m um n\u00f3 de atributo \"{1}\" com um prefixo n\u00e3o vinculado \"{2}\"." } , } ; return contents ; |
public class BaseSpscLinkedAtomicArrayQueue { /** * { @ inheritDoc }
* This implementation is correct for single consumer thread use only . */
@ SuppressWarnings ( "unchecked" ) @ Override public E peek ( ) { } } | final AtomicReferenceArray < E > buffer = consumerBuffer ; final long index = lpConsumerIndex ( ) ; final long mask = consumerMask ; final int offset = calcElementOffset ( index , mask ) ; // LoadLoad
final Object e = lvElement ( buffer , offset ) ; if ( e == JUMP ) { return newBufferPeek ( buffer , index ) ; } return ( E ) e ; |
public class JAXBMarshaller { /** * { @ inheritDoc } */
public Object unmarshal ( InputStream in ) throws IOException { } } | try { Unmarshaller unmarshaller = m_ctx . createUnmarshaller ( ) ; configureJaxbUnmarshaller ( unmarshaller ) ; return unmarshaller . unmarshal ( new StreamSource ( in ) , m_clzRoot ) . getValue ( ) ; } catch ( JAXBException e ) { throw new IOException ( e ) ; } |
public class SDBaseOps { /** * Create a new 1d array with values evenly spaced between values ' start ' and ' stop '
* For example , linspace ( start = 3.0 , stop = 4.0 , number = 3 ) will generate [ 3.0 , 3.5 , 4.0]
* @ param name Name of the new variable
* @ param from Start value
* @ param to Stop value
* @ param length Number of values to generate
* @ param dt Data type of the output array
* @ return SDVariable with linearly spaced elements */
public SDVariable linspace ( String name , SDVariable from , SDVariable to , SDVariable length , DataType dt ) { } } | SDVariable ret = f ( ) . linspace ( from , to , length , dt ) ; return updateVariableNameAndReference ( ret , name ) ; |
public class CfgParser { /** * This method calculates all of the inside probabilities by iteratively
* parsing larger and larger spans of the sentence . */
private void upwardChartPass ( CfgParseChart chart ) { } } | double [ ] newValues = new double [ binaryDistributionWeights . getValues ( ) . length ] ; // spanSize is the number of words * in addition * to the word under
// spanStart .
for ( int spanSize = 1 ; spanSize < chart . chartSize ( ) ; spanSize ++ ) { for ( int spanStart = 0 ; spanStart + spanSize < chart . chartSize ( ) ; spanStart ++ ) { int spanEnd = spanStart + spanSize ; calculateInside ( spanStart , spanEnd , chart , newValues ) ; } } chart . setInsideCalculated ( ) ; |
public class PipelineScriptParser { /** * Parses lines from a pipeline script .
* @ param scriptLines
* the lines of a pipeline script to parse
* @ param parentFilePath
* the path to the parent File , used for resolving includes
* @ param replacementVars
* the variables to replace in the original pipeline script . The
* first variable gets inserted in place of all $ 1 , the second in
* place of $ 2 , etc .
* @ return the parsed { @ link Pipeline } */
public static Pipeline parse ( List < String > scriptLines , String parentFilePath , List < String > replacementVars ) throws ParseException , IOException { } } | if ( replacementVars == null ) replacementVars = new ArrayList < String > ( ) ; // parse
Pipeline pipeline = parseAndDispatch ( scriptLines , new Pipeline ( ) , parentFilePath , replacementVars ) ; // verify pipeline not empty
if ( pipeline . crd == null ) LOG . warn ( "no CollectionReader defined in this pipeline" ) ; // throw new ParseException (
// " no collection reader defined in this pipeline script " , - 1 ) ;
if ( pipeline . aeds . isEmpty ( ) ) throw new ParseException ( "no analysis engines defined in this pipeline script, at least define one" , - 1 ) ; return pipeline ; |
public class CPMeasurementUnitPersistenceImpl { /** * Caches the cp measurement units in the entity cache if it is enabled .
* @ param cpMeasurementUnits the cp measurement units */
@ Override public void cacheResult ( List < CPMeasurementUnit > cpMeasurementUnits ) { } } | for ( CPMeasurementUnit cpMeasurementUnit : cpMeasurementUnits ) { if ( entityCache . getResult ( CPMeasurementUnitModelImpl . ENTITY_CACHE_ENABLED , CPMeasurementUnitImpl . class , cpMeasurementUnit . getPrimaryKey ( ) ) == null ) { cacheResult ( cpMeasurementUnit ) ; } else { cpMeasurementUnit . resetOriginalValues ( ) ; } } |
public class DoubleArraysND { /** * Creates a new array that is a < i > view < / i > on the specified portion
* of the given parent . Changes in the parent will be visible in the
* returned array .
* @ param parent The parent array
* @ param fromIndices The start indices in the parent , inclusive
* @ param toIndices The end indices in the parent , exclusive
* @ throws NullPointerException If any argument is < code > null < / code >
* @ throws IllegalArgumentException If the indices are not valid . This
* is the case when the { @ link IntTuple # getSize ( ) size } of the start - or
* end indices is different than the parent size , or when
* < code > fromIndex & lt ; 0 < / code > or
* < code > toIndex & gt ; parentSize ( i ) < / code >
* or < code > fromIndex & gt ; toIndex < / code > for any dimension .
* @ return The new array */
public static DoubleArrayND createSubArray ( DoubleArrayND parent , IntTuple fromIndices , IntTuple toIndices ) { } } | return new SubDoubleArrayND ( parent , fromIndices , toIndices ) ; |
public class FileExchange { /** * Start server */
synchronized void start ( ) throws BindException { } } | if ( status . equals ( "started" ) ) return ; long t = System . currentTimeMillis ( ) ; // starting server socket
int port = portMin ; for ( ; port <= portMax ; port ++ ) { try { if ( Objects . isNullOrEmpty ( address ) ) serverSocket = new ServerSocket ( port ) ; else serverSocket = new ServerSocket ( port , 50 , InetAddress . getByName ( address ) ) ; break ; } catch ( BindException e ) { } catch ( Exception e ) { throw new IllegalStateException ( e . getMessage ( ) , e ) ; } } if ( serverSocket == null ) { throw new BindException ( "Cannot bind FileServer to port range [" + portMin + ":" + portMax + "]" ) ; } run = true ; executor = Executors . newFixedThreadPool ( threads , new ThreadFactory ( ) { private AtomicInteger i = new AtomicInteger ( - 1 ) ; @ Override public Thread newThread ( Runnable r ) { return new Thread ( r , "FileExchangeThread-" + i . incrementAndGet ( ) ) ; } } ) ; new Thread ( new FileServer ( ) , "FileExchangeServerThread" ) . start ( ) ; status = "started" ; LOG . info ( "Node " + nodeId + " file server started (" + ( System . currentTimeMillis ( ) - t ) + " ms.) on port " + port + " with " + threads + " threads" ) ; |
public class EntityRestProxy { /** * ( non - Javadoc )
* @ see
* com . microsoft . windowsazure . services . media . entityoperations . EntityContract
* # get ( com . microsoft . windowsazure . services . media . entityoperations .
* EntityGetOperation ) */
@ SuppressWarnings ( "unchecked" ) @ Override public < T > T get ( EntityGetOperation < T > getter ) throws ServiceException { } } | getter . setProxyData ( createProxyData ( ) ) ; Object rawResponse = getResource ( getter ) . get ( getter . getResponseClass ( ) ) ; Object processedResponse = getter . processResponse ( rawResponse ) ; return ( T ) processedResponse ; |
public class ListOutgoingTypedLinksRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( ListOutgoingTypedLinksRequest listOutgoingTypedLinksRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( listOutgoingTypedLinksRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( listOutgoingTypedLinksRequest . getDirectoryArn ( ) , DIRECTORYARN_BINDING ) ; protocolMarshaller . marshall ( listOutgoingTypedLinksRequest . getObjectReference ( ) , OBJECTREFERENCE_BINDING ) ; protocolMarshaller . marshall ( listOutgoingTypedLinksRequest . getFilterAttributeRanges ( ) , FILTERATTRIBUTERANGES_BINDING ) ; protocolMarshaller . marshall ( listOutgoingTypedLinksRequest . getFilterTypedLink ( ) , FILTERTYPEDLINK_BINDING ) ; protocolMarshaller . marshall ( listOutgoingTypedLinksRequest . getNextToken ( ) , NEXTTOKEN_BINDING ) ; protocolMarshaller . marshall ( listOutgoingTypedLinksRequest . getMaxResults ( ) , MAXRESULTS_BINDING ) ; protocolMarshaller . marshall ( listOutgoingTypedLinksRequest . getConsistencyLevel ( ) , CONSISTENCYLEVEL_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; } |
public class ModelsImpl { /** * Gets all custom prebuilt models information of this application .
* @ param appId The application ID .
* @ param versionId The version ID .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the List & lt ; CustomPrebuiltModel & gt ; object */
public Observable < List < CustomPrebuiltModel > > listCustomPrebuiltModelsAsync ( UUID appId , String versionId ) { } } | return listCustomPrebuiltModelsWithServiceResponseAsync ( appId , versionId ) . map ( new Func1 < ServiceResponse < List < CustomPrebuiltModel > > , List < CustomPrebuiltModel > > ( ) { @ Override public List < CustomPrebuiltModel > call ( ServiceResponse < List < CustomPrebuiltModel > > response ) { return response . body ( ) ; } } ) ; |
public class DynamicListener { /** * from interface SetListener */
public void entryUpdated ( EntryUpdatedEvent < T > event ) { } } | dispatchMethod ( event . getName ( ) + "Updated" , new Object [ ] { event . getEntry ( ) } ) ; |
public class ElasticsearchUtil { /** * 创建或更新文档
* @ param indexName 索引名
* @ param type 数据类型
* @ param id 主键
* @ return */
public boolean deleteData ( String indexName , String type , String id ) { } } | DeleteResponse response = getClient ( ) . prepareDelete ( ) . setIndex ( indexName ) . setType ( type ) . setId ( id ) . execute ( ) . actionGet ( ) ; return response . getResult ( ) == DocWriteResponse . Result . DELETED ; |
public class ColorTable { /** * Create the buffer with the rbg colormap .
* @ param mapType - type of map , from which to understand the single value offset
* @ param data - the buffer with the data
* @ param dataOffset - offset to define rows
* @ return the colormap byte buffer */
public ByteBuffer interpolateColorMap ( int mapType , ByteBuffer data , int dataOffset ) { } } | int dataLength = data . capacity ( ) - dataOffset ; /* Allocate colour map output buffer using 4 bytes per cell value ( RGBA ) */
ByteBuffer cmapBuffer = ByteBuffer . allocate ( dataLength ) ; /* Set buffer position */
data . position ( dataOffset ) ; if ( mapType > 0 ) { while ( data . hasRemaining ( ) ) { /* * For each value in the array get the index from the rules map and then translate
* the rule . */
int f = data . getInt ( ) ; cmapBuffer . put ( f == Integer . MAX_VALUE ? blank : getColor ( ( float ) f ) ) ; } } else if ( mapType == - 1 ) { while ( data . hasRemaining ( ) ) { /* * For each value in the array get the index from the rules map and then translate
* the rule . */
float f = data . getFloat ( ) ; cmapBuffer . put ( Float . isNaN ( f ) ? blank : getColor ( f ) ) ; } } else if ( mapType == - 2 ) { while ( data . hasRemaining ( ) ) { /* * For each value in the array get the index from the rules map and then translate
* the rule . */
float f = ( float ) data . getDouble ( ) ; cmapBuffer . put ( Float . isNaN ( f ) ? blank : getColor ( f ) ) ; // if ( ! Float . isNaN ( f ) & & f > 0)
// System . out . println ( " COLOR - TABLE - > " + f + " has color "
// + ( Float . isNaN ( f ) ? blank : getColor ( f ) ) ) ;
/* * test the data map */
/* * System . out . print ( f + " " ) ; if ( counter = = 1024 ) { System . out . println ( ) ; counter =
* 1 ; } else { counter + + ; } */
} } return cmapBuffer ; |
public class AbstractMessageProducer { /** * ( non - Javadoc )
* @ see javax . jms . MessageProducer # send ( javax . jms . Message , int , int , long ) */
@ Override public final void send ( Message message , int deliveryMode , int priority , long timeToLive ) throws JMSException { } } | if ( this . destination == null ) throw new UnsupportedOperationException ( "Destination was not set at creation time" ) ; // Setup message fields
setupMessage ( destination , message , deliveryMode , priority , timeToLive ) ; // Handle foreign message implementations
message = MessageTools . normalize ( message ) ; sendToDestination ( destination , false , message , deliveryMode , priority , timeToLive ) ; |
public class Constraints { /** * Returns a ' in ' group ( or set ) constraint appled to the provided property .
* @ param propertyName the property
* @ param group the group items
* @ return The InGroup constraint . */
public PropertyConstraint inGroup ( String propertyName , Object [ ] group ) { } } | return value ( propertyName , new InGroup ( group ) ) ; |
public class LocationApi { /** * Get character location Information about the characters current location .
* Returns the current solar system id , and also the current station or
* structure ID if applicable - - - This route is cached for up to 5 seconds
* SSO Scope : esi - location . read _ location . v1
* @ param characterId
* An EVE character ID ( required )
* @ param datasource
* The server name you would like data from ( optional , default to
* tranquility )
* @ param ifNoneMatch
* ETag from a previous request . A 304 will be returned if this
* matches the current ETag ( optional )
* @ param token
* Access token to use if unable to set a header ( optional )
* @ return ApiResponse & lt ; CharacterLocationResponse & gt ;
* @ throws ApiException
* If fail to call the API , e . g . server error or cannot
* deserialize the response body */
public ApiResponse < CharacterLocationResponse > getCharactersCharacterIdLocationWithHttpInfo ( Integer characterId , String datasource , String ifNoneMatch , String token ) throws ApiException { } } | com . squareup . okhttp . Call call = getCharactersCharacterIdLocationValidateBeforeCall ( characterId , datasource , ifNoneMatch , token , null ) ; Type localVarReturnType = new TypeToken < CharacterLocationResponse > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ; |
public class ImagesInner { /** * Update an image .
* @ param resourceGroupName The name of the resource group .
* @ param imageName The name of the image .
* @ param parameters Parameters supplied to the Update Image operation .
* @ throws IllegalArgumentException thrown if parameters fail the validation
* @ return the observable to the ImageInner object */
public Observable < ImageInner > beginUpdateAsync ( String resourceGroupName , String imageName , ImageUpdate parameters ) { } } | return beginUpdateWithServiceResponseAsync ( resourceGroupName , imageName , parameters ) . map ( new Func1 < ServiceResponse < ImageInner > , ImageInner > ( ) { @ Override public ImageInner call ( ServiceResponse < ImageInner > response ) { return response . body ( ) ; } } ) ; |
public class SessionImpl { /** * Close JanusGraph , it will not be possible to create new transactions using current instance of Session .
* This closes current session and local transaction , invoking callback function if one is set . */
@ Override public void close ( ) { } } | if ( isClosed ) { return ; } TransactionOLTP localTx = localOLTPTransactionContainer . get ( ) ; if ( localTx != null ) { localTx . close ( ErrorMessage . SESSION_CLOSED . getMessage ( keyspace ( ) ) ) ; localOLTPTransactionContainer . set ( null ) ; } if ( this . onClose != null ) { this . onClose . accept ( this ) ; } isClosed = true ; |
import java . util . List ; class CountNegativeNumbers { /** * This function computes the amount of negative values in a provided list .
* Examples :
* count _ negative _ numbers ( [ - 1 , - 2 , 3 , - 4 , - 5 ] ) - > 4
* count _ negative _ numbers ( [ 1 , 2 , 3 ] ) - > 0
* count _ negative _ numbers ( [ 1 , 2 , - 3 , - 10 , 20 ] ) - > 2 */
public static int countNegativeNumbers ( List < Integer > lst ) { } } | int count = 0 ; for ( Integer el : lst ) { if ( el < 0 ) { count ++ ; } } return count ; |
public class InstantAdapterCore { /** * Method binds a POJO to the inflated View .
* @ param parent The { @ link View } ' s parent , usually an { @ link AdapterView } such as a
* { @ link ListView } .
* @ param view The associated view .
* @ param instance Instance backed by the adapter at the given position .
* @ param position The list item ' s position . */
public final void bindToView ( final ViewGroup parent , final View view , final T instance , final int position ) { } } | SparseArray < Holder > holders = ( SparseArray < Holder > ) view . getTag ( mLayoutResourceId ) ; updateAnnotatedViews ( holders , view , instance , position ) ; executeViewHandlers ( holders , parent , view , instance , position ) ; |
public class AccountClient { /** * Get information for a specific secret id associated to a given API key .
* @ param apiKey The API key that the secret is associated to .
* @ param secretId The id of the secret to get information on .
* @ return SecretResponse object which contains the results from the API .
* @ throws IOException if a network error occurred contacting the Nexmo Account API
* @ throws NexmoClientException if there was a problem wit hthe Nexmo request or response object indicating that the request was unsuccessful . */
public SecretResponse getSecret ( String apiKey , String secretId ) throws IOException , NexmoClientException { } } | return getSecret ( new SecretRequest ( apiKey , secretId ) ) ; |
public class ping { /** * < pre >
* Converts API response of bulk operation into object and returns the object array in case of get request .
* < / pre > */
protected base_resource [ ] get_nitro_bulk_response ( nitro_service service , String response ) throws Exception { } } | ping_responses result = ( ping_responses ) service . get_payload_formatter ( ) . string_to_resource ( ping_responses . class , response ) ; if ( result . errorcode != 0 ) { if ( result . errorcode == SESSION_NOT_EXISTS ) service . clear_session ( ) ; throw new nitro_exception ( result . message , result . errorcode , ( base_response [ ] ) result . ping_response_array ) ; } ping [ ] result_ping = new ping [ result . ping_response_array . length ] ; for ( int i = 0 ; i < result . ping_response_array . length ; i ++ ) { result_ping [ i ] = result . ping_response_array [ i ] . ping [ 0 ] ; } return result_ping ; |
public class NameNode { /** * { @ inheritDoc } */
@ Override public CorruptFileBlocks listCorruptFileBlocks ( String path , String cookie ) throws IOException { } } | return listCorruptFileBlocksInternal ( path , cookie ) ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.