signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class BlockNameSpace { /** * do we need this ? */
private NameSpace getNonBlockParent ( ) { } } | NameSpace parent = super . getParent ( ) ; if ( parent instanceof BlockNameSpace ) return ( ( BlockNameSpace ) parent ) . getNonBlockParent ( ) ; else return parent ; |
public class AssociatedPair { /** * Assigns this object to be equal to the passed in values . */
public void set ( double p1_x , double p1_y , double p2_x , double p2_y ) { } } | this . p1 . set ( p1_x , p1_y ) ; this . p2 . set ( p2_x , p2_y ) ; |
public class IAPlatformClient { /** * Get App Menu returns list of all the applications that are linked with
* the selected company
* @ return List < String > : Returns HTML as a list of Strings
* @ throws ConnectionException */
public List < String > getAppMenu ( String consumerKey , String consumerSecret , Stri... | try { List < String > menulist ; httpClient = new PlatformHttpClient ( consumerKey , consumerSecret , accessToken , accessTokenSecret ) ; menulist = this . httpClient . getAppMenu ( ) ; return menulist ; } catch ( ConnectionException conEx ) { throw conEx ; } catch ( Exception e ) { throw new ConnectionException ( "Fai... |
public class ChatLinearLayoutManager { /** * Converts a focusDirection to orientation .
* @ param focusDirection One of { @ link View # FOCUS _ UP } , { @ link View # FOCUS _ DOWN } ,
* { @ link View # FOCUS _ LEFT } , { @ link View # FOCUS _ RIGHT } ,
* { @ link View # FOCUS _ BACKWARD } , { @ link View # FOCUS ... | switch ( focusDirection ) { case View . FOCUS_BACKWARD : return LayoutState . LAYOUT_START ; case View . FOCUS_FORWARD : return LayoutState . LAYOUT_END ; case View . FOCUS_UP : return mOrientation == VERTICAL ? LayoutState . LAYOUT_START : LayoutState . INVALID_LAYOUT ; case View . FOCUS_DOWN : return mOrientation == ... |
public class FormatterBuilder { /** * Create a FormatterBuilder from the supplied arguments . If no formatter is specified by configuration , return a default CSV formatter builder . */
public static FormatterBuilder createFormatterBuilder ( Properties formatterProperties ) throws Exception { } } | FormatterBuilder builder ; AbstractFormatterFactory factory ; if ( formatterProperties . size ( ) > 0 ) { String formatterClass = formatterProperties . getProperty ( "formatter" ) ; String format = formatterProperties . getProperty ( "format" , "csv" ) ; Class < ? > classz = Class . forName ( formatterClass ) ; Class <... |
public class GuaranteedTargetStream { /** * Writes the range of Silence specified by the TickRange into the stream */
private void writeSilenceInternal ( TickRange tr , boolean forced ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "writeSilenceInternal" , new Object [ ] { tr , Boolean . valueOf ( forced ) } ) ; List msgList = null ; // Take lock on target stream and hold it until messages have been
// added to batch by deliverOrderedMessages
sy... |
public class DescribeRaidArraysResult { /** * A < code > RaidArrays < / code > object that describes the specified RAID arrays .
* @ param raidArrays
* A < code > RaidArrays < / code > object that describes the specified RAID arrays . */
public void setRaidArrays ( java . util . Collection < RaidArray > raidArrays ... | if ( raidArrays == null ) { this . raidArrays = null ; return ; } this . raidArrays = new com . amazonaws . internal . SdkInternalList < RaidArray > ( raidArrays ) ; |
public class EnableRadiusRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( EnableRadiusRequest enableRadiusRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( enableRadiusRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( enableRadiusRequest . getDirectoryId ( ) , DIRECTORYID_BINDING ) ; protocolMarshaller . marshall ( enableRadiusRequest . getRadiusSettings ( ) , RADIUSSETTINGS_BINDI... |
public class Messenger { /** * Get Group View Model Collection
* @ return Group ViewModel Collection */
@ Nullable @ ObjectiveCName ( "getGroups" ) public MVVMCollection < Group , GroupVM > getGroups ( ) { } } | if ( modules . getGroupsModule ( ) == null ) { return null ; } return modules . getGroupsModule ( ) . getGroupsCollection ( ) ; |
public class PersistSessionDialog { /** * This method initializes startSessionButton
* @ return javax . swing . JButton */
private JButton getStartSessionButton ( ) { } } | if ( startSessionButton == null ) { startSessionButton = new JButton ( ) ; startSessionButton . setText ( Constant . messages . getString ( "database.newsession.button.start" ) ) ; startSessionButton . setEnabled ( false ) ; startSessionButton . addActionListener ( new java . awt . event . ActionListener ( ) { @ Overri... |
public class VirtualMachineExtensionsInner { /** * The operation to create or update the extension .
* @ param resourceGroupName The name of the resource group .
* @ param vmName The name of the virtual machine where the extension should be created or updated .
* @ param vmExtensionName The name of the virtual ma... | return createOrUpdateWithServiceResponseAsync ( resourceGroupName , vmName , vmExtensionName , extensionParameters ) . toBlocking ( ) . last ( ) . body ( ) ; |
public class FacebookBatcher { /** * / * ( non - Javadoc )
* @ see com . googlecode . batchfb . Batcher # graph ( java . lang . String , java . lang . Class , com . googlecode . batchfb . Param [ ] ) */
@ Override public < T > GraphRequest < T > graph ( String object , Class < T > type , Param ... params ) { } } | return this . getBatchForGraph ( ) . graph ( object , type , params ) ; |
public class IconicsDrawable { /** * Set the padding of the drawable from res
* @ return The current IconicsDrawable for chaining . */
@ NonNull public IconicsDrawable paddingRes ( @ DimenRes int sizeResId ) { } } | return paddingPx ( mContext . getResources ( ) . getDimensionPixelSize ( sizeResId ) ) ; |
public class DistinguishedName { /** * ( non - Javadoc )
* @ see javax . naming . Name # getPrefix ( int ) */
public Name getPrefix ( int index ) { } } | LinkedList newNames = new LinkedList ( ) ; for ( int i = 0 ; i < index ; i ++ ) { newNames . add ( names . get ( i ) ) ; } return new DistinguishedName ( newNames ) ; |
public class NameValueData { /** * { @ inheritDoc } */
protected boolean internalEquals ( ValueData another ) { } } | if ( another instanceof NameValueData ) { return ( ( NameValueData ) another ) . value . equals ( value ) ; } return false ; |
public class InvocationDirector { /** * Requests that the specified invocation request be packaged up and sent to the supplied
* invocation oid . */
public void sendRequest ( int invOid , int invCode , int methodId , Object [ ] args ) { } } | sendRequest ( invOid , invCode , methodId , args , Transport . DEFAULT ) ; |
public class ListenerPortImpl { /** * Stops the listener port listening .
* @ see ListenerPort # close ( ) */
public void close ( ) { } } | if ( tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "close" ) ; // begin F177053
ChannelFramework framework = ChannelFrameworkFactory . getChannelFramework ( ) ; // F196678.10
try { framework . stopChain ( chainInbound , CHAIN_STOP_TIME ) ; } catch ( ChainException e ) { FFDCFilter . processException ( e , "com.... |
public class DigestUtil { /** * 计算SHA - 1摘要值
* @ param data 被摘要数据
* @ param charset 编码
* @ return SHA - 1摘要 */
public static byte [ ] sha1 ( String data , String charset ) { } } | return new Digester ( DigestAlgorithm . SHA1 ) . digest ( data , charset ) ; |
public class WWindow { /** * Override preparePaintComponent to clear the scratch map before the window content is being painted .
* @ param request the request being responded to . */
@ Override protected void preparePaintComponent ( final Request request ) { } } | super . preparePaintComponent ( request ) ; // Check if window in request ( might not have gone through handle request , eg Step error )
boolean targeted = isPresent ( request ) ; setTargeted ( targeted ) ; if ( getState ( ) == ACTIVE_STATE && isTargeted ( ) ) { getComponentModel ( ) . wrappedContent . preparePaint ( r... |
public class FileTransferHelper { /** * File Service MXBean */
private synchronized FileServiceMXBean getFileService ( ) { } } | if ( fileService == null ) { try { fileService = JMX . newMXBeanProxy ( ManagementFactory . getPlatformMBeanServer ( ) , new ObjectName ( FileServiceMXBean . OBJECT_NAME ) , FileServiceMXBean . class ) ; } catch ( MalformedObjectNameException e ) { throw ErrorHelper . createRESTHandlerJsonException ( e , null , APICons... |
public class BuildTasksInner { /** * Updates a build task with the specified parameters .
* @ param resourceGroupName The name of the resource group to which the container registry belongs .
* @ param registryName The name of the container registry .
* @ param buildTaskName The name of the container registry buil... | return ServiceFuture . fromResponse ( updateWithServiceResponseAsync ( resourceGroupName , registryName , buildTaskName , buildTaskUpdateParameters ) , serviceCallback ) ; |
public class HtmlUtil { /** * < p > cleanUpResults . < / p >
* @ param resultsToClean a { @ link java . lang . String } object .
* @ return a { @ link java . lang . String } object . */
public static String cleanUpResults ( String resultsToClean ) { } } | if ( resultsToClean != null ) { String cleanedString = resultsToClean . replace ( "</html><html>" , "<br/><br/>" ) ; cleanedString = cleanedString . replace ( "</HTML><HTML>" , "<br/><br/>" ) ; cleanedString = cleanedString . replace ( "<html>" , "" ) ; cleanedString = cleanedString . replace ( "</html>" , "" ) ; clean... |
public class FSDirectory { /** * Get the extended file info for a specific file .
* @ param src
* The string representation of the path to the file
* @ param targetNode
* the INode for the corresponding file
* @ param leaseHolder
* the lease holder for the file
* @ return object containing information reg... | readLock ( ) ; try { if ( targetNode == null ) { return null ; } FileStatus stat = createFileStatus ( src , targetNode ) ; long hardlinkId = ( targetNode instanceof INodeHardLinkFile ) ? ( ( INodeHardLinkFile ) targetNode ) . getHardLinkID ( ) : - 1 ; return new FileStatusExtended ( stat , ( ( INodeFile ) targetNode ) ... |
public class JsDocInfoParser { /** * BasicTypeExpression : = ' * ' | ' null ' | ' undefined ' | TypeName | FunctionType | UnionType |
* RecordType | TypeofType */
private Node parseBasicTypeExpression ( JsDocToken token ) { } } | if ( token == JsDocToken . STAR ) { return newNode ( Token . STAR ) ; } else if ( token == JsDocToken . LEFT_CURLY ) { skipEOLs ( ) ; return parseRecordType ( next ( ) ) ; } else if ( token == JsDocToken . LEFT_PAREN ) { skipEOLs ( ) ; return parseUnionType ( next ( ) ) ; } else if ( token == JsDocToken . STRING ) { St... |
public class UsersApi { /** * Creates a user ( [ CfgPerson ] ( https : / / docs . genesys . com / Documentation / PSDK / latest / ConfigLayerRef / CfgPerson ) ) with the given attributes .
* @ param user The user to be created . ( required )
* @ throws ProvisioningApiException if the call is unsuccessful .
* @ re... | try { CreateUserSuccessResponse resp = usersApi . addUser ( new AddUserData ( ) . data ( Converters . convertUserToAddUserDataData ( user ) ) ) ; if ( ! resp . getStatus ( ) . getCode ( ) . equals ( 0 ) ) { throw new ProvisioningApiException ( "Error adding user. Code: " + resp . getStatus ( ) . getCode ( ) ) ; } retur... |
public class Nodes { /** * Removes the currently installed { @ link InputMap } ( InputMap1 ) on the given node and installs the { @ code im }
* ( InputMap2 ) in its place . When finished , InputMap2 can be uninstalled and InputMap1 reinstalled via
* { @ link # popInputMap ( Node ) } . Multiple InputMaps can be inst... | // store currently installed im ; getInputMap calls init
InputMap < ? > previousInputMap = getInputMap ( node ) ; getStack ( node ) . push ( previousInputMap ) ; // completely override the previous one with the given one
setInputMapUnsafe ( node , im ) ; |
public class AbstractFormModel { /** * Creates a new value mode for the the given property . Usually delegates to
* the underlying property access strategy but subclasses may provide
* alternative value model creation strategies . */
protected ValueModel createValueModel ( String formProperty ) { } } | Assert . notNull ( formProperty , "formProperty" ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Creating " + ( buffered ? "buffered" : "" ) + " value model for form property '" + formProperty + "'." ) ; } return buffered ? new BufferedValueModel ( propertyAccessStrategy . getPropertyValueModel ( formPropert... |
public class JobGraphGenerator { private JobVertex createSingleInputVertex ( SingleInputPlanNode node ) throws CompilerException { } } | final String taskName = node . getNodeName ( ) ; final DriverStrategy ds = node . getDriverStrategy ( ) ; // check , whether chaining is possible
boolean chaining ; { Channel inConn = node . getInput ( ) ; PlanNode pred = inConn . getSource ( ) ; chaining = ds . getPushChainDriverClass ( ) != null && ! ( pred instanceo... |
public class TaskRuntime { /** * Calls the configured Task close handler and catches exceptions it may throw . */
@ SuppressWarnings ( "checkstyle:illegalcatch" ) private void closeTask ( final byte [ ] message ) throws TaskCloseHandlerFailure { } } | LOG . log ( Level . FINEST , "Invoking close handler." ) ; try { this . fCloseHandler . get ( ) . onNext ( new CloseEventImpl ( message ) ) ; } catch ( final Throwable throwable ) { throw new TaskCloseHandlerFailure ( throwable ) ; } |
public class FTPServer { /** * Starts the FTP server asynchronously .
* @ param address The server address or { @ code null } for a local address
* @ param port The server port or { @ code 0 } to automatically allocate the port
* @ throws IOException When an error occurs while starting the server */
public void l... | if ( auth == null ) throw new NullPointerException ( "The Authenticator is null" ) ; if ( socket != null ) throw new IOException ( "Server already started" ) ; socket = Utils . createServer ( port , 50 , address , ssl , ! explicitSecurity ) ; serverThread = new ServerThread ( ) ; serverThread . setDaemon ( true ) ; ser... |
public class UnsignedLong { /** * Returns an { @ code UnsignedLong } holding the value of the specified { @ code String } , parsed as
* an unsigned { @ code long } value in the specified radix .
* @ throws NumberFormatException if the string does not contain a parsable unsigned { @ code long }
* value , or { @ co... | return fromLongBits ( UnsignedLongs . parseUnsignedLong ( string , radix ) ) ; |
public class EnvUtil { /** * Join a list of objects to a string with a given separator by calling Object . toString ( ) on the elements .
* @ param list to join
* @ param separator separator to use
* @ return the joined string . */
public static String stringJoin ( List list , String separator ) { } } | StringBuilder ret = new StringBuilder ( ) ; boolean first = true ; for ( Object o : list ) { if ( ! first ) { ret . append ( separator ) ; } ret . append ( o ) ; first = false ; } return ret . toString ( ) ; |
public class ServiceInfoCache { /** * Adds the given service to this cache replacing an eventually existing entry .
* @ param service The service to cache
* @ return a result whose previous is the replaced service and where current is the given service */
public Result < T > put ( T service ) { } } | check ( service ) ; ServiceType serviceType = service . resolveServiceType ( ) ; T previous = null ; lock ( ) ; try { ServiceType existingServiceType = keysToServiceTypes . get ( service . getKey ( ) ) ; if ( existingServiceType != null && ! existingServiceType . equals ( serviceType ) ) throw new ServiceLocationExcept... |
public class PyExpressionGenerator { /** * Generate the given object .
* @ param breakStatement the break statement .
* @ param it the target for the generated content .
* @ param context the context .
* @ return the statement . */
@ SuppressWarnings ( "static-method" ) protected XExpression _generate ( SarlBre... | if ( context . getExpectedExpressionType ( ) == null ) { it . append ( "break" ) ; // $ NON - NLS - 1 $
} else { it . append ( "return " ) . append ( toDefaultValue ( context . getExpectedExpressionType ( ) . toJavaCompliantTypeReference ( ) ) ) ; // $ NON - NLS - 1 $
} return breakStatement ; |
public class PdfGraphics2D { /** * Sets a rendering hint
* @ param arg0
* @ param arg1 */
public void setRenderingHint ( Key arg0 , Object arg1 ) { } } | if ( arg1 != null ) { rhints . put ( arg0 , arg1 ) ; } else { if ( arg0 instanceof HyperLinkKey ) { rhints . put ( arg0 , HyperLinkKey . VALUE_HYPERLINKKEY_OFF ) ; } else { rhints . remove ( arg0 ) ; } } |
public class PGXADataSource { /** * Gets a XA - enabled connection to the PostgreSQL database . The database is identified by the
* DataSource properties serverName , databaseName , and portNumber . The user to connect as is
* identified by the arguments user and password , which override the DataSource properties ... | Connection con = super . getConnection ( user , password ) ; return new PGXAConnection ( ( BaseConnection ) con ) ; |
public class PatternUtils { /** * / * pp */
static boolean isPossibleQualifiedName ( @ Nonnull String value , @ Nonnull String extraAllowedCharacters ) { } } | // package - info violates the spec for Java Identifiers .
// Nevertheless , expressions that end with this string are still legal .
// See 7.4.1.1 of the Java language spec for discussion .
if ( value . endsWith ( PACKAGE_INFO ) ) { value = value . substring ( 0 , value . length ( ) - PACKAGE_INFO . length ( ) ) ; } f... |
public class ParameterTypeImpl { /** * Returns all < code > constraint < / code > elements
* @ return list of < code > constraint < / code > */
public List < ConstraintType < ParameterType < T > > > getAllConstraint ( ) { } } | List < ConstraintType < ParameterType < T > > > list = new ArrayList < ConstraintType < ParameterType < T > > > ( ) ; List < Node > nodeList = childNode . get ( "constraint" ) ; for ( Node node : nodeList ) { ConstraintType < ParameterType < T > > type = new ConstraintTypeImpl < ParameterType < T > > ( this , "constrai... |
public class RegionClient { /** * Retrieves the list of region resources available to the specified project .
* < p > Sample code :
* < pre > < code >
* try ( RegionClient regionClient = RegionClient . create ( ) ) {
* ProjectName project = ProjectName . of ( " [ PROJECT ] " ) ;
* for ( Region element : regio... | ListRegionsHttpRequest request = ListRegionsHttpRequest . newBuilder ( ) . setProject ( project == null ? null : project . toString ( ) ) . build ( ) ; return listRegions ( request ) ; |
public class AmazonSimpleWorkflowClient { /** * Returns the estimated number of decision tasks in the specified task list . The count returned is an approximation
* and isn ' t guaranteed to be exact . If you specify a task list that no decision task was ever scheduled in then
* < code > 0 < / code > is returned . ... | request = beforeClientExecution ( request ) ; return executeCountPendingDecisionTasks ( request ) ; |
public class SessionBeans { /** * Identifiers */
public static String createIdentifier ( EnhancedAnnotatedType < ? > type , EjbDescriptor < ? > descriptor ) { } } | StringBuilder builder = BeanIdentifiers . getPrefix ( SessionBean . class ) ; appendEjbNameAndClass ( builder , descriptor ) ; if ( ! type . isDiscovered ( ) ) { builder . append ( BEAN_ID_SEPARATOR ) . append ( type . slim ( ) . getIdentifier ( ) . asString ( ) ) ; } return builder . toString ( ) ; |
public class AbstractItemLink { /** * ( non - Javadoc )
* @ see com . ibm . ws . sib . msgstore . deliverydelay . DeliveryDelayable # deliveryDelayableUnlock ( com . ibm . ws . sib . msgstore . transactions . impl . PersistentTransaction )
* Note : synchronized block must not be used here ! If intrensic lock is acq... | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "deliveryDelayableUnlock" , "tran=" + tran + "lockID=" + lockID ) ; boolean removeFromDeliveryDelayIndex = false ; try { /* * Only if the item is not expiring and its in store and if its not being
* removed ( remova... |
public class LinearLayout { /** * Set the { @ link Gravity } of the layout .
* The new gravity can be rejected if it is in conflict with the currently applied Orientation
* @ param gravity
* One of the { @ link Gravity } constants . */
public void setGravity ( final Gravity gravity ) { } } | if ( mGravity != gravity ) { mGravity = gravity ; if ( mContainer != null ) { mContainer . onLayoutChanged ( this ) ; } } |
public class SwingUtil { /** * Apply the specified ComponentOp to the supplied component and then all its descendants . */
public static void applyToHierarchy ( Component comp , ComponentOp op ) { } } | applyToHierarchy ( comp , Integer . MAX_VALUE , op ) ; |
public class HttpResponse { /** * Update header to return as a Header object , if a header with
* the same name already exists it will be modified
* @ param name the header name
* @ param values the header values */
public HttpResponse replaceHeader ( String name , String ... values ) { } } | this . headers . replaceEntry ( name , values ) ; return this ; |
public class InodeLockManager { /** * Tries to acquire a lock for persisting the specified inode id .
* @ param inodeId the inode to acquire the lock for
* @ return an optional wrapping a closure for releasing the lock on success , or Optional . empty if
* the lock is already taken */
public Optional < Scoped > t... | AtomicBoolean lock = mPersistingLocks . getUnchecked ( inodeId ) ; if ( lock . compareAndSet ( false , true ) ) { return Optional . of ( ( ) -> lock . set ( false ) ) ; } return Optional . empty ( ) ; |
public class EnvironmentUtils { /** * Retrieve string value for the environment variable name
* @ param name The name of the variable without prefix
* @ param defaultValue The default value if not found
* @ return The value found , or the default if not found */
public static String getEnvironmentString ( String ... | if ( envVars == null ) { throw new IllegalStateException ( "The environment vars must be provided before calling getEnvironmentString." ) ; } return envVars . get ( ENV_PREFIX + name ) != null ? envVars . get ( ENV_PREFIX + name ) : defaultValue ; |
public class TransformationPolicyBuilder { /** * Gets the assertion .
* @ param message the message
* @ return the assertion
* @ throws SAXException the sAX exception
* @ throws IOException Signals that an I / O exception has occurred .
* @ throws ParserConfigurationException the parser configuration exceptio... | AssertionInfoMap aim = message . get ( AssertionInfoMap . class ) ; if ( aim != null ) { Collection < AssertionInfo > ais = aim . get ( TransformationPolicyBuilder . TRANSFORMATION ) ; if ( ais == null ) { return null ; } for ( AssertionInfo ai : ais ) { if ( ai . getAssertion ( ) instanceof TransformationAssertion ) {... |
public class CharUtils { /** * < p > Converts the string to the Unicode format ' \ u0020 ' . < / p >
* < p > This format is the Java source code format . < / p >
* < p > If { @ code null } is passed in , { @ code null } will be returned . < / p >
* < pre >
* CharUtils . unicodeEscaped ( null ) = null
* CharUt... | if ( ch == null ) { return null ; } return unicodeEscaped ( ch . charValue ( ) ) ; |
public class TypedIsomorphicGraphCounter { /** * { @ inheritDoc } */
public G max ( ) { } } | int maxCount = - 1 ; G max = null ; for ( LinkedList < Map . Entry < G , Integer > > graphs : typesToGraphs . values ( ) ) { for ( Map . Entry < G , Integer > e : graphs ) { if ( e . getValue ( ) > maxCount ) { maxCount = e . getValue ( ) ; max = e . getKey ( ) ; } } } return max ; |
public class ThreadSafeBitSet { /** * this = this ^ other , bitwise
* @ param other The bit set to xor with . */
public final void xor ( ThreadSafeBitSet other ) { } } | if ( other . size != size ) throw new IllegalArgumentException ( "BitSets must be of equal size" ) ; for ( int i = 0 ; i < bits . length ; i ++ ) { bits [ i ] ^= other . bits [ i ] ; } |
public class WeakObjectRegistry { /** * Registers an object in this model identified by a newly created id .
* @ param object
* The object to register .
* @ return The generated id . */
private UUID registerObject ( final Object object ) { } } | UUID id = UUID . randomUUID ( ) ; registerObject ( object , id ) ; return id ; |
public class TiffReader { /** * Processes a TIFF data sequence .
* @ param reader the { @ link RandomAccessReader } from which the data should be read
* @ param handler the { @ link TiffHandler } that will coordinate processing and accept read values
* @ param tiffHeaderOffset the offset within < code > reader < ... | // This must be either " MM " or " II " .
short byteOrderIdentifier = reader . getInt16 ( tiffHeaderOffset ) ; if ( byteOrderIdentifier == 0x4d4d ) { // " MM "
reader . setMotorolaByteOrder ( true ) ; } else if ( byteOrderIdentifier == 0x4949 ) { // " II "
reader . setMotorolaByteOrder ( false ) ; } else { throw new Ti... |
public class PeerGroup { /** * You can override this to customise the creation of { @ link Peer } objects . */
@ GuardedBy ( "lock" ) protected Peer createPeer ( PeerAddress address , VersionMessage ver ) { } } | return new Peer ( params , ver , address , chain , downloadTxDependencyDepth ) ; |
public class ProxyIdpAuthnContextServiceImpl { /** * { @ inheritDoc } */
@ Override public List < String > getSendAuthnContextClassRefs ( ProfileRequestContext < ? , ? > context , List < String > assuranceURIs , boolean idpSupportsSignMessage ) throws ExternalAutenticationErrorCodeException { } } | final String logId = this . getLogString ( context ) ; AuthnContextClassContext authnContextClassContext = this . getAuthnContextClassContext ( context ) ; authnContextClassContext . setProxiedIdPSupportsSignMessage ( idpSupportsSignMessage ) ; // Intermediate list holding the URI : s that should be sent in the AuthnRe... |
public class CorpusTools { /** * 分析语料库 */
private static void analyzeCorpus ( ) { } } | String zipFile = "src/main/resources/corpus/corpora.zip" ; LOGGER . info ( "开始分析语料库" ) ; long start = System . currentTimeMillis ( ) ; try { analyzeCorpus ( zipFile ) ; } catch ( IOException ex ) { LOGGER . info ( "分析语料库失败:" , ex ) ; } long cost = System . currentTimeMillis ( ) - start ; LOGGER . info ( "完成分析语料库,耗时:" +... |
public class Resty { /** * Set the proxy for this instance of Resty .
* Note , that the proxy settings will be carried over to Resty instances created by this instance only if you used
* new Resty ( Option . proxy ( . . . ) ) !
* @ param proxyhost name of the host
* @ param proxyport port to be used */
public v... | proxy = new java . net . Proxy ( java . net . Proxy . Type . HTTP , new InetSocketAddress ( proxyhost , proxyport ) ) ; |
public class EvalHelper { /** * Inverse of { @ link # getAccessor ( Class , String ) } */
public static Optional < String > propertyFromAccessor ( Method accessor ) { } } | if ( accessor . getParameterCount ( ) != 0 || accessor . getReturnType ( ) . equals ( Void . class ) ) { return Optional . empty ( ) ; } String methodName = accessor . getName ( ) ; if ( methodName . startsWith ( "get" ) ) { return Optional . of ( lcFirst ( methodName . substring ( 3 , methodName . length ( ) ) ) ) ; }... |
public class MetadataProviderImpl { /** * Determines if an { @ link AnnotatedType } represents a specific type identified
* by a meta annotation .
* @ param annotatedType
* The { @ link AnnotatedType } .
* @ param definitionType
* The meta annotation .
* @ return < code > true < / code > if the annotated ty... | Annotation definition = annotatedType . getByMetaAnnotation ( definitionType ) ; if ( definition != null ) { return true ; } for ( Class < ? > superType : annotatedType . getAnnotatedElement ( ) . getInterfaces ( ) ) { if ( isOfDefinitionType ( new AnnotatedType ( superType ) , definitionType ) ) { return true ; } } re... |
public class ChangeObjects { /** * method to add a PolymerNotation at a specific position of the
* HELM2Notation
* @ param position
* position of the PolymerNotation
* @ param polymer
* new PolymerNotation
* @ param helm2notation
* input HELM2Notation */
public final static void addPolymerNotation ( int p... | helm2notation . getListOfPolymers ( ) . add ( position , polymer ) ; |
public class FctBnSeSelProcessors { /** * < p > Get PrcEntitiesPage ( create and put into map ) . < / p >
* @ return requested PrcEntitiesPage
* @ throws Exception - an exception */
protected final PrcEntitiesPage createPutPrcEntitiesPage ( ) throws Exception { } } | PrcEntitiesPage proc = new PrcEntitiesPage ( ) ; proc . setSrvEntitiesPage ( this . srvEntitiesPage ) ; // assigning fully initialized object :
this . processorsMap . put ( PrcEntitiesPage . class . getSimpleName ( ) , proc ) ; return proc ; |
public class V1InstanceCreator { /** * Create a new response to an existing note with a name , content , and ' personal ' flag
* @ param responseTo The Note to respond to .
* @ param name The initial name of the note .
* @ param content The content of the note .
* @ param personal True if this note is only visi... | Note note = new Note ( responseTo , instance ) ; note . setName ( name ) ; note . setContent ( content ) ; note . setPersonal ( personal ) ; addAttributes ( note , attributes ) ; note . save ( ) ; return note ; |
public class BatchDeleteClusterSnapshotsRequest { /** * A list of identifiers for the snapshots that you want to delete .
* @ param identifiers
* A list of identifiers for the snapshots that you want to delete . */
public void setIdentifiers ( java . util . Collection < DeleteClusterSnapshotMessage > identifiers ) ... | if ( identifiers == null ) { this . identifiers = null ; return ; } this . identifiers = new com . amazonaws . internal . SdkInternalList < DeleteClusterSnapshotMessage > ( identifiers ) ; |
public class VolumeStatisticsMarshaller { /** * Marshall the given parameter object . */
public void marshall ( VolumeStatistics volumeStatistics , ProtocolMarshaller protocolMarshaller ) { } } | if ( volumeStatistics == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( volumeStatistics . getInboxRawCount ( ) , INBOXRAWCOUNT_BINDING ) ; protocolMarshaller . marshall ( volumeStatistics . getSpamRawCount ( ) , SPAMRAWCOUNT_BINDING ) ; pr... |
public class StreamSegmentNameUtils { /** * Returns the transaction name for a TransactionStreamSegment based on the name of the current Parent StreamSegment , and the transactionId .
* @ param parentStreamSegmentName The name of the Parent StreamSegment for this transaction .
* @ param transactionId The unique Id ... | StringBuilder result = new StringBuilder ( ) ; result . append ( parentStreamSegmentName ) ; result . append ( TRANSACTION_DELIMITER ) ; result . append ( String . format ( FULL_HEX_FORMAT , transactionId . getMostSignificantBits ( ) ) ) ; result . append ( String . format ( FULL_HEX_FORMAT , transactionId . getLeastSi... |
public class IntegerExtensions { /** * The bitwise < code > and < / code > operation . This is the equivalent to the java < code > & < / code > operator .
* @ param a
* an integer .
* @ param b
* an integer .
* @ return < code > a & b < / code > */
@ Pure @ Inline ( value = "($1 & $2)" , constantExpression = ... | return a & b ; |
public class FieldValue { /** * Returns a special value that can be used with set ( ) , create ( ) or update ( ) that tells the server
* to remove the given elements from any array value that already exists on the server . All
* instances of each element specified will be removed from the array . If the field being... | Preconditions . checkArgument ( elements . length > 0 , "arrayRemove() expects at least 1 element" ) ; return new ArrayRemoveFieldValue ( Arrays . asList ( elements ) ) ; |
public class Matcher { /** * Resets this matcher and then attempts to find the next subsequence of
* the input sequence that matches the pattern , starting at the specified
* index .
* < p > If the match succeeds then more information can be obtained via the
* < tt > start < / tt > , < tt > end < / tt > , and <... | int limit = matcher . targetEnd ( ) ; if ( ( start < 0 ) || ( start > limit ) ) throw new IndexOutOfBoundsException ( "Illegal start index" ) ; reset ( ) ; matcher . setPosition ( start ) ; return matcher . find ( ) ; |
public class MisoScenePanel { /** * Called when the user presses the mouse button over an object . */
protected void handleObjectPressed ( final SceneObject scobj , int mx , int my ) { } } | String action = scobj . info . action ; final ObjectActionHandler handler = ObjectActionHandler . lookup ( action ) ; // if there ' s no handler , just fire the action immediately
if ( handler == null ) { fireObjectAction ( null , scobj , new SceneObjectActionEvent ( this , 0 , action , 0 , scobj ) ) ; return ; } // if... |
public class OpenTok { /** * Sets the layout type for a composed archive . For a description of layout types , see
* < a href = " https : / / tokbox . com / developer / guides / archiving / layout - control . html " > Customizing
* the video layout for composed archives < / a > .
* @ param archiveId { String } Th... | if ( StringUtils . isEmpty ( archiveId ) || properties == null ) { throw new InvalidArgumentException ( "ArchiveId is not valid or properties are null" ) ; } this . client . setArchiveLayout ( archiveId , properties ) ; |
public class AbstractExtensionDependency { /** * Replace existing properties with provided properties .
* @ param properties the properties */
public void setProperties ( Map < String , Object > properties ) { } } | this . properties . clear ( ) ; this . properties . putAll ( properties ) ; |
public class TextRankKeyword { /** * 返回分数最高的前size个分词结果和对应的rank
* @ param content
* @ param size
* @ return */
public Map < String , Float > getTermAndRank ( String content , int size ) { } } | Map < String , Float > map = getTermAndRank ( content ) ; Map < String , Float > result = top ( size , map ) ; return result ; |
public class InventoryNavigator { /** * Get the first ManagedObjectReference from current node for the specified type */
public ManagedEntity [ ] searchManagedEntities ( String type ) throws InvalidProperty , RuntimeFault , RemoteException { } } | String [ ] [ ] typeinfo = new String [ ] [ ] { new String [ ] { type , "name" , } , } ; return searchManagedEntities ( typeinfo , true ) ; |
public class LoggerFactory { /** * Return the most appropriate log type . This should _ never _ return null . */
private static LogType findLogType ( ) { } } | // see if the log - type was specified as a system property
String logTypeString = System . getProperty ( LOG_TYPE_SYSTEM_PROPERTY ) ; if ( logTypeString != null ) { try { return LogType . valueOf ( logTypeString ) ; } catch ( IllegalArgumentException e ) { Log log = new LocalLog ( LoggerFactory . class . getName ( ) )... |
public class MethodUtils { /** * < p > Invoke a named method whose parameter type matches the object type . < / p >
* < p > The behaviour of this method is less deterministic
* than { @ link # invokeExactMethod ( Object object , String methodName , Object [ ] args ) } .
* It loops through all methods with names t... | Class < ? > [ ] paramTypes ; if ( args == null ) { args = EMPTY_OBJECT_ARRAY ; paramTypes = EMPTY_CLASS_PARAMETERS ; } else { int arguments = args . length ; if ( arguments == 0 ) { paramTypes = EMPTY_CLASS_PARAMETERS ; } else { paramTypes = new Class < ? > [ arguments ] ; for ( int i = 0 ; i < arguments ; i ++ ) { if ... |
public class AttributeSwapperHelperImpl { /** * / * ( non - Javadoc )
* @ see org . apereo . portal . portlets . swapper . IAttributeSwapperHelper # getOriginalUserAttributes ( java . lang . String ) */
@ Override public IPersonAttributes getOriginalUserAttributes ( String uid ) { } } | final IPersonAttributeDao delegatePersonAttributeDao = this . portalRootPersonAttributeDao . getDelegatePersonAttributeDao ( ) ; return delegatePersonAttributeDao . getPerson ( uid ) ; |
public class QueryableStateUtils { /** * Initializes the { @ link KvStateClientProxy client proxy } responsible for
* receiving requests from the external ( to the cluster ) client and forwarding them internally .
* @ param address the address to bind to .
* @ param ports the range of ports the proxy will attempt... | Preconditions . checkNotNull ( address , "address" ) ; Preconditions . checkNotNull ( stats , "stats" ) ; Preconditions . checkArgument ( eventLoopThreads >= 1 ) ; Preconditions . checkArgument ( queryThreads >= 1 ) ; try { String classname = "org.apache.flink.queryablestate.client.proxy.KvStateClientProxyImpl" ; Class... |
public class CassandraKeyspace { /** * Returns the actual partitioner in use by Cassandra if it does not match the expected partitioner , null if it matches . */
private String getMismatchedPartitioner ( Class < ? extends IPartitioner > expectedPartitioner ) { } } | String partitioner = null ; try { partitioner = _astyanaxKeyspace . describePartitioner ( ) ; boolean matches = CassandraPartitioner . fromClass ( partitioner ) . matches ( expectedPartitioner . getName ( ) ) ; if ( matches ) { return null ; } else { return partitioner ; } } catch ( ConnectionException e ) { throw Thro... |
public class AbstractRemoteClient { /** * Method blocks until the remote reaches the desired connection state .
* @ param connectionState the desired connection state
* @ throws InterruptedException is thrown in case the thread is externally
* interrupted .
* @ throws org . openbase . jul . exception . CouldNot... | try { waitForConnectionState ( connectionState , 0 ) ; } catch ( TimeoutException ex ) { assert false ; } |
public class CommerceSubscriptionEntryUtil { /** * Returns the first commerce subscription entry in the ordered set where groupId = & # 63 ; .
* @ param groupId the group ID
* @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > )
* @ return the first matching commerc... | return getPersistence ( ) . fetchByGroupId_First ( groupId , orderByComparator ) ; |
public class SimpleCookieManager { @ Override public OptionalThing < Cookie > getCookie ( String key ) { } } | assertKeyNotNull ( key ) ; final Cookie [ ] cookies = getRequest ( ) . getCookies ( ) ; if ( cookies != null ) { for ( Cookie cookie : cookies ) { if ( key . equals ( cookie . getName ( ) ) ) { return OptionalThing . of ( createSnapshotCookie ( cookie ) ) ; } } } return OptionalThing . ofNullable ( null , ( ) -> { thro... |
public class WRepeater { /** * Removes any stale contexts from the row context map .
* @ param rowIds the current set of row Ids . */
protected void cleanupStaleContexts ( final Set < ? > rowIds ) { } } | RepeaterModel model = getOrCreateComponentModel ( ) ; if ( model . rowContextMap != null ) { for ( Iterator < Map . Entry < Object , SubUIContext > > i = model . rowContextMap . entrySet ( ) . iterator ( ) ; i . hasNext ( ) ; ) { Map . Entry < Object , SubUIContext > entry = i . next ( ) ; Object rowId = entry . getKey... |
public class Ssh2Session { /** * This overidden method handles the " exit - status " , " exit - signal " and
* " xon - xoff " channel requests . */
protected void channelRequest ( String requesttype , boolean wantreply , byte [ ] requestdata ) throws SshException { } } | try { if ( requesttype . equals ( "exit-status" ) ) { if ( requestdata != null ) { exitcode = ( int ) ByteArrayReader . readInt ( requestdata , 0 ) ; } } if ( requesttype . equals ( "exit-signal" ) ) { if ( requestdata != null ) { ByteArrayReader bar = new ByteArrayReader ( requestdata , 0 , requestdata . length ) ; tr... |
public class AndroidUtil { /** * Get the number of tiles that can be stored on the file system .
* @ param directory where the cache will reside
* @ param fileSize average size of tile to be cached
* @ return number of tiles that can be stored without running out of space */
@ SuppressWarnings ( "deprecation" ) @... | StatFs statfs = new StatFs ( directory ) ; if ( Build . VERSION . SDK_INT >= Build . VERSION_CODES . JELLY_BEAN_MR2 ) { return statfs . getAvailableBytes ( ) / fileSize ; } // problem is overflow with devices with large storage , so order is important here
// additionally avoid division by zero in devices with a large ... |
public class UtcRules { /** * Converts a { @ code UtcInstant } to a { @ code TaiInstant } .
* This method converts from the UTC to the TAI time - scale using the
* leap - second rules of the implementation .
* @ param utcInstant the UTC instant to convert , not null
* @ return the converted TAI instant , not nu... | long mjd = utcInstant . getModifiedJulianDay ( ) ; long nod = utcInstant . getNanoOfDay ( ) ; long taiUtcDaySeconds = Math . multiplyExact ( Math . subtractExact ( mjd , OFFSET_MJD_TAI ) , SECS_PER_DAY ) ; long taiSecs = Math . addExact ( taiUtcDaySeconds , nod / NANOS_PER_SECOND + getTaiOffset ( mjd ) ) ; int nos = ( ... |
public class SoyMsgIdComputer { /** * Private helper to build the canonical message content string that should be used for msg id
* computation .
* < p > Note : For people who know what " presentation " means in this context , the result string
* should be exactly the presentation string .
* @ param msgParts Th... | msgParts = IcuSyntaxUtils . convertMsgPartsToEmbeddedIcuSyntax ( msgParts ) ; StringBuilder msgStrSb = new StringBuilder ( ) ; for ( SoyMsgPart msgPart : msgParts ) { if ( msgPart instanceof SoyMsgRawTextPart ) { msgStrSb . append ( ( ( SoyMsgRawTextPart ) msgPart ) . getRawText ( ) ) ; } else if ( msgPart instanceof S... |
public class DateParser { /** * Strip the searchString with and trim the result .
* @ param input the source string
* @ param searchString the string to look for in the source
* @ return the stripped string */
private String stripPrefix ( final String input , final String searchString ) { } } | return input . substring ( searchString . length ( ) , input . length ( ) ) . trim ( ) ; |
public class ColumnDescriptorAdapter { /** * Construct an Bigtable { @ link GCRule } from the given column descriptor .
* @ param columnDescriptor a { @ link org . apache . hadoop . hbase . HColumnDescriptor } object .
* @ return a { @ link GCRule } object . */
public static GCRule buildGarbageCollectionRule ( HCol... | int maxVersions = columnDescriptor . getMaxVersions ( ) ; int minVersions = columnDescriptor . getMinVersions ( ) ; int ttlSeconds = columnDescriptor . getTimeToLive ( ) ; Preconditions . checkState ( minVersions < maxVersions , "HColumnDescriptor min versions must be less than max versions." ) ; if ( ttlSeconds == HCo... |
public class ActionButton { /** * Initializes the image inside < b > Action Button < / b >
* @ param attrs attributes of the XML tag that is inflating the view */
private void initImage ( TypedArray attrs ) { } } | int index = R . styleable . ActionButton_image ; if ( attrs . hasValue ( index ) ) { image = attrs . getDrawable ( index ) ; LOGGER . trace ( "Initialized Action Button image" ) ; } |
public class JaxRsMethodBindings { /** * Get the key for the baseMethodBinding . This is :
* < ul >
* < li > the compartName for SearchMethodBindings
* < li > the methodName for OperationMethodBindings
* < li > { @ link # DEFAULT _ METHOD _ KEY } for all other MethodBindings
* < / ul >
* @ param theBinding ... | if ( theBinding instanceof OperationMethodBinding ) { return ( ( OperationMethodBinding ) theBinding ) . getName ( ) ; } else if ( theBinding instanceof SearchMethodBinding ) { Search search = theBinding . getMethod ( ) . getAnnotation ( Search . class ) ; return search . compartmentName ( ) ; } else { return DEFAULT_M... |
public class AppServiceEnvironmentsInner { /** * Get available SKUs for scaling a worker pool .
* Get available SKUs for scaling a worker pool .
* @ param resourceGroupName Name of the resource group to which the resource belongs .
* @ param name Name of the App Service Environment .
* @ param workerPoolName Na... | return listWorkerPoolSkusWithServiceResponseAsync ( resourceGroupName , name , workerPoolName ) . map ( new Func1 < ServiceResponse < Page < SkuInfoInner > > , Page < SkuInfoInner > > ( ) { @ Override public Page < SkuInfoInner > call ( ServiceResponse < Page < SkuInfoInner > > response ) { return response . body ( ) ;... |
public class EurekaHttpClients { /** * / * testing */
static ClosableResolver < AwsEndpoint > compositeQueryResolver ( final ClusterResolver < AwsEndpoint > remoteResolver , final ClusterResolver < AwsEndpoint > localResolver , final EurekaClientConfig clientConfig , final EurekaTransportConfig transportConfig , final ... | String [ ] availZones = clientConfig . getAvailabilityZones ( clientConfig . getRegion ( ) ) ; String myZone = InstanceInfo . getZone ( availZones , myInstanceInfo ) ; ClusterResolver < AwsEndpoint > compositeResolver = new ClusterResolver < AwsEndpoint > ( ) { @ Override public String getRegion ( ) { return clientConf... |
public class Job { /** * Renames a job . */
@ Override public void renameTo ( String newName ) throws IOException { } } | File oldBuildDir = getBuildDir ( ) ; super . renameTo ( newName ) ; File newBuildDir = getBuildDir ( ) ; if ( oldBuildDir . isDirectory ( ) && ! newBuildDir . isDirectory ( ) ) { if ( ! newBuildDir . getParentFile ( ) . isDirectory ( ) ) { newBuildDir . getParentFile ( ) . mkdirs ( ) ; } if ( ! oldBuildDir . renameTo (... |
public class Menus { /** * 获取自定义菜单配置
* 操蛋的微信 , JSON太混乱了 ; 本接口拒绝支持 ' 公众号是在公众平台官网通过网站功能发布菜单 '
* @ return */
public MenuConfig getMenuConfig ( ) { } } | String url = WxEndpoint . get ( "url.menu.get.self" ) ; String content = wxClient . get ( url ) ; logger . debug ( "get menu config: {}" , content ) ; return JsonMapper . nonEmptyMapper ( ) . fromJson ( content , MenuConfig . class ) ; |
public class ContextFromVertx { /** * Get the ( first ) request header with the given name .
* @ return The header value */
@ Override public String header ( String name ) { } } | List < String > list = request . headers ( ) . get ( name ) ; if ( list != null && ! list . isEmpty ( ) ) { return list . get ( 0 ) ; } return null ; |
public class BaseIdTokenGeneratorService { /** * Encode and finalize token .
* @ param claims the claims
* @ param registeredService the registered service
* @ param accessToken the access token
* @ return the string */
protected String encodeAndFinalizeToken ( final JwtClaims claims , final OAuthRegisteredServ... | LOGGER . debug ( "Received claims for the id token [{}] as [{}]" , accessToken , claims ) ; val idTokenResult = getConfigurationContext ( ) . getIdTokenSigningAndEncryptionService ( ) . encode ( registeredService , claims ) ; accessToken . setIdToken ( idTokenResult ) ; LOGGER . debug ( "Updating access token [{}] in t... |
public class WebUtils { /** * Returns the sufficiently shown WebElements
* @ param javaScriptWasExecuted true if JavaScript was executed
* @ param onlySufficientlyVisible true if only sufficiently visible { @ link WebElement } objects should be returned
* @ return the sufficiently shown WebElements */
private Arr... | ArrayList < WebElement > webElements = new ArrayList < WebElement > ( ) ; if ( javaScriptWasExecuted ) { for ( WebElement webElement : webElementCreator . getWebElementsFromWebViews ( ) ) { if ( ! onlySufficientlyVisbile ) { webElements . add ( webElement ) ; } else if ( isWebElementSufficientlyShown ( webElement ) ) {... |
public class TokenClientParam { /** * Create a search criterion that matches against the given system
* value but does not specify a code . This means that any code / identifier with
* the given system should match .
* Use { @ link # exactly ( ) } if you want to specify a code . */
public ICriterion < TokenClient... | return new TokenCriterion ( getParamName ( ) , theSystem , ( String ) null ) ; |
public class UP3iFinishingOperationImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public void setSeqnum ( Integer newSeqnum ) { } } | Integer oldSeqnum = seqnum ; seqnum = newSeqnum ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , AfplibPackage . UP_3I_FINISHING_OPERATION__SEQNUM , oldSeqnum , seqnum ) ) ; |
public class AipContentCensor { /** * 组合审核接口
* @ param imgData 图片二进制数据
* @ param scenes 需要审核的服务类型
* @ param options 可选参数
* @ return JSONObject */
public JSONObject imageCensorComb ( byte [ ] imgData , List < String > scenes , HashMap < String , String > options ) { } } | AipRequest request = new AipRequest ( ) ; String base64Content = Base64Util . encode ( imgData ) ; request . addBody ( "image" , base64Content ) ; return imageCensorCombHelper ( request , scenes , options ) ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.