signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class FFMQJNDIContext { /** * ( non - Javadoc ) * @ see javax . naming . Context # rebind ( java . lang . String , java . lang . Object ) */ @ Override public void rebind ( String name , Object obj ) throws NamingException { } }
rebind ( new CompositeName ( name ) , obj ) ;
public class ItemRef { /** * Increments by one a given attribute of an item . If the attribute doesn ' t exist , it is set to zero before the operation . * < pre > * StorageRef storage = new StorageRef ( " your _ app _ key " , " your _ token " ) ; * TableRef tableRef = storage . table ( " your _ table " ) ; * I...
return this . incr ( property , null , onItemSnapshot , onError ) ;
public class QueueBatchUniqueProcessor { /** * This method is overridden over parent class so that a batch of data is taken * from the queue and { @ link # process ( Set ) } is invoked . < br > * 这个方法被重载了 , 从而队列中的一批数据会被取出并调用 { @ link # process ( Set ) } 方法 。 */ @ Override protected void consume ( ) { } }
int size = 0 ; LinkedHashSet < E > batch = new LinkedHashSet < E > ( ) ; E obj = null ; try { obj = queue . take ( ) ; } catch ( InterruptedException e ) { return ; } batch . add ( obj ) ; size ++ ; if ( pollTimeout == 0 ) { // no waiting while ( size < maxBatchSize && ( obj = queue . poll ( ) ) != null ) { batch . add...
public class Task { /** * The Critical field indicates whether a task has any room in the schedule * to slip , or if a task is on the critical path . The Critical field contains * Yes if the task is critical and No if the task is not critical . * @ return boolean */ public boolean getCritical ( ) { } }
Boolean critical = ( Boolean ) getCachedValue ( TaskField . CRITICAL ) ; if ( critical == null ) { Duration totalSlack = getTotalSlack ( ) ; ProjectProperties props = getParentFile ( ) . getProjectProperties ( ) ; int criticalSlackLimit = NumberHelper . getInt ( props . getCriticalSlackLimit ( ) ) ; if ( criticalSlackL...
public class HtmlDocletWriter { /** * Adds the comment tags . * @ param doc the doc for which the comment tags will be generated * @ param holderTag the block tag context for the inline tags * @ param tags the first sentence tags for the doc * @ param depr true if it is deprecated * @ param first true if the ...
if ( configuration . nocomment ) { return ; } Content div ; Content result = commentTagsToContent ( null , doc , tags , first ) ; if ( depr ) { Content italic = HtmlTree . SPAN ( HtmlStyle . deprecationComment , result ) ; div = HtmlTree . DIV ( HtmlStyle . block , italic ) ; htmltree . addContent ( div ) ; } else { di...
public class JooqTxnInterceptor { /** * Invokes the method wrapped within a unit of work and a transaction . * @ param methodInvocation the method to be invoked within a transaction * @ return the result of the call to the invoked method * @ throws Throwable if an exception occurs during the method invocation , t...
boolean unitOfWorkAlreadyStarted = unitOfWork . isActive ( ) ; if ( ! unitOfWorkAlreadyStarted ) { unitOfWork . begin ( ) ; } Throwable originalThrowable = null ; try { return dslContextProvider . get ( ) . transactionResult ( ( ) -> { try { return methodInvocation . proceed ( ) ; } catch ( Throwable e ) { if ( e insta...
public class ChannelArbitrateEvent { /** * 停止对应的channel同步 , 是个异步调用 */ public boolean pause ( Long channelId , boolean needTermin ) { } }
ChannelStatus currstatus = status ( channelId ) ; boolean status = false ; boolean result = ! needTermin ; if ( currstatus . isStart ( ) ) { // stop的优先级高于pause , 这里只针对start状态进行状态更新 updateStatus ( channelId , ChannelStatus . PAUSE ) ; status = true ; // 避免stop时发生rollback报警 } if ( needTermin ) { try { // 调用termin进行关闭 res...
public class AffineTransformation { /** * Transform a relative vector into homogeneous coordinates . * @ param v initial vector * @ return vector of dim + 1 , with new column having the value 0.0 */ public double [ ] homogeneRelativeVector ( double [ ] v ) { } }
assert ( v . length == dim ) ; // TODO : this only works properly when trans [ dim ] [ dim ] = = 1.0 , right ? double [ ] dv = Arrays . copyOf ( v , dim + 1 ) ; dv [ dim ] = 0.0 ; return dv ;
public class HashtableOnDisk { /** * Given an index into the hash table and a value to store there , find it * on disk and write the value . */ private void writeHashIndex ( int index , long value , int tableid ) throws IOException { } }
long diskloc = header . calcOffset ( index , tableid ) ; filemgr . seek ( diskloc ) ; filemgr . writeLong ( value ) ; updateHtindex ( index , value , tableid ) ;
public class CoverageUtilities { /** * Creates a useless { @ link GridCoverage2D } that might be usefull as placeholder . * @ return the dummy grod coverage . */ public static GridCoverage2D buildDummyCoverage ( ) { } }
HashMap < String , Double > envelopeParams = new HashMap < String , Double > ( ) ; envelopeParams . put ( NORTH , 1.0 ) ; envelopeParams . put ( SOUTH , 0.0 ) ; envelopeParams . put ( WEST , 0.0 ) ; envelopeParams . put ( EAST , 1.0 ) ; envelopeParams . put ( XRES , 1.0 ) ; envelopeParams . put ( YRES , 1.0 ) ; envelop...
public class PrimitiveDataChecksum { /** * Note : leaves the checksum untouched if given value is null ( provide a special value for stronger hashing ) . */ public void updateUtf8 ( String string ) { } }
if ( string != null ) { byte [ ] bytes ; try { bytes = string . getBytes ( "UTF-8" ) ; } catch ( UnsupportedEncodingException e ) { throw new RuntimeException ( e ) ; } update ( bytes , 0 , bytes . length ) ; }
public class FlatMapIterator { /** * Delegates calls to the { @ link # flatMap ( Object ) } method . */ @ Override public final void flatMap ( IN value , Collector < OUT > out ) throws Exception { } }
for ( Iterator < OUT > iter = flatMap ( value ) ; iter . hasNext ( ) ; ) { out . collect ( iter . next ( ) ) ; }
public class AbstractAmazonSQSAsync { /** * Simplified method form for invoking the ChangeMessageVisibilityBatch operation . * @ see # changeMessageVisibilityBatchAsync ( ChangeMessageVisibilityBatchRequest ) */ @ Override public java . util . concurrent . Future < ChangeMessageVisibilityBatchResult > changeMessageVi...
return changeMessageVisibilityBatchAsync ( new ChangeMessageVisibilityBatchRequest ( ) . withQueueUrl ( queueUrl ) . withEntries ( entries ) ) ;
public class ConcurrentSummaryStats { /** * Adds a value to the stream . * @ param x the new value . */ public synchronized void add ( double x ) { } }
final double oldA = a ; a += ( x - a ) / ++ size ; q += ( x - a ) * ( x - oldA ) ; min = Math . min ( min , x ) ; max = Math . max ( max , x ) ;
public class Histogram { /** * Return the average of the histogram . */ public Optional < Double > avg ( ) { } }
if ( isEmpty ( ) ) return Optional . empty ( ) ; return Optional . of ( sum ( ) / getEventCount ( ) ) ;
public class DataSet { /** * Runs a { @ link CustomUnaryOperation } on the data set . Custom operations are typically complex * operators that are composed of multiple steps . * @ param operation The operation to run . * @ return The data set produced by the operation . */ public < X > DataSet < X > runOperation ...
Preconditions . checkNotNull ( operation , "The custom operator must not be null." ) ; operation . setInput ( this ) ; return operation . createResult ( ) ;
public class Mork { /** * - - the real functionality */ public boolean compile ( Job job ) throws IOException { } }
boolean result ; currentJob = job ; result = compileCurrent ( ) ; currentJob = null ; return result ;
public class StaticFilesHandler { /** * < pre > * Regular expression that matches the file paths for all files that should be * referenced by this handler . * < / pre > * < code > string upload _ path _ regex = 2 ; < / code > */ public com . google . protobuf . ByteString getUploadPathRegexBytes ( ) { } }
java . lang . Object ref = uploadPathRegex_ ; if ( ref instanceof java . lang . String ) { com . google . protobuf . ByteString b = com . google . protobuf . ByteString . copyFromUtf8 ( ( java . lang . String ) ref ) ; uploadPathRegex_ = b ; return b ; } else { return ( com . google . protobuf . ByteString ) ref ; }
public class Utils { /** * システム設定に従いラベルを正規化する 。 * @ since 1.1 * @ param text セルのラベル * @ param config システム設定 * @ return true : ラベルが一致する 。 */ public static String normalize ( final String text , final Configuration config ) { } }
if ( text != null && config . isNormalizeLabelText ( ) ) { return text . trim ( ) . replaceAll ( "[\n\r]" , "" ) . replaceAll ( "[\t  ]+" , " " ) ; } return text ;
public class TextToSpeech { /** * Delete a custom word . * Deletes a single word from the specified custom voice model . You must use credentials for the instance of the * service that owns a model to delete its words . * * * Note : * * This method is currently a beta release . * * * See also : * * [ Deleting a...
Validator . notNull ( deleteWordOptions , "deleteWordOptions cannot be null" ) ; String [ ] pathSegments = { "v1/customizations" , "words" } ; String [ ] pathParameters = { deleteWordOptions . customizationId ( ) , deleteWordOptions . word ( ) } ; RequestBuilder builder = RequestBuilder . delete ( RequestBuilder . cons...
public class AiNodeAnim { /** * Returns the buffer with rotation keys of this animation channel . < p > * Rotation keys consist of a time value ( double ) and a quaternion ( 4D * vector of floats ) , resulting in a total of 24 bytes per entry . The * buffer contains { @ link # getNumRotKeys ( ) } of these entries...
ByteBuffer buf = m_rotKeys . duplicate ( ) ; buf . order ( ByteOrder . nativeOrder ( ) ) ; return buf ;
public class QueryHints { /** * Returns null if hint is not provided . */ public Object get ( QueryHint hint ) { } }
return hint == null ? null : ( mMap == null ? null : mMap . get ( hint ) ) ;
public class OsLoginServiceClient { /** * Adds an SSH public key and returns the profile information . Default POSIX account information * is set when no username and UID exist as part of the login profile . * < p > Sample code : * < pre > < code > * try ( OsLoginServiceClient osLoginServiceClient = OsLoginServ...
ImportSshPublicKeyRequest request = ImportSshPublicKeyRequest . newBuilder ( ) . setParent ( parent == null ? null : parent . toString ( ) ) . setSshPublicKey ( sshPublicKey ) . build ( ) ; return importSshPublicKey ( request ) ;
public class MesosFramework { /** * Handle status update from mesos master * 1 . It does nothing except logging under states : * - TASK _ STAGING , * - TASK _ STARTING , * - TASK _ RUNNING , * 2 . It does severe logging under states : * - TASK _ FINISHED * since heron - executor should be long live in nor...
// We would determine what to do basing on current taskId and mesos status update switch ( status . getState ( ) ) { case TASK_STAGING : LOG . info ( String . format ( "Task with id '%s' STAGING" , status . getTaskId ( ) . getValue ( ) ) ) ; LOG . severe ( "Framework status updates should not use" ) ; break ; case TASK...
public class WSX509TrustManager { /** * @ see javax . net . ssl . X509TrustManager # checkServerTrusted ( java . security . cert . * X509Certificate [ ] , java . lang . String ) */ @ Override public void checkServerTrusted ( X509Certificate [ ] chain , String authType ) throws CertificateException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "checkServerTrusted" ) ; Map < String , Object > currentConnectionInfo = ThreadManager . getInstance ( ) . getOutboundConnectionInfoInternal ( ) ; if ( currentConnectionInfo != null ) { if ( TraceComponent . isAnyTracingEnabled...
public class StatusUpdateManager { /** * instantiate a status update * @ param typeIdentifier * status update type identifier * @ param values * form item list containing all status update items necessary * @ return status update instance of type specified * @ throws StatusUpdateInstantiationFailedException...
final StatusUpdateTemplate template = getStatusUpdateTemplate ( typeIdentifier ) ; final Class < ? > templateInstantiationClass = template . getInstantiationClass ( ) ; try { // instantiate status update final StatusUpdate statusUpdate = ( StatusUpdate ) templateInstantiationClass . newInstance ( ) ; // set status upda...
public class QueryAtomContainer { /** * Returns an array of all SingleElectron connected to the given atom . * @ param atom The atom on which the single electron is located * @ return The array of SingleElectron of this AtomContainer */ @ Override public List < ISingleElectron > getConnectedSingleElectronsList ( IA...
List < ISingleElectron > lps = new ArrayList < ISingleElectron > ( ) ; for ( int i = 0 ; i < singleElectronCount ; i ++ ) { if ( singleElectrons [ i ] . contains ( atom ) ) lps . add ( singleElectrons [ i ] ) ; } return lps ;
public class CmsContainerPageElementPanel { /** * Updates the option bar position . < p > */ public void updateOptionBarPosition ( ) { } }
// only if attached to the DOM if ( ( m_elementOptionBar != null ) && RootPanel . getBodyElement ( ) . isOrHasChild ( getElement ( ) ) ) { int absoluteTop = getElement ( ) . getAbsoluteTop ( ) ; int absoluteRight = getElement ( ) . getAbsoluteRight ( ) ; CmsPositionBean dimensions = CmsPositionBean . getBoundingClientR...
public class GetMountTablePResponse { /** * Use { @ link # getMountPointsMap ( ) } instead . */ @ java . lang . Deprecated public java . util . Map < java . lang . String , alluxio . grpc . MountPointInfo > getMountPoints ( ) { } }
return getMountPointsMap ( ) ;
public class SwipeActionAdapter { /** * We need the ListView to be able to modify it ' s OnTouchListener * @ param listView the ListView to which the adapter will be attached * @ return A reference to the current instance so that commands can be chained */ public SwipeActionAdapter setListView ( ListView listView )...
this . mListView = listView ; mTouchListener = new SwipeActionTouchListener ( listView , this ) ; this . mListView . setOnTouchListener ( mTouchListener ) ; this . mListView . setOnScrollListener ( mTouchListener . makeScrollListener ( ) ) ; this . mListView . setClipChildren ( false ) ; mTouchListener . setFadeOut ( m...
public class MongoDBUtils { /** * Insert data in a MongoDB Collection . * @ param collection * @ param table */ public void insertIntoMongoDBCollection ( String collection , DataTable table ) { } }
// Primero pasamos la fila del datatable a un hashmap de ColumnName - Type List < String [ ] > colRel = coltoArrayList ( table ) ; // Vamos insertando fila a fila for ( int i = 1 ; i < table . raw ( ) . size ( ) ; i ++ ) { // Obtenemos la fila correspondiente BasicDBObject doc = new BasicDBObject ( ) ; List < String > ...
public class TransformerHandlerImpl { /** * Filter an error event . * @ param e The error as an exception . * @ throws SAXException The client may throw * an exception during processing . * @ see org . xml . sax . ErrorHandler # error */ public void error ( SAXParseException e ) throws SAXException { } }
// % REVIEW % I don ' t think this should be called . - sb // clearCoRoutine ( e ) ; // This is not great , but we really would rather have the error // handler be the error listener if it is a error handler . Coroutine ' s fatalError // can ' t really be configured , so I think this is the best thing right now // for ...
public class SoundexComparator { /** * Produces the Soundex key for the given string . */ public static String soundex ( String str ) { } }
if ( str . length ( ) < 1 ) return "" ; // no soundex key for the empty string ( could use 000) char [ ] key = new char [ 4 ] ; key [ 0 ] = str . charAt ( 0 ) ; int pos = 1 ; char prev = '0' ; for ( int ix = 1 ; ix < str . length ( ) && pos < 4 ; ix ++ ) { char ch = str . charAt ( ix ) ; int charno ; if ( ch >= 'A' && ...
public class CmsTreeItem { /** * Sets the tree item style to leaf , hiding the list opener . < p > * @ param isLeaf < code > true < / code > to set to leaf style */ public void setLeafStyle ( boolean isLeaf ) { } }
if ( isLeaf ) { m_leafStyleVar . setValue ( CSS . listTreeItemLeaf ( ) ) ; } else { m_leafStyleVar . setValue ( CSS . listTreeItemInternal ( ) ) ; }
public class FSNamesystem { /** * Schedule blocks for deletion at datanodes * @ param nodesToProcess number of datanodes to schedule deletion work * @ return total number of block for deletion */ int computeInvalidateWork ( int nodesToProcess ) { } }
int numOfNodes = 0 ; ArrayList < String > keyArray = null ; readLock ( ) ; try { numOfNodes = recentInvalidateSets . size ( ) ; // get an array of the keys keyArray = new ArrayList < String > ( recentInvalidateSets . keySet ( ) ) ; } finally { readUnlock ( ) ; } nodesToProcess = Math . min ( numOfNodes , nodesToProcess...
public class Languages { /** * Returns the language component of a language string . * @ param language * @ return the language component */ public String getLanguageComponent ( String language ) { } }
if ( StringUtils . isNullOrEmpty ( language ) ) { return "" ; } if ( language . contains ( "-" ) ) { return language . split ( "-" ) [ 0 ] ; } else if ( language . contains ( "_" ) ) { return language . split ( "_" ) [ 0 ] ; } return language ;
public class FieldIterator { /** * Is this field in my field list already ? */ private boolean inBaseField ( String strFieldFileName , String [ ] rgstrClassNames ) { } }
for ( int i = 0 ; i < rgstrClassNames . length - 1 ; i ++ ) { // In my base ( but not in this ( top ) class ) . if ( strFieldFileName . equals ( rgstrClassNames [ i ] ) ) return true ; } return false ;
public class ShrinkWrapFileAttributes { /** * { @ inheritDoc } * @ see java . nio . file . attribute . BasicFileAttributes # isDirectory ( ) */ @ Override public boolean isDirectory ( ) { } }
final ArchivePath archivePath = ArchivePaths . create ( path . toString ( ) ) ; Node node = archive . get ( archivePath ) ; return node . getAsset ( ) == null ;
public class BOSHClient { /** * Adds a response message listener to the session . * @ param listener response listener to add , if not already added */ public void addBOSHClientResponseListener ( final BOSHClientResponseListener listener ) { } }
if ( listener == null ) { throw ( new IllegalArgumentException ( NULL_LISTENER ) ) ; } responseListeners . add ( listener ) ;
public class AbstractAggregatorImpl { /** * Called when the aggregator is shutting down . Note that there is inconsistency * among servlet bridge implementations over when { @ link HttpServlet # destroy ( ) } * is called relative to when ( or even if ) the bundle is stopped . So this method * may be called from t...
final String sourceMethod = "shutdown" ; // $ NON - NLS - 1 $ boolean isTraceLogging = log . isLoggable ( Level . FINER ) ; if ( isTraceLogging ) { log . entering ( AbstractAggregatorImpl . class . getName ( ) , sourceMethod ) ; } currentRequest . remove ( ) ; if ( ! isShuttingDown ) { isShuttingDown = true ; IServiceR...
public class FctConvertersToFromString { /** * < p > Create put CnvTfsHasId ( Integer ) . < / p > * @ param pBeanName - bean name * @ param pClass - bean class * @ param pIdName - bean ID name * @ return requested CnvTfsHasId ( Integer ) * @ throws Exception - an exception */ protected final CnvTfsHasId < IHa...
CnvTfsHasId < IHasId < Integer > , Integer > convrt = new CnvTfsHasId < IHasId < Integer > , Integer > ( ) ; convrt . setUtlReflection ( getUtlReflection ( ) ) ; convrt . setIdConverter ( lazyGetCnvTfsInteger ( ) ) ; convrt . init ( pClass , pIdName ) ; this . convertersMap . put ( pBeanName , convrt ) ; return convrt ...
public class MultiUserChatLight { /** * Set the room configurations . * @ param roomName * @ param customConfigs * @ throws NoResponseException * @ throws XMPPErrorException * @ throws NotConnectedException * @ throws InterruptedException */ public void setRoomConfigs ( String roomName , HashMap < String , ...
MUCLightSetConfigsIQ mucLightSetConfigIQ = new MUCLightSetConfigsIQ ( room , roomName , customConfigs ) ; connection . createStanzaCollectorAndSend ( mucLightSetConfigIQ ) . nextResultOrThrow ( ) ;
public class Workspace { /** * Called when deserialising JSON , to re - create the object graph * based upon element / relationship IDs . */ public void hydrate ( ) { } }
if ( viewSet == null ) { viewSet = createViewSet ( ) ; } if ( documentation == null ) { documentation = createDocumentation ( ) ; } hydrateModel ( ) ; hydrateViewSet ( ) ; hydrateDocumentation ( ) ;
public class ClassUtil { /** * Refer to setPropValue ( Method , Object , Object ) . * @ param entity * @ param propName * is case insensitive * @ param propValue */ public static void setPropValue ( final Object entity , final String propName , final Object propValue ) { } }
setPropValue ( entity , propName , propValue , false ) ;
public class CxxReportSensor { /** * resolveFilename normalizes the report full path * @ param baseDir of the project * @ param filename of the report * @ return String */ @ Nullable public static String resolveFilename ( final String baseDir , @ Nullable final String filename ) { } }
if ( filename != null ) { // Normalization can return null if path is null , is invalid , // or is a path with back - ticks outside known directory structure String normalizedPath = FilenameUtils . normalize ( filename ) ; if ( ( normalizedPath != null ) && ( new File ( normalizedPath ) . isAbsolute ( ) ) ) { return no...
public class UpdatableResultSet { /** * { inheritDoc } . */ public void updateAsciiStream ( int columnIndex , InputStream inputStream , int length ) throws SQLException { } }
updateAsciiStream ( columnIndex , inputStream , ( long ) length ) ;
public class Work { /** * Parse a set of characters and return an instance of { @ link Tree } . * This tree can then be fed into < code > Assert . assertTree ( . . . ) < / code > . * This method will throw an exception if there was an error parsing . It * will also throw { @ link ParserException } if the parsing ...
if ( walkerRule == null ) throw new IllegalArgumentException ( "WalkerRule cannot be null, please use rule()" ) ; if ( tree == null ) throw new IllegalArgumentException ( "Tree cannot be null" ) ; if ( AunitRuntime . getTreeParserFactory ( ) == null ) throw new IllegalStateException ( "Walker factory not set by configu...
public class CertificatesInner { /** * Create or update a certificate . * Create or update a certificate . * @ param resourceGroupName Name of the resource group to which the resource belongs . * @ param name Name of the certificate . * @ param certificateEnvelope Details of certificate , if it exists already ....
return ServiceFuture . fromResponse ( updateWithServiceResponseAsync ( resourceGroupName , name , certificateEnvelope ) , serviceCallback ) ;
public class Option { /** * 设置symbolList值 * @ param symbolList */ public Option symbolList ( Symbol ... symbolList ) { } }
if ( symbolList == null || symbolList . length == 0 ) { return this ; } this . symbolList ( ) . addAll ( Arrays . asList ( symbolList ) ) ; return this ;
public class Expression { /** * Tell the user of an error , and probably throw an * exception . * @ param xctxt The XPath runtime context . * @ param msg An error msgkey that corresponds to one of the constants found * in { @ link org . apache . xpath . res . XPATHErrorResources } , which is * a key for a for...
java . lang . String fmsg = XSLMessages . createXPATHMessage ( msg , args ) ; if ( null != xctxt ) { ErrorListener eh = xctxt . getErrorListener ( ) ; TransformerException te = new TransformerException ( fmsg , this ) ; eh . fatalError ( te ) ; }
public class LabelingJobOutputConfigMarshaller { /** * Marshall the given parameter object . */ public void marshall ( LabelingJobOutputConfig labelingJobOutputConfig , ProtocolMarshaller protocolMarshaller ) { } }
if ( labelingJobOutputConfig == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( labelingJobOutputConfig . getS3OutputPath ( ) , S3OUTPUTPATH_BINDING ) ; protocolMarshaller . marshall ( labelingJobOutputConfig . getKmsKeyId ( ) , KMSKEYID_BIN...
public class ComponentEnvDispatcher { public ComponentDef dispatch ( Class < ? > componentClass ) { } }
if ( ! canDispatch ( componentClass ) ) { // already checked but just in case return null ; } return doDispatch ( componentClass , findEnvDispatch ( componentClass ) ) ;
public class FileSystem { /** * Convert a string to an URL according to several rules . * < p > The rules are ( the first succeeded is replied ) : * < ul > * < li > if { @ code urlDescription } is < code > null < / code > or empty , return < code > null < / code > ; < / li > * < li > try to build an { @ link UR...
"checkstyle:cyclomaticcomplexity" , "checkstyle:npathcomplexity" , "checkstyle:nestedifdepth" } ) static URL convertStringToURL ( String urlDescription , boolean allowResourceSearch , boolean repliesFileURL , boolean supportWindowsPaths ) { URL url = null ; if ( urlDescription != null && urlDescription . length ( ) > 0...
public class PolymerClassRewriter { /** * Returns an assign replacing the equivalent var or let declaration . */ private static Node varToAssign ( Node var ) { } }
Node assign = IR . assign ( var . getFirstChild ( ) . cloneNode ( ) , var . getFirstChild ( ) . removeFirstChild ( ) ) ; return IR . exprResult ( assign ) . useSourceInfoIfMissingFromForTree ( var ) ;
public class FileContentCryptorImpl { /** * visible for testing */ ByteBuffer encryptChunk ( ByteBuffer cleartextChunk , long chunkNumber , byte [ ] headerNonce , SecretKey fileKey ) { } }
try { // nonce : byte [ ] nonce = new byte [ NONCE_SIZE ] ; random . nextBytes ( nonce ) ; // payload : final Cipher cipher = CipherSupplier . AES_CTR . forEncryption ( fileKey , new IvParameterSpec ( nonce ) ) ; final ByteBuffer outBuf = ByteBuffer . allocate ( NONCE_SIZE + cipher . getOutputSize ( cleartextChunk . re...
public class ColumnList { /** * add a new column * @ param stt * @ param column * @ param alias */ public void add ( SchemaTableTree stt , String column , String alias ) { } }
add ( stt . getSchemaTable ( ) , column , stt . getStepDepth ( ) , alias ) ;
public class AlphabeticIndex { /** * This method is called to get the index exemplars . Normally these come from the locale directly , * but if they aren ' t available , we have to synthesize them . */ private void addIndexExemplars ( ULocale locale ) { } }
UnicodeSet exemplars = LocaleData . getExemplarSet ( locale , 0 , LocaleData . ES_INDEX ) ; if ( exemplars != null ) { initialLabels . addAll ( exemplars ) ; return ; } // The locale data did not include explicit Index characters . // Synthesize a set of them from the locale ' s standard exemplar characters . exemplars...
public class DefaultImportationLinker { /** * Get the filters ImporterServiceFilter and ImportDeclarationFilter from the properties , stop the instance if one of . * them is invalid . */ private void processProperties ( ) { } }
state = true ; try { importerServiceFilter = getFilter ( importerServiceFilterProperty ) ; } catch ( InvalidFilterException invalidFilterException ) { LOG . debug ( "The value of the Property " + FILTER_IMPORTERSERVICE_PROPERTY + " is invalid," + " the recuperation of the Filter has failed. The instance gonna stop." , ...
public class ReflectionOnObjectMethods { /** * implements the visitor to reset the opcode stack and clear the local variable map @ * @ param obj * the context object of the currently parsed code block */ @ Override public void visitCode ( Code obj ) { } }
stack . resetForMethodEntry ( this ) ; localClassTypes . clear ( ) ; super . visitCode ( obj ) ;
public class TranslateToPyExprVisitor { /** * Generates the code for key access given the name of a variable to be used as a key , e . g . { @ code * . get ( key ) } . * @ param key an expression to be used as a key * @ param notFoundBehavior What should happen if the key is not in the structure . * @ param coe...
if ( coerceKeyToString == CoerceKeyToString . YES ) { key = new PyFunctionExprBuilder ( "runtime.maybe_coerce_key_to_string" ) . addArg ( key ) . asPyExpr ( ) ; } switch ( notFoundBehavior . getType ( ) ) { case RETURN_NONE : return new PyFunctionExprBuilder ( "runtime.key_safe_data_access" ) . addArg ( new PyExpr ( co...
public class ErrorUtils { /** * Pretty prints the given parse error showing its location in the given input buffer . * @ param error the parse error * @ param formatter the formatter for InvalidInputErrors * @ return the pretty print text */ public static String printParseError ( ParseError error , Formatter < In...
checkArgNotNull ( error , "error" ) ; checkArgNotNull ( formatter , "formatter" ) ; String message = error . getErrorMessage ( ) != null ? error . getErrorMessage ( ) : error instanceof InvalidInputError ? formatter . format ( ( InvalidInputError ) error ) : error . getClass ( ) . getSimpleName ( ) ; return printErrorM...
public class Handshaker { /** * The previous caller failed for some reason , report back the * Exception . We won ' t worry about Error ' s . * Locked by SSLEngine . this . */ void checkThrown ( ) throws SSLException { } }
synchronized ( thrownLock ) { if ( thrown != null ) { String msg = thrown . getMessage ( ) ; if ( msg == null ) { msg = "Delegated task threw Exception/Error" ; } /* * See what the underlying type of exception is . We should * throw the same thing . Chain thrown to the new exception . */ Exception e = thrown ; thrown...
public class ImageComponent { /** * Returns the transformation that is applied to the image . Most commonly the transformation * is the concatenation of a uniform scale and a translation . * The < code > AffineTransform < / code > * instance returned by this method should not be modified . * @ return the transf...
if ( getImage ( ) == null ) throw new IllegalStateException ( "No image" ) ; if ( ! hasSize ( ) ) throw new IllegalStateException ( "Viewer size is zero" ) ; double currentZoom ; switch ( resizeStrategy ) { case NO_RESIZE : currentZoom = 1 ; break ; case SHRINK_TO_FIT : currentZoom = Math . min ( getSizeRatio ( ) , 1 )...
public class Adresse { /** * Liefert eine Adresse mit den uebergebenen Parametern . * @ param ort the ort * @ param strasse the strasse * @ param hausnummer the hausnummer * @ return Adresse * @ since 2.1 */ public static Adresse of ( Ort ort , String strasse , int hausnummer ) { } }
return of ( ort , strasse , Integer . toString ( hausnummer ) ) ;
public class StandardCovarianceMatrixBuilder { /** * Compute Covariance Matrix for a collection of database IDs . * @ param ids a collection of ids * @ param database the database used * @ return Covariance Matrix */ @ Override public double [ ] [ ] processIds ( DBIDs ids , Relation < ? extends NumberVector > dat...
return CovarianceMatrix . make ( database , ids ) . destroyToPopulationMatrix ( ) ;
public class CommerceShipmentItemUtil { /** * Returns the first commerce shipment item in the ordered set where commerceShipmentId = & # 63 ; . * @ param commerceShipmentId the commerce shipment ID * @ param orderByComparator the comparator to order the set by ( optionally < code > null < / code > ) * @ return th...
return getPersistence ( ) . findByCommerceShipment_First ( commerceShipmentId , orderByComparator ) ;
public class ByteArrayISO8859Writer { public void write ( char c ) throws IOException { } }
ensureSpareCapacity ( 1 ) ; if ( c >= 0 && c <= 0x7f ) _buf [ _size ++ ] = ( byte ) c ; else { char [ ] ca = { c } ; writeEncoded ( ca , 0 , 1 ) ; }
public class AbstractExecutorService { /** * Returns a { @ code RunnableFuture } for the given runnable and default * value . * @ param runnable the runnable task being wrapped * @ param value the default value for the returned future * @ param < T > the type of the given value * @ return a { @ code RunnableF...
return new FutureTask < T > ( runnable , value ) ;
public class ExcelFunctions { /** * Converts time stored in text to an actual time */ public static OffsetTime timevalue ( EvaluationContext ctx , Object text ) { } }
return Conversions . toTime ( text , ctx ) ;
public class TenantService { /** * Verify that the given tenant and command can be accessed using by the user * represented by the given userID and password . An { @ link UnauthorizedException } is * thrown if the given credentials are invalid for the given tenant / command or if the * user has insufficient right...
// So we can allow / _ logs and other commands before the DBService has initialized , // allow valid privileged commands without checking the tenant . if ( isPrivileged ) { if ( ! isValidSystemCredentials ( userid , password ) ) { throw new UnauthorizedException ( "Unrecognized system user id/password" ) ; } return ; }...
public class StringGroovyMethods { /** * Replaces sequences of whitespaces with tabs . * @ param self A CharSequence to unexpand * @ param tabStop The number of spaces a tab represents * @ return an unexpanded String * @ since 1.8.2 */ public static String unexpand ( CharSequence self , int tabStop ) { } }
String s = self . toString ( ) ; if ( s . length ( ) == 0 ) return s ; try { StringBuilder builder = new StringBuilder ( ) ; for ( String line : readLines ( ( CharSequence ) s ) ) { builder . append ( unexpandLine ( line , tabStop ) ) ; builder . append ( "\n" ) ; } // remove the normalized ending line ending if it was...
public class IR { /** * It isn ' t possible to always determine if a detached node is a expression , * so make a best guess . */ public static boolean mayBeExpression ( Node n ) { } }
switch ( n . getToken ( ) ) { case FUNCTION : case CLASS : // FUNCTION and CLASS are used both in expression and statement // contexts . return true ; case ADD : case AND : case ARRAYLIT : case ASSIGN : case ASSIGN_BITOR : case ASSIGN_BITXOR : case ASSIGN_BITAND : case ASSIGN_LSH : case ASSIGN_RSH : case ASSIGN_URSH : ...
public class EditableComboBoxAutoCompletion { /** * Handle a key release event . See if what they ' ve type so far matches anything in the * selectable items list . If so , then show the popup and select the item . If not , then * hide the popup . * @ param e key event */ public void keyReleased ( KeyEvent e ) { ...
char ch = e . getKeyChar ( ) ; if ( ch == KeyEvent . CHAR_UNDEFINED || Character . isISOControl ( ch ) ) return ; int pos = editor . getCaretPosition ( ) ; String str = editor . getText ( ) ; if ( str . length ( ) == 0 ) return ; boolean matchFound = false ; for ( int k = 0 ; k < comboBox . getItemCount ( ) ; k ++ ) { ...
public class BundleUtils { /** * Returns a optional byte array value . In other words , returns the value mapped by key if it exists and is a byte array . * The bundle argument is allowed to be { @ code null } . If the bundle is null , this method returns null . * @ param bundle a bundle . If the bundle is null , t...
if ( bundle == null ) { return fallback ; } return bundle . getByteArray ( key ) ;
public class Layout { /** * The size of the ViewPort ( virtual area used by the list rendering engine ) * If { @ link Layout # mViewPort } is set to true the ViewPort is applied during layout . * The unlimited size can be specified for the layout . * @ param enable true to apply the view port , false - otherwise ...
if ( mViewPort . isClippingEnabled ( ) != enable ) { mViewPort . enableClipping ( enable ) ; if ( mContainer != null ) { mContainer . onLayoutChanged ( this ) ; } }
public class DefaultHistoryReferencesTableModel { /** * Removes and returns all the row indexes greater than or equal to { @ code fromRowIndex } contained in { @ code rowIndexes } . * @ param fromRowIndex the start row index * @ return the removed row indexes * @ see # rowIndexes */ private RowIndex [ ] removeRow...
SortedSet < RowIndex > indexes = rowIndexes . tailSet ( fromRowIndex ) ; RowIndex [ ] removedIndexes = new RowIndex [ indexes . size ( ) ] ; removedIndexes = indexes . toArray ( removedIndexes ) ; indexes . clear ( ) ; return removedIndexes ;
public class OperationsInner { /** * Gets a list of compute operations . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ return the observable to the List & lt ; OperationValueInner & gt ; object */ public Observable < List < OperationValueInner > > listAsync ( ) { } }
return listWithServiceResponseAsync ( ) . map ( new Func1 < ServiceResponse < List < OperationValueInner > > , List < OperationValueInner > > ( ) { @ Override public List < OperationValueInner > call ( ServiceResponse < List < OperationValueInner > > response ) { return response . body ( ) ; } } ) ;
public class LongExtensions { /** * The binary < code > equals < / code > operator . This is the equivalent to the Java < code > = = < / code > operator . * @ param a a long . * @ param b a double . * @ return < code > a = = b < / code > * @ since 2.3 */ @ Pure @ Inline ( value = "($1 == $2)" , constantExpressi...
return a == b ;
public class SoundPagingQuery { /** * Specify a field to return in the results using the Fluent API approach . Users may specify this method multiple * times to define the collection of fields they want returning , and / or use * { @ link SoundPagingQuery # includeFields ( Set ) } to define them as a batch . * @ ...
if ( this . fields == null ) { this . fields = new HashSet < > ( ) ; } if ( field != null ) { this . fields . add ( field ) ; } return ( Q ) this ;
public class HudsonPrivateSecurityRealm { /** * Try to make this user a super - user */ private void tryToMakeAdmin ( User u ) { } }
AuthorizationStrategy as = Jenkins . getInstance ( ) . getAuthorizationStrategy ( ) ; for ( PermissionAdder adder : ExtensionList . lookup ( PermissionAdder . class ) ) { if ( adder . add ( as , u , Jenkins . ADMINISTER ) ) { return ; } }
public class Util { /** * Frees the memory for the given direct buffer */ private static void free ( ByteBuffer buf ) { } }
Cleaner cleaner = ( ( DirectBuffer ) buf ) . cleaner ( ) ; if ( cleaner != null ) { cleaner . clean ( ) ; }
public class HessianOutput { /** * Writes any object to the output stream . */ public void writeObject ( Object object ) throws IOException { } }
if ( object == null ) { writeNull ( ) ; return ; } Serializer serializer ; serializer = _serializerFactory . getSerializer ( object . getClass ( ) ) ; serializer . writeObject ( object , this ) ;
public class Equation { /** * Operators which affect the variables to its left and right */ protected static boolean isOperatorLR ( Symbol s ) { } }
if ( s == null ) return false ; switch ( s ) { case ELEMENT_DIVIDE : case ELEMENT_TIMES : case ELEMENT_POWER : case RDIVIDE : case LDIVIDE : case TIMES : case POWER : case PLUS : case MINUS : case ASSIGN : return true ; } return false ;
public class JavacState { /** * Utility method to recursively find all files below a directory . */ private static Set < File > findAllFiles ( File dir ) { } }
Set < File > foundFiles = new HashSet < > ( ) ; if ( dir == null ) { return foundFiles ; } recurse ( dir , foundFiles ) ; return foundFiles ;
public class AmazonElastiCacheClient { /** * Reboots some , or all , of the cache nodes within a provisioned cluster . This operation applies any modified cache * parameter groups to the cluster . The reboot operation takes place as soon as possible , and results in a momentary * outage to the cluster . During the ...
request = beforeClientExecution ( request ) ; return executeRebootCacheCluster ( request ) ;
public class DBScan { /** * Performs DBSCAN cluster analysis . * @ param points the points to cluster * @ return the list of clusters * @ throws NullArgumentException if the data points are null */ public List < Cluster > cluster ( final Collection < Point2D > points ) { } }
final List < Cluster > clusters = new ArrayList < Cluster > ( ) ; final Map < Point2D , PointStatus > visited = new HashMap < Point2D , DBScan . PointStatus > ( ) ; KDTree < Point2D > tree = new KDTree < Point2D > ( 2 ) ; // Populate the kdTree for ( final Point2D point : points ) { double [ ] key = { point . x , point...
public class NotificationConfigurationStaxUnmarshaller { /** * Id ( aka configuration name ) isn ' t modeled on the actual { @ link NotificationConfiguration } * class but as the key name in the map of configurations in * { @ link BucketNotificationConfiguration } */ @ Override public Entry < String , NotificationC...
int originalDepth = context . getCurrentDepth ( ) ; int targetDepth = originalDepth + 1 ; if ( context . isStartOfDocument ( ) ) { targetDepth += 1 ; } T topicConfig = createConfiguration ( ) ; String id = null ; while ( true ) { XMLEvent xmlEvent = context . nextEvent ( ) ; if ( xmlEvent . isEndDocument ( ) ) { return...
public class CPAttachmentFileEntryLocalServiceBaseImpl { /** * Returns the cp attachment file entry matching the UUID and group . * @ param uuid the cp attachment file entry ' s UUID * @ param groupId the primary key of the group * @ return the matching cp attachment file entry * @ throws PortalException if a m...
return cpAttachmentFileEntryPersistence . findByUUID_G ( uuid , groupId ) ;
public class FragmentManagerUtils { /** * Find a fragment that is under { @ link android . support . v4 . app . FragmentManager } ' s control by the id . * @ param manager the fragment manager . * @ param id the fragment id . * @ param < F > the concrete fragment class parameter . * @ return the fragment . */ @...
return ( F ) manager . findFragmentById ( id ) ;
public class DataWriterBuilder { /** * Tell the writer which branch it is associated with . * @ param branch branch index * @ return this { @ link DataWriterBuilder } instance */ public DataWriterBuilder < S , D > forBranch ( int branch ) { } }
this . branch = branch ; log . debug ( "For branch: {}" , this . branch ) ; return this ;
public class IOUtil { /** * 一次性读入纯文本 * @ param path * @ return */ public static String readTxt ( String path ) { } }
if ( path == null ) return null ; try { InputStream in = IOAdapter == null ? new FileInputStream ( path ) : IOAdapter . open ( path ) ; byte [ ] fileContent = new byte [ in . available ( ) ] ; int read = readBytesFromOtherInputStream ( in , fileContent ) ; in . close ( ) ; // 处理 UTF - 8 BOM if ( read >= 3 && fileConten...
public class GVRTransform { /** * Modify the transform ' s current rotation in angle / axis terms , around a * pivot other than the origin . * @ param angle * Angle of rotation in degrees . * @ param axisX * ' X ' component of the axis . * @ param axisY * ' Y ' component of the axis . * @ param axisZ ...
NativeTransform . rotateByAxisWithPivot ( getNative ( ) , angle * TO_RADIANS , axisX , axisY , axisZ , pivotX , pivotY , pivotZ ) ;
public class CmsWrapperPreference { /** * Returns the first non - null value . < p > * @ param a a value * @ param b another value * @ return the first non - null value */ String firstNotNull ( String a , String b ) { } }
return a != null ? a : b ;
public class SortUtil { /** * See http : / / stereopsis . com / radix . html for more details . */ public static void putDoubleNormalizedKey ( double value , MemorySegment target , int offset , int numBytes ) { } }
long lValue = Double . doubleToLongBits ( value ) ; lValue ^= ( ( lValue >> ( Long . SIZE - 1 ) ) | Long . MIN_VALUE ) ; NormalizedKeyUtil . putUnsignedLongNormalizedKey ( lValue , target , offset , numBytes ) ;
public class TopicsDetectionJobPropertiesMarshaller { /** * Marshall the given parameter object . */ public void marshall ( TopicsDetectionJobProperties topicsDetectionJobProperties , ProtocolMarshaller protocolMarshaller ) { } }
if ( topicsDetectionJobProperties == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( topicsDetectionJobProperties . getJobId ( ) , JOBID_BINDING ) ; protocolMarshaller . marshall ( topicsDetectionJobProperties . getJobName ( ) , JOBNAME_BIND...
public class MoskitoHttpServlet { /** * Override this method to react on http trace method . */ protected void moskitoDoTrace ( HttpServletRequest req , HttpServletResponse res ) throws ServletException , IOException { } }
super . doTrace ( req , res ) ;
public class IfcPropertyDefinitionImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ SuppressWarnings ( "unchecked" ) public EList < IfcRelAssociates > getHasAssociations ( ) { } }
return ( EList < IfcRelAssociates > ) eGet ( Ifc2x3tc1Package . Literals . IFC_PROPERTY_DEFINITION__HAS_ASSOCIATIONS , true ) ;
public class AbstractTTTLearner { /** * Performs a membership query , using an access sequence as its prefix . * @ param accessSeqProvider * the object from which to obtain the access sequence * @ param suffix * the suffix part of the query * @ return the output */ protected D query ( AccessSequenceProvider <...
return query ( accessSeqProvider . getAccessSequence ( ) , suffix ) ;
public class EigenvalueDecomposition { /** * Nonsymmetric reduction to Hessenberg form . */ private void orthes ( ) { } }
// FIXME : does this fail on NaN / inf values ? // This is derived from the Algol procedures orthes and ortran , // by Martin and Wilkinson , Handbook for Auto . Comp . , // Vol . ii - Linear Algebra , and the corresponding // Fortran subroutines in EISPACK . final int low = 0 , high = n - 1 ; for ( int m = low + 1 ; m...
public class JPAEMFactory { /** * Instance serialization . */ private void writeObject ( java . io . ObjectOutputStream out ) throws IOException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . entry ( tc , "writeObject : " + ivPuId + ", " + ivJ2eeName ) ; out . writeObject ( ivPuId ) ; out . writeObject ( ivJ2eeName ) ; // d510184 if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) Tr . exit ( tc , "writeOb...