signature stringlengths 43 39.1k | implementation stringlengths 0 450k |
|---|---|
public class DefaultErrorHandler { /** * Render the result directly ( without template ) .
* @ param routeContext */
protected void renderDirectly ( int statusCode , RouteContext routeContext ) { } } | if ( application . getPippoSettings ( ) . isProd ( ) ) { routeContext . getResponse ( ) . commit ( ) ; } else { if ( statusCode == HttpConstants . StatusCode . NOT_FOUND ) { StringBuilder content = new StringBuilder ( ) ; content . append ( "<html><body>" ) ; content . append ( "<pre>" ) ; content . append ( "Cannot fi... |
public class ExeFindAction { /** * Handles the Find action .
* { @ inheritDoc } */
@ Override public ExitCode handleTask ( PrintStream stdout , PrintStream stderr , Arguments args ) { } } | logger . log ( Level . INFO , Messages . INSTALL_KERNEL_MESSAGES . getLogMessage ( "MSG_STABILIZING_FEATUREMANAGER" , "find" ) + "\n" ) ; InstallKernel installKernel = InstallKernelFactory . getInstance ( ) ; installKernel . setUserAgent ( InstallConstants . FEATURE_MANAGER ) ; // Load the repository properties instanc... |
public class AppServiceEnvironmentsInner { /** * Get metric definitions for a multi - role pool of an App Service Environment .
* Get metric definitions for a multi - role pool of an App Service Environment .
* @ param nextPageLink The NextLink from the previous successful call to List operation .
* @ throws Ille... | return listMultiRoleMetricDefinitionsNextSinglePageAsync ( nextPageLink ) . concatMap ( new Func1 < ServiceResponse < Page < ResourceMetricDefinitionInner > > , Observable < ServiceResponse < Page < ResourceMetricDefinitionInner > > > > ( ) { @ Override public Observable < ServiceResponse < Page < ResourceMetricDefinit... |
public class MSSQLDBInitializer { /** * { @ inheritDoc } */
@ Override protected void postInit ( Connection connection ) throws SQLException { } } | super . postInit ( connection ) ; Statement stmt = null ; ResultSet rs = null ; try { if ( containerConfig . useSequenceForOrderNumber ) { String select = "select * from JCR_" + DBInitializerHelper . getItemTableSuffix ( containerConfig ) + "_SEQ where name='LAST_N_ORDER_NUM'" ; stmt = connection . createStatement ( )... |
public class PriorityQueue { /** * Inserts item x at position k , maintaining heap invariant by
* promoting x up the tree until it is greater than or equal to
* its parent , or is the root .
* To simplify and speed up coercions and comparisons . the
* Comparable and Comparator versions are separated into differ... | if ( comparator != null ) siftUpUsingComparator ( k , x ) ; else siftUpComparable ( k , x ) ; |
public class Participant { /** * Create a ParticipantCreator to execute create .
* @ param pathServiceSid The SID of the parent Service resource
* @ param pathSessionSid The SID of the parent Session resource
* @ param identifier The phone number of the Participant
* @ return ParticipantCreator capable of execu... | return new ParticipantCreator ( pathServiceSid , pathSessionSid , identifier ) ; |
public class OpenIDConnectConfigMarshaller { /** * Marshall the given parameter object . */
public void marshall ( OpenIDConnectConfig openIDConnectConfig , ProtocolMarshaller protocolMarshaller ) { } } | if ( openIDConnectConfig == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( openIDConnectConfig . getIssuer ( ) , ISSUER_BINDING ) ; protocolMarshaller . marshall ( openIDConnectConfig . getClientId ( ) , CLIENTID_BINDING ) ; protocolMarshal... |
public class ClassNode { /** * Accept a visitor that visit all descendants of the class represetned by
* this ` ClassNode ` including this ` ClassNode ` itself .
* @ param visitor the visitor
* @ param publicOnly specify if only public class shall be visited
* @ param noAbstract specify if abstract class can be... | return visitTree ( $ . guardedVisitor ( classNodeFilter ( publicOnly , noAbstract ) , visitor ) ) ; |
public class AmazonLexModelBuildingClient { /** * Exports the contents of a Amazon Lex resource in a specified format .
* @ param getExportRequest
* @ return Result of the GetExport operation returned by the service .
* @ throws NotFoundException
* The resource specified in the request was not found . Check the... | request = beforeClientExecution ( request ) ; return executeGetExport ( request ) ; |
public class PackageManagerUtils { /** * Get the { @ link android . content . pm . PackageInfo } that contains signature info .
* @ param context the context .
* @ param targetPackage the the target package name .
* @ return the { @ link android . content . pm . PackageInfo }
* @ throws NameNotFoundException if... | PackageManager manager = context . getPackageManager ( ) ; return manager . getPackageInfo ( targetPackage , PackageManager . GET_SIGNATURES ) ; |
public class ExperimentsInner { /** * Creates an Experiment .
* @ param resourceGroupName Name of the resource group to which the resource belongs .
* @ param workspaceName The name of the workspace . Workspace names can only contain a combination of alphanumeric characters along with dash ( - ) and underscore ( _ ... | return beginCreateWithServiceResponseAsync ( resourceGroupName , workspaceName , experimentName ) . toBlocking ( ) . single ( ) . body ( ) ; |
public class SamlEndpoint { /** * Creates a { @ link SamlEndpoint } of the specified { @ code uri } and the HTTP Redirect binding protocol . */
public static SamlEndpoint ofHttpRedirect ( URI uri ) { } } | requireNonNull ( uri , "uri" ) ; return new SamlEndpoint ( uri , SamlBindingProtocol . HTTP_REDIRECT ) ; |
public class CPRuleUserSegmentRelUtil { /** * Returns the cp rule user segment rels before and after the current cp rule user segment rel in the ordered set where CPRuleId = & # 63 ; .
* @ param CPRuleUserSegmentRelId the primary key of the current cp rule user segment rel
* @ param CPRuleId the cp rule ID
* @ pa... | return getPersistence ( ) . findByCPRuleId_PrevAndNext ( CPRuleUserSegmentRelId , CPRuleId , orderByComparator ) ; |
public class MaxBiotonicSequenceSum { /** * This function calculates the maximum sum of a bi - tonic ( first increasing then decreasing ) subsequence in the given list .
* > > > calculate _ max _ biotonic _ sequence _ sum ( new int [ ] { 1 , 15 , 51 , 45 , 33 , 100 , 12 , 18 , 9 } , 9)
* 194
* > > > calculate _ m... | int i , j ; int max ; int incSubSeqSum [ ] = new int [ length ] ; int decSubSeqSum [ ] = new int [ length ] ; for ( i = 0 ; i < length ; i ++ ) { incSubSeqSum [ i ] = array [ i ] ; decSubSeqSum [ i ] = array [ i ] ; } for ( i = 1 ; i < length ; i ++ ) for ( j = 0 ; j < i ; j ++ ) if ( array [ i ] > array [ j ] && incSu... |
public class TaskEventSupport { /** * after methods */
public void fireAfterTaskActivated ( final Task task , TaskContext context ) { } } | final Iterator < TaskLifeCycleEventListener > iter = getEventListenersIterator ( ) ; if ( iter . hasNext ( ) ) { final TaskEventImpl event = new TaskEventImpl ( task , context ) ; do { iter . next ( ) . afterTaskActivatedEvent ( event ) ; } while ( iter . hasNext ( ) ) ; } |
public class WrappedByteBuffer { /** * Puts an eight - byte long into the buffer at the specified index .
* @ param index the index
* @ param v the eight - byte long
* @ return the buffer */
public WrappedByteBuffer putLongAt ( int index , long v ) { } } | _checkForWriteAt ( index , 8 ) ; _buf . putLong ( index , v ) ; return this ; |
public class UpdatePhoneNumberRequestItemMarshaller { /** * Marshall the given parameter object . */
public void marshall ( UpdatePhoneNumberRequestItem updatePhoneNumberRequestItem , ProtocolMarshaller protocolMarshaller ) { } } | if ( updatePhoneNumberRequestItem == null ) { throw new SdkClientException ( "Invalid argument passed to marshall(...)" ) ; } try { protocolMarshaller . marshall ( updatePhoneNumberRequestItem . getPhoneNumberId ( ) , PHONENUMBERID_BINDING ) ; protocolMarshaller . marshall ( updatePhoneNumberRequestItem . getProductTyp... |
public class ProcessorBuilder { /** * Create a template from definition
* @ param template the template definition
* @ return template */
private ProcTemplate createTemplate ( Template template ) { } } | if ( ! template . isEmpty ( ) ) { return new ProcTemplate ( templateElementFactory . createTemplateList ( template . getElements ( ) ) ) ; } else { return ProcTemplate . EMPTY ; } |
public class GraphHopper { /** * This method applies the changes to the graph specified as feature collection . It does so by locking the routing
* to avoid concurrent changes which could result in incorrect routing ( like when done while a Dijkstra search ) or
* also while just reading one edge row ( inconsistent ... | // TODO allow calling this method if called before CH preparation
if ( getCHFactoryDecorator ( ) . isEnabled ( ) ) throw new IllegalArgumentException ( "To use the changeGraph API you need to turn off CH" ) ; Lock writeLock = readWriteLock . writeLock ( ) ; writeLock . lock ( ) ; try { ChangeGraphHelper overlay = creat... |
public class ResourceWatcher { /** * Removes the path mapping of the bundle given in parameter from map which
* links Path to resource bundle
* @ param bundle
* the bundle whose the path mapping should be removed */
private void removePathMappingFromPathMap ( JoinableResourceBundle bundle ) { } } | for ( List < PathMapping > pathMappings : pathToResourceBundle . values ( ) ) { for ( Iterator < PathMapping > iterator = pathMappings . iterator ( ) ; iterator . hasNext ( ) ; ) { PathMapping pathMapping = ( PathMapping ) iterator . next ( ) ; if ( pathMapping . getBundle ( ) . getName ( ) . equals ( bundle . getName ... |
public class ScannerSupplier { /** * Returns a { @ link ScannerSupplier } with a specific list of { @ link BugChecker } classes . */
public static ScannerSupplier fromBugCheckerClasses ( Iterable < Class < ? extends BugChecker > > checkers ) { } } | ImmutableList . Builder < BugCheckerInfo > builder = ImmutableList . builder ( ) ; for ( Class < ? extends BugChecker > checker : checkers ) { builder . add ( BugCheckerInfo . create ( checker ) ) ; } return fromBugCheckerInfos ( builder . build ( ) ) ; |
public class AnchorCell { /** * Sets < code > hreflang < / code > attribute for the anchor .
* @ param hreflang the hreflang attribute
* @ jsptagref . attributedescription The hrefLang attribute for the HTML anchor .
* @ jsptagref . attributesyntaxvalue < i > string _ hreflang < / i >
* @ netui : attribute requ... | _anchorState . registerAttribute ( AbstractHtmlState . ATTR_GENERAL , HtmlConstants . HREFLANG , hreflang ) ; |
public class StreamCharBuffer { /** * Reads the buffer to a char [ ] .
* Caches the result if there aren ' t any readers .
* @ return the chars */
public char [ ] toCharArray ( ) { } } | // check if there is a cached single charbuffer
if ( firstChunk == lastChunk && firstChunk instanceof CharBufferChunk && allocBuffer . charsUsed ( ) == 0 && ( ( CharBufferChunk ) firstChunk ) . isSingleBuffer ( ) ) { return ( ( CharBufferChunk ) firstChunk ) . buffer ; } int initialReaderCount = readerCount ; char [ ] ... |
public class FeatureListGrid { /** * This method is used only when selection is enabled ( see setSelectionEnabled ) . When a feature deselection event is
* sent out from the MapModel , check if we have that row selected and deselect it . */
public void onFeatureDeselected ( FeatureDeselectedEvent event ) { } } | Feature feature = event . getFeature ( ) ; // Only deselect if it is actually selected :
boolean selected = false ; ListGridRecord [ ] selections = getSelection ( ) ; for ( ListGridRecord selection : selections ) { if ( selection . getAttribute ( FIELD_NAME_FEATURE_ID ) . equals ( feature . getId ( ) ) ) { selected = t... |
public class MetadataBuilder { /** * Ad an entry to the list of { @ link RuleProvider } classes that should execute after the { @ link Rule } instances in the corresponding
* { @ link RuleProvider } instance .
* { @ link RuleProvider } s can also be specified based on id ( { @ link # getExecuteBeforeIDs } ) . */
pu... | if ( type != null ) { executeAfter . add ( type ) ; } return this ; |
public class ChronosClientWatcher { /** * Get the data from znode .
* @ param chronosClientWatcher the ZooKeeper watcher
* @ param znode the znode you want to access
* @ return the byte array of value in znode
* @ throws IOException when error to access ZooKeeper */
public byte [ ] getData ( ChronosClientWatche... | byte [ ] data = null ; for ( int i = 0 ; i <= connectRetryTimes ; i ++ ) { try { data = chronosClientWatcher . getZooKeeper ( ) . getData ( znode , null , null ) ; break ; } catch ( Exception e ) { LOG . info ( "Exceptioin to get data from ZooKeeper, retry " + i + " times" ) ; if ( i == connectRetryTimes ) { throw new ... |
public class AttributeService { /** * Gets the value of the given attribute for the given file . { @ code attribute } must be of the form
* " view : attribute " or " attribute " . */
public Object getAttribute ( File file , String attribute ) { } } | String view = getViewName ( attribute ) ; String attr = getSingleAttribute ( attribute ) ; return getAttribute ( file , view , attr ) ; |
public class CommerceNotificationAttachmentPersistenceImpl { /** * Returns the first commerce notification attachment in the ordered set where commerceNotificationQueueEntryId = & # 63 ; .
* @ param commerceNotificationQueueEntryId the commerce notification queue entry ID
* @ param orderByComparator the comparator ... | List < CommerceNotificationAttachment > list = findByCommerceNotificationQueueEntryId ( commerceNotificationQueueEntryId , 0 , 1 , orderByComparator ) ; if ( ! list . isEmpty ( ) ) { return list . get ( 0 ) ; } return null ; |
public class NS { /** * Returns a < a href =
* " http : / / docs . aws . amazon . com / amazondynamodb / latest / developerguide / Expressions . SpecifyingConditions . html # ConditionExpressionReference . Comparators "
* > comparator condition < / a > ( that evaluates to true if the value of the
* current attrib... | return new ComparatorCondition ( "<>" , this , new LiteralOperand ( new LinkedHashSet < Number > ( Arrays . asList ( values ) ) ) ) ; |
public class AbstractFileEncryptor { /** * Factory method for creating a new { @ link Cipher } from the given parameters . This method is
* invoked in the constructor from the derived classes and can be overridden so users can
* provide their own version of a new { @ link Cipher } from the given parameters .
* @ ... | final KeySpec keySpec = newKeySpec ( privateKey , salt , iterationCount ) ; final SecretKeyFactory factory = newSecretKeyFactory ( algorithm ) ; final SecretKey key = factory . generateSecret ( keySpec ) ; final AlgorithmParameterSpec paramSpec = newAlgorithmParameterSpec ( salt , iterationCount ) ; return newCipher ( ... |
public class JavacElements { /** * Returns the tree for an annotation given a list of annotations
* in which to search ( recursively ) and their corresponding trees .
* Returns null if the tree cannot be found . */
private JCTree matchAnnoToTree ( Attribute . Compound findme , List < Attribute . Compound > annos , ... | for ( Attribute . Compound anno : annos ) { for ( JCAnnotation tree : trees ) { JCTree match = matchAnnoToTree ( findme , anno , tree ) ; if ( match != null ) return match ; } } return null ; |
public class LoadBalancerContext { /** * This is called after a response is received from the client
* to update related stats . */
protected void noteResponse ( ServerStats stats , ClientRequest request , Object response , long responseTime ) { } } | if ( stats == null ) { return ; } try { recordStats ( stats , responseTime ) ; RetryHandler errorHandler = getRetryHandler ( ) ; if ( errorHandler != null && response != null ) { stats . clearSuccessiveConnectionFailureCount ( ) ; } } catch ( Exception ex ) { logger . error ( "Error noting stats for client {}" , client... |
public class UnsignedInteger64 { /** * Add an unsigned integer to another unsigned integer .
* @ param x
* @ param y
* @ return */
public static UnsignedInteger64 add ( UnsignedInteger64 x , UnsignedInteger64 y ) { } } | return new UnsignedInteger64 ( x . bigInt . add ( y . bigInt ) ) ; |
public class PreorderVisitor { /** * Constants */
@ Override public void visitConstantPool ( ConstantPool obj ) { } } | super . visitConstantPool ( obj ) ; Constant [ ] constant_pool = obj . getConstantPool ( ) ; for ( int i = 1 ; i < constant_pool . length ; i ++ ) { constant_pool [ i ] . accept ( this ) ; byte tag = constant_pool [ i ] . getTag ( ) ; if ( ( tag == Const . CONSTANT_Double ) || ( tag == Const . CONSTANT_Long ) ) { i ++ ... |
public class ReadHandler { /** * Return only those attributes of an mbean which has one of the given names */
private List < String > filterAttributeNames ( MBeanServerExecutor pSeverManager , ObjectName pName , List < String > pNames ) throws IOException , ReflectionException , MBeanException , AttributeNotFoundExcept... | Set < String > attrs = new HashSet < String > ( getAllAttributesNames ( pSeverManager , pName ) ) ; List < String > ret = new ArrayList < String > ( ) ; for ( String name : pNames ) { if ( attrs . contains ( name ) ) { ret . add ( name ) ; } } return ret ; |
public class AppSummaryService { /** * creates a list of appkeys from the hbase scan
* @ param scan
* @ param startTime
* @ param endTime
* @ param maxCount
* @ return list of flow keys
* @ throws IOException */
public List < AppKey > createNewAppKeysFromResults ( Scan scan , long startTime , long endTime ,... | ResultScanner scanner = null ; List < AppKey > newAppsKeys = new ArrayList < AppKey > ( ) ; Table versionsTable = null ; try { Stopwatch timer = new Stopwatch ( ) . start ( ) ; int rowCount = 0 ; long colCount = 0 ; long resultSize = 0 ; versionsTable = hbaseConnection . getTable ( TableName . valueOf ( Constants . HIS... |
public class TrustGraphNode { /** * Determines the policy for forwarding received messages .
* By default this policy drops messages with ttl higher than
* getMaxRouteLength ( ) or there are no more hops ( ttl < = 1)
* @ return true if the message should be forwarded */
protected boolean shouldForward ( TrustGrap... | final int ttl = message . getInboundTTL ( ) ; if ( ttl <= 1 || ttl > getMaxRouteLength ( ) ) { return false ; } return true ; |
public class GitlabAPI { /** * Gets a list of a project ' s jobs in Gitlab
* @ param projectId the project id
* @ return A list of project jobs */
public List < GitlabJob > getProjectJobs ( Integer projectId ) { } } | String tailUrl = GitlabProject . URL + "/" + sanitizeProjectId ( projectId ) + GitlabJob . URL + PARAM_MAX_ITEMS_PER_PAGE ; return retrieve ( ) . getAll ( tailUrl , GitlabJob [ ] . class ) ; |
public class DefaultRelationshipCreator { /** * { @ inheritDoc } */
@ Override public Relationship createRelationship ( Node first , Node second ) { } } | return first . createRelationshipTo ( second , relationshipType ) ; |
public class XmlReader { /** * Get the attribute value .
* @ param attribute The attribute name ( must not be < code > null < / code > ) .
* @ return The attribute value .
* @ throws LionEngineException If attribute is not valid or does not exist . */
private String getValue ( String attribute ) { } } | Check . notNull ( attribute ) ; if ( root . hasAttribute ( attribute ) ) { return root . getAttribute ( attribute ) ; } throw new LionEngineException ( ERROR_ATTRIBUTE + attribute ) ; |
public class ExtinctionCoefficient { /** * method to calculate the extinction coefficient for peptide
* @ param monomers all monomers of the peptide
* @ return extinction coefficient
* @ throws IOException
* @ throws HELM2HandledException if HELM2 features were there */
private static float calculateExtinctionF... | if ( null == monomers || monomers . isEmpty ( ) ) { return 0.0f ; } Map < String , Integer > countMap = new HashMap < String , Integer > ( ) ; for ( Monomer monomer : monomers ) { if ( aminoAcidMap . containsKey ( monomer . getAlternateId ( ) ) ) { int count = 1 ; if ( countMap . containsKey ( monomer . getAlternateId ... |
public class DefaultSecurityControllerManager { /** * Get the security controller for the given id . If the id is registered in our map ,
* then return the registered controller . If not , then try to obtain a bean with the
* given id if it implements the SecurityController interface .
* @ param id of controller ... | SecurityController sc = ( SecurityController ) securityControllerMap . get ( id ) ; if ( sc == null ) { // Try for a named bean
try { sc = applicationContext . getBean ( id , SecurityController . class ) ; } catch ( NoSuchBeanDefinitionException e ) { // Try for a fallback
sc = getFallbackSecurityController ( ) ; } } r... |
public class MaterialTree { /** * Recursive function to expand each tree item . */
protected void expandItems ( MaterialTreeItem item ) { } } | item . expand ( ) ; item . setHide ( true ) ; item . getTreeItems ( ) . forEach ( this :: expandItems ) ; |
public class AbsModule { /** * Asserts that the given { @ code object } with name { @ code param } is not null , throws
* { @ link IllegalArgumentException } otherwise . */
void assertNotNull ( Object object , String param ) { } } | if ( object == null ) { throw new IllegalArgumentException ( String . format ( "%s may not be null." , param ) ) ; } |
public class Cards { /** * 创建优惠券
* @ param coupon
* @ return */
public String coupon ( Coupon coupon ) { } } | Card card = new Card ( ) ; card . setCardType ( "GENERAL_COUPON" ) ; card . setCoupon ( coupon ) ; return createCard ( card ) ; |
public class FileService { /** * returns the absolute path to the final based file output folder where the
* resource is configured
* @ param file
* Relative file from remote resource
* @ param basePath
* Absolute path to outputdirectory
* @ param destinationFolder
* Relative sub path from output director... | StringBuilder retval = new StringBuilder ( destinationFolder . getAbsolutePath ( ) ) ; PathUtils . addEndingSlashIfNeeded ( retval ) ; if ( ! isFlatten ) { // delete output directory from basePath
String relativePath = file . replace ( basePath , "" ) ; retval . append ( relativePath ) ; } else { // skip location file
... |
public class Sum { /** * Backward pass : dG / dx _ i = dG / dy dy / dx _ i = dG / dy */
@ Override public void backward ( ) { } } | Tensor xAdj = modIn . getOutputAdj ( ) ; xAdj . add ( yAdj . getValue ( 0 ) ) ; |
public class SessionApi { /** * Get DNs for a place
* Get all DNs attached to the specified place .
* @ param placeName The name of the place . ( required )
* @ return ApiResponse & lt ; Devices & gt ;
* @ throws ApiException If fail to call the API , e . g . server error or cannot deserialize the response body... | com . squareup . okhttp . Call call = getDevicesForPlaceValidateBeforeCall ( placeName , null , null ) ; Type localVarReturnType = new TypeToken < Devices > ( ) { } . getType ( ) ; return apiClient . execute ( call , localVarReturnType ) ; |
public class Chars { /** * Arrays . copyOf ( ) requires Java 6 */
private static char [ ] copyOf ( char [ ] original , int length ) { } } | char [ ] copy = new char [ length ] ; System . arraycopy ( original , 0 , copy , 0 , Math . min ( original . length , length ) ) ; return copy ; |
public class MongoEntityExtractor { /** * { @ inheritDoc } */
@ Override public T transformElement ( Tuple2 < Object , BSONObject > tuple , DeepJobConfig < T , ? extends DeepJobConfig > config ) { } } | try { return ( T ) UtilMongoDB . getObjectFromBson ( config . getEntityClass ( ) , tuple . _2 ( ) ) ; } catch ( Exception e ) { LOG . error ( "Cannot convert BSON: " , e ) ; throw new DeepTransformException ( "Could not transform from Bson to Entity " + e . getMessage ( ) , e ) ; } |
public class AlluxioJobMasterMonitor { /** * Starts the Alluxio job _ master monitor .
* @ param args command line arguments , should be empty */
public static void main ( String [ ] args ) { } } | if ( args . length != 0 ) { LOG . info ( "java -cp {} {}" , RuntimeConstants . ALLUXIO_JAR , AlluxioJobMasterMonitor . class . getCanonicalName ( ) ) ; LOG . warn ( "ignoring arguments" ) ; } AlluxioConfiguration conf = new InstancedConfiguration ( ConfigurationUtils . defaults ( ) ) ; HealthCheckClient client ; // Onl... |
public class EMFGeneratorFragment { /** * Sets the target EMF runtime version to generate for to the specified value .
* @ param emfRuntimeVersion the EMF runtime version .
* @ since 2.3 */
public void setEmfRuntimeVersion ( String emfRuntimeVersion ) { } } | this . emfRuntimeVerison = GenRuntimeVersion . get ( emfRuntimeVersion ) ; if ( this . emfRuntimeVerison == null ) { log . warn ( "Illegal EMF runtime verison " + emfRuntimeVersion + ". Using default version instead." ) ; } |
public class AesEncrypter { /** * Returns a { @ link SecretKeySpec } given a secret key .
* @ param secretKey */
private static SecretKeySpec keySpecFromSecretKey ( String secretKey ) { } } | if ( ! keySpecs . containsKey ( secretKey ) ) { byte [ ] ivraw = secretKey . getBytes ( ) ; SecretKeySpec skeySpec = new SecretKeySpec ( ivraw , "AES" ) ; // $ NON - NLS - 1 $
keySpecs . put ( secretKey , skeySpec ) ; } return keySpecs . get ( secretKey ) ; |
public class FileUtil { /** * Writes the specified byte array to a file .
* @ param file The < code > File < / code > to write .
* @ param contents The byte array to write to the file .
* @ param createDirectory A value indicating whether the directory
* containing the file to be written should be created if it... | if ( createDirectory ) { File directory = file . getParentFile ( ) ; if ( ! directory . exists ( ) ) { directory . mkdirs ( ) ; } } FileOutputStream stream = new FileOutputStream ( file ) ; StreamUtil . writeBytes ( contents , stream ) ; stream . close ( ) ; |
public class Ifc4PackageImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ Override public EClass getIfcCardinalPointReference ( ) { } } | if ( ifcCardinalPointReferenceEClass == null ) { ifcCardinalPointReferenceEClass = ( EClass ) EPackage . Registry . INSTANCE . getEPackage ( Ifc4Package . eNS_URI ) . getEClassifiers ( ) . get ( 786 ) ; } return ifcCardinalPointReferenceEClass ; |
public class ExpressionUtils { /** * Create a { @ code left in right } expression
* @ param < D > type of expressions
* @ param left lhs of expression
* @ param right rhs of expression
* @ return left in right */
public static < D > Predicate in ( Expression < D > left , CollectionExpression < ? , ? extends D >... | return predicate ( Ops . IN , left , right ) ; |
public class WMenu { /** * Returns the selected item ( WMenUItem / WSubMenu , depending on the menu type ) in the given context .
* @ return the selected item , or null if no item has been selected . */
public MenuItemSelectable getSelectedMenuItem ( ) { } } | List < MenuItemSelectable > selectedItems = getSelectedMenuItems ( ) ; if ( selectedItems . isEmpty ( ) ) { return null ; } else { return selectedItems . get ( 0 ) ; } |
public class lbvserver { /** * Use this API to add lbvserver . */
public static base_response add ( nitro_service client , lbvserver resource ) throws Exception { } } | lbvserver addresource = new lbvserver ( ) ; addresource . name = resource . name ; addresource . servicetype = resource . servicetype ; addresource . ipv46 = resource . ipv46 ; addresource . ippattern = resource . ippattern ; addresource . ipmask = resource . ipmask ; addresource . port = resource . port ; addresource ... |
public class SqlLifecycle { /** * Emit logs and metrics for this query .
* @ param e exception that occurred while processing this query
* @ param remoteAddress remote address , for logging ; or null if unknown
* @ param bytesWritten number of bytes written ; will become a query / bytes metric if > = 0 */
public ... | synchronized ( lock ) { if ( sql == null ) { // Never initialized , don ' t log or emit anything .
return ; } if ( state == State . DONE ) { log . warn ( "Tried to emit logs and metrics twice for query[%s]!" , sqlQueryId ( ) ) ; } state = State . DONE ; final boolean success = e == null ; final long queryTimeNs = Syste... |
public class Bound { /** * Returns true if left is overlapping or adjacent to right */
public static boolean adOrOver ( Bound < ? > left , Bound < ? > right ) { } } | boolean isValueEqual = left . getValue ( ) . equals ( right . getValue ( ) ) ; boolean isBothOpen = left . getBoundaryType ( ) == RangeBoundary . OPEN && right . getBoundaryType ( ) == RangeBoundary . OPEN ; return isValueEqual && ! isBothOpen ; |
public class PrototypeScopedView { /** * You can inject UI scoped beans into a prototype scoped bean */
@ PostConstruct void init ( ) { } } | LOGGER . info ( "I'm being created: {}" , this ) ; setMargin ( true ) ; setSpacing ( true ) ; final Label label = new Label ( String . format ( "This is a prototype scoped view. A new instance is created every time this view is shown. " + "This particular instance is <b>%s</b>. If you navigate away from this view and b... |
public class Primitives { /** * Parses the char sequence argument as a boolean . The boolean returned represents
* the value true if the char sequence argument is not null and it ' s digit value
* is 1.
* @ param cs
* @ param radix Must be 2.
* @ param beginIndex the index to the first char of the text range ... | if ( radix != 2 ) { throw new IllegalArgumentException ( "radix must be 2" ) ; } if ( Character . codePointCount ( cs , beginIndex , endIndex ) != 1 ) { throw new IllegalArgumentException ( "input length must be 1" ) ; } int digit = Character . digit ( Character . codePointAt ( cs , beginIndex ) , 2 ) ; switch ( digit ... |
public class PythonStreamExecutionEnvironment { /** * Creates a python data stream from the given iterator .
* < p > Note that this operation will result in a non - parallel data stream source , i . e . ,
* a data stream source with a parallelism of one . < / p >
* @ param iter The iterator of elements to create ... | return new PythonDataStream < > ( env . addSource ( new PythonIteratorFunction ( iter ) , TypeExtractor . getForClass ( Object . class ) ) . map ( new AdapterMap < > ( ) ) ) ; |
public class WorkflowEngineOperationsProcessor { /** * Continue processing from current state */
private void continueProcessing ( ) { } } | try { while ( ! Thread . currentThread ( ) . isInterrupted ( ) ) { HashMap < String , String > changes = new HashMap < > ( ) ; // load all changes already in the queue
getAvailableChanges ( changes ) ; if ( changes . isEmpty ( ) ) { if ( inProcess . isEmpty ( ) ) { // no pending operations , signalling no new state cha... |
public class Common { /** * Set the default amount of money a account will have
* @ param value the default amount of money */
public void setDefaultHoldings ( double value ) { } } | getStorageHandler ( ) . getStorageEngine ( ) . setConfigEntry ( "holdings" , String . valueOf ( value ) ) ; holdings = value ; |
public class UicStatsAsHtml { /** * Writes a row containing a single stat .
* @ param writer the writer to write the row to .
* @ param stat the stat to write . */
private static void writeRow ( final PrintWriter writer , final UicStats . Stat stat ) { } } | writer . print ( "<tr>" ) ; writer . print ( "<td>" + stat . getClassName ( ) + "</td>" ) ; writer . print ( "<td>" + stat . getModelStateAsString ( ) + "</td>" ) ; if ( stat . getSerializedSize ( ) > 0 ) { writer . print ( "<td>" + stat . getSerializedSize ( ) + "</td>" ) ; } else { writer . print ( "<td> </td>" ... |
public class ServletContextResourceReaderHandler { /** * ( non - Javadoc )
* @ see
* net . jawr . web . resource . handler . reader . ResourceReaderHandler # getFilePath (
* java . lang . String ) */
@ Override public String getFilePath ( String resourcePath ) { } } | String filePath = null ; List < ResourceBrowser > list = new ArrayList < > ( ) ; list . addAll ( resourceInfoProviders ) ; for ( Iterator < ResourceBrowser > iterator = list . iterator ( ) ; iterator . hasNext ( ) && filePath == null ; ) { ResourceBrowser rsBrowser = iterator . next ( ) ; if ( generatorRegistry . isPat... |
public class Component { /** * Configures component by passing configuration parameters .
* @ param config configuration parameters to be set . */
public void configure ( ConfigParams config ) throws ConfigException { } } | _dependencyResolver . configure ( config ) ; _logger . configure ( config ) ; |
public class Control { /** * This method returns the default value for this control
* @ return the default value for this control
* @ throws UnsupportedMethod if this control is of type { @ link V4L4JConstants # CTRL _ TYPE _ STRING }
* @ throws StateException if this control has been released and must not be use... | if ( type == V4L4JConstants . CTRL_TYPE_STRING ) throw new UnsupportedMethod ( "This control is a string control and does not support calls to getDefaultValue()" ) ; if ( type == V4L4JConstants . CTRL_TYPE_LONG ) throw new UnsupportedMethod ( "This control is a long control and does not support calls to getDefaultValue... |
public class JSONWriter { /** * / * Overridable concrete typed write methods ; key conversions : */
protected String keyToString ( Object rawKey ) { } } | if ( rawKey instanceof String ) { return ( String ) rawKey ; } return String . valueOf ( rawKey ) ; |
public class BlockReconstructor { /** * This reconstructs a single part file block by recovering in sequence each
* parity block in the part file block . */
private void processParityHarPartBlock ( FileSystem dfs , Path partFile , long blockOffset , FileStatus partFileStat , HarIndex harIndex , File localBlockFile , ... | String partName = partFile . toUri ( ) . getPath ( ) ; // Temporarily .
partName = partName . substring ( 1 + partName . lastIndexOf ( Path . SEPARATOR ) ) ; OutputStream out = new FileOutputStream ( localBlockFile ) ; try { // A HAR part file block could map to several parity files . We need to
// use all of them to r... |
public class YearMonth { /** * Returns a copy of this year - month with the new year and month , checking
* to see if a new object is in fact required .
* @ param newYear the year to represent , validated from MIN _ YEAR to MAX _ YEAR
* @ param newMonth the month - of - year to represent , validated not null
* ... | if ( year == newYear && month == newMonth ) { return this ; } return new YearMonth ( newYear , newMonth ) ; |
public class Matrix4x3d { /** * Set this matrix to a rotation matrix which rotates the given radians about a given axis .
* The axis described by the < code > axis < / code > vector needs to be a unit vector .
* When used with a right - handed coordinate system , the produced rotation will rotate a vector
* count... | return rotation ( angle , axis . x ( ) , axis . y ( ) , axis . z ( ) ) ; |
public class CodeWriter { /** * Emits { @ code modifiers } in the standard order . Modifiers in { @ code implicitModifiers } will not
* be emitted . */
public void emitModifiers ( Set < Modifier > modifiers , Set < Modifier > implicitModifiers ) throws IOException { } } | if ( modifiers . isEmpty ( ) ) return ; for ( Modifier modifier : EnumSet . copyOf ( modifiers ) ) { if ( implicitModifiers . contains ( modifier ) ) continue ; emitAndIndent ( modifier . name ( ) . toLowerCase ( Locale . US ) ) ; emitAndIndent ( " " ) ; } |
public class HTODDependencyTable { /** * This adds a entry to the ValueSet for the specified dependency . The dependency is found
* in the dependencyToEntryTable .
* @ param dependency The dependency .
* @ param valueSet containing all entries for this dependency .
* @ param entry The new entry to add . */
publ... | int returnCode = HTODDynacache . NO_EXCEPTION ; dependencyNotUpdatedTable . remove ( dependency ) ; valueSet . add ( entry ) ; if ( valueSet . size ( ) > this . delayOffloadEntriesLimit ) { if ( this . type == DEP_ID_TABLE ) { returnCode = this . htod . writeValueSet ( HTODDynacache . DEP_ID_DATA , dependency , valueSe... |
public class AbstractPageFactory { /** * { @ inheritDoc } */
@ Override public void updated ( Dictionary < String , ? > config ) throws ConfigurationException { } } | if ( config == null ) { synchronized ( this ) { pageServiceRegistration . setProperties ( properties ) ; } return ; } String pagename = ( String ) config . get ( PAGE_NAME ) ; String appname = ( String ) config . get ( APPLICATION_NAME ) ; setPageName ( pagename ) ; setApplicationName ( appname ) ; synchronized ( this ... |
public class ObjectFactory { /** * Create an instance of { @ link JAXBElement } { @ code < } { @ link JournalCode } { @ code > } } */
@ XmlElementDecl ( namespace = "http://schema.intuit.com/finance/v3" , name = "JournalCode" , substitutionHeadNamespace = "http://schema.intuit.com/finance/v3" , substitutionHeadName = "... | return new JAXBElement < JournalCode > ( _JournalCode_QNAME , JournalCode . class , null , value ) ; |
public class CDIUtils { /** * Read the file META - INF / services / javax . enterprise . inject . spi . Extension and return the extension class names
* @ param metaInfServicesEntry
* @ return */
public static Set < String > parseServiceSPIExtensionFile ( Resource metaInfServicesEntry ) { } } | Set < String > serviceClazz = new HashSet < String > ( ) ; URL metaInfServicesUrl = metaInfServicesEntry == null ? null : metaInfServicesEntry . getURL ( ) ; if ( metaInfServicesUrl != null ) { InputStream is = null ; BufferedReader bfReader = null ; InputStreamReader isReader = null ; try { is = metaInfServicesUrl . o... |
public class SmbSessionImpl { /** * { @ inheritDoc }
* @ see jcifs . SmbSession # unwrap ( java . lang . Class ) */
@ SuppressWarnings ( "unchecked" ) @ Override public < T extends SmbSession > T unwrap ( Class < T > type ) { } } | if ( type . isAssignableFrom ( this . getClass ( ) ) ) { return ( T ) this ; } throw new ClassCastException ( ) ; |
public class IfcConnectedFaceSetImpl { /** * < ! - - begin - user - doc - - >
* < ! - - end - user - doc - - >
* @ generated */
@ SuppressWarnings ( "unchecked" ) public EList < IfcFace > getCfsFaces ( ) { } } | return ( EList < IfcFace > ) eGet ( Ifc2x3tc1Package . Literals . IFC_CONNECTED_FACE_SET__CFS_FACES , true ) ; |
public class GridBagLayoutFormBuilder { /** * Appends a label and field to the end of the current line .
* The label will be to the left of the field , and be right - justified .
* < br / >
* The field will " grow " horizontally as space allows .
* @ param propertyName the name of the property to create the con... | return appendLabeledField ( propertyName , field , labelOrientation , colSpan , 1 , true , false ) ; |
public class ClientConfiguration { /** * Returns the Java system property for proxy port depending on
* { @ link # getProtocol ( ) } : i . e . if protocol is https , returns
* the value of the system property https . proxyPort , otherwise
* returns value of http . proxyPort . Defaults to { @ link this . proxyPort... | final String proxyPortString = ( getProtocol ( ) == Protocol . HTTPS ) ? getSystemProperty ( "https.proxyPort" ) : getSystemProperty ( "http.proxyPort" ) ; try { return Integer . parseInt ( proxyPortString ) ; } catch ( NumberFormatException e ) { return proxyPort ; } |
public class Jazz { /** * Displays a static picture in a single window .
* You can open multiple windows using this method .
* This method used an { @ link Animation } and allows for zooming and panning .
* @ since 1.0.0
* @ param title
* The title of the displayed window .
* @ param width
* The width of ... | return play ( title , width , height , new Animation ( ) { @ Override public Picture getPicture ( ) { return picture ; } @ Override public void update ( final double time , final double delta ) { // do nothing , the picture is static .
} } ) ; |
public class ServletRESTRequestWithParams { /** * ( non - Javadoc )
* @ see com . ibm . wsspi . rest . handler . RESTRequest # getLocales ( ) */
@ Override public Enumeration < Locale > getLocales ( ) { } } | ServletRESTRequestImpl ret = castRequest ( ) ; if ( ret != null ) return ret . getLocales ( ) ; return null ; |
public class JBBPBitInputStream { /** * Read number of integer items from the input stream .
* @ param items number of items to be read from the input stream , if less than
* zero then all stream till the end will be read
* @ param byteOrder the order of bytes to be used to decode values
* @ return read items a... | int pos = 0 ; if ( items < 0 ) { int [ ] buffer = new int [ INITIAL_ARRAY_BUFFER_SIZE ] ; // till end
while ( hasAvailableData ( ) ) { final int next = readInt ( byteOrder ) ; if ( buffer . length == pos ) { final int [ ] newbuffer = new int [ buffer . length << 1 ] ; System . arraycopy ( buffer , 0 , newbuffer , 0 , b... |
public class Wings { /** * Subscribes to link state changes of the endpoints . The subscribing { @ link java . lang . Object } must
* have one or more { @ link com . squareup . otto . Subscribe } - annotated methods , each taking a single
* parameter that corresponds to the { @ link com . groundupworks . wings . Wi... | if ( ! sIsInitialized ) { throw new IllegalStateException ( "Wings must be initialized. See Wings#init()." ) ; } WingsInjector . getBus ( ) . register ( object ) ; |
public class DefaultCustomizationCollection { /** * Adds a customization to the collection .
* @ return always { @ code true }
* @ throws IllegalArgumentException if the entry is already existing . */
@ Override public boolean add ( final CustomizationSupplier < T > entry ) { } } | if ( list . contains ( entry ) ) { throw new IllegalArgumentException ( "duplicate entry" ) ; } return list . add ( entry ) ; |
public class ResourceServerSecurityConfigurer { /** * Sets a custom { @ link AuthenticationDetailsSource } to use as a source
* of authentication details . The default is { @ link OAuth2AuthenticationDetailsSource } .
* @ param authenticationDetailsSource the custom { @ link AuthenticationDetailsSource } to use
*... | Assert . state ( authenticationDetailsSource != null , "AuthenticationDetailsSource cannot be null" ) ; this . authenticationDetailsSource = authenticationDetailsSource ; return this ; |
public class Iso8601Format { /** * / * [ deutsch ]
* < p > Interpretiert den angegebenen ISO - 8601 - kompatiblen Datumstext im < i > basic < / i > - Format
* oder im < i > extended < / i > - Format . < / p >
* @ param iso text like & quot ; 20160101 & quot ; , & quot ; 2016001 & quot ; , & quot ; 2016W011 & quot... | ParseLog plog = new ParseLog ( ) ; PlainDate date = parseDate ( iso , plog ) ; if ( ( date == null ) || plog . isError ( ) ) { throw new ParseException ( plog . getErrorMessage ( ) , plog . getErrorIndex ( ) ) ; } else if ( plog . getPosition ( ) < iso . length ( ) ) { throw new ParseException ( "Trailing characters fo... |
public class PathUtil { /** * Unzip a file to a target directory .
* @ param zip the path to the zip file .
* @ param target the path to the target directory into which the zip file will be unzipped .
* @ throws IOException */
public static void unzip ( Path zip , Path target ) throws IOException { } } | try ( final ZipFile zipFile = new ZipFile ( zip . toFile ( ) ) ) { unzip ( zipFile , target ) ; } |
public class KTypeArrayDeque { /** * { @ inheritDoc } */
@ Override public int removeAll ( KType e1 ) { } } | int removed = 0 ; final int last = tail ; final int bufLen = buffer . length ; int from , to ; for ( from = to = head ; from != last ; from = oneRight ( from , bufLen ) ) { if ( Intrinsics . equals ( this , e1 , buffer [ from ] ) ) { buffer [ from ] = Intrinsics . empty ( ) ; removed ++ ; continue ; } if ( to != from )... |
public class Emitter { /** * Check if there is a valid HTML tag here . This method also transforms auto
* links and mailto auto links .
* @ param out
* The StringBuilder to write to .
* @ param in
* Input String .
* @ param start
* Starting position .
* @ return The new position or - 1 if nothing valid ... | final StringBuilder temp = new StringBuilder ( ) ; int pos ; // Check for auto links
temp . setLength ( 0 ) ; pos = Utils . readUntil ( temp , in , start + 1 , ':' , ' ' , '>' , '\n' ) ; if ( pos != - 1 && in . charAt ( pos ) == ':' && HTML . isLinkPrefix ( temp . toString ( ) ) ) { pos = Utils . readUntil ( temp , in ... |
public class VariantJSONQuery { /** * Return the specified token from the reader . If it is not found , throw an
* IOException indicating that . Converting to chr to ( char ) chr is acceptable
* because the ' tokens ' allowed in a JSON input stream ( true , false , null )
* are all ASCII . */
private void parseTo... | int len = token . length ( ) ; for ( int i = 0 ; i < len ; i ++ ) { int chr = sr . read ( ) ; if ( chr == - 1 ) { throw new IllegalArgumentException ( "EOF reached while reading token: " + token ) ; } chr = Character . toLowerCase ( ( char ) chr ) ; int loTokenChar = token . charAt ( i ) ; if ( loTokenChar != chr ) { t... |
public class TransmitMessage { /** * / * ( non - Javadoc )
* @ see com . ibm . ws . sib . processor . runtime . SIMPRemoteMessageControllable # getMEArrivalTimestamp ( ) */
public long getMEArrivalTimestamp ( ) throws SIMPControllableNotFoundException , SIMPException { } } | if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . entry ( tc , "getMEArrivalTimestamp" ) ; long timestamp = getJsMessage ( ) . getCurrentMEArrivalTimestamp ( ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isEntryEnabled ( ) ) SibTr . exit ( tc , "getMEArrivalTimestamp" , new ... |
public class CaseArgumentAnalyser { /** * A scenario model is structural identical if all cases have exactly the same
* steps , except for values of step arguments .
* This is implemented by comparing all cases with the first one */
private boolean isStructuralIdentical ( ScenarioModel scenarioModel ) { } } | ScenarioCaseModel firstCase = scenarioModel . getScenarioCases ( ) . get ( 0 ) ; for ( int iCase = 1 ; iCase < scenarioModel . getScenarioCases ( ) . size ( ) ; iCase ++ ) { ScenarioCaseModel caseModel = scenarioModel . getScenarioCases ( ) . get ( iCase ) ; if ( stepsAreDifferent ( firstCase , caseModel ) ) { return f... |
public class JsonRpcMultiServer { /** * Returns the handler ' s class or interfaces . The serviceName is used
* to look up a registered handler .
* @ param serviceName the optional name of a service
* @ return the class */
@ Override protected Class < ? > [ ] getHandlerInterfaces ( String serviceName ) { } } | Class < ? > remoteInterface = interfaceMap . get ( serviceName ) ; if ( remoteInterface != null ) { return new Class < ? > [ ] { remoteInterface } ; } else if ( Proxy . isProxyClass ( getHandler ( serviceName ) . getClass ( ) ) ) { return getHandler ( serviceName ) . getClass ( ) . getInterfaces ( ) ; } else { return n... |
public class DBCluster { /** * Provides a list of the AWS Identity and Access Management ( IAM ) roles that are associated with the DB cluster .
* IAM roles that are associated with a DB cluster grant permission for the DB cluster to access other AWS services
* on your behalf .
* @ param associatedRoles
* Provi... | if ( associatedRoles == null ) { this . associatedRoles = null ; return ; } this . associatedRoles = new java . util . ArrayList < DBClusterRole > ( associatedRoles ) ; |
public class Agg { /** * Get a { @ link Collector } that calculates the < code > MIN ( ) < / code > function . */
public static < T > Collector < T , ? , Optional < T > > min ( Comparator < ? super T > comparator ) { } } | return minBy ( t -> t , comparator ) ; |
public class JobDefinitionService { /** * Returns an optional JobDefinition matching the given jobType .
* @ param jobType case insensitive { @ link JobDefinition # jobType ( ) job type }
* @ return optional JobDefinition */
public Optional < JobDefinition > getJobDefinition ( final String jobType ) { } } | return jobDefinitions . stream ( ) . filter ( ( j ) -> j . jobType ( ) . equalsIgnoreCase ( jobType ) ) . findAny ( ) ; |
public class DocumentPermission { /** * Create a DocumentPermissionFetcher to execute fetch .
* @ param pathServiceSid Sync Service Instance SID or unique name .
* @ param pathDocumentSid Sync Document SID or unique name .
* @ param pathIdentity Identity of the user to whom the Sync Document
* Permission applie... | return new DocumentPermissionFetcher ( pathServiceSid , pathDocumentSid , pathIdentity ) ; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.