signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class BufferedAttributeCollection { /** * Set the attribute value .
* @ param name is the name of the attribute
* @ param type is the type of the attribute
* @ param value is the raw value to store .
* @ return the new created attribute
* @ throws AttributeException on error . */
protected Attribute se... | AttributeValue oldValue = extractValueForSafe ( name ) ; if ( oldValue != null ) { if ( oldValue . equals ( value ) ) { return null ; } // Clone the value for avoid border effects .
oldValue = new AttributeValueImpl ( oldValue ) ; } final Attribute attr = new AttributeImpl ( name , type ) ; attr . setValue ( type . cas... |
public class CreateAssociationBatchResult { /** * Information about the associations that succeeded .
* < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use
* { @ link # setSuccessful ( java . util . Collection ) } or { @ link # withSuccessful ( java . util . Collection ) } if y... | if ( this . successful == null ) { setSuccessful ( new com . amazonaws . internal . SdkInternalList < AssociationDescription > ( successful . length ) ) ; } for ( AssociationDescription ele : successful ) { this . successful . add ( ele ) ; } return this ; |
public class BlockExpressionBuilderImpl { /** * Add an expression inside the block .
* @ return the expression builder . */
public IExpressionBuilder addExpression ( ) { } } | final IExpressionBuilder builder = this . expressionProvider . get ( ) ; builder . eInit ( getXBlockExpression ( ) , new Procedures . Procedure1 < XExpression > ( ) { private int index = - 1 ; public void apply ( XExpression it ) { if ( this . index >= 0 ) { getXBlockExpression ( ) . getExpressions ( ) . set ( index , ... |
public class DBUnitDataHandler { /** * - - Private methods */
private void executeScript ( String script ) { } } | try { final StatementSplitter statementSplitter = new StatementSplitterResolver ( scriptConfigurationInstance . get ( ) ) . resolve ( ) ; final ScriptExecutor scriptExecutor = new ScriptExecutor ( databaseConnection . get ( ) . getConnection ( ) , scriptConfigurationInstance . get ( ) , statementSplitter ) ; scriptExec... |
public class AbstractMinMaxTextBox { /** * set maximum allowed value .
* @ param pmax maximum value allowed */
public void setMax ( final T pmax ) { } } | if ( pmax == null ) { getInputElement ( ) . removeAttribute ( "max" ) ; } else { getInputElement ( ) . setMax ( this . numberRenderer . render ( pmax ) ) ; } |
public class RestServiceExceptionFacade { /** * Add a response message to an existing response .
* @ param exception the { @ link WebApplicationException } .
* @ return the response with the response message added */
protected Response createResponse ( WebApplicationException exception ) { } } | Response response = exception . getResponse ( ) ; int statusCode = response . getStatus ( ) ; Status status = Status . fromStatusCode ( statusCode ) ; NlsRuntimeException error ; if ( exception instanceof ServerErrorException ) { error = new TechnicalErrorUserException ( exception ) ; LOG . error ( "Service failed on s... |
public class InBinding { /** * Sets the specified values as the matching value list .
* First , the previous list are cleared and all of
* the specified values are appended to the list .
* @ param values
* a collection whose elements are appended
* to the matching value list . */
public void setValues ( final... | if ( values != _values ) { clear ( ) ; if ( values == null || values . size ( ) == 0 ) { return ; } for ( Object value : values ) { addValue ( value ) ; } } |
public class GenericParser { /** * { @ inheritDoc } */
@ Override public RepositoryResourceWritable parseFileToResource ( File assetFile , File metadataFile , String contentUrl ) throws RepositoryException { } } | File artifactFile = null ; ArtifactMetadata metadata = null ; if ( assetFile . getName ( ) . endsWith ( "metadata.zip" ) ) { metadata = explodeZip ( assetFile ) ; // No artifactFile to set , that ' s fine we just won ' t have a CRC or file size
} else { metadata = explodeArtifact ( assetFile , metadataFile ) ; artifact... |
public class IntervalTree { /** * Balancing operations .
* Implementations of rebalancings during insertion and deletion are
* slightly different than the CLR version . Rather than using dummy
* nilnodes , we use a set of accessors that deal properly with null . They
* are used to avoid messiness surrounding nu... | return p == null ? BLACK : p . color ; |
public class ChangeModelAction { /** * Template method to factorize the execution of the change model
* notification .
* @ return
* @ throws java . lang . Exception */
@ Override public Object execute ( ) throws Exception { } } | Object ret = executeChange ( ) ; if ( changesManager != null ) changesManager . modelChanged ( ) ; return ret ; |
public class StereoDisparityWtoNaiveFive { /** * Compute the score for five local regions and just use the center + the two best
* @ param leftX X - axis center left image
* @ param rightX X - axis center left image
* @ param centerY Y - axis center for both images
* @ return Fit score for both regions . */
pro... | double center = computeScoreRect ( leftX , rightX , centerY ) ; four [ 0 ] = computeScoreRect ( leftX - radiusX , rightX - radiusX , centerY - radiusY ) ; four [ 1 ] = computeScoreRect ( leftX + radiusX , rightX + radiusX , centerY - radiusY ) ; four [ 2 ] = computeScoreRect ( leftX - radiusX , rightX - radiusX , cente... |
public class ByteUtils { /** * Converts a Collection of Number to a byte array .
* @ param bytes
* a Collection of Number
* @ return byte array */
public static byte [ ] toArray ( Collection < ? extends Number > bytes ) { } } | byte [ ] array = new byte [ bytes . size ( ) ] ; Iterator < ? extends Number > iter = bytes . iterator ( ) ; for ( int i = 0 ; i < bytes . size ( ) ; i ++ ) { array [ i ] = iter . next ( ) . byteValue ( ) ; } return array ; |
public class RunPRequest { /** * < code > optional . alluxio . grpc . job . RunPOptions options = 2 ; < / code > */
public alluxio . grpc . RunPOptionsOrBuilder getOptionsOrBuilder ( ) { } } | return options_ == null ? alluxio . grpc . RunPOptions . getDefaultInstance ( ) : options_ ; |
public class AbstractVdmBreakpoint { /** * @ see IScriptBreakpoint # removeId ( IDbgpSession ) */
public String removeId ( IDbgpSession session ) { } } | final PerSessionInfo info ; synchronized ( sessions ) { info = ( PerSessionInfo ) sessions . remove ( session ) ; } return info != null ? info . identifier : null ; |
public class DOMDifferenceEngine { /** * Compares whether two attributes are specified explicitly . */
private DeferredComparison compareAttributeExplicitness ( final Attr control , final XPathContext controlContext , final Attr test , final XPathContext testContext ) { } } | return new DeferredComparison ( ) { @ Override public ComparisonState apply ( ) { return compare ( new Comparison ( ComparisonType . ATTR_VALUE_EXPLICITLY_SPECIFIED , control , getXPath ( controlContext ) , control . getSpecified ( ) , getParentXPath ( controlContext ) , test , getXPath ( testContext ) , test . getSpec... |
public class SocketGroovyMethods { /** * Accepts a connection and passes the resulting Socket to the closure
* which runs in a new Thread or the calling thread , as needed .
* @ param serverSocket a ServerSocket
* @ param runInANewThread This flag should be true , if the closure should be invoked in a new thread ... | final Socket socket = serverSocket . accept ( ) ; if ( runInANewThread ) { new Thread ( new Runnable ( ) { public void run ( ) { invokeClosureWithSocket ( socket , closure ) ; } } ) . start ( ) ; } else { invokeClosureWithSocket ( socket , closure ) ; } return socket ; |
public class xen_upgrade { /** * Use this API to fetch filtered set of xen _ upgrade resources .
* filter string should be in JSON format . eg : " vm _ state : DOWN , name : [ a - z ] + " */
public static xen_upgrade [ ] get_filtered ( nitro_service service , String filter ) throws Exception { } } | xen_upgrade obj = new xen_upgrade ( ) ; options option = new options ( ) ; option . set_filter ( filter ) ; xen_upgrade [ ] response = ( xen_upgrade [ ] ) obj . getfiltered ( service , option ) ; return response ; |
public class LabelIndexer { /** * Convert Index to actual string . */
public Map < String , Double > convertMapKey ( Map < Integer , Double > probs ) { } } | Map < String , Double > stringKeyProb = new HashMap < > ( ) ; probs . entrySet ( ) . forEach ( e -> stringKeyProb . put ( getLabel ( e . getKey ( ) ) , e . getValue ( ) ) ) ; return stringKeyProb ; |
public class CmsExportHelper { /** * Writes a single OpenCms VFS file to the export . < p >
* @ param file the OpenCms VFS file to write
* @ param name the name of the file in the export
* @ throws IOException in case of file access issues */
public void writeFile ( CmsFile file , String name ) throws IOException... | if ( m_isExportAsFiles ) { writeFile2Rfs ( file , name ) ; } else { writeFile2Zip ( file , name ) ; } |
public class MultiProcessCluster { /** * Kills the primary master .
* If no master is currently primary , this method blocks until a primary has been elected , then
* kills it .
* @ param timeoutMs maximum amount of time to wait , in milliseconds
* @ return the ID of the killed master */
public synchronized int... | int index = getPrimaryMasterIndex ( timeoutMs ) ; mMasters . get ( index ) . close ( ) ; return index ; |
public class BalancingPolicy { /** * Determines whether or not a given work unit is pegged to this instance . */
public boolean isPeggedToMe ( String workUnitId ) { } } | ObjectNode zkWorkData = cluster . allWorkUnits . get ( workUnitId ) ; if ( zkWorkData == null || zkWorkData . size ( ) == 0 ) { cluster . workUnitsPeggedToMe . remove ( workUnitId ) ; return false ; } try { JsonNode pegged = zkWorkData . get ( cluster . name ) ; final boolean isPegged = ( pegged != null ) && pegged . a... |
public class PhaseOneImpl { /** * { @ inheritDoc } */
@ Override public void stage6Expansion ( final Document doc , final ProtoNetwork pn , boolean expandNestedStatements ) { } } | // expand statements , including whether nested statement should be
// expanded
expansion . expandStatements ( doc , pn , expandNestedStatements ) ; // expand terms if not disabled
expansion . expandTerms ( doc , pn ) ; |
public class MigrationManager { /** * Retains only the { @ code migrations } in the completed migration list . Acquires the partition service lock . */
void retainCompletedMigrations ( Collection < MigrationInfo > migrations ) { } } | partitionServiceLock . lock ( ) ; try { completedMigrations . retainAll ( migrations ) ; } finally { partitionServiceLock . unlock ( ) ; } |
public class FadeDrawable { /** * Starts fading to the specified layer .
* @ param index the index of the layer to fade to */
public void fadeToLayer ( int index ) { } } | mTransitionState = TRANSITION_STARTING ; Arrays . fill ( mIsLayerOn , false ) ; mIsLayerOn [ index ] = true ; invalidateSelf ( ) ; |
public class TokenQueue { /** * Pulls a string off the queue ( like consumeTo ) , and then pulls off the matched string ( but does not return it ) .
* If the queue runs out of characters before finding the seq , will return as much as it can ( and queue will go
* isEmpty ( ) = = true ) .
* @ param seq String to m... | String data = consumeTo ( seq ) ; matchChomp ( seq ) ; return data ; |
public class JSONTokener { /** * Determine if the source string still contains characters that next ( )
* can consume .
* @ return true if not yet at the end of the source .
* @ throws JSONException thrown if there is an error stepping forward
* or backward while checking for more data . */
public boolean more ... | if ( this . usePrevious ) { return true ; } try { this . reader . mark ( 1 ) ; } catch ( IOException e ) { throw new JSONException ( "Unable to preserve stream position" , e ) ; } try { // -1 is EOF , but next ( ) can not consume the null character ' \ 0'
if ( this . reader . read ( ) <= 0 ) { this . eof = true ; retur... |
public class CompilerUtil { /** * Converts and returns the specified class , if it represents a primitive , to the associated
* non - primitive class , or else returns the specified class if it is not a primitive .
* @ param clazz
* the input class
* @ return the associated non - primitive class , or the input ... | Class < ? > clazz2 = PRIMITIVE_TO_CLASS . get ( clazz ) ; return clazz2 == null ? clazz : clazz2 ; |
public class CmsSiteManager { /** * Opens the edit site dialog . < p >
* @ param siteRoot the site root of the site to edit , if < code > null < / code > */
public void openEditDialog ( String siteRoot ) { } } | CmsEditSiteForm form ; String caption ; if ( siteRoot != null ) { form = new CmsEditSiteForm ( m_rootCms , this , siteRoot ) ; caption = CmsVaadinUtils . getMessageText ( Messages . GUI_SITE_CONFIGURATION_EDIT_1 , m_sitesTable . getContainer ( ) . getItem ( siteRoot ) . getItemProperty ( TableProperty . Title ) . getVa... |
import java . util . ArrayList ; import java . util . Collections ; import java . util . Comparator ; class ArrangeTuples { /** * Function to sort a list of tuples based on the total count of digits in each tuple .
* Examples :
* arrange _ tuples ( [ ( 3 , 4 , 6 , 723 ) , ( 1 , 2 ) , ( 12345 , ) , ( 134 , 234 , 34 ... | Collections . sort ( inputList , new Comparator < int [ ] > ( ) { @ Override public int compare ( int [ ] o1 , int [ ] o2 ) { return Integer . compare ( digitsCount ( o1 ) , digitsCount ( o2 ) ) ; } } ) ; return inputList . toString ( ) ; |
public class LBiBoolFunctionBuilder { /** * Builds the functional interface implementation and if previously provided calls the consumer . */
@ Nonnull public final LBiBoolFunction < R > build ( ) { } } | final LBiBoolFunction < R > eventuallyFinal = this . eventually ; LBiBoolFunction < R > retval ; final Case < LLogicalBinaryOperator , LBiBoolFunction < R > > [ ] casesArray = cases . toArray ( new Case [ cases . size ( ) ] ) ; retval = LBiBoolFunction . < R > biBoolFunc ( ( a1 , a2 ) -> { try { for ( Case < LLogicalBi... |
public class Bits { /** * Reads 2 compressed longs into an array of 2 longs .
* Once variable - length encoding has been implemented , this method will probably get dropped as we can simply
* read the 2 longs individually .
* @ param in the input stream to read from
* @ param seqnos the array to read the seqnos... | byte len = in . readByte ( ) ; if ( len == 0 ) { seqnos [ index ] = seqnos [ index + 1 ] = 0 ; return ; } byte len1 = firstNibble ( len ) , len2 = secondNibble ( len ) ; seqnos [ index ] = makeLong ( in , len1 ) ; seqnos [ index + 1 ] = makeLong ( in , len2 ) + seqnos [ index ] ; |
public class MFVec2f { /** * Places a new value at the end of the existing value array , increasing the field length accordingly .
* @ param newValue - the 2 floats making the new SFVec2f appended to the MFVec2f array list */
public void append ( float [ ] newValue ) { } } | if ( ( newValue . length % 2 ) == 0 ) { for ( int i = 0 ; i < ( newValue . length / 2 ) ; i ++ ) { value . add ( new SFVec2f ( newValue [ i * 2 ] , newValue [ i * 2 + 1 ] ) ) ; } } else { Log . e ( TAG , "X3D MFVec3f append set with array length not divisible by 2" ) ; } |
public class JPATxEmInvocation { /** * ( non - Javadoc )
* @ see javax . transaction . Synchronization # afterCompletion ( int ) */
@ Override public void afterCompletion ( int status ) { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "afterCompletion : " + status + " : " + this ) ; // JPA 5.9.1 Container Responsibilities
// - After the JTA transaction has completed ( either by transaction commit or rollback ) ,
// The container closes the entity manager by ... |
public class DefaultSwidProcessor { /** * Identifies the tag creator ( tag : tag _ creator ) .
* Example data format : < i > “ regid . 2010-04 . com . labs64 , NLIC ” < / i > where :
* < ul >
* < li > regid = registered id < / li >
* < li > 2010-04 = the year and first month the domain was registered ( yyyy - m... | swidTag . setTagCreator ( new EntityComplexType ( new Token ( tagCreatorName , idGenerator . nextId ( ) ) , new RegistrationId ( tagCreatorRegId , idGenerator . nextId ( ) ) , idGenerator . nextId ( ) ) ) ; return this ; |
public class XPathPolicyIndex { /** * FIXME : public for some external testing . - > protected */
public static Map < String , String > getXpathVariables ( Map < String , Collection < AttributeBean > > attributeMap ) { } } | // Set all the bind variables in the query context
Map < String , String > variables = new HashMap < String , String > ( ) ; for ( String t : targets ) { int count = 0 ; for ( AttributeBean bean : attributeMap . get ( t . toLowerCase ( ) + "Attributes" ) ) { if ( bean . getId ( ) . equals ( XACML_RESOURCE_ID ) ) { vari... |
public class DBTablePropertySheet { /** * GEN - LAST : event _ tfPackageNameFocusLost */
private void tfPackageNameActionPerformed ( java . awt . event . ActionEvent evt ) // GEN - FIRST : event _ tfPackageNameActionPerformed
{ } } | // GEN - HEADEREND : event _ tfPackageNameActionPerformed
// Commit on ENTER
aTable . setPackageName ( tfPackageName . getText ( ) ) ; |
public class MethodInfo { /** * Check if this method has a parameter with the named annotation .
* @ param annotationName
* The name of a method parameter annotation .
* @ return true if this method has a parameter with the named annotation . */
public boolean hasParameterAnnotation ( final String annotationName ... | for ( final MethodParameterInfo methodParameterInfo : getParameterInfo ( ) ) { if ( methodParameterInfo . hasAnnotation ( annotationName ) ) { return true ; } } return false ; |
public class QuickSort { /** * Sorts the given list using the given comparator . */
public static < T > void sort ( List < T > list , Comparator < ? super T > comparator ) { } } | if ( list instanceof RandomAccess ) { quicksort ( list , comparator ) ; } else { List < T > copy = new ArrayList < > ( list ) ; quicksort ( copy , comparator ) ; list . clear ( ) ; list . addAll ( copy ) ; } |
public class CPDefinitionOptionRelUtil { /** * Returns the first cp definition option rel in the ordered set where uuid = & # 63 ; .
* @ param uuid the uuid
* @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > )
* @ return the first matching cp definition option rel... | return getPersistence ( ) . fetchByUuid_First ( uuid , orderByComparator ) ; |
public class CrossingHelper { /** * the array sorting */
private static void sort ( double [ ] coords1 , int length1 , double [ ] coords2 , int length2 , int [ ] array ) { } } | int temp ; int length = length1 + length2 ; double x1 , y1 , x2 , y2 ; for ( int i = 1 ; i < length ; i ++ ) { if ( array [ i - 1 ] < length1 ) { x1 = coords1 [ 2 * array [ i - 1 ] ] ; y1 = coords1 [ 2 * array [ i - 1 ] + 1 ] ; } else { x1 = coords2 [ 2 * ( array [ i - 1 ] - length1 ) ] ; y1 = coords2 [ 2 * ( array [ i... |
public class Environment { /** * Get the ( optional ) raw data database manager .
* @ return The pDatabaseOwner ( returns an object , so this package isn ' t dependent on PDatabaseOwner ) . */
public ThinPhysicalDatabaseParent getPDatabaseParent ( Map < String , Object > properties , boolean bCreateIfNew ) { } } | if ( m_PhysicalDatabaseParent == null ) if ( bCreateIfNew ) { Map < String , Object > map = new Hashtable < String , Object > ( ) ; if ( properties != null ) map . putAll ( properties ) ; if ( map . get ( PhysicalDatabaseParent . APP ) == null ) map . put ( PhysicalDatabaseParent . APP , this . getDefaultApplication ( ... |
public class GCLINEImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public void eUnset ( int featureID ) { } } | switch ( featureID ) { case AfplibPackage . GCLINE__RG : getRg ( ) . clear ( ) ; return ; } super . eUnset ( featureID ) ; |
public class SftpSubsystemChannel { /** * Make a directory . If the directory exists this method will throw an
* exception .
* @ param path
* @ throws SftpStatusException
* , SshException */
public void makeDirectory ( String path ) throws SftpStatusException , SshException { } } | makeDirectory ( path , new SftpFileAttributes ( this , SftpFileAttributes . SSH_FILEXFER_TYPE_DIRECTORY ) ) ; |
public class ConfirmationDialog { /** * TenantAwareEvent handler for button clicks .
* @ param event
* the click event . */
@ Override public void buttonClick ( final ClickEvent event ) { } } | if ( window . getParent ( ) != null ) { isImplicitClose = true ; UI . getCurrent ( ) . removeWindow ( window ) ; } callback . response ( event . getSource ( ) . equals ( okButton ) ) ; |
public class CrossValidatedMahoutKNNRecommenderEvaluator { /** * Main method . Parameter is not used .
* @ param args the arguments ( not used ) */
public static void main ( final String [ ] args ) { } } | String url = "http://files.grouplens.org/datasets/movielens/ml-100k.zip" ; String folder = "data/ml-100k" ; String modelPath = "data/ml-100k/model/" ; String recPath = "data/ml-100k/recommendations/" ; String dataFile = "data/ml-100k/ml-100k/u.data" ; int nFolds = N_FOLDS ; prepareSplits ( url , nFolds , dataFile , fol... |
public class CircularQueueCaptureQueriesListener { /** * Log all captured INSERT queries */
public void logInsertQueries ( ) { } } | List < String > queries = getInsertQueries ( ) . stream ( ) . map ( CircularQueueCaptureQueriesListener :: formatQueryAsSql ) . collect ( Collectors . toList ( ) ) ; ourLog . info ( "Insert Queries:\n{}" , String . join ( "\n" , queries ) ) ; |
public class ResourceValueFrameModelingVisitor { /** * - return ( areturn ) */
private void handleFieldStore ( FieldInstruction ins ) { } } | try { // If the resource instance is stored in a field , then it escapes
ResourceValueFrame frame = getFrame ( ) ; ResourceValue topValue = frame . getTopValue ( ) ; if ( topValue . equals ( ResourceValue . instance ( ) ) ) { frame . setStatus ( ResourceValueFrame . ESCAPED ) ; } } catch ( DataflowAnalysisException e )... |
public class LazyArray { /** * Returns the string value stored at the given index or null if there was no such value .
* @ param index the location of the value in this array
* @ return the value if it could be parsed as a boolean or null if there was no such value
* @ throws LazyException if the index is out of ... | LazyNode token = getOptionalValueToken ( index ) ; if ( token == null ) return null ; if ( token . type == LazyNode . VALUE_NULL ) return null ; return token . getStringValue ( ) ; |
public class UTF16 { /** * Number of codepoints in a UTF16 String
* @ param source UTF16 string
* @ return number of codepoint in string */
public static int countCodePoint ( String source ) { } } | if ( source == null || source . length ( ) == 0 ) { return 0 ; } return findCodePointOffset ( source , source . length ( ) ) ; |
public class KieModuleDeploymentHelperImpl { /** * Add class to the { @ link KieFileSystem } .
* @ param userClass The class to be added .
* @ param kfs The { @ link KieFileSystem } */
private static void addClass ( Class < ? > userClass , KieFileSystem kfs ) { } } | String classSimpleName = userClass . getSimpleName ( ) ; URL classFileUrl = userClass . getResource ( classSimpleName + ".class" ) ; if ( classFileUrl == null ) { throw new RuntimeException ( "Class " + userClass . getCanonicalName ( ) + " can not be found on the classpath." ) ; } byte [ ] classByteCode = null ; if ( "... |
public class AtomEntryIterator { /** * Get next entry . */
@ Override public BlogEntry next ( ) { } } | try { final ClientEntry entry = iterator . next ( ) ; if ( entry instanceof ClientMediaEntry ) { return new AtomResource ( collection , ( ClientMediaEntry ) entry ) ; } else { return new AtomEntry ( collection , entry ) ; } } catch ( final Exception e ) { LOG . error ( "An error occured while fetching entry" , e ) ; } ... |
public class TransactionTable { /** * TODO : consider returning null instead of throwing exception when the transaction is already completed */
public RemoteTransaction getOrCreateRemoteTransaction ( GlobalTransaction globalTx , WriteCommand [ ] modifications ) { } } | return getOrCreateRemoteTransaction ( globalTx , modifications , currentTopologyId ) ; |
public class EvalVisitor { /** * Implementations for collections . */
@ Override protected SoyValue visitListLiteralNode ( ListLiteralNode node ) { } } | List < SoyValue > values = this . visitChildren ( node ) ; return ListImpl . forProviderList ( values ) ; |
public class StringHelper { /** * Same as { @ link # replaceAll ( String , String , CharSequence ) } but allowing for a
* < code > null < / code > new - value , which is than interpreted as an empty string
* instead .
* @ param sInputString
* The input string where the text should be replace . If this parameter... | return replaceAll ( sInputString , sSearchText , getNotNull ( aReplacementText , "" ) ) ; |
public class DatastoreMutationPool { /** * Adds a mutation deleting the entity with the given key . */
public void put ( Entity entity ) { } } | int bytesHere = EntityTranslator . convertToPb ( entity ) . getSerializedSize ( ) ; // Do this before the add so that we guarantee that size is never > sizeLimit
if ( putsBytes + bytesHere >= params . getBytesLimit ( ) ) { flushPuts ( ) ; } putsBytes += bytesHere ; puts . add ( entity ) ; if ( puts . size ( ) >= params... |
public class AbstractPluginManager { /** * Returns a copy of plugins with that state . */
@ Override public List < PluginWrapper > getPlugins ( PluginState pluginState ) { } } | List < PluginWrapper > plugins = new ArrayList < > ( ) ; for ( PluginWrapper plugin : getPlugins ( ) ) { if ( pluginState . equals ( plugin . getPluginState ( ) ) ) { plugins . add ( plugin ) ; } } return plugins ; |
public class TemplCommandIn { private Method analyse_method_exe ( String cl_name , String exe_method ) throws DevFailed { } } | Method meth = null ; try { // Get the class object for the device class
StringBuffer str = new StringBuffer ( cl_name ) ; str . append ( "." ) ; str . append ( cl_name ) ; Class cl = Class . forName ( str . toString ( ) ) ; // Get the device object method list
Method [ ] meth_list = cl . getDeclaredMethods ( ) ; if ( m... |
public class BaseSerializer { /** * Serialize the specified object , such as a { @ link Transform } , { @ link Condition } , { @ link Filter } , etc < br >
* < b > NOTE : < / b > For lists use the list methods , such as { @ link # serializeTransformList ( List ) } < br >
* To deserialize , use the appropriate metho... | ObjectMapper om = getObjectMapper ( ) ; try { return om . writeValueAsString ( o ) ; } catch ( Exception e ) { throw new RuntimeException ( e ) ; } |
public class DBEntitySequenceFactory { /** * / * ( non - Javadoc )
* @ see com . dell . doradus . search . aggregate . EntitySequenceFactory # getSequence ( com . dell . doradus . common . TableDefinition , java . lang . Iterable , java . util . List , com . dell . doradus . search . aggregate . EntitySequenceOptions... | if ( fields == null || fields . contains ( ALLSCALARMARK ) ) fields = ALLSCALARFIELDS ; return new DBEntityRootCollection < T > ( tableDef , fields , collection , this , tableDef . getTableName ( ) , EntitySequenceOptions . getOptions ( options , DBEntitySequenceOptions . defaultOptions ) ) ; |
public class ControllersInner { /** * Gets an Azure Dev Spaces Controller .
* Gets the properties for an Azure Dev Spaces Controller .
* @ param resourceGroupName Resource group to which the resource belongs .
* @ param name Name of the resource .
* @ throws IllegalArgumentException thrown if parameters fail th... | return getByResourceGroupWithServiceResponseAsync ( resourceGroupName , name ) . map ( new Func1 < ServiceResponse < ControllerInner > , ControllerInner > ( ) { @ Override public ControllerInner call ( ServiceResponse < ControllerInner > response ) { return response . body ( ) ; } } ) ; |
public class FSDirectoryManager { /** * { @ inheritDoc } */
public Directory getDirectory ( final String name ) throws IOException { } } | return SecurityHelper . doPrivilegedIOExceptionAction ( new PrivilegedExceptionAction < Directory > ( ) { public Directory run ( ) throws Exception { File dir ; if ( name . equals ( "." ) ) { dir = baseDir ; } else { dir = new File ( baseDir , name ) ; } // FSDirectory itself doesnt create dirs now
if ( ! dir . exists ... |
public class DynamicManager { /** * Retrieve all dynamic commands
* @ return Dynamic commands */
public List < ICommandBehavior > getDynamicCommands ( ) { } } | final List < ICommandBehavior > result = new ArrayList < ICommandBehavior > ( ) ; for ( final CommandImpl cmdImpl : dynamicCommands . values ( ) ) { result . add ( cmdImpl . getBehavior ( ) ) ; } return result ; |
public class BELUtilities { /** * Create the provided directory , if it does not already exist .
* @ param directory Path to create
* @ throws RuntimeException Thrown if directory creation failed */
public static void createDirectory ( final String directory ) { } } | if ( directory == null ) return ; final File f = new File ( directory ) ; if ( ! f . isDirectory ( ) ) { if ( ! f . mkdir ( ) ) throw new RuntimeException ( "couldn't create " + directory ) ; } |
public class Serializers { /** * Serializes this class into a data output .
* @ param out data output
* @ param serializers serializers instance
* @ throws IOException if an io error occurs */
static void serialize ( DataOutput out , Serializers serializers ) throws IOException { } } | StringBuilder msg = new StringBuilder ( String . format ( "Serialize %d serializer classes:" , serializers . serializers . values ( ) . size ( ) ) ) ; int size = serializers . serializers . values ( ) . size ( ) ; out . writeInt ( size ) ; if ( size > 0 ) { for ( SerializerWrapper sw : serializers . serializers . value... |
public class TreeUtil { /** * Retrieves the context for the component with the given Id .
* Searches visible and not visible components .
* @ param root the root component to search from .
* @ param id the id to search for .
* @ return the context for the component with the given id , or null if not found . */
... | return getComponentWithContextForId ( root , id , false ) ; |
public class SpdLongImpl { /** * combine the value of this data and other data */
public void combine ( SpdLong other ) { } } | if ( other == null ) return ; if ( stat . isEnabled ( ) && other . isEnabled ( ) ) stat . combine ( ( CountStatisticImpl ) other . getStatistic ( ) ) ; |
public class DatasetSink { /** * Not thread - safe .
* @ param event
* @ param reuse
* @ return */
private GenericRecord deserialize ( Event event , GenericRecord reuse ) throws EventDeliveryException { } } | decoder = DecoderFactory . get ( ) . binaryDecoder ( event . getBody ( ) , decoder ) ; // no checked exception is thrown in the CacheLoader
DatumReader < GenericRecord > reader = readers . getUnchecked ( schema ( event ) ) ; try { return reader . read ( reuse , decoder ) ; } catch ( IOException ex ) { throw new EventDe... |
public class ASpatialDb { /** * Run a generic sql string ( also multiline ) .
* @ param sql the sql to run .
* @ throws Exception */
public void runSql ( String sql ) throws Exception { } } | String [ ] sqlSplit = sql . split ( "\n" ) ; StringBuilder sb = new StringBuilder ( ) ; for ( String string : sqlSplit ) { String trim = string . trim ( ) ; if ( trim . length ( ) == 0 ) { continue ; } if ( trim . startsWith ( "--" ) ) { continue ; } sb . append ( trim + " " ) ; } String [ ] sqls = sb . toString ( ) . ... |
public class BindDataSourceSubProcessor { /** * for each method with custom bean , check if :
* < ul >
* < li > bean is not included in schema < / li >
* < li > method must have declared with explicit JQL < / li >
* < / ul >
* @ param currentSchema */
private void analyzeCustomBeanForSelect ( SQLiteDatabaseSc... | for ( SQLiteDaoDefinition dao : schema . getCollection ( ) ) { for ( SQLiteModelMethod method : dao . getCollection ( ) ) { if ( method . hasCustomProjection ( ) ) { SQLiteEntity entity = method . getEntity ( ) ; AssertKripton . assertTrueOrInvalidMethodSignException ( schema . getEntity ( entity . getName ( ) ) == nul... |
public class FakeScheduler { /** * using a validateXxx rather than a hideXxx because of https : / / issues . apache . org / jira / browse / ISIS - 1593 */
public String validateRunBackgroundCommands ( final Integer waitFor ) { } } | List < CommandJdo > commands = backgroundCommandRepository . findBackgroundCommandsNotYetStarted ( ) ; return commands . isEmpty ( ) ? "No background commands to run" : null ; |
public class PreferenceActivity { /** * Obtains the elevation of the button bar , which is shown when using the activity as a wizard ,
* from the activity ' s theme . */
private void obtainButtonBarElevation ( ) { } } | int elevation ; try { elevation = ThemeUtil . getDimensionPixelSize ( this , R . attr . buttonBarElevation ) ; } catch ( NotFoundException e ) { elevation = getResources ( ) . getDimensionPixelSize ( R . dimen . button_bar_elevation ) ; } setButtonBarElevation ( pixelsToDp ( this , elevation ) ) ; |
public class Jinx { /** * OAuth workflow , step three : Exchange request token for an access token .
* < br >
* After getting the verification code from the user , call this method to exchange the request token for
* an access token . The returned access token can be saved and used until the user revokes access .... | JinxUtils . validateParams ( requestToken , verificationCode ) ; try { Verifier verifier = new Verifier ( verificationCode ) ; Token accessToken = this . oAuthService . getAccessToken ( requestToken , verifier ) ; if ( accessToken != null ) { this . oAuthAccessToken = new OAuthAccessToken ( ) ; this . oAuthAccessToken ... |
public class MapRow { /** * { @ inheritDoc } */
@ Override public String getString ( String name ) { } } | Object value = getObject ( name ) ; String result ; if ( value instanceof byte [ ] ) { result = new String ( ( byte [ ] ) value ) ; } else { result = ( String ) value ; } return ( result ) ; |
public class PolicyChecker { /** * Processes certificate policies in the certificate .
* @ param certIndex the index of the certificate
* @ param initPolicies the initial policies required by the user
* @ param explicitPolicy an integer which indicates if a non - null
* valid policy tree is required
* @ param... | boolean policiesCritical = false ; List < PolicyInformation > policyInfo ; PolicyNodeImpl rootNode = null ; Set < PolicyQualifierInfo > anyQuals = new HashSet < > ( ) ; if ( origRootNode == null ) rootNode = null ; else rootNode = origRootNode . copyTree ( ) ; // retrieve policyOIDs from currCert
CertificatePoliciesExt... |
public class FunctionConfigurationEnvironmentMarshaller { /** * Marshall the given parameter object . */
public void marshall ( FunctionConfigurationEnvironment functionConfigurationEnvironment , ProtocolMarshaller protocolMarshaller ) { } } | if ( functionConfigurationEnvironment == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( functionConfigurationEnvironment . getAccessSysfs ( ) , ACCESSSYSFS_BINDING ) ; protocolMarshaller . marshall ( functionConfigurationEnvironment . getEx... |
public class CleverTapAPI { /** * Push a profile update .
* @ param profile A { @ link Map } , with keys as strings , and values as { @ link String } ,
* { @ link Integer } , { @ link Long } , { @ link Boolean } , { @ link Float } , { @ link Double } ,
* { @ link java . util . Date } , or { @ link Character } */
... | "unused" , "WeakerAccess" } ) public void pushProfile ( final Map < String , Object > profile ) { if ( profile == null || profile . isEmpty ( ) ) return ; postAsyncSafely ( "profilePush" , new Runnable ( ) { @ Override public void run ( ) { _push ( profile ) ; } } ) ; |
public class BucketConfigurationXmlFactory { /** * Converts the specified notification configuration into an XML byte array .
* @ param notificationConfiguration
* The configuration to convert .
* @ return The XML byte array representation . */
public byte [ ] convertToXmlByteArray ( BucketNotificationConfigurati... | XmlWriter xml = new XmlWriter ( ) ; xml . start ( "NotificationConfiguration" , "xmlns" , Constants . XML_NAMESPACE ) ; Map < String , NotificationConfiguration > configurations = notificationConfiguration . getConfigurations ( ) ; for ( Map . Entry < String , NotificationConfiguration > entry : configurations . entryS... |
public class Node { /** * Guava Functions */
public static Function < Node , String > toDotFunction ( ) { } } | return new Function < Node , String > ( ) { @ Override public String apply ( Node input ) { return input . toDot ( ) ; } } ; |
public class PLRenderHelper { /** * Render a single border
* @ param aElement
* The element currently rendered . May not be < code > null < / code > .
* @ param aContentStream
* Content stream
* @ param fLeft
* Left position ( including left border width )
* @ param fTop
* Top position ( including top b... | final float fRight = fLeft + fWidth ; final float fBottom = fTop - fHeight ; if ( aBorder . hasAllBorders ( ) && aBorder . areAllBordersEqual ( ) ) { // draw full rect
final BorderStyleSpec aAll = aBorder . getLeft ( ) ; // The border position must be in the middle of the line
final float fLineWidth = aAll . getLineWid... |
public class GPARCImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public void setXCENT ( Integer newXCENT ) { } } | Integer oldXCENT = xcent ; xcent = newXCENT ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , AfplibPackage . GPARC__XCENT , oldXCENT , xcent ) ) ; |
public class MDMoleculeCustomizer { /** * Customize Molecule . */
@ Override public void customize ( IAtomContainer molecule , Object nodeToAdd ) throws Exception { } } | if ( ! ( nodeToAdd instanceof CMLMolecule ) ) throw new CDKException ( "NodeToAdd must be of type nu.xom.Element!" ) ; // The nodeToAdd
CMLMolecule molToCustomize = ( CMLMolecule ) nodeToAdd ; if ( ( molecule instanceof MDMolecule ) ) { MDMolecule mdmol = ( MDMolecule ) molecule ; molToCustomize . setConvention ( "md:m... |
public class NavigationPresenter { /** * { @ inheritDoc } */
@ Override public void initializeViewParts ( ) { } } | initializeTreeItems ( ) ; setSelectedCategory ( model . getDisplayedCategory ( ) ) ; searchHandler . init ( model , navigationView . searchFld . textProperty ( ) , navigationView . rootItem . predicateProperty ( ) ) ; setupCellValueFactory ( ) ; |
public class DL4JResources { /** * Get the URL relative to the base URL as a String . < br >
* For example , if baseURL is " http : / / blob . deeplearning4j . org / " , and relativeToBase is " / datasets / iris . dat "
* this simply returns " http : / / blob . deeplearning4j . org / datasets / iris . dat "
* @ p... | if ( relativeToBase . startsWith ( "/" ) ) { relativeToBase = relativeToBase . substring ( 1 ) ; } return baseURL + relativeToBase ; |
public class BatchDeletePhoneNumberRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( BatchDeletePhoneNumberRequest batchDeletePhoneNumberRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( batchDeletePhoneNumberRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( batchDeletePhoneNumberRequest . getPhoneNumberIds ( ) , PHONENUMBERIDS_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to mars... |
public class Maps2 { /** * Creates a { @ code LinkedHashMap } instance , with a high enough " initial capacity " that it < i > should < / i > hold
* { @ code expectedSize } elements without growth . This behavior cannot be broadly guaranteed , but it is observed to
* be true for OpenJDK 1.6 . It also can ' t be gua... | return new LinkedHashMap < K , V > ( capacity ( expectedSize ) ) { private static final long serialVersionUID = 1L ; @ Override public void clear ( ) { if ( isEmpty ( ) ) return ; super . clear ( ) ; } } ; |
public class ColorSpaces { /** * Tests whether an ICC color profile is equal to the default sRGB profile .
* @ param profile the ICC profile to test . May not be { @ code null } .
* @ return { @ code true } if { @ code profile } is equal to the default sRGB profile .
* @ throws IllegalArgumentException if { @ cod... | Validate . notNull ( profile , "profile" ) ; return profile . getColorSpaceType ( ) == ColorSpace . TYPE_RGB && Arrays . equals ( getProfileHeaderWithProfileId ( profile ) , sRGB . header ) ; |
public class CreateTagOptionRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( CreateTagOptionRequest createTagOptionRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( createTagOptionRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( createTagOptionRequest . getKey ( ) , KEY_BINDING ) ; protocolMarshaller . marshall ( createTagOptionRequest . getValue ( ) , VALUE_BINDING ) ; } catch ( Exceptio... |
public class InternalSARLParser { /** * InternalSARL . g : 2244:1 : ruleCapacityMember returns [ EObject current = null ] : ( ( ) ( ( lv _ annotations _ 1_0 = ruleXAnnotation ) ) * ( ) ( ( lv _ modifiers _ 3_0 = ruleCommonModifier ) ) * ( ( lv _ modifiers _ 4_0 = ruleMethodModifier ) ) ( ( lv _ modifiers _ 5_0 = ruleCo... | EObject current = null ; Token otherlv_6 = null ; Token otherlv_8 = null ; Token otherlv_10 = null ; Token otherlv_12 = null ; Token otherlv_14 = null ; Token otherlv_16 = null ; Token otherlv_17 = null ; Token otherlv_21 = null ; Token otherlv_23 = null ; Token otherlv_25 = null ; Token otherlv_27 = null ; Token other... |
public class UpdateTarget { /** * A list of operations supported by the maintenance track .
* @ param supportedOperations
* A list of operations supported by the maintenance track . */
public void setSupportedOperations ( java . util . Collection < SupportedOperation > supportedOperations ) { } } | if ( supportedOperations == null ) { this . supportedOperations = null ; return ; } this . supportedOperations = new com . amazonaws . internal . SdkInternalList < SupportedOperation > ( supportedOperations ) ; |
public class GenerateJsonSchemaMojo { /** * Generate JSON schema for given POJO
* @ param clazz POJO class */
private void generateSchema ( Class clazz ) { } } | try { File targetFile = new File ( getGeneratedResourcesDirectory ( ) , clazz . getName ( ) + ".json" ) ; getLog ( ) . info ( "Generate JSON schema: " + targetFile . getName ( ) ) ; SchemaFactoryWrapper schemaFactory = new SchemaFactoryWrapper ( ) ; OBJECT_MAPPER . acceptJsonFormatVisitor ( OBJECT_MAPPER . constructTyp... |
public class StatementManager { /** * bind a Query based Select Statement */
public int bindStatement ( PreparedStatement stmt , Query query , ClassDescriptor cld , int param ) throws SQLException { } } | int result ; result = bindStatement ( stmt , query . getCriteria ( ) , cld , param ) ; result = bindStatement ( stmt , query . getHavingCriteria ( ) , cld , result ) ; return result ; |
public class Ui { /** * Get the attribute have enabled value
* Form android styles namespace
* @ param attrs AttributeSet
* @ param attribute The attribute to retrieve
* @ param defaultValue What to return if the attribute isn ' t found
* @ return Resulting value */
public static boolean isTrueFromAttribute (... | return attrs . getAttributeBooleanValue ( Ui . androidStyleNameSpace , attribute , defaultValue ) ; |
public class JmsBytesMessageImpl { /** * Read a signed 64 - bit integer from the stream message .
* @ return the next eight bytes from the stream message , interpreted as
* a < code > long < / code > .
* @ exception MessageNotReadableException if message in write - only mode .
* @ exception MessageEOFException ... | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "readLong" ) ; try { // Check that we are in read mode
checkBodyReadable ( "readLong" ) ; if ( requiresInit ) lazyInitForReading ( ) ; // Mark the current position , so we can return to it if there ' s an error
readSt... |
public class BaseRegistrationScreen { /** * SetupUserProperties Method . */
public RunRemoteProcessMessageData setupUserProperties ( Map < String , Object > properties ) { } } | try { Record recUser = this . getMainRecord ( ) ; String processClassName = ( String ) properties . get ( RunRemoteProcessMessageData . PROCESS_CLASS_NAME ) ; // Step 1 - Get the web site prefix
String sitePrefix = ( String ) properties . get ( MenusMessageData . SITE_PREFIX ) ; String fullSitePrefix = sitePrefix ; Str... |
public class ScrollableLayout { /** * Helper method to animate scroll state of ScrollableLayout .
* Please note , that returned { @ link ValueAnimator } is not fully configured -
* it needs at least ` duration ` property .
* Also , there is no checks if the current scrollY is equal to the requested one .
* @ pa... | // create an instance of this animator that is shared between calls
if ( mManualScrollAnimator == null ) { mManualScrollAnimator = ValueAnimator . ofFloat ( .0F , 1.F ) ; mManualScrollAnimator . setEvaluator ( new FloatEvaluator ( ) ) ; mManualScrollAnimator . addListener ( new SelfUpdateAnimationListener ( ) ) ; } els... |
public class FeatureIO { /** * Takes a two - dimensional double array with features and writes them in a binary file .
* @ param featuresFileName
* The binary file ' s name .
* @ param features
* The features .
* @ throws Exception */
public static void writeBinary ( String featuresFileName , double [ ] [ ] f... | DataOutputStream out = new DataOutputStream ( new BufferedOutputStream ( new FileOutputStream ( featuresFileName ) ) ) ; for ( int i = 0 ; i < features . length ; i ++ ) { for ( int j = 0 ; j < features [ i ] . length ; j ++ ) { out . writeDouble ( features [ i ] [ j ] ) ; } } out . close ( ) ; |
public class ApacheMultipartParser { /** * Retrieves the file name from the < code > Content - disposition < / code >
* header .
* @ param headers A < code > Map < / code > containing the HTTP request headers .
* @ return The file name for the current < code > encapsulation < / code > . */
private String getFileN... | String fileName = null ; String cd = getHeader ( headers , CONTENT_DISPOSITION ) ; if ( cd != null ) { String cdl = cd . toLowerCase ( ) ; if ( cdl . startsWith ( FORM_DATA ) || cdl . startsWith ( ATTACHMENT ) ) { ParameterParser parser = new ParameterParser ( ) ; parser . setLowerCaseNames ( true ) ; // Parameter pars... |
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link GridFunctionType } { @ code > }
* @ param value
* Java instance representing xml element ' s value .
* @ return
* the new instance of { @ link JAXBElement } { @ code < } { @ link GridFunctionType } { @ code > }... | return new JAXBElement < GridFunctionType > ( _GridFunction_QNAME , GridFunctionType . class , null , value ) ; |
public class MethodCall { /** * Gets an attribute attached to a call . Attributes are arbitrary contextual
* objects attached to a call .
* @ param key
* attribute key / name
* @ return attached attribute or null if there is none */
public Object getAttribute ( String key ) { } } | Object result ; if ( attributes == null ) { result = null ; } else { result = attributes . get ( key ) ; } return result ; |
public class ProxyBuilder { /** * hence this cast is safe . */
@ SuppressWarnings ( "unchecked" ) private static < T > Constructor < T > [ ] getConstructorsToOverwrite ( Class < T > clazz ) { } } | return ( Constructor < T > [ ] ) clazz . getDeclaredConstructors ( ) ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.