signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class AddressUtils { /** * 判断该ip是否为本机ip , 一台机器可能同时有多个IP
* @ param ip
* @ return */
public static boolean isHostIp ( String ip ) { } } | InetAddress localAddress = null ; try { localAddress = InetAddress . getLocalHost ( ) ; if ( localAddress . isLoopbackAddress ( ) || isValidHostAddress ( localAddress ) && ( localAddress . getHostAddress ( ) . equals ( ip ) || localAddress . getHostName ( ) . equals ( ip ) ) ) { return true ; } } catch ( Throwable e ) ... |
public class SnapshotDeleteAgent { /** * return null . Yes , ugly . Bang it out , then refactor later . */
private String parseParams ( ParameterSet params , JSONObject obj ) throws Exception { } } | if ( params . size ( ) < 2 ) { return "@SnapshotDelete expects 2 or 3 arguments, received " + params . size ( ) ; } String [ ] paths = null ; Object paramList [ ] = params . toArray ( ) ; try { paths = ( String [ ] ) ( ParameterConverter . tryToMakeCompatible ( String [ ] . class , paramList [ 0 ] ) ) ; } catch ( Excep... |
public class Property { /** * Returns the boolean value of this property . */
public boolean booleanValue ( ) { } } | final String value = getInternal ( null , false ) ; if ( value == null ) { return false ; } return toBoolean ( value ) ; |
public class CommonIronJacamarParser { /** * Store admin object
* @ param ao The admin object
* @ param writer The writer
* @ exception Exception Thrown if an error occurs */
protected void storeAdminObject ( AdminObject ao , XMLStreamWriter writer ) throws Exception { } } | writer . writeStartElement ( CommonXML . ELEMENT_ADMIN_OBJECT ) ; if ( ao . getClassName ( ) != null ) writer . writeAttribute ( CommonXML . ATTRIBUTE_CLASS_NAME , ao . getValue ( CommonXML . ATTRIBUTE_CLASS_NAME , ao . getClassName ( ) ) ) ; if ( ao . getJndiName ( ) != null ) writer . writeAttribute ( CommonXML . ATT... |
public class IOCase { /** * Checks if one string contains another at a specific index using the case - sensitivity rule .
* This method mimics parts of { @ link String # regionMatches ( boolean , int , String , int , int ) }
* but takes case - sensitivity into account .
* @ param str the string to check , not nul... | return str . regionMatches ( ! sensitive , strStartIndex , search , 0 , search . length ( ) ) ; |
public class TreeTranslator { /** * Visitor methods */
public void visitTopLevel ( JCCompilationUnit tree ) { } } | tree . pid = translate ( tree . pid ) ; tree . defs = translate ( tree . defs ) ; result = tree ; |
public class Section { /** * Defines the color that will be used to colorize a highlighted section
* @ param COLOR */
public void setHighlightColor ( final Color COLOR ) { } } | if ( null == highlightColor ) { _highlightColor = COLOR ; fireSectionEvent ( UPDATE_EVENT ) ; } else { highlightColor . set ( COLOR ) ; } |
public class MediaQueryTools { /** * Get the CSS wrapped in the specified media query . Note : all existing rule
* objects are reused , so modifying them also modifies the original CSS !
* @ param aCSS
* The CSS to be wrapped . May not be < code > null < / code > .
* @ param aMediaQueries
* The media queries ... | ValueEnforcer . notNull ( aCSS , "CSS" ) ; ValueEnforcer . notEmpty ( aMediaQueries , "MediaQueries" ) ; if ( ! canWrapInMediaQuery ( aCSS , bAllowNestedMediaQueries ) ) return null ; final CascadingStyleSheet ret = new CascadingStyleSheet ( ) ; // Copy all import rules
for ( final CSSImportRule aImportRule : aCSS . ge... |
public class GSAPImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public Object eGet ( int featureID , boolean resolve , boolean coreType ) { } } | switch ( featureID ) { case AfplibPackage . GSAP__P : return getP ( ) ; case AfplibPackage . GSAP__Q : return getQ ( ) ; case AfplibPackage . GSAP__R : return getR ( ) ; case AfplibPackage . GSAP__S : return getS ( ) ; } return super . eGet ( featureID , resolve , coreType ) ; |
public class WebService { /** * method to calculate froma non - ambiguous HELM input the molecular
* properties : molecular formula , molecular weight , exact mass , extinction
* coefficient
* @ param notation
* given HELM
* @ return { @ code List < String > } containing the molecule properties
* @ throws B... | MoleculeProperty result = MoleculePropertyCalculator . getMoleculeProperties ( validate ( notation ) ) ; setMonomerFactoryToDefault ( notation ) ; return new LinkedList < String > ( Arrays . asList ( result . getMolecularFormula ( ) , Double . toString ( result . getMolecularWeight ( ) ) , Double . toString ( result . ... |
public class EndpointUtil { /** * This method returns the operation part of the supplied endpoint .
* @ param endpoint The endpoint
* @ param stripped Whether brackets should be stripped
* @ return The operation */
public static String decodeEndpointOperation ( String endpoint , boolean stripped ) { } } | int ind = endpoint . indexOf ( '[' ) ; if ( ind != - 1 ) { if ( stripped ) { return endpoint . substring ( ind + 1 , endpoint . length ( ) - 1 ) ; } return endpoint . substring ( ind ) ; } return null ; |
public class XMLSerializer { /** * Write attribute .
* @ param namespaceURI the namespace URI
* @ param localName the local name
* @ param value the value
* @ throws Exception the exception */
public void writeAttribute ( String namespaceURI , String localName , String value ) throws Exception { } } | this . attribute ( namespaceURI , localName , value . toString ( ) ) ; |
public class DataSourceService { /** * Declarative services method to unset the JAASLoginContextEntry . */
protected void unsetJaasLoginContextEntry ( ServiceReference < com . ibm . ws . security . jaas . common . JAASLoginContextEntry > svc ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( this , tc , "unsetJaasLoginContextEntry" , svc ) ; } jaasLoginContextEntryName = null ; |
public class GeometryService { /** * This geometry is empty if there are no geometries / coordinates stored inside .
* @ param geometry The geometry to check .
* @ return true or false . */
public static boolean isEmpty ( Geometry geometry ) { } } | return ( geometry . getCoordinates ( ) == null || geometry . getCoordinates ( ) . length == 0 ) && ( geometry . getGeometries ( ) == null || geometry . getGeometries ( ) . length == 0 ) ; |
public class CleverTapAPI { /** * InApp */
private static void showInApp ( Context context , final CTInAppNotification inAppNotification , CleverTapInstanceConfig config ) { } } | Logger . v ( config . getAccountId ( ) , "Attempting to show next In-App" ) ; if ( ! appForeground ) { pendingNotifications . add ( inAppNotification ) ; Logger . v ( config . getAccountId ( ) , "Not in foreground, queueing this In App" ) ; return ; } if ( currentlyDisplayingInApp != null ) { pendingNotifications . add... |
public class DecisionDefinitionEntity { /** * Updates all modifiable fields from another decision definition entity .
* @ param updatingDecisionDefinition */
@ Override public void updateModifiableFieldsFromEntity ( DecisionDefinitionEntity updatingDecisionDefinition ) { } } | if ( this . key . equals ( updatingDecisionDefinition . key ) && this . deploymentId . equals ( updatingDecisionDefinition . deploymentId ) ) { this . revision = updatingDecisionDefinition . revision ; this . historyTimeToLive = updatingDecisionDefinition . historyTimeToLive ; } else { LOG . logUpdateUnrelatedDecisionD... |
public class AmazonNeptuneClient { /** * Creates an event notification subscription . This action requires a topic ARN ( Amazon Resource Name ) created by
* either the Neptune console , the SNS console , or the SNS API . To obtain an ARN with SNS , you must create a topic
* in Amazon SNS and subscribe to the topic ... | request = beforeClientExecution ( request ) ; return executeCreateEventSubscription ( request ) ; |
public class TransactionContext { /** * Commits the current transaction . This will : check for any conflicts , based on the change set aggregated from
* all registered { @ link TransactionAware } instances ; flush any pending writes from the { @ code TransactionAware } s ;
* commit the current transaction with the... | Preconditions . checkState ( currentTx != null , "Cannot finish tx that has not been started" ) ; // each of these steps will abort and rollback the tx in case if errors , and throw an exception
checkForConflicts ( ) ; persist ( ) ; commit ( ) ; postCommit ( ) ; currentTx = null ; |
public class DeltaCalculator { /** * Returns the best estimate client / server time - delta . */
public long getTimeDelta ( ) { } } | if ( _iter == 0 ) { // no responses yet
return 0L ; } // Return a median value as our estimate , rather than an average .
// Mdb writes :
// I used the median because that was more likely to result in a
// sensible value .
// Assuming there are two kinds of packets , one that goes and comes
// back without delay and pr... |
public class ValueList { /** * Creates a list of the provided elements in the same order .
* @ param value zero or more values .
* @ return a list of the provided values . */
public static < V extends Value > ValueList < V > getInstance ( V ... value ) { } } | ValueList < V > result = new ValueList < > ( value . length ) ; for ( V val : value ) { result . add ( val ) ; } return result ; |
public class CliFrontend { /** * Displays an optional exception message for incorrect program parametrization .
* @ param e The exception to display .
* @ return The return code for the process . */
private static int handleParametrizationException ( ProgramParametrizationException e ) { } } | LOG . error ( "Program has not been parametrized properly." , e ) ; System . err . println ( e . getMessage ( ) ) ; return 1 ; |
public class ArrayUtils { /** * < p > Converts an array of object Character to primitives handling < code > null < / code > . < / p >
* < p > This method returns < code > null < / code > for a < code > null < / code > input array . < / p >
* @ param array a < code > Character < / code > array , may be < code > null... | if ( array == null ) { return null ; } else if ( array . length == 0 ) { return EMPTY_CHAR_ARRAY ; } final char [ ] result = new char [ array . length ] ; for ( int i = 0 ; i < array . length ; i ++ ) { Character b = array [ i ] ; result [ i ] = ( b == null ? valueForNull : b ) ; } return result ; |
public class VideoSampleActivity { /** * Initialize ViedeoView with a video by default . */
private void initializeVideoView ( ) { } } | Uri path = Uri . parse ( APPLICATION_RAW_PATH + R . raw . video ) ; videoView . setVideoURI ( path ) ; videoView . start ( ) ; |
public class JMJson { /** * Transform t 2.
* @ param < T1 > the type parameter
* @ param < T2 > the type parameter
* @ param object the object
* @ param typeClass the type class
* @ return the t 2 */
public static < T1 , T2 > T2 transform ( T1 object , Class < T2 > typeClass ) { } } | try { return jsonMapper . convertValue ( object , typeClass ) ; } catch ( Exception e ) { return JMExceptionManager . handleExceptionAndReturnNull ( log , e , "transform" , object ) ; } |
public class FindPositionArray { /** * This method updates the internal array only if the bit vector has been
* changed since the last update or creation of this class . */
void updateCount ( ) { } } | if ( this . hasChanged ) { this . positionArray = ArrayUtils . toPrimitive ( getPositionList ( ) . toArray ( new Long [ 0 ] ) ) ; this . hasChanged = false ; } |
public class FlatBuffersMapper { /** * This method just converts enums
* @ param val
* @ return */
public static ByteOrder getOrderFromByte ( byte val ) { } } | if ( val == org . nd4j . graph . ByteOrder . LE ) return ByteOrder . LITTLE_ENDIAN ; else return ByteOrder . BIG_ENDIAN ; |
public class GobblinClusterManager { /** * Get additional { @ link Tag } s required for any type of reporting . */
private List < ? extends Tag < ? > > getMetadataTags ( String applicationName , String applicationId ) { } } | return Tag . fromMap ( new ImmutableMap . Builder < String , Object > ( ) . put ( GobblinClusterMetricTagNames . APPLICATION_NAME , applicationName ) . put ( GobblinClusterMetricTagNames . APPLICATION_ID , applicationId ) . build ( ) ) ; |
public class ZoteroItemDataProvider { /** * Makes the given ID unique
* @ param id the ID
* @ param knownIds a set of known IDs to compare to
* @ return the unique IDs */
private static String uniquify ( String id , Set < String > knownIds ) { } } | int n = 10 ; String olda = id ; while ( knownIds . contains ( id ) ) { id = olda + Integer . toString ( n , Character . MAX_RADIX ) ; ++ n ; } return id ; |
public class CardInputWidget { /** * Checks on the horizontal position of a touch event to see if
* that event needs to be associated with one of the controls even
* without having actually touched it . This essentially gives a larger
* touch surface to the controls . We return { @ code null } if the user touches... | int frameStart = mFrameLayout . getLeft ( ) ; if ( mCardNumberIsViewed ) { // Then our view is
// | CARDVIEW | | space | | DATEVIEW |
if ( touchX < frameStart + mPlacementParameters . cardWidth ) { // Then the card edit view will already handle this touch .
return null ; } else if ( touchX < mPlacementParameters . card... |
public class ComplexStubPersonAttributeDao { /** * The backing Map to use for queries , the outer map is keyed on the query attribute . The inner
* Map is the set of user attributes to be returned for the query attribute .
* @ param backingMap backing map */
public void setBackingMap ( final Map < String , Map < St... | if ( backingMap == null ) { this . backingMap = new HashMap < > ( ) ; this . possibleUserAttributeNames = new HashSet < > ( ) ; } else { this . backingMap = new LinkedHashMap < > ( backingMap ) ; this . initializePossibleAttributeNames ( ) ; } |
public class ELParser { /** * Note that both an empty Set and an empty Map are represented by { } . The
* parser will always parse { } as an empty Set and special handling is required
* to convert it to an empty Map when appropriate . */
final public void MapData ( ) throws ParseException { } } | /* @ bgen ( jjtree ) MapData */
AstMapData jjtn000 = new AstMapData ( JJTMAPDATA ) ; boolean jjtc000 = true ; jjtree . openNodeScope ( jjtn000 ) ; try { jj_consume_token ( START_SET_OR_MAP ) ; switch ( ( jj_ntk == - 1 ) ? jj_ntk ( ) : jj_ntk ) { case START_SET_OR_MAP : case INTEGER_LITERAL : case FLOATING_POINT_LITERAL... |
public class ApiOvhEmailpro { /** * Alter this object properties
* REST : PUT / email / pro / { service } / externalContact / { externalEmailAddress }
* @ param body [ required ] New object properties
* @ param service [ required ] The internal name of your pro organization
* @ param externalEmailAddress [ requ... | String qPath = "/email/pro/{service}/externalContact/{externalEmailAddress}" ; StringBuilder sb = path ( qPath , service , externalEmailAddress ) ; exec ( qPath , "PUT" , sb . toString ( ) , body ) ; |
public class Messenger { /** * Request user name auth
* @ param userName userName to authenticate
* @ return Command for execution */
@ NotNull @ ObjectiveCName ( "requestStartAuthCommandWithUserName:" ) public Command < AuthState > requestStartUserNameAuth ( String userName ) { } } | return modules . getAuthModule ( ) . requestStartUserNameAuth ( userName ) ; |
public class GL20 { /** * Checks for any GL error codes and logs them ( if { @ link # checkErrors } is true ) .
* @ return true if any errors were reported . */
public boolean checkError ( String op ) { } } | int reported = 0 ; if ( checkErrors ) { int error ; while ( ( error = glGetError ( ) ) != GL_NO_ERROR ) { reported += 1 ; System . err . println ( op + ": glError " + error ) ; } } return reported > 0 ; |
public class Unsigned { /** * Create an < code > unsigned short < / code >
* @ throws NumberFormatException If < code > value < / code > does not contain a
* parsable < code > unsigned short < / code > .
* @ see UShort # valueOf ( String ) */
public static UShort ushort ( String value ) throws NumberFormatExcepti... | return value == null ? null : UShort . valueOf ( value ) ; |
public class Vacuum { /** * Get an array with the details of all cleanups .
* @ return An array with the details of all cleanups . Empty if no cleanups were performed .
* @ throws CommandExecutionException When there has been a error during the communication or the response was invalid . */
public VacuumCleanup [ ]... | JSONArray cleanupIDs = getCleaningSummary ( ) . optJSONArray ( 3 ) ; if ( cleanupIDs == null ) return null ; VacuumCleanup [ ] res = new VacuumCleanup [ cleanupIDs . length ( ) ] ; for ( int i = 0 ; i < cleanupIDs . length ( ) ; i ++ ) { JSONArray send = new JSONArray ( ) ; send . put ( cleanupIDs . optLong ( i ) ) ; J... |
public class ParquetGroupConverter { /** * Convert a parquet group field as though it were a map . Logical types of ' list ' and ' map ' will be transformed
* into java lists and maps respectively ( { @ link ParquetGroupConverter # convertLogicalList } and
* { @ link ParquetGroupConverter # convertLogicalMap } ) , ... | return convertField ( g , fieldName , binaryAsString ) ; |
public class RegexpExpression { /** * Convert a regexp match to a map of matcher arguments . */
private Map < Any2 < Integer , String > , String > resolve_template_args_ ( Matcher matcher ) { } } | return template_ . getArguments ( ) . stream ( ) . collect ( Collectors . toMap ( arg -> arg , arg -> arg . mapCombine ( matcher :: group , matcher :: group ) ) ) ; |
public class DbSecurity { /** * For a set of tables , retrieves access to columns specified in the security tables .
* This method uses the table ' dbsec _ columns ' to perform this work . The resulting information
* in the column data is incomplete : it lacks types and other elements .
* @ param tableDataSet Tab... | for ( TableSchemaImpl tableData : tableDataSet ) { retrieveColumnData ( tableData ) ; } |
public class ModelsEngine { /** * TODO Daniele doc
* @ param U
* @ param T
* @ param theSplit
* @ param binNum
* @ param num _ max
* @ return */
public static double split2realvectors ( double [ ] U , double [ ] T , SplitVectors theSplit , int binNum , int num_max , IHMProgressMonitor pm ) { } } | double binStep = 0 , minValue = 0 , maxValue ; int i , count = 0 , previousCount , minPosition = 0 , maxPosition = 0 , emptyBins ; int [ ] bins ; int head = 0 ; bins = new int [ U . length ] ; if ( binNum <= 1 ) { previousCount = 1 ; count = 1 ; int index = 0 ; while ( count < U . length ) { // was while ( count < = U ... |
public class Utils { /** * Gets the client world .
* @ return the client world */
@ SideOnly ( Side . CLIENT ) public static World getClientWorld ( ) { } } | return Minecraft . getMinecraft ( ) != null ? Minecraft . getMinecraft ( ) . world : null ; |
public class JobConf { /** * Get the memory required to run a task of this job , in bytes . See
* { @ link # MAPRED _ TASK _ MAXVMEM _ PROPERTY }
* This method is deprecated . Now , different memory limits can be
* set for map and reduce tasks of a job , in MB .
* For backward compatibility , if the job configu... | LOG . warn ( "getMaxVirtualMemoryForTask() is deprecated. " + "Instead use getMemoryForMapTask() and getMemoryForReduceTask()" ) ; long value = getLong ( MAPRED_TASK_MAXVMEM_PROPERTY , DISABLED_MEMORY_LIMIT ) ; value = normalizeMemoryConfigValue ( value ) ; if ( value == DISABLED_MEMORY_LIMIT ) { value = Math . max ( g... |
public class Mac { /** * Returns a < code > Mac < / code > object that implements the
* specified MAC algorithm .
* < p > A new Mac object encapsulating the
* MacSpi implementation from the specified provider
* is returned . The specified provider must be registered
* in the security provider list .
* < p >... | Instance instance = JceSecurity . getInstance ( "Mac" , MacSpi . class , algorithm , provider ) ; return new Mac ( ( MacSpi ) instance . impl , instance . provider , algorithm ) ; |
public class AbstractVariable { /** * { @ inheritDoc } */
@ Override public T getConvertedValue ( Map < String , String > variables ) { } } | return convert ( variables . get ( getName ( ) ) ) ; |
public class Bucket { /** * Returns an iterable over all the items in this bucket
* @ param type The storage location to fetch from
* @ return An iterable which will return all items in the bucket .
* Note this currently makes a copy of the items list , making it thread safe . It also means
* that this will pot... | return new Iterable < Item > ( ) { @ Override public Iterator < Item > iterator ( ) { return getMasterItemsIterator ( type ) ; } } ; |
public class LogGammaDistribution { /** * The log CDF , static version .
* @ param x Value
* @ param k Shape k
* @ param theta Theta = 1.0 / Beta aka . " scaling " parameter
* @ return cdf value */
public static double logcdf ( double x , double k , double theta , double shift ) { } } | x = ( x - shift ) ; return x <= 0. ? - Double . NEGATIVE_INFINITY : GammaDistribution . logregularizedGammaP ( k , FastMath . log1p ( x ) * theta ) ; |
public class PythonDataStream { /** * A thin wrapper layer over { @ link DataStream # flatMap ( FlatMapFunction ) } .
* @ param flat _ mapper The FlatMapFunction that is called for each element of the
* DataStream
* @ return The transformed { @ link PythonDataStream } . */
public PythonDataStream < SingleOutputSt... | return new PythonSingleOutputStreamOperator ( stream . flatMap ( new PythonFlatMapFunction ( flat_mapper ) ) ) ; |
public class LabelCache { /** * Adds the label list to the labels for the account .
* @ param labels The labels to add */
public void add ( Collection < Label > labels ) { } } | for ( Label label : labels ) this . labels . put ( label . getKey ( ) , label ) ; |
public class DeploymentLaunchConfigMarshaller { /** * Marshall the given parameter object . */
public void marshall ( DeploymentLaunchConfig deploymentLaunchConfig , ProtocolMarshaller protocolMarshaller ) { } } | if ( deploymentLaunchConfig == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( deploymentLaunchConfig . getPackageName ( ) , PACKAGENAME_BINDING ) ; protocolMarshaller . marshall ( deploymentLaunchConfig . getPreLaunchFile ( ) , PRELAUNCHFIL... |
public class AmazonAlexaForBusinessClient { /** * Configures the email template for the user enrollment invitation with the specified attributes .
* @ param putInvitationConfigurationRequest
* @ return Result of the PutInvitationConfiguration operation returned by the service .
* @ throws NotFoundException
* Th... | request = beforeClientExecution ( request ) ; return executePutInvitationConfiguration ( request ) ; |
public class Music { /** * Returns an element for the given reference , < TT > null < / TT > if not found */
public MusicElement getElementByReference ( MusicElementReference ref ) { } } | if ( voiceExists ( ref . getVoice ( ) ) ) { for ( Object o : getVoice ( ref . getVoice ( ) ) ) { MusicElement element = ( MusicElement ) o ; if ( element . getReference ( ) . equals ( ref ) ) return element ; } } return null ; |
public class ListChildrenRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( ListChildrenRequest listChildrenRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( listChildrenRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( listChildrenRequest . getParentId ( ) , PARENTID_BINDING ) ; protocolMarshaller . marshall ( listChildrenRequest . getChildType ( ) , CHILDTYPE_BINDING ) ; protocolM... |
public class LazyFeatureDependencies { /** * Creates a LazyProxyFactory
* @ return the LazyProxyFactory */
public static LazyProxyFactory createDefaultProxyFactory ( ) { } } | if ( testDependencyFullFilled ( ) ) { final String factoryClassName = "dev.morphia.mapping.lazy.CGLibLazyProxyFactory" ; try { return ( LazyProxyFactory ) Class . forName ( factoryClassName ) . newInstance ( ) ; } catch ( Exception e ) { LOG . error ( "While instantiating " + factoryClassName , e ) ; } } return null ; |
public class SearchHelper { /** * Set up an OR filter for each map key and value . Consider the following example .
* < table border = " 1 " > < caption > Example Values < / caption >
* < tr > < td > < b > Attribute < / b > < / td > < td > < b > Value < / b > < / td > < / tr >
* < tr > < td > givenName < / td > <... | if ( nameValuePairs == null ) { throw new NullPointerException ( ) ; } if ( nameValuePairs . size ( ) < 1 ) { throw new IllegalArgumentException ( "requires at least one key" ) ; } final List < FilterSequence > filters = new ArrayList < > ( ) ; for ( final Map . Entry < String , String > entry : nameValuePairs . entryS... |
public class ChiIndexUtils { /** * Evaluates the valence corrected chi index for a set of fragments .
* This method takes into account the S and P atom types described in
* Kier & Hall ( 1986 ) , page 20 for which empirical delta V values are used .
* @ param atomContainer The target < code > AtomContainer < / co... | try { IsotopeFactory ifac = Isotopes . getInstance ( ) ; ifac . configureAtoms ( atomContainer ) ; } catch ( IOException e ) { throw new CDKException ( "IO problem occurred when using the CDK atom config\n" + e . getMessage ( ) , e ) ; } double sum = 0 ; for ( List < Integer > aFragList : fragList ) { List < Integer > ... |
public class ObjectParameter { /** * Parse an Enum definition by calling Enum . valueOf .
* @ param serializedObject the full enumerated value
* @ return the class object */
@ SuppressWarnings ( "unchecked" ) private Object parseEnumParameter ( final Enum < ? > e , final String serializedObject ) { } } | final Object res = Enum . valueOf ( e . getClass ( ) , serializedObject ) ; return res ; |
public class SynchronizedPDUSender { /** * ( non - Javadoc )
* @ see org . jsmpp . PDUSender # sendQuerySmResp ( java . io . OutputStream , int ,
* java . lang . String , java . lang . String , org . jsmpp . bean . MessageState ,
* byte ) */
public byte [ ] sendQuerySmResp ( OutputStream os , int sequenceNumber ,... | synchronized ( os ) { return pduSender . sendQuerySmResp ( os , sequenceNumber , messageId , finalDate , messageState , errorCode ) ; } |
public class Checksum { /** * Calculates the MD5 checksum of a specified bytes .
* @ param algorithm the algorithm to use ( md5 , sha1 , etc . ) to calculate the
* message digest
* @ param bytes the bytes to generate the MD5 checksum
* @ return the hex representation of the MD5 hash */
public static String getC... | final MessageDigest digest = getMessageDigest ( algorithm ) ; final byte [ ] b = digest . digest ( bytes ) ; return getHex ( b ) ; |
public class XMLEncodingDetector { /** * org . apache . xerces . impl . XMLEntityManager . startEntity ( ) */
private void createInitialReader ( ) throws IOException , JspCoreException { } } | // wrap this stream in RewindableInputStream
stream = new RewindableInputStream ( stream ) ; // perform auto - detect of encoding if necessary
if ( encoding == null ) { // read first four bytes and determine encoding
final byte [ ] b4 = new byte [ 4 ] ; int count = 0 ; for ( ; count < 4 ; count ++ ) { b4 [ count ] = ( ... |
public class JstormOnYarn { /** * Monitor the submitted application for completion .
* Kill application if time expires .
* @ param appId Application Id of application to be monitored
* @ return true if application completed successfully
* @ throws YarnException
* @ throws IOException */
private boolean monit... | Integer monitorTimes = JOYConstants . MONITOR_TIMES ; while ( true ) { // Check app status every 1 second .
try { Thread . sleep ( JOYConstants . MONITOR_TIME_INTERVAL ) ; } catch ( InterruptedException e ) { LOG . debug ( "Thread sleep in monitoring loop interrupted" ) ; } // Get application report for the appId we ar... |
public class TimedMetadataInsertion { /** * Id3Insertions contains the array of Id3Insertion instances .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setId3Insertions ( java . util . Collection ) } or { @ link # withId3Insertions ( java . util . Collection... | if ( this . id3Insertions == null ) { setId3Insertions ( new java . util . ArrayList < Id3Insertion > ( id3Insertions . length ) ) ; } for ( Id3Insertion ele : id3Insertions ) { this . id3Insertions . add ( ele ) ; } return this ; |
public class Transporter { /** * - - - ERROR PACKET ( STREAMING ) - - - */
public void sendErrorPacket ( String cmd , String nodeID , Context ctx , Throwable cause , long sequence ) { } } | FastBuildTree msg = throwableToTree ( ctx . id , this . nodeID , cause ) ; // Stream packet counter ( 1 . . . N )
msg . putUnsafe ( "seq" , sequence ) ; // End of streaming
msg . putUnsafe ( "stream" , false ) ; // Send message
publish ( cmd , nodeID , msg ) ; |
public class ZipNumIndex { /** * TODO : replace with matchType version */
public CloseableIterator < String > getCDXIterator ( String key , String start , boolean exact , ZipNumParams params ) throws IOException { } } | CloseableIterator < String > summaryIter = summary . getRecordIteratorLT ( key ) ; if ( params . getTimestampDedupLength ( ) > 0 ) { summaryIter = new TimestampDedupIterator ( summaryIter , params . getTimestampDedupLength ( ) ) ; } summaryIter = wrapPrefix ( summaryIter , start , exact ) ; if ( blockLoader . isBufferF... |
public class MutatorImpl { /** * { @ inheritDoc } */
@ Override public < N > Mutator < K > addDeletion ( K key , String cf , long clock ) { } } | addDeletion ( key , cf , null , null , clock ) ; return this ; |
public class IOUtils { /** * Get a input file stream ( automatically gunzip / bunzip2 depending on file extension )
* @ param filename Name of file to open
* @ return Input stream that can be used to read from the file
* @ throws IOException if there are exceptions opening the file */
public static InputStream ge... | InputStream in = new FileInputStream ( filename ) ; if ( filename . endsWith ( ".gz" ) ) { in = new GZIPInputStream ( in ) ; } else if ( filename . endsWith ( ".bz2" ) ) { // in = new CBZip2InputStream ( in ) ;
in = getBZip2PipedInputStream ( filename ) ; } return in ; |
public class AgreementSite { /** * Construct a ZK transaction that will add the initiator to the cluster */
public CountDownLatch requestJoin ( final long joiningSite ) throws Exception { } } | final CountDownLatch cdl = new CountDownLatch ( 1 ) ; final Runnable r = new Runnable ( ) { @ Override public void run ( ) { try { final long txnId = m_idManager . getNextUniqueTransactionId ( ) ; for ( long initiatorHSId : m_hsIds ) { if ( initiatorHSId == m_hsId ) continue ; JSONObject jsObj = new JSONObject ( ) ; js... |
public class ColumnMapperInteger { /** * { @ inheritDoc } */
@ Override public Field field ( String name , Object value ) { } } | Integer number = indexValue ( name , value ) ; Field field = new IntField ( name , number , STORE ) ; field . setBoost ( boost ) ; return field ; |
public class PassConfig { /** * Find the first pass provider that does not have a delegate . */
final PassConfig getBasePassConfig ( ) { } } | PassConfig current = this ; while ( current instanceof PassConfigDelegate ) { current = ( ( PassConfigDelegate ) current ) . delegate ; } return current ; |
public class CmsPropertyDialogExtension { /** * Opens the property dialog for a resource to be created with the ' New ' dialog . < p >
* @ param builder the resource builder used by the ' New ' dialog to create the resource */
public void editPropertiesForNewResource ( CmsNewResourceBuilder builder ) { } } | try { CmsPropertiesBean propData = builder . getPropertyData ( ) ; String serializedPropData = RPC . encodeResponseForSuccess ( I_CmsVfsService . class . getMethod ( "loadPropertyData" , CmsUUID . class ) , propData , CmsPrefetchSerializationPolicy . instance ( ) ) ; getRpcProxy ( I_CmsPropertyClientRpc . class ) . edi... |
public class CheerleaderPlayer { /** * Add a list of track to thr current SoundCloud player playlist .
* @ param tracks list of { @ link fr . tvbarthel . cheerleader . library . client . SoundCloudTrack }
* to be added to the player . */
public void addTracks ( List < SoundCloudTrack > tracks ) { } } | checkState ( ) ; for ( SoundCloudTrack track : tracks ) { addTrack ( track ) ; } |
public class NodeImpl { /** * TODO It would be nicer if we could return PropertyNode */
public static NodeImpl createPropertyNode ( final String name , final NodeImpl parent ) { } } | return new NodeImpl ( name , parent , false , null , null , ElementKind . PROPERTY , EMPTY_CLASS_ARRAY , null , null , null , null ) ; |
public class SebContextWait { /** * Sleeps for defined timeout without checking for any
* condition . */
public SebContextWait sleep ( ) { } } | try { sleeper . sleep ( timeout ) ; return this ; } catch ( InterruptedException e ) { Thread . currentThread ( ) . interrupt ( ) ; throw new WebDriverException ( e ) ; } |
public class BuildInfo { /** * Generates the { @ code build - info . properties } file in the configured
* { @ link # setDestinationDir ( File ) destination } . */
@ TaskAction public void generateBuildProperties ( ) { } } | try { new BuildPropertiesWriter ( new File ( getDestinationDir ( ) , "build-info.properties" ) ) . writeBuildProperties ( new ProjectDetails ( this . properties . getGroup ( ) , ( this . properties . getArtifact ( ) != null ) ? this . properties . getArtifact ( ) : "unspecified" , this . properties . getVersion ( ) , t... |
public class SimpleDataWriter { /** * Write a source record to the staging file
* @ param record data record to write
* @ throws java . io . IOException if there is anything wrong writing the record */
@ Override public void write ( byte [ ] record ) throws IOException { } } | Preconditions . checkNotNull ( record ) ; byte [ ] toWrite = record ; if ( this . recordDelimiter . isPresent ( ) ) { toWrite = Arrays . copyOf ( record , record . length + 1 ) ; toWrite [ toWrite . length - 1 ] = this . recordDelimiter . get ( ) ; } if ( this . prependSize ) { long recordSize = toWrite . length ; Byte... |
public class DisplayerEditor { /** * Widget listeners callback notifications */
void onDataSetLookupChanged ( @ Observes DataSetLookupChangedEvent event ) { } } | DataSetLookup dataSetLookup = event . getDataSetLookup ( ) ; displayerSettings . setDataSet ( null ) ; displayerSettings . setDataSetLookup ( dataSetLookup ) ; removeStaleSettings ( ) ; initDisplayer ( ) ; initSettingsEditor ( ) ; showDisplayer ( ) ; |
public class PoolFairnessCalculator { /** * This method takes a list of { @ link PoolMetadata } objects and calculates
* fairness metrics of how well scheduling is doing .
* The goals of the fair scheduling are to insure that every pool is getting
* an equal share . The expected share of resources for each pool i... | if ( poolMetadataList == null || poolMetadataList . isEmpty ( ) ) { return ; } // Find the total available usage and guaranteed resources by resource
// type . Add the resource metadata to the sorted set to schedule if
// there is something to schedule ( desiredAfterConstraints > 0)
long startTime = System . currentTim... |
public class PlannerDataModelerHelperUtils { /** * TODO introduce PlannerDatamodelerRenameHelper once DataModelerService . rename uses RenameService to rename DataObject */
private void onDataObjectRename ( @ Observes DataObjectRenamedEvent event ) { } } | Path updatedPath = event . getPath ( ) ; if ( updatedPath != null ) { try { updateDataObject ( updatedPath ) ; } catch ( Exception e ) { logger . error ( "Data object couldn't be updated, path: " + updatedPath + "." ) ; } } |
public class Classes { /** * Retrieve resource , identified by qualified name , as input stream . This method does its best to load requested
* resource but throws exception if fail . Resource is loaded using { @ link ClassLoader # getResourceAsStream ( String ) } and
* < code > name < / code > argument should foll... | Params . notNullOrEmpty ( name , "Resource name" ) ; // not documented behavior : accept but ignore trailing path separator
if ( name . charAt ( 0 ) == '/' ) { name = name . substring ( 1 ) ; } InputStream stream = getResourceAsStream ( name , new ClassLoader [ ] { Thread . currentThread ( ) . getContextClassLoader ( )... |
public class CommerceCountryPersistenceImpl { /** * Returns the first commerce country in the ordered set where groupId = & # 63 ; and billingAllowed = & # 63 ; and active = & # 63 ; .
* @ param groupId the group ID
* @ param billingAllowed the billing allowed
* @ param active the active
* @ param orderByCompar... | CommerceCountry commerceCountry = fetchByG_B_A_First ( groupId , billingAllowed , active , orderByComparator ) ; if ( commerceCountry != null ) { return commerceCountry ; } StringBundler msg = new StringBundler ( 8 ) ; msg . append ( _NO_SUCH_ENTITY_WITH_KEY ) ; msg . append ( "groupId=" ) ; msg . append ( groupId ) ; ... |
public class Serializer { /** * Registers a default type serializer for the given base type .
* Default serializers are used to serialize types for which no specific { @ link TypeSerializer } is provided .
* When a serializable type is { @ link # register ( Class ) registered } without a { @ link TypeSerializer } ,... | registry . registerDefault ( baseType , factory ) ; return this ; |
public class iptunnel { /** * Use this API to fetch filtered set of iptunnel resources .
* filter string should be in JSON format . eg : " port : 80 , servicetype : HTTP " . */
public static iptunnel [ ] get_filtered ( nitro_service service , String filter ) throws Exception { } } | iptunnel obj = new iptunnel ( ) ; options option = new options ( ) ; option . set_filter ( filter ) ; iptunnel [ ] response = ( iptunnel [ ] ) obj . getfiltered ( service , option ) ; return response ; |
public class ZipUtils { /** * zip .
* @ param fileNames a { @ link java . util . List } object .
* @ param zipPath a { @ link java . lang . String } object .
* @ return a { @ link java . io . File } object . */
public static File zip ( List < String > fileNames , String zipPath ) { } } | return zip ( fileNames , zipPath , null ) ; |
public class PostgisGeoPlugin { /** * 检查并替换输入的地理信息相关参数 , 使用PostGis提供的ST _ GeomFromText函数
* @ author Pin Liu */
protected void checkAndReplaceInput ( List < IntrospectedColumn > columns , XmlElement xe ) { } } | for ( Element element : xe . getElements ( ) ) { if ( element instanceof XmlElement ) { checkAndReplaceInput ( columns , ( XmlElement ) element ) ; } if ( element instanceof TextElement ) { TextElement te = ( TextElement ) element ; checkAndReplaceInput ( columns , te ) ; } } |
public class WsMessageReaderImpl { /** * - - - - - WebSocketMessageReader Implementation - - - - - */
@ Override public ByteBuffer getBinary ( ) throws IOException { } } | if ( _messageType == null ) { return null ; } if ( _messageType == WebSocketMessageType . EOS ) { String s = "End of stream has reached as the connection has been closed" ; throw new WebSocketException ( s ) ; } if ( _messageType != WebSocketMessageType . BINARY ) { String s = "Invalid WebSocketMessageType: Cannot deco... |
public class RendererModel { /** * Sets the atom currently highlighted .
* @ param highlightedAtom
* The atom to be highlighted */
public void setHighlightedAtom ( IAtom highlightedAtom ) { } } | if ( ( this . highlightedAtom != null ) || ( highlightedAtom != null ) ) { this . highlightedAtom = highlightedAtom ; fireChange ( ) ; } |
public class CmsHtmlConverter { /** * Converts the given HTML code according to the settings of the converter . < p >
* @ param htmlInput HTML input stored in a string
* @ return string containing the converted HTML
* @ throws UnsupportedEncodingException if the encoding set for the conversion is not supported */... | // first : collect all converter classes to use on the input
Map < String , List < String > > converters = new HashMap < String , List < String > > ( ) ; for ( Iterator < String > i = getModes ( ) . iterator ( ) ; i . hasNext ( ) ; ) { String mode = i . next ( ) ; String converterClass = OpenCms . getResourceManager ( ... |
public class MPSubscriptionImpl { /** * Remove a selection criteria from the subscription */
public void removeSelectionCriteria ( SelectionCriteria selCriteria ) throws SIResourceException { } } | if ( tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "removeSelectionCriteria" , new Object [ ] { selCriteria } ) ; // If the selection criteria was removed then this is an indication that it was
// in the matchspace and it can be removed .
boolean wasRemoved = _consumerDispatcher . getConsumerDispatcherState ( ) . remo... |
public class ClusteredStore { /** * The assumption is that this method will be invoked only by cache . getAll method . */
@ Override public Map < K , ValueHolder < V > > bulkComputeIfAbsent ( final Set < ? extends K > keys , final Function < Iterable < ? extends K > , Iterable < ? extends Map . Entry < ? extends K , ? ... | if ( mappingFunction instanceof Ehcache . GetAllFunction ) { Map < K , ValueHolder < V > > map = new HashMap < > ( ) ; for ( K key : keys ) { ValueHolder < V > value ; try { value = getInternal ( key ) ; } catch ( TimeoutException e ) { // This timeout handling is safe * * only * * in the context of a get / read operat... |
public class AppConfig { /** * Returns property value for a key .
* @ param key key of property .
* @ return value for this key , < code > null < / code > if not found . */
public static String getProperty ( String key ) { } } | if ( ! isInited ( ) ) { init ( ) ; } Property p = props . get ( key ) ; return p == null ? null : p . getValue ( ) ; |
public class Name { /** * Sets the node ' s identifier
* @ throws IllegalArgumentException if identifier is null */
public void setIdentifier ( String identifier ) { } } | assertNotNull ( identifier ) ; this . identifier = identifier ; setLength ( identifier . length ( ) ) ; |
public class AbstractLoader { /** * { @ inheritDoc } */
public void load ( ) { } } | Source source = getSource ( ) ; Target target = getTarget ( ) ; source . beginExport ( ) ; target . beginImport ( ) ; Set < String > propertyNames = mode . equals ( MappingMode . AUTO ) ? target . getPropertyNames ( ) : source . getPropertyNames ( ) ; for ( Object sourceItem : source ) { Object targetItem = target . cr... |
public class AbstractMessage { /** * / * ( non - Javadoc )
* @ see javax . jms . Message # setJMSMessageID ( java . lang . String ) */
@ Override public final void setJMSMessageID ( String id ) throws JMSException { } } | assertDeserializationLevel ( MessageSerializationLevel . FULL ) ; this . id = id ; |
public class WebDavServletController { /** * Tries to mount the resource served by this servlet as a WebDAV drive on the local machine .
* @ param mountParams Optional mount parameters , that may be required for certain operating systems .
* @ return A { @ link Mount } instance allowing unmounting and revealing the... | if ( ! contextHandler . isStarted ( ) ) { throw new IllegalStateException ( "Mounting only possible for running servlets." ) ; } URI uri = getServletRootUri ( mountParams . getOrDefault ( MountParam . WEBDAV_HOSTNAME , connector . getHost ( ) ) ) ; LOG . info ( "Mounting {} using {}" , uri , mounter . getClass ( ) . ge... |
public class ClassGraph { /** * Print the specified relation
* @ param from the source class
* @ param to the destination class */
private void relation ( Options opt , RelationType rt , ClassDoc from , ClassDoc to , String tailLabel , String label , String headLabel ) { } } | relation ( opt , rt , from , from . toString ( ) , to , to . toString ( ) , tailLabel , label , headLabel ) ; |
public class ImLoggedInBase { /** * Browse to the login page and do the login .
* @ param noPage this param won ' t be considered : may be null */
@ Override public WebPage run ( WebPage noPage ) { } } | LoginPage < ? > loginPage = ( LoginPage < ? > ) super . run ( noPage ) ; return loginPage . loginAs ( user . getUsername ( ) , user . getPassword ( ) ) ; |
public class ReportService { /** * Returns the output directory for reporting . */
public Path getReportDirectory ( ) { } } | WindupConfigurationModel cfg = WindupConfigurationService . getConfigurationModel ( getGraphContext ( ) ) ; Path path = cfg . getOutputPath ( ) . asFile ( ) . toPath ( ) . resolve ( REPORTS_DIR ) ; createDirectoryIfNeeded ( path ) ; return path . toAbsolutePath ( ) ; |
public class BeanUtil { /** * 把Bean里面的String属性做trim操作 。
* 通常bean直接用来绑定页面的input , 用户的输入可能首尾存在空格 , 通常保存数据库前需要把首尾空格去掉
* @ param < T > Bean类型
* @ param bean Bean对象
* @ param ignoreFields 不需要trim的Field名称列表 ( 不区分大小写 ) */
public static < T > T trimStrFields ( T bean , String ... ignoreFields ) { } } | if ( bean == null ) { return bean ; } final Field [ ] fields = ReflectUtil . getFields ( bean . getClass ( ) ) ; for ( Field field : fields ) { if ( ignoreFields != null && ArrayUtil . containsIgnoreCase ( ignoreFields , field . getName ( ) ) ) { // 不处理忽略的Fields
continue ; } if ( String . class . equals ( field . getTy... |
public class JoinDomainRequest { /** * List of IPv4 addresses , NetBIOS names , or host names of your domain server . If you need to specify the port
* number include it after the colon ( “ : ” ) . For example , < code > mydc . mydomain . com : 389 < / code > .
* @ return List of IPv4 addresses , NetBIOS names , or... | if ( domainControllers == null ) { domainControllers = new com . amazonaws . internal . SdkInternalList < String > ( ) ; } return domainControllers ; |
public class AdaptiveCompiler { /** * httl . properties : loggers = httl . spi . loggers . Log4jLogger */
public void setLogger ( Logger logger ) { } } | this . logger = logger ; if ( compiler instanceof AbstractCompiler ) { ( ( AbstractCompiler ) compiler ) . setLogger ( logger ) ; } |
public class TemplateMsgAPI { /** * 删除模板
* @ param templateId 模板ID
* @ return 删除结果 */
public BaseResponse delTemplate ( String templateId ) { } } | LOG . debug ( "删除模板......" ) ; BeanUtil . requireNonNull ( templateId , "templateId is null" ) ; String url = BASE_API_URL + "cgi-bin/template/del_private_template?access_token=#" ; Map < String , String > map = new HashMap < String , String > ( ) ; map . put ( "template_id" , templateId ) ; BaseResponse r = executePos... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.