signature
stringlengths
43
39.1k
implementation
stringlengths
0
450k
public class ServerMappingController { /** * Updates the dest URL in the server redirects * @ param model * @ param id * @ param destUrl * @ return * @ throws Exception */ @ RequestMapping ( value = "api/edit/server/{id}/dest" , method = RequestMethod . POST ) public @ ResponseBody ServerRedirect updateDestRe...
ServerRedirectService . getInstance ( ) . setDestinationUrl ( destUrl , id ) ; return ServerRedirectService . getInstance ( ) . getRedirect ( id ) ;
public class PersistentTimerTaskHandler { /** * Internal convenience method for serializing the user info object to a byte array . */ private static byte [ ] serializeObject ( Object obj ) { } }
if ( obj == null ) { return null ; } ByteArrayOutputStream baos = new ByteArrayOutputStream ( ) ; try { ObjectOutputStream out = new ObjectOutputStream ( baos ) ; out . writeObject ( obj ) ; out . flush ( ) ; } catch ( IOException ioex ) { throw new EJBException ( "Timer info object failed to serialize." , ioex ) ; } r...
public class HDualReportScreen { /** * display this screen in html input format . * returns true if default params were found for this form . * @ param bAddDescColumn true if form , otherwise grid format * @ exception DBException File exception . */ public int getPrintOptions ( ) throws DBException { } }
int iHtmlOptions = super . getPrintOptions ( ) ; String strForms = this . getProperty ( HtmlConstants . FORMS ) ; if ( ( strForms == null ) || ( strForms . length ( ) == 0 ) ) { if ( ( ( DualReportScreen ) this . getScreenField ( ) ) . isPrintReport ( ) ) iHtmlOptions = iHtmlOptions & ( ~ HtmlConstants . DONT_PRINT_SCR...
public class SynchronizedPDUSender { /** * ( non - Javadoc ) * @ see org . jsmpp . PDUSender # sendSubmitSmResp ( java . io . OutputStream , int , * java . lang . String ) */ public byte [ ] sendSubmitSmResp ( OutputStream os , int sequenceNumber , String messageId ) throws PDUStringException , IOException { } }
return pduSender . sendSubmitSmResp ( os , sequenceNumber , messageId ) ;
public class ObjectUtil { /** * 序列化后拷贝流的方式克隆 < br > * 对象必须实现Serializable接口 * @ param < T > 对象类型 * @ param obj 被克隆对象 * @ return 克隆后的对象 * @ throws UtilException IO异常和ClassNotFoundException封装 */ @ SuppressWarnings ( "unchecked" ) public static < T > T cloneByStream ( T obj ) { } }
if ( null == obj || false == ( obj instanceof Serializable ) ) { return null ; } final FastByteArrayOutputStream byteOut = new FastByteArrayOutputStream ( ) ; ObjectOutputStream out = null ; try { out = new ObjectOutputStream ( byteOut ) ; out . writeObject ( obj ) ; out . flush ( ) ; final ObjectInputStream in = new O...
public class Properties { /** * Gets the property ' s value from an object * @ param object * The object * @ param name * Property name * @ return */ public static < T > T getValue ( Object object , String name ) { } }
return propertyValues . getValue ( object , name ) ;
public class AbstractMedia { /** * Compares this media to the specified media by render order . */ public int renderCompareTo ( AbstractMedia other ) { } }
int result = Ints . compare ( _renderOrder , other . _renderOrder ) ; return ( result != 0 ) ? result : naturalCompareTo ( other ) ;
public class Quaternionf { /** * Set this quaternion to be a copy of q . * @ param q * the { @ link Quaternionf } to copy * @ return this */ public Quaternionf set ( Quaternionfc q ) { } }
if ( q instanceof Quaternionf ) MemUtil . INSTANCE . copy ( ( Quaternionf ) q , this ) ; else { this . x = q . x ( ) ; this . y = q . y ( ) ; this . z = q . z ( ) ; this . w = q . w ( ) ; } return this ;
public class AbstractSessionHandler { /** * Unbind value if value implements { @ link SessionBindingListener } * ( calls { @ link SessionBindingListener # valueUnbound ( Session , String , Object ) } ) * @ param session the basic session * @ param name the name with which the object is bound or unbound * @ para...
if ( value instanceof SessionBindingListener ) { ( ( SessionBindingListener ) value ) . valueUnbound ( session , name , value ) ; }
public class HylaFaxClientSpi { /** * This function will resume an existing fax job . * @ param faxJob * The fax job object containing the needed information */ @ Override protected void resumeFaxJobImpl ( FaxJob faxJob ) { } }
// get fax job HylaFaxJob hylaFaxJob = ( HylaFaxJob ) faxJob ; // get client HylaFAXClient client = this . getHylaFAXClient ( ) ; try { this . resumeFaxJob ( hylaFaxJob , client ) ; } catch ( FaxException exception ) { throw exception ; } catch ( Exception exception ) { throw new FaxException ( "General error." , excep...
public class SimpleDocumentValidator { /** * Checks an XHTML document or other XML document . */ public void checkXmlFile ( File file ) throws IOException , SAXException { } }
validator . reset ( ) ; InputSource is = new InputSource ( new FileInputStream ( file ) ) ; is . setSystemId ( file . toURI ( ) . toURL ( ) . toString ( ) ) ; checkAsXML ( is ) ;
public class PrintStream { /** * Prints an Object and then terminate the line . This method calls * at first String . valueOf ( x ) to get the printed object ' s string value , * then behaves as * though it invokes < code > { @ link # print ( String ) } < / code > and then * < code > { @ link # println ( ) } < ...
String s = String . valueOf ( x ) ; synchronized ( this ) { print ( s ) ; newLine ( ) ; }
public class KieContainerResourceFilter { /** * Creates representation of this filter which can be used as part of the URL ( e . g . the " ? " query part ) . * @ return string representation that can be directly used in URL ( as query params ) , without the leading ' ? ' */ public String toURLQueryString ( ) { } }
StringJoiner joiner = new StringJoiner ( "&" ) ; if ( releaseIdFilter . getGroupId ( ) != null ) { joiner . add ( "groupId=" + releaseIdFilter . getGroupId ( ) ) ; } if ( releaseIdFilter . getArtifactId ( ) != null ) { joiner . add ( "artifactId=" + releaseIdFilter . getArtifactId ( ) ) ; } if ( releaseIdFilter . getVe...
public class NodeUtil { /** * Returns true if the given node is either an LHS node in a destructuring pattern or if one of * its descendants contains an LHS node in a destructuring pattern . For example , in { @ code var { a : * b = 3 } } } , this returns true given the NAME b or the DEFAULT _ VALUE node containing...
Node parent = n . getParent ( ) ; Node grandparent = n . getGrandparent ( ) ; switch ( parent . getToken ( ) ) { case ARRAY_PATTERN : // ` b ` in ` var [ b ] = . . . ` case REST : // ` b ` in ` var [ . . . b ] = . . . ` return true ; case COMPUTED_PROP : if ( n . isFirstChildOf ( parent ) ) { return false ; } // Fall t...
public class FileLocker { /** * Attempts to grab the lock for the given file , returning a FileLock if * the lock has been created ; otherwise it returns null */ public static FileLocker getLock ( File lockFile ) { } }
lockFile . getParentFile ( ) . mkdirs ( ) ; if ( ! lockFile . exists ( ) ) { try { IOHelper . write ( lockFile , "I have the lock!" ) ; lockFile . deleteOnExit ( ) ; return new FileLocker ( lockFile ) ; } catch ( IOException e ) { // Ignore } } return null ;
public class Branch { /** * Append the deep link debug params to the original params * @ param originalParams A { @ link JSONObject } original referrer parameters * @ return A new { @ link JSONObject } with debug params appended . */ private JSONObject appendDebugParams ( JSONObject originalParams ) { } }
try { if ( originalParams != null && deeplinkDebugParams_ != null ) { if ( deeplinkDebugParams_ . length ( ) > 0 ) { PrefHelper . Debug ( "You're currently in deep link debug mode. Please comment out 'setDeepLinkDebugMode' to receive the deep link parameters from a real Branch link" ) ; } Iterator < String > keys = dee...
public class InsightMarshaller { /** * Marshall the given parameter object . */ public void marshall ( Insight insight , ProtocolMarshaller protocolMarshaller ) { } }
if ( insight == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( insight . getInsightArn ( ) , INSIGHTARN_BINDING ) ; protocolMarshaller . marshall ( insight . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( insight . getFilter...
public class PtoPMessageItemStream { /** * ( non - Javadoc ) * @ see com . ibm . ws . sib . processor . impl . interfaces . LocalizationPoint # getAvailableMessageCount ( ) */ public long getAvailableMessageCount ( ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getAvailableMessageCount" ) ; long returnValue = - 1 ; try { returnValue = getStatistics ( ) . getAvailableItemCount ( ) ; } catch ( MessageStoreException e ) { // FFDC FFDCFilter . processException ( e , "com.ibm.ws.sib.pr...
public class ReportDefinition { /** * A list of strings that indicate additional content that Amazon Web Services includes in the report , such as * individual resource IDs . * < b > NOTE : < / b > This method appends the values to the existing list ( if any ) . Use * { @ link # setAdditionalSchemaElements ( java...
if ( this . additionalSchemaElements == null ) { setAdditionalSchemaElements ( new java . util . ArrayList < String > ( additionalSchemaElements . length ) ) ; } for ( String ele : additionalSchemaElements ) { this . additionalSchemaElements . add ( ele ) ; } return this ;
public class ClientConnectionTimings { /** * Returns { @ link ClientConnectionTimings } from the specified { @ link RequestContext } if exists . * @ see # setTo ( RequestContext ) */ @ Nullable public static ClientConnectionTimings get ( RequestContext ctx ) { } }
requireNonNull ( ctx , "ctx" ) ; if ( ctx . hasAttr ( TIMINGS ) ) { return ctx . attr ( TIMINGS ) . get ( ) ; } return null ;
public class DefaultRegisteredServiceUserInterfaceInfo { /** * Gets logo height . * @ return the logo url */ public long getLogoWidth ( ) { } }
try { val items = getLogoUrls ( ) ; if ( ! items . isEmpty ( ) ) { return items . iterator ( ) . next ( ) . getWidth ( ) ; } } catch ( final Exception e ) { LOGGER . debug ( e . getMessage ( ) , e ) ; } return DEFAULT_IMAGE_SIZE ;
public class AssertionMatcher { /** * A variant of assertArg ( Consumer ) for lambdas declaring checked exceptions . */ @ Incubating public static < T > T assertArgThrowing ( ThrowingConsumer < T > throwingConsumer ) { } }
argThat ( throwingConsumer . uncheck ( ) ) ; return handyReturnValues . returnForConsumerLambdaChecked ( throwingConsumer ) ;
public class Validate { /** * Checks that the specified String is not null or empty and represents a readable file , throws exception if it is empty or * null and does not represent a path to a file . * @ param path The path to check * @ param message The exception message * @ throws IllegalArgumentException Th...
notNull ( file , message ) ; if ( ! file . exists ( ) || ! file . isFile ( ) || ! file . canRead ( ) ) { throw new IllegalArgumentException ( message ) ; }
public class Routable { /** * Map the route for HTTP GET requests * @ param path the path * @ param route The route * @ param transformer the response transformer */ public void get ( String path , Route route , ResponseTransformer transformer ) { } }
addRoute ( HttpMethod . get , ResponseTransformerRouteImpl . create ( path , route , transformer ) ) ;
public class TextUICommandLine { /** * Common handling code for - chooseVisitors and - choosePlugins options . * @ param argument * the list of visitors or plugins to be chosen * @ param desc * String describing what is being chosen * @ param chooser * callback object to selectively choose list members */ p...
StringTokenizer tok = new StringTokenizer ( argument , "," ) ; while ( tok . hasMoreTokens ( ) ) { String what = tok . nextToken ( ) . trim ( ) ; if ( ! what . startsWith ( "+" ) && ! what . startsWith ( "-" ) ) { throw new IllegalArgumentException ( desc + " must start with " + "\"+\" or \"-\" (saw " + what + ")" ) ; ...
public class PravegaAuthManager { /** * Loads the custom implementations of the AuthHandler interface dynamically . Registers the interceptors with grpc . * Stores the implementation in a local map for routing the REST auth request . * @ param builder The grpc service builder to register the interceptors . */ publi...
try { if ( serverConfig . isAuthorizationEnabled ( ) ) { ServiceLoader < AuthHandler > loader = ServiceLoader . load ( AuthHandler . class ) ; for ( AuthHandler handler : loader ) { try { handler . initialize ( serverConfig ) ; synchronized ( this ) { if ( handlerMap . putIfAbsent ( handler . getHandlerName ( ) , handl...
public class ByteArrayMethods { /** * Returns the next number greater or equal num that is power of 2. */ public static long nextPowerOf2 ( long num ) { } }
final long highBit = Long . highestOneBit ( num ) ; return ( highBit == num ) ? num : highBit << 1 ;
public class KickflipApiClient { /** * Create a new Kickflip User . * The User created as a result of this request is cached and managed by this KickflipApiClient * throughout the life of the host Android application installation . * The other methods of this client will be performed on behalf of the user created...
GenericData data = new GenericData ( ) ; if ( username != null ) { data . put ( "username" , username ) ; } final String finalPassword ; if ( password != null ) { finalPassword = password ; } else { finalPassword = generateRandomPassword ( ) ; } data . put ( "password" , finalPassword ) ; if ( displayName != null ) { d...
public class DefaultEngine { /** * Tests whether the resource denoted by this abstract pathname exists . * @ param name - template name * @ param locale - resource locale * @ return exists * @ see # getEngine ( ) */ public boolean hasResource ( String name , Locale locale ) { } }
name = UrlUtils . cleanName ( name ) ; locale = cleanLocale ( locale ) ; return stringLoader . exists ( name , locale ) || loader . exists ( name , locale ) ;
public class NodeImpl { /** * For internal use . Doesn ' t check the InvalidItemStateException and may return unpooled * VersionHistory object . * @ param pool * boolean , true if result should be pooled in Session * @ return VersionHistoryImpl * @ throws UnsupportedRepositoryOperationException * if version...
if ( ! this . isNodeType ( Constants . MIX_VERSIONABLE ) ) { throw new UnsupportedRepositoryOperationException ( "Node is not mix:versionable " + getPath ( ) ) ; } PropertyData vhProp = ( PropertyData ) dataManager . getItemData ( nodeData ( ) , new QPathEntry ( Constants . JCR_VERSIONHISTORY , 1 ) , ItemType . PROPERT...
public class ByteCountingDataInput { /** * Please note that this isn ' t going to accurately count line separators , which are discarded by * the underlying DataInput object * This call is deprecated because you cannot accurately account for the CR / LF count * @ return * @ throws IOException */ @ Override @ De...
String value = dataInput . readLine ( ) ; if ( value != null ) { count += value . getBytes ( ) . length ; } return value ;
public class MahoutRecommenderRunner { /** * Runs the recommender using models from file . * @ param opts see * { @ link net . recommenders . rival . recommend . frameworks . AbstractRunner . RUN _ OPTIONS } * @ return see * { @ link # runMahoutRecommender ( net . recommenders . rival . recommend . frameworks ....
if ( isAlreadyRecommended ( ) ) { return null ; } DataModel trainingModel = new FileDataModel ( new File ( getProperties ( ) . getProperty ( RecommendationRunner . TRAINING_SET ) ) ) ; DataModel testModel = new FileDataModel ( new File ( getProperties ( ) . getProperty ( RecommendationRunner . TEST_SET ) ) ) ; return r...
public class JMPath { /** * Gets sub file path list . * @ param startDirectoryPath the start directory path * @ param maxDepth the max depth * @ return the sub file path list */ public static List < Path > getSubFilePathList ( Path startDirectoryPath , int maxDepth ) { } }
return getSubPathList ( startDirectoryPath , maxDepth , RegularFileFilter ) ;
public class XmlUtils { /** * 将传入xml文本转换成Java对象 * @ Title : toBean * @ Description : TODO * @ param xmlStr * @ param cls xml对应的class类 * @ return T xml对应的class类的实例对象 * 调用的方法实例 : PersonBean person = XmlUtil . toBean ( xmlStr , PersonBean . class ) ; */ public static < T > T toBean ( String xmlStr , Class < T ...
// 注意 : 不是new Xstream ( ) ; 否则报错 : java . lang . NoClassDefFoundError : org / xmlpull / v1 / XmlPullParserFactory XStream xstream = new XStream ( new DomDriver ( ) ) ; xstream . processAnnotations ( cls ) ; T obj = ( T ) xstream . fromXML ( xmlStr ) ; return obj ;
public class ConnectorServiceImpl { /** * Declarative Services method for unsetting the non - deferrable scheduled executor service reference . * @ param ref reference to the service */ protected void unsetNonDeferrableScheduledExecutor ( ServiceReference < ScheduledExecutorService > ref ) { } }
if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) Tr . debug ( tc , "unsetNonDeferrableScheduledExecutor" , ref ) ; nonDeferrableSchedXSvcRef . unsetReference ( ref ) ;
public class LogLog { /** * This method is used to output log4j internal warnings . There is * no way to disable warning statements . Output goes to * < code > System . err < / code > . */ public static void warn ( String msg , Throwable t ) { } }
if ( quietMode ) return ; System . err . println ( WARN_PREFIX + msg ) ; if ( t != null ) { t . printStackTrace ( ) ; }
public class JacksonSingleton { /** * Converts a JsonNode to its string representation . * This implementation use a ` pretty printer ` . * @ param json the json node * @ return the String representation of the given Json Object * @ throws java . lang . RuntimeException if the String form cannot be created */ p...
try { return mapper ( ) . writerWithDefaultPrettyPrinter ( ) . writeValueAsString ( json ) ; } catch ( JsonProcessingException e ) { throw new RuntimeException ( "Cannot stringify the input json node" , e ) ; }
public class AccentResources { /** * Add a drawable resource to which to apply the " tint transformation " technique . */ public void addTintTransformationResourceId ( int resId ) { } }
if ( mCustomTransformationDrawableIds == null ) mCustomTransformationDrawableIds = new ArrayList < Integer > ( ) ; mCustomTransformationDrawableIds . add ( resId ) ;
public class LazyList { /** * Simple utility method to test if List has at least 1 entry . * @ param list a LazyList , { @ link List } or { @ link Object } * @ return true if not - null and is not empty */ public static boolean hasEntry ( Object list ) { } }
if ( list == null ) return false ; if ( list instanceof List ) return ! ( ( List < ? > ) list ) . isEmpty ( ) ; return true ;
public class TelemetryUtil { /** * Create a simple TelemetryData instance for Job metrics using given parameters * @ param queryId the id of the query * @ param field the field to log ( represents the " type " field in telemetry ) * @ param value the value to log for the field * @ return TelemetryData instance ...
ObjectNode obj = mapper . createObjectNode ( ) ; obj . put ( TYPE , field . toString ( ) ) ; obj . put ( QUERY_ID , queryId ) ; obj . put ( VALUE , value ) ; return new TelemetryData ( obj , System . currentTimeMillis ( ) ) ;
public class PhaseOneImpl { /** * { @ inheritDoc } */ @ Override public Stage1Output stage1XBELValidation ( final File file ) { } }
Stage1Output output = new Stage1Output ( ) ; output . addValidationErrors ( validator . validateWithErrors ( file ) ) ; if ( output . hasValidationErrors ( ) ) { return output ; } Document d = null ; try { d = converter . toCommon ( file ) ; output . setDocument ( d ) ; } catch ( JAXBException e ) { final String name =...
public class BucketManager { /** * It may happen that the manager is not full ( since n is not always a power of 2 ) . In this case we extract the coreset * from the manager by computing a coreset of all nonempty buckets * Case 1 : the last bucket is full * = > n is a power of 2 and we return the contents of the ...
Point [ ] coreset = new Point [ d ] ; int i = 0 ; // if ( this . buckets [ this . numberOfBuckets - 1 ] . cursize = = this . maxBucketsize ) { // coreset = this . buckets [ this . numberOfBuckets - 1 ] . points ; // } else { // find the first nonempty bucket for ( i = 0 ; i < this . numberOfBuckets ; i ++ ) { if ( this...
public class JDBCCallableStatement { /** * # ifdef JAVA6 */ public synchronized void setAsciiStream ( String parameterName , java . io . InputStream x ) throws SQLException { } }
super . setAsciiStream ( findParameterIndex ( parameterName ) , x ) ;
public class ScopedServletUtils { /** * Find all scoped objects ( { @ link ScopedRequest } , { @ link ScopedResponse } ) * which have a certain scope - key , replaces this scope - key with the new one , and re - caches the objects * the new scope - key . * @ param oldScopeKey * @ param newScopeKey * @ param r...
assert ! ( request instanceof ScopedRequest ) ; String requestAttr = getScopedName ( OVERRIDE_REQUEST_ATTR , oldScopeKey ) ; String responseAttr = getScopedName ( OVERRIDE_RESPONSE_ATTR , oldScopeKey ) ; ScopedRequest scopedRequest = ( ScopedRequest ) request . getAttribute ( requestAttr ) ; ScopedResponse scopedRespon...
public class AbstractOpenTracingFilter { /** * Sets the error tags to use on the span . * @ param span The span * @ param error The error */ protected void setErrorTags ( Span span , Throwable error ) { } }
if ( error != null ) { String message = error . getMessage ( ) ; if ( message == null ) { message = error . getClass ( ) . getSimpleName ( ) ; } span . setTag ( TAG_ERROR , message ) ; }
public class Environment { /** * Enriches an environment with new / modified properties or views and returns the new instance . */ public static Environment enrich ( Environment env , Map < String , String > properties , Map < String , ViewEntry > views ) { } }
final Environment enrichedEnv = new Environment ( ) ; // merge tables enrichedEnv . tables = new LinkedHashMap < > ( env . getTables ( ) ) ; enrichedEnv . tables . putAll ( views ) ; // merge functions enrichedEnv . functions = new HashMap < > ( env . getFunctions ( ) ) ; // enrich execution properties enrichedEnv . ex...
public class DataSiftClient { /** * Retrieve the DPU usage of a historics job * @ param historicsId id of the historics job to get the DPU usage of * @ return future containing DPU response */ public FutureData < Dpu > dpu ( String historicsId ) { } }
final FutureData < Dpu > future = new FutureData < Dpu > ( ) ; URI uri = newParams ( ) . put ( "historics_id" , historicsId ) . forURL ( config . newAPIEndpointURI ( DPU ) ) ; Request request = config . http ( ) . GET ( uri , new PageReader ( newRequestCallback ( future , new Dpu ( ) , config ) ) ) ; performRequest ( f...
public class LocalEventManager { /** * Registers with the EventManager to fire an event . * Note : the same Event can be fired from multiple sources . * Method is thread - safe . * @ param identification the Identification of the the instance * @ return an Optional , empty if already registered * @ throws Ill...
"SynchronizationOnLocalVariableOrMethodParameter" } ) public Optional < EventCallable > registerCaller ( Identification identification ) throws IllegalIDException { if ( identification == null || callers . containsKey ( identification ) ) return Optional . empty ( ) ; EventCaller eventCaller = new EventCaller ( events ...
public class BuilderImpl { /** * ( non - Javadoc ) * @ see com . ibm . ws . security . jwt . internal . Builder # fetch ( java . lang . String ) */ @ Override public Builder fetch ( String name ) throws InvalidClaimException { } }
if ( JwtUtils . isNullEmpty ( name ) ) { String err = Tr . formatMessage ( tc , "JWT_INVALID_CLAIM_ERR" , new Object [ ] { name } ) ; throw new InvalidClaimException ( err ) ; } String sub = claims . getSubject ( ) ; if ( JwtUtils . isNullEmpty ( sub ) ) { // TODO // Tr . warning // We can not really get to registry wi...
public class LengthRule { /** * ( non - Javadoc ) * @ see javax . validation . ConstraintValidator # initialize ( java . lang . annotation . Annotation ) */ @ Override public void initialize ( Length annotation ) { } }
// On initialise les parametres min = annotation . min ( ) ; max = annotation . max ( ) ; acceptNullObject = annotation . acceptNullObject ( ) ; trimString = annotation . trimString ( ) ;
public class XmlSchemaParser { /** * Take an { @ link InputSource } and parse it generating map of template ID to Message objects , types , and schema . * @ param is source from which schema is read . Ideally it will have the systemId property set to resolve * relative references . * @ param options to be applied...
final DocumentBuilderFactory factory = DocumentBuilderFactory . newInstance ( ) ; if ( options . xIncludeAware ( ) ) { factory . setNamespaceAware ( true ) ; factory . setXIncludeAware ( true ) ; factory . setFeature ( "http://apache.org/xml/features/xinclude/fixup-base-uris" , false ) ; } final Document document = fac...
public class JavacConfig { /** * Returns the environment configuration . */ public static JavacConfig getLocalConfig ( ) { } }
JavacConfig config ; config = _localJavac . get ( ) ; if ( config != null ) return config ; else return new JavacConfig ( ) ;
public class Toposort { /** * Gets a topological sort for the graph , where the depth - first search is cutoff by an input set . * @ param inputSet The input set which is excluded from the graph . * @ param root The root of the graph . * @ param deps Functional description of the graph ' s dependencies . * @ pa...
// Check that inputs set is a valid set of leaves for the given output module . checkAreDescendentsOf ( inputSet , root , deps ) ; if ( isFullCut ) { checkIsFullCut ( inputSet , root , deps ) ; } Deps < T > cutoffDeps = getCutoffDeps ( inputSet , deps ) ; return Toposort . toposort ( root , cutoffDeps ) ;
public class AmazonSageMakerClient { /** * Gets a list of work teams that you have defined in a region . The list may be empty if no work team satisfies the * filter specified in the < code > NameContains < / code > parameter . * @ param listWorkteamsRequest * @ return Result of the ListWorkteams operation return...
request = beforeClientExecution ( request ) ; return executeListWorkteams ( request ) ;
public class FastaFormat { /** * method to convert the sequence of a PolymerNotation into the natural * analogue sequence * @ param polymer * PolymerNotation * @ return PolymerNotation with the natural analogue sequence * @ throws AnalogSequenceException * if the natural analog sequence can not be produced ...
for ( int i = 0 ; i < polymer . getPolymerElements ( ) . getListOfElements ( ) . size ( ) ; i ++ ) { /* Change current MonomerNotation */ polymer . getPolymerElements ( ) . getListOfElements ( ) . set ( i , generateMonomerNotationPeptide ( polymer . getPolymerElements ( ) . getListOfElements ( ) . get ( i ) ) ) ; } ret...
public class RedundentExprEliminator { /** * Get the previous sibling or parent of the given template , stopping at * xsl : for - each , xsl : template , or xsl : stylesheet . * @ param elem Should be non - null template element . * @ return previous sibling or parent , or null if previous is xsl : for - each , ...
ElemTemplateElement prev = elem . getPreviousSiblingElem ( ) ; if ( null == prev ) prev = elem . getParentElem ( ) ; if ( null != prev ) { int type = prev . getXSLToken ( ) ; if ( ( Constants . ELEMNAME_FOREACH == type ) || ( Constants . ELEMNAME_TEMPLATE == type ) || ( Constants . ELEMNAME_STYLESHEET == type ) ) { pre...
public class EqualsBuilder { /** * < p > This method uses reflection to determine if the two < code > Object < / code > s * are equal . < / p > * < p > It uses < code > AccessibleObject . setAccessible < / code > to gain access to private * fields . This means that it will throw a security exception if run under ...
return reflectionEquals ( lhs , rhs , testTransients , reflectUpToClass , false , excludeFields ) ;
public class RandomUtil { /** * Picks a random object from the supplied array of values . Even weight is given to all * elements of the array . * @ return a randomly selected item or null if the array is null or of length zero . */ public static < T > T pickRandom ( T [ ] values ) { } }
return ( values == null || values . length == 0 ) ? null : values [ getInt ( values . length ) ] ;
public class DojoHttpTransport { /** * Handles * { @ link com . ibm . jaggr . core . transport . IHttpTransport . LayerContributionType # BEFORE _ FIRST _ LAYER _ MODULE } * and * { @ link com . ibm . jaggr . core . transport . IHttpTransport . LayerContributionType # BEFORE _ SUBSEQUENT _ LAYER _ MODULE } * la...
String result ; String mid = info . getModuleId ( ) ; int idx = mid . indexOf ( "!" ) ; // $ NON - NLS - 1 $ if ( info . isScript ( ) ) { result = "\"" + ( idx == - 1 ? mid : mid . substring ( idx + 1 ) ) + "\":function(){" ; // $ NON - NLS - 1 $ / / $ NON - NLS - 2 $ } else { result = "\"url:" + ( idx == - 1 ? mid : m...
public class OperatorCentroid2DLocal { /** * c [ y ] = ( Sigma ( y [ i ] + y [ i + 1 ] ) * ( x [ i ] * y [ i + 1 ] - x [ i + 1 ] * y [ i ] ) , for i = 0 to N - 1 ) / ( 6 * signedArea ) */ private static Point2D getPolygonSansHolesCentroid ( Polygon polygon ) { } }
int pointCount = polygon . getPointCount ( ) ; double xSum = 0 ; double ySum = 0 ; double signedArea = 0 ; Point2D current = new Point2D ( ) ; Point2D next = new Point2D ( ) ; for ( int i = 0 ; i < pointCount ; i ++ ) { polygon . getXY ( i , current ) ; polygon . getXY ( ( i + 1 ) % pointCount , next ) ; double ladder ...
public class AssetCreativeTemplateVariable { /** * Sets the mimeTypes value for this AssetCreativeTemplateVariable . * @ param mimeTypes * A set of supported mime types . This set can be empty or null * if there ' s no * constraint , meaning files of any mime types are * allowed . */ public void setMimeTypes ( ...
this . mimeTypes = mimeTypes ;
public class CmsRoleManager { /** * Checks if the user of this OpenCms context is a member of the given role * for the given resource . < p > * The user must have the given role in at least one organizational unit to which this resource belongs . < p > * @ param cms the opencms context * @ param role the role t...
CmsResource resource = cms . readResource ( resourceName , CmsResourceFilter . ALL ) ; m_securityManager . checkRoleForResource ( cms . getRequestContext ( ) , role , resource ) ;
public class EvaluationTools { /** * Given a { @ link EvaluationCalibration } instance , export the charts to a stand - alone HTML file * @ param ec EvaluationCalibration instance to export HTML charts for * @ param file File to export to */ public static void exportevaluationCalibrationToHtmlFile ( EvaluationCalib...
String asHtml = evaluationCalibrationToHtml ( ec ) ; FileUtils . writeStringToFile ( file , asHtml ) ;
public class ResultBuilder { /** * This is a shortcut method for ResultBuilder . successful ( ) . data ( data ) . build ( ) */ public static < T > Result < T > successful ( T data ) { } }
return Result . < T > builder ( ) . success ( true ) . data ( data ) . build ( ) ;
public class CodeGenerator { /** * Gets the first non - empty child of the given node . */ private static Node getFirstNonEmptyChild ( Node n ) { } }
for ( Node c = n . getFirstChild ( ) ; c != null ; c = c . getNext ( ) ) { if ( c . isBlock ( ) ) { Node result = getFirstNonEmptyChild ( c ) ; if ( result != null ) { return result ; } } else if ( ! c . isEmpty ( ) ) { return c ; } } return null ;
public class ScalingInstruction { /** * The structure that defines new target tracking configurations ( up to 10 ) . Each of these structures includes a * specific scaling metric and a target value for the metric , along with various parameters to use with dynamic * scaling . * With predictive scaling and dynamic...
if ( targetTrackingConfigurations == null ) { this . targetTrackingConfigurations = null ; return ; } this . targetTrackingConfigurations = new java . util . ArrayList < TargetTrackingConfiguration > ( targetTrackingConfigurations ) ;
public class Assets { /** * Loads binary data asynchronously . The returned state instance provides a means to listen for * the arrival of the data . * @ param path the path to the binary asset . */ public RFuture < ByteBuffer > getBytes ( final String path ) { } }
final RPromise < ByteBuffer > result = exec . deferredPromise ( ) ; exec . invokeAsync ( new Runnable ( ) { public void run ( ) { try { result . succeed ( getBytesSync ( path ) ) ; } catch ( Throwable t ) { result . fail ( t ) ; } } } ) ; return result ;
public class JTreePanel { /** * User selected item . */ public NodeData mySingleClick ( int selRow , TreePath selPath ) { } }
Object [ ] x = selPath . getPath ( ) ; DynamicTreeNode nodeCurrent = ( DynamicTreeNode ) x [ x . length - 1 ] ; // Last one in list NodeData data = ( NodeData ) nodeCurrent . getUserObject ( ) ; String strDescription = data . toString ( ) ; String strID = data . getID ( ) ; String strRecord = data . getRecordName ( ) ;...
public class JTSGeometryExpressions { /** * Create a new JTSGeometryExpression * @ param expr Expression of type Geometry * @ return new JTSGeometryExpression */ public static < T extends Geometry > JTSGeometryExpression < T > asJTSGeometry ( Expression < T > expr ) { } }
Expression < T > underlyingMixin = ExpressionUtils . extract ( expr ) ; return new JTSGeometryExpression < T > ( underlyingMixin ) { private static final long serialVersionUID = - 6714044005570420009L ; @ Override public < R , C > R accept ( Visitor < R , C > v , C context ) { return this . mixin . accept ( v , context...
public class ASMClass { /** * Returns an array containing { @ code Method } objects reflecting all the public < em > member < / em > * methods of the class or interface represented by this { @ code Class } object , including those * declared by the class or interface and those inherited from superclasses and superi...
_throw ( ) ; return methods . entrySet ( ) . toArray ( new ASMMethod [ methods . size ( ) ] ) ;
public class TrustEverythingSSLTrustManager { /** * Configures a single HttpsURLConnection to trust all SSL certificates . * @ param connection an HttpsURLConnection which will be configured to trust all certs */ public static void trustAllSSLCertificates ( HttpsURLConnection connection ) { } }
getTrustingSSLSocketFactory ( ) ; connection . setSSLSocketFactory ( socketFactory ) ; connection . setHostnameVerifier ( new HostnameVerifier ( ) { public boolean verify ( String s , SSLSession sslSession ) { return true ; } } ) ;
public class CommerceVirtualOrderItemLocalServiceUtil { /** * Returns a range of all the commerce virtual order items . * Useful when paginating results . Returns a maximum of < code > end - start < / code > instances . < code > start < / code > and < code > end < / code > are not primary keys , they are indexes in t...
return getService ( ) . getCommerceVirtualOrderItems ( start , end ) ;
public class MyStringUtils { /** * Returns content for the given URL * @ param stringUrl URL * @ return Response content */ public static String getContent ( String stringUrl ) { } }
if ( stringUrl . equalsIgnoreCase ( "clipboard" ) ) { try { return getFromClipboard ( ) ; } catch ( Exception e ) { // it ' s ok . } } return getContent ( stringUrl , null ) ;
public class JxrTask { /** * Optional . Set the file encoding of the generated files . Defaults to the system file encoding . * @ param outputEncoding The encoding to set . */ public void setOutputEncoding ( String outputEncoding ) { } }
this . log ( "Setting output encoding to " + outputEncoding , LogLevel . DEBUG . getLevel ( ) ) ; this . outputEncoding = outputEncoding ;
public class AssociationDescriptionMarshaller { /** * Marshall the given parameter object . */ public void marshall ( AssociationDescription associationDescription , ProtocolMarshaller protocolMarshaller ) { } }
if ( associationDescription == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( associationDescription . getName ( ) , NAME_BINDING ) ; protocolMarshaller . marshall ( associationDescription . getInstanceId ( ) , INSTANCEID_BINDING ) ; protoc...
public class FunctionType { /** * Returns all interfaces implemented by a class or its superclass and any superclasses for any of * those interfaces . If this is called before all types are resolved , it may return an incomplete * set . */ public final Iterable < ObjectType > getAllImplementedInterfaces ( ) { } }
// Store them in a linked hash set , so that the compile job is // deterministic . Set < ObjectType > interfaces = new LinkedHashSet < > ( ) ; for ( ObjectType type : getImplementedInterfaces ( ) ) { addRelatedInterfaces ( type , interfaces ) ; } return interfaces ;
public class hanode_fis_binding { /** * Use this API to fetch hanode _ fis _ binding resources of given name . */ public static hanode_fis_binding [ ] get ( nitro_service service , Long id ) throws Exception { } }
hanode_fis_binding obj = new hanode_fis_binding ( ) ; obj . set_id ( id ) ; hanode_fis_binding response [ ] = ( hanode_fis_binding [ ] ) obj . get_resources ( service ) ; return response ;
public class NGram { /** * 提取ngram * @ param tokens * @ param gramSizes2 * @ return */ private ArrayList < String > ngram ( List tokens , int [ ] gramSizes2 ) { } }
ArrayList < String > list = new ArrayList < String > ( ) ; StringBuffer buf = new StringBuffer ( ) ; for ( int j = 0 ; j < gramSizes . length ; j ++ ) { int len = gramSizes [ j ] ; if ( len <= 0 || len > tokens . size ( ) ) continue ; for ( int i = 0 ; i < tokens . size ( ) - len + 1 ; i ++ ) { buf . delete ( 0 , buf ....
public class XmlChars { /** * guts of isNameChar / isNCNameChar */ private static boolean isLetter2 ( char c ) { } }
// [84 ] Letter : : = BaseChar | Ideographic // [85 ] BaseChar : : = . . . too much to repeat // [86 ] Ideographic : : = . . . too much to repeat // [87 ] CombiningChar : : = . . . too much to repeat // Optimize the typical case . if ( c >= 'a' && c <= 'z' ) return true ; if ( c == '>' ) return false ; if ( c >= 'A' &&...
public class DefaultEntityManager { /** * Returns an IncompleteKey of the given entity . * @ param entity * the entity * @ return the incomplete key */ private IncompleteKey getIncompleteKey ( Object entity ) { } }
EntityMetadata entityMetadata = EntityIntrospector . introspect ( entity . getClass ( ) ) ; String kind = entityMetadata . getKind ( ) ; ParentKeyMetadata parentKeyMetadata = entityMetadata . getParentKeyMetadata ( ) ; DatastoreKey parentKey = null ; IncompleteKey incompleteKey = null ; if ( parentKeyMetadata != null )...
public class JunitNotifier { /** * ( non - Javadoc ) * @ see * com . technophobia . substeps . runner . AbstractBaseNotifier # handleNotifyNodeStarted * ( com . technophobia . substeps . execution . ExecutionNode ) */ public void onNodeStarted ( final IExecutionNode node ) { } }
final Description description = descriptionMap . get ( Long . valueOf ( node . getId ( ) ) ) ; final boolean b = description != null ; log . debug ( "notifyTestStarted nodeid: " + node . getId ( ) + " description: " + b ) ; notifyTestStarted ( description ) ;
public class Matchers { /** * Determines whether an expression has an annotation of the given class . This includes * annotations inherited from superclasses due to @ Inherited . * @ param inputClass The class of the annotation to look for ( e . g , Produces . class ) . */ public static < T extends Tree > Matcher <...
return new Matcher < T > ( ) { @ Override public boolean matches ( T tree , VisitorState state ) { return ASTHelpers . hasAnnotation ( ASTHelpers . getDeclaredSymbol ( tree ) , inputClass , state ) ; } } ;
public class TermStatementUpdate { /** * Adds an individual alias . It will be merged with the current * list of aliases , or added as a label if there is no label for * this item in this language yet . * @ param alias * the alias to add */ protected void addAlias ( MonolingualTextValue alias ) { } }
String lang = alias . getLanguageCode ( ) ; AliasesWithUpdate currentAliasesUpdate = newAliases . get ( lang ) ; NameWithUpdate currentLabel = newLabels . get ( lang ) ; // If there isn ' t any label for that language , put the alias there if ( currentLabel == null ) { newLabels . put ( lang , new NameWithUpdate ( alia...
public class Node { /** * Gets the set of all pages this node directly links to ; this does not * include pages linked to by child elements . */ public Set < PageRef > getPageLinks ( ) { } }
synchronized ( lock ) { if ( pageLinks == null ) return Collections . emptySet ( ) ; if ( frozen ) return pageLinks ; return AoCollections . unmodifiableCopySet ( pageLinks ) ; }
public class BooleanArrayList { /** * Sorts the specified range of the receiver into ascending numerical order ( < tt > false & lt ; true < / tt > ) . * The sorting algorithm is a count sort . This algorithm offers guaranteed * O ( n ) performance without auxiliary memory . * @ param from the index of the first e...
if ( size == 0 ) return ; checkRangeFromTo ( from , to , size ) ; boolean [ ] theElements = elements ; int trues = 0 ; for ( int i = from ; i <= to ; ) if ( theElements [ i ++ ] ) trues ++ ; int falses = to - from + 1 - trues ; if ( falses > 0 ) fillFromToWith ( from , from + falses - 1 , false ) ; if ( trues > 0 ) fil...
public class CallbackContextHelper { /** * Complete the UOW that was started by the begin method of this class * and and resume any UOW that was suspended by the begin method . * @ param commit must be true if and only if you want the unspecified TX * started by begin method to be committed . Otherwise , the * ...
final boolean isTraceOn = TraceComponent . isAnyTracingEnabled ( ) ; if ( isTraceOn && tc . isEntryEnabled ( ) ) { Tr . entry ( tc , "complete called with commit argument set to: " + commit ) ; } if ( ivPopContexts != null ) { if ( ivPopContexts == Contexts . All ) { ivThreadData . popContexts ( ) ; } else { ivThreadDa...
public class WebGL10 { /** * < p > { @ code glBindRenderbuffer } binds the renderbuffer object with name renderbuffer to the renderbuffer target * specified by target . target must be { @ code GL _ RENDERBUFFER } . { @ code renderbuffer } is the name of a renderbuffer * object previously returned from a call to { @...
checkContextCompatibility ( ) ; nglBindRenderbuffer ( target , WebGLObjectMap . get ( ) . toRenderBuffer ( renderBuffer ) ) ;
public class SAReducerDecorator { /** * Perform initial condition convertion , for icnh4 and icno3 it ' s important to take into account the deep of the layer * for computing the aggregated value . * @ param key * @ param fullCurrentSoil * @ param previousSoil * @ return */ public Float computeInitialConditio...
Float newValue = ( parseFloat ( fullCurrentSoil . get ( key ) ) * parseFloat ( fullCurrentSoil . get ( SLLB ) ) + parseFloat ( previousSoil . get ( key ) ) * parseFloat ( previousSoil . get ( SLLB ) ) ) ; newValue = newValue / ( parseFloat ( fullCurrentSoil . get ( SLLB ) ) + parseFloat ( previousSoil . get ( SLLB ) ) ...
public class GSCRImpl { /** * < ! - - begin - user - doc - - > * < ! - - end - user - doc - - > * @ generated */ @ Override public void eSet ( int featureID , Object newValue ) { } }
switch ( featureID ) { case AfplibPackage . GSCR__PREC : setPREC ( ( Integer ) newValue ) ; return ; } super . eSet ( featureID , newValue ) ;
public class ManageAddOnsDialog { /** * This method initializes this */ private void initialize ( ) { } }
this . setTitle ( Constant . messages . getString ( "cfu.manage.title" ) ) ; // this . setContentPane ( getJTabbed ( ) ) ; this . setContentPane ( getTopPanel ( ) ) ; this . pack ( ) ; centerFrame ( ) ; state = State . IDLE ; // Handle escape key to close the dialog KeyStroke escape = KeyStroke . getKeyStroke ( KeyEven...
public class WithMavenStepExecution2 { /** * Executes a command and reads the result to a string . It uses the launcher to run the command to make sure the * launcher decorator is used ie . docker . image step * @ param args command arguments * @ return output from the command or { @ code null } if the command re...
try ( ByteArrayOutputStream baos = new ByteArrayOutputStream ( ) ) { ProcStarter ps = launcher . launch ( ) ; Proc p = launcher . launch ( ps . cmds ( args ) . stdout ( baos ) ) ; int exitCode = p . join ( ) ; if ( exitCode == 0 ) { return baos . toString ( getComputer ( ) . getDefaultCharset ( ) . name ( ) ) . replace...
public class BeanRepositoryApplication { /** * Startup initialisation of the BeanRepository . After the BeanRepository was initialised with * the given configurator classes , a { @ link ApplicationStartedEvent } is thrown . Use this event * as starting point for the code of your application . * @ param args the p...
validate ( args , configurators ) ; final BeanRepository beanRepository = buildAndConfigureBeanRepository ( args , configurators ) ; final ApplicationEventBus eventBus = beanRepository . getBean ( ApplicationEventBus . class ) ; eventBus . fireEvent ( new ApplicationStartedEvent ( ) ) ; Runtime . getRuntime ( ) . addSh...
public class PropertiesManager { /** * Retrieve the default raw value of the given property . This functionality * is local by design - nothing outside of the properties manager should be * directly requesting the default value . Client code should not be * concerned with what the default value is specifically , ...
String propertyName = getTranslator ( ) . getPropertyName ( property ) ; String value = properties . getDefaultValue ( propertyName ) ; if ( value != null && isAutoTrim ( ) ) { value = value . trim ( ) ; } return value ;
public class ManagedChannelImpl { /** * Make the channel exit idle mode , if it ' s in it . * < p > Must be called from syncContext */ @ VisibleForTesting void exitIdleMode ( ) { } }
syncContext . throwIfNotInThisSynchronizationContext ( ) ; if ( shutdown . get ( ) || panicMode ) { return ; } if ( inUseStateAggregator . isInUse ( ) ) { // Cancel the timer now , so that a racing due timer will not put Channel on idleness // when the caller of exitIdleMode ( ) is about to use the returned loadBalance...
public class SeqEval { /** * 从reader中提取实体 , 存到相应的队列中 , 并统计固定长度实体的个数 , 存到相应的map中 * 格式为 : 字 + 预测标签 + 正确标签 * 中BB * 国ES * 队SB * 赢SE * 了SS * @ param filePath结果文件 * @ throws IOException */ public void read ( String filePath ) throws IOException { } }
String line ; ArrayList < String > words = new ArrayList < String > ( ) ; ArrayList < String > markP = new ArrayList < String > ( ) ; ArrayList < String > typeP = new ArrayList < String > ( ) ; ArrayList < String > markC = new ArrayList < String > ( ) ; ArrayList < String > typeC = new ArrayList < String > ( ) ; if ( f...
public class ResourceReaderImpl { /** * / * ( non - Javadoc ) * @ see net . crowmagnumb . util . ResourceReader # getDoubleValue ( java . lang . String , double ) */ @ Override public double getDoubleValue ( final String key , final double defaultValue ) { } }
return formatDoubleValue ( key , getFormattedPropValue ( key ) , defaultValue ) ;
public class InvoiceData { /** * Write members to a MwsWriter . * @ param w * The writer to write to . */ @ Override public void writeFragmentTo ( MwsWriter w ) { } }
w . write ( "InvoiceRequirement" , invoiceRequirement ) ; w . write ( "BuyerSelectedInvoiceCategory" , buyerSelectedInvoiceCategory ) ; w . write ( "InvoiceTitle" , invoiceTitle ) ; w . write ( "InvoiceInformation" , invoiceInformation ) ;
public class BS { /** * Returns a < code > DeleteAction < / code > for deleting the specified values * from this binary set . */ public DeleteAction delete ( ByteBuffer ... values ) { } }
return new DeleteAction ( this , new LiteralOperand ( new LinkedHashSet < ByteBuffer > ( Arrays . asList ( values ) ) ) ) ;
public class HasNode { /** * Adds to < code > result < / code > the end point nodes ( nodes that specify a module name ) for this * node and all of the child nodes . * @ param result * The collection that the end point nodes will be added to */ public void gatherEndpoints ( Collection < HasNode > result ) { } }
if ( nodeName != null && nodeName . length ( ) > 0 ) { result . add ( this ) ; } if ( trueNode != null ) { trueNode . gatherEndpoints ( result ) ; } if ( falseNode != null ) { falseNode . gatherEndpoints ( result ) ; }
public class SnomedExample { /** * Shows how to create the following axioms : * < ol > * < li > Primitive child with no roles < / li > * < li > Fully defined child with one or more roles < / li > * < li > Fully defined child with a concrete domain < / li > * < / ol > */ public static void bottlesExample ( ) {...
// Create all the concepts Concept bottle = Factory . createNamedConcept ( "bottle" ) ; Concept plasticBottle = Factory . createNamedConcept ( "plasticBottle" ) ; Concept glassBottle = Factory . createNamedConcept ( "glassBottle" ) ; Concept purplePlasticBottle = Factory . createNamedConcept ( "purplePlasticBottle" ) ;...