signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class SparkDl4jMultiLayer { /** * Evaluate on a directory containing a set of DataSet objects to be loaded with a { @ link DataSetLoader } . * Uses default batch size of { @ link # DEFAULT _ EVAL _ SCORE _ BATCH _ SIZE } * @ param path Path / URI to the directory containing the datasets to load * @ return ...
JavaRDD < String > paths ; try { paths = SparkUtils . listPaths ( sc , path ) ; } catch ( IOException e ) { throw new RuntimeException ( "Error listing paths in directory" , e ) ; } JavaRDD < DataSet > rdd = paths . map ( new LoadDataSetFunction ( loader , new RemoteFileSourceFactory ( BroadcastHadoopConfigHolder . get...
public class CSSIdentifierSerializer { /** * Serialize a CSS identifier . * NOTE : This code was adapted from Mathias Bynens ' CSS . escape polyfill , available under the MIT license . * See https : / / drafts . csswg . org / cssom / # serialize - an - identifier and https : / / github . com / mathiasbynens / CSS ....
if ( StringUtils . isEmpty ( identifier ) ) { return identifier ; } int length = identifier . length ( ) ; int index = - 1 ; StringBuilder result = new StringBuilder ( ) ; int firstCodeUnit = identifier . charAt ( 0 ) ; while ( ++ index < length ) { int codeUnit = identifier . charAt ( index ) ; // Note : there ' s no ...
public class JPATxEmInvocation { /** * ( non - Javadoc ) * @ see javax . persistence . EntityManager # find ( java . lang . Class , java . lang . Object ) */ @ Override public < T > T find ( Class < T > entityClass , Object primaryKey ) { } }
try { return ivEm . find ( entityClass , primaryKey ) ; } finally { if ( ! inJTATransaction ( ) ) { ivEm . clear ( ) ; } }
public class TreeLoader { /** * Initialize */ @ PostConstruct @ Override public void init ( ) { } }
if ( _dir == null ) throw new ConfigException ( L . l ( "<tree-loader> requires a 'path' attribute" ) ) ; _dir . getLastModified ( ) ; super . init ( ) ;
public class DisjointMultiAdditionNeighbourhood { /** * Generates the list of all possible moves that perform \ ( k \ ) additions , where \ ( k \ ) is the fixed number * specified at construction . Note : taking into account the current number of unselected items , the imposed * maximum subset size ( if set ) and t...
// create empty list to store generated moves List < SubsetMove > moves = new ArrayList < > ( ) ; // get set of candidate IDs for addition ( fixed IDs are discarded ) Set < Integer > addCandidates = getAddCandidates ( solution ) ; // compute number of additions int curNumAdd = numAdditions ( addCandidates , solution ) ...
public class Krb5Common { /** * This method set the system property if the property is null or property value is not the same with the new value * @ param propName * @ param propValue * @ return */ @ SuppressWarnings ( { } }
"unchecked" , "rawtypes" } ) public static String setPropertyAsNeeded ( final String propName , final String propValue ) { String previousPropValue = ( String ) java . security . AccessController . doPrivileged ( new java . security . PrivilegedAction ( ) { @ Override public String run ( ) { String oldPropValue = Syste...
public class LoOP { /** * Compute the probabilistic distances used by LoOP . * @ param relation Data relation * @ param knn kNN query * @ param pdists Storage for distances */ protected void computePDists ( Relation < O > relation , KNNQuery < O > knn , WritableDoubleDataStore pdists ) { } }
// computing PRDs FiniteProgress prdsProgress = LOG . isVerbose ( ) ? new FiniteProgress ( "pdists" , relation . size ( ) , LOG ) : null ; for ( DBIDIter iditer = relation . iterDBIDs ( ) ; iditer . valid ( ) ; iditer . advance ( ) ) { final KNNList neighbors = knn . getKNNForDBID ( iditer , kreach + 1 ) ; // query // ...
public class TableStreamer { /** * Set the positions of the buffers to the start of the content , leaving some room for the headers . */ private void prepareBuffers ( List < DBBPool . BBContainer > buffers ) { } }
Preconditions . checkArgument ( buffers . size ( ) == m_tableTasks . size ( ) ) ; UnmodifiableIterator < SnapshotTableTask > iterator = m_tableTasks . iterator ( ) ; for ( DBBPool . BBContainer container : buffers ) { int headerSize = iterator . next ( ) . m_target . getHeaderSize ( ) ; final ByteBuffer buf = container...
public class N { /** * Returns an immutable empty set if the specified Set is < code > null < / code > , otherwise itself is returned . * @ param set * @ return */ public static < T > Set < T > nullToEmpty ( final Set < T > set ) { } }
return set == null ? N . < T > emptySet ( ) : set ;
public class Settings { /** * Effective value as { @ code Double } . * @ return the value as { @ code Double } . If the property does not have value nor default value , then { @ code null } is returned . * @ throws NumberFormatException if value is not empty and is not a parsable number */ @ CheckForNull public Dou...
String value = getString ( key ) ; if ( StringUtils . isNotEmpty ( value ) ) { try { return Double . valueOf ( value ) ; } catch ( NumberFormatException e ) { throw new IllegalStateException ( String . format ( "The property '%s' is not a double value" , key ) ) ; } } return null ;
public class MiniProfiler { /** * Stop the profiler . * This should be called in a { @ code finally } block to avoid leaving data on * the thread . * @ return The profiling data . */ protected static Profile stop ( ) { } }
Root result = PROFILER_STEPS . get ( ) ; PROFILER_STEPS . remove ( ) ; return result != null ? result . popData ( ) : null ;
public class HFactory { /** * Create a counter column with a name and long value */ public static < N > HCounterColumn < N > createCounterColumn ( N name , long value , Serializer < N > nameSerializer ) { } }
return new HCounterColumnImpl < N > ( name , value , nameSerializer ) ;
public class CmsXmlGroupContainerFactory { /** * Returns the cached group container . < p > * @ param cms the cms context * @ param resource the group container resource * @ param keepEncoding if to keep the encoding while unmarshalling * @ return the cached group container , or < code > null < / code > if not ...
if ( resource instanceof I_CmsHistoryResource ) { return null ; } return getCache ( ) . getCacheGroupContainer ( getCache ( ) . getCacheKey ( resource . getStructureId ( ) , keepEncoding ) , cms . getRequestContext ( ) . getCurrentProject ( ) . isOnlineProject ( ) ) ;
public class PostVersionedIOReadableWritable { /** * This read attempts to first identify if the input view contains the special * { @ link # VERSIONED _ IDENTIFIER } by reading and buffering the first few bytes . * If identified to be versioned , the usual version resolution read path * in { @ link VersionedIORe...
byte [ ] tmp = new byte [ VERSIONED_IDENTIFIER . length ] ; inputStream . read ( tmp ) ; if ( Arrays . equals ( tmp , VERSIONED_IDENTIFIER ) ) { DataInputView inputView = new DataInputViewStreamWrapper ( inputStream ) ; super . read ( inputView ) ; read ( inputView , true ) ; } else { PushbackInputStream resetStream = ...
public class EncodingUtils { /** * Hex encode string . * @ param data the data * @ return the string */ public static String hexEncode ( final byte [ ] data ) { } }
try { val result = Hex . encodeHex ( data ) ; return new String ( result ) ; } catch ( final Exception e ) { return null ; }
public class FileSystemUtil { /** * Finds potential datasets by crawling a directory tree . * This method looks for any data files and directories appear to form a * dataset . This deliberately ignores information that may be stored in the * Hive metastore or . metadata folders . * Recognizes only Avro , Parque...
List < DatasetDescriptor > descriptors = Lists . newArrayList ( ) ; Result result = visit ( new FindDatasets ( ) , fs , path ) ; if ( result instanceof Result . Table ) { descriptors . add ( descriptor ( fs , ( Result . Table ) result ) ) ; } else if ( result instanceof Result . Group ) { for ( Result . Table table : (...
public class File { /** * Returns a Uniform Resource Locator for this file . The URL is system * dependent and may not be transferable between different operating / file * systems . * @ return a URL for this file . * @ throws java . net . MalformedURLException * if the path cannot be transformed into a URL . ...
String name = getAbsoluteName ( ) ; if ( ! name . startsWith ( "/" ) ) { // start with sep . return new URL ( "file" , "" , - 1 , "/" + name , null ) ; } else if ( name . startsWith ( "//" ) ) { return new URL ( "file:" + name ) ; // UNC path } return new URL ( "file" , "" , - 1 , name , null ) ;
public class DateTimePickerRenderer { /** * Get date in string format * @ param fc The FacesContext * @ param dtp the DateTimePicker component * @ param value The date to display * @ param javaFormatString The format string as defined by the SimpleDateFormat syntax * @ param locale The locale * @ return nul...
if ( value == null ) { return null ; } Converter converter = dtp . getConverter ( ) ; return converter == null ? getInternalDateAsString ( value , javaFormatString , locale ) : converter . getAsString ( fc , dtp , value ) ;
public class WeightedXMLExcerpt { /** * { @ inheritDoc } */ protected String createExcerpt ( TermPositionVector tpv , String text , int maxFragments , int maxFragmentSize ) throws IOException { } }
return WeightedHighlighter . highlight ( tpv , getQueryTerms ( ) , text , maxFragments , maxFragmentSize / 2 ) ;
public class TranslationServiceClient { /** * Creates a glossary and returns the long - running operation . Returns NOT _ FOUND , if the project * doesn ' t exist . * < p > Sample code : * < pre > < code > * try ( TranslationServiceClient translationServiceClient = TranslationServiceClient . create ( ) ) { * ...
LOCATION_PATH_TEMPLATE . validate ( parent , "createGlossary" ) ; CreateGlossaryRequest request = CreateGlossaryRequest . newBuilder ( ) . setParent ( parent ) . setGlossary ( glossary ) . build ( ) ; return createGlossaryAsync ( request ) ;
public class DisasterRecoveryConfigurationsInner { /** * Fails over from the current primary server to this server . This operation might result in data loss . * @ param resourceGroupName The name of the resource group that contains the resource . You can obtain this value from the Azure Resource Manager API or the p...
beginFailoverAllowDataLossWithServiceResponseAsync ( resourceGroupName , serverName , disasterRecoveryConfigurationName ) . toBlocking ( ) . single ( ) . body ( ) ;
public class ResourceChange { /** * For the < code > Modify < / code > action , indicates which resource attribute is triggering this update , such as a * change in the resource attribute ' s < code > Metadata < / code > , < code > Properties < / code > , or < code > Tags < / code > . * @ param scope * For the < ...
com . amazonaws . internal . SdkInternalList < String > scopeCopy = new com . amazonaws . internal . SdkInternalList < String > ( scope . length ) ; for ( ResourceAttribute value : scope ) { scopeCopy . add ( value . toString ( ) ) ; } if ( getScope ( ) == null ) { setScope ( scopeCopy ) ; } else { getScope ( ) . addAl...
public class RestClientUtil { /** * 创建索引文档 , 根据elasticsearch . xml中指定的日期时间格式 , 生成对应时间段的索引表名称 * For Elasticsearch 7 and 7 + * @ param indexName * @ param bean * @ return * @ throws ElasticSearchException */ public String addDocumentWithParentId ( String indexName , Object bean , Object parentId ) throws Elasti...
return addDocumentWithParentId ( indexName , _doc , bean , parentId ) ;
public class CPDefinitionLinkPersistenceImpl { /** * Returns a range of all the cp definition links where CProductId = & # 63 ; . * Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and < code > end < / code > are not primary keys , they are in...
return findByCProductId ( CProductId , start , end , null ) ;
public class TldFernClassifier { /** * Increments the P and N value for a fern . Also updates the maxP and maxN statistics so that it * knows when to re - normalize data structures . */ private void increment ( TldFernFeature f , boolean positive ) { } }
if ( positive ) { f . incrementP ( ) ; if ( f . numP > maxP ) maxP = f . numP ; } else { f . incrementN ( ) ; if ( f . numN > maxN ) maxN = f . numN ; }
public class BaseMessagingEngineImpl { /** * Return the cache of localization point config objects ( not a copy ) . * @ return Returns the _ lpConfig . */ final ArrayList getLPConfigObjects ( ) { } }
String thisMethodName = "getLPConfigObjects" ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { SibTr . entry ( tc , thisMethodName , this ) ; SibTr . exit ( tc , thisMethodName , _lpConfig ) ; } return _lpConfig ;
public class Functions { /** * Returns a function which performs a map lookup . The returned function throws an { @ link * IllegalArgumentException } if given a key that does not exist in the map . See also { @ link * # forMap ( Map , Object ) } , which returns a default value in this case . */ public static < K , ...
return key -> { if ( map . containsKey ( key ) ) { return map . get ( key ) ; } else { throw new IllegalArgumentException ( "Key '" + key + "' not present in map" ) ; } } ;
public class BucketNotificationConfiguration { /** * Gets the list of * { @ link BucketNotificationConfiguration . TopicConfiguration } objects * contained in this object . This method may return an empty list if no * < code > TopicConfiguration < / code > objects are present . * This method is deprecated and w...
List < TopicConfiguration > topicConfigs = new ArrayList < BucketNotificationConfiguration . TopicConfiguration > ( ) ; for ( Map . Entry < String , NotificationConfiguration > entry : configurations . entrySet ( ) ) { if ( entry . getValue ( ) instanceof TopicConfiguration ) { topicConfigs . add ( ( TopicConfiguration...
public class Utils { /** * Stores the resources from a directory into a map . * @ param directory an existing directory * @ param exclusionPatteners a non - null list of exclusion patterns for file names ( e . g . " . * \ \ . properties " ) * @ return a non - null map ( key = the file location , relative to the d...
if ( ! directory . exists ( ) ) throw new IllegalArgumentException ( "The resource directory was not found. " + directory . getAbsolutePath ( ) ) ; if ( ! directory . isDirectory ( ) ) throw new IllegalArgumentException ( "The resource directory is not a valid directory. " + directory . getAbsolutePath ( ) ) ; Map < St...
public class CRFLogConditionalObjectiveFunction { /** * Computes value of function for specified value of x ( scaled by xscale ) * only over samples indexed by batch * NOTE : This function does not do regularization ( regularization is done by minimizer ) * @ param x - unscaled weights * @ param xscale - how mu...
double prob = 0 ; // the log prob of the sequence given the model , which is the negation of value at this point double [ ] weights = x ; int [ ] [ ] wis = getWeightIndices ( ) ; int [ ] given = new int [ window - 1 ] ; int [ ] [ ] docCliqueLabels = new int [ window ] [ ] ; for ( int j = 0 ; j < window ; j ++ ) { docCl...
public class V1InstanceCreator { /** * Create a new effort record with a value and date , assigned to the given * workitem and member . * @ param value the value of the effort record . * @ param item the workitem to assign the effort record to . * @ param member the member to assign the effort record to . If is...
return effort ( value , item , member , date , null ) ;
public class CPDefinitionLinkUtil { /** * Returns the last cp definition link in the ordered set where CProductId = & # 63 ; and type = & # 63 ; . * @ param CProductId the c product ID * @ param type the type * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) ...
return getPersistence ( ) . fetchByCP_T_Last ( CProductId , type , orderByComparator ) ;
public class CacheMap { /** * Add an entry to the map consisting of the specified ( key , value ) pair . A key is allowed * to simultaneously map to multiple values . If the maximum number of entries for the * CacheMap is exceeded , an entry is discarded . * @ param key the key . * @ param value the value . *...
int bucketIndex = ( key . hashCode ( ) & Integer . MAX_VALUE ) % numBuckets ; int bucketSize = bucketSizes [ bucketIndex ] ++ ; // Discard an entry from the bucket if it ' s already at the maximum bucket size . Object discardedObject = bucketSize == maxBucketSize ? discardFromBucket ( bucketIndex , -- bucketSize ) : nu...
public class MIMEUtil { /** * Returns all MIME types for the given file extension . * @ param pFileExt the file extension * @ return a { @ link List } of { @ code String } s containing the MIME types , or an empty * list , if there are no known MIME types for the given file extension . */ public static List < Str...
List < String > types = sExtToMIME . get ( StringUtil . toLowerCase ( pFileExt ) ) ; return maskNull ( types ) ;
public class CacheManager { /** * Get the default cache manager for the default class loader . The default class loader * is the class loader used to load the cache2k implementation classes . * < p > The name of default cache manager is { @ code " default " } . * This may be changed , by { @ link # setDefaultName...
ClassLoader _defaultClassLoader = PROVIDER . getDefaultClassLoader ( ) ; return PROVIDER . getManager ( _defaultClassLoader , PROVIDER . getDefaultManagerName ( _defaultClassLoader ) ) ;
public class FileComparer { /** * Removes all the similar parts from all the files * @ param filepathes * @ throws IOException */ public static void removeSimilaritiesAndSaveFiles ( List < String > filepathes , Log logging , Boolean isWindows ) throws IOException { } }
List < File > files = new LinkedList < File > ( ) ; for ( String path : filepathes ) { files . add ( new File ( path ) ) ; } FileComparer fcomparer ; for ( int i = 0 ; i < files . size ( ) ; i ++ ) { for ( int y = i + 1 ; y < files . size ( ) ; y ++ ) { fcomparer = new FileComparer ( files . get ( i ) , files . get ( y...
public class FileEditPanel { /** * < / editor - fold > / / GEN - END : initComponents */ private void labelBrowseCurrentLinkMouseClicked ( java . awt . event . MouseEvent evt ) { } }
// GEN - FIRST : event _ labelBrowseCurrentLinkMouseClicked if ( evt . getClickCount ( ) > 1 ) { final File file = new File ( this . textFieldFilePath . getText ( ) . trim ( ) ) ; NbUtils . openInSystemViewer ( null , file ) ; }
public class CmsImportView { /** * Processes the result of the import operation from the server . < p > * @ param results the string containing the results of the import sent by the server */ protected void handleImportResults ( List < CmsAliasImportResult > results ) { } }
clearResults ( ) ; for ( CmsAliasImportResult singleResult : results ) { addImportResult ( singleResult ) ; }
public class JaxbUtils { /** * Marshals the given data . A < code > null < / code > data argument returns < code > null < / code > . * @ param data * Data to serialize or < code > null < / code > . * @ param adapters * Adapters to associate with the marshaller or < code > null < / code > . * @ param classesTo...
if ( data == null ) { return null ; } try { final JAXBContext ctx = JAXBContext . newInstance ( classesToBeBound ) ; return marshal ( ctx , data , adapters ) ; } catch ( final JAXBException ex ) { throw new RuntimeException ( ERROR_MARSHALLING_TEST_DATA , ex ) ; }
public class TriggerBuilder { /** * Use a TriggerKey with the given name and group to identify the Trigger . * If none of the ' withIdentity ' methods are set on the TriggerBuilder , then a * random , unique TriggerKey will be generated . * @ param name * the name element for the Trigger ' s TriggerKey * @ pa...
m_aKey = new TriggerKey ( name , group ) ; return this ;
public class FileUtils { /** * Attempts to the get the canonical form of the given file , otherwise returns the absolute form of the file . * @ param file the { @ link File } from which the canonical or absolute file will be returned . * @ return the canonical form of the file unless an IOException occurs then retu...
try { return file . getCanonicalFile ( ) ; } catch ( IOException ignore ) { return file . getAbsoluteFile ( ) ; }
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EClass getIfcElectricalCircuit ( ) { } }
if ( ifcElectricalCircuitEClass == null ) { ifcElectricalCircuitEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 194 ) ; } return ifcElectricalCircuitEClass ;
public class protocoludp_stats { /** * < pre > * converts nitro response into object and returns the object array in case of get request . * < / pre > */ protected base_resource [ ] get_nitro_response ( nitro_service service , String response ) throws Exception { } }
protocoludp_stats [ ] resources = new protocoludp_stats [ 1 ] ; protocoludp_response result = ( protocoludp_response ) service . get_payload_formatter ( ) . string_to_resource ( protocoludp_response . class , response ) ; if ( result . errorcode != 0 ) { if ( result . errorcode == 444 ) { service . clear_session ( ) ; ...
public class FastSerializer { /** * Write a varbinary in the standard VoltDB way . That is , four * bytes of length info followed by the bytes . * @ param bin The byte array value to be serialized . * @ throws IOException Rethrows any IOExceptions thrown . */ public void writeVarbinary ( byte [ ] bin ) throws IOE...
if ( bin == null ) { writeInt ( VoltType . NULL_STRING_LENGTH ) ; return ; } if ( bin . length > VoltType . MAX_VALUE_LENGTH ) { throw new IOException ( "Varbinary exceeds maximum length of " + VoltType . MAX_VALUE_LENGTH + " bytes." ) ; } writeInt ( bin . length ) ; write ( bin ) ;
public class AwsSecurityFindingFilters { /** * Exclusive to findings that are generated as the result of a check run against a specific rule in a supported * standard ( for example , AWS CIS Foundations ) . Contains compliance - related finding details . * < b > NOTE : < / b > This method appends the values to the ...
if ( this . complianceStatus == null ) { setComplianceStatus ( new java . util . ArrayList < StringFilter > ( complianceStatus . length ) ) ; } for ( StringFilter ele : complianceStatus ) { this . complianceStatus . add ( ele ) ; } return this ;
public class InternalXbaseParser { /** * InternalXbase . g : 58:1 : entryRuleXExpression : ruleXExpression EOF ; */ public final void entryRuleXExpression ( ) throws RecognitionException { } }
try { // InternalXbase . g : 59:1 : ( ruleXExpression EOF ) // InternalXbase . g : 60:1 : ruleXExpression EOF { if ( state . backtracking == 0 ) { before ( grammarAccess . getXExpressionRule ( ) ) ; } pushFollow ( FOLLOW_1 ) ; ruleXExpression ( ) ; state . _fsp -- ; if ( state . failed ) return ; if ( state . backtrack...
public class DescribeNetworkAclsRequest { /** * This method is intended for internal use only . Returns the marshaled request configured with additional * parameters to enable operation dry - run . */ @ Override public Request < DescribeNetworkAclsRequest > getDryRunRequest ( ) { } }
Request < DescribeNetworkAclsRequest > request = new DescribeNetworkAclsRequestMarshaller ( ) . marshall ( this ) ; request . addParameter ( "DryRun" , Boolean . toString ( true ) ) ; return request ;
public class MetadataFinder { /** * Given a status update from a CDJ , find the metadata for the track that it has loaded , if any . If there is * an appropriate metadata cache , will use that , otherwise makes a query to the players dbserver . * @ param status the CDJ status update that will be used to determine t...
if ( status . getTrackSourceSlot ( ) == CdjStatus . TrackSourceSlot . NO_TRACK || status . getRekordboxId ( ) == 0 ) { return null ; } final DataReference track = new DataReference ( status . getTrackSourcePlayer ( ) , status . getTrackSourceSlot ( ) , status . getRekordboxId ( ) ) ; return requestMetadataFrom ( track ...
public class dns_stats { /** * < pre > * converts nitro response into object and returns the object array in case of get request . * < / pre > */ protected base_resource [ ] get_nitro_response ( nitro_service service , String response ) throws Exception { } }
dns_stats [ ] resources = new dns_stats [ 1 ] ; dns_response result = ( dns_response ) service . get_payload_formatter ( ) . string_to_resource ( dns_response . class , response ) ; if ( result . errorcode != 0 ) { if ( result . errorcode == 444 ) { service . clear_session ( ) ; } if ( result . severity != null ) { if ...
public class DeviceProxyDAODefaultImpl { public DeviceAttribute [ ] write_read_attribute ( final DeviceProxy deviceProxy , final DeviceAttribute [ ] deviceAttributes , final String [ ] readNames ) throws DevFailed { } }
checkIfTango ( deviceProxy , "write_read_attribute" ) ; build_connection ( deviceProxy ) ; // Manage Access control if ( deviceProxy . access == TangoConst . ACCESS_READ ) { // ping the device to throw exception if failed ( for reconnection ) ping ( deviceProxy ) ; throwNotAuthorizedException ( deviceProxy . devname + ...
public class MapperConstructor { /** * if it is a null setting returns the null mapping * @ param makeDest true if destination is a new instance * @ param mtd mapping type of destination * @ param mts mapping type of source * @ param result StringBuilder used for mapping * @ return true if operation is a null...
if ( makeDest && ( mtd == ALL_FIELDS || mtd == ONLY_VALUED_FIELDS ) && mts == ONLY_NULL_FIELDS ) { result . append ( " " + stringOfSetDestination + "(null);" + newLine ) ; return true ; } return false ;
public class AWSCodeCommitClient { /** * Gets information about triggers configured for a repository . * @ param getRepositoryTriggersRequest * Represents the input of a get repository triggers operation . * @ return Result of the GetRepositoryTriggers operation returned by the service . * @ throws RepositoryNa...
request = beforeClientExecution ( request ) ; return executeGetRepositoryTriggers ( request ) ;
public class Expression { /** * A simple helper that calls through to { @ link MethodRef # invokeVoid ( Expression . . . ) } , but allows a * more natural fluent call style . */ public Statement invokeVoid ( MethodRef method , Expression ... args ) { } }
return method . invokeVoid ( ImmutableList . < Expression > builder ( ) . add ( this ) . add ( args ) . build ( ) ) ;
public class FunctionApplication { /** * Parse command line entries . * @ param args command line options * @ return command line built with options */ static CommandLine parseCommandLine ( String [ ] args ) { } }
return CommandLine . build ( ) . addOption ( DATA_OPTION , "For passing the data" ) . addOption ( DEBUG_OPTIONS , "For outputting debug information" ) . parse ( args ) ;
public class AbstractDraweeController { /** * Adds controller listener . */ public void addControllerListener ( ControllerListener < ? super INFO > controllerListener ) { } }
Preconditions . checkNotNull ( controllerListener ) ; if ( mControllerListener instanceof InternalForwardingListener ) { ( ( InternalForwardingListener < INFO > ) mControllerListener ) . addListener ( controllerListener ) ; return ; } if ( mControllerListener != null ) { mControllerListener = InternalForwardingListener...
public class MoonPosition { /** * max error given by J . Meeus : 10 ' ' in longitude and 4 ' ' in latitude */ static double [ ] calculateMeeus ( double jct ) { } }
// jct = julian centuries since J2000 in ephemeris time // Meeus ( 47.1 ) : L ' double meanLongitude = normalize ( 218.3164477 + ( 481267.88123421 + ( - 0.0015786 + ( 1.0 / 538841 + ( - 1.0 / 65194000 ) * jct ) * jct ) * jct ) * jct ) ; // Meeus ( 47.2 ) : D double meanElongation = normalize ( 297.8501921 + ( 445267.11...
public class UseVarArgs { /** * overrides the visitor to look for methods that has an array as a last * parameter of an array type , where the base type is not like the previous * parameter nor something like a char or byte array . * @ param obj the currently parse method */ @ Override public void visitMethod ( M...
try { if ( obj . isSynthetic ( ) ) { return ; } if ( Values . CONSTRUCTOR . equals ( getMethodName ( ) ) && javaClass . getClassName ( ) . contains ( "$" ) ) { return ; } List < String > types = SignatureUtils . getParameterSignatures ( obj . getSignature ( ) ) ; if ( ( types . isEmpty ( ) ) || ( types . size ( ) > 2 )...
public class SubtitleChatOverlay { /** * documentation inherited from superinterface ChatDisplay */ public boolean displayMessage ( ChatMessage message , boolean alreadyDisplayed ) { } }
// nothing doing if we ' ve not been laid out if ( ! isLaidOut ( ) ) { return false ; } // possibly display it now Graphics2D gfx = getTargetGraphics ( ) ; if ( gfx != null ) { displayMessage ( message , gfx ) ; // display it gfx . dispose ( ) ; // clean up return true ; } return false ;
public class MainApplication { /** * Get the user registration record . * And create it if it doesn ' t exist yet . * @ return The user registration record . */ public Record getUserRegistration ( ) { } }
Record recUserRegistration = ( Record ) m_systemRecordOwner . getRecord ( UserRegistrationModel . USER_REGISTRATION_FILE ) ; if ( recUserRegistration == null ) recUserRegistration = Record . makeRecordFromClassName ( UserRegistrationModel . THICK_CLASS , m_systemRecordOwner ) ; return recUserRegistration ;
public class JmxClient { /** * Return an array of the attributes associated with the bean name . */ public MBeanAttributeInfo [ ] getAttributesInfo ( String domainName , String beanName ) throws JMException { } }
return getAttributesInfo ( ObjectNameUtil . makeObjectName ( domainName , beanName ) ) ;
public class PreviousPageInfo { /** * Reinitialize the stored ActionMapping and PageFlowController objects . These are transient , and will be lost if * you place this object in the session , and then retrieve it after a session failover has occurred ( i . e . , after * this object has been serialized and deseriali...
if ( _mapping == null && _mappingPath != null ) { ModuleConfig mc = pfc . getModuleConfig ( ) ; assert mc != null : "no ModuleConfig found for " + pfc . getClass ( ) . getName ( ) ; _mapping = ( ActionMapping ) mc . findActionConfig ( _mappingPath ) ; } if ( _forward != null && _forward instanceof Forward ) { ( ( Forwa...
public class CalendarCodeGenerator { /** * Implements the formatSkeleton method . */ private MethodSpec buildSkeletonFormatter ( List < Skeleton > skeletons ) { } }
MethodSpec . Builder method = MethodSpec . methodBuilder ( "formatSkeleton" ) . addAnnotation ( Override . class ) . addModifiers ( PUBLIC ) . addParameter ( String . class , "skeleton" ) . addParameter ( ZonedDateTime . class , "d" ) . addParameter ( StringBuilder . class , "b" ) . returns ( boolean . class ) ; method...
public class A_CmsUploadDialog { /** * Sets the target folder . < p > * @ param target the target folder to set */ public void setTargetFolder ( String target ) { } }
m_targetFolder = target ; setCaption ( Messages . get ( ) . key ( Messages . GUI_UPLOAD_DIALOG_TITLE_1 , m_targetFolder ) ) ;
public class SnapshotDaemon { /** * Search for truncation snapshots , after a failure there may be * ones we don ' t know about , there may be ones from a previous instance etc . * Do this every five minutes as an easy hack to make sure we don ' t leak them . * Next time groom is called it will delete the old one...
if ( m_truncationSnapshotPath == null ) { try { m_truncationSnapshotPath = new String ( m_zk . getData ( VoltZK . test_scan_path , false , null ) , "UTF-8" ) ; } catch ( Exception e ) { return ; } } Object params [ ] = new Object [ 1 ] ; params [ 0 ] = m_truncationSnapshotPath ; long handle = m_nextCallbackHandle ++ ; ...
public class CmsSecurityManager { /** * Counts the locked resources in this project . < p > * @ param context the current request context * @ param id the id of the project * @ return the amount of locked resources in this project * @ throws CmsException if something goes wrong * @ throws CmsRoleViolationExce...
CmsDbContext dbc = m_dbContextFactory . getDbContext ( context ) ; CmsProject project = null ; int result = 0 ; try { project = m_driverManager . readProject ( dbc , id ) ; checkManagerOfProjectRole ( dbc , project ) ; result = m_driverManager . countLockedResources ( project ) ; } catch ( Exception e ) { dbc . report ...
public class OracleDialect { /** * insert into table ( id , name ) values ( seq . nextval , ? ) */ public void forModelSave ( Table table , Map < String , Object > attrs , StringBuilder sql , List < Object > paras ) { } }
sql . append ( "insert into " ) . append ( table . getName ( ) ) . append ( '(' ) ; StringBuilder temp = new StringBuilder ( ") values(" ) ; String [ ] pKeys = table . getPrimaryKey ( ) ; int count = 0 ; for ( Entry < String , Object > e : attrs . entrySet ( ) ) { String colName = e . getKey ( ) ; if ( table . hasColum...
public class AttackDetail { /** * The array of < a > AttackProperty < / a > objects . * @ param attackProperties * The array of < a > AttackProperty < / a > objects . */ public void setAttackProperties ( java . util . Collection < AttackProperty > attackProperties ) { } }
if ( attackProperties == null ) { this . attackProperties = null ; return ; } this . attackProperties = new java . util . ArrayList < AttackProperty > ( attackProperties ) ;
public class Partitioner { /** * Get partitions with low and high water marks * @ param previousWatermark previous water mark from metadata * @ return map of partition intervals . * map ' s key is interval begin time ( in format { @ link Partitioner # WATERMARKTIMEFORMAT } ) * map ' s value is interval end time...
HashMap < Long , Long > defaultPartition = Maps . newHashMap ( ) ; if ( ! isWatermarkExists ( ) ) { defaultPartition . put ( ConfigurationKeys . DEFAULT_WATERMARK_VALUE , ConfigurationKeys . DEFAULT_WATERMARK_VALUE ) ; LOG . info ( "Watermark column or type not found - Default partition with low watermark and high wate...
public class CollectionSupport { /** * Prints a collection to the given output stream . * @ param coll * @ param out stream to print to * @ param separator item separator */ public static void print ( Collection coll , PrintStream out , String separator ) { } }
out . print ( format ( coll , separator ) ) ;
public class Resources { /** * Retrieve a double from bundle . * @ param key the key of resource * @ return the resource double * @ throws MissingResourceException if the requested key is unknown */ public double getDouble ( String key ) throws MissingResourceException { } }
ResourceBundle bundle = getBundle ( ) ; String value = bundle . getString ( key ) ; try { return Double . parseDouble ( value ) ; } catch ( NumberFormatException nfe ) { throw new MissingResourceException ( "Expecting a double value but got " + value , "java.lang.String" , key ) ; }
public class MapUtils { /** * Splits rawMap ' s entries into a number of chunk maps of max chunkSize elements * @ param rawMap * @ param chunkSize * @ return */ public static List < Map < String , List < String > > > splitToChunksOfSize ( Map < String , List < String > > rawMap , int chunkSize ) { } }
List < Map < String , List < String > > > mapChunks = new LinkedList < Map < String , List < String > > > ( ) ; Set < Map . Entry < String , List < String > > > rawEntries = rawMap . entrySet ( ) ; Map < String , List < String > > currentChunk = new LinkedHashMap < String , List < String > > ( ) ; int rawEntryIndex = 0...
public class XmlUtils { /** * Executes the specified namespace aware XPath query as a multiple node query , * returning the text values of the resulting list of * nodes . */ public static List < String > selectNodeValues ( Node node , String xpathQuery , Map < String , String > namespaceUris ) { } }
List < Node > resultNodes = selectNodes ( node , xpathQuery , namespaceUris ) ; return extractNodeValues ( resultNodes ) ;
public class LocalClientFactory { /** * Creates a client from information in the config map . * @ param config the configuration * @ param defaultIndexName the default index to use if not specified in the config * @ return the ES client */ public JestClient createClient ( Map < String , String > config , String d...
JestClient client ; String indexName = config . get ( "client.index" ) ; // $ NON - NLS - 1 $ if ( indexName == null ) { indexName = defaultIndexName ; } client = createLocalClient ( config , indexName , defaultIndexName ) ; return client ;
public class GenStrutsApp { /** * Returns a non - empty List of FormBeanModels that match the given form * bean type . The < code > usesPageFlowScopedFormBean < / code > parameter can * be used to get the FormBeanModel for either a page flow scoped bean * ( < code > true < / code > ) , not flow scoped ( < code > ...
// Use the actual type of form to create the name . // This avoids conflicts if there are multiple forms using the // ANY _ FORM _ CLASS _ NAME type . String actualType = CompilerUtils . getLoadableName ( formType ) ; // See if the app already has a form - bean of this type . If so , // we ' ll just use it ; otherwise ...
public class AbstractBackend { /** * Notifies all registered listeners when the backend has been updated . * @ param e a { @ link BackendUpdatedEvent } representing an update . */ protected void fireBackendUpdated ( E e ) { } }
for ( int i = 0 , n = this . listenerList . size ( ) ; i < n ; i ++ ) { this . listenerList . get ( i ) . backendUpdated ( e ) ; }
public class SearchCriteria { /** * Appends the specified ordering criterion . * @ param order * the ordering criterion . * @ throws NullPointerException * if the argument is null . */ public SearchCriteria addOrder ( final Order order ) { } }
if ( order == null ) { throw new IllegalArgumentException ( "no order specified" ) ; } _orders . add ( order ) ; return this ;
public class AWSParameterStoreConfigClient { /** * Calculates property names to look for . * @ param prefix The prefix * @ param activeNames active environment names * @ return A set of calculated property names */ private Set < String > calcPropertySourceNames ( String prefix , Set < String > activeNames ) { } }
return ClientUtil . calcPropertySourceNames ( prefix , activeNames , "_" ) ;
public class SeaGlassLookAndFeel { /** * Initialize button settings . * @ param d the UI defaults map . */ private void defineButtons ( UIDefaults d ) { } }
d . put ( "Button.contentMargins" , new InsetsUIResource ( 6 , 14 , 6 , 14 ) ) ; d . put ( "Button.defaultButtonFollowsFocus" , Boolean . FALSE ) ; d . put ( "buttonBorderBaseEnabled" , new Color ( 0x709ad0 ) ) ; d . put ( "buttonBorderBasePressed" , new Color ( 0x4879bf ) ) ; d . put ( "buttonInteriorBaseEnabled" , ne...
public class MessageSelectorParser { /** * Static parse method taking care of test action description . * @ param element * @ param builder */ public static void doParse ( Element element , BeanDefinitionBuilder builder ) { } }
Element messageSelectorElement = DomUtils . getChildElementByTagName ( element , "selector" ) ; if ( messageSelectorElement != null ) { Element selectorStringElement = DomUtils . getChildElementByTagName ( messageSelectorElement , "value" ) ; if ( selectorStringElement != null ) { builder . addPropertyValue ( "messageS...
public class Functions { /** * Runs decode base 64 function with arguments . * @ return */ public static String decodeBase64 ( String content , Charset charset , TestContext context ) { } }
return new DecodeBase64Function ( ) . execute ( Arrays . asList ( content , charset . displayName ( ) ) , context ) ;
public class AbstractDatabaseEngine { /** * Executes the given query . * @ param query The query to execute . * @ throws DatabaseEngineException If something goes wrong executing the query . */ @ Override public synchronized List < Map < String , ResultColumn > > query ( final Expression query ) throws DatabaseEngi...
return query ( translate ( query ) ) ;
public class CommerceOrderNotePersistenceImpl { /** * Clears the cache for all commerce order notes . * The { @ link EntityCache } and { @ link FinderCache } are both cleared by this method . */ @ Override public void clearCache ( ) { } }
entityCache . clearCache ( CommerceOrderNoteImpl . class ) ; finderCache . clearCache ( FINDER_CLASS_NAME_ENTITY ) ; finderCache . clearCache ( FINDER_CLASS_NAME_LIST_WITH_PAGINATION ) ; finderCache . clearCache ( FINDER_CLASS_NAME_LIST_WITHOUT_PAGINATION ) ;
public class EbeanUpdater { /** * { @ inheritDoc } */ @ Override public Update < M > setNullParameter ( int position , int jdbcType ) { } }
return getUpdate ( ) . setNullParameter ( position , jdbcType ) ;
public class CmsSearchReplaceSettings { /** * Sets the xpath . < p > * @ param xpath the xpath to set */ public void setXpath ( String xpath ) { } }
if ( CmsStringUtil . isNotEmptyOrWhitespaceOnly ( xpath ) ) { xpath = xpath . trim ( ) ; if ( xpath . startsWith ( "/" ) ) { xpath = xpath . substring ( 1 ) ; } if ( xpath . endsWith ( "/" ) ) { xpath = xpath . substring ( 0 , xpath . length ( ) - 1 ) ; } } m_xpath = xpath ;
public class CmsGalleriesTab { /** * De - selects the galleries in the galleries list . < p > * @ param galleries the galleries to deselect */ public void uncheckGalleries ( List < String > galleries ) { } }
for ( String gallery : galleries ) { CmsListItem item = searchTreeItem ( m_scrollList , gallery ) ; if ( item != null ) { item . getCheckBox ( ) . setChecked ( false ) ; } }
public class JavacState { /** * Delete all prev artifacts in the currently tainted packages . */ public void deleteClassArtifactsInTaintedPackages ( ) { } }
for ( String pkg : taintedPackages ) { Map < String , File > arts = fetchPrevArtifacts ( pkg ) ; for ( File f : arts . values ( ) ) { if ( f . exists ( ) && f . getName ( ) . endsWith ( ".class" ) ) { f . delete ( ) ; } } }
public class BoltNeo4jResourceLocalTransactionCoordinator { /** * PhysicalTransactionDelegate ~ ~ ~ ~ ~ */ private void afterBeginCallback ( ) { } }
if ( this . timeOut > 0 ) { owner . setTransactionTimeOut ( this . timeOut ) ; } owner . afterTransactionBegin ( ) ; for ( TransactionObserver observer : observers ) { observer . afterBegin ( ) ; } log . trace ( "ResourceLocalTransactionCoordinatorImpl#afterBeginCallback" ) ;
public class BouncyCastleUtil { /** * Creates a < code > ProxyCertInfo < / code > object from given * extension . * @ param ext the extension . * @ return the < code > ProxyCertInfo < / code > object . * @ exception IOException if something fails . */ public static ProxyCertInfo getProxyCertInfo ( X509Extension...
return ProxyCertInfo . getInstance ( BouncyCastleUtil . getExtensionObject ( ext ) ) ;
public class AbstractCompositeHandler { /** * { @ inheritDoc } */ public UpdateResult whenSQLUpdate ( final String sql , final List < Parameter > parameters ) throws SQLException { } }
if ( this . updateHandler == null ) { throw new SQLException ( "No update handler: " + sql ) ; } // end of if return this . updateHandler . apply ( sql , parameters ) ;
public class Nfs3 { /** * ( non - Javadoc ) * @ see * com . emc . ecs . nfsclient . nfs . Nfs # wrapped _ sendLink ( com . emc . ecs . nfsclient . nfs . * NfsLinkRequest ) */ public Nfs3LinkResponse wrapped_sendLink ( NfsLinkRequest request ) throws IOException { } }
NfsResponseHandler < Nfs3LinkResponse > responseHandler = new NfsResponseHandler < Nfs3LinkResponse > ( ) { /* ( non - Javadoc ) * @ see com . emc . ecs . nfsclient . rpc . RpcResponseHandler # makeNewResponse ( ) */ protected Nfs3LinkResponse makeNewResponse ( ) { return new Nfs3LinkResponse ( ) ; } } ; _rpcWrapper ...
public class LightweightTypeReference { /** * / * @ Nullable */ protected List < LightweightTypeReference > getNonInterfaceTypes ( List < LightweightTypeReference > components ) { } }
List < LightweightTypeReference > nonInterfaceTypes = null ; for ( LightweightTypeReference component : components ) { if ( ! component . isInterfaceType ( ) ) { if ( nonInterfaceTypes == null ) { nonInterfaceTypes = Collections . singletonList ( component ) ; } else if ( nonInterfaceTypes . size ( ) == 1 ) { nonInterf...
public class CompletedCheckpointStatsSummary { /** * Updates the summary with the given completed checkpoint . * @ param completed Completed checkpoint to update the summary with . */ void updateSummary ( CompletedCheckpointStats completed ) { } }
stateSize . add ( completed . getStateSize ( ) ) ; duration . add ( completed . getEndToEndDuration ( ) ) ; alignmentBuffered . add ( completed . getAlignmentBuffered ( ) ) ;
public class MessageTemplate { /** * Returns the { @ link MessageBroker } for routing messages * @ return the message broker */ public MessageBroker getMessageBroker ( ) { } }
if ( this . messageBroker != null ) { return this . messageBroker ; } Assert . notNull ( FlexContext . getMessageBroker ( ) , "A MessageBroker was not set on the MessageTemplate " + "and no thread-local MessageBroker could be found in the FlexContext." ) ; return FlexContext . getMessageBroker ( ) ;
public class AccessClassLoader { /** * interface . " */ static boolean areInSameRuntimeClassLoader ( Class type1 , Class type2 ) { } }
if ( type1 . getPackage ( ) != type2 . getPackage ( ) ) { return false ; } ClassLoader loader1 = type1 . getClassLoader ( ) ; ClassLoader loader2 = type2 . getClassLoader ( ) ; ClassLoader systemClassLoader = ClassLoader . getSystemClassLoader ( ) ; if ( loader1 == null ) { return ( loader2 == null || loader2 == system...
public class SipComponentProcessor { /** * Gets all classes that are eligible for injection etc * @ param metaData * @ return */ private Set < String > getAllComponentClasses ( DeploymentUnit deploymentUnit , CompositeIndex index , SipMetaData sipMetaData , SipAnnotationMetaData sipAnnotationMetaData ) { } }
final Set < String > classes = new HashSet < String > ( ) ; if ( sipAnnotationMetaData != null ) { for ( Map . Entry < String , SipMetaData > metaData : sipAnnotationMetaData . entrySet ( ) ) { getAllComponentClasses ( metaData . getValue ( ) , classes ) ; } } // if ( metaData . getAnnotationsMetaData ( ) ! = null ) //...
public class LogSignAlgebra { /** * Converts a compacted number to its real value . */ @ Override public double toReal ( double x ) { } }
double unsignedReal = FastMath . exp ( natlog ( x ) ) ; return ( sign ( x ) == POSITIVE ) ? unsignedReal : - unsignedReal ;
public class DateUtilExtensions { /** * Decrement a Calendar by one day . * @ param self a Calendar * @ return a new Calendar set to the previous day * @ since 1.8.7 */ public static Calendar previous ( Calendar self ) { } }
Calendar result = ( Calendar ) self . clone ( ) ; result . add ( Calendar . DATE , - 1 ) ; return result ;
public class AccountsApi { /** * Delete an existing account custom field . * @ param accountId The external account number ( int ) or account ID Guid . ( required ) * @ param customFieldId ( required ) * @ return void */ public void deleteCustomField ( String accountId , String customFieldId ) throws ApiException...
deleteCustomField ( accountId , customFieldId , null ) ;
public class Packer { /** * Get native int ( fixed length ) * @ return * @ see # putInt ( int ) */ public int getInt ( ) { } }
int v = 0 ; v |= ( ( getByte ( ) & 0xFF ) << 24 ) ; v |= ( ( getByte ( ) & 0xFF ) << 16 ) ; v |= ( ( getByte ( ) & 0xFF ) << 8 ) ; v |= ( getByte ( ) & 0xFF ) ; return v ;
public class Common { /** * Initialize the { @ link CurrencyManager } */ public void initializeCurrency ( ) { } }
if ( ! currencyInitialized ) { sendConsoleMessage ( Level . INFO , getLanguageManager ( ) . getString ( "loading_currency_manager" ) ) ; currencyManager = new CurrencyManager ( ) ; currencyInitialized = true ; sendConsoleMessage ( Level . INFO , getLanguageManager ( ) . getString ( "currency_manager_loaded" ) ) ; }