signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class JobOperatorImpl { /** * DS injection */ @ Reference ( cardinality = ReferenceCardinality . OPTIONAL , policy = ReferencePolicy . DYNAMIC , policyOption = ReferencePolicyOption . GREEDY ) protected void setWSBatchAuthService ( WSBatchAuthService bas ) { } }
this . authService = bas ;
public class EditTextDialogDecorator { /** * Requests the focus and displays the keyboard . */ private void requestFocus ( ) { } }
Window window = getWindow ( ) ; if ( window != null ) { window . setSoftInputMode ( WindowManager . LayoutParams . SOFT_INPUT_STATE_ALWAYS_VISIBLE ) ; } if ( editText != null ) { editText . requestFocus ( ) ; }
public class IrrelevantFeatureAppenderStream { /** * Constructs the new header according to : * 1 - The original header * 2 - The number of numeric and categorical features given by the user . */ private void buildHeader ( ) { } }
ArrayList < Attribute > attributes = new ArrayList < > ( ) ; // copies the original attributes InstancesHeader originalHeader = originalStream . getHeader ( ) ; for ( int i = 0 ; i < originalHeader . numAttributes ( ) ; i ++ ) { Attribute att = originalHeader . attribute ( i ) ; if ( att != originalHeader . classAttrib...
public class Functions { /** * Accept a client token to establish a secure communication channel . * @ param context GSSContext for which a connection has been established to the remote peer * @ param token the client side token ( client side , as in the token had * to be bootstrapped by the client and this peer ...
try { if ( ! context . isEstablished ( ) ) { byte [ ] nextToken = context . acceptSecContext ( token , 0 , token . length ) ; return nextToken == null ; } return true ; } catch ( GSSException ex ) { throw new RuntimeException ( "Exception accepting client token" , ex ) ; }
public class dnsptrrec { /** * Use this API to delete dnsptrrec of given name . */ public static base_response delete ( nitro_service client , String reversedomain ) throws Exception { } }
dnsptrrec deleteresource = new dnsptrrec ( ) ; deleteresource . reversedomain = reversedomain ; return deleteresource . delete_resource ( client ) ;
public class SmartsAtomAtomMapFilter { /** * Safely access the reaction role of an atom , returns { @ link ReactionRole # None } if null . * @ param atom atom * @ return mapidx , None if undefined */ private ReactionRole role ( IAtom atom ) { } }
ReactionRole role = atom . getProperty ( CDKConstants . REACTION_ROLE ) ; if ( role != null ) return role ; return ReactionRole . None ;
public class StringUtil { /** * do first Letter Upper case * @ param str String to operate * @ return uppercase string */ public static String ucFirst ( String str ) { } }
if ( str == null ) return null ; else if ( str . length ( ) <= 1 ) return str . toUpperCase ( ) ; else { return str . substring ( 0 , 1 ) . toUpperCase ( ) + str . substring ( 1 ) ; }
public class AuthorizationManager { /** * task query / / / / / */ public void configureTaskQuery ( TaskQueryImpl query ) { } }
configureQuery ( query ) ; if ( query . getAuthCheck ( ) . isAuthorizationCheckEnabled ( ) ) { // necessary authorization check when the task is part of // a running process instance CompositePermissionCheck permissionCheck = new PermissionCheckBuilder ( ) . disjunctive ( ) . atomicCheck ( TASK , "RES.ID_" , READ ) . a...
public class CommandButtonLabelInfo { /** * Configures an existing button appropriately based on this label info ' s * properties . * @ param button */ public AbstractButton configure ( AbstractButton button ) { } }
Assert . notNull ( button ) ; button . setText ( this . labelInfo . getText ( ) ) ; button . setMnemonic ( this . labelInfo . getMnemonic ( ) ) ; button . setDisplayedMnemonicIndex ( this . labelInfo . getMnemonicIndex ( ) ) ; configureAccelerator ( button , getAccelerator ( ) ) ; return button ;
public class TwitterStreamImpl { /** * Returns a stream of random sample of all public statuses . The default access level provides a small proportion of the Firehose . The " Gardenhose " access level provides a proportion more suitable for data mining and research applications that desire a larger proportion to be sta...
ensureAuthorizationEnabled ( ) ; try { return new StatusStreamImpl ( getDispatcher ( ) , http . get ( conf . getStreamBaseURL ( ) + "statuses/sample.json?" + stallWarningsGetParam , null , auth , null ) , conf ) ; } catch ( IOException e ) { throw new TwitterException ( e ) ; }
public class GetLogsFromNode { /** * Do the work . */ public void doIt ( ) { } }
if ( nodeidx == - 1 ) { GetLogsTask t = new GetLogsTask ( ) ; t . doIt ( ) ; bytes = t . _bytes ; } else { H2ONode node = H2O . CLOUD . _memary [ nodeidx ] ; GetLogsTask t = new GetLogsTask ( ) ; Log . trace ( "GetLogsTask starting to node " + nodeidx + "..." ) ; // Synchronous RPC call to get ticks from remote ( possi...
public class Ameba { /** * < p > main . < / p > * @ param args an array of { @ link java . lang . String } objects . */ public static void main ( String [ ] args ) { } }
// register shutdown hook Runtime . getRuntime ( ) . addShutdownHook ( new Thread ( Ameba :: shutdown , "AmebaShutdownHook" ) ) ; List < String > list = Lists . newArrayList ( ) ; String idCommand = "--#" ; int idArgLen = idCommand . length ( ) ; for ( String arg : args ) { if ( arg . startsWith ( idCommand ) ) { Strin...
public class RequestUtils { /** * Converts request and query parameter into a single map * @ param exchange The Undertow HttpServerExchange * @ return A single map contain both request and query parameter */ public static Map < String , String > getRequestParameters ( HttpServerExchange exchange ) { } }
Objects . requireNonNull ( exchange , Required . HTTP_SERVER_EXCHANGE . toString ( ) ) ; final Map < String , String > requestParamater = new HashMap < > ( ) ; final Map < String , Deque < String > > queryParameters = exchange . getQueryParameters ( ) ; queryParameters . putAll ( exchange . getPathParameters ( ) ) ; qu...
public class PatchedBigQueryServicesImpl { /** * Identical to { @ link BackOffUtils # next } but without checked IOException . */ private static boolean nextBackOff ( Sleeper sleeper , BackOff backoff ) throws InterruptedException { } }
try { return BackOffUtils . next ( sleeper , backoff ) ; } catch ( IOException e ) { throw new RuntimeException ( e ) ; }
public class UserResource { /** * Update a user . * @ param user user updates * @ param uriInfo injected * @ return http 200 * The URI of the updated user will be stated in the Location header */ @ POST @ Path ( "{id}" ) @ RolesAllowed ( { } }
"ROLE_ADMIN" } ) public Response update ( @ PathParam ( "id" ) Long id , @ Context UriInfo uriInfo , @ Context SecurityContext securityContext , DUser user ) { checkNotNull ( id ) ; // Username and email will never be updated , no need to check format user = userService . update ( id , user , securityContext . isUserIn...
public class IfcBSplineSurfaceWithKnotsImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ SuppressWarnings ( "unchecked" ) @ Override public EList < String > getVKnotsAsString ( ) { } }
return ( EList < String > ) eGet ( Ifc4Package . Literals . IFC_BSPLINE_SURFACE_WITH_KNOTS__VKNOTS_AS_STRING , true ) ;
public class EbeanQueryChannelService { /** * Return an object relational query for finding a List , Set , Map or single entity bean . * @ return the Query . */ @ Override public < T > Query < T > createQuery ( Class < T > entityType , Object queryObject ) { } }
Assert . notNull ( entityType , "entityType must not null" ) ; Assert . notNull ( queryObject , "queryObject must not null" ) ; return query ( entityType , queryObject ) ;
public class DBColumnPropertySheet { /** * GEN - LAST : event _ tfJavaFieldNameActionPerformed */ private void cmbJavaTypeActionPerformed ( java . awt . event . ActionEvent evt ) // GEN - FIRST : event _ cmbJavaTypeActionPerformed { } }
// GEN - HEADEREND : event _ cmbJavaTypeActionPerformed // Add your handling code here : aColumn . setJavaFieldType ( cmbJavaType . getSelectedItem ( ) . toString ( ) ) ; if ( cmbJavaType . getModel ( ) instanceof org . apache . ojb . tools . swing . SortingComboBoxModel ) { org . apache . ojb . tools . swing . Sorting...
public class EmoUriComponent { /** * Contextually encodes the characters of string that are either non - ASCII * characters or are ASCII characters that must be percent - encoded using the * UTF - 8 encoding . Percent - encoded characters will be recognized and not * double encoded . * @ param s the string to b...
return _encode ( s , t , template , true ) ;
public class AmazonWorkLinkClient { /** * Describes the identity provider configuration of the specified fleet . * @ param describeIdentityProviderConfigurationRequest * @ return Result of the DescribeIdentityProviderConfiguration operation returned by the service . * @ throws UnauthorizedException * You are no...
request = beforeClientExecution ( request ) ; return executeDescribeIdentityProviderConfiguration ( request ) ;
public class DefaultNamingStrategy { /** * Return the column name or the unqualified property name */ public String logicalColumnName ( String columnName , String propertyName ) { } }
return ! isNullOrEmpty ( columnName ) ? columnName : unqualify ( propertyName ) ;
public class DataKey { /** * creates a data key with the given name and type . This data * key allows for null values and sets no default value . * @ param < T > the type * @ param name the name of the key that is stored in the xdata file * @ param dataClass the type ' s class * @ return */ public static < T ...
return create ( name , dataClass , true , null ) ;
public class CmsCloneModuleThread { /** * Renames the vfs resource bundle files within the target module according to the new module ' s name . < p > * @ param resources the vfs resource bundle files * @ param targetModule the target module * @ param name the package name of the source module * @ return a list ...
for ( CmsResource res : resources ) { String newName = res . getName ( ) . replaceAll ( name , targetModule . getName ( ) ) ; String targetRootPath = CmsResource . getFolderPath ( res . getRootPath ( ) ) + newName ; if ( ! getCms ( ) . existsResource ( targetRootPath ) ) { getCms ( ) . moveResource ( res . getRootPath ...
public class PermissionUtil { /** * Returns , whether all permissions , which are contained by a specific array , are granted , or * not . * @ param context * The context , which should be used , as an instance of the class { @ link Context } . The * context may not be null * @ param permissions * An array ...
Condition . INSTANCE . ensureNotNull ( context , "The context may not be null" ) ; Condition . INSTANCE . ensureNotNull ( permissions , "The array may not be null" ) ; if ( Build . VERSION . SDK_INT >= Build . VERSION_CODES . M ) { for ( String permission : permissions ) { if ( ! isPermissionGranted ( context , permiss...
public class DefaultsUpdater { /** * Add the requested post parameters to the Request . * @ param request Request to add post params to */ private void addPostParams ( final Request request ) { } }
if ( defaults != null ) { request . addPostParam ( "Defaults" , Converter . mapToJson ( defaults ) ) ; }
public class JBBPUtils { /** * Convert double value into string representation with defined radix * base . * @ param doubleValue value to be converted in string * @ param radix radix base to be used for conversion , must be 10 or 16 * @ return converted value as upper case string * @ throws IllegalArgumentExc...
if ( radix != 10 && radix != 16 ) { throw new IllegalArgumentException ( "Illegal radix [" + radix + ']' ) ; } final String result ; if ( radix == 16 ) { String converted = Double . toHexString ( doubleValue ) ; boolean minus = converted . startsWith ( "-" ) ; if ( minus ) { converted = converted . substring ( 1 ) ; } ...
public class DateUtil { /** * 计算arg0 - arg1的时间差 * @ param arg0 arg0 * @ param arg1 arg1 * @ param dateUnit 返回结果的单位 * @ return arg0 - arg1的时间差 , 精确到指定的单位 ( field ) , 出错时返回 - 1 */ private static long calc ( Temporal arg0 , Temporal arg1 , DateUnit dateUnit ) { } }
return create ( dateUnit ) . between ( arg1 , arg0 ) ;
public class ComponentScopeShadow { /** * public Object get ( PageContext pc , String key ) throws PageException { return get ( key ) ; } */ @ Override public Object get ( PageContext pc , Collection . Key key ) throws PageException { } }
return get ( key ) ;
public class Currency { /** * Returns the ISO 4217 numeric code for this currency object . * < p > Note : If the ISO 4217 numeric code is not assigned for the currency or * the currency is unknown , this method returns 0 . < / p > * @ return The ISO 4217 numeric code of this currency . */ public int getNumericCod...
int result = 0 ; try { UResourceBundle bundle = UResourceBundle . getBundleInstance ( ICUData . ICU_BASE_NAME , "currencyNumericCodes" , ICUResourceBundle . ICU_DATA_CLASS_LOADER ) ; UResourceBundle codeMap = bundle . get ( "codeMap" ) ; UResourceBundle numCode = codeMap . get ( subType ) ; result = numCode . getInt ( ...
public class ThreadContextManager { /** * Save off the context data for the current thread */ public HashMap < String , Object > saveContextData ( ) { } }
HashMap < String , Object > contextData = new HashMap < String , Object > ( ) ; // Save off the data from the other components we have hooks into ComponentMetaDataAccessorImpl cmdai = ComponentMetaDataAccessorImpl . getComponentMetaDataAccessor ( ) ; ComponentMetaData cmd = cmdai . getComponentMetaData ( ) ; if ( cmd !...
public class JCudaDriver { /** * If the given result is different to CUresult . CUDA _ SUCCESS and * exceptions have been enabled , this method will throw a * CudaException with an error message that corresponds to the * given result code . Otherwise , the given result is simply * returned . * @ param result ...
if ( exceptionsEnabled && result != CUresult . CUDA_SUCCESS ) { throw new CudaException ( CUresult . stringFor ( result ) ) ; } return result ;
public class GpxParserTrk { /** * Fires whenever an XML end markup is encountered . It catches attributes of * trackPoints , trackSegments or routes and saves them in corresponding * values [ ] . * @ param uri URI of the local element * @ param localName Name of the local element ( without prefix ) * @ param ...
super . endElement ( uri , localName , qName ) ; if ( ( getCurrentElement ( ) . equalsIgnoreCase ( GPXTags . TEXT ) ) && ( isPoint ( ) ) ) { getCurrentPoint ( ) . setLinkText ( getContentBuffer ( ) ) ; } else if ( getCurrentElement ( ) . equalsIgnoreCase ( GPXTags . TEXT ) ) { getCurrentLine ( ) . setLinkText ( getCont...
public class AbstractStrategy { /** * { @ inheritDoc } */ @ Override public void printRanking ( final Long user , final List < Pair < Long , Double > > scoredItems , final PrintStream out , final OUTPUT_FORMAT format ) { } }
final Map < Long , Double > scores = new HashMap < Long , Double > ( ) ; for ( Pair < Long , Double > p : scoredItems ) { scores . put ( p . getFirst ( ) , p . getSecond ( ) ) ; } printRanking ( "" + user , scores , out , format ) ;
public class KeyVisualization { /** * Compute the size of the clustering . * @ param c Clustering * @ return Array storing the depth and the number of leaf nodes . */ protected static < M extends Model > int [ ] findDepth ( Clustering < M > c ) { } }
final Hierarchy < Cluster < M > > hier = c . getClusterHierarchy ( ) ; int [ ] size = { 0 , 0 } ; for ( It < Cluster < M > > iter = c . iterToplevelClusters ( ) ; iter . valid ( ) ; iter . advance ( ) ) { findDepth ( hier , iter . get ( ) , size ) ; } return size ;
public class ChromosomeMappingTools { /** * Extracts the DNA sequence transcribed from the input genetic coordinates . * @ param twoBitFacade the facade that provide an access to a 2bit file * @ param gcp The container with chromosomal positions * @ return the DNA sequence transcribed from the input genetic coord...
return getTranscriptDNASequence ( twoBitFacade , gcp . getChromosome ( ) , gcp . getExonStarts ( ) , gcp . getExonEnds ( ) , gcp . getCdsStart ( ) , gcp . getCdsEnd ( ) , gcp . getOrientation ( ) ) ;
public class BaseAsyncInterceptor { /** * Invoke the next interceptor , possibly with a new command , and execute an { @ link InvocationCallback } * after all the interceptors have finished , with or without an exception . * < p > You need to wrap the result with { @ link # makeStage ( Object ) } if you need to add...
try { Object rv ; Throwable throwable ; try { if ( nextDDInterceptor != null ) { rv = command . acceptVisitor ( ctx , nextDDInterceptor ) ; } else { rv = nextInterceptor . visitCommand ( ctx , command ) ; } throwable = null ; if ( rv instanceof InvocationStage ) { return ( ( InvocationStage ) rv ) . andHandle ( ctx , c...
public class HtmlTool { /** * Wraps elements in HTML with the given HTML . * @ param content * HTML content to modify * @ param selector * CSS selector for elements to wrap * @ param wrapHtml * HTML to use for wrapping the selected elements * @ param amount * Maximum number of elements to modify * @ r...
Element body = parseContent ( content ) ; List < Element > elements = body . select ( selector ) ; if ( amount >= 0 ) { // limit to the indicated amount elements = elements . subList ( 0 , Math . min ( amount , elements . size ( ) ) ) ; } if ( elements . size ( ) > 0 ) { for ( Element element : elements ) { element . w...
public class ESTemplate { /** * 获取es mapping中的属性类型 * @ param mapping mapping配置 * @ param fieldName 属性名 * @ return 类型 */ @ SuppressWarnings ( "unchecked" ) private String getEsType ( ESMapping mapping , String fieldName ) { } }
String key = mapping . get_index ( ) + "-" + mapping . get_type ( ) ; Map < String , String > fieldType = esFieldTypes . get ( key ) ; if ( fieldType == null ) { ImmutableOpenMap < String , MappingMetaData > mappings ; try { mappings = transportClient . admin ( ) . cluster ( ) . prepareState ( ) . execute ( ) . actionG...
public class TaskLog { /** * Wrap a command in a shell to capture debug script ' s * stdout and stderr to debugout . * @ param cmd The command and the arguments that should be run * @ param debugoutFilename The filename that stdout and stderr * should be saved to . * @ return the modified command that should ...
String debugout = FileUtil . makeShellPath ( debugoutFilename ) ; List < String > result = new ArrayList < String > ( 3 ) ; result . add ( bashCommand ) ; result . add ( "-c" ) ; StringBuffer mergedCmd = new StringBuffer ( ) ; mergedCmd . append ( "exec " ) ; boolean isExecutable = true ; for ( String s : cmd ) { if ( ...
public class CmsLoginHelper { /** * Returns the locale for the given request . < p > * @ param req the request * @ return the locale */ private static Locale getLocaleForRequest ( HttpServletRequest req ) { } }
CmsAcceptLanguageHeaderParser parser = new CmsAcceptLanguageHeaderParser ( req , OpenCms . getWorkplaceManager ( ) . getDefaultLocale ( ) ) ; List < Locale > acceptedLocales = parser . getAcceptedLocales ( ) ; List < Locale > workplaceLocales = OpenCms . getWorkplaceManager ( ) . getLocales ( ) ; Locale locale = OpenCm...
public class FlowLogicCondition { /** * - - - - - protected methods - - - - - */ protected static boolean getBoolean ( final Context context , final DataSource source ) throws FlowException { } }
if ( source != null ) { final Object value = source . get ( context ) ; if ( value instanceof Boolean ) { return ( Boolean ) value ; } if ( value instanceof String ) { return Boolean . valueOf ( ( String ) value ) ; } } return false ;
public class PackageManagerUtils { /** * Checks if the device has a touch screen . * @ param context the context . * @ return { @ code true } if the device has a touch screen . */ @ TargetApi ( Build . VERSION_CODES . FROYO ) public static boolean hasTouchScreenFeature ( Context context ) { } }
return hasTouchScreenFeature ( context . getPackageManager ( ) ) ;
public class EsMarshalling { /** * Unmarshals the given map source into a bean . * @ param source the source * @ return the plan version */ public static PlanVersionBean unmarshallPlanVersion ( Map < String , Object > source ) { } }
if ( source == null ) { return null ; } PlanVersionBean bean = new PlanVersionBean ( ) ; bean . setVersion ( asString ( source . get ( "version" ) ) ) ; bean . setStatus ( asEnum ( source . get ( "status" ) , PlanStatus . class ) ) ; bean . setCreatedBy ( asString ( source . get ( "createdBy" ) ) ) ; bean . setCreatedO...
public class ContainerDefinition { /** * The command that is passed to the container . This parameter maps to < code > Cmd < / code > in the < a * href = " https : / / docs . docker . com / engine / api / v1.35 / # operation / ContainerCreate " > Create a container < / a > section of the * < a href = " https : / / ...
if ( this . command == null ) { setCommand ( new com . amazonaws . internal . SdkInternalList < String > ( command . length ) ) ; } for ( String ele : command ) { this . command . add ( ele ) ; } return this ;
public class DescribeReservedCacheNodesResult { /** * A list of reserved cache nodes . Each element in the list contains detailed information about one node . * @ return A list of reserved cache nodes . Each element in the list contains detailed information about one node . */ public java . util . List < ReservedCach...
if ( reservedCacheNodes == null ) { reservedCacheNodes = new com . amazonaws . internal . SdkInternalList < ReservedCacheNode > ( ) ; } return reservedCacheNodes ;
public class Consumers { /** * Yields all elements of the iterator ( in a map created by the supplier ) . * @ param < M > the returned map type * @ param < K > the map key type * @ param < V > the map value type * @ param iterator the iterator that will be consumed * @ param supplier the factory used to get t...
final Function < Iterator < Pair < K , V > > , M > consumer = new ConsumeIntoMap < > ( supplier ) ; return consumer . apply ( iterator ) ;
public class VoldemortBuildAndPushJob { /** * For each node , checks if the store exists and then verifies that the remote schema * matches the new one . If the remote store doesn ' t exist , it creates it . */ private void verifyOrAddStore ( String clusterURL , String keySchema , String valueSchema ) { } }
String newStoreDefXml = VoldemortUtils . getStoreDefXml ( storeName , props . getInt ( BUILD_REPLICATION_FACTOR , 2 ) , props . getInt ( BUILD_REQUIRED_READS , 1 ) , props . getInt ( BUILD_REQUIRED_WRITES , 1 ) , props . getNullableInt ( BUILD_PREFERRED_READS ) , props . getNullableInt ( BUILD_PREFERRED_WRITES ) , prop...
public class ImageAnchorCell { /** * Sets the the horizontal spacing attribute for the HTML image tag . * @ param hspace the horizontal spacing . * @ jsptagref . attributedescription The horizontal spacing for the HTML image tag . * @ jsptagref . attributesyntaxvalue < i > integer _ hspace < / i > * @ netui : a...
_imageState . registerAttribute ( AbstractHtmlState . ATTR_GENERAL , HtmlConstants . HSPACE , hspace ) ;
public class WktService { /** * Parses a given WKT ( or EWKT ) string into a geometry object . * @ param wkt * The Well Known Text to parse . * @ return Returns The resulting geometry from parsing the WKT . * @ throws WktException * In case something went wrong while parsing . The WKT format must be respected...
if ( wkt != null ) { // First we detect if the string is WKT or EWKT : String [ ] parts = wkt . split ( ";" ) ; if ( parts . length == 2 ) { // We assume it is EWKT : Geometry geometry = parseWkt ( parts [ 1 ] ) ; recursiveSetSrid ( geometry , parseSrid ( parts [ 0 ] ) ) ; return geometry ; } return parseWkt ( wkt ) ; ...
public class DateUtils { /** * < p > Parses a string representing a date by trying a variety of different parsers . < / p > * < p > The parse will try each parse pattern in turn . * A parse is only deemed successful if it parses the whole of the input string . * If no parse patterns match , a ParseException is th...
return parseDateStrictly ( str , null , parsePatterns ) ;
public class ModelClassGeneratorTasks { /** * For API Gateway request classes we override the sdkRequestConfig fluent setter to return the correct concrete request type * for better method chaining . * @ return True if sdkRequestConfig should be overriden by template . False if not . */ private boolean shouldGenera...
return model . getMetadata ( ) . getProtocol ( ) == Protocol . API_GATEWAY && shape . getShapeType ( ) == ShapeType . Request ;
public class CircuitBreakerExports { /** * Creates a new instance of { @ link CircuitBreakerExports } with specified metrics names prefix and * { @ link CircuitBreakerRegistry } as a source of circuit breakers . * @ param prefix the prefix of metrics names * @ param circuitBreakerRegistry the registry of circuit ...
requireNonNull ( prefix ) ; requireNonNull ( circuitBreakerRegistry ) ; return new CircuitBreakerExports ( prefix , circuitBreakerRegistry ) ;
public class AbstractDom4jExporter { /** * / * ( non - Javadoc ) * @ see org . apereo . portal . io . xml . IDataExporter # exportData ( java . lang . String ) */ @ Override public Tuple < String , Element > exportData ( String id ) { } }
final Element node = this . exportDataElement ( id ) ; if ( node == null ) { return null ; } return new Tuple < String , Element > ( id , node ) ;
public class LoggerOddities { /** * looks to see if this field is a logger , and declared non privately * @ param fieldClsName * the owning class type of the field * @ param fieldName * the name of the field * @ param fieldSig * the signature of the field * @ return if the field is a logger and not privat...
String fieldType = SignatureUtils . trimSignature ( fieldSig ) ; if ( ! SLF4J_LOGGER . equals ( fieldType ) && ! COMMONS_LOGGER . equals ( fieldType ) && ! LOG4J_LOGGER . equals ( fieldType ) && ! LOG4J2_LOGGER . equals ( fieldType ) ) { return false ; } JavaClass cls = getClassContext ( ) . getJavaClass ( ) ; if ( ! c...
public class SagaKeyReaderExtractor { /** * { @ inheritDoc } */ @ Override public Object findSagaInstanceKey ( final Class < ? extends Saga > sagaClazz , final LookupContext context ) { } }
Object keyValue = null ; KeyReader reader = tryGetKeyReader ( sagaClazz , context . message ( ) ) ; if ( reader != null ) { keyValue = reader . readKey ( context . message ( ) , context ) ; } return keyValue ;
public class ExcelUtil { /** * Sax方式读取Excel03 * @ param in 输入流 * @ param sheetIndex Sheet索引 , - 1表示全部Sheet , 0表示第一个Sheet * @ param rowHandler 行处理器 * @ return { @ link Excel07SaxReader } * @ since 3.2.0 */ public static Excel03SaxReader read03BySax ( InputStream in , int sheetIndex , RowHandler rowHandler ) { ...
try { return new Excel03SaxReader ( rowHandler ) . read ( in , sheetIndex ) ; } catch ( NoClassDefFoundError e ) { throw new DependencyException ( ObjectUtil . defaultIfNull ( e . getCause ( ) , e ) , PoiChecker . NO_POI_ERROR_MSG ) ; }
public class BuildInfo { /** * Creates an instance using properties from the given stream ( which must be in property file * format ) . * < p > See { @ link # create ( Properties ) } for a list of required properties . * < p > For convenience , this method throws a runtime exception if an IOException occurs . If ...
Properties properties = new Properties ( ) ; try { properties . load ( propertiesStream ) ; } catch ( IOException e ) { throw new IllegalStateException ( "Unable to load build info properties" , e ) ; } finally { try { propertiesStream . close ( ) ; } catch ( IOException e ) { LOGGER . warn ( "Unable to close propertie...
public class FrameManager { /** * Asks about leaving the application * @ param navigationFrameView used as parent of question dialog * @ return true if user wants to leave */ private boolean askBeforeExit ( SwingFrame navigationFrameView ) { } }
if ( Configuration . isDevModeActive ( ) ) { return true ; } else { int answer = JOptionPane . showConfirmDialog ( navigationFrameView , Resources . getString ( "Exit.confirm" ) , Resources . getString ( "Exit.confirm.title" ) , JOptionPane . YES_NO_OPTION ) ; return answer == JOptionPane . YES_OPTION ; }
public class JQLBuilder { /** * Define WHERE statement . * @ param < L > * the generic type * @ param method * the method * @ param result * the result * @ param annotation * the annotation * @ param dynamicReplace * the dynamic replace * @ return the string */ private static < L extends Annotatio...
StringBuilder builder = new StringBuilder ( ) ; int pageSize = AnnotationUtility . extractAsInt ( method . getElement ( ) , annotation , AnnotationAttributeType . PAGE_SIZE ) ; if ( pageSize > 0 ) { result . annotatedPageSize = true ; } final One < String > pageDynamicName = new One < String > ( null ) ; forEachParamet...
public class JobDefinitionMarshaller { /** * Marshall the given parameter object . */ public void marshall ( JobDefinition jobDefinition , ProtocolMarshaller protocolMarshaller ) { } }
if ( jobDefinition == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( jobDefinition . getJobDefinitionName ( ) , JOBDEFINITIONNAME_BINDING ) ; protocolMarshaller . marshall ( jobDefinition . getJobDefinitionArn ( ) , JOBDEFINITIONARN_BINDING...
public class Configuration { /** * Back this < code > Configuration < / code > by the given properties from ConfigurationAdmin . * @ param properties the properties from ConfigurationAdmin , may be < code > null < / code > . * @ throws ConfigurationException thrown if the property values are not of type String */ p...
List < String > newArgumentList = new ArrayList < String > ( ) ; if ( properties != null ) { for ( Enumeration < ? > keysEnum = properties . keys ( ) ; keysEnum . hasMoreElements ( ) ; ) { String key = ( String ) keysEnum . nextElement ( ) ; Object val = properties . get ( key ) ; if ( val instanceof String ) { String ...
public class ReferenceStreamLink { /** * / * ( non - Javadoc ) * @ see com . ibm . ws . sib . msgstore . cache . links . LinkOwner # eventWatermarkBreached ( ) */ public final void eventWatermarkBreached ( ) throws SevereMessageStoreException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "eventWatermarkBreached" ) ; ReferenceStream referenceStream = ( ReferenceStream ) getItem ( ) ; if ( null != referenceStream ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debu...
public class ReportResourcesImpl { /** * Get a report . * It mirrors to the following Smartsheet REST API method : GET / reports / { id } * Exceptions : * InvalidRequestException : if there is any problem with the REST API request * AuthorizationException : if there is any problem with the REST API authorizatio...
String path = "reports/" + reportId ; HashMap < String , Object > parameters = new HashMap < String , Object > ( ) ; parameters . put ( "include" , QueryUtil . generateCommaSeparatedList ( includes ) ) ; if ( pageSize != null ) { parameters . put ( "pageSize" , pageSize . toString ( ) ) ; } if ( page != null ) { parame...
public class RtfCodePage { /** * Writes the selected codepage */ public void writeDefinition ( final OutputStream result ) throws IOException { } }
result . write ( ANSI ) ; result . write ( ANSI_CODEPAGE ) ; result . write ( intToByteArray ( 1252 ) ) ; this . document . outputDebugLinebreak ( result ) ;
public class NodeListener { /** * Inform listeners that node is being updated . * @ param oldOne Old configuration . * @ param newOne New Configuration . */ public static void fireOnUpdated ( @ Nonnull Node oldOne , @ Nonnull Node newOne ) { } }
for ( NodeListener nl : all ( ) ) { try { nl . onUpdated ( oldOne , newOne ) ; } catch ( Throwable ex ) { LOGGER . log ( Level . WARNING , "Listener invocation failed" , ex ) ; } }
public class FaceletViewDeclarationLanguage { /** * Creates the Facelet page compiler . * @ param context * the current FacesContext * @ return the application ' s Facelet page compiler */ protected Compiler createCompiler ( FacesContext context ) { } }
Compiler compiler = new SAXCompiler ( ) ; compiler . setDevelopmentProjectStage ( context . isProjectStage ( ProjectStage . Development ) ) ; loadLibraries ( context , compiler ) ; loadDecorators ( context , compiler ) ; loadOptions ( context , compiler ) ; return compiler ;
public class Dictionary { /** * Attempts to load a dictionary using the URL to the FSA file and the * expected metadata extension . * @ param dictURL The URL pointing to the dictionary file ( < code > * . dict < / code > ) . * @ return An instantiated dictionary . * @ throws IOException if an I / O error occurs...
final URL expectedMetadataURL ; try { String external = dictURL . toExternalForm ( ) ; expectedMetadataURL = new URL ( DictionaryMetadata . getExpectedMetadataFileName ( external ) ) ; } catch ( MalformedURLException e ) { throw new IOException ( "Couldn't construct relative feature map URL for: " + dictURL , e ) ; } t...
public class ConversationState { /** * removeObject - remove an object from the object store . * @ param objectIndex An integer value that identifies the location of the object in * the object store . * @ return Returns the object that was in that position * @ throws IndexOutOfBoundsException * @ throws NoSuc...
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "removeObject" , Integer . valueOf ( objectIndex ) ) ; if ( ( objectIndex < OBJECT_TABLE_ORIGIN ) ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) SibTr . debug ( this , tc , "Invalid obj...
public class ClientConversationState { /** * Sets the Connection ID referring to the SIMPConnection Object on the server . * @ param i */ public void setConnectionObjectID ( int i ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( this , tc , "setConnectionObjectID" , "" + i ) ; connectionObjectID = i ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( this , tc , "setConnectionObjectID" ) ;
public class JsonPController { /** * tag : : json [ ] */ @ Route ( method = HttpMethod . GET , uri = "/json" ) public Result usingJsonService ( @ Parameter ( "callback" ) String callback ) { } }
return ok ( json . toJsonP ( callback , json . newObject ( ) . put ( "foo" , "bar" ) ) ) . as ( MimeTypes . JAVASCRIPT ) ;
public class IfBlock { /** * / * - - - - - [ FinishAll ] - - - - - */ public boolean usesFinishAll ( ) { } }
return parent == null && state . ifBlocks . get ( 0 ) == this && path != null && path . size ( ) > 1 && edgeWithRule ( ) == null && path . get ( 0 ) == path . get ( path . size ( ) - 1 ) ;
public class AbstractCommandLineRunner { /** * Outputs the source map found in the compiler to the proper path if one exists . * @ param options The options to the Compiler . */ @ GwtIncompatible ( "Unnecessary" ) private void outputSourceMap ( B options , String associatedName ) throws IOException { } }
if ( Strings . isNullOrEmpty ( options . sourceMapOutputPath ) || options . sourceMapOutputPath . equals ( "/dev/null" ) ) { return ; } String outName = expandSourceMapPath ( options , null ) ; maybeCreateDirsForPath ( outName ) ; try ( Writer out = fileNameToOutputWriter2 ( outName ) ) { compiler . getSourceMap ( ) . ...
public class BaseScreen { /** * Does the current user have permission to access this screen . * @ return NORMAL _ RETURN if access is allowed , ACCESS _ DENIED or LOGIN _ REQUIRED otherwise . */ public int checkSecurity ( ) { } }
if ( ( this . getClass ( ) . getName ( ) . startsWith ( BASE_CLASS ) ) && ( this . getMainRecord ( ) != null ) ) { App application = null ; if ( this . getTask ( ) != null ) application = this . getTask ( ) . getApplication ( ) ; int iErrorCode = DBConstants . NORMAL_RETURN ; if ( application != null ) iErrorCode = app...
public class NioTCPWriteRequestContextImpl { /** * @ see com . ibm . ws . tcpchannel . internal . TCPWriteRequestContextImpl # * processSyncWriteRequest ( long , int ) */ @ Override public long processSyncWriteRequest ( long numBytes , int timeout ) throws IOException { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "processSyncRequest(" + numBytes + "," + timeout + ")" ) ; } long numUserBytesWritten = 0 ; // no . of user bytes written if ( numBytes != 0 ) { if ( this . blockWait == null ) { this . blockWait = new SimpleSync ( ) ; } this...
public class HTTPBatchClientConnectionInterceptor { /** * Returns first item from the list * @ param intuitMessages * @ return IntuitMessage * @ throws FMSException */ private IntuitMessage getFirst ( List < IntuitMessage > intuitMessages ) throws FMSException { } }
if ( intuitMessages . isEmpty ( ) ) { throw new FMSException ( "IntuitMessages list is empty. Nothing to upload." ) ; } return intuitMessages . get ( 0 ) ;
public class PermissionTargetProviderRegistryImpl { /** * Construct a new target provider registry and initialize it with the supplied map of key - > * provider pairs . * @ param providers */ public void setProviders ( Map < String , IPermissionTargetProvider > providers ) { } }
this . providers . clear ( ) ; for ( Map . Entry < String , IPermissionTargetProvider > provider : providers . entrySet ( ) ) { this . providers . put ( provider . getKey ( ) , provider . getValue ( ) ) ; }
public class ESTemplate { /** * The AST node structure is merged with the * context to produce the final output . * @ param context Conext with data elements accessed by template * @ param writer output writer for rendered template * @ throws ResourceNotFoundException if template not found * from any availabl...
merge ( context , writer , null ) ;
public class ClusterJoinManager { /** * Invoked from master node while executing a join request to validate it , delegating to * { @ link com . hazelcast . instance . NodeExtension # validateJoinRequest ( JoinMessage ) } */ private boolean validateJoinRequest ( JoinRequest joinRequest , Address target ) { } }
if ( clusterService . isMaster ( ) ) { try { node . getNodeExtension ( ) . validateJoinRequest ( joinRequest ) ; } catch ( Exception e ) { logger . warning ( e . getMessage ( ) ) ; nodeEngine . getOperationService ( ) . send ( new BeforeJoinCheckFailureOp ( e . getMessage ( ) ) , target ) ; return false ; } } return tr...
public class MessageInfo { /** * Add this field in the Record ' s field sequence . */ public BaseField setupField ( int iFieldSeq ) { } }
BaseField field = null ; // if ( iFieldSeq = = 0) // field = new CounterField ( this , ID , Constants . DEFAULT _ FIELD _ LENGTH , null , null ) ; // field . setHidden ( true ) ; // if ( iFieldSeq = = 1) // field = new RecordChangedField ( this , LAST _ CHANGED , Constants . DEFAULT _ FIELD _ LENGTH , null , null ) ; /...
public class MailUtil { /** * Delivers the supplied mail , with the specified additional headers . */ public static void deliverMail ( String [ ] recipients , String sender , String subject , String body , String [ ] headers , String [ ] values ) throws IOException { } }
if ( recipients == null || recipients . length < 1 ) { throw new IOException ( "Must specify one or more recipients." ) ; } try { MimeMessage message = createEmptyMessage ( ) ; int hcount = ( headers == null ) ? 0 : headers . length ; for ( int ii = 0 ; ii < hcount ; ii ++ ) { message . addHeader ( headers [ ii ] , val...
public class FileUtils { /** * Gets the extension of the given file name or < code > " png " < / code > if the file name has no extension . * @ param fileName The file name . * @ return The extension of the given file . */ public static String getExtension ( String fileName ) { } }
if ( fileName . contains ( "." ) ) { return fileName . substring ( fileName . lastIndexOf ( "." ) + 1 ) ; } return "png" ;
public class RestUtils { /** * A generic JSON response handler . Returns a message and response code . * @ param response the response to write to * @ param status status code * @ param message error message */ public static void returnStatusResponse ( HttpServletResponse response , int status , String message ) ...
if ( response == null ) { return ; } PrintWriter out = null ; try { response . setStatus ( status ) ; response . setContentType ( MediaType . APPLICATION_JSON ) ; out = response . getWriter ( ) ; ParaObjectUtils . getJsonWriter ( ) . writeValue ( out , getStatusResponse ( Response . Status . fromStatusCode ( status ) ,...
public class TArrayTypeEntry { /** * Returns true if field corresponding to fieldID is set ( has been assigned a value ) and false otherwise */ public boolean isSet ( _Fields field ) { } }
if ( field == null ) { throw new IllegalArgumentException ( ) ; } switch ( field ) { case OBJECT_TYPE_PTR : return isSetObjectTypePtr ( ) ; } throw new IllegalStateException ( ) ;
public class LineSegmentPath { /** * documentation inherited */ public void paint ( Graphics2D gfx ) { } }
gfx . setColor ( Color . red ) ; Point prev = null ; int size = size ( ) ; for ( int ii = 0 ; ii < size ; ii ++ ) { PathNode n = getNode ( ii ) ; if ( prev != null ) { gfx . drawLine ( prev . x , prev . y , n . loc . x , n . loc . y ) ; } prev = n . loc ; }
public class AOConnectionPool { /** * Loads a driver at most once . */ private static void loadDriver ( String classname ) throws ClassNotFoundException , InstantiationException , IllegalAccessException { } }
if ( ! driversLoaded . containsKey ( classname ) ) { Object O = Class . forName ( classname ) . newInstance ( ) ; driversLoaded . putIfAbsent ( classname , O ) ; }
public class RadioGroupBlankValidator { /** * { @ inheritDoc } */ @ Override public boolean isValid ( final T value ) { } }
boolean valid = false ; for ( Radio child : inputWidget . getRadioChildren ( ) ) { valid |= child . getValue ( ) ; } return valid ;
public class SwimMembershipProtocolConfig { /** * Sets the probe timeout . * @ param probeTimeout the probe timeout * @ return the membership protocol configuration */ public SwimMembershipProtocolConfig setProbeTimeout ( Duration probeTimeout ) { } }
checkNotNull ( probeTimeout , "probeTimeout cannot be null" ) ; checkArgument ( ! probeTimeout . isNegative ( ) && ! probeTimeout . isZero ( ) , "probeTimeout must be positive" ) ; this . probeTimeout = probeTimeout ; return this ;
public class SQLiteConnectionPool { /** * Dumps debugging information about this connection pool . * @ param printer The printer to receive the dump , not null . * @ param verbose True to dump more verbose information . */ public void dump ( Printer printer , boolean verbose ) { } }
Printer indentedPrinter = printer ; synchronized ( mLock ) { printer . println ( "Connection pool for " + mConfiguration . path + ":" ) ; printer . println ( " Open: " + mIsOpen ) ; printer . println ( " Max connections: " + mMaxConnectionPoolSize ) ; printer . println ( " Available primary connection:" ) ; if ( mAv...
public class Legend_ { /** * Normally each legend entry just has one line of text , but it can be made multi - line by adding * " \ \ n " . This method returns a Map for each single legend entry , which is normally just a Map * with one single entry . * @ param series * @ return */ Map < String , Rectangle2D > ...
// FontMetrics fontMetrics = g . getFontMetrics ( getChartPainter ( ) . getstyler ( ) . getLegendFont ( ) ) ; // float fontDescent = fontMetrics . getDescent ( ) ; String lines [ ] = series . getName ( ) . split ( "\\n" ) ; Map < String , Rectangle2D > seriesTextBounds = new LinkedHashMap < String , Rectangle2D > ( lin...
public class VirtualHostMapper { /** * Returns an enumeration of all the target mappings added * to this mapper */ public Iterator targetMappings ( ) { } }
// System . out . println ( " TargetMappings called " ) ; // return vHostTable . values ( ) . iterator ( ) ; 316624 Collection vHosts = vHostTable . values ( ) ; // 316624 List l = new ArrayList ( ) ; // 316624 l . addAll ( vHosts ) ; // 316624 return l . listIterator ( ) ; // 316624
public class ExpressionBuilderImpl { /** * Replies the default value for the given type . * @ param type the type for which the default value should be determined . * @ return the default value . */ @ Pure public String getDefaultValueForType ( String type ) { } }
// TODO : Check if a similar function exists in the Xbase library . String defaultValue = "" ; if ( ! Strings . isEmpty ( type ) && ! "void" . equals ( type ) ) { switch ( type ) { case "boolean" : defaultValue = "true" ; break ; case "double" : defaultValue = "0.0" ; break ; case "float" : defaultValue = "0.0f" ; brea...
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public EClass getIfcConnectionCurveGeometry ( ) { } }
if ( ifcConnectionCurveGeometryEClass == null ) { ifcConnectionCurveGeometryEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 121 ) ; } return ifcConnectionCurveGeometryEClass ;
public class ApiOvhDedicatedCloud { /** * Get the current state of Zerto deployment on your dedicated Cloud . * REST : POST / dedicatedCloud / { serviceName } / datacenter / { datacenterId } / disasterRecovery / zerto / state * @ param serviceName [ required ] Domain of the service * @ param datacenterId [ requir...
String qPath = "/dedicatedCloud/{serviceName}/datacenter/{datacenterId}/disasterRecovery/zerto/state" ; StringBuilder sb = path ( qPath , serviceName , datacenterId ) ; String resp = exec ( qPath , "POST" , sb . toString ( ) , null ) ; return convertTo ( resp , net . minidev . ovh . api . dedicatedcloud . disasterrecov...
public class JenkinsLogs { /** * Adds j . u . l logging output that the support - core plugin captures . * Compared to { @ link # addMasterJulRingBuffer ( Container ) } , this one uses disk files , * so it remembers larger number of entries . */ private void addMasterJulLogRecords ( Container result ) { } }
// this file captures the most recent of those that are still kept around in memory . // this overlaps with Jenkins . logRecords , and also overlaps with what ' s written in files , // but added nonetheless just in case . // should be ignorable . result . add ( new LogRecordContent ( "nodes/master/logs/all_memory_buffe...
public class CalendarPeriodAssociative { /** * print string */ public String OutEx ( Printer < T > printer ) { } }
String out = "" ; for ( int i = 0 ; i < periods . size ( ) ; i ++ ) { PeriodAssociative < T > period = periods . get ( i ) ; out += "[" + period . getFrom ( ) + "->" + period . getTo ( ) + "] => " + printer . print ( period . getValue ( ) ) + "<br>" ; } return out ;
public class UnicodeEncoder { /** * Encodes the given string , so that it can be used within a html page . * @ param string the string to convert */ public static String encode ( String string ) { } }
if ( string == null ) { return "" ; } StringBuilder sb = null ; char c ; for ( int i = 0 ; i < string . length ( ) ; ++ i ) { c = string . charAt ( i ) ; if ( ( ( int ) c ) >= 0x80 ) { if ( sb == null ) { sb = new StringBuilder ( string . length ( ) + 4 ) ; sb . append ( string . substring ( 0 , i ) ) ; } // encode all...
public class PluralRules { /** * Given a number information , and keyword , return whether the keyword would match the number . * @ param sample The number information for which the rule has to be determined . * @ param keyword The keyword to filter on * @ deprecated This API is ICU internal only . * @ hide ori...
return rules . select ( sample , keyword ) ;
public class ProviderAttributeDefinition { /** * Populate the supplied response { @ link ModelNode } with information about the supplied { @ link Provider } * @ param response the response to populate . * @ param provider the { @ link Provider } to use when populating the response . */ static void populateProvider ...
response . get ( ElytronDescriptionConstants . NAME ) . set ( provider . getName ( ) ) ; response . get ( ElytronDescriptionConstants . INFO ) . set ( provider . getInfo ( ) ) ; response . get ( ElytronDescriptionConstants . VERSION ) . set ( provider . getVersion ( ) ) ; if ( includeServices ) { addServices ( response...
public class OmsTrentoP { /** * Find the pipes that are draining in this pipe ( defined by the index parameter ) . * @ param index * the ID of this pipe . * @ param cord * the Coordinate of the link where drain . */ private void findIdThatDrainsIntoIndex ( int index , Coordinate cord ) { } }
int t = 0 ; double toll = 0.1 ; for ( int i = 0 ; i < networkPipes . length ; i ++ ) { // if it is this pipe then go haead . if ( index == i ) { continue ; } // there isn - t other pipe that can drain in this . else if ( t == pMaxJunction ) { break ; } // the id is already set . else if ( networkPipes [ i ] . getIdPipe...
public class DiscoveredResource { /** * Verifies the given { @ link Link } by issuing an HTTP HEAD request to the resource . * @ param link Must not be { @ literal null } . * @ return - link to the resource */ private Link verify ( Link link ) { } }
Assert . notNull ( link , "Link must not be null!" ) ; try { String uri = link . expand ( ) . getHref ( ) ; this . log . debug ( "Verifying link pointing to {}…" , uri ) ; this . restOperations . headForHeaders ( uri ) ; this . log . debug ( "Successfully verified link!" ) ; return link ; } catch ( RestClientException ...