signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class RejoinTaskBuffer { /** * Expand the underlying byte buffer to contain the specified delta * @ param delta amount needed to accommodate the next buffer append */ private void ensureCapacity ( int delta ) { } }
ByteBuffer bb = m_container . b ( ) ; int bufferDelta = ( bb . position ( ) + delta ) - bb . capacity ( ) ; if ( bufferDelta > 0 ) { BBContainer ncntnr = DBBPool . allocateUnsafeByteBuffer ( bb . capacity ( ) + bufferDelta ) ; ByteBuffer newbb = ncntnr . b ( ) ; bb . flip ( ) ; newbb . put ( bb ) ; m_container . discar...
public class RecurrenceUtility { /** * Maps a duration unit value from a recurring task record in an MPX file * to a TimeUnit instance . Defaults to days if any problems are encountered . * @ param value integer duration units value * @ return TimeUnit instance */ private static TimeUnit getDurationUnits ( Intege...
TimeUnit result = null ; if ( value != null ) { int index = value . intValue ( ) ; if ( index >= 0 && index < DURATION_UNITS . length ) { result = DURATION_UNITS [ index ] ; } } if ( result == null ) { result = TimeUnit . DAYS ; } return ( result ) ;
public class Debug { /** * Returns a string representation of all elements from a * collection , in increasing lexicographic order of their string * representations . */ public static < T > String stringImg ( Collection < T > coll ) { } }
StringBuffer buffer = new StringBuffer ( ) ; buffer . append ( "[ " ) ; for ( T t : sortedCollection ( coll ) ) { buffer . append ( t ) ; buffer . append ( " " ) ; } buffer . append ( "]" ) ; return buffer . toString ( ) ;
public class DataTree { /** * this method traverses the quota path and update the path trie and sets * @ param path */ private void traverseNode ( String path ) { } }
DataNode node = getNode ( path ) ; String children [ ] = null ; synchronized ( node ) { Set < String > childs = node . getChildren ( ) ; if ( childs != null ) { children = childs . toArray ( new String [ childs . size ( ) ] ) ; } } if ( children != null ) { if ( children . length == 0 ) { // this node does not have a c...
public class TextRetinaApiImpl { /** * { @ inheritDoc } */ @ Override public List < Fingerprint > getFingerprintBulk ( Double sparsity , Text ... texts ) throws JsonProcessingException , ApiException { } }
validateRequiredModels ( texts ) ; LOG . debug ( "Retrieve representation for the bulk Text: " + toJson ( texts ) + " sparsity: " + sparsity ) ; return this . api . getRepresentationsForBulkText ( toJson ( texts ) , retinaName , sparsity ) ;
public class Data { /** * Create a new { @ code Data } object with the given parameters . * @ param name the name of the data object * @ param samples the sample list of the data object * @ throws NullPointerException if one of the parameters is { @ code null } * @ return a new { @ code Data } object with the g...
return new Data ( name , samples ) ;
public class Utils { /** * Print time difference in minutes , seconds and milliseconds */ public static String printTiming ( long start , long end ) { } }
long totalMillis = end - start ; long mins = TimeUnit . MILLISECONDS . toMinutes ( totalMillis ) ; long secs = TimeUnit . MILLISECONDS . toSeconds ( totalMillis ) - TimeUnit . MINUTES . toSeconds ( mins ) ; long millis = TimeUnit . MILLISECONDS . toMillis ( totalMillis ) - TimeUnit . MINUTES . toMillis ( mins ) - TimeU...
public class FastTSPFitness { /** * Default fitness for FastTSP algorithm . * Returns positive number if configuration { @ link TSP # isSolution ( cz . cvut . felk . cig . jcop . problem . Configuration ) is * solution } , number equals - tourDistance . * If configuration is not solution , returns negative infini...
double cost = this . problem . pathLength ( configuration ) ; if ( this . problem . isSolution ( configuration ) ) return - cost ; return Double . NEGATIVE_INFINITY ; // if ( this . problem . isSolution ( configuration ) ) // return this . maxDistance - cost ; // return - cost ;
public class bit { /** * Copies the specified range of the specified array into a new array . * @ param data the bits from which a range is to be copied * @ param start the initial index of the range to be copied , inclusive * @ param end the final index of the range to be copied , exclusive . * @ return a new ...
if ( start > end ) { throw new IllegalArgumentException ( String . format ( "start > end: %d > %d" , start , end ) ) ; } if ( start < 0 || start > data . length << 3 ) { throw new ArrayIndexOutOfBoundsException ( String . format ( "%d < 0 || %d > %d" , start , start , data . length * 8 ) ) ; } final int to = min ( data...
public class FIMTDDNumericAttributeClassObserver { /** * Implementation of the FindBestSplit algorithm from E . Ikonomovska et al . */ protected AttributeSplitSuggestion searchForBestSplitOption ( Node currentNode , AttributeSplitSuggestion currentBestOption , SplitCriterion criterion , int attIndex ) { } }
// Return null if the current node is null or we have finished looking through all the possible splits if ( currentNode == null || countRightTotal == 0.0 ) { return currentBestOption ; } if ( currentNode . left != null ) { currentBestOption = searchForBestSplitOption ( currentNode . left , currentBestOption , criterion...
public class Field { /** * Is this field not displayed in the given target mode . If not explicitly * set in the definition following defaults apply : * < ul > * < li > ModeConnect : false < / li > * < li > ModeCreate : true < / li > * < li > ModeView : false < / li > * < li > ModeEdit : false < / li > * ...
boolean ret = false ; if ( this . mode2display . containsKey ( _mode ) ) { ret = this . mode2display . get ( _mode ) . equals ( Field . Display . NONE ) ; } else if ( _mode . equals ( TargetMode . CREATE ) || _mode . equals ( TargetMode . SEARCH ) ) { ret = true ; } return ret ;
public class ErrorPagePool { /** * returns the error page * @ param pe Page Exception * @ return */ public ErrorPage getErrorPage ( PageException pe , short type ) { } }
for ( int i = pages . size ( ) - 1 ; i >= 0 ; i -- ) { ErrorPageImpl ep = ( ErrorPageImpl ) pages . get ( i ) ; if ( ep . getType ( ) == type ) { if ( type == ErrorPage . TYPE_EXCEPTION ) { if ( pe . typeEqual ( ep . getTypeAsString ( ) ) ) return ep ; } else return ep ; } } return null ;
public class UrlValidator { /** * Checks one character , throws IOException if invalid . * @ see java . net . URLEncoder * @ return < code > true < / code > if found the first ' ? ' . */ public static boolean checkCharacter ( int c , boolean foundQuestionMark ) throws IOException { } }
if ( foundQuestionMark ) { switch ( c ) { case '.' : case '-' : case '*' : case '_' : case '+' : // converted space case '%' : // encoded value // Other characters used outside the URL data // case ' : ' : // case ' / ' : // case ' @ ' : // case ' ; ' : // case ' ? ' : // Parameter separators case '=' : case '&' : // A...
public class ItemDeletion { /** * Checks if the supplied { @ link Item } or any of its { @ link Item # getParent ( ) } are being deleted . * @ param item the item . * @ return { @ code true } if the { @ link Item } or any of its { @ link Item # getParent ( ) } are being deleted . */ public static boolean contains (...
ItemDeletion instance = instance ( ) ; if ( instance == null ) { return false ; } instance . lock . readLock ( ) . lock ( ) ; try { return instance . _contains ( item ) ; } finally { instance . lock . readLock ( ) . unlock ( ) ; }
public class StreamingCinchContext { /** * Executes your streaming job from the spring context . */ public void executeJob ( ) { } }
AbstractApplicationContext springContext = SpringContext . getContext ( getSpringConfigurationClass ( ) ) ; StreamingCinchJob cinchJob = springContext . getBean ( StreamingCinchJob . class ) ; cinchJob . execute ( this ) ;
public class ValidationChangedEvent { /** * Fire the event . * @ param source the source * @ param valid the valid */ public static void fire ( HasHandlers source , boolean valid ) { } }
ValidationChangedEvent eventInstance = new ValidationChangedEvent ( valid ) ; source . fireEvent ( eventInstance ) ;
public class DatabaseManager { /** * Adjust this method for large strings . . . ie multi megabtypes . */ void execute ( ) { } }
String sCmd = null ; if ( 4096 <= ifHuge . length ( ) ) { sCmd = ifHuge ; } else { sCmd = txtCommand . getText ( ) ; } if ( sCmd . startsWith ( "-->>>TEST<<<--" ) ) { testPerformance ( ) ; return ; } String [ ] g = new String [ 1 ] ; lTime = System . currentTimeMillis ( ) ; try { if ( sStatement == null ) { return ; } ...
public class AfplibPackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EEnum getBeginSegmentCommandLENGTH ( ) { } }
if ( beginSegmentCommandLENGTHEEnum == null ) { beginSegmentCommandLENGTHEEnum = ( EEnum ) EPackage . Registry . INSTANCE . getEPackage ( AfplibPackage . eNS_URI ) . getEClassifiers ( ) . get ( 131 ) ; } return beginSegmentCommandLENGTHEEnum ;
public class PersistentState { /** * cluster _ config files . */ void cleanupClusterConfigFiles ( ) throws IOException { } }
Zxid latestZxid = getLatestZxid ( ) ; List < File > files = getFilesWithPrefix ( this . rootDir , "cluster_config" ) ; if ( files . isEmpty ( ) ) { LOG . error ( "There's no cluster_config files in log directory." ) ; throw new RuntimeException ( "There's no cluster_config files!" ) ; } Iterator < File > iter = files ....
public class SerializerBase { /** * Tell if two strings are equal , without worry if the first string is null . * @ param p String reference , which may be null . * @ param t String reference , which may be null . * @ return true if strings are equal . */ private static final boolean subPartMatch ( String p , Str...
return ( p == t ) || ( ( null != p ) && ( p . equals ( t ) ) ) ;
public class ExtensionEdit { /** * This method initializes popupMenuFind * @ return org . parosproxy . paros . extension . ExtensionPopupMenu */ private PopupFindMenu getPopupMenuFind ( ) { } }
if ( popupFindMenu == null ) { popupFindMenu = new PopupFindMenu ( ) ; popupFindMenu . setText ( Constant . messages . getString ( "edit.find.popup" ) ) ; // ZAP : i18n popupFindMenu . addActionListener ( new java . awt . event . ActionListener ( ) { @ Override public void actionPerformed ( java . awt . event . ActionE...
public class InstructionView { /** * Use this method inside a { @ link ProgressChangeListener } to update this view with all other information * that is not updated by the { @ link InstructionView # updateBannerInstructionsWith ( Milestone ) } . * This includes the distance remaining , instruction list , turn lanes...
if ( routeProgress != null && ! isRerouting ) { InstructionModel model = new InstructionModel ( distanceFormatter , routeProgress ) ; updateDataFromInstruction ( model ) ; }
public class EventSubscription { /** * A list of source IDs for the event notification subscription . * @ param sourceIdsList * A list of source IDs for the event notification subscription . */ public void setSourceIdsList ( java . util . Collection < String > sourceIdsList ) { } }
if ( sourceIdsList == null ) { this . sourceIdsList = null ; return ; } this . sourceIdsList = new java . util . ArrayList < String > ( sourceIdsList ) ;
public class LabelOperationMetadata { /** * < code > * . google . cloud . datalabeling . v1beta1 . LabelVideoObjectTrackingOperationMetadata video _ object _ tracking _ details = 7; * < / code > */ public com . google . cloud . datalabeling . v1beta1 . LabelVideoObjectTrackingOperationMetadataOrBuilder getVideoObje...
if ( detailsCase_ == 7 ) { return ( com . google . cloud . datalabeling . v1beta1 . LabelVideoObjectTrackingOperationMetadata ) details_ ; } return com . google . cloud . datalabeling . v1beta1 . LabelVideoObjectTrackingOperationMetadata . getDefaultInstance ( ) ;
public class Parser { /** * When this is called , the identifier token has already been read . */ private AssignmentStatement parseAssignmentStatement ( Token token ) throws IOException { } }
// TODO : allow lvalue to support dot notations // ie : field = x ( store local variable ) // obj . field = x ( obj . setField ) // obj . field . field = x ( obj . getField ( ) . setField ) // array [ idx ] = x ( array [ idx ] ) // list [ idx ] = x ( list . set ( idx , x ) ) // map [ key ] = x ( map . put ( key , x ) )...
public class MapUtils { /** * Extract a date value from the map . If the extracted value is * a string , parse it as a { @ link Date } using the specified date - time format . * @ param map * @ param key * @ param dateTimeFormat * @ return * @ since 0.6.3.1 */ public static Date getDate ( Map < String , Obj...
Object obj = map . get ( key ) ; return obj instanceof Number ? new Date ( ( ( Number ) obj ) . longValue ( ) ) : ( obj instanceof String ? DateFormatUtils . fromString ( obj . toString ( ) , dateTimeFormat ) : ( obj instanceof Date ? ( Date ) obj : null ) ) ;
public class ProjectsInner { /** * Delete project . * The project resource is a nested resource representing a stored migration project . The DELETE method deletes a project . * @ param groupName Name of the resource group * @ param serviceName Name of the service * @ param projectName Name of the project * @...
return ServiceFuture . fromResponse ( deleteWithServiceResponseAsync ( groupName , serviceName , projectName ) , serviceCallback ) ;
public class RequestUtil { /** * getBodyAsMultiValuedMap . * @ param request * a { @ link com . cloudcontrolled . api . request . Request } object . * @ param < T > * a T object . * @ return a { @ link javax . ws . rs . core . MultivaluedMap } object . */ public static < T > MultivaluedMap < String , String >...
MultivaluedMap < String , String > map = new BodyMultivaluedMap ( ) ; Class < ? > referenceClazz = request . getClass ( ) ; List < Field > fields = ClassUtil . getAnnotatedFields ( referenceClazz , Body . class ) ; for ( Field field : fields ) { Body body = field . getAnnotation ( Body . class ) ; String parameter = bo...
public class GIUtils { /** * Computes which fraction of the time series is covered by the rules set . * @ param seriesLength the time series length . * @ param rules the grammar rules set . * @ return a fraction covered by the rules . */ public static double getCoverAsFraction ( int seriesLength , GrammarRules ru...
boolean [ ] coverageArray = new boolean [ seriesLength ] ; for ( GrammarRuleRecord rule : rules ) { if ( 0 == rule . ruleNumber ( ) ) { continue ; } ArrayList < RuleInterval > arrPos = rule . getRuleIntervals ( ) ; for ( RuleInterval saxPos : arrPos ) { int startPos = saxPos . getStart ( ) ; int endPos = saxPos . getEn...
public class DaySchedule { /** * Sleeps till a future time . */ private final void sleepTill ( long future ) throws InterruptedException { } }
long milliseconds = future - logicalClockMillis ( ) ; if ( milliseconds > 0 ) { Thread . sleep ( milliseconds ) ; }
public class CliPrinter { /** * Print suggestions . * @ param suggestions Suggestions to print . */ public void printSuggestions ( Suggestions suggestions ) { } }
final PrintContext context = new PrintContext ( ) ; context . append ( "Suggestions:" ) . println ( ) ; context . incIndent ( ) ; printSuggestions0 ( context , suggestions . getDirectorySuggestions ( ) , "Directories" ) ; printSuggestions0 ( context , suggestions . getCommandSuggestions ( ) , "Commands" ) ; printSugges...
public class DescribeDeliveryStreamRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DescribeDeliveryStreamRequest describeDeliveryStreamRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( describeDeliveryStreamRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( describeDeliveryStreamRequest . getDeliveryStreamName ( ) , DELIVERYSTREAMNAME_BINDING ) ; protocolMarshaller . marshall ( describeDeliveryStreamRequest . ...
public class Sql { /** * Performs a stored procedure call with the given parameters . The closure * is called once with all the out parameters . * Example usage - suppose we create a stored procedure ( ignore its simplistic implementation ) : * < pre > * / / Tested with MySql 5.0.75 * sql . execute " " " * ...
callWithRows ( sql , params , NO_RESULT_SETS , closure ) ;
public class DefaultGroovyMethods { /** * Selects the maximum value found from the Iterator using the given comparator . * @ param self an Iterator * @ param comparator a Comparator * @ return the maximum value * @ since 1.5.5 */ public static < T > T max ( Iterator < T > self , Comparator < T > comparator ) { ...
return max ( ( Iterable < T > ) toList ( self ) , comparator ) ;
public class ParosTableHistory { /** * Returns all the history record IDs of the given session except the ones with the given history types . * @ param sessionId the ID of session of the history records * @ param histTypes the history types of the history records that should be excluded * @ return a { @ code List...
return getHistoryIdsByParams ( sessionId , 0 , false , histTypes ) ;
public class GenomicsFactory { /** * Create a new genomics stub from the given service account ID and private key { @ link File } . * @ param serviceAccountId The service account ID ( typically an email address ) * @ param p12File The file on disk containing the private key * @ return The new { @ code Genomics } ...
Preconditions . checkNotNull ( serviceAccountId ) ; Preconditions . checkNotNull ( p12File ) ; return fromServiceAccount ( getGenomicsBuilder ( ) , serviceAccountId , p12File ) . build ( ) ;
public class Matrices { /** * Creates a const function that evaluates it ' s argument to given { @ code value } . * @ param arg a const value * @ return a closure object that does { @ code _ } */ public static MatrixFunction asConstFunction ( final double arg ) { } }
return new MatrixFunction ( ) { @ Override public double evaluate ( int i , int j , double value ) { return arg ; } } ;
public class JedisUtils { /** * Create a new { @ link JedisCluster } . * @ param poolConfig * format { @ code host1 : port1 , host2 : port2 , . . . } , default Redis port is used if not * specified * @ param password * @ param timeoutMs * @ param maxAttempts * @ return */ public static JedisCluster newJed...
Set < HostAndPort > clusterNodes = new HashSet < > ( ) ; String [ ] hapList = hostsAndPorts . split ( "[,;\\s]+" ) ; for ( String hostAndPort : hapList ) { String [ ] tokens = hostAndPort . split ( ":" ) ; String host = tokens . length > 0 ? tokens [ 0 ] : Protocol . DEFAULT_HOST ; int port = tokens . length > 1 ? Inte...
public class FileUtils { /** * Resolve file path against a base directory path . Normalize the input file path , by replacing all the ' \ \ ' , ' / ' with * File . seperator , and removing ' . . ' from the directory . * < p > Note : the substring behind " # " will be removed . < / p > * @ param basedir base dir ,...
final File pathname = new File ( normalizePath ( stripFragment ( filepath ) , File . separator ) ) ; if ( basedir == null || basedir . length ( ) == 0 ) { return pathname ; } final String normilizedPath = new File ( basedir , pathname . getPath ( ) ) . getPath ( ) ; return new File ( normalizePath ( normilizedPath , Fi...
public class AbstractDecimal { /** * Wraps BigDecimal ' s divide method to enforce the default rounding * behavior * @ param divisor the value to divide by * @ return result of dividing this value by the given divisor * @ throws IllegalArgumentException if the given divisor is null */ public T divide ( T diviso...
if ( divisor == null ) { throw new IllegalArgumentException ( "invalid (null) divisor" ) ; } BigDecimal quotient = this . value . divide ( divisor . value , ROUND_BEHAVIOR ) ; return newInstance ( quotient , this . value . scale ( ) ) ;
public class WebClientConfigurer { /** * Return a set of { @ link ExchangeStrategies } driven by registered { @ link HypermediaType } s . * @ return a collection of { @ link Encoder } s and { @ link Decoder } assembled into a { @ link ExchangeStrategies } . */ public ExchangeStrategies hypermediaExchangeStrategies ( ...
List < Encoder < ? > > encoders = new ArrayList < > ( ) ; List < Decoder < ? > > decoders = new ArrayList < > ( ) ; this . hypermediaTypes . forEach ( hypermedia -> { ObjectMapper objectMapper = hypermedia . configureObjectMapper ( this . mapper . copy ( ) ) ; MimeType [ ] mimeTypes = hypermedia . getMediaTypes ( ) . t...
public class JarURLConnection { /** * Returns the main Attributes for the JAR file for this * connection . * @ return the main Attributes for the JAR file for this * connection . * @ exception IOException if getting the manifest causes an * IOException to be thrown . * @ see # getJarFile * @ see # getMani...
Manifest man = getManifest ( ) ; return man != null ? man . getMainAttributes ( ) : null ;
public class DoubleArray { /** * Returns the corresponding value if the key is found . Otherwise returns - 1. * @ param key search key * @ return found value */ public int exactMatchSearch ( byte [ ] key ) { } }
int unit = _array [ 0 ] ; int nodePos = 0 ; for ( byte b : key ) { // nodePos ^ = unit . offset ( ) ^ b nodePos ^= ( ( unit >>> 10 ) << ( ( unit & ( 1 << 9 ) ) >>> 6 ) ) ^ ( b & 0xFF ) ; unit = _array [ nodePos ] ; // if ( unit . label ( ) ! = b ) if ( ( unit & ( ( 1 << 31 ) | 0xFF ) ) != ( b & 0xff ) ) { return - 1 ; ...
public class JsHdrsImpl { /** * Set the value of the ExceptionReason in the message header . * Javadoc description supplied by JsMessage interface . */ public final void setExceptionReason ( int value ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "setExceptionReason" , Integer . valueOf ( value ) ) ; boolean wasEmpty = ( getHdr2 ( ) . getChoiceField ( JsHdr2Access . EXCEPTION ) == JsHdr2Access . IS_EXCEPTION_EMPTY ) ; getHdr2 ( ) . setIntField ( JsHdr2Access ....
public class LinkedIOSubchannel { /** * The { @ link # toString ( ) } method of { @ link LinkedIOSubchannel } s * shows the channel together with the upstream channel that it * is linked to . If there are several levels of upstream links , * this can become a very long sequence . * This method creates the repre...
if ( upstream == null ) { linkedRemaining . set ( null ) ; return "" ; } if ( linkedRemaining . get ( ) == null ) { linkedRemaining . set ( 1 ) ; } if ( linkedRemaining . get ( ) <= 0 ) { linkedRemaining . set ( null ) ; return "↔…" ; } linkedRemaining . set ( linkedRemaining . get ( ) - 1 ) ; // Build continuation . S...
public class XmlUtil { /** * Loads XML from string and uses referenced XSD to validate the content . * This method will use { @ link XmlErrorHandlerQuiet } to suppress all errors / warnings when validating . * @ param _ xmlStr string to validate * @ param _ namespaceAware take care of namespace * @ return Docum...
return parseXmlStringWithXsdValidation ( _xmlStr , _namespaceAware , null ) ;
public class MapBindTransformation { /** * Generate parse on jackson internal . * @ param context the context * @ param methodBuilder the method builder * @ param parserName the parser name * @ param beanClass the bean class * @ param beanName the bean name * @ param property the property * @ param onStri...
// define key and value type ParameterizedTypeName mapTypeName = ( ParameterizedTypeName ) property . getPropertyType ( ) . getTypeName ( ) ; TypeName keyTypeName = mapTypeName . typeArguments . get ( 0 ) ; TypeName valueTypeName = mapTypeName . typeArguments . get ( 1 ) ; // @ formatter : off methodBuilder . beginCont...
public class NewJFrame { /** * Validate and set the datetime field on the screen given a datetime string . * @ param dateTime The datetime string */ public void setDate ( String dateString ) { } }
Date date = null ; try { if ( ( dateString != null ) && ( dateString . length ( ) > 0 ) ) date = dateFormat . parse ( dateString ) ; } catch ( Exception e ) { date = null ; } this . setDate ( date ) ;
public class MessageStack { /** * Free all the resources belonging to this applet . If all applet screens are closed , shut down the applet . */ public void free ( ) { } }
if ( m_messageStackOwner != null ) // Always m_messageStackOwner . setMessageStack ( null ) ; m_messageStackOwner = null ; if ( m_bWaiting ) { synchronized ( m_thread ) { if ( m_bWaiting ) // Inside the sync block m_stack . removeAllElements ( ) ; m_bWaiting = false ; if ( m_thread != null ) { m_stack = null ; m_thread...
public class AppEngineDatastoreService { /** * Gets App Engine Datastore entity corresponding to the specified * { @ code Key } within the specified { @ code Transaction } . * @ param transaction The transaction to get the entity . * @ param key The key to get the entity . * @ return The entity corresponding to...
try { return datastore . get ( transaction , key ) ; } catch ( EntityNotFoundException e ) { return null ; }
public class WebAppDescriptorImpl { /** * Returns all < code > error - page < / code > elements * @ return list of < code > error - page < / code > */ public List < ErrorPageType < WebAppDescriptor > > getAllErrorPage ( ) { } }
List < ErrorPageType < WebAppDescriptor > > list = new ArrayList < ErrorPageType < WebAppDescriptor > > ( ) ; List < Node > nodeList = model . get ( "error-page" ) ; for ( Node node : nodeList ) { ErrorPageType < WebAppDescriptor > type = new ErrorPageTypeImpl < WebAppDescriptor > ( this , "error-page" , model , node )...
public class JsonPropertyMeta { /** * Gets a new instance of property builder for the given coder router . * @ param router * @ return a new property builder instance * @ author vvakame */ public JsonPropertyBuilder < T , P > router ( JsonCoderRouter < P > router ) { } }
return new JsonPropertyBuilder < T , P > ( coderClass , name , null , router ) ;
public class AccessLogSource { /** * { @ inheritDoc } */ @ Override public void setBufferManager ( BufferManager bufferMgr ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEventEnabled ( ) ) { Tr . event ( tc , "Setting buffer manager " + this ) ; } this . bufferMgr = bufferMgr ; startSource ( ) ;
public class CmsVfsService { /** * Internal version of getResourceHistory . < p > * @ param structureId the structure id of the resource * @ return the resource history * @ throws CmsException if something goes wrong */ public CmsHistoryResourceCollection getResourceHistoryInternal ( CmsUUID structureId ) throws ...
CmsHistoryResourceCollection result = new CmsHistoryResourceCollection ( ) ; CmsObject cms = getCmsObject ( ) ; CmsResource resource = cms . readResource ( structureId , CmsResourceFilter . ALL ) ; List < I_CmsHistoryResource > versions = cms . readAllAvailableVersions ( resource ) ; if ( ! resource . getState ( ) . is...
public class BaseMessageManager { /** * Send this message to the appropriate queue . * The message ' s message header has the queue name and type . * @ param The message to send . * @ return An error code . */ public int sendMessage ( Message message ) { } }
BaseMessageHeader messageHeader = ( ( BaseMessage ) message ) . getMessageHeader ( ) ; String strQueueType = messageHeader . getQueueType ( ) ; String strQueueName = messageHeader . getQueueName ( ) ; MessageSender sender = this . getMessageQueue ( strQueueName , strQueueType ) . getMessageSender ( ) ; if ( sender != n...
public class ReconciliationLineItemReport { /** * Gets the netBillableRevenue value for this ReconciliationLineItemReport . * @ return netBillableRevenue * The net billable revenue . If this reconciliation data is for * a { @ link ProposalLineItem } , * this is calculated from the { @ link # netRate } , { @ link ...
return netBillableRevenue ;
public class BasePool { /** * Set the { @ link StackTraceElement } for the given { @ link Throwable } , using the { @ link Class } and method name . */ static < T extends Throwable > T unknownStackTrace ( T cause , Class < ? > clazz , String method ) { } }
cause . setStackTrace ( new StackTraceElement [ ] { new StackTraceElement ( clazz . getName ( ) , method , null , - 1 ) } ) ; return cause ;
public class NioSocketAcceptor { /** * but also allow explicit setting of the Netty property ( for internal testing purposes ) */ static void initSelectTimeout ( ) { } }
String currentTimeout = System . getProperty ( PROPERTY_NETTY_SELECT_TIMEOUT ) ; if ( currentTimeout == null || "" . equals ( currentTimeout ) ) { try { System . setProperty ( PROPERTY_NETTY_SELECT_TIMEOUT , Long . toString ( DEFAULT_SELECT_TIMEOUT_MILLIS ) ) ; } catch ( SecurityException e ) { if ( logger . isWarnEnab...
public class RedundentExprEliminator { /** * Find the previous occurance of a xsl : variable . Stop * the search when a xsl : for - each , xsl : template , or xsl : stylesheet is * encountered . * @ param elem Should be non - null template element . * @ return The first previous occurance of an xsl : variable o...
// This could be somewhat optimized . since getPreviousSiblingElem is a // fairly expensive operation . while ( null != ( elem = getPrevElementWithinContext ( elem ) ) ) { int type = elem . getXSLToken ( ) ; if ( ( Constants . ELEMNAME_VARIABLE == type ) || ( Constants . ELEMNAME_PARAMVARIABLE == type ) ) { return ( El...
public class IOUtils { /** * Write object to a file with the specified name . * @ param o * object to be written to file * @ param filename * name of the temp file * @ return File containing the object , or null if an exception was caught */ public static File writeObjectToFileNoExceptions ( Object o , String...
File file = null ; ObjectOutputStream oos = null ; try { file = new File ( filename ) ; // file . createNewFile ( ) ; / / cdm may 2005 : does nothing needed oos = new ObjectOutputStream ( new BufferedOutputStream ( new GZIPOutputStream ( new FileOutputStream ( file ) ) ) ) ; oos . writeObject ( o ) ; oos . close ( ) ; ...
public class SloppyClassReflection { /** * overrides the visitor to collect all class references * @ param classContext * the class context of the currently visited class */ @ Override public void visitClassContext ( ClassContext classContext ) { } }
try { refClasses = new HashSet < > ( ) ; refClasses . add ( classContext . getJavaClass ( ) . getClassName ( ) ) ; state = State . COLLECT ; super . visitClassContext ( classContext ) ; state = State . SEEN_NOTHING ; super . visitClassContext ( classContext ) ; } finally { refClasses = null ; }
public class MetricDataResult { /** * The timestamps for the data points , formatted in Unix timestamp format . The number of timestamps always matches * the number of values and the value for Timestamps [ x ] is Values [ x ] . * @ param timestamps * The timestamps for the data points , formatted in Unix timestam...
if ( timestamps == null ) { this . timestamps = null ; return ; } this . timestamps = new com . amazonaws . internal . SdkInternalList < java . util . Date > ( timestamps ) ;
public class LuceneUtil { /** * Get the generation ( N ) of the current segments _ N file in the directory . * @ param directory - - directory to search for the latest segments _ N file */ public static long getCurrentSegmentGeneration ( Directory directory ) throws IOException { } }
String [ ] files = directory . list ( ) ; if ( files == null ) throw new IOException ( "cannot read directory " + directory + ": list() returned null" ) ; return getCurrentSegmentGeneration ( files ) ;
public class RowDataSet { private void convertColumnType ( final int columnIndex , final Class < ? > targetType ) { } }
final List < Object > column = _columnList . get ( columnIndex ) ; Object newValue = null ; for ( int i = 0 , len = size ( ) ; i < len ; i ++ ) { newValue = N . convert ( column . get ( i ) , targetType ) ; column . set ( i , newValue ) ; } modCount ++ ;
public class ResourceMarshaller { /** * Marshall the given parameter object . */ public void marshall ( Resource resource , ProtocolMarshaller protocolMarshaller ) { } }
if ( resource == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( resource . getType ( ) , TYPE_BINDING ) ; protocolMarshaller . marshall ( resource . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( resource . getArn ( ) , ARN_...
public class JsonStringToJsonIntermediateConverter { /** * Take in an input schema of type string , the schema must be in JSON format * @ return a JsonArray representation of the schema */ @ Override public JsonArray convertSchema ( String inputSchema , WorkUnitState workUnit ) throws SchemaConversionException { } }
this . unpackComplexSchemas = workUnit . getPropAsBoolean ( UNPACK_COMPLEX_SCHEMAS_KEY , DEFAULT_UNPACK_COMPLEX_SCHEMAS_KEY ) ; JsonParser jsonParser = new JsonParser ( ) ; log . info ( "Schema: " + inputSchema ) ; JsonElement jsonSchema = jsonParser . parse ( inputSchema ) ; return jsonSchema . getAsJsonArray ( ) ;
public class SequenceModelResource { /** * Serialize this model into the overall Sequence model . * @ param out * the output stream * @ throws IOException * io exception */ public void serialize ( final OutputStream out ) throws IOException { } }
final Writer writer = new BufferedWriter ( new OutputStreamWriter ( out ) ) ; this . seqModel . serialize ( out ) ; writer . flush ( ) ;
public class CmsStreamReportWidget { /** * Writes data to delegate stream if it has been set . * @ param data the data to write */ private void writeToDelegate ( byte [ ] data ) { } }
if ( m_delegateStream != null ) { try { m_delegateStream . write ( data ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; } }
public class JsonConverter { /** * Converts JSON string into map object or returns null when conversion is not * possible . * @ param value the JSON string to convert . * @ return Map object value or null when conversion is not supported . * @ see MapConverter # toNullableMap ( Object ) */ public static Map < S...
if ( value == null ) return null ; try { Map < String , Object > map = _mapper . readValue ( ( String ) value , typeRef ) ; return RecursiveMapConverter . toNullableMap ( map ) ; } catch ( Exception ex ) { return null ; }
public class UtlJsp { /** * < p > Escape HTML character to UTF - 8 for given string . < / p > * @ param pSource string * @ return String escaped */ public final String escapeHtml ( final String pSource ) { } }
StringBuffer sb = new StringBuffer ( ) ; for ( int i = 0 ; i < pSource . length ( ) ; i ++ ) { char ch = pSource . charAt ( i ) ; sb . append ( htmlEscape ( ch ) ) ; } return sb . toString ( ) ;
public class EventClient { /** * Records a user - action - on - item event . * @ param action name of the action performed * @ param uid ID of the user * @ param iid ID of the item * @ param properties a map of properties associated with this action * @ param eventTime timestamp of the event * @ return ID o...
return createEvent ( userActionItemAsFuture ( action , uid , iid , properties , eventTime ) ) ;
public class FineGrainedWatermarkTracker { /** * Schedule the sweeper and stability checkers */ public synchronized void start ( ) { } }
if ( ! _started . get ( ) ) { _executorService = new ScheduledThreadPoolExecutor ( 1 , ExecutorsUtils . newThreadFactory ( Optional . of ( LoggerFactory . getLogger ( FineGrainedWatermarkTracker . class ) ) ) ) ; _executorService . scheduleAtFixedRate ( _sweeper , 0 , _sweepIntervalMillis , TimeUnit . MILLISECONDS ) ; ...
public class ProgressInputStream { /** * Returns an input stream for response progress tracking purposes . If * request / response progress tracking is not enabled , this method simply * return the given input stream as is . * @ param is the response content input stream */ public static InputStream inputStreamFo...
return req == null ? is : new ResponseProgressInputStream ( is , req . getGeneralProgressListener ( ) ) ;
public class GlideHelper { /** * Loads thumbnail and then replaces it with full image . */ public static void loadFull ( ImageView image , int imageId , int thumbId ) { } }
// We don ' t want Glide to crop or resize our image final RequestOptions options = new RequestOptions ( ) . diskCacheStrategy ( DiskCacheStrategy . NONE ) . override ( Target . SIZE_ORIGINAL ) . dontTransform ( ) ; final RequestBuilder < Drawable > thumbRequest = Glide . with ( image ) . load ( thumbId ) . apply ( opt...
public class VoiceRecorderDialog { /** * 开始录制 */ public void recording ( ) { } }
if ( null != dialog && dialog . isShowing ( ) ) { mImageView . setImageResource ( R . drawable . hlklib_record_animate_01 ) ; mWarningText . setText ( R . string . hlklib_voice_recorder_warning_text_cancel ) ; }
public class DOTranslatorModule { /** * { @ inheritDoc } */ public void serialize ( DigitalObject in , OutputStream out , String format , String encoding , int transContext ) throws ObjectIntegrityException , StreamIOException , UnsupportedTranslationException , ServerException { } }
m_wrappedTranslator . serialize ( in , out , format , encoding , transContext ) ;
public class MapDataDao { /** * Note that if not logged in , the Changeset for each returned element will be null * @ param relationIds a collection of relation ids to return * @ throws OsmNotFoundException if < b > any < / b > one of the given relations does not exist * @ return a list of relations . */ public L...
if ( relationIds . isEmpty ( ) ) return Collections . emptyList ( ) ; return getSomeElements ( RELATION + "s?" + RELATION + "s=" + toCommaList ( relationIds ) , Relation . class ) ;
public class PriorityConverterMap { /** * Add a converter to the map if : * - there is no existing converter for that type * - there is an existing converter of equal priority * - there is an existing converter of lower priority * @ param converter the new converter * @ return the new converter if it was adde...
PriorityConverter existing = _addConverter ( converter ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "Converter added to map @ priority {0}: {1}={2}" , existing . getPriority ( ) , existing . getType ( ) , existing ) ; } return existing ;
public class AfplibPackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public EClass getCMRFidelity ( ) { } }
if ( cmrFidelityEClass == null ) { cmrFidelityEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( AfplibPackage . eNS_URI ) . getEClassifiers ( ) . get ( 508 ) ; } return cmrFidelityEClass ;
public class DomUtils { /** * < p > Retutns the value of the named attribute of the given * element . If there is no such attribute , returns null . < / p > * @ param element element * @ param name name * @ return value */ static String getAttributeValue ( Element element , String name ) { } }
Attr attribute = element . getAttributeNode ( name ) ; if ( attribute == null ) { return null ; } else { return attribute . getValue ( ) ; }
public class XMonitoredInputStream { /** * This method is called by the actual input stream method * to provide feedback about the number of read bytes . * Notifies the attached progress listener if appropriate . * @ param readBytes The number of read bytes in this call . */ protected void update ( long readBytes...
if ( progressListener . isAborted ( ) ) { throw new IOException ( "Reading Cancelled by ProgressListener" ) ; } this . bytesRead += readBytes ; int step = ( int ) ( bytesRead / stepSize ) ; if ( step > lastStep ) { lastStep = step ; progressListener . updateProgress ( step , stepNumber ) ; }
public class Configuration { /** * Get the value of the < code > name < / code > property as a < code > boolean < / code > . * If no such property is specified , or if the specified value is not a valid * < code > boolean < / code > , then < code > defaultValue < / code > is returned . * @ param name property nam...
String valueString = get ( name ) ; if ( valueString == null ) { return defaultValue ; } valueString = valueString . toLowerCase ( ) ; if ( "true" . equals ( valueString ) ) { return true ; } else if ( "false" . equals ( valueString ) ) { return false ; } throw new IllegalArgumentException ( "Invalid value of boolean c...
public class TrackSourceSettingsMarshaller { /** * Marshall the given parameter object . */ public void marshall ( TrackSourceSettings trackSourceSettings , ProtocolMarshaller protocolMarshaller ) { } }
if ( trackSourceSettings == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( trackSourceSettings . getTrackNumber ( ) , TRACKNUMBER_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + ...
public class StringManager { /** * Get the StringManager for a particular package and Locale . If a manager * for a package / Locale combination already exists , it will be reused , else * a new StringManager will be created and returned . * @ param packageName The package name * @ param locale The Locale */ pu...
Map < Locale , StringManager > map = managers . get ( packageName ) ; if ( map == null ) { /* * Don ' t want the HashMap to be expanded beyond LOCALE _ CACHE _ SIZE . * Expansion occurs when size ( ) exceeds capacity . Therefore keep * size at or below capacity . * removeEldestEntry ( ) executes after insertion t...
public class OAuth2Bootstrapper { /** * Gets users Credentials * @ param codeOrUrl code or redirect URL provided by the browser * @ throws IOException */ public void getUserCredentials ( String codeOrUrl ) throws IOException { } }
if ( state == null ) { // should not occur if this class is used properly throw new IllegalStateException ( "No anti CSRF state defined" ) ; } String code ; if ( codeOrUrl . startsWith ( "http://" ) || codeOrUrl . startsWith ( "https://" ) ) { // It ' s a URL : extract code and check state String url = codeOrUrl ; LOGG...
public class Ifc2x3tc1FactoryImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ public IfcElementAssemblyTypeEnum createIfcElementAssemblyTypeEnumFromString ( EDataType eDataType , String initialValue ) { } }
IfcElementAssemblyTypeEnum result = IfcElementAssemblyTypeEnum . get ( initialValue ) ; if ( result == null ) throw new IllegalArgumentException ( "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType . getName ( ) + "'" ) ; return result ;
public class BlockIterator { /** * Repositions the iterator so the key of the next BlockElement returned greater than or equal to the specified targetKey . */ @ Override public void seek ( Slice targetKey ) { } }
if ( restartCount == 0 ) { return ; } int left = 0 ; int right = restartCount - 1 ; // binary search restart positions to find the restart position immediately before the targetKey while ( left < right ) { int mid = ( left + right + 1 ) / 2 ; seekToRestartPosition ( mid ) ; if ( comparator . compare ( nextEntry . getKe...
public class TCPPort { /** * Destroys the server socket associated with this end point . */ protected synchronized void destroyServerSocket ( ) { } }
if ( null == this . serverSocket ) { // already closed return ; } if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "ServerSocket being closed for port " + this . listenPort ) ; } closeServerSocket ( ) ; this . serverSocket = null ;
public class PrequentialSourceProcessor { private void initStreamSource ( InstanceStream stream ) { } }
if ( stream instanceof AbstractOptionHandler ) { ( ( AbstractOptionHandler ) ( stream ) ) . prepareForUse ( ) ; } this . streamSource = new StreamSource ( stream ) ; firstInstance = streamSource . nextInstance ( ) . getData ( ) ;
public class S3Manager { /** * Downloads an AWS CloudTrail log from the specified source . * @ param ctLog The { @ link CloudTrailLog } to download * @ param source The { @ link CloudTrailSource } to download the log from . * @ return A byte array containing the log data . */ public byte [ ] downloadLog ( CloudTr...
boolean success = false ; ProgressStatus downloadLogStatus = new ProgressStatus ( ProgressState . downloadLog , new BasicProcessLogInfo ( source , ctLog , success ) ) ; final Object downloadSourceReportObject = progressReporter . reportStart ( downloadLogStatus ) ; byte [ ] s3ObjectBytes = null ; // start to download C...
public class RestController { /** * Adds an object to the request . If a page will be renderer and it needs some objects * to work , with this method a developer can add objects to the request , so the page can * obtain them . * @ param name Parameter name * @ param object Object to put in the request */ protec...
this . response . getRequest ( ) . setAttribute ( name , object ) ;
public class AgentSerializer { /** * Serialize java object * @ param unwrapper structure of agent class * @ param agent the agent object * @ return List of variables */ @ SuppressWarnings ( { } }
"unchecked" , "rawtypes" } ) public List serialize ( ClassUnwrapper unwrapper , Object agent ) { List variables = new ArrayList < > ( ) ; List < GetterMethodCover > methods = unwrapper . getMethods ( ) ; for ( GetterMethodCover method : methods ) { Object value = method . invoke ( agent ) ; if ( value == null ) continu...
public class ObjectManagerByteArrayOutputStream { /** * Writes an < code > int < / code > to the byte array as four * bytes , high byte first . If no exception is thrown , the counter * < code > written < / code > is incremented by < code > 4 < / code > . * @ param value to be written . * @ see java . io . Data...
byte writeBuffer [ ] = new byte [ 4 ] ; writeBuffer [ 0 ] = ( byte ) ( value >>> 24 ) ; writeBuffer [ 1 ] = ( byte ) ( value >>> 16 ) ; writeBuffer [ 2 ] = ( byte ) ( value >>> 8 ) ; writeBuffer [ 3 ] = ( byte ) ( value >>> 0 ) ; write ( writeBuffer , 0 , 4 ) ;
public class MonitorEndpointHelper { /** * Verify access to a HTTPS endpoint by performing a HTTP - get operation and assures that a proper http - return code ( e . g . 200 ) is returned . * NOTE : This method is aimed for external http - endpoionts and not internal http - endpoints , e . g . servlet - endpoints . ...
return OK_PREFIX ;
public class CommonOps_DDF4 { /** * Returns the absolute value of the element in the matrix that has the largest absolute value . < br > * < br > * Max { | a < sub > ij < / sub > | } for all i and j < br > * @ param a A matrix . Not modified . * @ return The max abs element value of the matrix . */ public stati...
double max = Math . abs ( a . a11 ) ; double tmp = Math . abs ( a . a12 ) ; if ( tmp > max ) max = tmp ; tmp = Math . abs ( a . a13 ) ; if ( tmp > max ) max = tmp ; tmp = Math . abs ( a . a14 ) ; if ( tmp > max ) max = tmp ; tmp = Math . abs ( a . a21 ) ; if ( tmp > max ) max = tmp ; tmp = Math . abs ( a . a22 ) ; if (...
public class ImmutableSetJsonDeserializer { /** * @ param deserializer { @ link JsonDeserializer } used to deserialize the objects inside the { @ link ImmutableSet } . * @ param < T > Type of the elements inside the { @ link ImmutableSet } * @ return a new instance of { @ link ImmutableSetJsonDeserializer } */ publ...
return new ImmutableSetJsonDeserializer < T > ( deserializer ) ;
public class DatePickerDialog { /** * Set the selected date of this DatePickerDialog . * @ param day The day value of selected date . * @ param month The month value of selected date . * @ param year The year value of selected date . * @ return The DatePickerDialog for chaining methods . */ public DatePickerDia...
mDatePickerLayout . setDate ( day , month , year ) ; return this ;
public class AggregationPipelineImpl { /** * Converts a Projection to a DBObject for use by the Java driver . * @ param projection the project to apply * @ return the DBObject */ private DBObject toDBObject ( final Projection projection ) { } }
String target ; if ( firstStage ) { MappedField field = mapper . getMappedClass ( source ) . getMappedField ( projection . getTarget ( ) ) ; target = field != null ? field . getNameToStore ( ) : projection . getTarget ( ) ; } else { target = projection . getTarget ( ) ; } if ( projection . getProjections ( ) != null ) ...
public class CmsNewLinkFunctionTable { /** * Triggers creation and editing of a new element for the given collector , identified by its context id . < p > * @ param contextId the context id of the collector */ public void createAndEditNewElement ( String contextId ) { } }
Runnable action = m_createFunctions . get ( contextId ) ; if ( action != null ) { action . run ( ) ; } else { log ( "Could not execute create action for context id '" + contextId + "'" ) ; }
public class AbstractProxyCollection { /** * Creates an a data collection which has no entity inside it */ private void createEmptyDataCollection ( ) { } }
Class < ? > collectionClass = getRelation ( ) . getProperty ( ) . getType ( ) ; if ( collectionClass . isAssignableFrom ( Set . class ) ) { dataCollection = new HashSet ( ) ; } else if ( collectionClass . isAssignableFrom ( List . class ) ) { dataCollection = new ArrayList ( ) ; }