signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class RepeatedFieldBuilder { /** * Increments the mod counts so that an ConcurrentModificationException can be thrown if calling * code tries to modify the builder while its iterating the list . */ private void incrementModCounts ( ) { } }
if ( externalMessageList != null ) { externalMessageList . incrementModCount ( ) ; } if ( externalBuilderList != null ) { externalBuilderList . incrementModCount ( ) ; } if ( externalMessageOrBuilderList != null ) { externalMessageOrBuilderList . incrementModCount ( ) ; }
public class BooleanUtils { /** * < p > Converts an int to a boolean specifying the conversion values . < / p > * < pre > * BooleanUtils . toBoolean ( 0 , 1 , 0 ) = false * BooleanUtils . toBoolean ( 1 , 1 , 0 ) = true * BooleanUtils . toBoolean ( 2 , 1 , 2 ) = false * BooleanUtils . toBoolean ( 2 , 2 , 0 ) =...
if ( value == trueValue ) { return true ; } if ( value == falseValue ) { return false ; } // no match throw new IllegalArgumentException ( "The Integer did not match either specified value" ) ;
public class GeoServiceGeometry { /** * Convert a Point and LocationType into a Feature . * @ param point the Point * @ param locationType the LocationType * @ return the Feature */ private static Feature createLocation ( final Point point , final LocationType locationType ) { } }
final Feature location = new Feature ( ) ; location . setGeometry ( point ) ; location . setProperty ( "locationType" , locationType ) ; location . setId ( "location" ) ; return location ;
public class CQLService { /** * Return true if the given table exists in the given keyspace . */ private boolean storeExists ( String tableName ) { } }
KeyspaceMetadata ksMetadata = m_cluster . getMetadata ( ) . getKeyspace ( m_keyspace ) ; return ( ksMetadata != null ) && ( ksMetadata . getTable ( tableName ) != null ) ;
public class Signature { /** * Prepend arguments ( names + types ) to the signature . * @ param names the names of the arguments * @ param types the types of the arguments * @ return a new signature with the added arguments */ public Signature prependArgs ( String [ ] names , Class < ? > ... types ) { } }
String [ ] newArgNames = new String [ argNames . length + names . length ] ; System . arraycopy ( argNames , 0 , newArgNames , names . length , argNames . length ) ; System . arraycopy ( names , 0 , newArgNames , 0 , names . length ) ; MethodType newMethodType = methodType . insertParameterTypes ( 0 , types ) ; return ...
public class AffineGapAlignmentScoring { /** * Returns AminoAcid BLAST scoring * @ param matrix BLAST substitution matrix to be used * @ param gapOpenPenalty penalty for opening gap to be used in system * @ param gapExtensionPenalty penalty for extending gap to be used in system * @ return AminoAcid BLAST scori...
return new AffineGapAlignmentScoring < > ( AminoAcidSequence . ALPHABET , matrix . getMatrix ( ) , gapOpenPenalty , gapExtensionPenalty ) ;
public class ImageLoading { /** * Saving image in bmp to file * @ param src source image * @ param fileName destination file name * @ throws ImageSaveException if it is unable to save image */ public static void saveBmp ( Bitmap src , String fileName ) throws ImageSaveException { } }
try { BitmapUtil . save ( src , fileName ) ; } catch ( IOException e ) { throw new ImageSaveException ( e ) ; }
public class StatementUtil { /** * 创建批量操作的 { @ link PreparedStatement } * @ param conn 数据库连接 * @ param sql SQL语句 , 使用 " ? " 做为占位符 * @ param paramsBatch " ? " 对应参数批次列表 * @ return { @ link PreparedStatement } * @ throws SQLException SQL异常 * @ since 4.1.13 */ public static PreparedStatement prepareStatementFor...
return prepareStatementForBatch ( conn , sql , new ArrayIter < Object [ ] > ( paramsBatch ) ) ;
public class ModuleApiKeys { /** * Fetch all delivery api keys from the given space . * This method will override the configuration specified through * { @ link CMAClient . Builder # setSpaceId ( String ) } and will ignore * { @ link CMAClient . Builder # setEnvironmentId ( String ) } . * @ param spaceId the id...
assertNotNull ( spaceId , "spaceId" ) ; return service . fetchAll ( spaceId ) . blockingFirst ( ) ;
public class DeleteResults { /** * Creates new instance of immutable container for results of Delete Operation * @ param results map with results of Delete Operation * @ param < T > type of objects * @ return new instance of { @ link DeleteResults } */ @ NonNull public static < T > DeleteResults < T > newInstance...
return new DeleteResults < T > ( results ) ;
public class TenantService { /** * Get the { @ link Tenant } object for the tenant with the given name . This is a * convenience method that calls { @ link # getTenantDefinition ( String ) } and either * returns null or calls < code > new Teanant ( tenantDef ) < / code > using the tenant * definition found . * ...
if ( tenantName . equals ( m_defaultTenantName ) ) { return getDefaultTenant ( ) ; } checkServiceState ( ) ; TenantDefinition tenantDef = getTenantDefinition ( tenantName ) ; if ( tenantDef == null ) { return null ; } return new Tenant ( tenantDef ) ;
public class XlsMapper { /** * Excelファイルの複数シートを読み込み 、 任意のクラスにマップする 。 * < p > 複数のシートの形式を一度に読み込む際に使用します 。 < / p > * @ param xlsIn 読み込み元のExcelファイルのストリーム 。 * @ param classes マッピング先のクラスタイプの配列 。 * @ return マッピングした複数のシート 。 * { @ link Configuration # isIgnoreSheetNotFound ( ) } の値がtrueで 、 シートが見つからない場合 、 マッピ...
return loader . loadMultiple ( xlsIn , classes ) ;
public class ZooKeeperClient { /** * { @ inheritDoc } */ @ Override public void destroy ( ) { } }
try { _destroyNodeWatcher ( ) ; } catch ( Exception e ) { LOGGER . warn ( e . getMessage ( ) , e ) ; } try { _close ( ) ; } catch ( Exception e ) { LOGGER . warn ( e . getMessage ( ) , e ) ; } super . destroy ( ) ;
public class ManualHttpRequestEditorDialog { /** * Return the footer status bar object * @ return */ protected JToolBar getFooterStatusBar ( ) { } }
if ( footerToolbar == null ) { footerToolbar = new JToolBar ( ) ; footerToolbar . setEnabled ( true ) ; footerToolbar . setFloatable ( false ) ; footerToolbar . setRollover ( true ) ; footerToolbar . setName ( "Footer Toolbar Left" ) ; footerToolbar . setBorder ( BorderFactory . createEtchedBorder ( ) ) ; } return foot...
public class CDKRMapHandler { /** * This makes atom map of matching atoms out of atom map of matching bonds as produced by the get ( Subgraph | Ismorphism ) Map methods . * Added by Asad since CDK one doesn ' t pick up the correct changes * @ param list The list produced by the getMap method . * @ param sourceGra...
if ( list == null ) { return null ; } Map < IBond , IBond > bondMap = new HashMap < IBond , IBond > ( list . size ( ) ) ; for ( CDKRMap solBondMap : list ) { int id1 = solBondMap . getId1 ( ) ; int id2 = solBondMap . getId2 ( ) ; IBond qBond = sourceGraph . getBond ( id1 ) ; IBond tBond = targetGraph . getBond ( id2 ) ...
public class StageServiceImpl { /** * Gets the stage . * @ param swb the waveBean holding default values * @ param scene the scene * @ return the stage */ private Stage getStage ( final StageWaveBean swb , final Scene scene ) { } }
Stage stage = swb . stage ( ) ; if ( stage == null ) { stage = new Stage ( ) ; } stage . setScene ( scene ) ; return stage ;
public class MyAboutMePage { /** * public SamplePage assertSocialButtons ( SocialButtonsAssert socialButtonsAssert ) { */ protected WebElement getSocialIcon ( String social ) { } }
logger . debug ( "getSocialIcon " + social ) ; By linkLocator = By . cssSelector ( "a." + social ) ; WebElement foundSocialIcon = null ; for ( WebElement socialIcon : socialIcons ) { try { socialIcon . findElement ( linkLocator ) ; foundSocialIcon = socialIcon ; } catch ( NoSuchElementException e ) { continue ; } } ass...
public class MoneyUtils { /** * Adds two { @ code Money } objects , handling null . * This returns { @ code money1 + money2 } where null is ignored . * If both input values are null , then null is returned . * @ param money1 the first money instance , null returns money2 * @ param money2 the first money instanc...
if ( money1 == null ) { return money2 ; } if ( money2 == null ) { return money1 ; } return money1 . plus ( money2 ) ;
public class IntStreamEx { /** * Produces an array containing cumulative results of applying the * accumulation function going left to right . * This is a terminal operation . * For parallel stream it ' s not guaranteed that accumulator will always be * executed in the same thread . * This method cannot take ...
Spliterator . OfInt spliterator = spliterator ( ) ; long size = spliterator . getExactSizeIfKnown ( ) ; IntBuffer buf = new IntBuffer ( size >= 0 && size <= Integer . MAX_VALUE ? ( int ) size : INITIAL_SIZE ) ; delegate ( spliterator ) . forEachOrdered ( i -> buf . add ( buf . size == 0 ? i : accumulator . applyAsInt (...
public class VictimsSQL { /** * Given a an sql query containing the string " IN ( ? ) " and a set of strings , * this method constructs a query by safely replacing the first occurence of * " IN ( ? ) " with " IN ( ' v1 ' , ' v2 ' . . . ) " , where v1 , v2 , . . are in values . * @ param query * @ param values ...
String replace = "IN (?)" ; assert query . lastIndexOf ( replace ) == query . indexOf ( replace ) ; String sql = query . replace ( "IN (?)" , "IN (%s)" ) ; StringBuffer list = new StringBuffer ( ) ; for ( String value : values ) { if ( list . length ( ) > 0 ) { list . append ( "," ) ; } value = String . format ( "'%s'"...
public class NondominatedPopulation { /** * only add solution if solution is not worse than any solution in the non - dominated population */ @ Override public boolean add ( Solution solution_to_add ) { } }
List < Solution > solutions_to_remove = new ArrayList < > ( ) ; boolean should_add = true ; for ( Solution solution : solutions ) { int flag = invertedCompare ( solution_to_add , solution ) ; if ( flag < 0 ) // solution _ to _ add is better { solutions_to_remove . add ( solution ) ; } else if ( flag > 0 ) // solution i...
public class Utils { /** * アノテーションの指定した属性値を取得する 。 * < p > アノテーションの修飾子はpublicである必要があります 。 < / p > * @ param anno アノテーションのインスタンス * @ param attrName 属性名 * @ param attrType 属性のタイプ 。 * @ return 属性を持たない場合 、 空を返す 。 */ @ SuppressWarnings ( "unchecked" ) public static < T > Optional < T > getAnnotationAttribute ( f...
try { final Method method = anno . annotationType ( ) . getMethod ( attrName ) ; method . setAccessible ( true ) ; if ( ! attrType . equals ( method . getReturnType ( ) ) ) { return Optional . empty ( ) ; } final Object value = method . invoke ( anno ) ; return Optional . of ( ( T ) value ) ; } catch ( Exception e ) { ...
public class BusinessUtils { /** * Returns an arrays of all identifier class corresponding the the given array of aggregate root * classes . */ public static Class < ? > [ ] getAggregateIdClasses ( Class < ? extends AggregateRoot < ? > > [ ] aggregateRootClasses ) { } }
checkNotNull ( aggregateRootClasses , "aggregateRootClasses should not be null" ) ; Class < ? > [ ] result = new Class < ? > [ aggregateRootClasses . length ] ; for ( int i = 0 ; i < aggregateRootClasses . length ; i ++ ) { result [ i ] = resolveGenerics ( AggregateRoot . class , aggregateRootClasses [ i ] ) [ 0 ] ; } ...
public class Utils4J { /** * CHECKSTYLE : OFF */ public static String createWindowsDesktopUrlLinkContent ( final String baseUrl , final String url , final File workingDir , final Integer showCommand , final Integer iconIndex , final File iconFile , final Integer hotKey , final Date modified ) { } }
// CHECKSTYLE : ON checkNotNull ( "baseUrl" , baseUrl ) ; checkNotEmpty ( "baseUrl" , baseUrl ) ; checkNotNull ( "url" , url ) ; checkNotEmpty ( "url" , url ) ; final StringBuilder sb = new StringBuilder ( ) ; sb . append ( "[DEFAULT]\r\n" ) ; sb . append ( "BASEURL=" + baseUrl + "\r\n" ) ; sb . append ( "\r\n" ) ; sb ...
public class NBTIO { /** * Reads an NBT tag . * @ param in Data input to read from . * @ return The read tag , or null if the tag is an end tag . * @ throws java . io . IOException If an I / O error occurs . */ public static Tag readTag ( DataInput in ) throws IOException { } }
int id = in . readUnsignedByte ( ) ; if ( id == 0 ) { return null ; } String name = in . readUTF ( ) ; Tag tag ; try { tag = TagRegistry . createInstance ( id , name ) ; } catch ( TagCreateException e ) { throw new IOException ( "Failed to create tag." , e ) ; } tag . read ( in ) ; return tag ;
public class BeanGen { private void generateMetaGetPropertyValue ( ) { } }
if ( properties . size ( ) == 0 ) { return ; } data . ensureImport ( Bean . class ) ; addLine ( 2 , "@Override" ) ; addLine ( 2 , "protected Object propertyGet(Bean bean, String propertyName, boolean quiet) {" ) ; addLine ( 3 , "switch (propertyName.hashCode()) {" ) ; for ( PropertyGen prop : properties ) { addLines ( ...
public class MapEntryLite { /** * Parses an entry off of the input as a { @ link Map . Entry } . This helper requires an allocation so using * { @ link # parseInto } is preferred if possible . * @ param bytes the bytes * @ param extensionRegistry the extension registry * @ return the map . entry * @ throws IO...
return parseEntry ( bytes . newCodedInput ( ) , metadata , extensionRegistry ) ;
public class TranslateTextRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( TranslateTextRequest translateTextRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( translateTextRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( translateTextRequest . getText ( ) , TEXT_BINDING ) ; protocolMarshaller . marshall ( translateTextRequest . getTerminologyNames ( ) , TERMINOLOGYNAMES_BINDING ) ; ...
public class CPOptionValueUtil { /** * Returns a range of all the cp option values where CPOptionId = & # 63 ; . * Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and < code > end < / code > are not primary keys , they are indexes in the resu...
return getPersistence ( ) . findByCPOptionId ( CPOptionId , start , end ) ;
public class HttpStopwatchSource { /** * Indicates whether the HTTP Request should be monitored - method is intended for override . * Default behavior ignores URIs ending with . css , . png , . gif , . jpg and . js ( ignores casing ) . * @ param httpServletRequest HTTP Request * @ return true to enable request mo...
String uri = httpServletRequest . getRequestURI ( ) . toLowerCase ( ) ; return ! ( uri . endsWith ( ".css" ) || uri . endsWith ( ".png" ) || uri . endsWith ( ".gif" ) || uri . endsWith ( ".jpg" ) || uri . endsWith ( ".js" ) ) ;
public class FlipTileSkin { /** * * * * * * Initialization * * * * * */ @ Override protected void initGraphics ( ) { } }
super . initGraphics ( ) ; timeline = new Timeline ( ) ; characters = tile . getCharacterList ( ) ; currentSelectionIndex = 0 ; nextSelectionIndex = 1 ; centerX = PREFERRED_WIDTH * 0.5 ; centerY = PREFERRED_HEIGHT * 0.5 ; pane . setBackground ( null ) ; pane . setBorder ( null ) ; rotateFlap = new Rotate ( ) ; rotateFl...
public class ScopedServletUtils { /** * Get a URI relative to a given webapp root . * @ param contextPath the webapp context path , e . g . , " / myWebapp " * @ param uri the URI which should be made relative . */ public static final String getRelativeURI ( String contextPath , String uri ) { } }
String requestUrl = uri ; int overlap = requestUrl . indexOf ( contextPath + '/' ) ; assert overlap != - 1 : "contextPath: " + contextPath + ", uri: " + uri ; return requestUrl . substring ( overlap + contextPath . length ( ) ) ;
public class AnnotationMappingInfo { /** * 指定したクラス情報を削除します 。 * @ since 1.4.1 * @ param className FQCN ( 完全限定クラス名 ) を指定します 。 * @ return true : 指定したクラス名を含み 、 それが削除できた場合 。 */ public boolean removeClassInfo ( final String className ) { } }
final ClassInfo existInfo = getClassInfo ( className ) ; if ( existInfo != null ) { this . classInfos . remove ( existInfo ) ; return true ; } return false ;
public class LByteToCharFunctionBuilder { /** * One of ways of creating builder . This is possibly the least verbose way where compiler should be able to guess the generic parameters . */ @ Nonnull public static LByteToCharFunction byteToCharFunctionFrom ( Consumer < LByteToCharFunctionBuilder > buildingFunction ) { } ...
LByteToCharFunctionBuilder builder = new LByteToCharFunctionBuilder ( ) ; buildingFunction . accept ( builder ) ; return builder . build ( ) ;
public class FileSystemServlet { /** * { @ inheritDoc } */ protected void doDelete ( HttpServletRequest req , HttpServletResponse resp ) throws ServletException , IOException { } }
String path = req . getPathInfo ( ) ; String context ; if ( path == null ) { path = req . getServletPath ( ) ; context = req . getContextPath ( ) ; } else { context = req . getContextPath ( ) + req . getServletPath ( ) ; } Entry entry = fileSystem . get ( path ) ; if ( entry == null ) { resp . setStatus ( HttpURLConnec...
public class BeanMap { /** * Convenience method for getting an iterator over the values . * @ return an iterator over the values */ public Iterator < Object > valueIterator ( ) { } }
final Iterator < String > iter = keyIterator ( ) ; return new Iterator < Object > ( ) { public boolean hasNext ( ) { return iter . hasNext ( ) ; } public Object next ( ) { String key = iter . next ( ) ; return get ( key ) ; } public void remove ( ) { throw new UnsupportedOperationException ( "remove() not supported for...
public class BlockBrowser { /** * This is called when the browser canvas is clicked */ private void canvasClick ( int x , int y ) { } }
// always called listeners for ( CanvasClickListener listener : canvasClickAlwaysListeners ) listener . canvasClicked ( x , y ) ; // selected listener by toggle buttons for ( JToggleButton button : canvasClickToggleListeners . keySet ( ) ) { if ( button . isSelected ( ) ) canvasClickToggleListeners . get ( button ) . c...
public class EnvelopePayloadConverter { /** * Convert to the output value of a field */ protected Object convertFieldValue ( Schema outputSchema , Field field , GenericRecord inputRecord , WorkUnitState workUnit ) throws DataConversionException { } }
if ( field . name ( ) . equals ( payloadField ) ) { return upConvertPayload ( inputRecord ) ; } return inputRecord . get ( field . name ( ) ) ;
public class TargetSpecifications { /** * { @ link Specification } for retrieving { @ link Target } s including * { @ link TargetTag } s . * @ param controllerIDs * to search for * @ return the { @ link Target } { @ link Specification } */ public static Specification < JpaTarget > byControllerIdWithTagsInJoin (...
return ( targetRoot , query , cb ) -> { final Predicate predicate = targetRoot . get ( JpaTarget_ . controllerId ) . in ( controllerIDs ) ; targetRoot . fetch ( JpaTarget_ . tags , JoinType . LEFT ) ; query . distinct ( true ) ; return predicate ; } ;
public class AbstractArakhneMojo { /** * Copy a file . * @ param in input file . * @ param out output file . * @ throws IOException on error . */ public final void fileCopy ( URL in , File out ) throws IOException { } }
assert in != null ; try ( InputStream inStream = in . openStream ( ) ) { try ( OutputStream outStream = new FileOutputStream ( out ) ) { final byte [ ] buf = new byte [ FILE_BUFFER ] ; int len ; while ( ( len = inStream . read ( buf ) ) > 0 ) { outStream . write ( buf , 0 , len ) ; } } } finally { getBuildContext ( ) ....
public class ScopedMessageHandler { /** * Save message as ( global ) user messages . ( overriding existing messages ) < br > * This message will be deleted immediately after display if you use e . g . la : errors . * @ param property The property name corresponding to the message . ( NotNull ) * @ param messageKe...
assertObjectNotNull ( "messageKey" , messageKey ) ; doSaveInfo ( prepareUserMessages ( property , messageKey , args ) ) ;
public class AbstractObjectQuery { /** * Get the index for a SQLTable if the table is not existing the table is * added and a new index given . * @ param _ sqlTable SQLTable the index is wanted for * @ return index of the SQLTable */ public Integer getIndex4SqlTable ( final SQLTable _sqlTable ) { } }
final Integer ret ; if ( this . sqlTable2Index . containsKey ( _sqlTable ) ) { ret = this . sqlTable2Index . get ( _sqlTable ) ; } else { Integer max = 0 ; for ( final Integer index : this . sqlTable2Index . values ( ) ) { if ( index > max ) { max = index ; } } ret = max + 1 ; this . sqlTable2Index . put ( _sqlTable , ...
public class CloseableIterators { /** * Creates a { @ link com . merakianalytics . datapipelines . iterators . CloseableIterator } wrapper around the provided { @ link java . util . Iterator } * @ param < T > * the type of the { @ link java . util . Iterator } * @ param iterator * the { @ link java . util . Ite...
if ( iterator instanceof CloseableIterator ) { return ( CloseableIterator < T > ) iterator ; } return new CloseableIterator < T > ( ) { @ Override public void close ( ) { // Do nothing } @ Override public boolean hasNext ( ) { return iterator . hasNext ( ) ; } @ Override public T next ( ) { return iterator . next ( ) ;...
public class EntryStream { /** * Returns a sequential { @ link EntryStream } created from given * { @ link Spliterator } . * @ param < K > the type of stream keys * @ param < V > the type of stream values * @ param spliterator a spliterator to create the stream from . * @ return the new stream * @ since 0.3...
return of ( StreamSupport . stream ( spliterator , false ) ) ;
public class ComponentBindingsProviderCache { /** * Registers the ComponentBindingsProvider specified by the * ServiceReference . * @ param reference * the reference to the ComponentBindingsProvider service */ public void registerComponentBindingsProvider ( ServiceReference reference ) { } }
log . info ( "registerComponentBindingsProvider" ) ; log . info ( "Registering Component Bindings Provider {} - {}" , new Object [ ] { reference . getProperty ( Constants . SERVICE_ID ) , reference . getProperty ( Constants . SERVICE_PID ) } ) ; String [ ] resourceTypes = OsgiUtil . toStringArray ( reference . getPrope...
public class SimpleDateFormat { /** * / * Initialize compiledPattern and numberFormat fields */ private void initialize ( Locale loc ) { } }
// Verify and compile the given pattern . compiledPattern = compile ( pattern ) ; /* try the cache first */ numberFormat = cachedNumberFormatData . get ( loc ) ; if ( numberFormat == null ) { /* cache miss */ numberFormat = NumberFormat . getIntegerInstance ( loc ) ; numberFormat . setGroupingUsed ( false ) ; /* update...
public class AsynchronousRequest { /** * For more info on guild treasury API go < a href = " https : / / wiki . guildwars2 . com / wiki / API : 2 / guild / : id / treasury " > here < / a > < br / > * Give user the access to { @ link Callback # onResponse ( Call , Response ) } and { @ link Callback # onFailure ( Call ...
isParamValid ( new ParamChecker ( ParamType . GUILD , id ) , new ParamChecker ( ParamType . API , api ) ) ; gw2API . getGuildTreasuryInfo ( id , api ) . enqueue ( callback ) ;
public class MappedDataCache { /** * Retrieve the value associated with the given key , blocking as long as necessary up to the specified maximum . * @ param k The key . * @ param timeout The length of the timeout . * @ param unit The time unit of the timeout . * @ return The value associated with the key . *...
await ( k , timeout , unit ) ; return cache . get ( k ) ;
public class Sentence { /** * Returns the substring of the sentence from start ( inclusive ) * to end ( exclusive ) . * @ param start Leftmost index of the substring * @ param end Rightmost index of the ngram * @ return The ngram as a String */ public static < T > String extractNgram ( List < T > list , int sta...
if ( start < 0 || end > list . size ( ) || start >= end ) return null ; final StringBuilder sb = new StringBuilder ( ) ; // TODO : iterator for ( int i = start ; i < end ; i ++ ) { T o = list . get ( i ) ; if ( sb . length ( ) != 0 ) sb . append ( " " ) ; sb . append ( ( o instanceof HasWord ) ? ( ( HasWord ) o ) . wor...
public class SendTemplatedEmailRequest { /** * The reply - to email address ( es ) for the message . If the recipient replies to the message , each reply - to address * will receive the reply . * @ param replyToAddresses * The reply - to email address ( es ) for the message . If the recipient replies to the messa...
if ( replyToAddresses == null ) { this . replyToAddresses = null ; return ; } this . replyToAddresses = new com . amazonaws . internal . SdkInternalList < String > ( replyToAddresses ) ;
public class BoundedLinkedList { /** * ( non - Javadoc ) * @ see java . util . LinkedList # addAll ( java . util . Collection ) */ @ Override public boolean addAll ( @ NonNull Collection < ? extends E > collection ) { } }
final int size = collection . size ( ) ; if ( size > maxSize ) { collection = new ArrayList < > ( collection ) . subList ( size - maxSize , size ) ; } final int overhead = size ( ) + collection . size ( ) - maxSize ; if ( overhead > 0 ) { removeRange ( 0 , overhead ) ; } return super . addAll ( collection ) ;
public class ParserDDL { /** * Process a bracketed column list as used in the declaration of SQL * CONSTRAINTS and return an array containing the indexes of the columns * within the table . * @ param table table that contains the columns * @ param ascOrDesc boolean * @ return array of column indexes */ privat...
OrderedHashSet set = readColumnNames ( ascOrDesc ) ; return table . getColumnIndexes ( set ) ;
public class AbstractHttpHandler { public void start ( ) throws Exception { } }
if ( _context == null ) throw new IllegalStateException ( "No context for " + this ) ; _started = true ; if ( log . isDebugEnabled ( ) ) log . debug ( "Started " + this ) ;
public class TridiagonalHelper_DDRB { /** * Computes W from the householder reflectors stored in the columns of the row block * submatrix Y . * Y = v < sup > ( 1 ) < / sup > < br > * W = - & beta ; < sub > 1 < / sub > v < sup > ( 1 ) < / sup > < br > * for j = 2 : r < br > * & nbsp ; & nbsp ; z = - & beta ; (...
final int heightY = Y . row1 - Y . row0 ; CommonOps_DDRM . fill ( W . original , 0 ) ; // W = - beta * v ( 1) BlockHouseHolder_DDRB . scale_row ( blockLength , Y , W , 0 , 1 , - beta [ betaIndex ++ ] ) ; final int min = Math . min ( heightY , W . col1 - W . col0 ) ; // set up rest of the rows for ( int i = 1 ; i < min ...
public class ConfiguratorPanel { /** * Add parameter to this panel . * @ param param Parameter to add * @ param track Parameter tracking object */ public void addParameter ( Object owner , Parameter < ? > param , TrackParameters track ) { } }
this . setBorder ( new SoftBevelBorder ( SoftBevelBorder . LOWERED ) ) ; ParameterConfigurator cfg = null ; { // Find Object cur = owner ; while ( cur != null ) { cfg = childconfig . get ( cur ) ; if ( cfg != null ) { break ; } cur = track . getParent ( cur ) ; } } if ( cfg != null ) { cfg . addParameter ( owner , para...
public class StagePathUtils { /** * 返回对应的process path */ public static String getProcess ( Long pipelineId , String processNode ) { } }
// 根据channelId , pipelineId构造path return MessageFormat . format ( ArbitrateConstants . NODE_PROCESS_FORMAT , getChannelId ( pipelineId ) , String . valueOf ( pipelineId ) , processNode ) ;
public class AbstractPojoPathNavigator { /** * This method { @ link CollectionReflectionUtil # set ( Object , int , Object , GenericBean ) sets } the single * { @ link CachingPojoPath # getSegment ( ) segment } of the given { @ code currentPath } from the array or * { @ link java . util . List } given by { @ code p...
Object arrayOrList = convertList ( currentPath , context , state , parentPojo ) ; GenericBean < Object > arrayReceiver = new GenericBean < > ( ) ; Object convertedValue = value ; if ( currentPath . parent != null ) { GenericType < ? > collectionType = currentPath . parent . pojoType ; if ( collectionType != null ) { Ge...
public class SubnetsInner { /** * Gets all subnets in a virtual network . * @ param resourceGroupName The name of the resource group . * @ param virtualNetworkName The name of the virtual network . * @ throws IllegalArgumentException thrown if parameters fail the validation * @ throws CloudException thrown if t...
ServiceResponse < Page < SubnetInner > > response = listSinglePageAsync ( resourceGroupName , virtualNetworkName ) . toBlocking ( ) . single ( ) ; return new PagedList < SubnetInner > ( response . body ( ) ) { @ Override public Page < SubnetInner > nextPage ( String nextPageLink ) { return listNextSinglePageAsync ( nex...
public class Quaternion { /** * Copies the elements of another quaternion . * @ return a reference to this quaternion , for chaining . */ public Quaternion set ( IQuaternion other ) { } }
return set ( other . x ( ) , other . y ( ) , other . z ( ) , other . w ( ) ) ;
public class FastHashMap { /** * Initializes this instance for the specified capacity . * Once initialized , operations on this map should not create new objects * ( unless the map ' s size exceeds the specified capacity ) . * @ param capacity the initial capacity . */ @ SuppressWarnings ( "unchecked" ) private v...
// Find a power of 2 > = capacity int tableLength = 16 ; while ( tableLength < capacity ) { tableLength <<= 1 ; } // Allocates hash table . _entries = new EntryImpl [ tableLength ] ; _mask = tableLength - 1 ; _capacity = capacity ; _size = 0 ; // Allocates views . _values = new Values ( ) ; _entrySet = new EntrySet ( )...
public class VehicleManager { /** * Change the active vehicle interface to a new type using the given * resource . * To disable all vehicle interfaces , pass null to this function . * The only valid VehicleInterface types are those included with the library * - the vehicle service running in a remote process is...
Log . i ( TAG , "Setting VI to: " + vehicleInterfaceType ) ; String interfaceName = null ; if ( vehicleInterfaceType != null ) { interfaceName = vehicleInterfaceType . getName ( ) ; } if ( mRemoteService != null ) { try { mRemoteService . setVehicleInterface ( interfaceName , resource ) ; } catch ( RemoteException e ) ...
public class HashinatorLite { /** * Given the type of the targeting partition parameter and an object , * coerce the object to the correct type and hash it . * NOTE NOTE NOTE NOTE ! THIS SHOULD BE THE ONLY WAY THAT YOU FIGURE OUT * THE PARTITIONING FOR A PARAMETER ! THIS IS SHARED BY SERVER AND CLIENT * CLIENT ...
final VoltType partitionParamType = VoltType . get ( ( byte ) partitionParameterType ) ; // Special cases : // 1 ) if the user supplied a string for a number column , // try to do the conversion . This makes it substantially easier to // load CSV data or other untyped inputs that match DDL without // requiring the load...
public class JacksonDBCollection { /** * performs a map reduce operation * Runs the command in REPLACE output mode ( saves to named collection ) * @ param map map function in javascript code * @ param outputTarget optional - leave null if want to use temp collection * @ param reduce reduce function in javascrip...
return mapReduce ( new MapReduceCommand ( dbCollection , map , reduce , outputTarget , MapReduceCommand . OutputType . REPLACE , serializeFields ( query ) ) ) ;
public class ExampleMenuAction { /** * { @ inheritDoc } */ @ Override public void execute ( final ActionEvent event ) { } }
if ( event . getActionObject ( ) == null ) { throw new IllegalStateException ( "Missing action object" ) ; } else { selectedMenuText . setText ( event . getActionObject ( ) . toString ( ) ) ; }
public class PubSubInputHandler { /** * Add a msg reference to the proxy subscription reference stream . * @ param msg * @ param tran * @ throws SIResourceException if there is a message store resource problem * @ throws SIStoreException if there is a general problem with the message store . */ private MessageI...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "addProxyReference" , new Object [ ] { msg , tran } ) ; MessageItemReference ref = new MessageItemReference ( msg ) ; // This ensures that the persitence of the MessageItem cannot be downgaded // by the consumerDispatcher be...
public class RsaSignature { /** * See https : / / tools . ietf . org / html / rfc3447 # section - 5.2.2 */ protected BigInteger RSAVP1 ( RSAPublicKey key , BigInteger s ) { } }
if ( key == null ) { throw new IllegalArgumentException ( "key" ) ; } if ( s == null ) { throw new IllegalArgumentException ( "s" ) ; } BigInteger n = key . getModulus ( ) ; BigInteger e = key . getPublicExponent ( ) ; if ( s . compareTo ( BigInteger . ONE ) == - 1 || s . compareTo ( n ) != - 1 ) { throw new IllegalArg...
public class ProjectApi { /** * Get a list of the project ' s issues . * < pre > < code > GET / projects / : id / issues < / code > < / pre > * @ param projectIdOrPath projectIdOrPath the project in the form of an Integer ( ID ) , String ( path ) , or Project instance , required * @ return a list of project ' s i...
return ( getIssues ( projectIdOrPath , getDefaultPerPage ( ) ) . all ( ) ) ;
public class CoverageMethodVisitor { /** * METHOD VISITOR INTERFACE */ @ Override public void visitLdcInsn ( Object cst ) { } }
// We use this method to support accesses to . class . if ( cst instanceof Type ) { int sort = ( ( Type ) cst ) . getSort ( ) ; if ( sort == Type . OBJECT ) { String className = Types . descToInternalName ( ( ( Type ) cst ) . getDescriptor ( ) ) ; insertTInvocation0 ( className , mProbeCounter . incrementAndGet ( ) ) ;...
public class MutableDataPoint { /** * Resets with a new pair of a timestamp and a long value . * @ param timestamp A timestamp . * @ param value A double value . */ public static MutableDataPoint ofLongValue ( final long timestamp , final long value ) { } }
final MutableDataPoint dp = new MutableDataPoint ( ) ; dp . reset ( timestamp , value ) ; return dp ;
public class Agg { /** * Get a { @ link Collector } that calculates the < code > MODE ( ) < / code > function . */ public static < T > Collector < T , ? , Optional < T > > mode ( ) { } }
return mode0 ( seq -> seq . maxBy ( t -> t . v2 ) . map ( t -> t . v1 ) ) ;
public class ChangeLogActivity { /** * Configure the Appbar */ private void configAppBar ( ) { } }
setSupportActionBar ( mAppbar ) ; getSupportActionBar ( ) . setDisplayHomeAsUpEnabled ( true ) ; getSupportActionBar ( ) . setTitle ( R . string . changelog_activity_title ) ; mAppbar . setNavigationOnClickListener ( this ) ;
public class Actors { /** * process messages on the mailbox / callback queue until timeout is reached . In case timeout is 0, * process until mailbox + callback queue is empty . * If called from a non - actor thread , either sleep until timeout or ( if timeout = = 0 ) its a NOP . * @ param timeout */ public stati...
long endtime = 0 ; if ( timeout > 0 ) { endtime = System . currentTimeMillis ( ) + timeout ; } if ( Thread . currentThread ( ) instanceof DispatcherThread ) { DispatcherThread dt = ( DispatcherThread ) Thread . currentThread ( ) ; Scheduler scheduler = dt . getScheduler ( ) ; boolean term = false ; int idleCount = 0 ; ...
public class ST_Perimeter { /** * Compute the perimeter * @ param geometry * @ return */ private static double computePerimeter ( Geometry geometry ) { } }
double sum = 0 ; for ( int i = 0 ; i < geometry . getNumGeometries ( ) ; i ++ ) { Geometry subGeom = geometry . getGeometryN ( i ) ; if ( subGeom instanceof Polygon ) { sum += ( ( Polygon ) subGeom ) . getExteriorRing ( ) . getLength ( ) ; } } return sum ;
public class ComposableFutures { /** * Execute the producer on each element in the list in batches and return a stream of batch results . * Every batch is executed in parallel and the next batch begins only after the previous one ended . * The result of each batch is the next element in the stream . * An error in...
return Observable . create ( subscriber -> batchToStream ( elements , batchSize , 0 , subscriber , producer ) ) ;
public class RequestHelper { /** * Utility method that determines whether the request contains multipart * content . * @ param aHttpRequest * The servlet request to be evaluated . Must be non - null . * @ return < code > true < / code > if the request is multipart ; < code > false < / code > * otherwise . */ ...
if ( getHttpMethod ( aHttpRequest ) != EHttpMethod . POST ) return false ; return isMultipartContent ( aHttpRequest . getContentType ( ) ) ;
public class GenericEncodingStrategy { /** * Generates code to load a property value onto the operand stack . * @ param info info for property to load * @ param ordinal zero - based property ordinal , used only if instanceVar * refers to an object array . * @ param useReadMethod when true , access property by p...
if ( info . isDerived ( ) ) { useReadMethod = true ; } final TypeDesc type = info . getPropertyType ( ) ; final TypeDesc storageType = info . getStorageType ( ) ; final boolean isObjectArrayInstanceVar = instanceVar != null && instanceVar . getType ( ) == TypeDesc . forClass ( Object [ ] . class ) ; final boolean useAd...
public class PropertiesConfigAdapter { /** * Get the value from the properties or use a fallback from the { @ code defaults } . * @ param getter the getter for the properties * @ param fallback the fallback method , usually super interface method reference * @ param < V > the value type * @ return the property ...
V value = getter . apply ( this . properties ) ; return ( value != null ) ? value : fallback . get ( ) ;
public class CmsContentService { /** * Returns the change handler scopes . < p > * @ param definition the content definition * @ return the scopes */ private Set < String > getChangeHandlerScopes ( CmsXmlContentDefinition definition ) { } }
List < I_CmsXmlContentEditorChangeHandler > changeHandlers = definition . getContentHandler ( ) . getEditorChangeHandlers ( ) ; Set < String > scopes = new HashSet < String > ( ) ; for ( I_CmsXmlContentEditorChangeHandler handler : changeHandlers ) { String scope = handler . getScope ( ) ; scopes . addAll ( evaluateSco...
public class EncodedTransport { /** * Add this method param to the param list . * ( By default , uses the property method . . . override this to use an app specific method ) . * NOTE : The param name DOES NOT need to be saved , as params are always added and retrieved in order . * @ param strParam The param name ...
if ( strValue == null ) strValue = NULL ; m_properties . setProperty ( strParam , strValue ) ;
public class FastFuture { /** * Called at least once on complete */ public void onComplete ( final Consumer < OnComplete > fn ) { } }
this . forXOf = fn ; // set - could also be called on a separate thread if ( done ) { // can be called again fn . accept ( buildOnComplete ( ) ) ; }
public class MessageDigestUtility { /** * Calculate the digest specified by byte array of data * @ param messageDigest * @ param data * @ return digest in string with base64 encoding . */ public static String processMessageDigestForData ( MessageDigest messageDigest , byte [ ] data ) { } }
String output = "" ; // $ NON - NLS - 1 $ if ( messageDigest != null ) { // Get the digest for the given data messageDigest . update ( data ) ; byte [ ] digest = messageDigest . digest ( ) ; output = Base64Coder . encode ( digest ) ; } return output ;
public class BindingInstaller { /** * Ensure that the binding for key which exists in the parent Ginjector is also available to the * child Ginjector . */ private void ensureAccessible ( Key < ? > key , GinjectorBindings parent , GinjectorBindings child ) { } }
// Parent will be null if it is was an optional dependency and it couldn ' t be created . if ( parent != null && ! child . equals ( parent ) && ! child . isBound ( key ) ) { PrettyPrinter . log ( logger , TreeLogger . DEBUG , "In %s: inheriting binding for %s from the parent %s" , child , key , parent ) ; Context conte...
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link SphericalCSType } { @ code > } * @ param value * Java instance representing xml element ' s value . * @ return * the new instance of { @ link JAXBElement } { @ code < } { @ link SphericalCSType } { @ code > } *...
return new JAXBElement < SphericalCSType > ( _SphericalCS_QNAME , SphericalCSType . class , null , value ) ;
public class HtmlTree { /** * Generates a DT tag with some content . * @ param body content for the tag * @ return an HtmlTree object for the DT tag */ public static HtmlTree DT ( Content body ) { } }
HtmlTree htmltree = new HtmlTree ( HtmlTag . DT , nullCheck ( body ) ) ; return htmltree ;
public class AsyncSocketConnection { /** * error = null = > ok */ void writeFinished ( Object error ) { } }
checkThread ( ) ; writingBuffer = null ; Promise wp = this . writePromise ; writePromise = null ; if ( ! wp . isSettled ( ) ) { if ( error != null ) wp . reject ( error ) ; else wp . resolve ( ) ; }
public class Formatter { /** * 将Map转换成JSON , 调用对象的toString方法 * @ param map { @ link Map } * @ return { @ link String } */ public static String mapToJsonArray ( Map < ? , ? > map ) { } }
JSONArray array = new JSONArray ( ) ; if ( Checker . isNotEmpty ( map ) ) { map . forEach ( ( key , value ) -> { JSONObject object = new JSONObject ( ) ; object . put ( "key" , key ) ; object . put ( "value" , value ) ; array . add ( object ) ; } ) ; } return formatJson ( array . toString ( ) ) ;
public class MapMapping { /** * Delegates to the underlying { @ link java . util . Map } . * @ see java . util . Map # put ( Object , Object ) */ @ Override public R put ( D key , R value ) { } }
return map . put ( key , value ) ;
public class ShardedCounter { /** * Check if a resource counter has capacity to spare . Can be used as a cheaper check before starting an expensive * operation , e . g . workflow instance dequeue . Note that even if this method returns true , * { @ link # updateCounter ( StorageTransaction , String , long ) } might...
try { final CounterSnapshot counterSnapshot = getCounterSnapshot ( resourceId ) ; counterSnapshot . pickShardWithSpareCapacity ( 1 ) ; return true ; } catch ( CounterCapacityException e ) { return false ; }
public class CommerceUserSegmentEntryPersistenceImpl { /** * Returns all the commerce user segment entries . * @ return the commerce user segment entries */ @ Override public List < CommerceUserSegmentEntry > findAll ( ) { } }
return findAll ( QueryUtil . ALL_POS , QueryUtil . ALL_POS , null ) ;
public class RootConsole { /** * Determines file locations . */ public void setProperties ( Properties properties ) { } }
baseDir = properties . getProperty ( "base_dir" , baseDir ) ; inputFileLocation = baseDir + '/' + properties . getProperty ( "input_file_location" , inputFileLocation ) ; outputFileLocation = baseDir + '/' + properties . getProperty ( "output_file_location" , outputFileLocation ) ; tempOutputFileLocation = baseDir + '/...
public class FleetsApi { /** * Create fleet squad Create a new squad in a fleet - - - SSO Scope : * esi - fleets . write _ fleet . v1 * @ param fleetId * ID for a fleet ( required ) * @ param wingId * The wing _ id to create squad in ( required ) * @ param datasource * The server name you would like data ...
com . squareup . okhttp . Call call = postFleetsFleetIdWingsWingIdSquadsValidateBeforeCall ( fleetId , wingId , datasource , token , null ) ; Type localVarReturnType = new TypeToken < FleetSquadCreatedResponse > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ;
public class Num { /** * Scale both value to scale of number which have minimum scale . * @ param value * @ param autoscale * @ return */ public boolean isEqual ( Object value , boolean autoscale ) { } }
Num numA = this ; Num numB = null ; if ( value instanceof Num ) numB = ( Num ) value ; else numB = new Num ( value ) ; int minScale = numA . remainderSize ( ) ; int bScale = numB . remainderSize ( ) ; if ( bScale < minScale ) minScale = bScale ; return isEqual ( value , minScale ) ;
public class ApplicationListener { /** * { @ inheritDoc } */ @ Override public void applicationStarting ( ApplicationInfo appInfo ) throws StateChangeException { } }
if ( appProcessor != null ) { try { if ( OpenAPIUtils . isEventEnabled ( tc ) ) { Tr . event ( tc , "Application starting process started: " + appInfo ) ; } appProcessor . addApplication ( appInfo ) ; if ( OpenAPIUtils . isEventEnabled ( tc ) ) { Tr . event ( tc , "Application starting process ended: " + appInfo ) ; } ...
public class MailClient { /** * * writes BodyTag data to query , if there is a problem with encoding , encoding will removed a do * it again * @ param qry * @ param columnName * @ param row * @ param bp * @ param body * @ throws IOException * @ throws MessagingException / private void setBody ( Query qr...
InputStream is = null ; try { return getContent ( is = bp . getInputStream ( ) , CharsetUtil . toCharset ( getCharsetFromContentType ( bp . getContentType ( ) ) ) ) ; } catch ( IOException mie ) { IOUtil . closeEL ( is ) ; try { return getContent ( is = bp . getInputStream ( ) , SystemUtil . getCharset ( ) ) ; } catch ...
public class SipServletResponseImpl { /** * ( non - Javadoc ) * @ see java . io . Externalizable # writeExternal ( java . io . ObjectOutput ) */ public void writeExternal ( ObjectOutput out ) throws IOException { } }
super . writeExternal ( out ) ; if ( originalRequest == null ) { out . writeBoolean ( false ) ; } else { out . writeBoolean ( true ) ; out . writeObject ( originalRequest ) ; } if ( proxyBranch == null ) { out . writeBoolean ( false ) ; } else { out . writeBoolean ( true ) ; out . writeObject ( proxyBranch ) ; } out . ...
public class ThrowingRunnable { /** * / * ( non - Javadoc ) * @ see java . lang . Runnable # run ( ) */ @ Override public final void run ( ) { } }
try { this . runWithException ( ) ; } catch ( RuntimeException e ) { throw e ; } catch ( Error e ) { throw e ; } catch ( Throwable t ) { throw new RuntimeException ( t ) ; }
public class LanguageTag { /** * BNF in RFC5464 * Language - Tag = langtag ; normal language tags * / privateuse ; private use tag * / grandfathered ; grandfathered tags * langtag = language * [ " - " script ] * [ " - " region ] * * ( " - " variant ) * * ( " - " extension ) * [ " - " privateuse ] * ...
if ( sts == null ) { sts = new ParseStatus ( ) ; } else { sts . reset ( ) ; } StringTokenIterator itr ; // Check if the tag is grandfathered String [ ] gfmap = GRANDFATHERED . get ( LocaleUtils . toLowerString ( languageTag ) ) ; if ( gfmap != null ) { // use preferred mapping itr = new StringTokenIterator ( gfmap [ 1 ...
public class TokenList { /** * Adds a variable to the end of the token list * @ param variable Variable which is to be added * @ return The new Token created around variable */ public Token add ( Variable variable ) { } }
Token t = new Token ( variable ) ; push ( t ) ; return t ;
public class RoleManager { /** * Delete the role with the passed ID * @ param sRoleID * The role ID to be deleted * @ return { @ link EChange # CHANGED } if the passed role ID was found and deleted */ @ Nonnull public EChange deleteRole ( @ Nullable final String sRoleID ) { } }
Role aDeletedRole ; m_aRWLock . writeLock ( ) . lock ( ) ; try { aDeletedRole = internalDeleteItem ( sRoleID ) ; if ( aDeletedRole == null ) { AuditHelper . onAuditDeleteFailure ( Role . OT , "no-such-role-id" , sRoleID ) ; return EChange . UNCHANGED ; } BusinessObjectHelper . setDeletionNow ( aDeletedRole ) ; } finall...
public class ListUtils { /** * Expands an integer list to a size equal to its value range and adds * < code > null < / code > - value entries for every missing intermediate integer * value . If < code > replace < / code > is not < code > null < / code > , all original * values are replaced by < code > replace < /...
Collections . sort ( list ) ; int minValue = list . get ( 0 ) ; int maxValue = list . get ( list . size ( ) - 1 ) ; int range = ( int ) ( maxValue - Math . signum ( minValue ) * Math . abs ( minValue ) ) ; List < Integer > result = new ArrayList < > ( range + 1 ) ; for ( int i = 0 ; i < list . size ( ) - 1 ; i ++ ) { r...