signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class JPAPCtxtInjectionBinding { /** * This transient PersistenceContext annotation class has no default value . * i . e . null is a valid value for some fields . */ private static PersistenceContext newPersistenceContext ( final String fJndiName , final String fUnitName , final int fCtxType , final List < Pro...
return new PersistenceContext ( ) { @ Override public Class < ? extends Annotation > annotationType ( ) { return PersistenceContext . class ; } @ Override public String name ( ) { return fJndiName ; } @ Override public PersistenceProperty [ ] properties ( ) { // TODO not ideal doing this conversion processing here Pers...
public class SpringUtilities { /** * A debugging utility that prints to stdout the component ' s * minimum , preferred , and maximum sizes . */ public static void printSizes ( Component c ) { } }
System . out . println ( "minimumSize = " + c . getMinimumSize ( ) ) ; System . out . println ( "preferredSize = " + c . getPreferredSize ( ) ) ; System . out . println ( "maximumSize = " + c . getMaximumSize ( ) ) ;
public class DOM2DTM { /** * A document type declaration information item has the following properties : * 1 . [ system identifier ] The system identifier of the external subset , if * it exists . Otherwise this property has no value . * @ return the system identifier String object , or null if there is none . */...
Document doc ; if ( m_root . getNodeType ( ) == Node . DOCUMENT_NODE ) doc = ( Document ) m_root ; else doc = m_root . getOwnerDocument ( ) ; if ( null != doc ) { DocumentType dtd = doc . getDoctype ( ) ; if ( null != dtd ) { return dtd . getSystemId ( ) ; } } return null ;
public class EphemerisTileSkin { /** * * * * * * Resizing * * * * * */ @ Override protected void resizeDynamicText ( ) { } }
double fontSize = size * TextSize . SMALL . factor ; Font font = Fonts . latoRegular ( fontSize ) ; blueHourSunriseText . setFont ( font ) ; sunriseText . setFont ( font ) ; goldenHourSunriseText . setFont ( font ) ; goldenHourSunsetText . setFont ( font ) ; sunsetText . setFont ( font ) ; blueHourSunsetText . setFont ...
public class AutomaticScaling { /** * < pre > * Target scaling by network usage . * < / pre > * < code > . google . appengine . v1 . NetworkUtilization network _ utilization = 12 ; < / code > */ public com . google . appengine . v1 . NetworkUtilization getNetworkUtilization ( ) { } }
return networkUtilization_ == null ? com . google . appengine . v1 . NetworkUtilization . getDefaultInstance ( ) : networkUtilization_ ;
public class MainFooterPanel { /** * Left toolbar for alerts */ private JToolBar getToolbarLeft ( ) { } }
if ( footerToolbarLeft == null ) { footerToolbarLeft = new JToolBar ( ) ; footerToolbarLeft . setEnabled ( true ) ; footerToolbarLeft . setFloatable ( false ) ; footerToolbarLeft . setRollover ( true ) ; footerToolbarLeft . setName ( "Footer Toolbar Left" ) ; footerToolbarLeft . setBorder ( BorderFactory . createEmptyB...
public class XsdAnnotationEmitter { /** * Adds the COXB namespace and associated prefixes to the XML schema . */ protected void addNamespaceContext ( ) { } }
NamespaceMap prefixmap = new NamespaceMap ( ) ; NamespacePrefixList npl = getXsd ( ) . getNamespaceContext ( ) ; if ( npl == null ) { /* We get an NPE if we don ' t add this . */ prefixmap . add ( "" , XMLConstants . W3C_XML_SCHEMA_NS_URI ) ; } else { for ( int i = 0 ; i < npl . getDeclaredPrefixes ( ) . length ; i ++ ...
public class FileUtils { public static void writeCompletely ( WritableByteChannel channel , ByteBuffer src ) throws IOException { } }
while ( src . hasRemaining ( ) ) { channel . write ( src ) ; }
public class RootAndNestedDTOResourceGenerator { /** * Creates a collection of DTOs for the provided JPA entity , and any JPA entities referenced in the JPA entity . * @ param entity The JPA entity for which DTOs are to be generated * @ param dtoPackage The Java package in which the DTOs are to be created * @ ret...
DTOCollection dtoCollection = new DTOCollection ( ) ; if ( entity == null ) { throw new IllegalArgumentException ( "The argument entity was null." ) ; } generatedDTOGraphForEntity ( project , entity , dtoPackage , true , false , dtoCollection ) ; return dtoCollection ;
public class Utils4J { /** * Concatenate a path and a filename taking < code > null < / code > and empty string values into account . * @ param path * Path - Can be < code > null < / code > or an empty string . * @ param filename * Filename - Cannot be < code > null < / code > . * @ param separator * Separa...
checkNotNull ( "filename" , filename ) ; checkNotNull ( "separator" , separator ) ; checkNotEmpty ( "separator" , separator ) ; if ( path == null ) { return filename ; } final String trimmedPath = path . trim ( ) ; if ( trimmedPath . length ( ) == 0 ) { return filename ; } final String trimmedFilename = filename . trim...
public class RelationalOperationsMatrix { /** * Invokes the 9 relational predicates of Line vs Line . */ private boolean lineLinePredicates_ ( int half_edge , int id_a , int id_b ) { } }
boolean bRelationKnown = true ; if ( m_perform_predicates [ MatrixPredicate . InteriorInterior ] ) { interiorLineInteriorLine_ ( half_edge , id_a , id_b , m_cluster_index_a , m_cluster_index_b ) ; bRelationKnown &= isPredicateKnown_ ( MatrixPredicate . InteriorInterior ) ; } if ( m_perform_predicates [ MatrixPredicate ...
public class SCM { /** * Get a chance to do operations after the workspace i checked out and the changelog is written . * @ since 1.568 */ public void postCheckout ( @ Nonnull Run < ? , ? > build , @ Nonnull Launcher launcher , @ Nonnull FilePath workspace , @ Nonnull TaskListener listener ) throws IOException , Inte...
if ( build instanceof AbstractBuild && listener instanceof BuildListener ) { postCheckout ( ( AbstractBuild ) build , launcher , workspace , ( BuildListener ) listener ) ; }
public class CloudTraceFormat { /** * Using big - endian encoding . */ private static long spanIdToLong ( SpanId spanId ) { } }
ByteBuffer buffer = ByteBuffer . allocate ( SpanId . SIZE ) ; buffer . put ( spanId . getBytes ( ) ) ; return buffer . getLong ( 0 ) ;
public class URLConnectionRequestPropertiesBuilder { /** * Add provided cookie to ' Cookie ' request property . * @ param cookieName The cookie name * @ param cookieValue The ccokie value * @ return this */ public URLConnectionRequestPropertiesBuilder withCookie ( String cookieName , String cookieValue ) { } }
if ( requestProperties . containsKey ( "Cookie" ) ) { // there are existing cookies so just append the new cookie at the end final String cookies = requestProperties . get ( "Cookie" ) ; requestProperties . put ( "Cookie" , cookies + COOKIES_SEPARATOR + buildCookie ( cookieName , cookieValue ) ) ; } else { // this is t...
public class PropertyProcessor { /** * < p > findAllProperties < / p > * @ param configuration a { @ link com . github . nmorel . gwtjackson . rebind . RebindConfiguration } object . * @ param logger a { @ link com . google . gwt . core . ext . TreeLogger } object . * @ param typeOracle a { @ link com . github . ...
// we first parse the bean to retrieve all the properties ImmutableMap < String , PropertyAccessors > fieldsMap = PropertyParser . findPropertyAccessors ( configuration , logger , beanInfo ) ; // value , any getter and any setter properties PropertyInfo valuePropertyInfo = null ; PropertyInfo anyGetterPropertyInfo = nu...
public class SaveSliceInfoDef { /** * < pre > * Name of the full variable of which this is a slice . * < / pre > * < code > optional string full _ name = 1 ; < / code > */ public java . lang . String getFullName ( ) { } }
java . lang . Object ref = fullName_ ; if ( ref instanceof java . lang . String ) { return ( java . lang . String ) ref ; } else { com . google . protobuf . ByteString bs = ( com . google . protobuf . ByteString ) ref ; java . lang . String s = bs . toStringUtf8 ( ) ; fullName_ = s ; return s ; }
public class ManagerFactoryBean { /** * Get simon manager instance . * If singleton is enabled SimonManager . manager ( ) is invoked else new * Manager is created . * Then callbacks are appended to this manager * @ return Simon manager */ public Manager getObject ( ) throws Exception { } }
Manager manager ; if ( singleton ) { manager = SimonManager . manager ( ) ; } else { manager = new SwitchingManager ( ) ; } registerCallbacks ( manager ) ; configureEnabled ( manager ) ; return manager ;
public class ApiOvhCloud { /** * Migrate your instance to another flavor * REST : POST / cloud / project / { serviceName } / instance / { instanceId } / resize * @ param flavorId [ required ] Flavor id * @ param instanceId [ required ] Instance id * @ param serviceName [ required ] Service name */ public OvhIns...
String qPath = "/cloud/project/{serviceName}/instance/{instanceId}/resize" ; StringBuilder sb = path ( qPath , serviceName , instanceId ) ; HashMap < String , Object > o = new HashMap < String , Object > ( ) ; addBody ( o , "flavorId" , flavorId ) ; String resp = exec ( qPath , "POST" , sb . toString ( ) , o ) ; return...
public class CSSBoxTree { /** * Creates an empty block style definition . * @ return */ protected NodeData createBlockStyle ( ) { } }
NodeData ret = CSSFactory . createNodeData ( ) ; TermFactory tf = CSSFactory . getTermFactory ( ) ; ret . push ( createDeclaration ( "display" , tf . createIdent ( "block" ) ) ) ; return ret ;
public class ClassName { /** * Returns { @ code true } if { @ code name } is < em > syntactically < / em > a * valid binary name . */ @ Ensures ( "result == isQualifiedName(name.replace('/', '.'))" ) public static boolean isBinaryName ( String name ) { } }
if ( name == null || name . isEmpty ( ) ) { return false ; } String [ ] parts = name . split ( "/" ) ; for ( String part : parts ) { if ( ! isSimpleName ( part ) ) { return false ; } } return true ;
public class AbstractPrintQuery { /** * Add an AttributeSet to the PrintQuery . It is used to get editable values * from the eFaps DataBase . * @ param _ setName Name of the AttributeSet to add * @ return this PrintQuery * @ throws EFapsException on error */ public AbstractPrintQuery addAttributeSet ( final Str...
final Type type = getMainType ( ) ; if ( type != null ) { final AttributeSet set = AttributeSet . find ( type . getName ( ) , _setName ) ; addAttributeSet ( set ) ; } return this ;
public class DigitalOceanClient { @ Override public Regions getAvailableRegions ( Integer pageNo ) throws DigitalOceanException , RequestUnsuccessfulException { } }
validatePageNo ( pageNo ) ; return ( Regions ) perform ( new ApiRequest ( ApiAction . AVAILABLE_REGIONS , pageNo , DEFAULT_PAGE_SIZE ) ) . getData ( ) ;
public class NodeWrapper { /** * { @ inheritDoc } */ @ Override public NodeInfo getParent ( ) { } }
try { NodeInfo parent = null ; final INodeReadTrx rtx = createRtxAndMove ( ) ; if ( rtx . getNode ( ) . hasParent ( ) ) { // Parent transaction . parent = new NodeWrapper ( mDocWrapper , rtx . getNode ( ) . getParentKey ( ) ) ; } rtx . close ( ) ; return parent ; } catch ( final TTException exc ) { LOGGER . error ( exc...
public class PageFlowUtils { /** * Make a set of form beans available as attributets in the request / session ( as appropriate ) . * @ param mapping the ActionMapping for the current Struts action being processed . * @ param outputForms an array of ActionForm instances to be made available in the * request / sess...
try { // Now set any output forms in the request or session , as appropriate . assert mapping . getScope ( ) == null || mapping . getScope ( ) . equals ( "request" ) || mapping . getScope ( ) . equals ( "session" ) : mapping . getScope ( ) ; for ( int i = 0 ; i < outputForms . length ; ++ i ) { setOutputForm ( mapping ...
public class Operations { /** * Reads the result of an operation and returns the result . If the operation does not have a { @ link * ClientConstants # RESULT } attribute , a new undefined { @ link org . jboss . dmr . ModelNode } is returned . * @ param result the result of executing an operation * @ return the r...
return ( result . hasDefined ( RESULT ) ? result . get ( RESULT ) : new ModelNode ( ) ) ;
public class Configurer { /** * Loads and merges application configuration with default properties . * @ param confname - optional configuration filename * @ param rootPath - only load configuration properties underneath this path that this code * module owns and understands * @ return Configuration loaded from...
// load configuration properties Config config ; final String confname2 = trimToNull ( confname ) ; if ( confname2 != null ) { final ConfigParseOptions options = ConfigParseOptions . defaults ( ) . setAllowMissing ( false ) ; final Config customConfig = ConfigFactory . parseFileAnySyntax ( new File ( confname2 ) , opti...
public class BatchGetDeploymentGroupsRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( BatchGetDeploymentGroupsRequest batchGetDeploymentGroupsRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( batchGetDeploymentGroupsRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( batchGetDeploymentGroupsRequest . getApplicationName ( ) , APPLICATIONNAME_BINDING ) ; protocolMarshaller . marshall ( batchGetDeploymentGroupsRequest . ...
public class RelativeTimeframe { /** * Construct the Timeframe map to send in the query . * @ return the Timeframe Json map to send in the query . */ @ Override public Map < String , Object > constructTimeframeArgs ( ) { } }
Map < String , Object > timeframe = new HashMap < String , Object > ( 3 ) ; if ( null != this . relativeTimeframe ) { timeframe . put ( KeenQueryConstants . TIMEFRAME , this . relativeTimeframe ) ; } if ( null != this . timezone ) { timeframe . put ( KeenQueryConstants . TIMEZONE , this . timezone ) ; } return timefram...
public class CommonsLogger { /** * Delegates to the { @ link Log # debug ( Object ) } method of the underlying * { @ link Log } instance . * However , this form avoids superfluous object creation when the logger is disabled * for level DEBUG . * @ param format * the format string * @ param arg * the argum...
if ( logger . isDebugEnabled ( ) ) { FormattingTuple ft = MessageFormatter . format ( format , arg ) ; logger . debug ( ft . getMessage ( ) , ft . getThrowable ( ) ) ; }
public class NameUtils { /** * Tries to convert < code > string < / code > to a Java class name by following * a few simple steps : * < ul > * < li > First of all , < code > string < / code > gets < i > camel cased < / i > , the * usual Java class naming convention . * < li > Secondly , any whitespace , by vi...
if ( StringUtil . isEmpty ( s ) || s . contains ( "." ) ) return s ; return removeNonJavaIdentifierCharacters ( removeDiacritics ( toUpperCamelCase ( s ) ) ) ;
public class GHEventsSubscriber { /** * Should return true only if this subscriber interested in { @ link # events ( ) } set for this project * Don ' t call it directly , use { @ link # isApplicableFor } static function * @ param project to check * @ return { @ code true } to provide events to register and subscr...
if ( checkIsApplicableItem ( ) ) { return isApplicable ( ( Item ) project ) ; } // a legacy implementation which should not have been calling super . isApplicable ( Job ) throw new AbstractMethodError ( "you must override the new overload of isApplicable" ) ;
public class SemanticAPI { /** * 微信翻译 * @ param accessToken 接口调用凭证 * @ param lfrom 源语言 , zh _ CN 或 en _ US * @ param lto 目标语言 , zh _ CN 或 en _ US * @ param content 源内容放body里或者上传文件的形式 ( utf8格式 , 最大600Byte ) * @ return TranslatecontentResult * @ since 2.8.22 */ public static TranslatecontentResult translateco...
HttpPost httpPost = new HttpPost ( BASE_URI + "/cgi-bin/media/voice/translatecontent" ) ; byte [ ] data ; try { data = content . getBytes ( "UTF-8" ) ; } catch ( IOException e ) { logger . error ( "" , e ) ; throw new RuntimeException ( e ) ; } HttpEntity reqEntity = MultipartEntityBuilder . create ( ) . addBinaryBody ...
public class MPD9DatabaseReader { /** * Process a single outline code . * @ param parentRow outline code to task mapping table * @ throws SQLException */ private void processOutlineCodeFields ( Row parentRow ) throws SQLException { } }
Integer entityID = parentRow . getInteger ( "CODE_REF_UID" ) ; Integer outlineCodeEntityID = parentRow . getInteger ( "CODE_UID" ) ; for ( ResultSetRow row : getRows ( "SELECT * FROM MSP_OUTLINE_CODES WHERE CODE_UID=?" , outlineCodeEntityID ) ) { processOutlineCodeField ( entityID , row ) ; }
public class GroupLayout { /** * Computes dimensions of the children widgets that are useful for the * group layout managers . */ protected DimenInfo computeDimens ( Container parent , int type ) { } }
int count = parent . getComponentCount ( ) ; DimenInfo info = new DimenInfo ( ) ; info . dimens = new Dimension [ count ] ; for ( int i = 0 ; i < count ; i ++ ) { Component child = parent . getComponent ( i ) ; if ( ! child . isVisible ( ) ) { continue ; } Dimension csize ; switch ( type ) { case MINIMUM : csize = chil...
public class AbstractGauge { /** * Sets the state of the user led . * The led could blink which will be triggered by a javax . swing . Timer * that triggers every 500 ms . The blinking will be done by switching * between two images . * @ param USER _ LED _ BLINKING */ public void setUserLedBlinking ( final bool...
this . userLedBlinking = USER_LED_BLINKING ; if ( USER_LED_BLINKING ) { USER_LED_BLINKING_TIMER . start ( ) ; } else { setCurrentUserLedImage ( getUserLedImageOff ( ) ) ; USER_LED_BLINKING_TIMER . stop ( ) ; }
public class DeleteBatchPredictionRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DeleteBatchPredictionRequest deleteBatchPredictionRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( deleteBatchPredictionRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( deleteBatchPredictionRequest . getBatchPredictionId ( ) , BATCHPREDICTIONID_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to ...
public class AmazonDirectConnectClient { /** * Deprecated . Use < a > AllocateHostedConnection < / a > instead . * Creates a hosted connection on an interconnect . * Allocates a VLAN number and a specified amount of bandwidth for use by a hosted connection on the specified * interconnect . * < note > * Intend...
request = beforeClientExecution ( request ) ; return executeAllocateConnectionOnInterconnect ( request ) ;
public class VRPResourceManager { /** * Undeploy a VM in given VRP , hub pair . * @ param vrpId The unique Id of the VRP . * @ param vm VirtualMachine * @ param cluster Cluster Object * @ throws InvalidState * @ throws NotFound * @ throws RuntimeFault * @ throws RemoteException */ public void undeployVM (...
getVimService ( ) . undeployVM ( getMOR ( ) , vrpId , vm . getMOR ( ) , cluster . getMOR ( ) ) ;
public class FisExporter { /** * Returns a string representation for the Rule in the Fuzzy Inference System * format * @ param rule is the rule * @ param engine is the engine in which the rule is registered * @ return a string representation for the rule in the Fuzzy Inference System * format */ public String...
List < Proposition > propositions = new ArrayList < Proposition > ( ) ; List < Operator > operators = new ArrayList < Operator > ( ) ; Deque < Expression > queue = new ArrayDeque < Expression > ( ) ; queue . offer ( rule . getAntecedent ( ) . getExpression ( ) ) ; while ( ! queue . isEmpty ( ) ) { Expression front = qu...
public class DisassociateS3ResourcesRequest { /** * The S3 resources ( buckets or prefixes ) that you want to remove from being monitored and classified by Amazon * Macie . * @ param associatedS3Resources * The S3 resources ( buckets or prefixes ) that you want to remove from being monitored and classified by *...
if ( associatedS3Resources == null ) { this . associatedS3Resources = null ; return ; } this . associatedS3Resources = new java . util . ArrayList < S3Resource > ( associatedS3Resources ) ;
public class LinkedList { /** * Retrieves , but does not remove , the last element of this list , * or returns { @ code null } if this list is empty . * @ return the last element of this list , or { @ code null } * if this list is empty * @ since 1.6 */ public E peekLast ( ) { } }
final Node < E > l = last ; return ( l == null ) ? null : l . item ;
public class HELM2NotationUtils { /** * method to get all peptide polymers given a list of PolymerNotation objects * @ param polymers List of PolymerNotation objects * @ return list of peptide polymers */ public final static List < PolymerNotation > getPeptidePolymers ( List < PolymerNotation > polymers ) { } }
List < PolymerNotation > peptidePolymers = new ArrayList < PolymerNotation > ( ) ; for ( PolymerNotation polymer : polymers ) { if ( polymer . getPolymerID ( ) instanceof PeptideEntity ) { peptidePolymers . add ( polymer ) ; } } return peptidePolymers ;
public class ConcurrentHashMultiset { /** * Adds or removes occurrences of { @ code element } such that the { @ link # count } of the * element becomes { @ code count } . * @ return the count of { @ code element } in the multiset before this call * @ throws IllegalArgumentException if { @ code count } is negative...
checkNotNull ( element ) ; checkNonnegative ( count , "count" ) ; while ( true ) { AtomicInteger existingCounter = Maps . safeGet ( countMap , element ) ; if ( existingCounter == null ) { if ( count == 0 ) { return 0 ; } else { existingCounter = countMap . putIfAbsent ( element , new AtomicInteger ( count ) ) ; if ( ex...
public class AVMixPushManager { /** * 打开 / 关闭通知栏消息 * Turn on / off notification bar messages * @ param enable 打开 / 关闭 ( 默认为打开 ) * Turn ON / off */ public static void setHMSReceiveNotifyMsg ( final boolean enable ) { } }
com . huawei . android . hms . agent . HMSAgent . Push . enableReceiveNotifyMsg ( enable , new com . huawei . android . hms . agent . push . handler . EnableReceiveNotifyMsgHandler ( ) { @ Override public void onResult ( int rst ) { LOGGER . d ( "[HMS] enableReceiveNotifyMsg(flag=" + enable + ") returnCode=" + rst ) ; ...
public class IfmapJ { /** * Create a new { @ link SSRC } object to operate on the given url * using basic authentication . * @ param url * the URL to connect to * @ param user * basic authentication user * @ param pass * basic authentication password * @ param tms * TrustManager instances to initializ...
return new SsrcImpl ( url , user , pass , tms , 120 * 1000 ) ;
public class ScriptableObject { /** * If hasProperty ( obj , name ) would return true , then if the property that * was found is compatible with the new property , this method just returns . * If the property is not compatible , then an exception is thrown . * A property redefinition is incompatible if the first ...
Scriptable base = getBase ( obj , name ) ; if ( base == null ) return ; if ( base instanceof ConstProperties ) { ConstProperties cp = ( ConstProperties ) base ; if ( cp . isConst ( name ) ) throw ScriptRuntime . typeError1 ( "msg.const.redecl" , name ) ; } if ( isConst ) throw ScriptRuntime . typeError1 ( "msg.var.rede...
public class VoiceApi { /** * Attach user data to a call * Attach the provided data to the specified call . This adds the data to the call even if data already exists with the provided keys . * @ param id The connection ID of the call . ( required ) * @ param userData The data to attach to the call . This is an a...
com . squareup . okhttp . Call call = attachUserDataValidateBeforeCall ( id , userData , null , null ) ; Type localVarReturnType = new TypeToken < ApiSuccessResponse > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ;
public class JSON { /** * Parses JSON data from a file . * The character set of the file is auto - detected . * The file will be opened 2 times ( once for detecting the character set , and once * for the actual parsing ) * @ param file the file to read the data from * @ return the parsed JSON Value . * @ th...
InputStream input = null ; try { byte [ ] header = new byte [ 4 ] ; // Guess charset input = new FileInputStream ( file ) ; input . read ( header ) ; Charset charset ; if ( header [ 0 ] == 0 ) { charset = ( header [ 1 ] == 0 ? UTF32BE : UTF16BE ) ; } else if ( header [ 1 ] == 0 ) { charset = ( header [ 2 ] == 0 ? UTF32...
public class GraphiteEventReporter { /** * Non - numeric event values may be emitted as part of the key by applying them to the end of the key if * { @ link ConfigurationKeys # METRICS _ REPORTING _ GRAPHITE _ EVENTS _ VALUE _ AS _ KEY } is set . Thus such events can be still * reported even when the backend doesn ...
return emitValueAsKey && ( field . equals ( TaskEvent . METADATA_TASK_WORKING_STATE ) || field . equals ( JobEvent . METADATA_JOB_STATE ) ) ;
public class JspHelper { /** * Get an array of nodes that can serve the streaming request * The best one is the first in the array which has maximum * local copies of all blocks */ public DatanodeInfo [ ] bestNode ( LocatedBlocks blks ) throws IOException { } }
// insert all known replica locations into a tree map where the // key is the DatanodeInfo TreeMap < DatanodeInfo , NodeRecord > map = new TreeMap < DatanodeInfo , NodeRecord > ( ) ; for ( int i = 0 ; i < blks . getLocatedBlocks ( ) . size ( ) ; i ++ ) { DatanodeInfo [ ] nodes = blks . get ( i ) . getLocations ( ) ; fo...
public class XmlEntity { /** * Parses content from given reader input stream and namespace dictionary . */ protected void parseXml ( Reader reader , XmlNamespaceDictionary namespaceDictionary ) throws IOException , XmlPullParserException { } }
this . xmlPullParser . setInput ( reader ) ; Xml . parseElement ( this . xmlPullParser , this , namespaceDictionary , null ) ;
public class Iterate { /** * Return the specified collection as a sorted List . */ public static < T extends Comparable < ? super T > > MutableList < T > toSortedList ( Iterable < T > iterable ) { } }
return Iterate . toSortedList ( iterable , Comparators . naturalOrder ( ) ) ;
public class StreamGraphGenerator { /** * Determines the slot sharing group for an operation based on the slot sharing group set by * the user and the slot sharing groups of the inputs . * < p > If the user specifies a group name , this is taken as is . If nothing is specified and * the input operations all have ...
if ( specifiedGroup != null ) { return specifiedGroup ; } else { String inputGroup = null ; for ( int id : inputIds ) { String inputGroupCandidate = streamGraph . getSlotSharingGroup ( id ) ; if ( inputGroup == null ) { inputGroup = inputGroupCandidate ; } else if ( ! inputGroup . equals ( inputGroupCandidate ) ) { ret...
public class RestUtils { /** * Returns the query parameter values . * @ param param a parameter name * @ param ctx ctx * @ return a list of values */ public static List < String > queryParams ( String param , ContainerRequestContext ctx ) { } }
return ctx . getUriInfo ( ) . getQueryParameters ( ) . get ( param ) ;
public class PippoSettings { /** * Returns the float value for the specified name . If the name does not * exist or the value for the name can not be interpreted as a float , the * defaultValue is returned . * @ param name * @ param defaultValue * @ return name value or defaultValue */ public float getFloat (...
try { String value = getString ( name , null ) ; if ( ! StringUtils . isNullOrEmpty ( value ) ) { return Float . parseFloat ( value . trim ( ) ) ; } } catch ( NumberFormatException e ) { log . warn ( "Failed to parse float for " + name + USING_DEFAULT_OF + defaultValue ) ; } return defaultValue ;
public class DoublesPmfCdfImpl { /** * Shared algorithm for both PMF and CDF functions . The splitPoints must be unique , monotonically * increasing values . * @ param sketch the given quantiles DoublesSketch * @ param splitPoints an array of < i > m < / i > unique , monotonically increasing doubles * that divi...
final DoublesSketchAccessor sketchAccessor = DoublesSketchAccessor . wrap ( sketch ) ; Util . checkSplitPointsOrder ( splitPoints ) ; final int numSplitPoints = splitPoints . length ; final int numCounters = numSplitPoints + 1 ; final double [ ] counters = new double [ numCounters ] ; long weight = 1 ; sketchAccessor ....
public class Convertor { /** * Converts a { @ link Resource } object into the matching { @ link Order } . * @ param rdfOrder Resource for which the matching { @ link Order } should be given . * @ return the matching { @ link Order } . */ public static Order resource2Order ( Resource rdfOrder ) { } }
if ( rdfOrder . equals ( CDK . SINGLEBOND ) ) { return Order . SINGLE ; } else if ( rdfOrder . equals ( CDK . DOUBLEBOND ) ) { return Order . DOUBLE ; } else if ( rdfOrder . equals ( CDK . TRIPLEBOND ) ) { return Order . TRIPLE ; } else if ( rdfOrder . equals ( CDK . QUADRUPLEBOND ) ) { return Order . QUADRUPLE ; } ret...
public class MapDotApi { /** * Get string value by path . * @ param map subject * @ param pathString nodes to walk in map * @ return value */ public static Optional < String > dotGetString ( final Map map , final String pathString ) { } }
return dotGet ( map , String . class , pathString ) ;
public class PolicyUtils { /** * Build the default Event Bridge Policies . * @ param accountSid account sid * @ param channelId channel id * @ return generated Policies */ public static List < Policy > defaultEventBridgePolicies ( String accountSid , String channelId ) { } }
String url = Joiner . on ( '/' ) . join ( TASKROUTER_EVENT_URL , accountSid , channelId ) ; Policy get = new Policy . Builder ( ) . url ( url ) . method ( HttpMethod . GET ) . allowed ( true ) . build ( ) ; Policy post = new Policy . Builder ( ) . url ( url ) . method ( HttpMethod . POST ) . allowed ( true ) . build ( ...
public class CommerceRegionLocalServiceUtil { /** * Updates the commerce region in the database or adds it if it does not yet exist . Also notifies the appropriate model listeners . * @ param commerceRegion the commerce region * @ return the commerce region that was updated */ public static com . liferay . commerce...
return getService ( ) . updateCommerceRegion ( commerceRegion ) ;
public class EntryUtils { /** * Returns the day given a string in format dd - MMM - yyyy . */ public static Date getDay ( String string ) { } }
if ( string == null ) { return null ; } Date date = null ; try { date = ( new SimpleDateFormat ( "dd-MMM-yyyy" ) . parse ( string ) ) ; } catch ( ParseException ex ) { return null ; } return date ;
public class BusJacksonAutoConfiguration { /** * otherwise RemoteApplicationEventRegistrar will register the bean */ @ Bean @ ConditionalOnMissingBean ( name = "busJsonConverter" ) @ StreamMessageConverter public AbstractMessageConverter busJsonConverter ( @ Autowired ( required = false ) ObjectMapper objectMapper ) { ...
return new BusJacksonMessageConverter ( objectMapper ) ;
public class StringUtil { /** * string keys are converted from camel style to underline style . a new map is returned , the original map is not changed . */ public static Map < String , Object > camelToUnderline ( Map < String , Object > map ) { } }
Map < String , Object > newMap = new HashMap < > ( ) ; for ( String key : map . keySet ( ) ) { newMap . put ( camelToUnderline ( key ) , map . get ( key ) ) ; } return newMap ;
public class Logger { /** * Sets the log level . Only log messages with a rank greater or equal than the rank of the * currently applied log level , are written to the output . * @ param logLevel * The log level , which should be set , as a value of the enum { @ link LogLevel } . The log * level may not be null...
Condition . INSTANCE . ensureNotNull ( logLevel , "The log level may not be null" ) ; this . logLevel = logLevel ;
public class IotHubResourcesInner { /** * Get the health for routing endpoints . * Get the health for routing endpoints . * @ param resourceGroupName the String value * @ param iotHubName the String value * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to...
return getEndpointHealthWithServiceResponseAsync ( resourceGroupName , iotHubName ) . map ( new Func1 < ServiceResponse < Page < EndpointHealthDataInner > > , Page < EndpointHealthDataInner > > ( ) { @ Override public Page < EndpointHealthDataInner > call ( ServiceResponse < Page < EndpointHealthDataInner > > response ...
public class UrlSyntaxProviderImpl { /** * Add the provided portlet url builder data to the url string builder */ protected void addPortletUrlData ( final HttpServletRequest request , final UrlStringBuilder url , final UrlType urlType , final IPortletUrlBuilder portletUrlBuilder , final IPortletWindowId targetedPortlet...
final IPortletWindowId portletWindowId = portletUrlBuilder . getPortletWindowId ( ) ; final boolean targeted = portletWindowId . equals ( targetedPortletWindowId ) ; IPortletWindow portletWindow = null ; // The targeted portlet doesn ' t need namespaced parameters final String prefixedPortletWindowId ; final String suf...
public class TraceNLSResolver { /** * Like { @ link # getResourceBundle ( Class , String , List ) } , but takes a single * Locale . * @ see # getResourceBundle ( Class , String , List ) */ public ResourceBundle getResourceBundle ( Class < ? > aClass , String bundleName , Locale locale ) { } }
return getResourceBundle ( aClass , bundleName , ( locale == null ) ? null : Collections . singletonList ( locale ) ) ;
public class PluginMessageDescription { /** * Create a description for an CompareCondition object . * It supports Condition . context properties : * - " description " : Description of the dataId used for this condition , if not present , description will use * dataId literal * i . e . " description " : " Respon...
String description ; if ( condition . getContext ( ) != null && condition . getContext ( ) . get ( CONTEXT_PROPERTY_DESCRIPTION ) != null ) { description = condition . getContext ( ) . get ( CONTEXT_PROPERTY_DESCRIPTION ) ; } else { description = condition . getDataId ( ) ; } CompareCondition . Operator operator = cond...
public class ExtensibleArray { private final T get ( int index , List < T > array ) { } }
while ( index >= array . size ( ) ) { array . add ( this . createNode ( ) ) ; } return array . get ( index ) ;
public class TunnelRequestService { /** * Notifies bound listeners that a new tunnel has been connected . * Listeners may veto a connected tunnel by throwing any GuacamoleException . * @ param authenticatedUser * The AuthenticatedUser associated with the user for whom the tunnel * is being created . * @ param...
listenerService . handleEvent ( new TunnelConnectEvent ( authenticatedUser , credentials , tunnel ) ) ;
public class AttachedRemoteSubscriberIterator { /** * / * ( non - Javadoc ) * @ see java . util . Iterator # remove ( ) */ public void remove ( ) { } }
if ( tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "remove" ) ; if ( anycastIHIterator != null ) { anycastIHIterator . remove ( ) ; } if ( tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "remove" ) ;
public class ThriftClientFactory { /** * Gets the connection . * @ param pool the pool * @ return the connection */ Connection getConnection ( ConnectionPool pool ) { } }
ConnectionPool connectionPool = pool ; boolean success = false ; while ( ! success ) { try { success = true ; Cassandra . Client client = connectionPool . getConnection ( ) ; if ( logger . isDebugEnabled ( ) ) { logger . debug ( "Returning connection of {} :{} ." , pool . getPoolProperties ( ) . getHost ( ) , pool . ge...
public class SAMFileMerger { /** * Terminate the aggregated output stream with an appropriate SAMOutputFormat - dependent terminator block */ private static void writeTerminatorBlock ( final OutputStream out , final SAMFormat samOutputFormat ) throws IOException { } }
if ( SAMFormat . CRAM == samOutputFormat ) { CramIO . issueEOF ( CramVersions . DEFAULT_CRAM_VERSION , out ) ; // terminate with CRAM EOF container } else if ( SAMFormat . BAM == samOutputFormat ) { out . write ( BlockCompressedStreamConstants . EMPTY_GZIP_BLOCK ) ; // add the BGZF terminator } // no terminator for SAM
public class Tree { /** * Sets this node ' s type and converts the value into the specified type . * @ param type * new type * @ return this node */ public Tree setType ( Class < ? > type ) { } }
if ( value == null || value . getClass ( ) == type ) { return this ; } value = DataConverterRegistry . convert ( type , value ) ; if ( parent != null && key != null ) { if ( key instanceof String ) { parent . putObjectInternal ( ( String ) key , value , false ) ; } else { parent . remove ( ( int ) key ) ; parent . inse...
public class SequenceUtil { /** * Reads fasta sequences from inStream into the list of FastaSequence * objects * @ param inStream * from * @ return list of FastaSequence objects * @ throws IOException */ public static List < FastaSequence > readFasta ( final InputStream inStream ) throws IOException { } }
final List < FastaSequence > seqs = new ArrayList < FastaSequence > ( ) ; final BufferedReader infasta = new BufferedReader ( new InputStreamReader ( inStream , "UTF8" ) , 16000 ) ; final Pattern pattern = Pattern . compile ( "//s+" ) ; String line ; String sname = "" , seqstr = null ; do { line = infasta . readLine ( ...
public class SDRandom { /** * Generate a new random SDVariable , where values are randomly sampled according to a Bernoulli distribution , * with the specified probability . Array values will have value 1 with probability P and value 0 with probability * 1 - P . < br > * See { @ link # bernoulli ( String , double...
SDVariable ret = f ( ) . randomBernoulli ( p , shape ) ; return updateVariableNameAndReference ( ret , name ) ;
public class RpcNettyClient { /** * 当连接废弃时 , 需要将缓存map中的那个废弃连接释放掉 , 此操作是并发安全的 */ static void removeClosedChannel ( String nodeId ) { } }
if ( lock . tryLock ( ) ) { try { nodeId_to_connectedChannel_map . remove ( nodeId ) ; LOG . info ( String . format ( "RpcClient:与%s的空闲长连接缓存释放完毕..." , nodeId ) ) ; } finally { lock . unlock ( ) ; } } else { LOG . info ( String . format ( "RpcClient删除缓存的与%s的废弃的连接:已经有新连接正在建立,那么这里不做操作,由新建连接的线程去覆盖掉缓存中的废弃连接" , nodeId ) ) ; ...
public class CmsFlexBucketConfiguration { /** * Returns true if for the given publish list , the complete Flex cache should be cleared based on this configuration . < p > * @ param publishedResources a publish list * @ return true if the complete Flex cache should be cleared */ public boolean shouldClearAll ( List ...
for ( CmsPublishedResource pubRes : publishedResources ) { for ( String clearPath : m_clearAll ) { if ( CmsStringUtil . isPrefixPath ( clearPath , pubRes . getRootPath ( ) ) ) { return true ; } } } return false ;
public class DeviceHelper { /** * Gets device mac address . * @ param context App context . * @ return Device mac address . */ private static String getMacAddress ( @ NonNull Context context ) { } }
if ( isWifiStatePermissionGranted ( context ) ) { WifiManager wifiManager = ( WifiManager ) context . getApplicationContext ( ) . getSystemService ( Context . WIFI_SERVICE ) ; if ( wifiManager != null ) { WifiInfo wifiInfo = wifiManager . getConnectionInfo ( ) ; if ( wifiInfo != null ) { return wifiInfo . getMacAddress...
public class AmazonAppStreamClient { /** * Retrieves a list that describes one or more specified Directory Config objects for AppStream 2.0 , if the names * for these objects are provided . Otherwise , all Directory Config objects in the account are described . These * objects include the information required to jo...
request = beforeClientExecution ( request ) ; return executeDescribeDirectoryConfigs ( request ) ;
public class TreeMultiMap { /** * { @ inheritDoc } */ public boolean putMany ( K key , Collection < V > values ) { } }
// Short circuit when adding empty values to avoid adding a key with an // empty mapping if ( values . isEmpty ( ) ) return false ; Set < V > vals = map . get ( key ) ; if ( vals == null ) { vals = new HashSet < V > ( ) ; map . put ( key , vals ) ; } int oldSize = vals . size ( ) ; boolean added = vals . addAll ( value...
public class AbstractComponent { /** * Notify all the listeners . */ protected void notifyListeners ( ) { } }
Iterator it = listeners . iterator ( ) ; while ( it . hasNext ( ) ) { ( ( ComponentListener ) it . next ( ) ) . componentActivated ( this ) ; }
public class NTLMUtilities { /** * Extracts the target information block from the type 2 message . * @ param msg the type 2 message byte array * @ param msgFlags the flags if null then flags are extracted from the * type 2 message * @ return the target info */ public static byte [ ] extractTargetInfoFromType2Me...
int flags = msgFlags == null ? extractFlagsFromType2Message ( msg ) : msgFlags ; if ( ! ByteUtilities . isFlagSet ( flags , FLAG_NEGOTIATE_TARGET_INFO ) ) return null ; int pos = 40 ; // isFlagSet ( flags , FLAG _ NEGOTIATE _ LOCAL _ CALL ) ? 40 : 32; return readSecurityBufferTarget ( msg , pos ) ;
public class JsonGenerator { /** * Convenience method for outputting a field entry ( " member " ) * that has a boolean value . Equivalent to : * < pre > * writeFieldName ( fieldName ) ; * writeBoolean ( value ) ; * < / pre > */ public final void writeBooleanField ( String fieldName , boolean value ) throws IO...
writeFieldName ( fieldName ) ; writeBoolean ( value ) ;
public class LifecycleInjector { /** * This is a shortcut to configuring the LifecycleInjectorBuilder using annotations . * Using bootstrap a main application class can simply be annotated with * custom annotations that are mapped to { @ link BootstrapModule } s . * Each annotations can then map to a subsystem or...
final LifecycleInjectorBuilder builder = LifecycleInjector . builder ( ) ; // Create a temporary Guice injector for the purpose of constructing the list of // BootstrapModules which can inject any of the bootstrap annotations as well as // the externally provided bindings . // Creation order , // 1 . Construct all Boot...
public class MalformedTypeException { /** * Returns first message , prefixed with the malformed type . */ @ Override public String getMessage ( ) { } }
String message = super . getMessage ( ) ; if ( mType != null ) { message = mType . getName ( ) + ": " + message ; } return message ;
public class Sql { /** * Performs the given SQL query and return the rows of the result set . * In addition , the < code > metaClosure < / code > will be called once passing in the * < code > ResultSetMetaData < / code > as argument . * Example usage : * < pre > * def printNumCols = { meta { @ code - > } prin...
return rows ( sql , 0 , 0 , metaClosure ) ;
public class CronUtils { /** * Converts repeating segments from " short " Quartz form to " extended " * SauronSoftware form . For example & quot ; 0/5 & quot ; will be converted to * & quot ; 0-59/5 & quot ; , & quot ; / 3 & quot ; will be converted to & quot ; * & # 47;3 & quot ; * @ param eSource item * @ par...
String [ ] parts = e . split ( "," ) ; for ( int i = 0 ; i < parts . length ; ++ i ) { if ( parts [ i ] . indexOf ( '-' ) == - 1 && parts [ i ] . indexOf ( '*' ) == - 1 ) { int indSlash = parts [ i ] . indexOf ( '/' ) ; if ( indSlash == 0 ) { parts [ i ] = "*" + parts [ i ] ; } else if ( indSlash > 0 ) { parts [ i ] = ...
public class ConsonantUtil { /** * * * * * * BEGINNING OF FUNCTION * * * * * */ / * / public static boolean is_ashanta ( String str ) { } }
String s1 = VarnaUtil . getAntyaVarna ( str ) ; if ( is_ash ( s1 ) ) return true ; return false ;
public class JsCodeBuilder { /** * Serializes the given { @ link JsDoc } into the code builder , respecting the code builder ' s current * indentation level . */ public JsCodeBuilder append ( JsDoc jsDoc ) { } }
jsDoc . collectRequires ( requireCollector ) ; return appendLine ( jsDoc . toString ( ) ) ;
public class CoalescedWriteBehindQueue { /** * If this is an existing key in this queue , use previously set store time ; * since we do not want to shift store time of an existing key on every update . */ private void calculateStoreTime ( DelayedEntry delayedEntry ) { } }
Data key = ( Data ) delayedEntry . getKey ( ) ; DelayedEntry currentEntry = map . get ( key ) ; if ( currentEntry != null ) { long currentStoreTime = currentEntry . getStoreTime ( ) ; delayedEntry . setStoreTime ( currentStoreTime ) ; }
public class ListResourcesRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( ListResourcesRequest listResourcesRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( listResourcesRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( listResourcesRequest . getOrganizationId ( ) , ORGANIZATIONID_BINDING ) ; protocolMarshaller . marshall ( listResourcesRequest . getNextToken ( ) , NEXTTOKEN_BINDIN...
public class DividerAdapterBuilder { /** * Sets the divider that appears between all of the wrapped adapters items . */ @ NonNull public DividerAdapterBuilder innerView ( @ NonNull ViewFactory viewFactory ) { } }
mInnerItem = new Item ( checkNotNull ( viewFactory , "viewFactory" ) , false ) ; return this ;
public class GrowQueue_I8 { /** * Removes elements from the list starting at ' first ' and ending at ' last ' * @ param first First index you wish to remove . Inclusive . * @ param last Last index you wish to remove . Inclusive . */ public void remove ( int first , int last ) { } }
if ( last < first ) throw new IllegalArgumentException ( "first <= last" ) ; if ( last >= size ) throw new IllegalArgumentException ( "last must be less than the max size" ) ; int delta = last - first + 1 ; for ( int i = last + 1 ; i < size ; i ++ ) { data [ i - delta ] = data [ i ] ; } size -= delta ;
public class DependencyResolver { /** * Creates an instance of the resolver . * @ param elements * The elements to resolve . * @ param dependencyProvider * The dependency provider . * @ param < T > * The element type . * @ return The resolver . */ public static < T > DependencyResolver < T > newInstance (...
return new DependencyResolver < T > ( elements , dependencyProvider ) ;
public class CompositeQuery { /** * Validate as rule body , Ensure : * - no negation nesting * - no disjunctions * - at most single negation block * @ param graph transaction to be validated against * @ param pattern pattern to be validated * @ return set of error messages applicable */ public static Set < ...
Set < String > errors = new HashSet < > ( ) ; try { CompositeQuery body = ReasonerQueries . composite ( pattern , graph ) ; Set < ResolvableQuery > complementQueries = body . getComplementQueries ( ) ; if ( complementQueries . size ( ) > 1 ) { errors . add ( ErrorMessage . VALIDATION_RULE_MULTIPLE_NEGATION_BLOCKS . get...
public class TriggerBuilder { /** * Produce the < code > OperableTrigger < / code > . * @ return a OperableTrigger that meets the specifications of the builder . */ public OperableTrigger build ( ) { } }
// if ( scheduleBuilder = = null ) { // scheduleBuilder = SimpleScheduleBuilder . simpleScheduleBuilder ( ) ; // get a trigger impl . but without the meta data filled in yet // OperableTrigger operableTrigger = operableTrigger ; operableTrigger = instantiate ( ) ; // fill in metadata operableTrigger . setCalendarName (...
public class RevisionUtils { /** * For a given article revision , the method returns the revision of the article discussion * page which was current at the time the revision was created . * @ param revisionId revision of the article for which the talk page revision should be retrieved * @ return the revision of t...
// get article revision Revision rev = revApi . getRevision ( revisionId ) ; Timestamp revTime = rev . getTimeStamp ( ) ; // get corresponding discussion page Page discussion = wiki . getDiscussionPage ( rev . getArticleID ( ) ) ; /* * find correct revision of discussion page */ List < Timestamp > discussionTs = revApi...
public class FileUtils { /** * Metodo encargado de limpiar la estructura de directorios temporales . Esta * metodo va borrando del currentPathDir hasta el basePathFile siempre que * los directorios esten vacios . * Ej : currentPathFile = / export / share - images / 2009/03/12 / LOCAL Ej : * basePathFile = / exp...
if ( currentPathFile == null ) { log . warn ( "El path inicial es nulo" ) ; return ; } if ( basePathFile == null ) { log . warn ( "El path final es nulo" ) ; return ; } try { if ( ! basePathFile . equals ( currentPathFile ) ) { if ( currentPathFile . isDirectory ( ) && currentPathFile . list ( ) . length == 0 ) { if ( ...
public class NullArgumentException { /** * Validates that the string is not null and not an empty string without trimming the string . * @ param stringToCheck The object to be tested . * @ param argumentName The name of the object , which is used to construct the exception message . * @ throws NullArgumentExcepti...
validateNotEmpty ( stringToCheck , false , argumentName ) ;