signature
stringlengths 43
39.1k
| implementation
stringlengths 0
450k
|
|---|---|
public class SystemDnsServer { /** * has 300s latency when system resolv change */
public static String [ ] getByInternalAPI ( ) { } }
|
try { Class < ? > resolverConfiguration = Class . forName ( "sun.net.dns.ResolverConfiguration" ) ; Method open = resolverConfiguration . getMethod ( "open" ) ; Method getNameservers = resolverConfiguration . getMethod ( "nameservers" ) ; Object instance = open . invoke ( null ) ; List nameservers = ( List ) getNameservers . invoke ( instance ) ; if ( nameservers == null || nameservers . size ( ) == 0 ) { return null ; } String [ ] ret = new String [ nameservers . size ( ) ] ; int i = 0 ; for ( Object dns : nameservers ) { ret [ i ++ ] = ( String ) dns ; } return ret ; } catch ( Exception e ) { // we might trigger some problems this way
e . printStackTrace ( ) ; } return null ;
|
public class CommerceNotificationAttachmentPersistenceImpl { /** * Removes all the commerce notification attachments where commerceNotificationQueueEntryId = & # 63 ; from the database .
* @ param commerceNotificationQueueEntryId the commerce notification queue entry ID */
@ Override public void removeByCommerceNotificationQueueEntryId ( long commerceNotificationQueueEntryId ) { } }
|
for ( CommerceNotificationAttachment commerceNotificationAttachment : findByCommerceNotificationQueueEntryId ( commerceNotificationQueueEntryId , QueryUtil . ALL_POS , QueryUtil . ALL_POS , null ) ) { remove ( commerceNotificationAttachment ) ; }
|
public class SARLQuickfixProvider { /** * Quick fix for " Cyclic hierarchy " .
* @ param issue the issue .
* @ param acceptor the quick fix acceptor . */
@ Fix ( IssueCodes . CYCLIC_INHERITANCE ) public void fixCyclicInheritance ( final Issue issue , IssueResolutionAcceptor acceptor ) { } }
|
ExtendedTypeRemoveModification . accept ( this , issue , acceptor ) ;
|
public class CoordinatorAccessor { /** * Ex : response looks something like this .
* [ { " dataSource " : " abf2 " , " interval " : " 2014-10-31T00:00:00.000-07:00/2014-11-01T00:00:00.000-07:00 " , " version " : " 2014-11-13T21:53:23.982-08:00 " , " loadSpec " : { . . } , . . } ,
* { " dataSource " : " abf2 " , " interval " : " 2014-11-01T00:00:00.000-07:00/2014-11-02T00:00:00.000-07:00 " , " version " : " 2014-11-13T22:01:23.554-08:00 " , " loadSpec " : { . . } , . . }
* @ param dataSource
* @ param reqHeaders
* @ return List [ intervals ] Ex :
* [ " 2014-10-31T00:00:00.000-07:00/2014-11-01T00:00:00.000-07:00 " ,
* " 2014-11-01T00:00:00.000-07:00/2014-11-02T00:00:00.000-07:00 " . . ] */
public Either < String , List < Interval > > segments ( String dataSource , Map < String , String > reqHeaders ) { } }
|
Either < String , Either < JSONArray , JSONObject > > resp = fireCommand ( "druid/coordinator/v1/metadata/datasources/" + dataSource + "/segments?full" , null , reqHeaders ) ; if ( resp . isLeft ( ) ) { return new Left < > ( resp . left ( ) . get ( ) ) ; } Either < JSONArray , JSONObject > mayBgoodResp = resp . right ( ) . get ( ) ; if ( mayBgoodResp . isLeft ( ) ) { JSONArray segments = mayBgoodResp . left ( ) . get ( ) ; List < Interval > segmentsList = new ArrayList < > ( ) ; for ( int i = 0 ; i < segments . length ( ) ; i ++ ) { JSONObject segment = segments . getJSONObject ( i ) ; segmentsList . add ( new Interval ( segment . getString ( "interval" ) ) ) ; } return new Right < > ( segmentsList ) ; } return new Left < > ( mayBgoodResp . right ( ) . get ( ) . toString ( ) ) ;
|
public class ApiOvhEmaildomain { /** * Alter this object properties
* REST : PUT / email / domain / { domain } / responder / { account }
* @ param body [ required ] New object properties
* @ param domain [ required ] Name of your domain name
* @ param account [ required ] Name of account */
public void domain_responder_account_PUT ( String domain , String account , OvhResponder body ) throws IOException { } }
|
String qPath = "/email/domain/{domain}/responder/{account}" ; StringBuilder sb = path ( qPath , domain , account ) ; exec ( qPath , "PUT" , sb . toString ( ) , body ) ;
|
public class FlatTreeNode { /** * Create a new { @ code FlatTreeNode } from the given { @ code tree } .
* @ param tree the source tree
* @ param < V > the tree value types
* @ return a new { @ code FlatTreeNode } from the given { @ code tree }
* @ throws NullPointerException if the given { @ code tree } is { @ code null } */
public static < V > FlatTreeNode < V > of ( final Tree < ? extends V , ? > tree ) { } }
|
requireNonNull ( tree ) ; final int size = tree . size ( ) ; final MSeq < V > elements = MSeq . ofLength ( size ) ; final int [ ] childOffsets = new int [ size ] ; final int [ ] childCounts = new int [ size ] ; assert size >= 1 ; final FlatTreeNode < V > root = new FlatTreeNode < > ( 0 , elements , childOffsets , childCounts ) ; int childOffset = 1 ; int index = 0 ; final Iterator < ? extends Tree < ? extends V , ? > > it = tree . breadthFirstIterator ( ) ; while ( it . hasNext ( ) ) { final Tree < ? extends V , ? > node = it . next ( ) ; elements . set ( index , node . getValue ( ) ) ; childCounts [ index ] = node . childCount ( ) ; childOffsets [ index ] = node . isLeaf ( ) ? - 1 : childOffset ; childOffset += node . childCount ( ) ; ++ index ; } return root ;
|
public class CmsTree { /** * Returns the HTML for the tree initialization . < p >
* @ param cms the CmsObject
* @ param encoding the current encoding
* @ param skinUri the current skin URI
* @ return the HTML for the tree initialization */
public static String initTree ( CmsObject cms , String encoding , String skinUri ) { } }
|
StringBuffer retValue = new StringBuffer ( 512 ) ; String servletUrl = OpenCms . getSystemInfo ( ) . getOpenCmsContext ( ) ; // get the localized workplace messages
// TODO : Why a new message object , can it not be obtained from session ?
Locale locale = cms . getRequestContext ( ) . getLocale ( ) ; CmsMessages messages = OpenCms . getWorkplaceManager ( ) . getMessages ( locale ) ; retValue . append ( "function initTreeResources() {\n" ) ; retValue . append ( "\tinitResources(\"" ) ; retValue . append ( encoding ) ; retValue . append ( "\", \"" ) ; retValue . append ( PATH_WORKPLACE ) ; retValue . append ( "\", \"" ) ; retValue . append ( skinUri ) ; retValue . append ( "\", \"" ) ; retValue . append ( servletUrl ) ; retValue . append ( "\");\n" ) ; // get all available resource types
List < I_CmsResourceType > allResTypes = OpenCms . getResourceManager ( ) . getResourceTypes ( ) ; for ( int i = 0 ; i < allResTypes . size ( ) ; i ++ ) { // loop through all types
I_CmsResourceType type = allResTypes . get ( i ) ; int curTypeId = type . getTypeId ( ) ; String curTypeName = type . getTypeName ( ) ; // get the settings for the resource type
CmsExplorerTypeSettings settings = OpenCms . getWorkplaceManager ( ) . getExplorerTypeSetting ( curTypeName ) ; if ( settings == null ) { if ( LOG . isWarnEnabled ( ) ) { LOG . warn ( Messages . get ( ) . getBundle ( ) . key ( Messages . LOG_MISSING_SETTINGS_ENTRY_1 , curTypeName ) ) ; } settings = OpenCms . getWorkplaceManager ( ) . getExplorerTypeSetting ( CmsResourceTypePlain . getStaticTypeName ( ) ) ; } retValue . append ( "\taddResourceType(" ) ; retValue . append ( curTypeId ) ; retValue . append ( ", \"" ) ; retValue . append ( curTypeName ) ; retValue . append ( "\",\t\"" ) ; retValue . append ( messages . key ( settings . getKey ( ) ) ) ; retValue . append ( "\",\t\"" + CmsWorkplace . RES_PATH_FILETYPES ) ; retValue . append ( settings . getIcon ( ) ) ; retValue . append ( "\");\n" ) ; } retValue . append ( "}\n\n" ) ; retValue . append ( "initTreeResources();\n" ) ; String sharedFolder = OpenCms . getSiteManager ( ) . getSharedFolder ( ) ; if ( sharedFolder != null ) { retValue . append ( "sharedFolderName = '" + sharedFolder + "';" ) ; } return retValue . toString ( ) ;
|
public class PropertyConverter { /** * Convert from source type to Comparable to allow a more
* fine - grained control over the sorted results . Override
* this method to modify sorting behaviour of entities .
* @ param source
* @ return converted source
* @ throws org . structr . common . error . FrameworkException */
public Comparable convertForSorting ( S source ) throws FrameworkException { } }
|
if ( source != null ) { if ( source instanceof Comparable ) { return ( Comparable ) source ; } // fallback
return source . toString ( ) ; } return null ;
|
public class BMOImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ SuppressWarnings ( "unchecked" ) @ Override public void eSet ( int featureID , Object newValue ) { } }
|
switch ( featureID ) { case AfplibPackage . BMO__OVLY_NAME : setOvlyName ( ( String ) newValue ) ; return ; case AfplibPackage . BMO__TRIPLETS : getTriplets ( ) . clear ( ) ; getTriplets ( ) . addAll ( ( Collection < ? extends Triplet > ) newValue ) ; return ; } super . eSet ( featureID , newValue ) ;
|
public class CreateMaintenanceWindowRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( CreateMaintenanceWindowRequest createMaintenanceWindowRequest , ProtocolMarshaller protocolMarshaller ) { } }
|
if ( createMaintenanceWindowRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( createMaintenanceWindowRequest . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( createMaintenanceWindowRequest . getDescription ( ) , DESCRIPTION_BINDING ) ; protocolMarshaller . marshall ( createMaintenanceWindowRequest . getStartDate ( ) , STARTDATE_BINDING ) ; protocolMarshaller . marshall ( createMaintenanceWindowRequest . getEndDate ( ) , ENDDATE_BINDING ) ; protocolMarshaller . marshall ( createMaintenanceWindowRequest . getSchedule ( ) , SCHEDULE_BINDING ) ; protocolMarshaller . marshall ( createMaintenanceWindowRequest . getScheduleTimezone ( ) , SCHEDULETIMEZONE_BINDING ) ; protocolMarshaller . marshall ( createMaintenanceWindowRequest . getDuration ( ) , DURATION_BINDING ) ; protocolMarshaller . marshall ( createMaintenanceWindowRequest . getCutoff ( ) , CUTOFF_BINDING ) ; protocolMarshaller . marshall ( createMaintenanceWindowRequest . getAllowUnassociatedTargets ( ) , ALLOWUNASSOCIATEDTARGETS_BINDING ) ; protocolMarshaller . marshall ( createMaintenanceWindowRequest . getClientToken ( ) , CLIENTTOKEN_BINDING ) ; protocolMarshaller . marshall ( createMaintenanceWindowRequest . getTags ( ) , TAGS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMessage ( ) , e ) ; }
|
public class AbstractFacade { /** * { @ inheritDoc } */
@ SuppressWarnings ( "unchecked" ) @ Override public < E extends R > void register ( final UniqueKey < E > registrationKey , final E readyObject ) { } }
|
// Synchronize the registration
synchronized ( this . componentMap ) { // Set the key if not set before otherwise does nothing because the registrationKey can be different from the real component key
if ( readyObject . key ( ) == null ) { readyObject . key ( ( UniqueKey < R > ) registrationKey ) ; } // Attach the facade to allow to retrieve any components
readyObject . localFacade ( this ) ; if ( ! this . componentMap . containsKey ( registrationKey ) ) { final Set < R > weakHashSet = Collections . newSetFromMap ( new WeakHashMap < R , Boolean > ( ) ) ; // Store the component into the singleton map
this . componentMap . put ( registrationKey , weakHashSet ) ; } this . componentMap . get ( registrationKey ) . add ( readyObject ) ; }
|
public class UserJSONImpl { /** * / * package */
static PagableResponseList < User > createPagableUserList ( HttpResponse res , Configuration conf ) throws TwitterException { } }
|
try { if ( conf . isJSONStoreEnabled ( ) ) { TwitterObjectFactory . clearThreadLocalMap ( ) ; } JSONObject json = res . asJSONObject ( ) ; JSONArray list = json . getJSONArray ( "users" ) ; int size = list . length ( ) ; PagableResponseList < User > users = new PagableResponseListImpl < User > ( size , json , res ) ; for ( int i = 0 ; i < size ; i ++ ) { JSONObject userJson = list . getJSONObject ( i ) ; User user = new UserJSONImpl ( userJson ) ; if ( conf . isJSONStoreEnabled ( ) ) { TwitterObjectFactory . registerJSONObject ( user , userJson ) ; } users . add ( user ) ; } if ( conf . isJSONStoreEnabled ( ) ) { TwitterObjectFactory . registerJSONObject ( users , json ) ; } return users ; } catch ( JSONException jsone ) { throw new TwitterException ( jsone ) ; }
|
public class JSettingsPanel { /** * GEN - LAST : event _ jCheckBoxPaintGradientActionPerformed */
private void jCheckBoxDrawFinalZeroingLinesActionPerformed ( java . awt . event . ActionEvent evt ) // GEN - FIRST : event _ jCheckBoxDrawFinalZeroingLinesActionPerformed
{ } }
|
// GEN - HEADEREND : event _ jCheckBoxDrawFinalZeroingLinesActionPerformed
parent . getGraphPanelChart ( ) . getChartSettings ( ) . setDrawFinalZeroingLines ( jCheckBoxDrawFinalZeroingLines . isSelected ( ) ) ; refreshGraphPreview ( ) ;
|
public class XSplitter { /** * Get the ratio of data objects in the intersection volume ( weighted
* overlap ) .
* @ param split two entry lists representing the given split
* @ param mbrs the MBRs for the given split
* @ return the ration of data objects in the intersection volume as value
* between 0 and 1 */
public double getRatioOfDataInIntersectionVolume ( List < SpatialEntry > [ ] split , HyperBoundingBox [ ] mbrs ) { } }
|
final ModifiableHyperBoundingBox xMBR = SpatialUtil . intersection ( mbrs [ 0 ] , mbrs [ 1 ] ) ; if ( xMBR == null ) { return 0. ; } // Total number of entries , intersecting entries
int [ ] numOf = { 0 , 0 } ; countXingDataEntries ( split [ 0 ] , xMBR , numOf ) ; countXingDataEntries ( split [ 1 ] , xMBR , numOf ) ; return numOf [ 1 ] / ( double ) numOf [ 0 ] ;
|
public class MetricName { /** * Build the MetricName that is this with another path appended to it .
* The new MetricName inherits the tags of this one .
* @ param p The extra path element to add to the new metric .
* @ return A new metric name relative to the original by the path specified
* in p . */
public MetricName resolve ( String p ) { } }
|
final String next ; if ( p != null && ! p . isEmpty ( ) ) { if ( key != null && ! key . isEmpty ( ) ) { next = key + SEPARATOR + p ; } else { next = p ; } } else { next = this . key ; } return new MetricName ( next , tags ) ;
|
public class KeyStore { /** * Returns the key associated with the given alias , using the given
* password to recover it . The key must have been associated with
* the alias by a call to < code > setKeyEntry < / code > ,
* or by a call to < code > setEntry < / code > with a
* < code > PrivateKeyEntry < / code > or < code > SecretKeyEntry < / code > .
* @ param alias the alias name
* @ param password the password for recovering the key
* @ return the requested key , or null if the given alias does not exist
* or does not identify a key - related entry .
* @ exception KeyStoreException if the keystore has not been initialized
* ( loaded ) .
* @ exception NoSuchAlgorithmException if the algorithm for recovering the
* key cannot be found
* @ exception UnrecoverableKeyException if the key cannot be recovered
* ( e . g . , the given password is wrong ) . */
public final Key getKey ( String alias , char [ ] password ) throws KeyStoreException , NoSuchAlgorithmException , UnrecoverableKeyException { } }
|
if ( ! initialized ) { throw new KeyStoreException ( "Uninitialized keystore" ) ; } return keyStoreSpi . engineGetKey ( alias , password ) ;
|
public class SARLRuntime { /** * Replies if the given directory contains a SRE .
* @ param directory the directory .
* @ return < code > true < / code > if the given directory contains a SRE . Otherwise < code > false < / code > .
* @ see # isPackedSRE ( File ) */
public static boolean isUnpackedSRE ( File directory ) { } }
|
File manifestFile = new File ( directory , "META-INF" ) ; // $ NON - NLS - 1 $
manifestFile = new File ( manifestFile , "MANIFEST.MF" ) ; // $ NON - NLS - 1 $
if ( manifestFile . canRead ( ) ) { try ( InputStream manifestStream = new FileInputStream ( manifestFile ) ) { final Manifest manifest = new Manifest ( manifestStream ) ; final Attributes sarlSection = manifest . getAttributes ( SREConstants . MANIFEST_SECTION_SRE ) ; if ( sarlSection == null ) { return false ; } final String sarlVersion = sarlSection . getValue ( SREConstants . MANIFEST_SARL_SPEC_VERSION ) ; if ( sarlVersion == null || sarlVersion . isEmpty ( ) ) { return false ; } final Version sarlVer = Version . parseVersion ( sarlVersion ) ; return sarlVer != null ; } catch ( IOException exception ) { return false ; } } return false ;
|
public class RegionInstanceGroupManagerClient { /** * Lists the instances in the managed instance group and instances that are scheduled to be
* created . The list includes any current actions that the group has scheduled for its instances .
* < p > Sample code :
* < pre > < code >
* try ( RegionInstanceGroupManagerClient regionInstanceGroupManagerClient = RegionInstanceGroupManagerClient . create ( ) ) {
* ProjectRegionInstanceGroupManagerName instanceGroupManager = ProjectRegionInstanceGroupManagerName . of ( " [ PROJECT ] " , " [ REGION ] " , " [ INSTANCE _ GROUP _ MANAGER ] " ) ;
* RegionInstanceGroupManagersListInstancesResponse response = regionInstanceGroupManagerClient . listManagedInstancesRegionInstanceGroupManagers ( instanceGroupManager . toString ( ) ) ;
* < / code > < / pre >
* @ param instanceGroupManager The name of the managed instance group .
* @ throws com . google . api . gax . rpc . ApiException if the remote call fails */
@ BetaApi public final RegionInstanceGroupManagersListInstancesResponse listManagedInstancesRegionInstanceGroupManagers ( String instanceGroupManager ) { } }
|
ListManagedInstancesRegionInstanceGroupManagersHttpRequest request = ListManagedInstancesRegionInstanceGroupManagersHttpRequest . newBuilder ( ) . setInstanceGroupManager ( instanceGroupManager ) . build ( ) ; return listManagedInstancesRegionInstanceGroupManagers ( request ) ;
|
public class BuildContextAwareMojo { /** * Retrieves the Info Plist out of the effective Xcode project settings and returns the accessor
* to it . */
protected PListAccessor getInfoPListAccessor ( XCodeContext . SourceCodeLocation location , String configuration , String sdk ) throws MojoExecutionException , XCodeException { } }
|
File plistFile = getPListFile ( location , configuration , sdk ) ; if ( ! plistFile . isFile ( ) ) { throw new MojoExecutionException ( "The Xcode project refers to the Info.plist file '" + plistFile + "' that does not exist." ) ; } return new PListAccessor ( plistFile ) ;
|
public class VisOdomMonoPlaneInfinity { /** * Fuse the estimates for yaw from both sets of points using a weighted vector average and save the results
* into currToKey */
private void fuseEstimates ( ) { } }
|
// weighted average for angle
double x = closeMotionKeyToCurr . c * closeInlierCount + Math . cos ( farAngle ) * farInlierCount ; double y = closeMotionKeyToCurr . s * closeInlierCount + Math . sin ( farAngle ) * farInlierCount ; // update the motion estimate
closeMotionKeyToCurr . setYaw ( Math . atan2 ( y , x ) ) ; // save the results
closeMotionKeyToCurr . invert ( currToKey ) ;
|
public class XMLSerializer { /** * Attribute .
* @ param namespace the namespace
* @ param name the name
* @ param value the value
* @ return serializer
* @ throws IOException Signals that an I / O exception has occurred . */
public XMLSerializer attribute ( String namespace , String name , String value ) throws IOException { } }
|
if ( ! startTagIncomplete ) { throw new IllegalArgumentException ( "startTag() must be called before attribute()" + getLocation ( ) ) ; } // assert setPrefixCalled = = false ;
out . write ( ' ' ) ; // / / assert namespace ! = null ;
if ( namespace != null && namespace . length ( ) > 0 ) { // namespace = namespace . intern ( ) ;
if ( ! namesInterned ) { namespace = namespace . intern ( ) ; } else if ( checkNamesInterned ) { checkInterning ( namespace ) ; } String prefix = getPrefix ( namespace , false , true ) ; // assert ( prefix ! = null ) ;
// if ( prefix . length ( ) = = 0 ) {
if ( prefix == null ) { // needs to declare prefix to hold default namespace
// NOTE : attributes such as a = ' b ' are in NO namespace
prefix = generatePrefix ( namespace ) ; } out . write ( prefix ) ; out . write ( ':' ) ; // if ( prefix . length ( ) > 0 ) {
// out . write ( prefix ) ;
// out . write ( ' : ' ) ;
} // assert name ! = null ;
out . write ( name ) ; out . write ( '=' ) ; // assert value ! = null ;
out . write ( attributeUseApostrophe ? '\'' : '"' ) ; writeAttributeValue ( value , out ) ; out . write ( attributeUseApostrophe ? '\'' : '"' ) ; return this ;
|
public class XMLConfigAdmin { /** * sets if spool is enable or not
* @ param spoolEnable
* @ throws SecurityException */
public void setMailSpoolEnable ( Boolean spoolEnable ) throws SecurityException { } }
|
checkWriteAccess ( ) ; boolean hasAccess = ConfigWebUtil . hasAccess ( config , SecurityManager . TYPE_MAIL ) ; if ( ! hasAccess ) throw new SecurityException ( "no access to update mail server settings" ) ; Element mail = _getRootElement ( "mail" ) ; mail . setAttribute ( "spool-enable" , Caster . toString ( spoolEnable , "" ) ) ; // config . setMailSpoolEnable ( spoolEnable ) ;
|
public class RLSSuspendTokenManager { /** * Returns true if there are no tokens in the map
* indicating that no active suspends exist .
* @ return */
boolean isResumable ( ) { } }
|
if ( tc . isEntryEnabled ( ) ) Tr . entry ( tc , "isResumable" ) ; boolean isResumable = true ; synchronized ( _tokenMap ) { if ( ! _tokenMap . isEmpty ( ) ) { isResumable = false ; } } if ( tc . isEntryEnabled ( ) ) Tr . exit ( tc , "isResumable" , new Boolean ( isResumable ) ) ; return isResumable ;
|
public class JNStorage { /** * Purge files in the given directory which match any of the set of patterns .
* The patterns must have a single numeric capture group which determines
* the associated transaction ID of the file . Only those files for which
* the transaction ID is less than the < code > minTxIdToKeep < / code > parameter
* are removed . */
private static void purgeMatching ( File dir , List < Pattern > patterns , long minTxIdToKeep ) throws IOException { } }
|
for ( File f : FileUtil . listFiles ( dir ) ) { if ( ! f . isFile ( ) ) continue ; for ( Pattern p : patterns ) { Matcher matcher = p . matcher ( f . getName ( ) ) ; if ( matcher . matches ( ) ) { // This parsing will always succeed since the group ( 1 ) is
// / \ d + / in the regex itself .
long txid = Long . valueOf ( matcher . group ( 1 ) ) ; if ( txid < minTxIdToKeep ) { LOG . info ( "Purging no-longer needed file " + txid ) ; if ( ! f . delete ( ) ) { LOG . warn ( "Unable to delete no-longer-needed data " + f ) ; } break ; } } } }
|
public class JCuda { /** * Allocate an array on the device .
* < pre >
* cudaError _ t cudaMalloc3DArray (
* cudaArray _ t * array ,
* const cudaChannelFormatDesc * desc ,
* cudaExtent extent ,
* unsigned int flags = 0 )
* < / pre >
* < div >
* < p > Allocate an array on the device .
* Allocates a CUDA array according to the cudaChannelFormatDesc structure
* < tt > desc < / tt > and returns a handle to the new CUDA array in < tt > * array < / tt > .
* < p > The cudaChannelFormatDesc is defined
* as :
* < pre > struct cudaChannelFormatDesc {
* int x , y , z , w ;
* enum cudaChannelFormatKind
* } ; < / pre >
* where cudaChannelFormatKind is one of
* cudaChannelFormatKindSigned , cudaChannelFormatKindUnsigned , or
* cudaChannelFormatKindFloat .
* < p > cudaMalloc3DArray ( ) can allocate the
* following :
* < ul >
* < li >
* < p > A 1D array is allocated if the
* height and depth extents are both zero .
* < / li >
* < li >
* < p > A 2D array is allocated if only
* the depth extent is zero .
* < / li >
* < li >
* < p > A 3D array is allocated if all
* three extents are non - zero .
* < / li >
* < li >
* < p > A 1D layered CUDA array is
* allocated if only the height extent is zero and the cudaArrayLayered
* flag is set . Each layer is
* a 1D array . The number of layers
* is determined by the depth extent .
* < / li >
* < li >
* < p > A 2D layered CUDA array is
* allocated if all three extents are non - zero and the cudaArrayLayered
* flag is set . Each layer is
* a 2D array . The number of layers
* is determined by the depth extent .
* < / li >
* < li >
* < p > A cubemap CUDA array is
* allocated if all three extents are non - zero and the cudaArrayCubemap
* flag is set . Width must be equal
* to height , and depth must be
* six . A cubemap is a special type of 2D layered CUDA array , where the
* six layers represent the
* six faces of a cube . The order
* of the six layers in memory is the same as that listed in
* cudaGraphicsCubeFace .
* < / li >
* < li >
* < p > A cubemap layered CUDA array
* is allocated if all three extents are non - zero , and both , cudaArrayCubemap
* and cudaArrayLayered
* flags are set . Width must be
* equal to height , and depth must be a multiple of six . A cubemap layered
* CUDA array is a special
* type of 2D layered CUDA array
* that consists of a collection of cubemaps . The first six layers
* represent the first cubemap ,
* the next six layers form the
* second cubemap , and so on .
* < / li >
* < / ul >
* < p > The < tt > flags < / tt > parameter enables
* different options to be specified that affect the allocation , as
* follows .
* < ul >
* < li >
* < p > cudaArrayDefault : This flag ' s
* value is defined to be 0 and provides default array allocation
* < / li >
* < li >
* < p > cudaArrayLayered : Allocates a
* layered CUDA array , with the depth extent indicating the number of
* layers
* < / li >
* < li >
* < p > cudaArrayCubemap : Allocates a
* cubemap CUDA array . Width must be equal to height , and depth must be
* six . If the cudaArrayLayered flag is also
* set , depth must be a multiple
* of six .
* < / li >
* < li >
* < p > cudaArraySurfaceLoadStore :
* Allocates a CUDA array that could be read from or written to using a
* surface reference .
* < / li >
* < li >
* < p > cudaArrayTextureGather : This
* flag indicates that texture gather operations will be performed on the
* CUDA array . Texture gather can only be performed
* on 2D CUDA arrays .
* < / li >
* < / ul >
* < p > The width , height and depth extents must
* meet certain size requirements as listed in the following table . All
* values are specified
* in elements .
* < p > Note that 2D CUDA arrays have different
* size requirements if the cudaArrayTextureGather flag is set . In that
* case , the valid range for ( width , height , depth ) is
* ( ( 1 , maxTexture2DGather [ 0 ] ) , ( 1 , maxTexture2DGather [ 1 ] ) ,
* < div >
* < table cellpadding = " 4 " cellspacing = " 0 " summary = " " frame = " border " border = " 1 " rules = " all " >
* < tbody >
* < tr >
* < td valign = " top " rowspan = " 1 " colspan = " 1 " >
* < p > < strong > CUDA array
* type < / strong >
* < / td >
* < td valign = " top " rowspan = " 1 " colspan = " 1 " >
* < p > < strong > Valid extents
* that must always be met
* { ( width range in
* elements ) , ( height range ) , ( depth range ) } < / strong >
* < / td >
* < td valign = " top " rowspan = " 1 " colspan = " 1 " >
* < p > < strong > Valid extents
* with cudaArraySurfaceLoadStore set
* { ( width range in
* elements ) , ( height range ) , ( depth range ) } < / strong >
* < / td >
* < / tr >
* < tr >
* < td valign = " top " rowspan = " 1 " colspan = " 1 " >
* < p > 1D < / p >
* < / td >
* < td valign = " top " rowspan = " 1 " colspan = " 1 " >
* < p > { ( 1 , maxTexture1D ) ,
* 0 , 0 }
* < / td >
* < td valign = " top " rowspan = " 1 " colspan = " 1 " >
* < p > { ( 1 , maxSurface1D ) ,
* 0 , 0 }
* < / td >
* < / tr >
* < tr >
* < td valign = " top " rowspan = " 1 " colspan = " 1 " >
* < p > 2D < / p >
* < / td >
* < td valign = " top " rowspan = " 1 " colspan = " 1 " >
* < p > { ( 1 , maxTexture2D [ 0 ] ) ,
* ( 1 , maxTexture2D [ 1 ] ) , 0 }
* < / td >
* < td valign = " top " rowspan = " 1 " colspan = " 1 " >
* < p > { ( 1 , maxSurface2D [ 0 ] ) ,
* ( 1 , maxSurface2D [ 1 ] ) , 0 }
* < / td >
* < / tr >
* < tr >
* < td valign = " top " rowspan = " 1 " colspan = " 1 " >
* < p > 3D < / p >
* < / td >
* < td valign = " top " rowspan = " 1 " colspan = " 1 " >
* < p > { ( 1 , maxTexture3D [ 0 ] ) ,
* ( 1 , maxTexture3D [ 1 ] ) , ( 1 , maxTexture3D [ 2 ] ) }
* < / td >
* < td valign = " top " rowspan = " 1 " colspan = " 1 " >
* < p > { ( 1 , maxSurface3D [ 0 ] ) ,
* ( 1 , maxSurface3D [ 1 ] ) , ( 1 , maxSurface3D [ 2 ] ) }
* < / td >
* < / tr >
* < tr >
* < td valign = " top " rowspan = " 1 " colspan = " 1 " >
* < p > 1D Layered < / p >
* < / td >
* < td valign = " top " rowspan = " 1 " colspan = " 1 " >
* ( 1 , maxTexture1DLayered [ 0 ] ) , 0 , ( 1 , maxTexture1DLayered [ 1 ] ) }
* < / td >
* < td valign = " top " rowspan = " 1 " colspan = " 1 " >
* ( 1 , maxSurface1DLayered [ 0 ] ) , 0 , ( 1 , maxSurface1DLayered [ 1 ] ) }
* < / td >
* < / tr >
* < tr >
* < td valign = " top " rowspan = " 1 " colspan = " 1 " >
* < p > 2D Layered < / p >
* < / td >
* < td valign = " top " rowspan = " 1 " colspan = " 1 " >
* ( 1 , maxTexture2DLayered [ 0 ] ) , ( 1 , maxTexture2DLayered [ 1 ] ) ,
* ( 1 , maxTexture2DLayered [ 2 ] ) }
* < / td >
* < td valign = " top " rowspan = " 1 " colspan = " 1 " >
* ( 1 , maxSurface2DLayered [ 0 ] ) , ( 1 , maxSurface2DLayered [ 1 ] ) ,
* ( 1 , maxSurface2DLayered [ 2 ] ) }
* < / td >
* < / tr >
* < tr >
* < td valign = " top " rowspan = " 1 " colspan = " 1 " >
* < p > Cubemap < / p >
* < / td >
* < td valign = " top " rowspan = " 1 " colspan = " 1 " >
* < p > { ( 1 , maxTextureCubemap ) ,
* ( 1 , maxTextureCubemap ) , 6 }
* < / td >
* < td valign = " top " rowspan = " 1 " colspan = " 1 " >
* < p > { ( 1 , maxSurfaceCubemap ) ,
* ( 1 , maxSurfaceCubemap ) , 6 }
* < / td >
* < / tr >
* < tr >
* < td valign = " top " rowspan = " 1 " colspan = " 1 " >
* < p > Cubemap Layered < / p >
* < / td >
* < td valign = " top " rowspan = " 1 " colspan = " 1 " >
* ( 1 , maxTextureCubemapLayered [ 0 ] ) , ( 1 , maxTextureCubemapLayered [ 0 ] ) ,
* ( 1 , maxTextureCubemapLayered [ 1 ] ) }
* < / td >
* < td valign = " top " rowspan = " 1 " colspan = " 1 " >
* ( 1 , maxSurfaceCubemapLayered [ 0 ] ) , ( 1 , maxSurfaceCubemapLayered [ 0 ] ) ,
* ( 1 , maxSurfaceCubemapLayered [ 1 ] ) }
* < / td >
* < / tr >
* < / tbody >
* < / table >
* < / div >
* < div >
* < span > Note : < / span >
* < p > Note that this
* function may also return error codes from previous , asynchronous
* launches .
* < / div >
* < / div >
* @ param array Pointer to allocated array in device memory
* @ param desc Requested channel format
* @ param extent Requested allocation size ( width field in elements )
* @ param flags Flags for extensions
* @ return cudaSuccess , cudaErrorMemoryAllocation
* @ see JCuda # cudaMalloc3D
* @ see JCuda # cudaMalloc
* @ see JCuda # cudaMallocPitch
* @ see JCuda # cudaFree
* @ see JCuda # cudaFreeArray
* @ see JCuda # cudaMallocHost
* @ see JCuda # cudaFreeHost
* @ see JCuda # cudaHostAlloc
* @ see cudaExtent */
public static int cudaMalloc3DArray ( cudaArray arrayPtr , cudaChannelFormatDesc desc , cudaExtent extent , int flags ) { } }
|
return checkResult ( cudaMalloc3DArrayNative ( arrayPtr , desc , extent , flags ) ) ;
|
public class DefaultTypeTransformation { /** * Method used for coercing an object to a boolean value ,
* thanks to an < code > asBoolean ( ) < / code > method added on types .
* @ param object to coerce to a boolean value
* @ return a boolean value */
public static boolean castToBoolean ( Object object ) { } }
|
// null is always false
if ( object == null ) { return false ; } // equality check is enough and faster than instanceof check , no need to check superclasses since Boolean is final
if ( object . getClass ( ) == Boolean . class ) { return ( Boolean ) object ; } // if the object is not null and no Boolean , try to call an asBoolean ( ) method on the object
return ( Boolean ) InvokerHelper . invokeMethod ( object , "asBoolean" , InvokerHelper . EMPTY_ARGS ) ;
|
public class ZipFileNestedDirContainer { /** * Answer the URLs of this entry . See { @ link ZipFileContainer # createEntryUri }
* for details .
* Answer a singleton , unless the archive and entry values cause a malformed
* URL to be created . If a malformed URL is created , answer an empty collection .
* @ return The collection of URLs of this entry . */
@ Override public Collection < URL > getURLs ( ) { } }
|
try { // As a container URL , the URL must end with a trailing slash .
URL entryUrl = rootContainer . createEntryUri ( getRelativePath ( ) + "/" ) . toURL ( ) ; return Collections . singleton ( entryUrl ) ; } catch ( MalformedURLException e ) { // FFDC
return Collections . emptyList ( ) ; }
|
public class PathNormalizer { /** * Cygwin prefers lowercase drive letters , but other parts of maven use
* uppercase
* @ param path
* @ return String */
static final String uppercaseDrive ( String path ) { } }
|
String resultPath = null ; if ( path != null ) { if ( path . length ( ) >= 2 && path . charAt ( 1 ) == ':' ) { resultPath = Character . toUpperCase ( path . charAt ( 0 ) ) + path . substring ( 1 ) ; } else { resultPath = path ; } } return resultPath ;
|
public class ScatteredConsistentHashFactory { /** * Merges two consistent hash objects that have the same number of segments , numOwners and hash function .
* For each segment , the primary owner of the first CH has priority , the other primary owners become backups . */
@ Override public ScatteredConsistentHash union ( ScatteredConsistentHash dch1 , ScatteredConsistentHash dch2 ) { } }
|
return dch1 . union ( dch2 ) ;
|
public class JSONConverter { /** * Encode an MBeanQuery instance as JSON :
* " objectName " : ObjectName ,
* " queryExp " : Base64,
* " className " : String ,
* @ param out The stream to write JSON to
* @ param value The MBeanQuery instance to encode . Can ' t be null .
* @ throws IOException If an I / O error occurs
* @ see # readMBeanQuery ( InputStream ) */
public void writeMBeanQuery ( OutputStream out , MBeanQuery value ) throws IOException { } }
|
writeStartObject ( out ) ; writeObjectNameField ( out , OM_OBJECTNAME , value . objectName ) ; // TODO : Produce proper JSON for QueryExp ?
writeSerializedField ( out , OM_QUERYEXP , value . queryExp ) ; writeStringField ( out , OM_CLASSNAME , value . className ) ; writeEndObject ( out ) ;
|
public class PatchComputer { /** * precondition : readPtr > 0 */
private boolean continueBlock ( ) throws IOException { } }
|
byte lastByte = buffer [ readPtr - 1 ] ; while ( true ) { if ( maybeFlush ( ) ) return true ; if ( ! hasFullBlock ( ) ) { refillBuffer ( ) ; if ( ! hasFullBlock ( ) ) { state = StateContinuePartialBlock ; return continueContinuePartialBlock ( lastByte ) ; } } int weakHash = rc . roll ( lastByte , buffer [ readPtr + blockSize - 1 ] ) ; int blockNum = signatureTable . findBlock ( weakHash , buffer , readPtr , blockSize ) ; if ( blockNum != - 1 ) { writeBlock ( blockNum , blockSize ) ; state = StateNewBlock ; return true ; } lastByte = buffer [ readPtr ] ; readPtr += 1 ; }
|
public class CollUtil { /** * 多个集合的并集 < br >
* 针对一个集合中存在多个相同元素的情况 , 计算两个集合中此元素的个数 , 保留最多的个数 < br >
* 例如 : 集合1 : [ a , b , c , c , c ] , 集合2 : [ a , b , c , c ] < br >
* 结果 : [ a , b , c , c , c ] , 此结果中只保留了三个c
* @ param < T > 集合元素类型
* @ param coll1 集合1
* @ param coll2 集合2
* @ param otherColls 其它集合
* @ return 并集的集合 , 返回 { @ link ArrayList } */
@ SafeVarargs public static < T > Collection < T > union ( Collection < T > coll1 , Collection < T > coll2 , Collection < T > ... otherColls ) { } }
|
Collection < T > union = union ( coll1 , coll2 ) ; for ( Collection < T > coll : otherColls ) { union = union ( union , coll ) ; } return union ;
|
public class TGetTablesReq { /** * Returns true if field corresponding to fieldID is set ( has been assigned a value ) and false otherwise */
public boolean isSet ( _Fields field ) { } }
|
if ( field == null ) { throw new IllegalArgumentException ( ) ; } switch ( field ) { case SESSION_HANDLE : return isSetSessionHandle ( ) ; case CATALOG_NAME : return isSetCatalogName ( ) ; case SCHEMA_NAME : return isSetSchemaName ( ) ; case TABLE_NAME : return isSetTableName ( ) ; case TABLE_TYPES : return isSetTableTypes ( ) ; } throw new IllegalStateException ( ) ;
|
public class CSIv2SubsystemFactory { /** * { @ inheritDoc } */
@ Override public void addTargetORBInitProperties ( Properties initProperties , Map < String , Object > configProps , List < IIOPEndpoint > endpoints , Map < String , Object > extraProperties ) { } }
|
StringBuilder sb = new StringBuilder ( ) ; Map < String , List < TransportAddress > > addrMap = extractTransportAddresses ( configProps , endpoints , sb ) ; extraProperties . put ( ADDR_KEY , addrMap ) ; sb . setLength ( sb . length ( ) - 1 ) ; initProperties . put ( ENDPOINT_KEY , sb . toString ( ) ) ;
|
public class ChangeTitleOnChangeHandler { /** * The Field has Changed .
* This method tries to get the new title for the screen and sets the new frame title .
* @ param bDisplayOption If true , display the change .
* @ param iMoveMode The type of move being done ( init / read / screen ) .
* @ return The error code ( or NORMAL _ RETURN if okay ) . */
public int fieldChanged ( boolean bDisplayOption , int iMoveMode ) { } }
|
Record recDefault = this . getOwner ( ) . getRecord ( ) ; ComponentParent screen = null ; if ( recDefault . getRecordOwner ( ) instanceof ScreenParent ) screen = ( ComponentParent ) recDefault . getRecordOwner ( ) ; screen = screen . getRootScreen ( ) ; String strScreenTitle = Constants . BLANK ; if ( m_bSetTitleToThisString ) strScreenTitle = this . getOwner ( ) . getString ( ) ; if ( strScreenTitle . length ( ) == 0 ) strScreenTitle = this . getTitle ( screen ) ; if ( strScreenTitle . length ( ) > 0 ) { Object pWnd = screen . getControl ( ) ; JFrame pWndFrame = null ; if ( pWndFrame == null ) pWndFrame = ( JFrame ) pWnd ; if ( pWndFrame != null ) pWndFrame . setTitle ( strScreenTitle ) ; } return DBConstants . NORMAL_RETURN ;
|
public class UseEnumCollections { /** * implements the visitor to reset the state
* @ param obj
* the context object for the currently parsed method */
@ Override public void visitMethod ( Method obj ) { } }
|
stack . resetForMethodEntry ( this ) ; enumRegs . clear ( ) ; super . visitMethod ( obj ) ;
|
public class JsiiClient { /** * Completes a callback .
* @ param callback The callback to complete .
* @ param error Error information ( or null ) .
* @ param result Result ( or null ) . */
public void completeCallback ( final Callback callback , final String error , final JsonNode result ) { } }
|
ObjectNode req = makeRequest ( "complete" ) ; req . put ( "cbid" , callback . getCbid ( ) ) ; req . put ( "err" , error ) ; req . set ( "result" , result ) ; this . runtime . requestResponse ( req ) ;
|
public class ThreadLocalSessionProviderService { /** * { @ inheritDoc } */
public SessionProvider getSystemSessionProvider ( Object key ) { } }
|
if ( systemSessionProviderKeeper . get ( ) != null ) { return systemSessionProviderKeeper . get ( ) ; } else { final SessionProvider ssp = SessionProvider . createSystemProvider ( ) ; systemSessionProviderKeeper . set ( ssp ) ; return ssp ; }
|
public class ClassBuilder { /** * Build the field documentation .
* @ param node the XML element that specifies which components to document
* @ param memberDetailsTree the content tree to which the documentation will be added */
public void buildFieldDetails ( XMLNode node , Content memberDetailsTree ) throws Exception { } }
|
configuration . getBuilderFactory ( ) . getFieldBuilder ( writer ) . buildChildren ( node , memberDetailsTree ) ;
|
public class ActivityModificationChangeConstraint { /** * Extracts the modification terms from the moficiation features .
* @ param mfMap map for the features
* @ return map from EntityReference to the set of the extracted terms */
protected Map < EntityReference , Set < String > > extractModifNames ( Map mfMap ) { } }
|
Map < EntityReference , Set < String > > map = new HashMap < EntityReference , Set < String > > ( ) ; for ( Object o : mfMap . keySet ( ) ) { EntityReference er = ( EntityReference ) o ; map . put ( er , extractModifNames ( ( Set ) mfMap . get ( er ) ) ) ; } return map ;
|
public class Label { /** * Marks this basic block as belonging to the given subroutine .
* @ param id
* a subroutine id .
* @ param nbSubroutines
* the total number of subroutines in the method . */
void addToSubroutine ( final long id , final int nbSubroutines ) { } }
|
if ( ( status & VISITED ) == 0 ) { status |= VISITED ; srcAndRefPositions = new int [ nbSubroutines / 32 + 1 ] ; } srcAndRefPositions [ ( int ) ( id >>> 32 ) ] |= ( int ) id ;
|
public class J4pClientBuilder { /** * Set the proxy for this client
* @ param pProxyHost proxy hostname
* @ param pProxyPort proxy port number
* @ param pProxyUser proxy authentication username
* @ param pProxyPass proxy authentication password */
public final J4pClientBuilder proxy ( String pProxyHost , int pProxyPort , String pProxyUser , String pProxyPass ) { } }
|
httpProxy = new Proxy ( pProxyHost , pProxyPort , pProxyUser , pProxyPass ) ; return this ;
|
public class DescribableList { /** * Binds items in the collection to URL . */
public T getDynamic ( String id ) { } }
|
// by ID
for ( T t : data ) if ( t . getDescriptor ( ) . getId ( ) . equals ( id ) ) return t ; // by position
try { return data . get ( Integer . parseInt ( id ) ) ; } catch ( NumberFormatException e ) { // fall through
} return null ;
|
public class DefaultSentryClientFactory { /** * The maximum length of the message body in the requests to the Sentry Server .
* @ param dsn Sentry server DSN which may contain options .
* @ return The maximum length of the message body in the requests to the Sentry Server . */
protected int getMaxMessageLength ( Dsn dsn ) { } }
|
return Util . parseInteger ( Lookup . lookup ( MAX_MESSAGE_LENGTH_OPTION , dsn ) , JsonMarshaller . DEFAULT_MAX_MESSAGE_LENGTH ) ;
|
public class TextImpl { /** * Tries to remove this node using itself and the previous node as context .
* If this node ' s text is empty , this node is removed and null is returned .
* If the previous node exists and is a text node , this node ' s text will be
* appended to that node ' s text and this node will be removed .
* < p > Although this method alters the structure of the DOM tree , it does
* not alter the document ' s semantics .
* @ return the node holding this node ' s text and the end of the operation .
* Can be null if this node contained the empty string . */
public final TextImpl minimize ( ) { } }
|
if ( getLength ( ) == 0 ) { parent . removeChild ( this ) ; return null ; } Node previous = getPreviousSibling ( ) ; if ( previous == null || previous . getNodeType ( ) != Node . TEXT_NODE ) { return this ; } TextImpl previousText = ( TextImpl ) previous ; previousText . buffer . append ( buffer ) ; parent . removeChild ( this ) ; return previousText ;
|
public class ReflectedHeap { /** * { @ inheritDoc } */
@ Override @ SuppressWarnings ( "unchecked" ) public Handle < K , V > findMin ( ) { } }
|
if ( size == 0 ) { throw new NoSuchElementException ( ) ; } else if ( size == 1 ) { return free ; } else if ( size % 2 == 0 ) { return minHeap . findMin ( ) . getValue ( ) . outer ; } else { AddressableHeap . Handle < K , HandleMap < K , V > > minInnerHandle = minHeap . findMin ( ) ; int c ; if ( comparator == null ) { c = ( ( Comparable < ? super K > ) minInnerHandle . getKey ( ) ) . compareTo ( free . key ) ; } else { c = comparator . compare ( minInnerHandle . getKey ( ) , free . key ) ; } if ( c < 0 ) { return minInnerHandle . getValue ( ) . outer ; } else { return free ; } }
|
public class Apptentive { /** * Use this method in your push receiver to get the notification body text you can use to
* construct a { @ link android . app . Notification } object .
* @ param data A { @ link Map } & lt ; { @ link String } , { @ link String } & gt ; containing the Apptentive Push
* data . Pass in what you receive in the the Service or BroadcastReceiver that is
* used by your chosen push provider .
* @ return a String value , or null . */
public static String getBodyFromApptentivePush ( Map < String , String > data ) { } }
|
try { if ( ! ApptentiveInternal . checkRegistered ( ) ) { return null ; } if ( data == null ) { return null ; } return data . get ( ApptentiveInternal . BODY_DEFAULT ) ; } catch ( Exception e ) { ApptentiveLog . e ( PUSH , e , "Exception while getting body from Apptentive push" ) ; logException ( e ) ; } return null ;
|
public class MultiDecoder { /** * Decodes byte array .
* @ param data class name and byte payload */
@ Override public T decode ( final byte [ ] data ) { } }
|
final WakeTuplePBuf tuple ; try { tuple = WakeTuplePBuf . parseFrom ( data ) ; } catch ( final InvalidProtocolBufferException e ) { e . printStackTrace ( ) ; throw new RemoteRuntimeException ( e ) ; } final String className = tuple . getClassName ( ) ; final byte [ ] message = tuple . getData ( ) . toByteArray ( ) ; final Class < ? > clazz ; try { clazz = Class . forName ( className ) ; } catch ( final ClassNotFoundException e ) { e . printStackTrace ( ) ; throw new RemoteRuntimeException ( e ) ; } return clazzToDecoderMap . get ( clazz ) . decode ( message ) ;
|
public class CPOptionCategoryPersistenceImpl { /** * Returns a range of all the cp option categories where companyId = & # 63 ; .
* Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and < code > end < / code > are not primary keys , they are indexes in the result set . Thus , < code > 0 < / code > refers to the first result in the set . Setting both < code > start < / code > and < code > end < / code > to { @ link QueryUtil # ALL _ POS } will return the full result set . If < code > orderByComparator < / code > is specified , then the query will include the given ORDER BY logic . If < code > orderByComparator < / code > is absent and pagination is required ( < code > start < / code > and < code > end < / code > are not { @ link QueryUtil # ALL _ POS } ) , then the query will include the default ORDER BY logic from { @ link CPOptionCategoryModelImpl } . If both < code > orderByComparator < / code > and pagination are absent , for performance reasons , the query will not have an ORDER BY clause and the returned result set will be sorted on by the primary key in an ascending order .
* @ param companyId the company ID
* @ param start the lower bound of the range of cp option categories
* @ param end the upper bound of the range of cp option categories ( not inclusive )
* @ return the range of matching cp option categories */
@ Override public List < CPOptionCategory > findByCompanyId ( long companyId , int start , int end ) { } }
|
return findByCompanyId ( companyId , start , end , null ) ;
|
public class ClassInfo { /** * Get the classes ( and their subclasses ) that implement this interface , if this is an interface .
* @ return the list of the classes ( and their subclasses ) that implement this interface , if this is an
* interface , otherwise returns the empty list . */
public ClassInfoList getClassesImplementing ( ) { } }
|
if ( ! isInterface ) { throw new IllegalArgumentException ( "Class is not an interface: " + getName ( ) ) ; } // Subclasses of implementing classes also implement the interface
final ReachableAndDirectlyRelatedClasses implementingClasses = this . filterClassInfo ( RelType . CLASSES_IMPLEMENTING , /* strictWhitelist = */
! isExternalClass ) ; final Set < ClassInfo > allImplementingClasses = new LinkedHashSet < > ( implementingClasses . reachableClasses ) ; for ( final ClassInfo implementingClass : implementingClasses . reachableClasses ) { final Set < ClassInfo > implementingSubclasses = implementingClass . filterClassInfo ( RelType . SUBCLASSES , /* strictWhitelist = */
! implementingClass . isExternalClass ) . reachableClasses ; allImplementingClasses . addAll ( implementingSubclasses ) ; } return new ClassInfoList ( allImplementingClasses , implementingClasses . directlyRelatedClasses , /* sortByName = */
true ) ;
|
public class DescribePublicIpv4PoolsRequest { /** * The IDs of the address pools .
* @ param poolIds
* The IDs of the address pools . */
public void setPoolIds ( java . util . Collection < String > poolIds ) { } }
|
if ( poolIds == null ) { this . poolIds = null ; return ; } this . poolIds = new com . amazonaws . internal . SdkInternalList < String > ( poolIds ) ;
|
public class TaskManagerService { /** * tasks we can run . Shutdown when told to do so . */
private void manageTasks ( ) { } }
|
setHostAddress ( ) ; while ( ! m_bShutdown ) { checkAllTasks ( ) ; checkForDeadTasks ( ) ; try { Thread . sleep ( SLEEP_TIME_MILLIS ) ; } catch ( InterruptedException e ) { } } m_executor . shutdown ( ) ;
|
public class PropertyUtil { /** * Returns a property value as a string list .
* @ param propertyName Name of the property whose value is sought .
* @ param instanceName An optional instance name . Specify null to indicate the default instance .
* @ return The property value as a string list , or null if not found .
* @ see IPropertyService # getValues */
public static List < String > getValues ( String propertyName , String instanceName ) { } }
|
return getPropertyService ( ) . getValues ( propertyName , instanceName ) ;
|
public class BasicQueryOutputProcessor { /** * { @ inheritDoc } */
public Map < String , Object > toMap ( List < QueryParameters > paramsList ) { } }
|
Map < String , Object > result = null ; Iterator < QueryParameters > iterator = paramsList . iterator ( ) ; // skipping header
if ( iterator . hasNext ( ) == true ) { iterator . next ( ) ; } if ( iterator . hasNext ( ) == true ) { result = this . toMap ( iterator . next ( ) ) ; } else { result = new HashMap < String , Object > ( ) ; } return result ;
|
public class NameNodeSafeModeInfo { /** * Print status every 20 seconds . */
private void reportStatus ( String msg , boolean rightNow ) { } }
|
long curTime = FSNamesystem . now ( ) ; if ( ! rightNow && ( curTime - lastStatusReport < 20 * 1000 ) ) { return ; } FLOG . info ( msg + " \n" + getTurnOffTip ( ) ) ; lastStatusReport = curTime ;
|
public class ProjectServlet { /** * We know the intention of API call is to return project ownership based on given user . < br > If
* user provides an user name , the method honors it < br > If user provides an empty user name , the
* user defaults to the session user < br > If user does not provide the user param , the user also
* defaults to the session user < br > */
private void handleFetchUserProjects ( final HttpServletRequest req , final Session session , final ProjectManager manager , final HashMap < String , Object > ret ) throws ServletException { } }
|
User user = null ; // if key " user " is specified , follow this logic
if ( hasParam ( req , "user" ) ) { final String userParam = getParam ( req , "user" ) ; if ( userParam . isEmpty ( ) ) { user = session . getUser ( ) ; } else { user = new User ( userParam ) ; } } else { // if key " user " is not specified , default to the session user
user = session . getUser ( ) ; } final List < Project > projects = manager . getUserProjects ( user ) ; final List < SimplifiedProject > simplifiedProjects = toSimplifiedProjects ( projects ) ; ret . put ( "projects" , simplifiedProjects ) ;
|
public class TypeConverter { /** * Return the value converted to a char
* or the specified alternate value if the original value is null . Note ,
* this method still throws { @ link IllegalArgumentException } if the value
* is not null and could not be converted .
* @ paramvalue
* The value to be converted
* @ paramnullValue
* The value to be returned if { @ link value } is null . Note , this
* value will not be returned if the conversion fails otherwise .
* @ throwsIllegalArgumentException
* If the value cannot be converted */
public static char asChar ( Object value , char nullValue ) { } }
|
value = convert ( Character . class , value ) ; return ( value != null ) ? ( ( Character ) value ) . charValue ( ) : nullValue ;
|
public class Imports { /** * Sorts the current set of { @ code Import } s by name and returns them as new instance of { @ code Imports } .
* @ return new instance of { @ code Imports } */
@ Nonnull public Imports sortByName ( ) { } }
|
final List < Import > imports = Lists . newArrayList ( this . imports ) ; Collections . sort ( imports , ORDER . nullsLast ( ) ) ; return new Imports ( imports ) ;
|
public class RtpPacket { /** * Encapsulates data into the packet for transmission via RTP .
* @ param mark mark field
* @ param payloadType payload type field .
* @ param seqNumber sequence number field
* @ param timestamp timestamp field
* @ param ssrc synchronization source field
* @ param data data buffer
* @ param offset offset in the data buffer
* @ param len the number of bytes */
public void wrap ( boolean mark , int payloadType , int seqNumber , long timestamp , long ssrc , byte [ ] data , int offset , int len ) { } }
|
buffer . clear ( ) ; buffer . rewind ( ) ; // no extensions , paddings and cc
buffer . put ( ( byte ) 0x80 ) ; byte b = ( byte ) ( payloadType ) ; if ( mark ) { b = ( byte ) ( b | 0x80 ) ; } buffer . put ( b ) ; // sequence number
buffer . put ( ( byte ) ( ( seqNumber & 0xFF00 ) >> 8 ) ) ; buffer . put ( ( byte ) ( seqNumber & 0x00FF ) ) ; // timestamp
buffer . put ( ( byte ) ( ( timestamp & 0xFF000000 ) >> 24 ) ) ; buffer . put ( ( byte ) ( ( timestamp & 0x00FF0000 ) >> 16 ) ) ; buffer . put ( ( byte ) ( ( timestamp & 0x0000FF00 ) >> 8 ) ) ; buffer . put ( ( byte ) ( ( timestamp & 0x000000FF ) ) ) ; // ssrc
buffer . put ( ( byte ) ( ( ssrc & 0xFF000000 ) >> 24 ) ) ; buffer . put ( ( byte ) ( ( ssrc & 0x00FF0000 ) >> 16 ) ) ; buffer . put ( ( byte ) ( ( ssrc & 0x0000FF00 ) >> 8 ) ) ; buffer . put ( ( byte ) ( ( ssrc & 0x000000FF ) ) ) ; buffer . put ( data , offset , len ) ; buffer . flip ( ) ; buffer . rewind ( ) ;
|
public class UserProfileBuilder { /** * internal helpers */
private String [ ] firstAndLastName ( String name ) { } }
|
if ( name == null ) { return EMPTY_FIRST_AND_LAST_NAME_ARRAY ; } String [ ] nameParts = name . split ( "\\s+" ) ; if ( nameParts . length == 1 ) { return new String [ ] { nameParts [ 0 ] , null } ; } else { return new String [ ] { nameParts [ 0 ] , nameParts [ nameParts . length - 1 ] } ; }
|
public class AbstractServiceValidateController { /** * Generate error view .
* @ param code the code
* @ param args the args
* @ param request the request
* @ return the model and view */
private ModelAndView generateErrorView ( final String code , final Object [ ] args , final HttpServletRequest request , final WebApplicationService service ) { } }
|
val modelAndView = serviceValidateConfigurationContext . getValidationViewFactory ( ) . getModelAndView ( request , false , service , getClass ( ) ) ; val convertedDescription = this . applicationContext . getMessage ( code , args , code , request . getLocale ( ) ) ; modelAndView . addObject ( CasViewConstants . MODEL_ATTRIBUTE_NAME_ERROR_CODE , StringEscapeUtils . escapeHtml4 ( code ) ) ; modelAndView . addObject ( CasViewConstants . MODEL_ATTRIBUTE_NAME_ERROR_DESCRIPTION , StringEscapeUtils . escapeHtml4 ( convertedDescription ) ) ; return modelAndView ;
|
public class TaskStatus { /** * The full error message will be available via a TaskReport . */
private static String truncateErrorMsg ( String errorMsg ) { } }
|
if ( errorMsg != null && errorMsg . length ( ) > MAX_ERROR_MSG_LENGTH ) { return errorMsg . substring ( 0 , MAX_ERROR_MSG_LENGTH ) + "..." ; } else { return errorMsg ; }
|
public class Decoder { /** * Get a decoder for the given charset . */
public static Decoder get ( Charset charset ) throws Exception { } }
|
Class < ? extends Decoder > cl = decoders . get ( charset . name ( ) ) ; if ( cl == null ) { CharsetDecoder decoder = charset . newDecoder ( ) ; decoder . onMalformedInput ( CodingErrorAction . REPLACE ) ; decoder . onUnmappableCharacter ( CodingErrorAction . REPLACE ) ; return new DefaultDecoder ( decoder ) ; } return cl . newInstance ( ) ;
|
public class ThreadLogFormatter { /** * Check if the class name starts with one of the prefixes specified in ` dropPrefix ` ,
* and remove it . e . g . for class name ` org . apache . reef . util . logging . Config ` and
* prefix ` com . microsoft . ` ( note the trailing dot ) , the result will be
* ` reef . util . logging . Config ` */
private String trimPrefix ( final String className ) { } }
|
for ( final String prefix : this . dropPrefix ) { if ( className . startsWith ( prefix ) ) { return className . substring ( prefix . length ( ) ) ; } } return className ;
|
public class JcrSystemViewExporter { /** * Fires the appropriate SAX events on the content handler to build the XML elements for the value .
* @ param value the value to be exported
* @ param contentHandler the SAX content handler for which SAX events will be invoked as the XML document is created .
* @ param propertyType the { @ link PropertyType } for the given value
* @ param skipBinary if < code > true < / code > , indicates that binary properties should not be exported
* @ throws SAXException if an exception occurs during generation of the XML document
* @ throws RepositoryException if an exception occurs accessing the content repository */
private void emitValue ( Value value , ContentHandler contentHandler , int propertyType , boolean skipBinary ) throws RepositoryException , SAXException { } }
|
if ( PropertyType . BINARY == propertyType ) { startElement ( contentHandler , JcrSvLexicon . VALUE , null ) ; // Per section 6.5 of the 1.0.1 spec , we need to emit one empty - value tag for each value if the property is
// multi - valued and skipBinary is true
if ( ! skipBinary ) { byte [ ] bytes = new byte [ BASE_64_BUFFER_SIZE ] ; int len ; Binary binary = value . getBinary ( ) ; try { InputStream stream = new Base64 . InputStream ( binary . getStream ( ) , Base64 . ENCODE ) ; try { while ( - 1 != ( len = stream . read ( bytes ) ) ) { contentHandler . characters ( new String ( bytes , 0 , len ) . toCharArray ( ) , 0 , len ) ; } } finally { stream . close ( ) ; } } catch ( IOException ioe ) { throw new RepositoryException ( ioe ) ; } finally { binary . dispose ( ) ; } } endElement ( contentHandler , JcrSvLexicon . VALUE ) ; } else { emitValue ( value . getString ( ) , contentHandler ) ; }
|
public class Store { /** * remove Fedora object from low - level store */
public final void remove ( String pid ) throws LowlevelStorageException { } }
|
File file = getFile ( pid ) ; pathRegistry . remove ( pid ) ; fileSystem . delete ( file ) ;
|
public class Transition { /** * Utility method to manage the boilerplate code that is the same whether we
* are excluding targets or their children . */
@ Nullable private static < T > ArrayList < T > excludeObject ( @ Nullable ArrayList < T > list , @ Nullable T target , boolean exclude ) { } }
|
if ( target != null ) { if ( exclude ) { list = ArrayListManager . add ( list , target ) ; } else { list = ArrayListManager . remove ( list , target ) ; } } return list ;
|
public class JsMsgObject { /** * Return a copy of this JsMsgObject .
* The copy can be considered a true and independant copy of the original , but for
* performance reasons it may start by sharing data with the original and only
* copying if ( or when ) updates are made .
* @ return JsMsgObject A JMO which is a copy of this .
* @ exception MessageCopyFailedException will be thrown if the copy can not be made . */
JsMsgObject getCopy ( ) throws MessageCopyFailedException { } }
|
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getCopy" ) ; JsMsgObject newJmo = null ; try { // We need to lock the whole of the copy with the getHdr2 , getApi & getPayload
// methods on the owning message , otherwise someone could reinstate the partcaches
// between clearing them and creating the new parts . d352642
synchronized ( theMessage ) { // Ensure any cached message data is written back and cached message parts are
// invalidated .
theMessage . updateDataFields ( MfpConstants . UDF_GET_COPY ) ; theMessage . clearPartCaches ( ) ; // Clone this JMO and insert a copy of the underlying JMF message . It is the JMF
// that handles all the " lazy " copying .
newJmo = new JsMsgObject ( null ) ; newJmo . headerPart = new JsMsgPart ( ( ( JMFMessage ) headerPart . jmfPart ) . copy ( ) ) ; newJmo . payloadPart = new JsMsgPart ( ( ( JMFMessage ) payloadPart . jmfPart ) . copy ( ) ) ; } } catch ( MessageDecodeFailedException e ) { // Dump whatever we can of both message parts
FFDCFilter . processException ( e , "com.ibm.ws.sib.mfp.impl.JsMsgObject.getCopy" , "jmo800" , this , new Object [ ] { new Object [ ] { MfpConstants . DM_MESSAGE , headerPart . jmfPart , theMessage } , new Object [ ] { MfpConstants . DM_MESSAGE , payloadPart . jmfPart , theMessage } } ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "copy failed: " + e ) ; throw new MessageCopyFailedException ( e ) ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "getCopy" , newJmo ) ; return newJmo ;
|
public class Events { /** * Creates event builder for provided event key . */
public static Event . Builder create ( @ NonNull String eventKey ) { } }
|
return new Event . Builder ( dispatcher , eventKey ) ;
|
public class DefaultConversionService { /** * internal helpers */
private static void addScalarConverters ( ConverterRegistry converterRegistry ) { } }
|
ConversionService conversionService = ( ConversionService ) converterRegistry ; converterRegistry . addConverter ( new StringToBooleanConverter ( ) ) ; converterRegistry . addConverter ( Boolean . class , String . class , new ObjectToStringConverter ( ) ) ; converterRegistry . addConverterFactory ( new StringToNumberConverterFactory ( ) ) ; converterRegistry . addConverter ( Number . class , String . class , new ObjectToStringConverter ( ) ) ; converterRegistry . addConverterFactory ( new NumberToNumberConverterFactory ( ) ) ; converterRegistry . addConverter ( new StringToCharacterConverter ( ) ) ; converterRegistry . addConverter ( Character . class , String . class , new ObjectToStringConverter ( ) ) ; converterRegistry . addConverter ( new NumberToCharacterConverter ( ) ) ; converterRegistry . addConverterFactory ( new CharacterToNumberFactory ( ) ) ; converterRegistry . addConverterFactory ( new StringToEnumConverterFactory ( ) ) ; converterRegistry . addConverter ( Enum . class , String . class , new EnumToStringConverter ( conversionService ) ) ; converterRegistry . addConverter ( new StringToLocaleConverter ( ) ) ; converterRegistry . addConverter ( Locale . class , String . class , new ObjectToStringConverter ( ) ) ; converterRegistry . addConverter ( new PropertiesToStringConverter ( ) ) ; converterRegistry . addConverter ( new StringToPropertiesConverter ( ) ) ; converterRegistry . addConverter ( new StringToUUIDConverter ( ) ) ; converterRegistry . addConverter ( UUID . class , String . class , new ObjectToStringConverter ( ) ) ;
|
public class Pagination { /** * Parses a parameter to an Integer , defaulting to 0 upon any errors encountered .
* @ param value the value to parse
* @ param defaultValue the default value to use
* @ return an Integer */
private Integer parseIntegerFromParam ( final String value , final int defaultValue ) { } }
|
try { return Integer . valueOf ( value ) ; } catch ( NumberFormatException | NullPointerException e ) { return defaultValue ; }
|
public class MethodUtils { /** * < p > Invokes a named { @ code static } method whose parameter type matches the object type . < / p >
* < p > This method delegates the method search to { @ link # getMatchingAccessibleMethod ( Class , String , Class [ ] ) } . < / p >
* < p > This method supports calls to methods taking primitive parameters
* via passing in wrapping classes . So , for example , a { @ code Boolean } class
* would match a { @ code boolean } primitive . < / p >
* < p > This is a convenient wrapper for
* { @ link # invokeStaticMethod ( Class , String , Object [ ] , Class [ ] ) } .
* @ param cls invoke static method on this class
* @ param methodName get method with this name
* @ param args use these arguments - treat { @ code null } as empty array
* @ return The value returned by the invoked method
* @ throws NoSuchMethodException if there is no such accessible method
* @ throws InvocationTargetException wraps an exception thrown by the
* method invoked
* @ throws IllegalAccessException if the requested method is not accessible
* via reflection */
public static Object invokeStaticMethod ( final Class < ? > cls , final String methodName , Object ... args ) throws NoSuchMethodException , IllegalAccessException , InvocationTargetException { } }
|
args = ArrayUtils . nullToEmpty ( args ) ; final Class < ? > [ ] parameterTypes = ClassUtils . toClass ( args ) ; return invokeStaticMethod ( cls , methodName , args , parameterTypes ) ;
|
public class LuceneSpellChecker { /** * { @ inheritDoc }
* @ throws RepositoryException */
public String check ( QueryRootNode aqt ) throws IOException , RepositoryException { } }
|
String stmt = getFulltextStatement ( aqt ) ; if ( stmt == null ) { // no spellcheck operation in query
return null ; } return spellChecker . suggest ( stmt ) ;
|
public class SQLExpressions { /** * Get an aggregate any expression for the given boolean expression */
public static BooleanExpression any ( BooleanExpression expr ) { } }
|
return Expressions . booleanOperation ( Ops . AggOps . BOOLEAN_ANY , expr ) ;
|
public class AbstractClusterApiClient { /** * Assemble path elements to form an HTTP path :
* - if an element starts with a slash , it is kept . Otherwise a trailing slash is added .
* - if an element ends with a slash , it is removed .
* - if an element is null , it is ignored .
* @ param paths the elements of the path .
* @ return returns the full path . */
public static String buildPath ( String ... paths ) { } }
|
if ( paths == null || paths . length == 0 ) { throw new IllegalArgumentException ( "Path must at least contain one element" ) ; } StringBuilder path = new StringBuilder ( ) ; for ( int i = 0 ; i < paths . length ; i ++ ) { String p = paths [ i ] ; if ( p == null ) continue ; // skip separator if one already present
if ( p . charAt ( 0 ) != '/' ) { path . append ( '/' ) ; } // remove trailing /
if ( p . charAt ( p . length ( ) - 1 ) == '/' ) { path . append ( p , 0 , p . length ( ) - 1 ) ; } else { path . append ( p ) ; } } return path . toString ( ) ;
|
public class DeleteRouteTableRequest { /** * This method is intended for internal use only . Returns the marshaled request configured with additional
* parameters to enable operation dry - run . */
@ Override public Request < DeleteRouteTableRequest > getDryRunRequest ( ) { } }
|
Request < DeleteRouteTableRequest > request = new DeleteRouteTableRequestMarshaller ( ) . marshall ( this ) ; request . addParameter ( "DryRun" , Boolean . toString ( true ) ) ; return request ;
|
public class ExternalContext { /** * < p class = " changed _ added _ 2_0 " > Returns a String containing the real
* path for a given virtual path . < / p >
* < div class = " changed _ added _ 2_0 " >
* < p > < em > Servlet : < / em > This must be the value returned by the
* < code > javax . servlet . ServletContext < / code > method
* < code > getRealPath ( ) < / code > . < / p >
* < p > The default implementation throws
* < code > UnsupportedOperationException < / code > and is provided
* for the sole purpose of not breaking existing applications that extend
* this class . < / p >
* < / div >
* @ param path The context of the requested initialization parameter
* @ since 2.0 */
public String getRealPath ( String path ) { } }
|
if ( defaultExternalContext != null ) { return defaultExternalContext . getRealPath ( path ) ; } throw new UnsupportedOperationException ( ) ;
|
public class NetworkServiceDescriptorAgent { /** * Delete a specific PhysicalNetworkFunctionDescriptor which is contained in a particular
* NetworkServiceDescriptor .
* @ param idNsd the NetworkServiceDescriptor ' s ID
* @ param idPnf : the PhysicalNetworkFunctionDescriptor ' s ID
* @ throws SDKException if the request fails */
@ Help ( help = "Delete the PhysicalNetworkFunctionDescriptor of a NetworkServiceDescriptor with specific id" ) public void deletePhysicalNetworkFunctionDescriptor ( final String idNsd , final String idPnf ) throws SDKException { } }
|
String url = idNsd + "/pnfdescriptors" + "/" + idPnf ; requestDelete ( url ) ;
|
public class DecimalFormat { /** * < strong > [ icu ] < / strong > Sets the rounding increment . In the absence of a rounding increment , numbers
* will be rounded to the number of digits displayed .
* @ param newValue A positive rounding increment , or < code > null < / code > or
* < code > BigDecimal ( 0.0 ) < / code > to use the default rounding increment .
* @ throws IllegalArgumentException if < code > newValue < / code > is & lt ; 0.0
* @ see # getRoundingIncrement
* @ see # getRoundingMode
* @ see # setRoundingMode */
public void setRoundingIncrement ( java . math . BigDecimal newValue ) { } }
|
if ( newValue == null ) { setRoundingIncrement ( ( BigDecimal ) null ) ; } else { setRoundingIncrement ( new BigDecimal ( newValue ) ) ; }
|
public class ConnectionImpl { /** * / * ( non - Javadoc )
* @ see tuwien . auto . calimero . knxnetip . KNXnetIPConnection # removeConnectionListener
* ( tuwien . auto . calimero . KNXListener ) */
public void removeConnectionListener ( KNXListener l ) { } }
|
synchronized ( listeners ) { if ( listeners . remove ( l ) ) listenersCopy = new ArrayList ( listeners ) ; }
|
public class KeyValueFormat { /** * If input is null , then an empty map is returned . */
public static < K , V > Map < K , V > parse ( @ Nullable String input , Converter < K > keyConverter , Converter < V > valueConverter ) { } }
|
Map < K , V > map = new LinkedHashMap < > ( ) ; if ( input != null ) { FieldParser reader = new FieldParser ( input ) ; boolean end = false ; while ( ! end ) { String key = reader . nextKey ( ) ; if ( key == null ) { end = true ; } else { String val = StringUtils . defaultString ( reader . nextVal ( ) , "" ) ; map . put ( keyConverter . parse ( key ) , valueConverter . parse ( val ) ) ; } } } return map ;
|
public class ArchiveReader { /** * Test Archive file is valid .
* Assumes the stream is at the start of the file . Be aware that this
* method makes a pass over the whole file .
* @ return True if file can be successfully parsed . */
public boolean isValid ( ) { } }
|
boolean valid = false ; try { validate ( ) ; valid = true ; } catch ( Exception e ) { // File is not valid if exception thrown parsing .
valid = false ; } return valid ;
|
public class TimeZone { /** * < strong > [ icu ] < / strong > Returns a set of time zone ID strings with the given filter conditions .
* < p > < b > Note : < / b > A < code > Set < / code > returned by this method is
* immutable .
* @ param zoneType The system time zone type .
* @ param region The ISO 3166 two - letter country code or UN M . 49 three - digit area code .
* When null , no filtering done by region .
* @ param rawOffset An offset from GMT in milliseconds , ignoring the effect of daylight savings
* time , if any . When null , no filtering done by zone offset .
* @ return an immutable set of system time zone IDs .
* @ see SystemTimeZoneType */
public static Set < String > getAvailableIDs ( SystemTimeZoneType zoneType , String region , Integer rawOffset ) { } }
|
return ZoneMeta . getAvailableIDs ( zoneType , region , rawOffset ) ;
|
public class SparkLine { /** * Sets the color theme for the sparkline .
* @ param LCD _ COLOR */
public void setSparkLineColor ( final LcdColor LCD_COLOR ) { } }
|
this . lineColor = LCD_COLOR . TEXT_COLOR ; this . sparkLineColor = LCD_COLOR ; recreateImages = true ; init ( INNER_BOUNDS . width , INNER_BOUNDS . height ) ; repaint ( INNER_BOUNDS ) ;
|
public class EventAdaptor { /** * Computes a unique adaptor class name */
private String initClassName ( ) { } }
|
StringBuffer sb = new StringBuffer ( ) ; String fieldName = _eventField . getName ( ) ; String setName = _eventSet . getClassName ( ) ; sb . append ( Character . toUpperCase ( fieldName . charAt ( 0 ) ) ) ; if ( fieldName . length ( ) > 1 ) sb . append ( fieldName . substring ( 1 ) ) ; sb . append ( setName . substring ( setName . lastIndexOf ( '.' ) + 1 ) ) ; sb . append ( "EventAdaptor" ) ; return sb . toString ( ) ;
|
public class Lexers { /** * Lookup a Pygments lexer by an alias .
* @ param gateway
* @ param alias language alias for which a lexer is queried */
public Optional < Object > lookupLexer ( PyGateway gateway , String alias ) { } }
|
Object result = lexerCache . get ( alias ) ; if ( result == null ) { result = evalLookupLexer ( gateway , alias , NULL ) ; lexerCache . put ( alias , result ) ; } if ( result == NULL ) { return Optional . absent ( ) ; } else { return Optional . of ( result ) ; }
|
import java . math . * ; class BrazilianFactorial { /** * Compute the Brazilian factorial of a number .
* The Brazilian factorial is described as :
* brazilian _ factorial ( n ) = n ! * ( n - 1 ) ! * ( n - 2 ) ! * . . . * 1!
* where n > 0
* For instance :
* > > > brazilian _ factorial ( 4)
* 288
* This function accepts an integer as input and returns the Brazilian
* factorial of the given integer .
* @ param num The number for which to compute the Brazilian factorial .
* @ return BigInteger : The Brazilian factorial of num . */
public static BigInteger brazilianFactorial ( int num ) { } }
|
BigInteger factorial = BigInteger . ONE ; BigInteger brazilianFactorial = BigInteger . ONE ; for ( int i = 1 ; i <= num ; i ++ ) { factorial = factorial . multiply ( BigInteger . valueOf ( i ) ) ; brazilianFactorial = brazilianFactorial . multiply ( factorial ) ; } return brazilianFactorial ;
|
public class ELParser { /** * DeferredExpression
* # { . . . } Expressions */
final public void DeferredExpression ( ) throws ParseException { } }
|
/* @ bgen ( jjtree ) DeferredExpression */
AstDeferredExpression jjtn000 = new AstDeferredExpression ( JJTDEFERREDEXPRESSION ) ; boolean jjtc000 = true ; jjtree . openNodeScope ( jjtn000 ) ; try { jj_consume_token ( START_DEFERRED_EXPRESSION ) ; Expression ( ) ; jj_consume_token ( RBRACE ) ; } catch ( Throwable jjte000 ) { if ( jjtc000 ) { jjtree . clearNodeScope ( jjtn000 ) ; jjtc000 = false ; } else { jjtree . popNode ( ) ; } if ( jjte000 instanceof RuntimeException ) { { if ( true ) throw ( RuntimeException ) jjte000 ; } } if ( jjte000 instanceof ParseException ) { { if ( true ) throw ( ParseException ) jjte000 ; } } { if ( true ) throw ( Error ) jjte000 ; } } finally { if ( jjtc000 ) { jjtree . closeNodeScope ( jjtn000 , true ) ; } }
|
public class WidgetState { /** * Sets current state
* @ param state new state */
void setState ( final WidgetState . State state ) { } }
|
Log . d ( TAG , "setState(%s): state is %s, setting to %s" , mWidget . getName ( ) , mState , state ) ; if ( state != mState ) { final WidgetState . State nextState = getNextState ( state ) ; Log . d ( TAG , "setState(%s): next state '%s'" , mWidget . getName ( ) , nextState ) ; if ( nextState != mState ) { Log . d ( TAG , "setState(%s): setting state to '%s'" , mWidget . getName ( ) , nextState ) ; setCurrentState ( false ) ; mState = nextState ; setCurrentState ( true ) ; } }
|
public class FontLoader { /** * calls { @ link # loadFont ( java . io . InputStream , java . lang . String ) } with the file extension from the
* URL
* @ param url
* @ return
* @ throws IOException */
public LOADSTATUS loadFont ( URL url ) throws IOException , VectorPrintException { } }
|
return loadFont ( url . openStream ( ) , url . toString ( ) . substring ( url . toString ( ) . lastIndexOf ( '.' ) ) ) ;
|
public class ProcessContext { /** * Returns all attributes of the given activity together with their
* usage . < br >
* If the given attribute has no attributes , the returned set contains
* no elements . < br >
* The given activity has to be known by the context , i . e . be contained
* in the activity list .
* @ param activity Activity for which the attribute usage is requested .
* @ return All attributes of the given activity together with their
* usage .
* @ throws ParameterException
* @ throws CompatibilityException
* @ throws IllegalArgumentException IllegalArgumentException If the
* given activity is not known .
* @ see # getActivities ( ) */
public Map < String , Set < DataUsage > > getDataUsageFor ( String activity ) throws CompatibilityException { } }
|
validateActivity ( activity ) ; if ( activityDataUsage . get ( activity ) == null ) { return new HashMap < > ( ) ; // No input data elements for this activity
} return Collections . unmodifiableMap ( activityDataUsage . get ( activity ) ) ;
|
public class SQLBuilder { /** * 通过 Bean 实例转化为 SQL 语句段 , 只转化非空属性 。
* 支持的属性类型有 int , Integer , float , Float , boolean , Boolean , Date < / p >
* @ param bean Bean 实例
* @ param split sql 语句的分隔符 , 如 " AND " 或 " , "
* @ return SQl 语句段 , 如果所有属性值都为空 , 返回 " " 。
* @ exception JibuException 转化失败时抛出 */
public static String beanToSQLClause ( Object bean , String split ) throws JibuException { } }
|
StringBuilder sb = new StringBuilder ( ) ; try { if ( null != bean ) { BeanInfo beanInfo = Introspector . getBeanInfo ( bean . getClass ( ) ) ; PropertyDescriptor [ ] pds = beanInfo . getPropertyDescriptors ( ) ; for ( PropertyDescriptor pd : pds ) { String clause = columnClause ( " " + pd . getName ( ) , pd . getPropertyType ( ) , pd . getReadMethod ( ) . invoke ( bean ) ) ; if ( null != clause ) { sb . append ( clause + split + " \n" ) ; } } } } catch ( Exception e ) { throw new JibuException ( e . getMessage ( ) ) ; } return sb . toString ( ) ;
|
public class DJTimeSeriesChartBuilder { /** * Adds the specified serie column to the dataset with custom label .
* @ param column the serie column
* @ param label column the custom label */
public DJTimeSeriesChartBuilder addSerie ( AbstractColumn column , String label ) { } }
|
getDataset ( ) . addSerie ( column , label ) ; return this ;
|
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link TransposeType } { @ code > } } */
@ XmlElementDecl ( namespace = "http://www.w3.org/1998/Math/MathML" , name = "transpose" ) public JAXBElement < TransposeType > createTranspose ( TransposeType value ) { } }
|
return new JAXBElement < TransposeType > ( _Transpose_QNAME , TransposeType . class , null , value ) ;
|
public class SlotPoolImpl { /** * Register TaskManager to this pool , only those slots come from registered TaskManager will be considered valid .
* Also it provides a way for us to keep " dead " or " abnormal " TaskManagers out of this pool .
* @ param resourceID The id of the TaskManager */
@ Override public boolean registerTaskManager ( final ResourceID resourceID ) { } }
|
componentMainThreadExecutor . assertRunningInMainThread ( ) ; log . debug ( "Register new TaskExecutor {}." , resourceID ) ; return registeredTaskManagers . add ( resourceID ) ;
|
public class AggregationIterator { /** * Indicates that an iterator in { @ link # iterators } has reached the end .
* @ param i The index in { @ link # iterators } of the iterator . */
private void endReached ( final int i ) { } }
|
// LOG . debug ( " No more DP for # " + i ) ;
timestamps [ iterators . length + i ] = TIME_MASK ; iterators [ i ] = null ; // We won ' t use it anymore , so free ( ) it .
|
public class MVELAccumulator { /** * / * ( non - Javadoc )
* @ see org . kie . spi . Accumulator # createContext ( ) */
public Serializable createContext ( ) { } }
|
Map < Integer , Object [ ] > shadow = null ; if ( this . reverse != null ) { shadow = new HashMap < Integer , Object [ ] > ( ) ; } return new MVELAccumulatorContext ( shadow ) ;
|
public class MurckoFragmenter { /** * Get all frameworks and ring systems as { @ link IAtomContainer } objects .
* @ return An array of structures representing frameworks and ring systems */
@ Override public IAtomContainer [ ] getFragmentsAsContainers ( ) { } }
|
List < IAtomContainer > allfrags = new ArrayList < IAtomContainer > ( ) ; allfrags . addAll ( frameMap . values ( ) ) ; allfrags . addAll ( ringMap . values ( ) ) ; return allfrags . toArray ( new IAtomContainer [ 0 ] ) ;
|
public class WSJdbcResultSet { /** * Gives a hint as to the direction in which the rows in this result set will be processed . The initial value is
* determined by the statement that produced the result set . The fetch direction may be changed at any time .
* @ param direction fetch direction
* @ throws SQLException if a database access error occurs or the result set type is TYPE _ FORWARD _ ONLY and the
* fetch direction is not FETCH _ FORWARD . */
public void setFetchDirection ( int direction ) throws SQLException { } }
|
if ( tc . isDebugEnabled ( ) ) Tr . debug ( this , tc , "setFetchDirection" , AdapterUtil . getFetchDirectionString ( direction ) ) ; try { rsetImpl . setFetchDirection ( direction ) ; } catch ( SQLException ex ) { FFDCFilter . processException ( ex , "com.ibm.ws.rsadapter.jdbc.WSJdbcResultSet.setFetchDirection" , "2860" , this ) ; throw WSJdbcUtil . mapException ( this , ex ) ; } catch ( NullPointerException nullX ) { // No FFDC code needed ; we might be closed .
throw runtimeXIfNotClosed ( nullX ) ; }
|
public class BluetoothService { /** * Start the chat service . Specifically start AcceptThread to begin a
* session in listening ( server ) mode . Called by the Activity onResume ( ) */
public synchronized void start ( ) { } }
|
// Cancel any thread attempting to make a connection
if ( mConnectThread != null ) { mConnectThread . cancel ( ) ; mConnectThread = null ; } // Cancel any thread currently running a connection
if ( mEngConnectedThread != null ) { mEngConnectedThread . cancel ( ) ; mEngConnectedThread = null ; } if ( mImpConnectedThread != null ) { mImpConnectedThread . cancel ( ) ; mImpConnectedThread = null ; } setState ( STATE_LISTEN ) ;
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.