signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class THttpService { /** * Creates a new multiplexed { @ link THttpService } with the specified service implementations , supporting * only the formats specified and defaulting to the specified { @ code defaultSerializationFormat } when the * client doesn ' t specify one . * < p > Currently , the only way ...
requireNonNull ( otherAllowedSerializationFormats , "otherAllowedSerializationFormats" ) ; return ofFormats ( implementations , defaultSerializationFormat , Arrays . asList ( otherAllowedSerializationFormats ) ) ;
public class DTDValidator { /** * Method called to update information about the newly encountered ( start ) * element . At this point namespace information has been resolved , but * no DTD validation has been done . Validator is to do these validations , * including checking for attribute value ( and existence ) ...
/* Ok , need to find the element definition ; if not found ( or * only implicitly defined ) , need to throw the exception . */ mTmpKey . reset ( prefix , localName ) ; DTDElement elem = mElemSpecs . get ( mTmpKey ) ; /* Let ' s add the entry in ( even if it ' s a null ) ; this is necessary * to keep things in - syn...
public class SAX2DTM2 { /** * Override the processingInstruction ( ) interface in SAX2DTM2. * % OPT % This one is different from SAX2DTM . processingInstruction ( ) * in that we do not use extended types for PI nodes . The name of * the PI is saved in the DTMStringPool . * Receive notification of a processing i...
charactersFlush ( ) ; int dataIndex = m_data . size ( ) ; m_previous = addNode ( DTM . PROCESSING_INSTRUCTION_NODE , DTM . PROCESSING_INSTRUCTION_NODE , m_parents . peek ( ) , m_previous , - dataIndex , false ) ; m_data . addElement ( m_valuesOrPrefixes . stringToIndex ( target ) ) ; m_values . addElement ( data ) ; m_...
public class Expression { /** * Resolves the expression * @ return the value of the expression */ public String getValue ( ) { } }
return StringUtils . isEmptyTrimmed ( resolvedValue ) ? ( StringUtils . isEmptyTrimmed ( defaultValue ) ? "" : defaultValue ) : resolvedValue ;
public class StringUtils { /** * Return whether the given string has non whitespace characters . * @ param str The string * @ return True if is */ public static boolean hasText ( @ Nullable CharSequence str ) { } }
if ( isEmpty ( str ) ) { return false ; } int strLen = str . length ( ) ; for ( int i = 0 ; i < strLen ; i ++ ) { if ( ! Character . isWhitespace ( str . charAt ( i ) ) ) { return true ; } } return false ;
public class ThesisScale1DQueryReportPage { /** * Appends query page comment to request . * @ param requestContext request contract * @ param queryPage query page */ private void appendQueryPageComments ( RequestContext requestContext , final QueryPage queryPage ) { } }
PanelStamp panelStamp = RequestUtils . getActiveStamp ( requestContext ) ; Map < Long , Map < String , String > > answers = getRequestAnswerMap ( requestContext ) ; ReportPageCommentProcessor sorter = new Scale1DReportPageCommentProcessor ( panelStamp , queryPage , answers ) ; appendQueryPageComments ( requestContext ,...
public class Permission { /** * The private CA operations that can be performed by the designated AWS service . * @ param actions * The private CA operations that can be performed by the designated AWS service . * @ return Returns a reference to this object so that method calls can be chained together . * @ see...
java . util . ArrayList < String > actionsCopy = new java . util . ArrayList < String > ( actions . length ) ; for ( ActionType value : actions ) { actionsCopy . add ( value . toString ( ) ) ; } if ( getActions ( ) == null ) { setActions ( actionsCopy ) ; } else { getActions ( ) . addAll ( actionsCopy ) ; } return this...
public class ChunkerFeatureExtractor { /** * Feats from http : / / www . aclweb . org / anthology / P10-1040 */ public List < String > extractFeatSingle ( int i , final String [ ] tokens , final String [ ] pos ) { } }
List < String > currentFeats = new ArrayList < > ( ) ; for ( int index = Math . max ( 0 , i - 2 ) ; index < Math . min ( i + 3 , tokens . length ) ; index ++ ) { // [ - 2,2] IFeatureExtractor . addFeat ( currentFeats , "w" + ( index - i ) , tokens [ index ] ) ; IFeatureExtractor . addFeat ( currentFeats , "pos" + ( ind...
public class ImageSlideView { /** * { @ inheritDoc } */ @ Override protected void initView ( ) { } }
node ( ) . getStyleClass ( ) . add ( "ImageSlide" ) ; if ( model ( ) . getSlide ( ) . getStyle ( ) != null ) { node ( ) . getStyleClass ( ) . add ( model ( ) . getSlide ( ) . getStyle ( ) ) ; } this . image = Resources . create ( new RelImage ( model ( ) . getImage ( ) ) ) . get ( ) ; if ( model ( ) . getSlide ( ) . ge...
public class Key { /** * { @ inheritDoc } */ @ Override public void write ( DataOutput out ) throws IOException { } }
super . write ( out ) ; out . writeInt ( sortMap . size ( ) ) ; for ( Entry < Integer , SortWritable > entry : sortMap . entrySet ( ) ) { entry . getValue ( ) . write ( out ) ; }
public class SymbolizerWrapper { /** * Set the { @ link ExternalGraphic } ' s path . * < p > Currently one { @ link ExternalGraphic } per { @ link Symbolizer } is supported . * < p > This is used for point styles . * @ param externalGraphicPath the path to set . * @ throws MalformedURLException */ public void s...
if ( externalGraphicPath == null ) { PointSymbolizerWrapper pointSymbolizerWrapper = adapt ( PointSymbolizerWrapper . class ) ; if ( pointSymbolizerWrapper != null ) { Graphic graphic = pointSymbolizerWrapper . getGraphic ( ) ; graphic . graphicalSymbols ( ) . clear ( ) ; externalGraphic = null ; } } else { PointSymbol...
public class Node { /** * 计算节点期望 * @ param expected 输出期望 * @ param Z 规范化因子 * @ param size 标签个数 */ public void calcExpectation ( double [ ] expected , double Z , int size ) { } }
double c = Math . exp ( alpha + beta - cost - Z ) ; for ( int i = 0 ; fVector . get ( i ) != - 1 ; i ++ ) { int idx = fVector . get ( i ) + y ; expected [ idx ] += c ; } for ( Path p : lpath ) { p . calcExpectation ( expected , Z , size ) ; }
public class DefaultSearchHandler { /** * Executed when a search command returns . Fills the { @ link FeatureListGrid } , and then calls the * < code > afterSearch < / code > method . */ public void onSearchDone ( SearchEvent event ) { } }
if ( featureListTable != null ) { featureListTable . setLayer ( event . getLayer ( ) ) ; for ( Feature feature : event . getFeatures ( ) ) { featureListTable . addFeature ( feature ) ; } } afterSearch ( ) ;
public class JspRuntimeLibrary { /** * URL encodes a string , based on the supplied character encoding . * This performs the same function as java . next . URLEncode . encode * in J2SDK1.4 , and should be removed if the only platform supported * is 1.4 or higher . * @ param s The String to be URL encoded . * ...
if ( s == null ) { return "null" ; } if ( enc == null ) { enc = "ISO-8859-1" ; // Is this right ? } StringBuffer out = new StringBuffer ( s . length ( ) ) ; ByteArrayOutputStream buf = new ByteArrayOutputStream ( ) ; OutputStreamWriter writer = null ; try { writer = new OutputStreamWriter ( buf , enc ) ; } catch ( java...
public class Table { /** * Update record in the table using table ' s primary key to locate record in * the table and values of fields of specified object < I > obj < / I > to alter * record fields . * @ param obj object specifying value of primary key and new values of * updated record fields * @ return numb...
return update ( conn , obj , null ) ;
public class Driver { /** * Registers a connection handler . * @ param id Handler unique ID * @ param handler Connection handler * @ return Handler previously registered for | id | , or null if none * @ throws IllegalArgumentException if | id | or | handler | is null ( or empty ) * @ see # unregister */ publi...
if ( id == null || id . length ( ) == 0 ) { throw new IllegalArgumentException ( "Invalid ID: " + id ) ; } // end of if if ( handler == null ) { throw new IllegalArgumentException ( "Invalid handler: " + handler ) ; } // end of if return handlers . put ( id , handler ) ;
public class LssClient { /** * Pause your app stream by app name and stream name * @ param app app name * @ param stream stream name * @ return the response */ public PauseAppStreamResponse pauseAppStream ( String app , String stream ) { } }
PauseAppStreamRequest pauseAppStreamRequest = new PauseAppStreamRequest ( ) ; pauseAppStreamRequest . setApp ( app ) ; pauseAppStreamRequest . setStream ( stream ) ; return pauseAppStream ( pauseAppStreamRequest ) ;
public class SraReader { /** * Read an experiment from the specified URL . * @ param url URL , must not be null * @ return an experiment read from the specified URL * @ throws IOException if an I / O error occurs */ public static Experiment readExperiment ( final URL url ) throws IOException { } }
checkNotNull ( url ) ; try ( BufferedReader reader = Resources . asCharSource ( url , Charsets . UTF_8 ) . openBufferedStream ( ) ) { return readExperiment ( reader ) ; }
public class MetricsFileSystemInstrumentation { /** * Add timer metrics to { @ link DistributedFileSystem # listStatus ( Path ) } */ public FileStatus [ ] listStatus ( Path path ) throws IOException { } }
try ( TimerContextWithLog context = new TimerContextWithLog ( listStatusTimer . time ( ) , "listStatus" , path ) ) { FileStatus [ ] statuses = super . listStatus ( path ) ; context . setResult ( statuses ) ; return statuses ; }
public class SimpleMutableDateTime { /** * Creates SimpleMutableDateTime and initializes it to given ZoneId . * @ param zoneId * @ return */ public static final SimpleMutableDateTime now ( ZoneId zoneId ) { } }
ZonedDateTime zdt = ZonedDateTime . now ( zoneId ) ; SimpleMutableDateTime smt = SimpleMutableDateTime . from ( zdt ) ; return smt ;
public class WindowsJNIFaxClientSpi { /** * This function will suspend an existing fax job . * @ param serverName * The fax server name * @ param faxJobID * The fax job ID */ private void winSuspendFaxJob ( String serverName , int faxJobID ) { } }
synchronized ( WindowsFaxClientSpiHelper . NATIVE_LOCK ) { // pre native call this . preNativeCall ( ) ; // invoke native WindowsJNIFaxClientSpi . suspendFaxJobNative ( serverName , faxJobID ) ; }
public class AbstractInjectionEngine { /** * { @ inheritDoc } */ @ Override public void registerObjectFactory ( Class < ? extends Annotation > annotation , Class < ? > type , Class < ? extends ObjectFactory > objectFactory , boolean allowOverride ) // F623-841.1 throws InjectionException { } }
registerObjectFactory ( annotation , type , objectFactory , allowOverride , null , true ) ;
public class RmpAppirater { /** * Reset saved conditions if app version changed . * @ param context Context */ public static void resetIfAppVersionChanged ( Context context ) { } }
SharedPreferences prefs = getSharedPreferences ( context ) ; int appVersionCode = Integer . MIN_VALUE ; final int previousAppVersionCode = prefs . getInt ( PREF_KEY_APP_VERSION_CODE , Integer . MIN_VALUE ) ; try { appVersionCode = context . getPackageManager ( ) . getPackageInfo ( context . getPackageName ( ) , 0 ) . v...
public class SpoutSpec { /** * Returns true if field corresponding to fieldID is set ( has been assigned a value ) and false otherwise */ public boolean isSet ( _Fields field ) { } }
if ( field == null ) { throw new IllegalArgumentException ( ) ; } switch ( field ) { case SPOUT_OBJECT : return is_set_spout_object ( ) ; case COMMON : return is_set_common ( ) ; } throw new IllegalStateException ( ) ;
public class JawrApplicationConfigManager { /** * ( non - Javadoc ) * @ see net . jawr . web . config . jmx . JawrApplicationConfigManagerMBean # * rebuildDirtyBundles ( ) */ @ Override public void rebuildDirtyBundles ( ) { } }
if ( jsMBean != null ) { jsMBean . rebuildDirtyBundles ( ) ; } if ( cssMBean != null ) { cssMBean . rebuildDirtyBundles ( ) ; } if ( binaryMBean != null ) { binaryMBean . rebuildDirtyBundles ( ) ; }
public class RejectVpcEndpointConnectionsRequest { /** * This method is intended for internal use only . Returns the marshaled request configured with additional * parameters to enable operation dry - run . */ @ Override public Request < RejectVpcEndpointConnectionsRequest > getDryRunRequest ( ) { } }
Request < RejectVpcEndpointConnectionsRequest > request = new RejectVpcEndpointConnectionsRequestMarshaller ( ) . marshall ( this ) ; request . addParameter ( "DryRun" , Boolean . toString ( true ) ) ; return request ;
public class BtcFormat { /** * Return a new microcoin - denominated formatter for the given locale with the specified * fractional decimal placing . The returned object will format the fractional part of * numbers with the given minimum number of fractional decimal places . Optionally , * repeating integer argume...
return getInstance ( MICROCOIN_SCALE , locale , scale , boxAsList ( groups ) ) ;
public class MailPublisher { /** * Sends a MimeMessage . * @ param from The mail sender address . * @ param replyTo The reply to address . * @ param to A list of mail recipient addresses . * @ param cc A list of carbon copy mail recipient addresses . * @ param bcc A list of blind carbon copy mail recipient ad...
Boolean multipart = false ; // if a attachment file is required , we have to use a multipart massage if ( attachmentFilename != null && attachmentFile != null ) { multipart = true ; } MimeMessage mimeMailMessage = mailSender . createMimeMessage ( ) ; MimeMessageHelper mimeHelper = new MimeMessageHelper ( mimeMailMessag...
public class PaxWicketPageFactory { /** * < p > add . < / p > * @ param pageSource a { @ link org . ops4j . pax . wicket . api . PageFactory } object . * @ throws java . lang . IllegalArgumentException if any . */ public void add ( PageFactory < ? extends IRequestablePage > pageSource ) throws IllegalArgumentExcept...
validateNotNull ( pageSource , "pageSource" ) ; Class < ? extends IRequestablePage > pageClass = pageSource . getPageClass ( ) ; validateNotNull ( pageSource , "pageClass" ) ; synchronized ( this ) { contents . put ( pageClass , pageSource ) ; }
public class TraceOptions { /** * Returns a { @ code TraceOptions } whose representation is copied from the { @ code src } beginning at * the { @ code srcOffset } offset . * @ param src the buffer where the representation of the { @ code TraceOptions } is copied . * @ param srcOffset the offset in the buffer wher...
Utils . checkIndex ( srcOffset , src . length ) ; return fromByte ( src [ srcOffset ] ) ;
public class SoftDictionary { /** * Insert a string into the dictionary . */ public void put ( String string , Object value ) { } }
put ( ( String ) null , new MyWrapper ( string ) , value ) ;
public class BasicScope { /** * { @ inheritDoc } */ public void setSecurityHandlers ( Set < IScopeSecurityHandler > handlers ) { } }
if ( securityHandlers == null ) { securityHandlers = new CopyOnWriteArraySet < > ( ) ; } // add the specified set of security handlers securityHandlers . addAll ( handlers ) ; if ( log . isDebugEnabled ( ) ) { log . debug ( "securityHandlers: {}" , securityHandlers ) ; }
public class Helper { /** * < p > parseArray . < / p > * @ param s a { @ link java . lang . String } object . * @ return an array of { @ link java . lang . String } objects . */ public static String [ ] parseArray ( String s ) { } }
// a : 2 : { i : 0 ; s : 12 : " PHPSUD _ OBJ _ 2 " ; i : 1 ; s : 12 : " PHPSUD _ OBJ _ 3 " ; } String [ ] t = s . split ( ":" ) ; int z = Integer . parseInt ( t [ 1 ] ) ; String [ ] res = new String [ z ] ; for ( int i = 0 ; i < z ; i ++ ) { String a = t [ 5 + 3 * i ] . split ( ";" ) [ 0 ] ; res [ i ] = a . substring (...
public class MkAppTree { /** * Adjusts the knn distance in the subtree of the specified root entry . * @ param entry the root entry of the current subtree * @ param knnLists a map of knn lists for each leaf entry */ private void adjustApproximatedKNNDistances ( MkAppEntry entry , Map < DBID , KNNList > knnLists ) {...
MkAppTreeNode < O > node = getNode ( entry ) ; if ( node . isLeaf ( ) ) { for ( int i = 0 ; i < node . getNumEntries ( ) ; i ++ ) { MkAppLeafEntry leafEntry = ( MkAppLeafEntry ) node . getEntry ( i ) ; // approximateKnnDistances ( leafEntry , // getKNNList ( leafEntry . getRoutingObjectID ( ) , knnLists ) ) ; Polynomia...
public class Es6ToEs3Util { /** * Warns the user that the given ES6 feature cannot be converted to ES3 * because the transpilation is not yet implemented . A call to this method * is essentially a " TODO ( tbreisacher ) : Implement { @ code feature } " comment . */ static void cannotConvertYet ( AbstractCompiler co...
compiler . report ( JSError . make ( n , CANNOT_CONVERT_YET , feature ) ) ;
public class FacesConfigFlowDefinitionFlowCallTypeImpl { /** * If not already created , a new < code > flow - reference < / code > element with the given value will be created . * Otherwise , the existing < code > flow - reference < / code > element will be returned . * @ return a new or existing instance of < code...
Node node = childNode . getOrCreate ( "flow-reference" ) ; FacesConfigFlowDefinitionFlowCallFlowReferenceType < FacesConfigFlowDefinitionFlowCallType < T > > flowReference = new FacesConfigFlowDefinitionFlowCallFlowReferenceTypeImpl < FacesConfigFlowDefinitionFlowCallType < T > > ( this , "flow-reference" , childNode ,...
public class ConsList { /** * for kryo */ @ Override public void add ( int index , Object element ) { } }
if ( index == 0 ) { _first = element ; } else { _elems . add ( index - 1 , element ) ; }
public class ConfigurationHooksSupport { /** * Called just after manual application configuration ( in application class ) . * Could be used in tests to disable configuration items and ( probably ) replace them . * @ param builder just created builder * @ return used hooks */ public static Set < GuiceyConfigurati...
final Set < GuiceyConfigurationHook > hooks = HOOKS . get ( ) ; if ( hooks != null ) { hooks . forEach ( l -> l . configure ( builder ) ) ; } // clear hooks just after init reset ( ) ; return hooks ;
public class VarOptItemsSketch { /** * Internal implementation of update ( ) which requires the user to know if an item is * marked as coming from the reservoir region of a sketch . The marks are used only in * merging . * @ param item an item of the set being sampled from * @ param weight a strictly positive w...
if ( item == null ) { return ; } if ( weight <= 0.0 ) { throw new SketchesArgumentException ( "Item weights must be strictly positive: " + weight + ", for item " + item . toString ( ) ) ; } ++ n_ ; if ( r_ == 0 ) { // exact mode updateWarmupPhase ( item , weight , mark ) ; } else { // sketch is in estimation mode , so ...
public class EncodingGroovyMethods { /** * Produce a Writable object which writes the Base64 encoding of the byte array . * Calling toString ( ) on the result returns the encoding as a String . For more * information on Base64 encoding and chunking see < code > RFC 4648 < / code > . * @ param data byte array to b...
return new Writable ( ) { public Writer writeTo ( final Writer writer ) throws IOException { int charCount = 0 ; final int dLimit = ( data . length / 3 ) * 3 ; for ( int dIndex = 0 ; dIndex != dLimit ; dIndex += 3 ) { int d = ( ( data [ dIndex ] & 0XFF ) << 16 ) | ( ( data [ dIndex + 1 ] & 0XFF ) << 8 ) | ( data [ dInd...
public class HttpOutputStreamImpl { /** * ( non - Javadoc ) * @ see com . ibm . ws . http . channel . internal . outbound . HttpOutputStream # clear ( ) */ @ Override public void clear ( ) { } }
if ( null != this . output ) { for ( int i = 0 ; i < this . output . length ; i ++ ) { if ( null != this . output [ i ] ) { this . output [ i ] . release ( ) ; this . output [ i ] = null ; } } } this . outputIndex = 0 ; this . bufferedCount = 0 ; this . bytesWritten = 0L ; this . isClosing = false ;
public class Common { /** * Reload the default settings . */ public void loadDefaultSettings ( ) { } }
String value = getStorageHandler ( ) . getStorageEngine ( ) . getConfigEntry ( "longmode" ) ; if ( value != null ) { displayFormat = DisplayFormat . valueOf ( value . toUpperCase ( ) ) ; } else { getStorageHandler ( ) . getStorageEngine ( ) . setConfigEntry ( "longmode" , "long" ) ; displayFormat = DisplayFormat . LONG...
public class Application { /** * Lame method , since android doesn ' t have awt / applet support . * @ param obj * @ param text */ public String getParameterByReflection ( Object obj , String param ) { } }
Object value = null ; try { java . lang . reflect . Method method = obj . getClass ( ) . getMethod ( "getParameter" , String . class ) ; if ( method != null ) value = method . invoke ( obj , param ) ; } catch ( Exception e ) { e . printStackTrace ( ) ; } if ( value == null ) return null ; else return value . toString (...
public class MultiPointerGestureDetector { /** * Restarts the current gesture ( if any ) . */ public void restartGesture ( ) { } }
if ( ! mGestureInProgress ) { return ; } stopGesture ( ) ; for ( int i = 0 ; i < MAX_POINTERS ; i ++ ) { mStartX [ i ] = mCurrentX [ i ] ; mStartY [ i ] = mCurrentY [ i ] ; } startGesture ( ) ;
public class DatasourceConfigReader { /** * read master datasource configuration from xian config . * please refer to { @ link XianDataSource # url } to see database configuration format * @ return datasource configuration url */ public static String getWriteUrl ( ) { } }
String writeUrl = XianConfig . get ( DB_URL_KEY ) ; LOG . info ( "db_url = " + writeUrl ) ; return writeUrl ;
public class PKITools { /** * Private methods */ private byte [ ] getEncryptedKey ( final String fileName , final int keyNum ) throws PKIException { } }
byte [ ] keys = getKeys ( fileName ) ; int foundKeys = 0 ; int keyStart = 0 ; for ( int i = 0 ; i < keys . length ; i ++ ) { if ( keys [ i ] != '\n' ) { continue ; } if ( keyNum != foundKeys ) { keyStart = i + 1 ; foundKeys ++ ; continue ; } // At end of our key int keyLen = i - keyStart ; byte [ ] key = new byte [ key...
public class AnimaQuery { /** * Set the where parameter according to model , * and generate sql like where where age = ? and name = ? * @ param model * @ return AnimaQuery */ public AnimaQuery < T > where ( T model ) { } }
Field [ ] declaredFields = model . getClass ( ) . getDeclaredFields ( ) ; for ( Field declaredField : declaredFields ) { Object value = AnimaUtils . invokeMethod ( model , getGetterName ( declaredField . getName ( ) ) , AnimaUtils . EMPTY_ARG ) ; if ( null == value ) { continue ; } if ( declaredField . getType ( ) . eq...
public class TSTraversal { /** * Traverses the given transition system in a breadth - first fashion . The traversal is steered by the specified * visitor . * @ param ts * the transition system . * @ param inputs * the input alphabet . * @ param vis * the visitor . */ public static < S , I , T , D > boolea...
Deque < BFSRecord < S , D > > bfsQueue = new ArrayDeque < > ( ) ; // setting the following to false means that the traversal had to be aborted // due to reaching the limit boolean complete = true ; int stateCount = 0 ; Holder < D > dataHolder = new Holder < > ( ) ; for ( S initS : ts . getInitialStates ( ) ) { dataHold...
public class ModuleBundleFileWrapperFactoryHook { /** * { @ inheritDoc } */ @ Override public BundleActivator createActivator ( ) { } }
return new BundleActivator ( ) { @ Override public void stop ( BundleContext context ) throws Exception { frameworkStop ( context ) ; } @ Override public void start ( BundleContext context ) throws Exception { frameworkStart ( context ) ; } } ;
public class PhaseOneApplication { /** * Runs stages 2 - 7 which remain static regardless of the BEL document * input . * @ param pedantic the flag for pedantic - ness * @ param document the { @ link Document BEL document } */ private void runCommonStages ( boolean pedantic , Document document ) { } }
if ( ! stage2 ( document ) ) { if ( pedantic ) { bail ( NAMESPACE_RESOLUTION_FAILURE ) ; } } if ( ! stage3 ( document ) ) { if ( pedantic ) { bail ( SYMBOL_VERIFICATION_FAILURE ) ; } } if ( ! stage4 ( document ) ) { if ( pedantic ) { bail ( SEMANTIC_VERIFICATION_FAILURE ) ; } } ProtoNetwork pn = stage5 ( document ) ; i...
public class AESUtil { /** * Decrypt . * @ param data the data * @ param key the key * @ return the string */ public static String decrypt ( String data , byte [ ] key ) { } }
try { Key k = toSecretKey ( key ) ; Cipher cipher = Cipher . getInstance ( CIPHER_ALGORITHM ) ; cipher . init ( Cipher . DECRYPT_MODE , k ) ; byte [ ] toByteArray = Hex . decodeHex ( data . toCharArray ( ) ) ; byte [ ] decrypted = cipher . doFinal ( toByteArray ) ; return new String ( decrypted , "UTF-8" ) ; } catch ( ...
public class DefaultJiraClient { /** * Process Epic data for a feature , updating the passed in feature * @ param feature * @ param epic */ protected static void processEpicData ( Feature feature , Epic epic ) { } }
feature . setsEpicID ( epic . getId ( ) ) ; feature . setsEpicIsDeleted ( "false" ) ; feature . setsEpicName ( epic . getName ( ) ) ; feature . setsEpicNumber ( epic . getNumber ( ) ) ; feature . setsEpicType ( "" ) ; feature . setsEpicAssetState ( epic . getStatus ( ) ) ; feature . setsEpicBeginDate ( epic . getBeginD...
public class DeploymentBuilder { /** * Get connection factories * @ return The value */ public Collection < ConnectionFactory > getConnectionFactories ( ) { } }
if ( connectionFactories == null ) return Collections . emptyList ( ) ; return Collections . unmodifiableCollection ( connectionFactories ) ;
public class Command { /** * Create a CORBA Any object and insert a int array in it . * @ param data The int array to be inserted into the Any object * @ exception DevFailed If the Any object creation failed . * Click < a href = " . . / . . / tango _ basic / idl _ html / Tango . html # DevFailed " > here < / a > ...
Any out_any = alloc_any ( ) ; DevVarLongArrayHelper . insert ( out_any , data ) ; return out_any ;
public class Matrix4x3d { /** * / * ( non - Javadoc ) * @ see org . joml . Matrix4x3dc # get4x4 ( int , java . nio . ByteBuffer ) */ public ByteBuffer get4x4 ( int index , ByteBuffer buffer ) { } }
MemUtil . INSTANCE . put4x4 ( this , index , buffer ) ; return buffer ;
public class CsvReader { /** * Configures which fields of the CSV file should be included and which should be skipped . The * positions in the string ( read from position 0 to its length ) define whether the field at * the corresponding position in the CSV schema should be included . * parser will look at the fir...
boolean [ ] includedMask = new boolean [ mask . length ( ) ] ; for ( int i = 0 ; i < mask . length ( ) ; i ++ ) { char c = mask . charAt ( i ) ; if ( c == '1' || c == 'T' || c == 't' ) { includedMask [ i ] = true ; } else if ( c != '0' && c != 'F' && c != 'f' ) { throw new IllegalArgumentException ( "Mask string may co...
public class ConfigImpl { /** * mapping used for script ( JSR 223) * @ return */ public Mapping getScriptMapping ( ) { } }
if ( scriptMapping == null ) { // Physical resource TODO make in RAM Resource physical = getConfigDir ( ) . getRealResource ( "jsr223" ) ; if ( ! physical . exists ( ) ) physical . mkdirs ( ) ; this . scriptMapping = new MappingImpl ( this , "/mapping-script/" , physical . getAbsolutePath ( ) , null , ConfigImpl . INSP...
public class Snowflake { /** * 下一个ID * @ return ID */ public synchronized long nextId ( ) { } }
long timestamp = genTime ( ) ; if ( timestamp < lastTimestamp ) { // 如果服务器时间有问题 ( 时钟后退 ) 报错 。 throw new IllegalStateException ( StrUtil . format ( "Clock moved backwards. Refusing to generate id for {}ms" , lastTimestamp - timestamp ) ) ; } if ( lastTimestamp == timestamp ) { sequence = ( sequence + 1 ) & sequenceMask ...
public class ExpressRouteCircuitsInner { /** * Updates an express route circuit tags . * @ param resourceGroupName The name of the resource group . * @ param circuitName The name of the circuit . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ throws CloudException thrown if the...
return beginUpdateTagsWithServiceResponseAsync ( resourceGroupName , circuitName ) . toBlocking ( ) . single ( ) . body ( ) ;
public class NamespaceTable { /** * { @ inheritDoc } */ @ Override protected void _from ( ObjectInput in ) throws IOException , ClassNotFoundException { } }
// 1 : read number of table namespaces final int size = in . readInt ( ) ; for ( int i = 0 ; i < size ; i ++ ) { final TableNamespace ns = new TableNamespace ( ) ; // 1 : read table namespace ns . readExternal ( in ) ; // 2 : read number of documents final int documentsSize = in . readInt ( ) ; for ( int j = 0 ; j < do...
public class QueueContainer { /** * Reserves an ID for a future queue item and associates it with the given { @ code transactionId } . * The item is not yet visible in the queue , it is just reserved for future insertion . * @ param transactionId the ID of the transaction offering this item * @ param itemId the I...
TxQueueItem o = txnOfferReserveInternal ( itemId , transactionId ) ; if ( o != null ) { logger . severe ( "txnOfferBackupReserve operation-> Item exists already at txMap for itemId: " + itemId ) ; }
public class Schemas { /** * Checks if a constraint exists for a given label and a list of properties * This method checks for constraints on node * @ param labelName * @ param propertyNames * @ return true if the constraint exists otherwise it returns false */ private Boolean constraintsExists ( String labelNa...
Schema schema = db . schema ( ) ; for ( ConstraintDefinition constraintDefinition : Iterables . asList ( schema . getConstraints ( Label . label ( labelName ) ) ) ) { List < String > properties = Iterables . asList ( constraintDefinition . getPropertyKeys ( ) ) ; if ( properties . equals ( propertyNames ) ) { return tr...
public class RottenTomatoesApi { /** * Returns similar movies to a movie * @ param movieId RT Movie ID * @ param limit Limit number of returned movies * @ return * @ throws RottenTomatoesException */ public List < RTMovie > getMoviesSimilar ( int movieId , int limit ) throws RottenTomatoesException { } }
properties . clear ( ) ; properties . put ( ApiBuilder . PROPERTY_ID , String . valueOf ( movieId ) ) ; properties . put ( ApiBuilder . PROPERTY_URL , URL_MOVIES_SIMILAR ) ; properties . put ( ApiBuilder . PROPERTY_LIMIT , ApiBuilder . validateLimit ( limit ) ) ; WrapperLists wrapper = response . getResponse ( WrapperL...
public class GetOfferingStatusResult { /** * When specified , gets the offering status for the current period . * @ param current * When specified , gets the offering status for the current period . * @ return Returns a reference to this object so that method calls can be chained together . */ public GetOfferingS...
setCurrent ( current ) ; return this ;
public class CssSkinGenerator { /** * Update the skin variants from the directory path given in parameter * @ param rsBrowser * the resource browser * @ param path * the skin path * @ param skinVariants * the set of skin variants to update */ private void updateSkinVariants ( ResourceBrowser rsBrowser , Str...
Set < String > skinPaths = rsBrowser . getResourceNames ( path ) ; for ( Iterator < String > itSkinPath = skinPaths . iterator ( ) ; itSkinPath . hasNext ( ) ; ) { String skinPath = path + itSkinPath . next ( ) ; if ( rsBrowser . isDirectory ( skinPath ) ) { String skinDirName = PathNormalizer . getPathName ( skinPath ...
public class StringUtils { /** * < p > Checks if a String { @ code str } contains Unicode digits , * if yes then concatenate all the digits in { @ code str } and return it as a String . < / p > * < p > An empty ( " " ) String will be returned if no digits found in { @ code str } . < / p > * < pre > * StringUtil...
if ( isEmpty ( str ) ) { return str ; } final int sz = str . length ( ) ; final StringBuilder strDigits = new StringBuilder ( sz ) ; for ( int i = 0 ; i < sz ; i ++ ) { final char tempChar = str . charAt ( i ) ; if ( Character . isDigit ( tempChar ) ) { strDigits . append ( tempChar ) ; } } return strDigits . toString ...
public class ModuleSpaces { /** * Create a Space . * @ param space CMASpace * @ return { @ link CMASpace } result instance * @ throws IllegalArgumentException if space is null . */ public CMASpace create ( CMASpace space ) { } }
assertNotNull ( space , "space" ) ; final CMASystem system = space . getSystem ( ) ; space . setSystem ( null ) ; try { return service . create ( space ) . blockingFirst ( ) ; } finally { space . setSystem ( system ) ; }
public class ReadWriteLockDataStore { /** * Deserializes an { @ code Optional < Object > } from the given stream . * The given stream will not be close . * @ param input the serialized object input stream , must not be null * @ return the serialized object * @ throws IOException in case the load operation faile...
try { BufferedInputStream bis = new BufferedInputStream ( input ) ; ObjectInputStream ois = new ObjectInputStream ( bis ) ; return Optional . of ( ois . readObject ( ) ) ; } catch ( ClassNotFoundException ex ) { LOG . log ( Level . SEVERE , "An error occurred during deserialization an object." , ex ) ; } return Optiona...
public class SarlLinkFactory { /** * Build the link for the wildcard . * @ param link the link . * @ param linkInfo the information on the link . * @ param type the type . */ protected void getLinkForWildcard ( Content link , LinkInfo linkInfo , Type type ) { } }
linkInfo . isTypeBound = true ; link . addContent ( "?" ) ; // $ NON - NLS - 1 $ final WildcardType wildcardType = type . asWildcardType ( ) ; final Type [ ] extendsBounds = wildcardType . extendsBounds ( ) ; final SARLFeatureAccess kw = Utils . getKeywords ( ) ; for ( int i = 0 ; i < extendsBounds . length ; i ++ ) { ...
public class JavaClassProcessor { /** * are found in the access flags of visitInnerClass ( . . ) */ private void correctModifiersForNestedClass ( String innerTypeName , int access ) { } }
if ( innerTypeName . equals ( className ) ) { javaClassBuilder . withModifiers ( JavaModifier . getModifiersForClass ( access ) ) ; }
public class VersionFactory { /** * Join this set of ranges together . This could result in a set , or in a * logical range . */ public IVersionRange getRange ( String [ ] versions ) throws InvalidRangeException { } }
if ( versions == null ) { return null ; } IVersionRange results = null ; for ( String version : versions ) { IVersionRange range = getRange ( version ) ; if ( results == null ) { results = range ; } else { results = new OrRange ( results , range ) ; } } return results ;
public class CreateAppProfileRequest { /** * Sets the optional long form description of the use case for the AppProfile . */ @ SuppressWarnings ( "WeakerAccess" ) public CreateAppProfileRequest setDescription ( @ Nonnull String description ) { } }
proto . getAppProfileBuilder ( ) . setDescription ( description ) ; return this ;
public class Fiat { /** * < p > Parses an amount expressed in the way humans are used to . The amount is cut to 4 digits after the comma . < / p > * < p > This takes string in a format understood by { @ link BigDecimal # BigDecimal ( String ) } , for example " 0 " , " 1 " , " 0.10 " , * " 1.23E3 " , " 1234.5E - 5 "...
try { long val = new BigDecimal ( str ) . movePointRight ( SMALLEST_UNIT_EXPONENT ) . longValue ( ) ; return Fiat . valueOf ( currencyCode , val ) ; } catch ( ArithmeticException e ) { throw new IllegalArgumentException ( e ) ; }
public class CommerceTaxFixedRateAddressRelPersistenceImpl { /** * Returns all the commerce tax fixed rate address rels . * @ return the commerce tax fixed rate address rels */ @ Override public List < CommerceTaxFixedRateAddressRel > findAll ( ) { } }
return findAll ( QueryUtil . ALL_POS , QueryUtil . ALL_POS , null ) ;
public class CSVAppender { /** * Returns a the value as the first matching schema type or null . * Note that if the value may be null even if the schema does not allow the * value to be null . * @ param value a value * @ param schema a Schema * @ return a String representation of the value according to the Sc...
if ( value == null || schema . getType ( ) == Schema . Type . NULL ) { return null ; } switch ( schema . getType ( ) ) { case BOOLEAN : case FLOAT : case DOUBLE : case INT : case LONG : case STRING : return value . toString ( ) ; case ENUM : // serialize as the ordinal from the schema return String . valueOf ( schema ....
public class HtmlWriter { /** * Signals that a < CODE > String < / CODE > was added to the < CODE > Document < / CODE > . * @ param string a String to add to the HTML * @ return < CODE > true < / CODE > if the string was added , < CODE > false < / CODE > if not . */ public boolean add ( String string ) { } }
if ( pause ) { return false ; } try { write ( string ) ; return true ; } catch ( IOException ioe ) { throw new ExceptionConverter ( ioe ) ; }
public class Provenance { /** * syntactic sugar */ public Provenance addReason ( Coding t ) { } }
if ( t == null ) return this ; if ( this . reason == null ) this . reason = new ArrayList < Coding > ( ) ; this . reason . add ( t ) ; return this ;
public class DbWebServlet { /** * Return a list of order specifiers found in request * @ param request http request containing a ( possibly empty ) set of ' orderBy ' parms . * @ return List of order specifiers given by those orderBy parameters * @ throws Exception */ private List < OrderSpecifier > getOrderByLis...
String [ ] orderByStrings = request . getParameterValues ( "orderBy" ) ; if ( null == orderByStrings ) { return null ; } if ( 0 == orderByStrings . length ) { return null ; } List < OrderSpecifier > result = new Vector < OrderSpecifier > ( ) ; for ( String orderByString : orderByStrings ) { OrderSpecifier orderSpecifie...
public class ThreadExecutorMap { /** * Decorate the given { @ link ThreadFactory } and ensure { @ link # currentExecutor ( ) } will return { @ code eventExecutor } * when called from within the { @ link Runnable } during execution . */ public static ThreadFactory apply ( final ThreadFactory threadFactory , final Even...
ObjectUtil . checkNotNull ( threadFactory , "command" ) ; ObjectUtil . checkNotNull ( eventExecutor , "eventExecutor" ) ; return new ThreadFactory ( ) { @ Override public Thread newThread ( Runnable r ) { return threadFactory . newThread ( apply ( r , eventExecutor ) ) ; } } ;
public class FileStatusTaskStatusHandler { /** * Returns a JSON string with the status of that task ( pending , successful , failed , etc ) , and the URL for hosts . * { " taskStatus " : " completed " , " propertiesURL " : " url " , " hostsURL " : " url " } */ private void taskStatus ( RESTRequest request , RESTRespo...
String taskID = RESTHelper . getRequiredParam ( request , APIConstants . PARAM_TASK_ID ) ; String taskStatusJson = getMultipleRoutingHelper ( ) . getStatus ( taskID ) ; OutputHelper . writeJsonOutput ( response , taskStatusJson ) ;
public class TransactionWriteRequest { /** * Adds update operation ( to be executed on object ) to the list of transaction write operations . * transactionWriteExpression is used to conditionally update object . */ public TransactionWriteRequest addUpdate ( Object object , DynamoDBTransactionWriteExpression transacti...
return addUpdate ( object , transactionWriteExpression , null /* returnValuesOnConditionCheckFailure */ ) ;
public class QuartzScheduler { /** * Pause all of the < code > { @ link com . helger . quartz . IJobDetail } s < / code > in the * matching groups - by pausing all of their < code > Trigger < / code > s . */ public void pauseJobs ( final GroupMatcher < JobKey > groupMatcher ) throws SchedulerException { } }
validateState ( ) ; final ICommonsCollection < String > pausedGroups = m_aResources . getJobStore ( ) . pauseJobs ( _getOrDefault ( groupMatcher ) ) ; notifySchedulerThread ( 0L ) ; for ( final String pausedGroup : pausedGroups ) { notifySchedulerListenersPausedJobs ( pausedGroup ) ; }
public class CodedConstant { /** * write list to { @ link CodedOutputStream } object . * @ param out target output stream to write * @ param order field order * @ param type field type * @ param list target list object to be serialized */ public static void writeToList ( CodedOutputStream out , int order , Fiel...
if ( list == null ) { return ; } for ( Object object : list ) { writeObject ( out , order , type , object , true ) ; }
public class MarvinColorModelConverter { /** * Converts an image in RGB mode to BINARY mode * @ param img image * @ param threshold grays cale threshold * @ return new MarvinImage instance in BINARY mode */ public static MarvinImage rgbToBinary ( MarvinImage img , int threshold ) { } }
MarvinImage resultImage = new MarvinImage ( img . getWidth ( ) , img . getHeight ( ) , MarvinImage . COLOR_MODEL_BINARY ) ; for ( int y = 0 ; y < img . getHeight ( ) ; y ++ ) { for ( int x = 0 ; x < img . getWidth ( ) ; x ++ ) { int gray = ( int ) ( ( img . getIntComponent0 ( x , y ) * 0.3 ) + ( img . getIntComponent1 ...
public class TrafficSplit { /** * < pre > * Mapping from version IDs within the service to fractional * ( 0.000 , 1 ] allocations of traffic for that version . Each version can * be specified only once , but some versions in the service may not * have any traffic allocation . Services that have traffic allocate...
if ( key == null ) { throw new java . lang . NullPointerException ( ) ; } java . util . Map < java . lang . String , java . lang . Double > map = internalGetAllocations ( ) . getMap ( ) ; return map . containsKey ( key ) ? map . get ( key ) : defaultValue ;
public class BufferUtil { /** * Bounds check the access range and throw a { @ link IndexOutOfBoundsException } if exceeded . * @ param buffer to be checked . * @ param index at which the access will begin . * @ param length of the range accessed . */ public static void boundsCheck ( final byte [ ] buffer , final ...
final int capacity = buffer . length ; final long resultingPosition = index + ( long ) length ; if ( index < 0 || resultingPosition > capacity ) { throw new IndexOutOfBoundsException ( "index=" + index + " length=" + length + " capacity=" + capacity ) ; }
public class KernelPoints { /** * Computes the Euclidean distance in the kernel space between the * { @ code k } ' th KernelPoint and the given vector * @ param k the index of the KernelPoint in this set to contribute to the * dot product * @ param x the point to get the Euclidean distance to * @ param qi the...
return points . get ( k ) . dist ( x , qi ) ;
public class Time { /** * Parse a duration * @ param duration 3h , 2mn , 7s * @ return The number of seconds */ public static int parseDuration ( String duration ) { } }
if ( duration == null ) { return 60 * 60 * 24 * 30 ; } Integer toAdd = null ; if ( days . matcher ( duration ) . matches ( ) ) { Matcher matcher = days . matcher ( duration ) ; matcher . matches ( ) ; toAdd = Integer . parseInt ( matcher . group ( 1 ) ) * ( 60 * 60 ) * 24 ; } else if ( hours . matcher ( duration ) . ma...
public class WeakManagedBeanCache { /** * Add a ManagedBean instance ( held in a BeanO ) to this weak reference * cache , keyed by the wrapper instance associated with it . < p > * @ param wrapper object representing a wrapper for the managed bean * @ param bean ManagedBean context , which holds the ManagedBean i...
final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "add(" + Util . identity ( wrapper ) + ", " + bean + ")" ) ; poll ( ) ; WeakReference < EJSWrapperBase > key = new WeakReference < EJSWrapperBase > ( wrapper , ivRefQueue ) ; synchronized (...
public class LongStreamEx { /** * does not add overhead as it appears in bytecode anyways as bridge method */ @ Override public < U > U chain ( Function < ? super LongStreamEx , U > mapper ) { } }
return mapper . apply ( this ) ;
public class ICPImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public void setXFilSize ( Integer newXFilSize ) { } }
Integer oldXFilSize = xFilSize ; xFilSize = newXFilSize ; if ( eNotificationRequired ( ) ) eNotify ( new ENotificationImpl ( this , Notification . SET , AfplibPackage . ICP__XFIL_SIZE , oldXFilSize , xFilSize ) ) ;
public class NameUtils { /** * Calculate the name for a getter method to retrieve the specified property . * @ param propertyName The property name * @ return The name for the getter method for this property , if it were to exist , i . e . getConstraints */ public static String getGetterName ( String propertyName )...
final String suffix = getSuffixForGetterOrSetter ( propertyName ) ; return PROPERTY_GET_PREFIX + suffix ;
public class BdbStoreShutdownHook { /** * Cleanly shuts down all databases in the provided environment . * @ throws IOException if a database delete attempt failed . * @ throws DatabaseException if an error occurs while closing the class * catalog database . */ void shutdown ( ) throws IOException { } }
synchronized ( this ) { for ( BdbEnvironmentInfo envInfo : this . envInfos ) { try { envInfo . getClassCatalog ( ) . close ( ) ; } catch ( DatabaseException ignore ) { LOGGER . log ( Level . SEVERE , "Failure closing class catalog" , ignore ) ; } envInfo . closeAndRemoveAllDatabaseHandles ( ) ; try ( Environment env = ...
public class PreferenceActivity { /** * Returns the char sequence , which is specified by a specific intent extra . The char sequence * can either be specified as a string or as a resource id . * @ param intent * The intent , which specifies the char sequence , as an instance of the class { @ link * Intent } . ...
CharSequence charSequence = intent . getCharSequenceExtra ( name ) ; if ( charSequence == null ) { int resourceId = intent . getIntExtra ( name , 0 ) ; if ( resourceId != 0 ) { charSequence = getText ( resourceId ) ; } } return charSequence ;
public class WDataTable { /** * Retrieves the starting row index for the current page . Will always return zero for tables which are not * paginated . * @ return the starting row index for the current page . */ private int getCurrentPageStartRow ( ) { } }
int startRow = 0 ; if ( getPaginationMode ( ) != PaginationMode . NONE ) { int rowsPerPage = getRowsPerPage ( ) ; TableDataModel model = getDataModel ( ) ; if ( model instanceof TreeTableDataModel ) { // For tree tables , pagination only occurs on first - level nodes ( ie . those // underneath the root node ) , however...
public class CollectionHelper { /** * Retrieve the tickets and compile them from the different sources * @ param basedTickets A list of based tickets * @ param methodAnnotation The method annotation that could contain tickets * @ param classAnnotation The class annotation that could contain tickets * @ return T...
Set < String > tickets ; if ( basedTickets == null ) { tickets = new HashSet < > ( ) ; } else { tickets = populateTickets ( basedTickets , new HashSet < String > ( ) ) ; } if ( classAnnotation != null && classAnnotation . tickets ( ) != null ) { tickets = populateTickets ( new HashSet < > ( Arrays . asList ( classAnnot...
public class JmxClient { /** * Return an array of the attributes associated with the bean name . */ public MBeanAttributeInfo [ ] getAttributesInfo ( ObjectName name ) throws JMException { } }
checkClientConnected ( ) ; try { return mbeanConn . getMBeanInfo ( name ) . getAttributes ( ) ; } catch ( Exception e ) { throw createJmException ( "Problems getting bean information from " + name , e ) ; }
public class OMVRBTree { /** * Remove a node from the tree . * @ param p * Node to remove * @ return Node that was removed . Passed and removed nodes may be different in case node to remove contains two children . In this * case node successor will be found and removed but it ' s content will be copied to the n...
modCount ++ ; // If strictly internal , copy successor ' s element to p and then make p // point to successor . if ( p . getLeft ( ) != null && p . getRight ( ) != null ) { OMVRBTreeEntry < K , V > s = next ( p ) ; p . copyFrom ( s ) ; p = s ; } // p has 2 children // Start fixup at replacement node , if it exists . fi...
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getIfcPositiveRatioMeasure ( ) { } }
if ( ifcPositiveRatioMeasureEClass == null ) { ifcPositiveRatioMeasureEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 903 ) ; } return ifcPositiveRatioMeasureEClass ;
public class Features { /** * Get a feature from its class or interface . * @ param < C > The custom feature type . * @ param feature The feature class or interface . * @ return The feature instance . * @ throws LionEngineException If the feature was not found . */ public < C extends Feature > C get ( Class < C...
final Feature found = typeToFeature . get ( feature ) ; if ( found != null ) { return feature . cast ( found ) ; } throw new LionEngineException ( ERROR_FEATURE_NOT_FOUND + feature . getName ( ) ) ;