signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class AdminLabeltypeAction { private HtmlResponse asListHtml ( ) { } }
return asHtml ( path_AdminLabeltype_AdminLabeltypeJsp ) . renderWith ( data -> { RenderDataUtil . register ( data , "labelTypeItems" , labelTypeService . getLabelTypeList ( labelTypePager ) ) ; // page navi } ) . useForm ( SearchForm . class , setup -> { setup . setup ( form -> { copyBeanToBean ( labelTypePager , form ...
public class DeleteBrokerRequestMarshaller { /** * Marshall the given parameter object . */ public void marshall ( DeleteBrokerRequest deleteBrokerRequest , ProtocolMarshaller protocolMarshaller ) { } }
if ( deleteBrokerRequest == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( deleteBrokerRequest . getBrokerId ( ) , BROKERID_BINDING ) ; } catch ( Exception e ) { throw new SdkClientException ( "Unable to marshall request to JSON: " + e . ge...
public class SingleFileStore { /** * Coalesces adjacent free entries to create larger free entries ( so that the probability of finding a free entry during allocation increases ) */ private void mergeFreeEntries ( List < FileEntry > entries ) { } }
long startTime = 0 ; if ( trace ) startTime = timeService . wallClockTime ( ) ; FileEntry lastEntry = null ; FileEntry newEntry = null ; int mergeCounter = 0 ; for ( FileEntry fe : entries ) { if ( fe . isLocked ( ) ) continue ; // Merge any holes created ( consecutive free entries ) in the file if ( ( lastEntry != nul...
public class CmsSystemConfiguration { /** * Adds a new instance of a request handler class . < p > * @ param clazz the class name of the request handler to instantiate and add */ public void addRequestHandler ( String clazz ) { } }
Object initClass ; try { initClass = Class . forName ( clazz ) . newInstance ( ) ; } catch ( Throwable t ) { LOG . error ( Messages . get ( ) . getBundle ( ) . key ( Messages . LOG_INIT_REQUEST_HANDLER_FAILURE_1 , clazz ) , t ) ; return ; } if ( initClass instanceof I_CmsRequestHandler ) { m_requestHandlers . add ( ( I...
public class ObjectMapperProvider { /** * Writes out the flow object * @ param jsonGenerator * @ param aFlow * @ param selectedSerialization * @ param includeFilter * @ throws JsonGenerationException * @ throws IOException */ @ SuppressWarnings ( "deprecation" ) public static void writeFlowDetails ( JsonGen...
jsonGenerator . writeStartObject ( ) ; // serialize the FlowKey object filteredWrite ( "flowKey" , includeFilter , aFlow . getFlowKey ( ) , jsonGenerator ) ; // serialize individual members of this class filteredWrite ( "flowName" , includeFilter , aFlow . getFlowName ( ) , jsonGenerator ) ; filteredWrite ( "userName" ...
public class ImageParser { /** * Parse a string of base64 encoded image data . 2011-09-08 PwD */ public static Document parseBase64 ( String base64Data , Element instruction ) throws Exception { } }
byte [ ] imageData = Base64 . decodeBase64 ( base64Data ) ; ByteArrayInputStream bais = new ByteArrayInputStream ( imageData ) ; StringWriter swLogger = new StringWriter ( ) ; PrintWriter pwLogger = new PrintWriter ( swLogger ) ; return parse ( bais , instruction , pwLogger ) ;
public class AbstractPool { /** * { @ inheritDoc } */ public void emptyManagedConnectionPool ( ManagedConnectionPool mcp ) { } }
if ( pools . values ( ) . remove ( mcp ) ) { mcp . shutdown ( ) ; if ( Tracer . isEnabled ( ) ) Tracer . destroyManagedConnectionPool ( poolConfiguration . getId ( ) , mcp ) ; }
public class Seb { /** * Modify Seb label joining given labels . * @ param labels * Seb labels * @ deprecated As of Seb version 0.3.22 , replaced by * < code > Seb . withLabel ( String . . . labels ) < / code > . */ @ Deprecated public void setLabel ( String ... labels ) { } }
this . label = utils . join ( LABEL_DELIMITER , ( Object [ ] ) labels ) ;
public class Matrix3x2f { /** * Apply shearing to this matrix by shearing along the X axis using the Y axis factor < code > yFactor < / code > , * and store the result in < code > dest < / code > . * @ param yFactor * the factor for the Y component to shear along the X axis * @ param dest * will hold the resu...
float nm10 = m00 * yFactor + m10 ; float nm11 = m01 * yFactor + m11 ; dest . m00 = m00 ; dest . m01 = m01 ; dest . m10 = nm10 ; dest . m11 = nm11 ; dest . m20 = m20 ; dest . m21 = m21 ; return dest ;
public class BaseStepControllerImpl { /** * The only valid states at this point are STARTED , STOPPING , or FAILED . * been able to get to STOPPED , or COMPLETED yet at this point in the code . */ private void transitionToFinalBatchStatus ( ) { } }
StopLock stopLock = getStopLock ( ) ; // Store in local variable to facilitate Ctrl + Shift + G search in Eclipse synchronized ( stopLock ) { BatchStatus currentBatchStatus = runtimeStepExecution . getBatchStatus ( ) ; if ( currentBatchStatus . equals ( BatchStatus . STARTED ) ) { updateStepBatchStatus ( BatchStatus . ...
public class JCacheProducers { /** * Allow @ Inject of Cache identified by its unique name * @ param ip to retrieve cache name * @ param < K > Key type * @ param < V > Value type * @ return unique instance of requested named cache * @ throws IllegalStateException if cache is not found in current context */ @ ...
String cacheName = ip . getAnnotated ( ) . getAnnotation ( NamedJCache . class ) . name ( ) ; Cache < K , V > cache = produceCacheManager ( ) . getCache ( cacheName ) ; if ( cache == null ) throw new IllegalStateException ( "Cannot @Produces cache : Named JCache '" + cacheName + "' does not exists. Make sure you create...
public class ThreadLocalRandom { /** * Returns an effectively unlimited stream of pseudorandom { @ code * double } values , each conforming to the given origin ( inclusive ) and bound * ( exclusive ) . * @ implNote This method is implemented to be equivalent to { @ code * doubles ( Long . MAX _ VALUE , randomNu...
if ( ! ( randomNumberOrigin < randomNumberBound ) ) throw new IllegalArgumentException ( BAD_RANGE ) ; return StreamSupport . doubleStream ( new RandomDoublesSpliterator ( 0L , Long . MAX_VALUE , randomNumberOrigin , randomNumberBound ) , false ) ;
public class CharMatcher { /** * Sets bits in { @ code table } matched by this matcher . * @ param table the new bits */ void setBits ( BitSet table ) { } }
for ( int c = Character . MAX_VALUE ; c >= Character . MIN_VALUE ; c -- ) { if ( matches ( ( char ) c ) ) { table . set ( c ) ; } }
public class Util { /** * Creates a regexp from < code > likePattern < / code > . * @ param likePattern the pattern . * @ return the regular expression < code > Pattern < / code > . */ public static Pattern createRegexp ( String likePattern ) { } }
// - escape all non alphabetic characters // - escape constructs like \ < alphabetic char > into \ \ < alphabetic char > // - replace non escaped _ % into . and . * StringBuilder regexp = new StringBuilder ( ) ; boolean escaped = false ; for ( int i = 0 ; i < likePattern . length ( ) ; i ++ ) { if ( likePattern . charA...
public class Profile { /** * Sets the background interval . If the background profile hasn ' t started , start it . */ public void setBackgroundPeriod ( long period ) { } }
if ( period < 1 ) { throw new ConfigException ( L . l ( "profile period '{0}ms' is too small. The period must be greater than 10ms." , period ) ) ; } _profilerService . setBackgroundInterval ( period , TimeUnit . MILLISECONDS ) ;
public class VertxGenerator { /** * copied from jOOQ ' s JavaGenerator * @ param table * @ param out1 */ @ Override protected void generateDao ( TableDefinition table , JavaWriter out1 ) { } }
UniqueKeyDefinition key = table . getPrimaryKey ( ) ; if ( key == null ) { logger . info ( "Skipping DAO generation" , out1 . file ( ) . getName ( ) ) ; return ; } VertxJavaWriter out = ( VertxJavaWriter ) out1 ; generateDAO ( key , table , out ) ;
public class MultiUserChat { /** * Grants voice to a visitor in the room . In a moderated room , a moderator may want to manage * who does and does not have " voice " in the room . To have voice means that a room occupant * is able to send messages to the room occupants . * @ param nickname the nickname of the vi...
changeRole ( nickname , MUCRole . participant , null ) ;
public class ArticleFeatureExtractor { /** * Computes the markedness of the area . The markedness generally describes the visual importance of the area based on different criteria . * @ return the computed expressiveness */ public double getMarkedness ( Area node ) { } }
double fsz = node . getFontSize ( ) / avgfont ; // use relative font size , 0 is the normal font double fwt = node . getFontWeight ( ) ; double fst = node . getFontStyle ( ) ; double ind = getIndentation ( node ) ; double cen = isCentered ( node ) ? 1.0 : 0.0 ; double contrast = getContrast ( node ) ; double cp = 1.0 -...
public class AbstractJobVertex { /** * Returns the index of this vertex ' s first free input gate . * @ return the index of the first free input gate */ protected int getFirstFreeInputGateIndex ( ) { } }
for ( int i = 0 ; i < this . backwardEdges . size ( ) ; i ++ ) { if ( this . backwardEdges . get ( i ) == null ) { return i ; } } return this . backwardEdges . size ( ) ;
public class JsonSerializerMiddlewares { /** * Middleware that serializes the result of the inner handler using the supplied * { @ link ObjectWriter } , and sets the Content - Type header to application / json . */ public static < T > Middleware < AsyncHandler < T > , AsyncHandler < Response < ByteString > > > jsonSe...
return handler -> requestContext -> handler . invoke ( requestContext ) . thenApply ( result -> Response . forPayload ( serialize ( objectWriter , result ) ) . withHeader ( CONTENT_TYPE , JSON ) ) ;
public class PharmacophoreQueryAngleBond { /** * Checks whether the query angle constraint matches a target distance . * This method checks whether a query constraint is satisfied by an observed * angle ( represented by a { @ link org . openscience . cdk . pharmacophore . PharmacophoreAngleBond } in the target mole...
bond = BondRef . deref ( bond ) ; if ( bond instanceof PharmacophoreAngleBond ) { PharmacophoreAngleBond pbond = ( PharmacophoreAngleBond ) bond ; double bondLength = round ( pbond . getBondLength ( ) , 2 ) ; return bondLength >= lower && bondLength <= upper ; } else return false ;
public class SessionDialog { /** * Initialises the given panel with the current session and the corresponding UI shared context . * @ param contextPanel the context panel to initialise * @ see AbstractContextPropertiesPanel # initContextData ( Session , Context ) */ private void initContextPanel ( AbstractContextPr...
Context ctx = uiContexts . get ( contextPanel . getContextIndex ( ) ) ; if ( ctx != null ) { contextPanel . initContextData ( session , ctx ) ; }
public class Agent { /** * This method reconfigures the agent . * It is invoked by iPojo when the configuration changes . * It may be invoked before the start ( ) method is . */ @ Override public void reconfigure ( ) { } }
// This method is invoked when properties change . // It is not related to life cycle ( start / stop ) . this . logger . info ( "Reconfiguration requested in agent " + getAgentId ( ) ) ; if ( this . messagingClient == null ) { this . logger . info ( "The agent has not yet been started. Configuration is dropped." ) ; re...
public class MutableBigInteger { /** * This method is used for division . It multiplies an n word input a by one * word input x , and subtracts the n word product from q . This is needed * when subtracting qhat * divisor from dividend . */ private int mulsub ( int [ ] q , int [ ] a , int x , int len , int offset ) ...
long xLong = x & LONG_MASK ; long carry = 0 ; offset += len ; for ( int j = len - 1 ; j >= 0 ; j -- ) { long product = ( a [ j ] & LONG_MASK ) * xLong + carry ; long difference = q [ offset ] - product ; q [ offset -- ] = ( int ) difference ; carry = ( product >>> 32 ) + ( ( ( difference & LONG_MASK ) > ( ( ( ~ ( int )...
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link AbstractTopologyType } { @ code > } * @ param value * Java instance representing xml element ' s value . * @ return * the new instance of { @ link JAXBElement } { @ code < } { @ link AbstractTopologyType } { @ ...
return new JAXBElement < AbstractTopologyType > ( __Topology_QNAME , AbstractTopologyType . class , null , value ) ;
public class CmdLineCLA { /** * { @ inheritDoc } */ @ Override protected void exportCommandLineData ( final StringBuilder str , final int occ ) { } }
str . append ( "[" ) ; getValue ( occ ) . exportCommandLine ( str ) ; str . append ( "]" ) ;
public class PdfObject { /** * Whether this object can be contained in an object stream . * PdfObjects of type STREAM OR INDIRECT can not be contained in an * object stream . * @ return < CODE > true < / CODE > if this object can be in an object stream . * Otherwise < CODE > false < / CODE > */ public boolean c...
switch ( type ) { case NULL : case BOOLEAN : case NUMBER : case STRING : case NAME : case ARRAY : case DICTIONARY : return true ; case STREAM : case INDIRECT : default : return false ; }
public class ReconciliationReportRow { /** * Gets the dfpRevenue value for this ReconciliationReportRow . * @ return dfpRevenue * The revenue calculated based on the { @ link # costPerUnit } , { @ link * # costType } , * { @ link # dfpClicks } , { @ link # dfpImpressions } and { @ link * # dfpLineItemDays } . ...
return dfpRevenue ;
public class NodeTaskServiceImpl { /** * 获取匹配stage的TaskEvent对象 */ private TaskEvent getMatchStage ( NodeTask nodeTask , StageType stage ) { } }
List < StageType > stages = nodeTask . getStage ( ) ; List < TaskEvent > events = nodeTask . getEvent ( ) ; for ( int i = 0 ; i < stages . size ( ) ; i ++ ) { if ( stages . get ( i ) == stage ) { return events . get ( i ) ; } } return null ;
public class NodeTypeDataManagerImpl { /** * Registers all the remote commands */ private void initRemoteCommands ( ) { } }
this . id = UUID . randomUUID ( ) . toString ( ) ; registerNodeTypes = rpcService . registerCommand ( new RemoteCommand ( ) { public String getId ( ) { return "org.exoplatform.services.jcr.impl.core.nodetype.NodeTypeDataManagerImpl-registerNodeTypes-" + repositoryName ; } public Serializable execute ( Serializable [ ] ...
public class MetadataProviderImpl { /** * Creates the method metadata for methods annotated with { @ link ResultOf } . * @ param annotatedMethod * The annotated method - * @ param resultOf * The { @ link com . buschmais . xo . api . annotation . ResultOf } annotation . * @ return The method metadata . */ priv...
Method method = annotatedMethod . getAnnotatedElement ( ) ; // Determine query type Class < ? > methodReturnType = method . getReturnType ( ) ; Class < ? > returnType ; if ( Result . class . isAssignableFrom ( methodReturnType ) ) { Type genericReturnType = method . getGenericReturnType ( ) ; ParameterizedType paramete...
public class Bond { /** * Returns the spread value such that the sum of cash flows of the bond discounted with a given reference curve * with the additional spread coincides with a given price . * @ param bondPrice The target price as double . * @ param referenceCurve The reference curve used for discounting the ...
GoldenSectionSearch search = new GoldenSectionSearch ( - 2.0 , 2.0 ) ; while ( search . getAccuracy ( ) > 1E-11 && ! search . isDone ( ) ) { double x = search . getNextPoint ( ) ; double fx = getValueWithGivenSpreadOverCurve ( 0.0 , referenceCurve , x , model ) ; double y = ( bondPrice - fx ) * ( bondPrice - fx ) ; sea...
public class HsqlTimer { /** * Causes the specified Runnable to be executed periodically in the * background , starting after the specified delay . * @ return opaque reference to the internal task * @ param period the cycle period * @ param relative if true , fixed rate sheduling else fixed delay scheduling *...
if ( period <= 0 ) { throw new IllegalArgumentException ( "period <= 0" ) ; } else if ( runnable == null ) { throw new IllegalArgumentException ( "runnable == null" ) ; } return addTask ( now ( ) + delay , runnable , period , relative ) ;
public class S { /** * Format a date with specified pattern , lang , locale and timezone . The locale * comes from the engine instance specified * @ param template * @ param date * @ param pattern * @ param locale * @ param timezone * @ return format result */ public static String format ( ITemplate templ...
if ( null == date ) throw new NullPointerException ( ) ; RythmEngine engine = null == template ? RythmEngine . get ( ) : template . __engine ( ) ; DateFormat df = ( null == engine ? IDateFormatFactory . DefaultDateFormatFactory . INSTANCE : engine . dateFormatFactory ( ) ) . createDateFormat ( template , pattern , loca...
public class ClassicLockView { /** * Triggers the back action on the form . * @ return true if it was handled , false otherwise */ public boolean onBackPressed ( ) { } }
if ( subForm != null ) { final boolean shouldDisplayPreviousForm = configuration . allowLogIn ( ) || configuration . allowSignUp ( ) ; if ( shouldDisplayPreviousForm ) { resetHeaderTitle ( ) ; showSignUpTerms ( subForm instanceof CustomFieldsFormView ) ; removeSubForm ( ) ; clearFocus ( ) ; return true ; } } return for...
public class BoxFactory { /** * Creates a single new box from an element . * @ param n The source DOM element * @ param display the display : property value that is used when the box style is not known ( e . g . anonymous boxes ) * @ return A new box of a subclass of { @ link ElementBox } based on the value of th...
ElementBox root = null ; // New box style NodeData style = decoder . getElementStyleInherited ( n ) ; if ( style == null ) style = createAnonymousStyle ( display ) ; // Special ( HTML ) tag names if ( config . getUseHTML ( ) && html . isTagSupported ( n ) ) { root = html . createBox ( parent , n , viewport , style ) ; ...
public class LoadJobConfiguration { /** * Creates a builder for a BigQuery Load Job configuration given the destination table and source * URIs . */ public static Builder newBuilder ( TableId destinationTable , List < String > sourceUris ) { } }
return new Builder ( ) . setDestinationTable ( destinationTable ) . setSourceUris ( sourceUris ) ;
public class PoolsImpl { /** * Changes the number of compute nodes that are assigned to a pool . * You can only resize a pool when its allocation state is steady . If the pool is already resizing , the request fails with status code 409 . When you resize a pool , the pool ' s allocation state changes from steady to r...
resizeWithServiceResponseAsync ( poolId , poolResizeParameter ) . toBlocking ( ) . single ( ) . body ( ) ;
public class FormValidator { /** * Start live validation - whenever focus changes from view with validations upon itself , validators will run . < br / > * Don ' t forget to call { @ link # stopLiveValidation ( Object ) } once you are done . * @ param fragment fragment with views to validate , there can be only one...
startLiveValidation ( fragment , fragment . getView ( ) , callback ) ;
public class MonitoringServiceImpl { /** * Filter events . * @ param events the events * @ return the list of filtered events */ private List < Event > filterEvents ( List < Event > events ) { } }
List < Event > filteredEvents = new ArrayList < Event > ( ) ; for ( Event event : events ) { if ( ! filter ( event ) ) { filteredEvents . add ( event ) ; } } return filteredEvents ;
public class NetworkClient { /** * Switches the network mode from auto subnet mode to custom subnet mode . * < p > Sample code : * < pre > < code > * try ( NetworkClient networkClient = NetworkClient . create ( ) ) { * ProjectGlobalNetworkName network = ProjectGlobalNetworkName . of ( " [ PROJECT ] " , " [ NETW...
SwitchToCustomModeNetworkHttpRequest request = SwitchToCustomModeNetworkHttpRequest . newBuilder ( ) . setNetwork ( network == null ? null : network . toString ( ) ) . build ( ) ; return switchToCustomModeNetwork ( request ) ;
public class SightResourcesImpl { /** * Creates s copy of the specified Sight . * It mirrors to the following Smartsheet REST API method : POST / sights / { sightId } / move * @ param sightId the Id of the Sight * @ param destination the destination to copy to * @ return the newly created Sight resource . * @...
return this . createResource ( "sights/" + sightId + "/move" , Sight . class , destination ) ;
public class TreeVectorizer { /** * Vectorizes the passed in sentences * @ param sentences the sentences to convert to trees * @ param label the label for the sentence * @ param labels all of the possible labels for the trees * @ return a list of trees pre converted with CNF and * binarized and word vectors a...
List < Tree > ret = new ArrayList < > ( ) ; List < Tree > baseTrees = parser . getTreesWithLabels ( sentences , label , labels ) ; for ( Tree t : baseTrees ) { Tree binarized = treeTransformer . transform ( t ) ; binarized = cnfTransformer . transform ( binarized ) ; ret . add ( binarized ) ; } return ret ;
public class AltsHandshakerClient { /** * Sets the start server fields for the passed handshake request . */ private void setStartServerFields ( HandshakerReq . Builder req , ByteBuffer inBytes ) { } }
ServerHandshakeParameters serverParameters = ServerHandshakeParameters . newBuilder ( ) . addRecordProtocols ( RECORD_PROTOCOL ) . build ( ) ; StartServerHandshakeReq . Builder startServerReq = StartServerHandshakeReq . newBuilder ( ) . addApplicationProtocols ( APPLICATION_PROTOCOL ) . putHandshakeParameters ( Handsha...
public class MathBindings { /** * Binding for { @ link java . lang . Math # incrementExact ( long ) } * @ param a the value to increment * @ return the result * @ throws ArithmeticException if the result overflows a long */ public static LongBinding incrementExact ( final ObservableLongValue a ) { } }
return createLongBinding ( ( ) -> Math . incrementExact ( a . get ( ) ) , a ) ;
public class NativeLibraryLoader { /** * Load the helper { @ link Class } as a byte array , to be redefined in specified { @ link ClassLoader } . * @ param clazz - The helper { @ link Class } provided by this bundle * @ return The binary content of helper { @ link Class } . * @ throws ClassNotFoundException Helpe...
String fileName = clazz . getName ( ) ; int lastDot = fileName . lastIndexOf ( '.' ) ; if ( lastDot > 0 ) { fileName = fileName . substring ( lastDot + 1 ) ; } URL classUrl = clazz . getResource ( fileName + ".class" ) ; if ( classUrl == null ) { throw new ClassNotFoundException ( clazz . getName ( ) ) ; } byte [ ] buf...
public class CommerceWarehouseUtil { /** * Returns a range of all the commerce warehouses where groupId = & # 63 ; and commerceCountryId = & # 63 ; and primary = & # 63 ; . * Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and < code > end < ...
return getPersistence ( ) . findByG_C_P ( groupId , commerceCountryId , primary , start , end ) ;
public class ElementBox { /** * Updates the stacking parent values and registers the z - index for this parent . */ @ Override protected void updateStackingContexts ( ) { } }
super . updateStackingContexts ( ) ; if ( stackingParent != null ) { if ( formsStackingContext ( ) ) // all the positioned boxes are considered as separate stacking contexts { stackingParent . getStackingContext ( ) . registerChildContext ( this ) ; if ( scontext != null ) // clear this context if it exists ( remove ol...
public class TargetCleanupTask { /** * Performs a cleanup on all loaded targets . */ @ Scheduled ( cron = "${deployer.main.targets.cleanup.cron}" ) public void cleanupAllTargets ( ) { } }
try { logger . info ( "Starting cleanup for all targets" ) ; targetService . getAllTargets ( ) . forEach ( Target :: cleanup ) ; } catch ( TargetServiceException e ) { logger . error ( "Error getting loaded targets" , e ) ; }
public class HadoopImageDownload { /** * Download of an image by URL . * @ return The image as a BufferedImage object . * @ throws Exception */ private BufferedImage downloadImage ( ) throws Exception { } }
BufferedImage image = null ; InputStream in = null ; try { // first try reading with the default class URL url = new URL ( imageUrl ) ; HttpURLConnection conn = null ; boolean success = false ; try { conn = ( HttpURLConnection ) url . openConnection ( ) ; conn . setInstanceFollowRedirects ( followRedirects ) ; conn . s...
public class FunctionTypeBuilder { /** * Infer the return type from JSDocInfo . * @ param fromInlineDoc Indicates whether return type is inferred from inline * doc attached to function name */ FunctionTypeBuilder inferReturnType ( @ Nullable JSDocInfo info , boolean fromInlineDoc ) { } }
if ( info != null ) { JSTypeExpression returnTypeExpr = fromInlineDoc ? info . getType ( ) : info . getReturnType ( ) ; if ( returnTypeExpr != null ) { returnType = returnTypeExpr . evaluate ( templateScope , typeRegistry ) ; returnTypeInferred = false ; } } return this ;
public class GridRowSet { /** * Give the regular grid * @ return ResultSet * @ throws SQLException */ public ResultSet getResultSet ( ) throws SQLException { } }
SimpleResultSet srs = new SimpleResultSet ( this ) ; srs . addColumn ( "THE_GEOM" , Types . JAVA_OBJECT , "GEOMETRY" , 0 , 0 ) ; srs . addColumn ( "ID" , Types . INTEGER , 10 , 0 ) ; srs . addColumn ( "ID_COL" , Types . INTEGER , 10 , 0 ) ; srs . addColumn ( "ID_ROW" , Types . INTEGER , 10 , 0 ) ; return srs ;
public class LinearSolverFactory_DDRM { /** * Linear solver which uses QR pivot decomposition . These solvers can handle singular systems * and should never fail . For singular systems , the solution might not be as accurate as a * pseudo inverse that uses SVD . * For singular systems there are multiple correct s...
QRColPivDecompositionHouseholderColumn_DDRM decomposition = new QRColPivDecompositionHouseholderColumn_DDRM ( ) ; if ( computeQ ) return new SolvePseudoInverseQrp_DDRM ( decomposition , computeNorm2 ) ; else return new LinearSolverQrpHouseCol_DDRM ( decomposition , computeNorm2 ) ;
public class LoganSquare { /** * Parse a parameterized object from a String . Note : parsing from an InputStream should be preferred over parsing from a String if possible . * @ param jsonString The JSON string being parsed . * @ param jsonObjectType The ParameterizedType describing the object . Ex : LoganSquare . ...
return mapperFor ( jsonObjectType ) . parse ( jsonString ) ;
public class StringParser { /** * Parse the given { @ link String } as short with the specified radix . * @ param sStr * The string to parse . May be < code > null < / code > . * @ param nRadix * The radix to use . Must be & ge ; { @ link Character # MIN _ RADIX } and & le ; * { @ link Character # MAX _ RADIX...
if ( sStr != null && sStr . length ( ) > 0 ) try { return Short . parseShort ( sStr , nRadix ) ; } catch ( final NumberFormatException ex ) { // Fall through } return nDefault ;
public class FunctionLepKeyResolver { /** * { @ inheritDoc } */ @ Override protected String [ ] getAppendSegments ( SeparatorSegmentedLepKey baseKey , LepMethod method , LepManagerService managerService ) { } }
// function key String translatedFuncKey = translateToLepConvention ( getRequiredStrParam ( method , PARAM_FUNCTION_KEY ) ) ; return new String [ ] { translatedFuncKey } ;
public class ImageFrame { /** * Displays the specified image in a new ImageFrame instance . * Creates a new ImageFrame , sets the specified image , and schedules a * call to < tt > setVisible ( true ) < / tt > on the AWT event dispatching thread . * @ param img to be displayed * @ return the frame that displays...
ImageFrame frame = new ImageFrame ( ) . useDefaultSettings ( ) ; SwingUtilities . invokeLater ( ( ) -> { frame . setImage ( img ) ; frame . setVisible ( true ) ; } ) ; return frame ;
public class CalendarText { /** * / * [ deutsch ] * < p > Liefert einen { @ code Accessor } f & uuml ; r alle Textformen des * angegebenen chronologischen Elements . < / p > * < p > Textformen k & ouml ; nnen unter Umst & auml ; nden in verschiedenen * Varianten vorkommen . Als Variantenbezug dient bei enum - V...
return this . getTextForms ( element . name ( ) , element . getType ( ) , variants ) ;
public class CATBrowseConsumer { /** * Helper method . Wraps the action of getting the next message for a browser session * and deals with the exceptions which may be thrown . If an exception is thrown the * client is notified ( if appropriate ) and an OperationFailedException is thrown . * This allows the caller...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "getNextMessage" , new Object [ ] { browserSession , conversation , "" + requestNumber } ) ; SIBusMessage msg = null ; try { msg = browserSession . next ( ) ; } catch ( SIException e ) { // No FFDC code needed // Only...
public class AccessControlEntryImpl { /** * Adds specified privileges to this entry . * @ param privileges privileges to add . * @ return true if at least one of privileges was added . */ protected boolean addIfNotPresent ( Privilege [ ] privileges ) { } }
ArrayList < Privilege > list = new ArrayList < Privilege > ( ) ; Collections . addAll ( list , privileges ) ; boolean res = combineRecursively ( list , privileges ) ; this . privileges . addAll ( list ) ; return res ;
public class MapsInner { /** * Gets an integration account map . * @ param resourceGroupName The resource group name . * @ param integrationAccountName The integration account name . * @ param mapName The integration account map name . * @ param serviceCallback the async ServiceCallback to handle successful and...
return ServiceFuture . fromResponse ( getWithServiceResponseAsync ( resourceGroupName , integrationAccountName , mapName ) , serviceCallback ) ;
public class AbstractPendingLinkingCandidate { /** * Returns the resolved string representation of the argument types . The simple names of * the types are used . The string representation includes the parenthesis . */ protected String getArgumentTypesAsString ( ) { } }
if ( ! getArguments ( ) . isEmpty ( ) ) { StringBuilder b = new StringBuilder ( ) ; b . append ( "(" ) ; for ( int i = 0 ; i < getArguments ( ) . size ( ) ; ++ i ) { LightweightTypeReference actualType = getActualType ( getArguments ( ) . get ( i ) ) ; if ( actualType != null ) b . append ( actualType . getHumanReadabl...
public class ThrottledApiHandler { /** * Retrieve a specific summoner spell * This method does not count towards the rate limit and is not affected by the throttle * @ param id The id of the spell * @ param data Additional information to retrieve * @ return The spell * @ see < a href = https : / / developer ....
return new DummyFuture < > ( handler . getSummonerSpell ( id , data ) ) ;
public class BaseHolder { /** * Find the key for the baseholder that holds this session . */ public String find ( RemoteBaseSession obj ) { } }
if ( m_mapChildHolders == null ) return null ; return m_mapChildHolders . find ( obj ) ;
public class RouteFilterRulesInner { /** * Updates a route in the specified route filter . * @ param resourceGroupName The name of the resource group . * @ param routeFilterName The name of the route filter . * @ param ruleName The name of the route filter rule . * @ param routeFilterRuleParameters Parameters s...
return updateWithServiceResponseAsync ( resourceGroupName , routeFilterName , ruleName , routeFilterRuleParameters ) . toBlocking ( ) . last ( ) . body ( ) ;
public class ChronoLocalDateTimeImpl { /** * Returns a copy of this date - time with the new date and time , checking * to see if a new object is in fact required . * @ param newDate the date of the new date - time , not null * @ param newTime the time of the new date - time , not null * @ return the date - tim...
if ( date == newDate && time == newTime ) { return this ; } // Validate that the new Temporal is a ChronoLocalDate ( and not something else ) D cd = ChronoLocalDateImpl . ensureValid ( date . getChronology ( ) , newDate ) ; return new ChronoLocalDateTimeImpl < > ( cd , newTime ) ;
public class SarlFormalParameterImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public void eSet ( int featureID , Object newValue ) { } }
switch ( featureID ) { case SarlPackage . SARL_FORMAL_PARAMETER__DEFAULT_VALUE : setDefaultValue ( ( XExpression ) newValue ) ; return ; } super . eSet ( featureID , newValue ) ;
public class RollupUtils { /** * Returns the offset in milliseconds from the row base timestamp from a data * point qualifier at the given offset ( for compacted columns ) * @ param qualifier The qualifier to parse * @ param byte _ offset An offset within the byte array * @ param interval The RollupInterval obj...
long offset = 0 ; if ( ( qualifier [ byte_offset ] & Const . MS_BYTE_FLAG ) == Const . MS_BYTE_FLAG ) { offset = ( ( Bytes . getUnsignedInt ( qualifier , byte_offset ) & 0x0FFFFFC0 ) >>> Const . MS_FLAG_BITS ) / 1000 ; } else { offset = ( Bytes . getUnsignedShort ( qualifier , byte_offset ) & 0xFFFF ) >>> Const . FLAG_...
public class LongIntVectorSlice { /** * Gets the idx ' th entry in the vector . * @ param idx The index of the element to get . * @ return The value of the element to get . */ public int get ( long idx ) { } }
if ( idx < 0 || idx >= size ) { return 0 ; } return elements [ SafeCast . safeLongToInt ( idx + start ) ] ;
public class Span { /** * Adds a MessageEvent to the { @ code Span } . * < p > This function can be used by higher level applications to record messaging event . * < p > This method should always be overridden by users whose API versions are larger or equal to * { @ code 0.12 } . * @ param messageEvent the mess...
// Default implementation by invoking addNetworkEvent ( ) so that any existing derived classes , // including implementation and the mocked ones , do not need to override this method explicitly . Utils . checkNotNull ( messageEvent , "messageEvent" ) ; addNetworkEvent ( BaseMessageEventUtils . asNetworkEvent ( messageE...
public class RaftImpl { /** * Finds the first index at which conflicting _ term starts , going back from start _ index towards the head of the log */ protected int getFirstIndexOfConflictingTerm ( int start_index , int conflicting_term ) { } }
Log log = raft . log_impl ; int first = Math . max ( 1 , log . firstAppended ( ) ) , last = log . lastAppended ( ) ; int retval = Math . min ( start_index , last ) ; for ( int i = retval ; i >= first ; i -- ) { LogEntry entry = log . get ( i ) ; if ( entry == null || entry . term != conflicting_term ) break ; retval = ...
public class ZooClassDef { /** * Methods used for bootstrapping the schema of newly created databases . * @ return Meta schema instance */ public static ZooClassDef bootstrapZooClassDef ( ) { } }
ZooClassDef meta = new ZooClassDef ( ZooClassDef . class . getName ( ) , 51 , 50 , 51 , 0 ) ; ArrayList < ZooFieldDef > fields = new ArrayList < ZooFieldDef > ( ) ; fields . add ( new ZooFieldDef ( meta , "className" , String . class . getName ( ) , 0 , JdoType . STRING , 70 ) ) ; fields . add ( new ZooFieldDef ( meta ...
public class Ledgers { /** * Fences out a Log made up of the given ledgers . * @ param ledgers An ordered list of LedgerMetadata objects representing all the Ledgers in the log . * @ param bookKeeper A reference to the BookKeeper client to use . * @ param config Configuration to use . * @ param traceObjectId Us...
// Fence out the ledgers , in descending order . During the process , we need to determine whether the ledgers we // fenced out actually have any data in them , and update the LedgerMetadata accordingly . // We need to fence out at least MIN _ FENCE _ LEDGER _ COUNT ledgers that are not empty to properly ensure we fenc...
public class PTXImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public void eUnset ( int featureID ) { } }
switch ( featureID ) { case AfplibPackage . PTX__CS : getCS ( ) . clear ( ) ; return ; } super . eUnset ( featureID ) ;
public class CommerceShipmentUtil { /** * Returns the commerce shipments before and after the current commerce shipment in the ordered set where groupId = & # 63 ; . * @ param commerceShipmentId the primary key of the current commerce shipment * @ param groupId the group ID * @ param orderByComparator the compara...
return getPersistence ( ) . findByGroupId_PrevAndNext ( commerceShipmentId , groupId , orderByComparator ) ;
public class HostName { /** * Returns whether the given host matches this one . For hosts to match , they must represent the same addresses or have the same host names . * Hosts are not resolved when matching . Also , hosts must have the same port and service . They must have the same masks if they are host names . ...
if ( this == host ) { return true ; } if ( isValid ( ) ) { if ( host . isValid ( ) ) { if ( isAddressString ( ) ) { return host . isAddressString ( ) && asAddressString ( ) . equals ( host . asAddressString ( ) ) && Objects . equals ( getPort ( ) , host . getPort ( ) ) && Objects . equals ( getService ( ) , host . getS...
public class EnumElement { /** * Though not mentioned in the spec , enum names use C + + scoping rules , meaning that enum constants * are siblings of their declaring element , not children of it . */ static void validateValueUniquenessInScope ( String qualifiedName , List < TypeElement > nestedElements ) { } }
Set < String > names = new LinkedHashSet < > ( ) ; for ( TypeElement nestedElement : nestedElements ) { if ( nestedElement instanceof EnumElement ) { EnumElement enumElement = ( EnumElement ) nestedElement ; for ( EnumConstantElement constant : enumElement . constants ( ) ) { String name = constant . name ( ) ; if ( ! ...
public class SimpleSectionSkin { /** * * * * * * Methods * * * * * */ @ Override protected void handleEvents ( final String EVENT_TYPE ) { } }
super . handleEvents ( EVENT_TYPE ) ; if ( "VISIBILITY" . equals ( EVENT_TYPE ) ) { Helper . enableNode ( valueText , gauge . isValueVisible ( ) ) ; Helper . enableNode ( titleText , ! gauge . getTitle ( ) . isEmpty ( ) ) ; Helper . enableNode ( unitText , gauge . isValueVisible ( ) && ! gauge . getUnit ( ) . isEmpty (...
public class GlobalizationPreferences { /** * Restore the object to the initial state . * @ return this , for chaining * @ hide draft / provisional / internal are hidden on Android */ public GlobalizationPreferences reset ( ) { } }
if ( isFrozen ( ) ) { throw new UnsupportedOperationException ( "Attempt to modify immutable object" ) ; } locales = null ; territory = null ; calendar = null ; collator = null ; breakIterators = null ; timezone = null ; currency = null ; dateFormats = null ; numberFormats = null ; implicitLocales = null ; return this ...
public class StrategyRunner { /** * Instantiates an strategy , according to the provided properties mapping . * @ param properties the properties to be used . * @ param trainingModel datamodel containing the training interactions to be * considered when generating the strategy . * @ param testModel datamodel co...
Double threshold = Double . parseDouble ( properties . getProperty ( RELEVANCE_THRESHOLD ) ) ; String strategyClassName = properties . getProperty ( STRATEGY ) ; Class < ? > strategyClass = Class . forName ( strategyClassName ) ; // get strategy EvaluationStrategy < Long , Long > strategy = null ; if ( strategyClassNam...
public class N { /** * Convert the specified Map to a two columns < code > DataSet < / code > : one column is for keys and one column is for values * @ param keyColumnName * @ param valueColumnName * @ param m * @ return */ public static DataSet newDataSet ( final String keyColumnName , final String valueColumn...
final List < Object > keyColumn = new ArrayList < > ( m . size ( ) ) ; final List < Object > valueColumn = new ArrayList < > ( m . size ( ) ) ; for ( Map . Entry < ? , ? > entry : m . entrySet ( ) ) { keyColumn . add ( entry . getKey ( ) ) ; valueColumn . add ( entry . getValue ( ) ) ; } final List < String > columnNam...
public class TextUtil { /** * Compute the better metric representing * the given time amount and reply a string representation * of the given amount with this selected unit . * < p > This function try to use a greater metric unit . * @ param amount is the amount expressed in the given unit . * @ param unit is...
"checkstyle:magicnumber" , "checkstyle:cyclomaticcomplexity" , "checkstyle:npathcomplexity" } ) public static String formatTime ( double amount , TimeUnit unit ) { double amt ; double coef = 1. ; switch ( unit ) { case DAYS : coef = 86400. ; break ; case HOURS : coef = 3600. ; break ; case MINUTES : coef = 60. ; break ...
public class EvaluateSilhouette { /** * Evaluate a single clustering . * @ param db Database * @ param rel Data relation * @ param dq Distance query * @ param c Clustering * @ return Average silhouette */ public double evaluateClustering ( Database db , Relation < O > rel , DistanceQuery < O > dq , Clustering...
List < ? extends Cluster < ? > > clusters = c . getAllClusters ( ) ; MeanVariance msil = new MeanVariance ( ) ; int ignorednoise = 0 ; for ( Cluster < ? > cluster : clusters ) { // Note : we treat 1 - element clusters the same as noise . if ( cluster . size ( ) <= 1 || cluster . isNoise ( ) ) { switch ( noiseOption ) {...
public class RestService { /** * Override if entity has a meaningful ID . */ protected Long getEntityId ( String path , Object content , Map < String , String > headers ) { } }
return 0L ;
public class KeyValueSource { /** * A helper method to build a KeyValueSource implementation based on the specified { @ link IList } . < br / > * The key returned by this KeyValueSource implementation is < b > ALWAYS < / b > the name of the list itself , * whereas the value are the entries of the list , one by one ...
return new ListKeyValueSource < V > ( list . getName ( ) ) ;
public class GVRCompressedTextureLoader { /** * Register a loader with the ' sniffer ' . * ' Factory loaders ' are pre - registered . To load a format we don ' t support , * create a { @ link GVRCompressedTextureLoader } descendant . Then , before * trying to load any files in that format , create an instance and...
synchronized ( loaders ) { loaders . add ( this ) ; maximumHeaderLength = 0 ; for ( GVRCompressedTextureLoader loader : loaders ) { int headerLength = loader . headerLength ( ) ; if ( headerLength > maximumHeaderLength ) { maximumHeaderLength = headerLength ; } } }
public class DFSEvaluatorPreserver { /** * Closes the readerWriter , which in turn closes the FileSystem . * @ throws Exception */ @ Override public synchronized void close ( ) throws Exception { } }
if ( this . readerWriter != null && ! this . writerClosed ) { this . readerWriter . close ( ) ; this . writerClosed = true ; }
public class JPAWSJarURLConnection { /** * Passthrough operations for archive referencing wsjar URL support . Synchronized because calling getInputStream ( ) * while an InputStream is still active should return the active InputStream . */ @ Override public synchronized InputStream getInputStream ( ) throws IOExceptio...
if ( connected == false ) { // Implicitly open the connection if it has not yet been done so . connect ( ) ; } Object token = ThreadIdentityManager . runAsServer ( ) ; try { if ( inputStream == null ) { if ( "" . equals ( archivePath ) ) { inputStream = new FileInputStream ( urlTargetFile ) ; } else { inputStream = new...
public class DeleteValues { /** * { @ inheritDoc } */ public void twoPhaseCommit ( ) throws IOException { } }
if ( locks != null ) try { if ( bckFiles == null ) return ; for ( int i = 0 , length = bckFiles . length ; i < length ; i ++ ) { File f = bckFiles [ i ] ; if ( f != null && ! f . delete ( ) ) // Possible place of error : FileNotFoundException when we delete / update existing // Value and then add / update again . // Af...
public class StringUtils { /** * Joins the given { @ code list } into a comma - separated string . * @ param list * The list to join . * @ return A comma - separated string representation of the given { @ code list } . */ public static String join ( List < String > list ) { } }
if ( list == null ) { return null ; } StringBuilder joined = new StringBuilder ( ) ; boolean first = true ; for ( String element : list ) { if ( first ) { first = false ; } else { joined . append ( "," ) ; } joined . append ( element ) ; } return joined . toString ( ) ;
public class KeystoreManager { /** * Given an object representing a keystore , returns an actual stream for that keystore . * Allows you to provide an actual keystore as an InputStream or a byte [ ] array , * or a reference to a keystore file as a File object or a String path . * @ param keystore a keystore conta...
validateKeystoreParameter ( keystore ) ; try { if ( keystore instanceof InputStream ) return ( InputStream ) keystore ; else if ( keystore instanceof KeyStore ) return new WrappedKeystore ( ( KeyStore ) keystore ) ; else if ( keystore instanceof File ) return new BufferedInputStream ( new FileInputStream ( ( File ) key...
public class AbsDiff { /** * Move to next following node . * @ param paramRtx * the { @ link IReadTransaction } to use * @ param paramRevision * the { @ link ERevision } constant * @ return true , if cursor moved , false otherwise * @ throws TTIOException */ private boolean moveToFollowingNode ( final INode...
boolean moved = false ; while ( ! ( ( ITreeStructData ) paramRtx . getNode ( ) ) . hasRightSibling ( ) && ( ( ITreeStructData ) paramRtx . getNode ( ) ) . hasParent ( ) && paramRtx . getNode ( ) . getDataKey ( ) != mRootKey ) { moved = paramRtx . moveTo ( paramRtx . getNode ( ) . getParentKey ( ) ) ; if ( moved ) { swi...
public class SourceStreamSetControl { /** * / * ( non - Javadoc ) * @ see com . ibm . ws . sib . processor . runtime . SIMPDeliveryStreamSetTransmitControllable # clearMessagesAtSource ( byte ) * Function Name : clearMessagesAtSource * Parameters : indoubtAction determines how indoubt messages are handled . * I...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "clearMessagesAtSource" ) ; // This method used to be exposed by the MBeans , // but this is no longer the case . Instead , the exposed methods will be delete / moveAll // which will implicitly use this path assertValidContr...
public class LayoutViews { /** * Gets a List of Views matching a given class . * @ param root the root ViewGroup to traverse . * @ param classType the class to find . * @ param < T > the class to find . * @ return a List of every matching View encountered . */ @ NonNull public static < T > List < T > findByClas...
FinderByClass < T > finderByClass = new FinderByClass < > ( classType ) ; LayoutTraverser . build ( finderByClass ) . traverse ( root ) ; return finderByClass . getViews ( ) ;
public class PoiUtil { /** * 用密码保护工作簿 。 只有在xlsx格式才起作用 。 * @ param workbook 工作簿 。 * @ param password 保护密码 。 */ public static void protectWorkbook ( Workbook workbook , String password ) { } }
if ( StringUtils . isEmpty ( password ) ) return ; if ( workbook instanceof XSSFWorkbook ) { val xsswb = ( XSSFWorkbook ) workbook ; for ( int i = 0 , ii = xsswb . getNumberOfSheets ( ) ; i < ii ; ++ i ) { xsswb . getSheetAt ( i ) . protectSheet ( password ) ; } }
public class BatchResult { /** * Use { @ link # getResponses ( ) } */ @ Deprecated public List < E > subList ( int fromIndex , int toIndex ) { } }
return responses . subList ( fromIndex , toIndex ) ;
public class RequestTemplate { /** * Returns an immutable copy of the Headers for this request . * @ return the currently applied headers . */ public Map < String , Collection < String > > headers ( ) { } }
Map < String , Collection < String > > headerMap = new TreeMap < > ( String . CASE_INSENSITIVE_ORDER ) ; this . headers . forEach ( ( key , headerTemplate ) -> { List < String > values = new ArrayList < > ( headerTemplate . getValues ( ) ) ; /* add the expanded collection , but only if it has values */ if ( ! values . ...
public class CompositeReportPlugin { /** * Execute a { @ link ReportOperation } on the provided { @ link ReportPlugin } s but * assure that this happens only once . * @ param reportPlugins * The { @ link ReportPlugin } s . * @ param operation * The { @ link ReportOperation } . * @ param executedPlugins * ...
for ( Map . Entry < String , ReportPlugin > entry : reportPlugins . entrySet ( ) ) { if ( executedPlugins . add ( entry . getKey ( ) ) ) { operation . run ( entry . getValue ( ) ) ; } }
public class RuleHelper { /** * This method casts the supplied object to the nominated * class . If the object cannot be cast to the provided type , * then a null will be returned . * @ param obj The object * @ param clz The class to cast to * @ return The cast object , or null if the object cannot be cast */...
if ( ! clz . isAssignableFrom ( obj . getClass ( ) ) ) { return null ; } return clz . cast ( obj ) ;
public class ItemRule { /** * Convert the given item parameters list into an { @ code ItemRuleMap } . * @ param itemParametersList the item parameters list to convert * @ return the item rule map * @ throws IllegalRuleException if an illegal rule is found */ public static ItemRuleMap toItemRuleMap ( List < ItemPa...
if ( itemParametersList == null || itemParametersList . isEmpty ( ) ) { return null ; } ItemRuleMap itemRuleMap = new ItemRuleMap ( ) ; for ( ItemParameters parameters : itemParametersList ) { itemRuleMap . putItemRule ( toItemRule ( parameters ) ) ; } return itemRuleMap ;