signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class UpdateDeploymentGroupRequest { /** * Information about triggers to change when the deployment group is updated . For examples , see < a
* href = " https : / / docs . aws . amazon . com / codedeploy / latest / userguide / how - to - notify - edit . html " > Modify Triggers in an AWS
* CodeDeploy Deploym... | if ( this . triggerConfigurations == null ) { setTriggerConfigurations ( new com . amazonaws . internal . SdkInternalList < TriggerConfig > ( triggerConfigurations . length ) ) ; } for ( TriggerConfig ele : triggerConfigurations ) { this . triggerConfigurations . add ( ele ) ; } return this ; |
public class SpanDeriverUtil { /** * Derives fault from Span . Fault is determined by HTTP client / server error code contained in binary annotations .
* @ param span the span
* @ return fault ( ) */
public static String deriveFault ( Span span ) { } } | List < SpanHttpDeriverUtil . HttpCode > errorCodes = SpanHttpDeriverUtil . getClientOrServerErrors ( SpanHttpDeriverUtil . getHttpStatusCodes ( span . getBinaryAnnotations ( ) ) ) ; if ( errorCodes . size ( ) > 0 ) { return errorCodes . iterator ( ) . next ( ) . getDescription ( ) ; } return null ; |
public class ValueDataUtil { /** * Creates value data depending on its type . It avoids storing unnecessary bytes in memory
* every time .
* @ param type
* property data type , can be either { @ link PropertyType } or { @ link ExtendedPropertyType }
* @ param orderNumber
* value data order number
* @ param ... | switch ( type ) { case PropertyType . BINARY : case PropertyType . UNDEFINED : return new ByteArrayPersistedValueData ( orderNumber , data ) ; case PropertyType . BOOLEAN : return new BooleanPersistedValueData ( orderNumber , Boolean . valueOf ( getString ( data ) ) ) ; case PropertyType . DATE : try { return new Calen... |
public class OtpOutputStream { /** * Write an array of bytes to the stream as an Erlang bitstr .
* @ param bin
* the array of bytes to write .
* @ param pad _ bits
* the number of zero pad bits at the low end of the last byte */
public void write_bitstr ( final byte [ ] bin , final int pad_bits ) { } } | if ( pad_bits == 0 ) { write_binary ( bin ) ; return ; } write1 ( OtpExternal . bitBinTag ) ; write4BE ( bin . length ) ; write1 ( 8 - pad_bits ) ; writeN ( bin ) ; |
public class PreferenceActivity { /** * Removes a specific listener , which should not be notified , when a navigation preference has
* been added or removed to / from the activity , anymore .
* @ param listener
* The listener , which should be removed , as an instance of the type { @ link
* NavigationListener ... | Condition . INSTANCE . ensureNotNull ( listener , "The listener may not be null" ) ; navigationListeners . remove ( listener ) ; |
public class CmsLoginHelper { /** * Returns the cookie with the given name , if not cookie is found a new one is created . < p >
* @ param request the current request
* @ param name the name of the cookie
* @ return the cookie */
protected static Cookie getCookie ( HttpServletRequest request , String name ) { } } | Cookie [ ] cookies = request . getCookies ( ) ; for ( int i = 0 ; ( cookies != null ) && ( i < cookies . length ) ; i ++ ) { if ( name . equalsIgnoreCase ( cookies [ i ] . getName ( ) ) ) { return cookies [ i ] ; } } return new Cookie ( name , "" ) ; |
public class MtasExtendedSpanTermQuery { /** * ( non - Javadoc )
* @ see
* org . apache . lucene . search . spans . SpanTermQuery # createWeight ( org . apache . lucene
* . search . IndexSearcher , boolean ) */
@ Override public SpanWeight createWeight ( IndexSearcher searcher , boolean needsScores , float boost ... | final TermContext context ; final IndexReaderContext topContext = searcher . getTopReaderContext ( ) ; if ( termContext == null ) { context = TermContext . build ( topContext , localTerm ) ; } else { context = termContext ; } return new SpanTermWeight ( context , searcher , needsScores ? Collections . singletonMap ( lo... |
public class ColorLab { /** * Conversion from normalized RGB into LAB . Normalized RGB values have a range of 0:1 */
public static void srgbToLab ( float r , float g , float b , float lab [ ] ) { } } | ColorXyz . srgbToXyz ( r , g , b , lab ) ; float X = lab [ 0 ] ; float Y = lab [ 1 ] ; float Z = lab [ 2 ] ; float xr = X / Xr_f ; float yr = Y / Yr_f ; float zr = Z / Zr_f ; float fx , fy , fz ; if ( xr > epsilon_f ) fx = ( float ) Math . pow ( xr , 1.0f / 3.0f ) ; else fx = ( kappa_f * xr + 16.0f ) / 116.0f ; if ( yr... |
public class VirtualMachinesInner { /** * Run command on the VM .
* @ param resourceGroupName The name of the resource group .
* @ param vmName The name of the virtual machine .
* @ param parameters Parameters supplied to the Run command operation .
* @ throws IllegalArgumentException thrown if parameters fail ... | return runCommandWithServiceResponseAsync ( resourceGroupName , vmName , parameters ) . map ( new Func1 < ServiceResponse < RunCommandResultInner > , RunCommandResultInner > ( ) { @ Override public RunCommandResultInner call ( ServiceResponse < RunCommandResultInner > response ) { return response . body ( ) ; } } ) ; |
public class CronUtil { /** * 重新启动定时任务 < br >
* 此方法会清除动态加载的任务 , 重新启动后 , 守护线程与否与之前保持一致 */
synchronized public static void restart ( ) { } } | if ( null != crontabSetting ) { // 重新读取配置文件
crontabSetting . load ( ) ; } if ( scheduler . isStarted ( ) ) { // 关闭并清除已有任务
scheduler . stop ( true ) ; } // 重新加载任务
schedule ( crontabSetting ) ; // 重新启动
scheduler . start ( ) ; |
public class ORecordSerializerCSVAbstract { /** * Serialize the link .
* @ param buffer
* @ param iParentRecord
* @ param iFieldName
* TODO
* @ param iLinked
* Can be an instance of ORID or a Record < ? >
* @ return */
private static OIdentifiable linkToStream ( final StringBuilder buffer , final ORecordS... | if ( iLinked == null ) // NULL REFERENCE
return null ; OIdentifiable resultRid = null ; ORID rid ; final ODatabaseRecord database = ODatabaseRecordThreadLocal . INSTANCE . get ( ) ; if ( iLinked instanceof ORID ) { // JUST THE REFERENCE
rid = ( ORID ) iLinked ; if ( rid . isValid ( ) && rid . isNew ( ) ) { // SAVE AT T... |
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public EClass getIfcStructuralAnalysisModel ( ) { } } | if ( ifcStructuralAnalysisModelEClass == null ) { ifcStructuralAnalysisModelEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 630 ) ; } return ifcStructuralAnalysisModelEClass ; |
public class FrameworkManager { /** * Register the PauseableComponentController class as a service in the OSGi registry
* @ param systemBundleCtx
* The framework system bundle context */
protected void registerPauseableComponentController ( BundleContext systemContext ) { } } | PauseableComponentControllerImpl pauseableComponentController = new PauseableComponentControllerImpl ( systemContext ) ; if ( pauseableComponentController != null ) { Hashtable < String , String > svcProps = new Hashtable < String , String > ( ) ; systemContext . registerService ( PauseableComponentController . class .... |
public class FileAuthenticationProvider { /** * Returns a UserMapping containing all authorization data given within
* GUACAMOLE _ HOME / user - mapping . xml . If the XML file has been modified or has
* not yet been read , this function may reread the file .
* @ return
* A UserMapping containing all authorizat... | // Read user mapping from GUACAMOLE _ HOME / user - mapping . xml
File userMappingFile = new File ( environment . getGuacamoleHome ( ) , USER_MAPPING_FILENAME ) ; // Abort if user mapping does not exist
if ( ! userMappingFile . exists ( ) ) { logger . debug ( "User mapping file \"{}\" does not exist and will not be rea... |
public class Controller { /** * A version of { @ link # handleAction ( ActionEvent ) } with the parameters
* broken out so that it can be used by non - Swing interface toolkits . */
public boolean handleAction ( Object source , String action , Object arg ) { } } | Method method = null ; Object [ ] args = null ; try { // look for the appropriate method
Method [ ] methods = getClass ( ) . getMethods ( ) ; int mcount = methods . length ; for ( int i = 0 ; i < mcount ; i ++ ) { if ( methods [ i ] . getName ( ) . equals ( action ) || // handle our old style of prepending " handle "
m... |
public class VirtualMachinesInner { /** * Retrieves information about the model view or the instance view of a virtual machine .
* @ param resourceGroupName The name of the resource group .
* @ param vmName The name of the virtual machine .
* @ param serviceCallback the async ServiceCallback to handle successful ... | return ServiceFuture . fromResponse ( getByResourceGroupWithServiceResponseAsync ( resourceGroupName , vmName ) , serviceCallback ) ; |
public class SecurityUtils { /** * Converts a string into 128 - bit AES key . */
public static SecretKey toAes128Key ( String s ) { } } | try { // turn secretKey into 256 bit hash
MessageDigest digest = MessageDigest . getInstance ( "SHA-256" ) ; digest . reset ( ) ; digest . update ( s . getBytes ( "UTF-8" ) ) ; // Due to the stupid US export restriction JDK only ships 128bit version .
return new SecretKeySpec ( digest . digest ( ) , 0 , 128 / 8 , "AES"... |
public class GroupDeviceElement { /** * read _ attribute _ asynch _ i - access limited to package Group */
@ Override int read_attribute_asynch_i ( final String [ ] a , final boolean fwd , final int rid ) throws DevFailed { } } | try { final int actual_rid = proxy . read_attribute_asynch ( a ) ; arp . put ( new Integer ( rid ) , new AsynchRequest ( actual_rid , a ) ) ; } catch ( final DevFailed df ) { arp . put ( new Integer ( rid ) , new AsynchRequest ( - 1 , a , df ) ) ; } catch ( final Exception e ) { final DevError [ ] errors = new DevError... |
public class JndiConfigurationSource { /** * Creates an instance of { @ link JndiConfigurationSource } .
* @ param context Context required to build the { @ link JNDIConfiguration }
* @ throws NullPointerException when context is null */
public static JndiConfigurationSource create ( Context context ) { } } | if ( context == null ) { throw new NullPointerException ( "context: null" ) ; } return new JndiConfigurationSource ( createJndiConfiguration ( context , null ) , DEFAULT_PRIORITY ) ; |
public class IfcPropertyTableValueImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ SuppressWarnings ( "unchecked" ) @ Override public EList < IfcValue > getDefinedValues ( ) { } } | return ( EList < IfcValue > ) eGet ( Ifc4Package . Literals . IFC_PROPERTY_TABLE_VALUE__DEFINED_VALUES , true ) ; |
public class TileConfig { /** * Export the tile as a node .
* @ param tileRef The tile to export ( must not be < code > null < / code > ) .
* @ return The exported node .
* @ throws LionEngineException If < code > null < / code > argument or error on writing . */
public static Xml exports ( TileRef tileRef ) { } ... | Check . notNull ( tileRef ) ; final Xml node = new Xml ( NODE_TILE ) ; node . writeInteger ( ATT_TILE_SHEET , tileRef . getSheet ( ) . intValue ( ) ) ; node . writeInteger ( ATT_TILE_NUMBER , tileRef . getNumber ( ) ) ; return node ; |
public class Reporter { /** * Captures the entire page screen shot , and created an HTML file friendly
* link to place in the output file
* @ return String : the image link string */
public String captureEntirePageScreenshot ( ) { } } | String imageName = generateImageName ( ) ; String imageLink = generateImageLink ( imageName ) ; try { app . takeScreenshot ( imageName ) ; screenshots . add ( imageName ) ; } catch ( Exception e ) { log . error ( e ) ; imageLink = "<br/><b><font class='fail'>No Screenshot Available</font></b>" ; } return imageLink ; |
public class DrilldownProcessor { /** * Adds a { @ link DrilldownFunction } to the { @ link PlotOptions } of the given
* { @ link Options } .
* @ param options
* the { @ link Options } to add a { @ link DrilldownFunction } to */
private void addDrilldownFunction ( Options options , OptionsProcessorContext context... | SeriesType chartType = options . getChartOptions ( ) . getType ( ) ; if ( options . getPlotOptions ( ) == null ) { options . setPlotOptions ( new PlotOptionsChoice ( ) ) ; } if ( options . getPlotOptions ( ) . getPlotOptions ( chartType ) == null ) { options . getPlotOptions ( ) . setPlotOptions ( new PlotOptions ( ) ,... |
public class ConnectionDAODefaultImpl { public void init ( final Connection connection , final String devname ) throws DevFailed { } } | connection . url = new TangoUrl ( devname ) ; connection . setDevice_is_dbase ( false ) ; connection . devname = connection . url . devname ; // Check if connection is possible
if ( connection . url . protocol == TANGO && connection . url . use_db ) { connection . ior = get_exported_ior ( connection ) ; } |
public class WhileContextDef { /** * < pre >
* Name of the context .
* < / pre >
* < code > optional string context _ name = 1 ; < / code > */
public com . google . protobuf . ByteString getContextNameBytes ( ) { } } | java . lang . Object ref = contextName_ ; if ( ref instanceof java . lang . String ) { com . google . protobuf . ByteString b = com . google . protobuf . ByteString . copyFromUtf8 ( ( java . lang . String ) ref ) ; contextName_ = b ; return b ; } else { return ( com . google . protobuf . ByteString ) ref ; } |
public class SynchronizingListModel { /** * Synchronizes the list , adding and removing only a minimum number of elements .
* Comparisons are performed using . equals . This must be called from the
* Swing event dispatch thread . */
public void synchronize ( List < ? extends E > list ) { } } | assert SwingUtilities . isEventDispatchThread ( ) : ApplicationResources . accessor . getMessage ( "assert.notRunningInSwingEventThread" ) ; // Make sure the first element exists and matches
int modelOffset ; if ( constantFirstRow != null ) { modelOffset = 1 ; if ( isEmpty ( ) ) addElement ( constantFirstRow ) ; else i... |
public class GetGroupsRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( GetGroupsRequest getGroupsRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( getGroupsRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( getGroupsRequest . getNextToken ( ) , NEXTTOKEN_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . getMes... |
public class PushNotificationsManager { /** * Enable push notifications .
* @ param pushJid
* @ param node
* @ param publishOptions
* @ return true if it was successfully enabled , false if not
* @ throws NoResponseException
* @ throws XMPPErrorException
* @ throws NotConnectedException
* @ throws Inter... | EnablePushNotificationsIQ enablePushNotificationsIQ = new EnablePushNotificationsIQ ( pushJid , node , publishOptions ) ; return changePushNotificationsStatus ( enablePushNotificationsIQ ) ; |
public class ObservableAdapterBuilder { /** * Each emission of this observable prepends to the elements of the adapter . */
@ NonNull public ObservableAdapterBuilder < T > prepends ( @ Nullable Observable < ? extends Collection < ? extends T > > prepends ) { } } | mPrepends = prepends ; return this ; |
public class SldUtilities { /** * REmoves the alpha channel from a color .
* @ param color the color .
* @ return the color without alpha . */
public static Color colorWithoutAlpha ( Color color ) { } } | return new Color ( color . getRed ( ) , color . getGreen ( ) , color . getBlue ( ) ) ; |
public class ChunkedInputStream { /** * Read some bytes from the stream .
* @ param b The byte array that will hold the contents from the stream .
* @ param off The offset into the byte array at which bytes will start to be
* placed .
* @ param len the maximum number of bytes that can be returned .
* @ return... | if ( closed ) { throw new IOException ( "Attempted read from closed stream." ) ; } if ( eof ) { return - 1 ; } if ( pos >= chunkSize ) { nextChunk ( ) ; if ( eof ) { return - 1 ; } } len = Math . min ( len , chunkSize - pos ) ; int count = in . read ( b , off , len ) ; pos += count ; return count ; |
public class ObjectResult { /** * Create an ObjectResult with a status of ERROR and the given error message and
* optional object ID .
* @ param errMsg Error message .
* @ param objID Optional object ID .
* @ return { @ link ObjectResult } with an error status and message . */
public static ObjectResult newErro... | ObjectResult result = new ObjectResult ( ) ; result . setStatus ( Status . ERROR ) ; result . setErrorMessage ( errMsg ) ; if ( ! Utils . isEmpty ( objID ) ) { result . setObjectID ( objID ) ; } return result ; |
public class ClientTypeSignature { /** * This field is deprecated and clients should switch to { @ link # getArguments ( ) } */
@ Deprecated @ JsonProperty public List < ClientTypeSignature > getTypeArguments ( ) { } } | List < ClientTypeSignature > result = new ArrayList < > ( ) ; for ( ClientTypeSignatureParameter argument : arguments ) { switch ( argument . getKind ( ) ) { case TYPE : result . add ( argument . getTypeSignature ( ) ) ; break ; case NAMED_TYPE : result . add ( new ClientTypeSignature ( argument . getNamedTypeSignature... |
public class DescribeBatchPredictionsRequestMarshaller { /** * Marshall the given parameter object . */
public void marshall ( DescribeBatchPredictionsRequest describeBatchPredictionsRequest , ProtocolMarshaller protocolMarshaller ) { } } | if ( describeBatchPredictionsRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( describeBatchPredictionsRequest . getFilterVariable ( ) , FILTERVARIABLE_BINDING ) ; protocolMarshaller . marshall ( describeBatchPredictionsRequest . ge... |
public class ScenarioImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
public void setVersion ( String newVersion ) { } } | String oldVersion = version ; version = newVersion ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , BpsimPackage . SCENARIO__VERSION , oldVersion , version ) ) ; |
public class CudaDirectProvider { /** * This method checks specified device for specified amount of memory
* @ param deviceId
* @ param requiredMemory
* @ return */
public boolean pingDeviceForFreeMemory ( Integer deviceId , long requiredMemory ) { } } | /* long [ ] totalMem = new long [ 1 ] ;
long [ ] freeMem = new long [ 1 ] ;
JCuda . cudaMemGetInfo ( freeMem , totalMem ) ;
long free = freeMem [ 0 ] ;
long total = totalMem [ 0 ] ;
long used = total - free ;
We don ' t want to allocate memory if it ' s too close to the end of available ram . */
// if ( con... |
public class Schema { /** * Validates the given value and throws a ValidationException if errors were
* found .
* @ param correlationId ( optional ) transaction id to trace execution through
* call chain .
* @ param value a value to be validated .
* @ throws ValidationException when errors occured in validati... | validateAndThrowException ( correlationId , value , false ) ; |
public class MetricLongBean { /** * Adds a single data point to the metric .
* @ param timestamp
* @ param value
* @ param tags */
public DataPointLongBean addDataPoint ( Date timestamp , long value , Map < String , String > tags ) { } } | DataPointLongBean point = new DataPointLongBean ( timestamp , value ) ; for ( Entry < String , String > entry : tags . entrySet ( ) ) { point . addTag ( entry . getKey ( ) , entry . getValue ( ) ) ; } dataPoints . add ( point ) ; return point ; |
public class DefaultFactory { /** * This method was designed to be called just one time at application startup .
* This could be done in a single static block of a single class , that perhaps
* grabbed the name of the Factory impl from a - D parameter or similar .
* If this method detects that its already been ca... | if ( INSTANCE == null ) { INSTANCE = myFactory ; } else { throw new RuntimeException ( "Factory has already been set to value [" + INSTANCE . getClass ( ) . getName ( ) + "]" ) ; } |
public class OAuth1aToken { /** * Returns additional ( or , user - defined ) parameters . */
public Map < String , String > additionals ( ) { } } | final ImmutableMap . Builder < String , String > builder = ImmutableMap . builder ( ) ; for ( Entry < String , String > e : params . entrySet ( ) ) { if ( ! DEFINED_PARAM_KEYS . contains ( e . getKey ( ) ) ) { builder . put ( e . getKey ( ) , e . getValue ( ) ) ; } } return builder . build ( ) ; |
public class Messenger { /** * MUST be called on profile open
* @ param uid user ' s Id */
@ ObjectiveCName ( "onProfileOpenWithUid:" ) public void onProfileOpen ( int uid ) { } } | modules . getEvents ( ) . post ( new PeerInfoOpened ( Peer . user ( uid ) ) ) ; |
public class JsAPIs { /** * 创建微信卡券JSAPI签名
* @ param wxCardAPISignature
* @ return */
public WxCardAPISignature createWxCardJsAPISignature ( WxCardAPISignature wxCardAPISignature ) { } } | if ( wxCardAPITicket == null || wxCardAPITicket . expired ( ) ) { getWxCardAPITicket ( ) ; } long timestamp = System . currentTimeMillis ( ) / 1000 ; String nonce = RandomStringGenerator . getRandomStringByLength ( 16 ) ; String ticket = wxCardAPITicket . getTicket ( ) ; List < String > parameters = new ArrayList < > (... |
public class SepaUtil { /** * Formatiert den XML - Kalender im angegebenen Format .
* @ param cal der Kalender .
* @ param format das zu verwendende Format . Fuer Beispiele siehe
* { @ link SepaUtil # DATE _ FORMAT }
* { @ link SepaUtil # DATETIME _ FORMAT }
* Wenn keines angegeben ist , wird per Default { @ ... | if ( cal == null ) return null ; if ( format == null ) format = DATE_FORMAT ; SimpleDateFormat df = new SimpleDateFormat ( format ) ; return df . format ( cal . toGregorianCalendar ( ) . getTime ( ) ) ; |
public class ExtraDataBeaconTracker { /** * The following code is for dealing with merging data fields in beacons */
@ Nullable private Beacon trackGattBeacon ( @ NonNull Beacon beacon ) { } } | if ( beacon . isExtraBeaconData ( ) ) { updateTrackedBeacons ( beacon ) ; return null ; } String key = getBeaconKey ( beacon ) ; HashMap < Integer , Beacon > matchingTrackedBeacons = mBeaconsByKey . get ( key ) ; if ( null == matchingTrackedBeacons ) { matchingTrackedBeacons = new HashMap < > ( ) ; } else { Beacon trac... |
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public EClass getIfcDistributionCircuit ( ) { } } | if ( ifcDistributionCircuitEClass == null ) { ifcDistributionCircuitEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 180 ) ; } return ifcDistributionCircuitEClass ; |
import java . lang . Math ; class OddRootElements { /** * Calculate the count of numbers with odd number of factors in a given range .
* Args :
* start : Minimum range value
* end : Maximum range value
* Returns :
* int : The total count of numbers with odd factors
* Examples :
* > > > countOddRootElement... | return ( int ) Math . sqrt ( end ) - ( int ) Math . sqrt ( start - 1 ) ; |
public class View { /** * An API REST method to get the allowed { $ link TopLevelItem } s and its categories .
* @ return A { @ link Categories } entity that is shown as JSON file . */
@ Restricted ( DoNotUse . class ) public Categories doItemCategories ( StaplerRequest req , StaplerResponse rsp , @ QueryParameter St... | getOwner ( ) . checkPermission ( Item . CREATE ) ; rsp . addHeader ( "Cache-Control" , "no-cache, no-store, must-revalidate" ) ; rsp . addHeader ( "Pragma" , "no-cache" ) ; rsp . addHeader ( "Expires" , "0" ) ; Categories categories = new Categories ( ) ; int order = 0 ; JellyContext ctx ; if ( StringUtils . isNotBlank... |
public class DateTieredCompactionStrategy { /** * Removes all sstables with max timestamp older than maxSSTableAge .
* @ param sstables all sstables to consider
* @ param maxSSTableAge the age in milliseconds when an SSTable stops participating in compactions
* @ param now current time . SSTables with max timesta... | if ( maxSSTableAge == 0 ) return sstables ; final long cutoff = now - maxSSTableAge ; return Iterables . filter ( sstables , new Predicate < SSTableReader > ( ) { @ Override public boolean apply ( SSTableReader sstable ) { return sstable . getMaxTimestamp ( ) >= cutoff ; } } ) ; |
public class CommandContext { /** * Parses and verifies the command line options .
* @ throws ParseException */
@ SuppressWarnings ( "unchecked" ) // marshall from apache commons cli
private void parse ( ) throws ParseException { } } | _argValues = new HashMap < Argument , String > ( ) ; _varargValues = new ArrayList < String > ( ) ; List < String > argList = _commandLine . getArgList ( ) ; int required = 0 ; boolean hasOptional = false ; boolean hasVarargs = false ; for ( Argument argument : _arguments . getArguments ( ) ) { if ( argument . isRequir... |
public class Util { /** * Writes the entire remaining contents of the buffer to the channel . May complete in one operation , but the
* documentation is vague , so this keeps going until we are sure .
* @ param buffer the data to be written
* @ param channel the channel to which we want to write data
* @ throws... | while ( buffer . hasRemaining ( ) ) { channel . write ( buffer ) ; } |
public class OpProfiler { /** * This method tracks op calls
* @ param op */
public void processOpCall ( Op op ) { } } | // total number of invocations
invocationsCount . incrementAndGet ( ) ; // number of invocations for this specific op
opCounter . incrementCount ( op . opName ( ) ) ; // number of invocations for specific class
String opClass = getOpClass ( op ) ; classCounter . incrementCount ( opClass ) ; if ( op . x ( ) == null || (... |
public class RebalanceUtils { /** * Print log to the following logger ( Info level )
* @ param batchId
* @ param taskId
* @ param logger
* @ param message */
public static void printBatchTaskLog ( int batchId , int taskId , Logger logger , String message ) { } } | logger . info ( "[Rebalance batch/task id " + batchId + "/" + taskId + "] " + message ) ; |
public class ScoreFunctions { /** * Illumina positional score function .
* @ return the Illumina positional score function */
public static ScoreFunction illumina ( ) { } } | return new ScoreFunction ( ) { @ Override public double evaluate ( final double relativePosition ) { // TODO : this could use improvement ; perhaps re - use quality profiles from ART
if ( relativePosition < 0.05d ) { return 14400.0d * ( relativePosition * relativePosition ) ; } else if ( relativePosition < 0.8d ) { ret... |
public class CircularLossyQueue { /** * Returns an array of the current elements in the queue . The order of elements
* is in reverse order of the order items were added .
* @ param type
* destination
* @ return An array containing the current elements in the queue . The first
* element of the array is the ta... | if ( type . length > m_nMaxSize ) throw new IllegalArgumentException ( "Size of array passed in cannot be greater than " + m_nMaxSize ) ; final int curIndex = _getCurrentIndex ( ) ; for ( int k = 0 ; k < type . length ; k ++ ) { final int index = _getIndex ( curIndex - k ) ; type [ k ] = m_aCircularArray [ index ] . ge... |
public class SubscriptionManager { /** * Unbinds a listener to a publisher
* @ param source the event publisher
* @ param listener the event receiver */
public < T extends EventListener > void unsubscribe ( EventPublisher source , T listener ) { } } | log . debug ( "[unsubscribe] Removing {} --> {}" , source . getClass ( ) . getName ( ) , listener . getClass ( ) . getName ( ) ) ; GenericEventDispatcher < T > dispatcher = ( GenericEventDispatcher < T > ) dispatchers . get ( source ) ; dispatcher . removeListener ( listener ) ; |
public class Op { /** * Creates a map containing one entry with the specified key and value , and an < i > operation
* expression < / i > on it . Also enables the addition of new entries to the map by means of the
* < tt > and ( . . . ) < / tt > action .
* @ param key the key for the map ' s first entry
* @ par... | final Map < K , V > newTarget = new LinkedHashMap < K , V > ( ) ; newTarget . put ( key , value ) ; return new Level0BuildingMapOperator < Map < K , V > , K , V > ( ExecutionTarget . forOp ( newTarget , Normalisation . MAP ) ) ; |
public class CmsVfsSitemapService { /** * Returns the modified list from the current user . < p >
* @ return the modified list */
private LinkedHashMap < CmsUUID , CmsClientSitemapEntry > getModifiedList ( ) { } } | CmsObject cms = getCmsObject ( ) ; CmsUser user = cms . getRequestContext ( ) . getCurrentUser ( ) ; Object obj = user . getAdditionalInfo ( ADDINFO_ADE_MODIFIED_LIST ) ; LinkedHashMap < CmsUUID , CmsClientSitemapEntry > result = new LinkedHashMap < CmsUUID , CmsClientSitemapEntry > ( ) ; if ( obj instanceof String ) {... |
public class MimeType { /** * Add a parameter .
* @ param sAttribute
* Parameter name . Must neither be < code > null < / code > nor empty and must
* match { @ link MimeTypeParser # isToken ( String ) } .
* @ param sValue
* The value to use . May neither be < code > null < / code > nor empty . Must
* not be... | return addParameter ( new MimeTypeParameter ( sAttribute , sValue ) ) ; |
public class Parser { /** * 12.12 Labelled Statement */
private ParseTree parseLabelledStatement ( ) { } } | SourcePosition start = getTreeStartLocation ( ) ; IdentifierToken name = eatId ( ) ; eat ( TokenType . COLON ) ; return new LabelledStatementTree ( getTreeLocation ( start ) , name , parseStatement ( ) ) ; |
public class FacebookBatcher { /** * Get a user access token from Facebook . Normally you obtain this from the client - side SDK ( javascript , iphone , etc )
* but if you are driving the OAuth flow manually , this method is the last step .
* see https : / / developers . facebook . com / docs / authentication / */
... | RequestBuilder call = new RequestBuilder ( GRAPH_ENDPOINT + "oauth/access_token" , HttpMethod . GET ) ; call . setTimeout ( 10 * 1000 ) ; // this is a somewhat crude hack but seems reasonable right now
call . addParam ( "client_id" , clientId ) ; call . addParam ( "client_secret" , clientSecret ) ; if ( code != null ||... |
public class MediaDescriptorField { /** * Creates or updates video format using payload number and text format description .
* @ param payload the payload number of the format .
* @ param description text description of the format
* @ return format object */
private RTPFormat createVideoFormat ( int payload , Tex... | Iterator < Text > it = description . split ( '/' ) . iterator ( ) ; // encoding name
Text token = it . next ( ) ; token . trim ( ) ; EncodingName name = new EncodingName ( token ) ; // clock rate
// TODO : convert to frame rate
token = it . next ( ) ; token . trim ( ) ; int clockRate = token . toInteger ( ) ; RTPFormat... |
public class LogRepositorySubManagerImpl { /** * Configures constrain parameters of the repository .
* @ param maxRepositorySize maximum in bytes of the total sum of repository file sizes the manager should maintain .
* This limit is ignored if < code > maxRepositorySize < / code > is less than or equal to zero . *... | this . maxLogFileSize = LogRepositoryManagerImpl . calculateFileSplit ( maxRepositorySize ) ; ivMaxListSize = ( maxRepositorySize < 0 ) ? - 1 : maxRepositorySize / maxLogFileSize ; if ( debugLogger . isLoggable ( Level . FINE ) && LogRepositoryBaseImpl . isDebugEnabled ( ) ) { debugLogger . logp ( Level . FINE , thisCl... |
public class AVFlymePushMessageReceiver { /** * 处理设备注册事件 */
@ Override public void onRegisterStatus ( Context context , com . meizu . cloud . pushsdk . platform . message . RegisterStatus registerStatus ) { } } | // 调用新版订阅PushManager . register ( context , appId , appKey ) 回调
if ( null == context || null == registerStatus ) { return ; } LOGGER . d ( "register successed, pushId=" + registerStatus . getPushId ( ) ) ; String pushId = registerStatus . getPushId ( ) ; if ( ! StringUtil . isEmpty ( pushId ) ) { updateAVInstallation (... |
public class PasswordHandler { /** * Replaces all configured elements with a - - - replaced - - - string .
* @ param event the event */
public void handleEvent ( Event event ) { } } | LOG . fine ( "PasswordHandler called" ) ; if ( tagnames == null || tagnames . size ( ) == 0 ) { LOG . warning ( "Password filter is active but there is no filter tagname configured!" ) ; } if ( tagnames != null && event . getContent ( ) != null && event . getContent ( ) . length ( ) > 0 ) { LOG . fine ( "Content before... |
public class Flowable { /** * Returns a Flowable that emits the items in a specified { @ link Publisher } before it begins to emit
* items emitted by the source Publisher .
* < img width = " 640 " height = " 315 " src = " https : / / raw . github . com / wiki / ReactiveX / RxJava / images / rx - operators / startWi... | ObjectHelper . requireNonNull ( other , "other is null" ) ; return concatArray ( other , this ) ; |
public class HdfsFileStatus { /** * Convert an HdfsFileStatus to a FileStatus
* @ param stat an HdfsFileStatus
* @ param src parent path in string representation
* @ return a FileStatus object */
public static FileStatus toFileStatus ( HdfsFileStatus stat , String src ) { } } | if ( stat == null ) { return null ; } return new FileStatus ( stat . getLen ( ) , stat . isDir ( ) , stat . getReplication ( ) , stat . getBlockSize ( ) , stat . getModificationTime ( ) , stat . getAccessTime ( ) , stat . getPermission ( ) , stat . getOwner ( ) , stat . getGroup ( ) , stat . getFullPath ( new Path ( sr... |
public class ConfigurationImpl { /** * Depending upon the command line options provided by the user , set
* configure the output generation environment .
* @ param options The array of option names and values . */
@ Override public void setSpecificDocletOptions ( String [ ] [ ] options ) { } } | for ( int oi = 0 ; oi < options . length ; ++ oi ) { String [ ] os = options [ oi ] ; String opt = StringUtils . toLowerCase ( os [ 0 ] ) ; if ( opt . equals ( "-footer" ) ) { footer = os [ 1 ] ; } else if ( opt . equals ( "-header" ) ) { header = os [ 1 ] ; } else if ( opt . equals ( "-packagesheader" ) ) { packageshe... |
public class Promises { /** * Returns a { @ link BiPredicate } which checks if
* { @ code Promise } wasn ' t completed exceptionally . */
@ Contract ( value = " -> new" , pure = true ) @ NotNull public static < T > BiPredicate < T , Throwable > isResult ( ) { } } | return ( $ , e ) -> e == null ; |
public class Assert { /** * Asserts that an argument is valid .
* The assertion holds if and only if { @ code valid } is { @ literal true } .
* For example , application code might assert that :
* < pre >
* < code >
* Assert . argument ( age & gt ; = 21 , " Person must be 21 years of age to enter " ) ;
* < ... | argument ( valid , new IllegalArgumentException ( format ( message , arguments ) ) ) ; |
public class DerbyDdlParser { /** * { @ inheritDoc }
* @ see org . modeshape . sequencer . ddl . StandardDdlParser # parseAlterTableStatement ( org . modeshape . sequencer . ddl . DdlTokenStream ,
* org . modeshape . sequencer . ddl . node . AstNode ) */
@ Override protected AstNode parseAlterTableStatement ( DdlTo... | assert tokens != null ; assert parentNode != null ; markStartOfStatement ( tokens ) ; // ALTER TABLE table - Name
// ADD COLUMN column - definition |
// ADD CONSTRAINT clause |
// DROP [ COLUMN ] column - name [ CASCADE | RESTRICT ] |
// DROP { PRIMARY KEY | FOREIGN KEY constraint - name | UNIQUE constraint - name | CH... |
public class SchemasInner { /** * Gets an integration account schema .
* @ param resourceGroupName The resource group name .
* @ param integrationAccountName The integration account name .
* @ param schemaName The integration account schema name .
* @ throws IllegalArgumentException thrown if parameters fail th... | return getWithServiceResponseAsync ( resourceGroupName , integrationAccountName , schemaName ) . map ( new Func1 < ServiceResponse < IntegrationAccountSchemaInner > , IntegrationAccountSchemaInner > ( ) { @ Override public IntegrationAccountSchemaInner call ( ServiceResponse < IntegrationAccountSchemaInner > response )... |
public class KeyVaultClientCustomImpl { /** * Gets the public part of a stored key . The get key operation is applicable to
* all key types . If the requested key is symmetric , then no key material is
* released in the response . Authorization : Requires the keys / get permission .
* @ param vaultBaseUrl
* The... | return getKeyAsync ( vaultBaseUrl , keyName , "" , serviceCallback ) ; |
public class TabbedPane { /** * Must be called when you want to update tab title . If tab is dirty an ' * ' is added before title . This is called automatically
* if using { @ link Tab # setDirty ( boolean ) }
* @ param tab that title will be updated */
public void updateTabTitle ( Tab tab ) { } } | TabButtonTable table = tabsButtonMap . get ( tab ) ; if ( table == null ) { throwNotBelongingTabException ( tab ) ; } table . button . setText ( getTabTitle ( tab ) ) ; |
public class CmsSiteManagerImpl { /** * Returns the current site for the provided OpenCms user context object . < p >
* In the unlikely case that no site matches with the provided OpenCms user context ,
* the default site is returned . < p >
* @ param cms the OpenCms user context object to check for the site
* ... | CmsSite site = getSiteForSiteRoot ( cms . getRequestContext ( ) . getSiteRoot ( ) ) ; return ( site == null ) ? m_defaultSite : site ; |
public class VersionInfo { /** * Returns an instance of VersionInfo with the argument version .
* @ param version version String in the format of " major . minor . milli . micro "
* or " major . minor . milli " or " major . minor " or " major " ,
* where major , minor , milli , micro are non - negative numbers
... | int length = version . length ( ) ; int array [ ] = { 0 , 0 , 0 , 0 } ; int count = 0 ; int index = 0 ; while ( count < 4 && index < length ) { char c = version . charAt ( index ) ; if ( c == '.' ) { count ++ ; } else { c -= '0' ; if ( c < 0 || c > 9 ) { throw new IllegalArgumentException ( INVALID_VERSION_NUMBER_ ) ; ... |
public class HeaderRegexCondition { /** * { @ inheritDoc } */
@ Override public final boolean checkCondition ( final SipServletRequest initialRequest , final DefaultSipApplicationRouterInfo info ) { } } | boolean enabled = true ; for ( String hAux : info . getHeaderPatternMap ( ) . keySet ( ) ) { String headerValue = initialRequest . getHeader ( hAux ) ; // Pattern is ThreadSafe as doc by Java doc
// Matcher is not threadsafe , but a new one is created every time .
// Anyway if performance is degraded , Threadlocal / po... |
public class EntityHelper { /** * 通过反射设置MappedStatement的keyProperties字段值
* @ param pkColumns 所有的主键字段
* @ param ms MappedStatement */
public static void setKeyProperties ( Set < EntityColumn > pkColumns , MappedStatement ms ) { } } | if ( pkColumns == null || pkColumns . isEmpty ( ) ) { return ; } List < String > keyProperties = new ArrayList < String > ( pkColumns . size ( ) ) ; for ( EntityColumn column : pkColumns ) { keyProperties . add ( column . getProperty ( ) ) ; } MetaObjectUtil . forObject ( ms ) . setValue ( "keyProperties" , keyProperti... |
public class ApplicationMonitor { /** * adds an application ' s information to the update monitor */
@ FFDCIgnore ( value = UnableToAdaptException . class ) public void addApplication ( ApplicationInstallInfo installInfo ) { } } | // . . . and now create the new . . . start by asking the handler what needs monitoring
final Collection < Notification > notificationsToMonitor ; final boolean listenForRootStructuralChanges ; ApplicationMonitoringInformation ami = installInfo . getApplicationMonitoringInformation ( ) ; if ( ami != null ) { notificati... |
public class ViewPoolProcessor { /** * Clear all transient components not created by facelets algorithm . In this way ,
* we ensure the component tree does not have any changes done after markInitialState .
* @ param context
* @ param component */
private void clearTransientAndNonFaceletComponents ( final FacesCo... | // Scan children
int childCount = component . getChildCount ( ) ; if ( childCount > 0 ) { for ( int i = 0 ; i < childCount ; i ++ ) { UIComponent child = component . getChildren ( ) . get ( i ) ; if ( child != null && child . isTransient ( ) && child . getAttributes ( ) . get ( ComponentSupport . MARK_CREATED ) == null... |
public class SpringAndroidObjectPersister { @ Override protected T readCacheDataFromFile ( File file ) throws CacheLoadingException { } } | try { String resultJson = null ; synchronized ( file . getAbsolutePath ( ) . intern ( ) ) { resultJson = FileUtils . readFileToString ( file , CharEncoding . UTF_8 ) ; } if ( ! StringUtils . isEmpty ( resultJson ) ) { T result = deserializeData ( resultJson ) ; return result ; } throw new CacheLoadingException ( "Unabl... |
public class AdroitList { private boolean checkEquality ( E it , Object o ) { } } | return o . equals ( it ) || ( comparator != null && comparator . compare ( it , ( E ) o ) == 0 ) ; |
public class InvitationMarshaller { /** * Marshall the given parameter object . */
public void marshall ( Invitation invitation , ProtocolMarshaller protocolMarshaller ) { } } | if ( invitation == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( invitation . getAccountId ( ) , ACCOUNTID_BINDING ) ; protocolMarshaller . marshall ( invitation . getInvitationId ( ) , INVITATIONID_BINDING ) ; protocolMarshaller . marshal... |
public class DependencyFinder { /** * Resolves the specified artifact ( using its GAV , classifier and packaging ) .
* @ param mojo the mojo
* @ param groupId the groupId of the artifact to resolve
* @ param artifactId the artifactId of the artifact to resolve
* @ param version the version
* @ param type the ... | ArtifactRequest request = new ArtifactRequest ( ) ; request . setArtifact ( new DefaultArtifact ( groupId , artifactId , classifier , type , version ) ) ; request . setRepositories ( mojo . remoteRepos ) ; mojo . getLog ( ) . info ( "Resolving artifact " + artifactId + " from " + mojo . remoteRepos ) ; ArtifactResult r... |
public class ProxyImpl { /** * ( non - Javadoc )
* @ see javax . servlet . sip . Proxy # cancel ( java . lang . String [ ] , int [ ] , java . lang . String [ ] ) */
public void cancel ( String [ ] protocol , int [ ] reasonCode , String [ ] reasonText ) { } } | if ( ackReceived ) throw new IllegalStateException ( "There has been an ACK received. Can not cancel more brnaches, the INVITE tx has finished." ) ; cancelAllExcept ( null , protocol , reasonCode , reasonText , true ) ; |
public class JEEMetadataContextImpl { /** * Serialize the given object .
* @ param outStream The stream to write the serialized data .
* @ throws IOException */
private void writeObject ( ObjectOutputStream outStream ) throws IOException { } } | PutField fields = outStream . putFields ( ) ; fields . put ( BEGIN_DEFAULT , beginDefaultContext ) ; outStream . writeFields ( ) ; |
public class TileUtil { /** * Calculate the screen size of a tile . Normally the screen size is expressed in pixels and should therefore be
* integers , but for the sake of accuracy we try to keep a double value as long as possible .
* @ param worldSize
* The width and height of a tile in the layer ' s world coor... | int screenWidth = ( int ) Math . round ( scale * worldSize [ 0 ] ) ; int screenHeight = ( int ) Math . round ( scale * worldSize [ 1 ] ) ; return new int [ ] { screenWidth , screenHeight } ; |
public class Sources { /** * Convert { @ link InputStream } to { @ link BufferedReader }
* @ param is
* @ return */
public static BufferedReader asReader ( InputStream is , Charset charset ) { } } | try { return new BufferedReader ( new InputStreamReader ( is , charset . toString ( ) ) ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } return null ; |
public class PreJava9DateFormatProvider { /** * Returns the same DateFormat as { @ code DateFormat . getDateTimeInstance ( dateStyle , timeStyle , Locale . US ) }
* in Java 8 or below . */
public static DateFormat getUSDateTimeFormat ( int dateStyle , int timeStyle ) { } } | String pattern = getDatePartOfDateTimePattern ( dateStyle ) + " " + getTimePartOfDateTimePattern ( timeStyle ) ; return new SimpleDateFormat ( pattern , Locale . US ) ; |
public class ExpressionEvaluator { /** * Utility method for ACaseAlternative
* @ param node
* @ param val
* @ param ctxt
* @ return
* @ throws AnalysisException */
public Value eval ( ACaseAlternative node , Value val , Context ctxt ) throws AnalysisException { } } | Context evalContext = new Context ( ctxt . assistantFactory , node . getLocation ( ) , "case alternative" , ctxt ) ; try { evalContext . putList ( ctxt . assistantFactory . createPPatternAssistant ( ) . getNamedValues ( node . getPattern ( ) , val , ctxt ) ) ; return node . getResult ( ) . apply ( VdmRuntime . getExpre... |
public class HttpChannelConfig { /** * Check the input configuration for the default flag on whether to use
* persistent connections or not . If this is false , then the other related
* configuration values will be ignored ( such as MaxKeepAliveRequests ) .
* @ param props */
private void parseKeepAliveEnabled ( ... | boolean flag = this . bKeepAliveEnabled ; Object value = props . get ( HttpConfigConstants . PROPNAME_KEEPALIVE_ENABLED ) ; if ( null != value ) { flag = convertBoolean ( value ) ; } this . bKeepAliveEnabled = flag ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "Config:... |
public class LabeledLabelPanel { /** * Factory method for creating the new { @ link Label } . This method is invoked in the constructor
* from the derived classes and can be overridden so users can provide their own version of a
* new { @ link Label } .
* @ param id
* the id
* @ param model
* the model
* ... | final PropertyModel < T > viewableLabelModel = new PropertyModel < > ( model . getObject ( ) , this . getId ( ) ) ; return ComponentFactory . newLabel ( id , viewableLabelModel ) ; |
public class DocumentElement { /** * setter for ElementId - sets
* @ generated
* @ param v value to set into the feature */
public void setElementId ( int v ) { } } | if ( DocumentElement_Type . featOkTst && ( ( DocumentElement_Type ) jcasType ) . casFeat_ElementId == null ) jcasType . jcas . throwFeatMissing ( "ElementId" , "ch.epfl.bbp.uima.types.DocumentElement" ) ; jcasType . ll_cas . ll_setIntValue ( addr , ( ( DocumentElement_Type ) jcasType ) . casFeatCode_ElementId , v ) ; |
public class ColumnMajorSparseMatrix { /** * Creates a random { @ link ColumnMajorSparseMatrix } of the given shape :
* { @ code rows } x { @ code columns } . */
public static ColumnMajorSparseMatrix random ( int rows , int columns , double density , Random random ) { } } | return CCSMatrix . random ( rows , columns , density , random ) ; |
public class DecoratorRegistryImpl { /** * { @ inheritDoc } */
@ Override public void addDecorator ( Class < ? extends AbstractStats > clazz , IDecorator decorator ) { } } | addDecorator ( clazz . getName ( ) , decorator ) ; |
public class MonomerStoreConfiguration { /** * Refreshes the configuration using the local properties file . */
public void refresh ( ) { } } | File configFile = new File ( CONFIG_FILE_PATH ) ; if ( ! configFile . exists ( ) ) { BufferedWriter writer = null ; BufferedReader reader = null ; try { configFile . createNewFile ( ) ; InputStream in = Chemistry . class . getResourceAsStream ( "/org/helm/notation2/resources/MonomerStoreConfig.properties" ) ; reader = ... |
public class LambdaSpringUtil { /** * wires spring into the passed in bean
* @ param o
* @ param myBeanName */
public static void wireInSpring ( Object o , String myBeanName ) { } } | // Lambda does not do this for you - though serverless does have a library to do it
if ( ctx == null ) { synchronized ( lck ) { if ( ctx == null ) { LOG . info ( "LamdaSpringUtil CTX is null - initialising spring" ) ; ctx = new ClassPathXmlApplicationContext ( globalRootContextPath ) ; } } } else { LOG . debug ( "Lamd... |
public class DirectoryLookupService { /** * Query the UP ModelServiceInstance .
* @ param query
* the query criteria .
* @ return
* the ModelServiceInstance list . */
public List < ModelServiceInstance > queryUPModelInstances ( ServiceInstanceQuery query ) { } } | List < ModelServiceInstance > upInstances = null ; List < ModelServiceInstance > instances = queryModelInstances ( query ) ; if ( instances != null && instances . size ( ) > 0 ) { for ( ModelServiceInstance instance : instances ) { if ( OperationalStatus . UP . equals ( instance . getStatus ( ) ) ) { if ( upInstances =... |
public class Authentication { /** * CAUSE : Prefer throwing / catching meaningful exceptions instead of Exception */
protected static boolean saveAuthentication ( URL url , String authenticationToken , boolean authenticationTokenIsPrivate , String applicationKey , int timeToLive , String privateKey , Map < String , Lin... | String postBody = String . format ( "AT=%s&AK=%s&PK=%s&TTL=%s&TP=%s&PVT=%s" , authenticationToken , applicationKey , privateKey , timeToLive , permissions . size ( ) , ( authenticationTokenIsPrivate ? "1" : "0" ) ) ; // CAUSE : Inefficient use of keySet iterator instead of entrySet iterator
for ( Map . Entry < String ,... |
public class CPOptionValueUtil { /** * Returns the cp option value where CPOptionId = & # 63 ; and key = & # 63 ; or returns < code > null < / code > if it could not be found , optionally using the finder cache .
* @ param CPOptionId the cp option ID
* @ param key the key
* @ param retrieveFromCache whether to re... | return getPersistence ( ) . fetchByC_K ( CPOptionId , key , retrieveFromCache ) ; |
public class JackrabbitContentRepository { /** * Closes the admin session , and in case of local transient respository for unit test , shuts down the repository and
* cleans all temporary files . */
@ Override protected void destroyRepository ( ) { } } | final RepositoryImpl repository = ( RepositoryImpl ) getRepository ( ) ; repository . shutdown ( ) ; LOG . info ( "Destroyed repository at {}" , repository . getConfig ( ) . getHomeDir ( ) ) ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.