signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class VirtualNetworkRulesInner { /** * Updates the specified virtual network rule . * @ param resourceGroupName The name of the Azure resource group . * @ param accountName The name of the Data Lake Store account . * @ param virtualNetworkRuleName The name of the virtual network rule to update . * @ para...
return updateWithServiceResponseAsync ( resourceGroupName , accountName , virtualNetworkRuleName , parameters ) . map ( new Func1 < ServiceResponse < VirtualNetworkRuleInner > , VirtualNetworkRuleInner > ( ) { @ Override public VirtualNetworkRuleInner call ( ServiceResponse < VirtualNetworkRuleInner > response ) { retu...
public class DefaultHttpHeaderMatcherBuilder { /** * { @ inheritDoc } */ @ Override public HttpFilterBuilder containsHeader ( final String name ) { } }
return addFilter ( new RequestFilter < HttpRequest > ( ) { @ Override public boolean matches ( HttpRequest request ) { return request . containsHeader ( name ) ; } @ Override public String toString ( ) { return String . format ( "containsHeader('%s')" , name ) ; } } ) ;
public class LsCommand { /** * Displays information for all directories and files directly under the path specified in args . * @ param path The { @ link AlluxioURI } path as the input of the command * @ param recursive Whether list the path recursively * @ param dirAsFile list the directory status as a plain fil...
URIStatus pathStatus = mFileSystem . getStatus ( path ) ; if ( dirAsFile ) { if ( pinnedOnly && ! pathStatus . isPinned ( ) ) { return ; } printLsString ( pathStatus , hSize ) ; return ; } ListStatusPOptions . Builder optionsBuilder = ListStatusPOptions . newBuilder ( ) ; if ( forceLoadMetadata ) { optionsBuilder . set...
public class HostKeyHelper { /** * Persists an SSH key to disk for the requested host . This effectively marks * the requested key as trusted for all future connections to the host , until * any future save attempt replaces this key . * @ param host the host the key is being saved for * @ param hostKey the key ...
XmlFile xmlHostKeyFile = new XmlFile ( getSshHostKeyFile ( host . getNode ( ) ) ) ; xmlHostKeyFile . write ( hostKey ) ; cache . put ( host , hostKey ) ;
public class ListApplicationsResult { /** * An array of application summaries . * @ param applications * An array of application summaries . */ public void setApplications ( java . util . Collection < ApplicationSummary > applications ) { } }
if ( applications == null ) { this . applications = null ; return ; } this . applications = new java . util . ArrayList < ApplicationSummary > ( applications ) ;
public class ComputerVisionImpl { /** * This interface is used for getting text operation result . The URL to this interface should be retrieved from ' Operation - Location ' field returned from Recognize Text interface . * @ param operationId Id of the text operation returned in the response of the ' Recognize Text ...
if ( this . client . endpoint ( ) == null ) { throw new IllegalArgumentException ( "Parameter this.client.endpoint() is required and cannot be null." ) ; } if ( operationId == null ) { throw new IllegalArgumentException ( "Parameter operationId is required and cannot be null." ) ; } String parameterizedHost = Joiner . ...
public class WeeklyAutoScalingSchedule { /** * The schedule for Sunday . * @ return The schedule for Sunday . */ public java . util . Map < String , String > getSunday ( ) { } }
if ( sunday == null ) { sunday = new com . amazonaws . internal . SdkInternalMap < String , String > ( ) ; } return sunday ;
public class PutVoiceConnectorTerminationCredentialsRequest { /** * The termination SIP credentials . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setCredentials ( java . util . Collection ) } or { @ link # withCredentials ( java . util . Collection ) } if...
if ( this . credentials == null ) { setCredentials ( new java . util . ArrayList < Credential > ( credentials . length ) ) ; } for ( Credential ele : credentials ) { this . credentials . add ( ele ) ; } return this ;
public class AbstractRemoteSupport { /** * Method closeRemoteConsumer * < p > Close the remote consumers for a given remote ME * @ param remoteMEUuid * @ throws SIResourceException */ public void closeRemoteConsumers ( SIBUuid8 remoteMEId ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "closeRemoteConsumers" , remoteMEId ) ; Iterator aihs = _anycastInputHandlers . keySet ( ) . iterator ( ) ; while ( aihs . hasNext ( ) ) { String key = ( String ) aihs . next ( ) ; AnycastInputHandler aih = _anycastInputHand...
public class UtilAbstractAction { /** * Get a multi - valued request parameter stripped of white space . * Return null for zero length . * @ param req * @ param name name of parameter * @ return Collection < String > or null * @ throws Throwable */ protected Collection < String > getReqPars ( final HttpServle...
String [ ] s = req . getParameterValues ( name ) ; ArrayList < String > res = null ; if ( ( s == null ) || ( s . length == 0 ) ) { return null ; } for ( String par : s ) { par = Util . checkNull ( par ) ; if ( par != null ) { if ( res == null ) { res = new ArrayList < String > ( ) ; } res . add ( par ) ; } } return res...
public class CmsUserDriver { /** * Updates the user additional information map . < p > * @ param dbc the current database context * @ param userId the id of the user to update * @ param additionalInfo the info to write * @ throws CmsDataAccessException if user data could not be written */ protected void interna...
Lock lock = USER_INFO_LOCKS . get ( userId ) ; try { lock . lock ( ) ; // get the map of existing additional infos to compare it new additional infos Map < String , Object > existingInfos = readUserInfos ( dbc , userId ) ; // loop over all entries of the existing additional infos Iterator < Entry < String , Object > > ...
public class UIViewAction { /** * < p class = " changed _ added _ 2_2 " > Enable the method invocation * specified by this component instance to return a value that * performs navigation , similar in spirit to { @ link * UICommand # broadcast } . < / p > * < div class = " changed _ added _ 2_2 " > * < p > Tak...
super . broadcast ( event ) ; FacesContext context = getFacesContext ( ) ; if ( ! ( event instanceof ActionEvent ) ) { throw new IllegalArgumentException ( ) ; } // OPEN QUESTION : should we consider a navigation to the same view as a // no - op navigation ? // only proceed if the response has not been marked complete ...
public class MarketEquilibrium { /** * Will calculate the risk aversion factor that is the best fit for an observed pair of market portfolio * weights and equilibrium / historical excess returns . */ Scalar < ? > calculateImpliedRiskAversion ( final PrimitiveMatrix assetWeights , final PrimitiveMatrix assetReturns ) ...
Scalar < ? > retVal = myCovariances . multiply ( assetWeights ) . solve ( assetReturns ) . toScalar ( 0 , 0 ) ; if ( retVal . isSmall ( PrimitiveMath . ONE ) ) { retVal = BigScalar . ONE ; } else if ( ! retVal . isAbsolute ( ) ) { retVal = retVal . negate ( ) ; } return retVal ;
public class CmsResourceUtil { /** * Returns the site of the current resources , * taking into account the set site mode . < p > * @ return the site path */ public String getSite ( ) { } }
String site = null ; if ( ( m_siteMode == SITE_MODE_MATCHING ) || ( m_cms == null ) ) { site = OpenCms . getSiteManager ( ) . getSiteRoot ( m_resource . getRootPath ( ) ) ; } else if ( m_siteMode == SITE_MODE_CURRENT ) { site = m_cms . getRequestContext ( ) . getSiteRoot ( ) ; } else if ( m_siteMode == SITE_MODE_ROOT )...
public class ReportDownloadResponse { /** * Writes the contents of the response to the specified File . * @ param outputFile the output file to write to * @ throws FileNotFoundException if unable to write to { @ code outputFile } * @ throws IOException if unable to read the response contents */ public void saveTo...
Streams . copy ( getInputStream ( ) , new BufferedOutputStream ( new FileOutputStream ( outputFile ) ) ) ;
public class CommerceAccountPersistenceImpl { /** * Returns the number of commerce accounts where userId = & # 63 ; and type = & # 63 ; . * @ param userId the user ID * @ param type the type * @ return the number of matching commerce accounts */ @ Override public int countByU_T ( long userId , int type ) { } }
FinderPath finderPath = FINDER_PATH_COUNT_BY_U_T ; Object [ ] finderArgs = new Object [ ] { userId , type } ; Long count = ( Long ) finderCache . getResult ( finderPath , finderArgs , this ) ; if ( count == null ) { StringBundler query = new StringBundler ( 3 ) ; query . append ( _SQL_COUNT_COMMERCEACCOUNT_WHERE ) ; qu...
public class ArrayUtils { /** * Tests two int [ ] [ ] arrays for having equal contents . * @ return true iff for each i , < code > equalContents ( xs [ i ] , ys [ i ] ) < / code > is true */ public static boolean equalContents ( int [ ] [ ] xs , int [ ] [ ] ys ) { } }
if ( xs == null ) return ys == null ; if ( ys == null ) return false ; if ( xs . length != ys . length ) return false ; for ( int i = xs . length - 1 ; i >= 0 ; i -- ) { if ( ! equalContents ( xs [ i ] , ys [ i ] ) ) return false ; } return true ;
public class TypeDecoder { /** * Static array length cannot be passed as a type . */ @ SuppressWarnings ( "unchecked" ) static < T extends Type > T decodeStaticArray ( String input , int offset , TypeReference < T > typeReference , int length ) { } }
BiFunction < List < T > , String , T > function = ( elements , typeName ) -> { if ( elements . isEmpty ( ) ) { throw new UnsupportedOperationException ( "Zero length fixed array is invalid type" ) ; } else { return instantiateStaticArray ( typeReference , elements , length ) ; } } ; return decodeArrayElements ( input ,...
public class TransformerFactoryImpl { /** * Allows the user to set specific attributes on the underlying * implementation . * @ param name The name of the attribute . * @ param value The value of the attribute ; Boolean or String = " true " | " false " * @ throws IllegalArgumentException thrown if the underlyin...
if ( name . equals ( FEATURE_INCREMENTAL ) ) { if ( value instanceof Boolean ) { // Accept a Boolean object . . m_incremental = ( ( Boolean ) value ) . booleanValue ( ) ; } else if ( value instanceof String ) { // . . or a String object m_incremental = ( new Boolean ( ( String ) value ) ) . booleanValue ( ) ; } else { ...
public class DescribeInstancesRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DescribeInstancesRequest describeInstancesRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( describeInstancesRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( describeInstancesRequest . getFleetId ( ) , FLEETID_BINDING ) ; protocolMarshaller . marshall ( describeInstancesRequest . getInstanceId ( ) , INSTANCEID_BINDIN...
public class RegularPactTask { /** * Creates all the serializers and comparators . */ protected void initInputsSerializersAndComparators ( int numInputs ) throws Exception { } }
this . inputSerializers = new TypeSerializerFactory < ? > [ numInputs ] ; this . inputComparators = this . driver . requiresComparatorOnInput ( ) ? new TypeComparator [ numInputs ] : null ; this . inputIterators = new MutableObjectIterator [ numInputs ] ; for ( int i = 0 ; i < numInputs ; i ++ ) { // - - - - - create t...
public class MetricReportReporter { /** * Serializes metrics and pushes the byte arrays to Kafka . Uses the serialize * methods in { @ link MetricReportReporter } . * @ param gauges map of { @ link com . codahale . metrics . Gauge } to report and their name . * @ param counters map of { @ link com . codahale . metr...
List < Metric > metrics = Lists . newArrayList ( ) ; for ( Map . Entry < String , Gauge > gauge : gauges . entrySet ( ) ) { metrics . addAll ( serializeGauge ( gauge . getKey ( ) , gauge . getValue ( ) ) ) ; } for ( Map . Entry < String , Counter > counter : counters . entrySet ( ) ) { metrics . addAll ( serializeCount...
public class DoublesMergeImpl { /** * also used by DoublesSketch , DoublesUnionImpl and HeapDoublesSketchTest */ static void downSamplingMergeInto ( final DoublesSketch src , final UpdateDoublesSketch tgt ) { } }
final int srcK = src . getK ( ) ; final int tgtK = tgt . getK ( ) ; final long tgtN = tgt . getN ( ) ; if ( ( srcK % tgtK ) != 0 ) { throw new SketchesArgumentException ( "source.getK() must equal target.getK() * 2^(nonnegative integer)." ) ; } final int downFactor = srcK / tgtK ; checkIfPowerOf2 ( downFactor , "source...
public class DeviceProxy { private int getTangoVersionFromZmqEventSubscriptionChange ( ) throws DevFailed { } }
try { DeviceData argIn = new DeviceData ( ) ; argIn . insert ( new String [ ] { "info" } ) ; DeviceData argOut = get_adm_dev ( ) . command_inout ( "ZmqEventSubscriptionChange" , argIn ) ; DevVarLongStringArray lsa = argOut . extractLongStringArray ( ) ; if ( lsa . lvalue . length == 0 ) return - 1 ; else return lsa . l...
public class Ifc2x3tc1PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EClass getIfcSanitaryTerminalType ( ) { } }
if ( ifcSanitaryTerminalTypeEClass == null ) { ifcSanitaryTerminalTypeEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc2x3tc1Package . eNS_URI ) . getEClassifiers ( ) . get ( 502 ) ; } return ifcSanitaryTerminalTypeEClass ;
public class PrimaveraReader { /** * Process tasks . * @ param wbs WBS task data * @ param tasks task data */ public void processTasks ( List < Row > wbs , List < Row > tasks ) { } }
ProjectProperties projectProperties = m_project . getProjectProperties ( ) ; String projectName = projectProperties . getName ( ) ; Set < Integer > uniqueIDs = new HashSet < Integer > ( ) ; Set < Task > wbsTasks = new HashSet < Task > ( ) ; // We set the project name when we read the project properties , but that ' s j...
public class SpanData { /** * Returns a new immutable { @ code SpanData } . * @ param context the { @ code SpanContext } of the { @ code Span } . * @ param parentSpanId the parent { @ code SpanId } of the { @ code Span } . { @ code null } if the { @ code * Span } is a root . * @ param hasRemoteParent { @ code t...
"deprecation" , "InconsistentOverloads" } ) public static SpanData create ( SpanContext context , @ Nullable SpanId parentSpanId , @ Nullable Boolean hasRemoteParent , String name , @ Nullable Kind kind , Timestamp startTimestamp , Attributes attributes , TimedEvents < Annotation > annotations , TimedEvents < ? extends...
public class Allowed { /** * A list of policies that allowed the authentication . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setPolicies ( java . util . Collection ) } or { @ link # withPolicies ( java . util . Collection ) } if you want to override * ...
if ( this . policies == null ) { setPolicies ( new java . util . ArrayList < Policy > ( policies . length ) ) ; } for ( Policy ele : policies ) { this . policies . add ( ele ) ; } return this ;
public class ComponentSelector { /** * Takes from the data the selection state . * @ throws QTasteTestFailException if the component is not a { @ link CheckBox } * or a { @ link RadioButton } * or a { @ link ToggleButton } . */ @ Override protected void prepareActions ( ) throws QTasteTestFailException { } }
mSelectState = Boolean . parseBoolean ( mData [ 0 ] . toString ( ) ) ; if ( ! ( component instanceof CheckBox ) && ! ( component instanceof RadioButton ) && ! ( component instanceof ToggleButton ) ) { throw new QTasteTestFailException ( "Unsupported component." ) ; }
public class LegacyDfuImpl { /** * Writes the operation code to the characteristic . This method is SYNCHRONOUS and wait until the * { @ link android . bluetooth . BluetoothGattCallback # onCharacteristicWrite ( android . bluetooth . BluetoothGatt , android . bluetooth . BluetoothGattCharacteristic , int ) } * will...
final boolean reset = value [ 0 ] == OP_CODE_RESET_KEY || value [ 0 ] == OP_CODE_ACTIVATE_AND_RESET_KEY ; writeOpCode ( characteristic , value , reset ) ;
public class AbstractTransitionBuilder { /** * Similar to alpha ( float ) , but wait until the transition is about to start to perform the evaluation . * @ param end * @ return self */ public T delayAlpha ( @ FloatRange ( from = 0.0 , to = 1.0 ) float end ) { } }
getDelayedProcessor ( ) . addProcess ( ALPHA , end ) ; return self ( ) ;
public class RootPaneWindowFocusedState { /** * { @ inheritDoc } */ public boolean isInState ( JComponent c ) { } }
Component parent = c ; while ( parent . getParent ( ) != null ) { if ( parent instanceof Window ) { break ; } parent = parent . getParent ( ) ; } if ( parent instanceof Window ) { return ( ( Window ) parent ) . isFocused ( ) ; } // Default to true . return true ;
public class WebFragmentDescriptorImpl { /** * Adds a new namespace * @ return the current instance of < code > WebFragmentDescriptor < / code > */ public WebFragmentDescriptor addNamespace ( String name , String value ) { } }
model . attribute ( name , value ) ; return this ;
public class FunctionKeyReader { /** * Read the saga instance key from the provided message . */ @ Override @ Nullable public KEY readKey ( final MESSAGE message , final LookupContext context ) { } }
return extractFunction . key ( message , context ) ;
public class Assignment { /** * Creates an { @ code Assignment } mapping each variable in { @ code vars } to the value * at the corresponding index of { @ code values } . { @ code vars } does not need * to be sorted in any order . This method does not copy { @ code vars } or * { @ code values } and may modify eit...
ArrayUtils . sortKeyValuePairs ( vars , new Object [ ] [ ] { values } , 0 , vars . length ) ; return fromSortedArrays ( vars , values ) ;
public class MongoDBBasicOperations { /** * Extract the value of the primary ID of the entity object * @ param entity * the entity to get primary key value of * @ return the primary key value */ public X getPrimaryID ( T entity ) { } }
if ( mappingContext == null || conversionService == null ) { fetchMappingContextAndConversionService ( ) ; } MongoPersistentEntity < ? > persistentEntity = mappingContext . getPersistentEntity ( entity . getClass ( ) ) ; MongoPersistentProperty idProperty = persistentEntity . getIdProperty ( ) ; if ( idProperty == null...
public class PropertyType { /** * Uses the object ' s properties to determine if the supplied string matches * the value of this property . * @ param text the String to validate * @ return whether the text supplied is matched by the value of the property */ public boolean matches ( String text ) { } }
if ( text == null ) { return false ; } if ( this . regex ) { final Pattern rx ; if ( this . caseSensitive ) { rx = Pattern . compile ( this . value ) ; } else { rx = Pattern . compile ( this . value , Pattern . CASE_INSENSITIVE ) ; } return rx . matcher ( text ) . matches ( ) ; } else { if ( this . caseSensitive ) { re...
public class ImplicitMappingBuilder { /** * Merges mappings from an existing TypeMap into the type map under construction . */ private void mergeMappings ( TypeMap < ? , ? > destinationMap ) { } }
for ( Mapping mapping : destinationMap . getMappings ( ) ) { InternalMapping internalMapping = ( InternalMapping ) mapping ; mergedMappings . add ( internalMapping . createMergedCopy ( propertyNameInfo . getSourceProperties ( ) , propertyNameInfo . getDestinationProperties ( ) ) ) ; }
public class Version { /** * Returns a new version from the given version string . * @ param version the version string * @ return the version object * @ throws IllegalArgumentException if the version string is invalid */ public static Version from ( String version ) { } }
String [ ] fields = version . split ( "[.-]" , 4 ) ; checkArgument ( fields . length >= 3 , "version number is invalid" ) ; return new Version ( parseInt ( fields [ 0 ] ) , parseInt ( fields [ 1 ] ) , parseInt ( fields [ 2 ] ) , fields . length == 4 ? fields [ 3 ] : null ) ;
public class TokenizerHelper { /** * Convert Tokenizer into serialized options , or empty map if null * @ param tokenizer a { @ link Tokenizer } used by a text index , or null * ( this will be the case for JSON indexes ) * @ return a JSON string representing these options */ public static String tokenizerToJson (...
Map < String , String > settingsMap = new HashMap < String , String > ( ) ; if ( tokenizer != null ) { settingsMap . put ( TOKENIZE , tokenizer . tokenizerName ) ; // safe to store args even if they are null settingsMap . put ( TOKENIZE_ARGS , tokenizer . tokenizerArguments ) ; } return JSONUtils . serializeAsString ( ...
public class InternalXbaseParser { /** * InternalXbase . g : 258:1 : entryRuleXEqualityExpression : ruleXEqualityExpression EOF ; */ public final void entryRuleXEqualityExpression ( ) throws RecognitionException { } }
try { // InternalXbase . g : 259:1 : ( ruleXEqualityExpression EOF ) // InternalXbase . g : 260:1 : ruleXEqualityExpression EOF { if ( state . backtracking == 0 ) { before ( grammarAccess . getXEqualityExpressionRule ( ) ) ; } pushFollow ( FOLLOW_1 ) ; ruleXEqualityExpression ( ) ; state . _fsp -- ; if ( state . failed...
public class IntegerExtensions { /** * The < code > . . < / code > operator yields an { @ link IntegerRange } . * @ param a the start of the range . * @ param b the end of the range . * @ return an { @ link IntegerRange } . Never < code > null < / code > . * @ since 2.3 */ @ Pure @ Inline ( value = "new $3($1, ...
return new IntegerRange ( a , b ) ;
public class Transform { /** * Get the narrowest possible target type . If this { @ link Transform } operation maps its { @ code TARGET _ POSITION } type * parameter as some { @ link Readable } then this will be deduced from target position type / value , else the target * position will be returned . * @ return T...
final TARGET_POSITION target = getTargetPosition ( ) ; final Type targetPositionType = TypeUtils . unrollVariables ( TypeUtils . getTypeArguments ( getClass ( ) , Transform . class ) , Transform . class . getTypeParameters ( ) [ 3 ] ) ; if ( TypeUtils . isAssignable ( targetPositionType , Position . Readable . class ) ...
public class AbstractXHTMLLinkTypeRenderer { /** * Default implementation for computing a link label when no label has been specified . Can be overwritten by * implementations to provide a different algorithm . * @ param reference the reference of the link for which to compute the label * @ return the computed la...
// Look for a component implementing URILabelGenerator with a role hint matching the link scheme . // If not found then use the full reference as the label . // If there ' s no scheme separator then use the full reference as the label . Note that this can happen // when we ' re not in wiki mode ( since all links are co...
public class P2sVpnServerConfigurationsInner { /** * Retrieves the details of a P2SVpnServerConfiguration . * @ param resourceGroupName The resource group name of the P2SVpnServerConfiguration . * @ param virtualWanName The name of the VirtualWan . * @ param p2SVpnServerConfigurationName The name of the P2SVpnSer...
return ServiceFuture . fromResponse ( getWithServiceResponseAsync ( resourceGroupName , virtualWanName , p2SVpnServerConfigurationName ) , serviceCallback ) ;
public class PropertyData { /** * Gets the raw type of the property without generics . * { @ code Foo < String > } will return { @ code Foo } . * @ return the raw type */ public String getTypeRaw ( ) { } }
int pos = type . indexOf ( "<" ) ; return ( pos < 0 ? type : type . substring ( 0 , pos ) ) ;
public class PoolManager { /** * Get a pool ' s min share preemption timeout , in milliseconds . This is the * time after which jobs in the pool may kill other pools ' tasks if they * are below their min share . */ public long getMinSharePreemptionTimeout ( String pool ) { } }
if ( minSharePreemptionTimeouts . containsKey ( pool ) ) { return minSharePreemptionTimeouts . get ( pool ) ; } else { return defaultMinSharePreemptionTimeout ; }
public class PooledWsByteBufferImpl { /** * @ seecom . ibm . ws . bytebuffer . internal . WsByteBufferImpl # readExternal ( java . io . * ObjectInput ) */ @ Override public void readExternal ( ObjectInput s ) throws IOException , ClassNotFoundException { } }
super . readExternal ( s ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( this , tc , "Deserializing " + this ) ; }
public class MainFrame { /** * < / editor - fold > / / GEN - END : initComponents */ private void settingsLoadDefaultsMenuItemActionPerformed ( java . awt . event . ActionEvent evt ) { } }
// GEN - FIRST : event _ settingsLoadDefaultsMenuItemActionPerformed if ( evt != null ) { int response = JOptionPane . showConfirmDialog ( this , "Load defaults settings and lose current ones?" , "Confirm Reset" , JOptionPane . OK_CANCEL_OPTION , JOptionPane . QUESTION_MESSAGE ) ; if ( response == JOptionPane . CANCEL_...
public class TableColumnStyle { /** * Add this style to a styles container * @ param stylesContainer the styles container */ public void addToContentStyles ( final StylesContainer stylesContainer ) { } }
stylesContainer . addContentStyle ( this ) ; if ( this . defaultCellStyle != null ) { stylesContainer . addContentStyle ( this . defaultCellStyle ) ; }
public class Positions { /** * Positions the owner to the right inside its parent . < br > * Respects the parent padding . * @ param < T > the generic type * @ param < U > the generic type * @ param spacing the spacing * @ return the int supplier */ public static < T extends ISized & IChild < U > , U extends ...
return ( ) -> { U parent = owner . getParent ( ) ; if ( parent == null ) return 0 ; return parent . size ( ) . width ( ) - owner . size ( ) . width ( ) - Padding . of ( parent ) . right ( ) - spacing ; } ;
public class CommerceTierPriceEntryPersistenceImpl { /** * Returns the first commerce tier price entry in the ordered set where uuid = & # 63 ; and companyId = & # 63 ; . * @ param uuid the uuid * @ param companyId the company ID * @ param orderByComparator the comparator to order the set by ( optionally < code >...
CommerceTierPriceEntry commerceTierPriceEntry = fetchByUuid_C_First ( uuid , companyId , orderByComparator ) ; if ( commerceTierPriceEntry != null ) { return commerceTierPriceEntry ; } StringBundler msg = new StringBundler ( 6 ) ; msg . append ( _NO_SUCH_ENTITY_WITH_KEY ) ; msg . append ( "uuid=" ) ; msg . append ( uui...
public class CascadingUtils { /** * Mark the output dir of the job for which the context is passed . */ public static void markSuccessfulOutputDir ( Path path , JobConf conf ) throws IOException { } }
FileSystem fs = FileSystem . get ( conf ) ; // create a file in the folder to mark it if ( fs . exists ( path ) ) { Path filePath = new Path ( path , VersionedStore . HADOOP_SUCCESS_FLAG ) ; fs . create ( filePath ) . close ( ) ; }
public class CmsSearchManager { /** * Adds a document type . < p > * @ param documentType a document type */ public void addDocumentTypeConfig ( CmsSearchDocumentType documentType ) { } }
m_documentTypeConfigs . add ( documentType ) ; if ( CmsLog . INIT . isInfoEnabled ( ) ) { CmsLog . INIT . info ( Messages . get ( ) . getBundle ( ) . key ( Messages . INIT_SEARCH_DOC_TYPES_2 , documentType . getName ( ) , documentType . getClassName ( ) ) ) ; }
public class DoubleFunctionBuilder { /** * One of ways of creating builder . This is possibly the least verbose way where compiler should be able to guess the generic parameters . */ @ Nonnull public static < R > DoubleFunction < R > dblFunctionFrom ( Consumer < DoubleFunctionBuilder < R > > buildingFunction ) { } }
DoubleFunctionBuilder builder = new DoubleFunctionBuilder ( ) ; buildingFunction . accept ( builder ) ; return builder . build ( ) ;
public class DoubleHistogram { /** * Encode this histogram in compressed form into a byte array * @ param targetBuffer The buffer to encode into * @ param compressionLevel Compression level ( for java . util . zip . Deflater ) . * @ return The number of bytes written to the buffer */ @ Override synchronized publi...
targetBuffer . putInt ( DHIST_compressedEncodingCookie ) ; targetBuffer . putInt ( getNumberOfSignificantValueDigits ( ) ) ; targetBuffer . putLong ( configuredHighestToLowestValueRatio ) ; return integerValuesHistogram . encodeIntoCompressedByteBuffer ( targetBuffer , compressionLevel ) + 16 ;
public class AmazonIdentityManagementClient { /** * Removes the specified user from the specified group . * @ param removeUserFromGroupRequest * @ return Result of the RemoveUserFromGroup operation returned by the service . * @ throws NoSuchEntityException * The request was rejected because it referenced a reso...
request = beforeClientExecution ( request ) ; return executeRemoveUserFromGroup ( request ) ;
public class ImageUtils { /** * The total difference between two images calculated as the sum of the difference in RGB values of each pixel * the images MUST be the same dimensions . * @ since 1.2 * @ param img1 the first image to be compared * @ param img2 the second image to be compared * @ return the diffe...
int width = img1 . getWidth ( ) ; int height = img1 . getHeight ( ) ; if ( ( width != img2 . getWidth ( ) ) || ( height != img2 . getHeight ( ) ) ) { throw new IllegalArgumentException ( "Image dimensions do not match" ) ; } long diff = 0 ; for ( int x = 0 ; x < width ; x ++ ) { for ( int y = 0 ; y < height ; y ++ ) { ...
public class ThreadPool { /** * Schedules an executor task . */ public boolean scheduleExecutorTask ( Runnable task ) { } }
ClassLoader loader = Thread . currentThread ( ) . getContextClassLoader ( ) ; synchronized ( _executorLock ) { _executorTaskCount ++ ; if ( _executorTaskCount <= _executorTaskMax || _executorTaskMax < 0 ) { boolean isPriority = false ; boolean isQueue = true ; boolean isWake = true ; return scheduleImpl ( task , loader...
public class Choice3 { /** * { @ inheritDoc } */ @ Override public < D > Choice3 < A , B , D > pure ( D d ) { } }
return c ( d ) ;
public class NuunCore { /** * Creates a kernel with the given configuration . * @ param configuration the kernel configuration * @ return the kernel */ public static Kernel createKernel ( KernelConfiguration configuration ) { } }
KernelCoreFactory factory = new KernelCoreFactory ( ) ; return factory . create ( configuration ) ;
public class SyncListPermissionUpdater { /** * Add the requested post parameters to the Request . * @ param request Request to add post params to */ private void addPostParams ( final Request request ) { } }
if ( read != null ) { request . addPostParam ( "Read" , read . toString ( ) ) ; } if ( write != null ) { request . addPostParam ( "Write" , write . toString ( ) ) ; } if ( manage != null ) { request . addPostParam ( "Manage" , manage . toString ( ) ) ; }
public class ClassUtils { /** * Returns an instance of bean ' s annotation * @ param beanClass class to be searched for * @ param annotationClass type of an annotation * @ param < T > type of an annotation * @ return an instance of an annotation */ public static < T extends Annotation > Optional < T > getAnnota...
Class < ? > currentClass = beanClass ; while ( currentClass != null && currentClass != Object . class ) { if ( currentClass . isAnnotationPresent ( annotationClass ) ) { return Optional . of ( currentClass . getAnnotation ( annotationClass ) ) ; } currentClass = currentClass . getSuperclass ( ) ; } return Optional . em...
public class ReLookup { public T put ( String regularExpKey , T value ) { } }
return this . lookupMap . put ( regularExpKey , value ) ;
public class AfplibPackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EClass getFNPRG ( ) { } }
if ( fnprgEClass == null ) { fnprgEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( AfplibPackage . eNS_URI ) . getEClassifiers ( ) . get ( 430 ) ; } return fnprgEClass ;
public class Reflector { /** * Returns the number of elements in the array or list object ; * @ return * the number of elements in the array or list object . * @ throws ReflectorException * if the object is not a list or an array . */ public int getArrayLength ( ) throws ReflectorException { } }
if ( object == null ) { logger . error ( "object is null: did you specify it using the 'inspect()' method?" ) ; throw new ReflectorException ( "object is null: did you specify it using the 'inspect()' method?" ) ; } int length = 0 ; if ( object . getClass ( ) . isArray ( ) ) { length = Array . getLength ( object ) ; } ...
public class CmsUriSplitter { /** * Checks if the given URI is well formed . < p > * @ param uri the URI to check * @ return < code > true < / code > if the given URI is well formed */ @ SuppressWarnings ( "unused" ) public static boolean isValidUri ( String uri ) { } }
boolean result = false ; try { new URI ( uri ) ; result = true ; } catch ( Exception e ) { // nothing to do } return result ;
public class Gradient { /** * Generate the image used for texturing the gradient across shapes */ public void genImage ( ) { } }
if ( image == null ) { ImageBuffer buffer = new ImageBuffer ( 128 , 16 ) ; for ( int i = 0 ; i < 128 ; i ++ ) { Color col = getColorAt ( i / 128.0f ) ; for ( int j = 0 ; j < 16 ; j ++ ) { buffer . setRGBA ( i , j , col . getRedByte ( ) , col . getGreenByte ( ) , col . getBlueByte ( ) , col . getAlphaByte ( ) ) ; } } im...
public class XMLGISElementUtil { /** * Write the XML description for the given map element . * @ param primitive is the map element to output . * @ param builder is the tool to create XML nodes . * @ param resources is the tool that permits to gather the resources . * @ return the XML node of the map element . ...
return writeMapElement ( primitive , null , builder , resources ) ;
public class ServerStats { /** * Creates new { @ link ServerStats } from specified parameters . * @ param lbLatencyNs Represents request processing latency observed on Load Balancer . It is * measured in nanoseconds . Must not be less than 0 . Value of 0 represents that the latency is * not measured . * @ param...
if ( lbLatencyNs < 0 ) { throw new IllegalArgumentException ( "'getLbLatencyNs' is less than zero: " + lbLatencyNs ) ; } if ( serviceLatencyNs < 0 ) { throw new IllegalArgumentException ( "'getServiceLatencyNs' is less than zero: " + serviceLatencyNs ) ; } return new AutoValue_ServerStats ( lbLatencyNs , serviceLatency...
public class CompositeByteBuf { /** * Add the given { @ link ByteBuf } s on the specific index * Be aware that this method does not increase the { @ code writerIndex } of the { @ link CompositeByteBuf } . * If you need to have it increased you need to handle it by your own . * { @ link ByteBuf # release ( ) } own...
return addComponents ( false , cIndex , buffers ) ;
public class LargeRecordHandler { @ SuppressWarnings ( "unchecked" ) public long addRecord ( T record ) throws IOException { } }
if ( recordsOutFile == null ) { if ( closed ) { throw new IllegalStateException ( "The large record handler has been closed." ) ; } if ( recordsReader != null ) { throw new IllegalStateException ( "The handler has already switched to sorting." ) ; } LOG . debug ( "Initializing the large record spilling..." ) ; // initi...
public class AbstractWALDAO { /** * Call this method inside the constructor to read the file contents directly . * This method is write locking internally . This method performs WAL file * reading upon startup both after init as well as after read ! * @ throws DAOException * in case initialization or reading fa...
File aFile = null ; final String sFilename = m_aFilenameProvider . get ( ) ; if ( sFilename == null ) { // required for testing if ( ! isSilentMode ( ) ) if ( LOGGER . isWarnEnabled ( ) ) LOGGER . warn ( "This DAO of class " + getClass ( ) . getName ( ) + " will not be able to read from a file" ) ; // do not return - r...
public class ElemTemplateElement { /** * Get the previous sibling ( as a Node ) or return null . * Note that this may be expensive if the parent has many kids ; * we accept that price in exchange for avoiding the prev pointer * TODO : If we were sure parents and sibs are always ElemTemplateElements , * we could...
ElemTemplateElement walker = getParentNodeElem ( ) ; ElemTemplateElement prev = null ; if ( walker != null ) for ( walker = walker . getFirstChildElem ( ) ; walker != null ; prev = walker , walker = walker . getNextSiblingElem ( ) ) { if ( walker == this ) return prev ; } return null ;
public class ApiOvhMe { /** * Add a TOTP access restriction * REST : POST / me / accessRestriction / totp */ public OvhTOTPSecret accessRestriction_totp_POST ( ) throws IOException { } }
String qPath = "/me/accessRestriction/totp" ; StringBuilder sb = path ( qPath ) ; String resp = exec ( qPath , "POST" , sb . toString ( ) , null ) ; return convertTo ( resp , OvhTOTPSecret . class ) ;
public class CustomUserRegistryWrapper { /** * { @ inheritDoc } */ @ Override public SearchResult getUsers ( String pattern , int limit ) throws RegistryException { } }
try { Result result = customUserRegistry . getUsers ( pattern , limit ) ; return new SearchResult ( result . getList ( ) , result . hasMore ( ) ) ; } catch ( Exception e ) { throw new RegistryException ( e . getMessage ( ) , e ) ; }
public class AuthorizationPrincipalImpl { /** * Returns the < code > IPermissions < / code > for this < code > IAuthorizationPrincipal < / code > for the * specified < code > owner < / code > , < code > activity < / code > and < code > target < / code > . Null parameters * are ignored , so < code > getPermissions (...
return getAuthorizationService ( ) . getPermissionsForPrincipal ( this , owner , activity , target ) ;
public class AbcGrammar { /** * note - length : : = ( * DIGIT [ " / " * DIGIT ] ) / 1 * " / " */ Rule NoteLength ( ) { } }
return Sequence ( ZeroOrMoreS ( DIGIT ( ) ) , ZeroOrMoreS ( '/' ) , ZeroOrMoreS ( DIGIT ( ) ) ) . label ( NoteLength ) . suppressSubnodes ( ) ;
public class CmsAccountsApp { /** * Parses a given state string to state bean . < p > * @ param state to be read * @ param baseOU baseOu * @ return CmsStateBean */ public CmsStateBean parseState ( String state , String baseOU ) { } }
String path = baseOU ; String filter = "" ; I_CmsOuTreeType type = CmsOuTreeType . OU ; CmsUUID groupId = null ; List < String > fields = CmsStringUtil . splitAsList ( state , STATE_SEPERATOR ) ; if ( ! fields . isEmpty ( ) ) { if ( fields . size ( ) > 1 ) { path = fields . get ( 1 ) ; // Make sure to only show OUs whi...
public class CommandLineParser { /** * Get the parsed and checked command line arguments for this parser * @ param args * - The command line arguments to add . These can be passed * straight from the parameter of main ( String [ ] ) * @ return A list of strings , the first ( [ 0 ] ) element in each list is the ...
for ( int i = 0 ; i < args . length ; i ++ ) { if ( ! args [ i ] . startsWith ( "-" ) ) { if ( this . params . size ( ) > 0 ) { List < String > option = new ArrayList < String > ( ) ; option . add ( this . params . get ( 0 ) . longOption ) ; this . params . remove ( 0 ) ; option . add ( args [ i ] ) ; sortedArgs . add ...
public class Enforcer { /** * addPermissionForUser adds a permission for a user or role . * Returns false if the user or role already has the permission ( aka not affected ) . * @ param user the user . * @ param permission the permission , usually be ( obj , act ) . It is actually the rule without the subject . ...
return addPermissionForUser ( user , permission . toArray ( new String [ 0 ] ) ) ;
public class AbstractHttpOverXmppProvider { /** * Parses HeadersExtension element if any . * @ param parser parser * @ return HeadersExtension or null if no headers * @ throws XmlPullParserException * @ throws IOException * @ throws SmackParsingException */ protected HeadersExtension parseHeaders ( XmlPullPar...
HeadersExtension headersExtension = null ; /* We are either at start of headers , start of data or end of req / res */ if ( parser . next ( ) == XmlPullParser . START_TAG && parser . getName ( ) . equals ( HeadersExtension . ELEMENT ) ) { headersExtension = HeadersProvider . INSTANCE . parse ( parser ) ; parser . next ...
public class RecurlyClient { /** * Get a Plan ' s details * @ param planCode recurly id of plan * @ return the plan object as identified by the passed in ID */ public Plan getPlan ( final String planCode ) { } }
if ( planCode == null || planCode . isEmpty ( ) ) throw new RuntimeException ( "planCode cannot be empty!" ) ; return doGET ( Plan . PLANS_RESOURCE + "/" + planCode , Plan . class ) ;
public class JmsSpout { /** * Sets the JMS Session acknowledgement mode for the JMS seesion associated with this spout . * Possible values : * < ul > * < li > javax . jms . Session . AUTO _ ACKNOWLEDGE < / li > * < li > javax . jms . Session . CLIENT _ ACKNOWLEDGE < / li > * < li > javax . jms . Session . DUP...
switch ( mode ) { case Session . AUTO_ACKNOWLEDGE : case Session . CLIENT_ACKNOWLEDGE : case Session . DUPS_OK_ACKNOWLEDGE : break ; default : throw new IllegalArgumentException ( "Unknown Acknowledge mode: " + mode + " (See javax.jms.Session for valid values)" ) ; } this . jmsAcknowledgeMode = mode ;
public class SliceDefinition { /** * Adds a proposition id from which this slice definition is abstracted . * @ param propId * a proposition id < code > String < / code > for an abstract * parameter definition . */ public boolean add ( TemporalExtendedPropositionDefinition tepd ) { } }
if ( tepd != null ) { boolean result = this . abstractedFrom . add ( tepd ) ; if ( result ) { recalculateChildren ( ) ; } return result ; } else { return false ; }
public class ClientPool { /** * Checks out a client for use by the caller . This method waits if necessary until a client is available or until pool is closed . * May return null if InterruptedException occurs during checkout , or if pool is closed during checkout . */ @ FFDCIgnore ( value = { } }
InterruptedException . class } ) public Client checkoutClient ( ) { Client client = null ; try { // need to poll here as the dequeue can be permanently emptied by close method at any time while ( client == null && numClientsClosed . get ( ) == 0 ) { client = clients . poll ( 200 , TimeUnit . MILLISECONDS ) ; } } catch ...
public class AwsSignature { /** * Create Amazon V2 signature . Reference : * http : / / docs . aws . amazon . com / general / latest / gr / signature - version - 2 . html */ static String createAuthorizationSignature ( HttpServletRequest request , String uri , String credential , boolean queryAuth , boolean bothDateH...
// sort Amazon headers SortedSetMultimap < String , String > canonicalizedHeaders = TreeMultimap . create ( ) ; for ( String headerName : Collections . list ( request . getHeaderNames ( ) ) ) { Collection < String > headerValues = Collections . list ( request . getHeaders ( headerName ) ) ; headerName = headerName . to...
public class Http { /** * HTTP POST : Reads the contents from the specified stream and sends them to the URL . * @ return * the location , as an URI , where the resource is created . * @ throws HttpException * when an exceptional condition occurred during the HTTP method execution . */ public static String post...
InputStreamRequestCallback callback = new InputStreamRequestCallback ( from_stream , media_type ) ; String location = _execute ( to_url , HttpMethod . POST , callback , new LocationHeaderResponseExtractor ( ) ) ; return location ;
public class Association { /** * Removes the row with the specified key from this association . * @ param key the key of the association row to remove */ public void remove ( RowKey key ) { } }
currentState . put ( key , new AssociationOperation ( key , null , REMOVE ) ) ;
public class SvdImplicitQrAlgorithm_DDRM { /** * Computes the eigenvalue of the 2 by 2 matrix B < sup > T < / sup > B */ protected void eigenBB_2x2 ( int x1 ) { } }
double b11 = diag [ x1 ] ; double b12 = off [ x1 ] ; double b22 = diag [ x1 + 1 ] ; // normalize to reduce overflow double absA = Math . abs ( b11 ) ; double absB = Math . abs ( b12 ) ; double absC = Math . abs ( b22 ) ; double scale = absA > absB ? absA : absB ; if ( absC > scale ) scale = absC ; // see if it is a pat...
public class MavenModelScannerPlugin { /** * Adds information about references licenses . * @ param pomDescriptor * The descriptor for the current POM . * @ param model * The Maven Model . * @ param store * The database . */ private void addLicenses ( MavenPomDescriptor pomDescriptor , Model model , Store s...
List < License > licenses = model . getLicenses ( ) ; for ( License license : licenses ) { MavenLicenseDescriptor licenseDescriptor = store . create ( MavenLicenseDescriptor . class ) ; licenseDescriptor . setUrl ( license . getUrl ( ) ) ; licenseDescriptor . setComments ( license . getComments ( ) ) ; licenseDescripto...
public class NFSFileVec { /** * Make a new NFSFileVec key which holds the filename implicitly . This name * is used by the Chunks to load data on - demand . * @ return A NFSFileVec mapped to this file . */ public static NFSFileVec make ( File f , Futures fs ) { } }
if ( ! f . exists ( ) ) throw new IllegalArgumentException ( "File not found: " + f . toString ( ) ) ; long size = f . length ( ) ; Key k = Vec . newKey ( PersistNFS . decodeFile ( f ) ) ; // Insert the top - level FileVec key into the store NFSFileVec nfs = new NFSFileVec ( k , size ) ; DKV . put ( k , nfs , fs ) ; re...
public class WorkingWeek { /** * Create a new calendar with the intersection of WORKING days . * e . g . if normal and arabic calendars are intersected , the week is 3 days : Fri - Sun . * @ param ww * @ return a new Working week * @ since 1.4.0 */ public WorkingWeek intersection ( final WorkingWeek ww ) { } }
final byte combined = ( byte ) ( this . workingDays & ww . workingDays ) ; return new WorkingWeek ( combined ) ;
public class CachingRemoteConnector { /** * Commit database transaction . This method is a NOOP if there is no * database or if { @ link # _ transaction } is currently true . * @ param force true if the database transaction should be committed * regardless of the { @ link # _ transaction } flag . */ private void ...
if ( _db == null ) { return ; } if ( _transaction && ! force ) { return ; } try { _db . commit ( ) ; } catch ( Exception e ) { throw new IllegalStateException ( "Could not commit transaction" , e ) ; }
public class RedisUtil { /** * 创建连接池 . * @ param server 服务器 * @ param timeout 超时时间 * @ return */ public static IJedisPool createJedisPool ( String server , int timeout ) { } }
int maxActive = 32 ; return createJedisPool ( server , timeout , maxActive , null ) ;
public class AmazonEC2Client { /** * [ IPv6 only ] Creates an egress - only internet gateway for your VPC . An egress - only internet gateway is used to * enable outbound communication over IPv6 from instances in your VPC to the internet , and prevents hosts outside of * your VPC from initiating an IPv6 connection ...
request = beforeClientExecution ( request ) ; return executeCreateEgressOnlyInternetGateway ( request ) ;
public class XpathUtil { /** * 获取同胞中同名元素的数量 * @ param e 元素 * @ return 数量 */ public static int sameTagElNums ( Element e ) { } }
Elements els = e . parent ( ) . getElementsByTag ( e . tagName ( ) ) ; return els . size ( ) ;
public class ManagedBean { /** * Validates the type */ @ Override protected void checkType ( ) { } }
if ( ! isDependent ( ) && getEnhancedAnnotated ( ) . isParameterizedType ( ) ) { throw BeanLogger . LOG . managedBeanWithParameterizedBeanClassMustBeDependent ( type ) ; } boolean passivating = beanManager . isPassivatingScope ( getScope ( ) ) ; if ( passivating && ! isPassivationCapableBean ( ) ) { if ( ! getEnhancedA...
public class MatrixIO { /** * Converts the contents of a matrix file as a { @ link Matrix } object , using * the provided type description as a hint for what kind to create . The * type of { @ code Matrix } object created will be based on an estimate of * whether the data will fit into the available memory . Note...
return readMatrix ( matrix , format , matrixType , false ) ;
public class Crc32 { /** * Feed a bitstring to the crc calculation . */ public void append24 ( int bits ) { } }
long l ; long [ ] a1 ; l = ( ( l = crc ) >> 8L ) ^ ( a1 = CRC32_TABLE ) [ ( int ) ( ( l & 0xFF ) ^ ( long ) ( bits & 0xFF ) ) ] ; l = ( l >> 8L ) ^ a1 [ ( int ) ( ( l & 0xFF ) ^ ( long ) ( ( bits & 0xff00 ) >> 8 ) ) ] ; crc = ( l >> 8L ) ^ a1 [ ( int ) ( ( l & 0xFF ) ^ ( long ) ( ( bits & 0xff0000 ) >> 16 ) ) ] ;