idx int64 0 41.2k | question stringlengths 73 5.81k | target stringlengths 5 918 |
|---|---|---|
2,500 | private static DSAKeyValidationParameters . Usage getUsage ( int usage ) { if ( usage == DSAParameterGenerationParameters . DIGITAL_SIGNATURE_USAGE ) { return DSAKeyValidationParameters . Usage . DIGITAL_SIGNATURE ; } else if ( usage == DSAParameterGenerationParameters . KEY_ESTABLISHMENT_USAGE ) { return DSAKeyValidat... | Convert usage index to key usage . |
2,501 | public void addURL ( URL url ) { this . finder . addURI ( URI . create ( url . toExternalForm ( ) ) ) ; } | Add specified URL at the end of the search path . |
2,502 | public void addURLs ( List < URL > urls ) { for ( URL url : urls ) { addURL ( url ) ; } } | Add specified URLs at the end of the search path . |
2,503 | protected Class < ? > findClass ( final String name ) throws ClassNotFoundException { try { return AccessController . doPrivileged ( new PrivilegedExceptionAction < Class < ? > > ( ) { public Class < ? > run ( ) throws ClassNotFoundException { String path = name . replace ( '.' , '/' ) . concat ( ".class" ) ; ResourceH... | Finds and loads the class with the specified name . |
2,504 | private boolean isSealed ( String name , Manifest man ) { String path = name . replace ( '.' , '/' ) . concat ( "/" ) ; Attributes attr = man . getAttributes ( path ) ; String sealed = null ; if ( attr != null ) { sealed = attr . getValue ( Name . SEALED ) ; } if ( sealed == null ) { if ( ( attr = man . getMainAttribut... | returns true if the specified package name is sealed according to the given manifest . |
2,505 | public URL findResource ( final String name ) { return AccessController . doPrivileged ( new PrivilegedAction < URL > ( ) { public URL run ( ) { return URIClassLoader . this . finder . findResource ( name ) ; } } , this . acc ) ; } | Finds the resource with the specified name . |
2,506 | public Enumeration < URL > findResources ( final String name ) throws IOException { return AccessController . doPrivileged ( new PrivilegedAction < Enumeration < URL > > ( ) { public Enumeration < URL > run ( ) { return URIClassLoader . this . finder . findResources ( name ) ; } } , this . acc ) ; } | Returns an Enumeration of URLs representing all of the resources having the specified name . |
2,507 | protected ResourceHandle getResourceHandle ( final String name ) { return AccessController . doPrivileged ( new PrivilegedAction < ResourceHandle > ( ) { public ResourceHandle run ( ) { return URIClassLoader . this . finder . getResource ( name ) ; } } , this . acc ) ; } | Finds the ResourceHandle object for the resource with the specified name . |
2,508 | protected Enumeration < ResourceHandle > getResourceHandles ( final String name ) { return AccessController . doPrivileged ( new PrivilegedAction < Enumeration < ResourceHandle > > ( ) { public Enumeration < ResourceHandle > run ( ) { return URIClassLoader . this . finder . getResources ( name ) ; } } , this . acc ) ; ... | Returns an Enumeration of ResourceHandle objects representing all of the resources having the specified name . |
2,509 | protected void initializePatterns ( ) { this . contentPagePatterns = initializationPagePatterns ( this . contentPages ) ; this . technicalPagePatterns = initializationPagePatterns ( this . technicalPages ) ; Map < Pattern , Pattern > patterns = new HashMap < > ( ) ; for ( String key : this . titles . stringPropertyName... | Initialize regex Patterns for performance reasons . |
2,510 | protected void executeLicenseGoal ( String goal ) throws MojoExecutionException { Plugin licensePlugin = this . project . getPluginManagement ( ) . getPluginsAsMap ( ) . get ( "com.mycila:license-maven-plugin" ) ; if ( licensePlugin == null ) { throw new MojoExecutionException ( "License plugin could not be found in <p... | Executes a goal of the Maven License plugin ( used for adding or checking for license headers . |
2,511 | protected Color parseRGB ( String value ) { StringTokenizer items = new StringTokenizer ( value , "," ) ; try { int red = 0 ; if ( items . hasMoreTokens ( ) ) { red = Integer . parseInt ( items . nextToken ( ) . trim ( ) ) ; } int green = 0 ; if ( items . hasMoreTokens ( ) ) { green = Integer . parseInt ( items . nextT... | Parsers a String in the form x y z into an SWT RGB class . |
2,512 | public ResourceHandle getResource ( URL source , String name ) { return getResource ( source , name , new HashSet < > ( ) , null ) ; } | Gets resource with given name at the given source URL . If the URL points to a directory the name is the file path relative to this directory . If the URL points to a JAR file the name identifies an entry in that JAR file . If the URL points to a JAR file the resource is not found in that JAR file and the JAR file has ... |
2,513 | public ResourceHandle getResource ( URL [ ] sources , String name ) { Set < URL > visited = new HashSet < > ( ) ; for ( URL source : sources ) { ResourceHandle h = getResource ( source , name , visited , null ) ; if ( h != null ) { return h ; } } return null ; } | Gets resource with given name at the given search path . The path is searched iteratively one URL at a time . If the URL points to a directory the name is the file path relative to this directory . If the URL points to the JAR file the name identifies an entry in that JAR file . If the URL points to the JAR file the re... |
2,514 | public URL findResource ( URL source , String name ) { return findResource ( source , name , new HashSet < > ( ) , null ) ; } | Fined resource with given name at the given source URL . If the URL points to a directory the name is the file path relative to this directory . If the URL points to a JAR file the name identifies an entry in that JAR file . If the URL points to a JAR file the resource is not found in that JAR file and the JAR file has... |
2,515 | public URL findResource ( URL [ ] sources , String name ) { Set < URL > visited = new HashSet < > ( ) ; for ( URL source : sources ) { URL url = findResource ( source , name , visited , null ) ; if ( url != null ) { return url ; } } return null ; } | Finds resource with given name at the given search path . The path is searched iteratively one URL at a time . If the URL points to a directory the name is the file path relative to this directory . If the URL points to the JAR file the name identifies an entry in that JAR file . If the URL points to the JAR file the r... |
2,516 | public static String toAlphaNumeric ( String text ) { if ( isEmpty ( text ) ) { return text ; } return stripAccents ( text ) . replaceAll ( "[^a-zA-Z0-9]" , "" ) ; } | Removes all non alpha numerical characters from the passed text . First tries to convert diacritics to their alpha numeric representation . |
2,517 | public static List < X509GeneralName > getX509GeneralNames ( GeneralNames genNames ) { if ( genNames == null ) { return null ; } GeneralName [ ] names = genNames . getNames ( ) ; List < X509GeneralName > x509names = new ArrayList < X509GeneralName > ( names . length ) ; for ( GeneralName name : names ) { switch ( name ... | Convert general names from Bouncy Castle general names . |
2,518 | public static EnumSet < KeyUsage > getSetOfKeyUsage ( org . bouncycastle . asn1 . x509 . KeyUsage keyUsage ) { if ( keyUsage == null ) { return null ; } Collection < KeyUsage > usages = new ArrayList < KeyUsage > ( ) ; for ( KeyUsage usage : KeyUsage . values ( ) ) { if ( ( ( ( DERBitString ) keyUsage . toASN1Primitive... | Convert usages from Bouncy Castle . |
2,519 | public static ExtendedKeyUsages getExtendedKeyUsages ( ExtendedKeyUsage usages ) { if ( usages == null ) { return null ; } List < String > usageStr = new ArrayList < String > ( ) ; for ( KeyPurposeId keyPurposeId : usages . getUsages ( ) ) { usageStr . add ( keyPurposeId . getId ( ) ) ; } return new ExtendedKeyUsages (... | Convert extended usages from Bouncy Castle . |
2,520 | public static GeneralNames getGeneralNames ( X509GeneralName [ ] genNames ) { GeneralName [ ] names = new GeneralName [ genNames . length ] ; int i = 0 ; for ( X509GeneralName name : genNames ) { if ( name instanceof BcGeneralName ) { names [ i ++ ] = ( ( BcGeneralName ) name ) . getGeneralName ( ) ; } else { throw new... | Convert a collection of X . 509 general names to Bouncy Castle general names . |
2,521 | public static org . bouncycastle . asn1 . x509 . KeyUsage getKeyUsage ( EnumSet < KeyUsage > usages ) { int bitmask = 0 ; for ( KeyUsage usage : usages ) { bitmask |= usage . value ( ) ; } return new org . bouncycastle . asn1 . x509 . KeyUsage ( bitmask ) ; } | Convert a set of key usages to Bouncy Castle key usage . |
2,522 | public static ExtendedKeyUsage getExtendedKeyUsage ( Set < String > usages ) { KeyPurposeId [ ] keyUsages = new KeyPurposeId [ usages . size ( ) ] ; int i = 0 ; for ( String usage : usages ) { keyUsages [ i ++ ] = KeyPurposeId . getInstance ( new ASN1ObjectIdentifier ( usage ) ) ; } return new ExtendedKeyUsage ( keyUsa... | Convert a set of extended key usages to Bouncy Castle extended key usage . |
2,523 | public void initialize ( ClassLoader classLoader ) { ComponentAnnotationLoader loader = new ComponentAnnotationLoader ( ) ; loader . initialize ( this , classLoader ) ; try { List < ComponentManagerInitializer > initializers = this . getInstanceList ( ComponentManagerInitializer . class ) ; for ( ComponentManagerInitia... | Load all component annotations and register them as components . |
2,524 | private Attributes getAttributes ( StartElement event ) { AttributesImpl attrs = new AttributesImpl ( ) ; if ( ! event . isStartElement ( ) ) { throw new InternalError ( "getAttributes() attempting to process: " + event ) ; } if ( this . filter . getNamespacePrefixes ( ) ) { for ( @ SuppressWarnings ( "unchecked" ) Ite... | Get the attributes associated with the given START_ELEMENT StAXevent . |
2,525 | protected TreeMarshaller createMarshallingContext ( HierarchicalStreamWriter writer , ConverterLookup converterLookup , Mapper mapper ) { return new SafeTreeMarshaller ( writer , converterLookup , mapper , RELATIVE ) ; } | If anything goes wrong with an element don t serialize it |
2,526 | public Map < String , List < String > > parseQuery ( String query ) { Map < String , List < String > > queryParams = new LinkedHashMap < > ( ) ; if ( query != null ) { for ( NameValuePair params : URLEncodedUtils . parse ( query , StandardCharsets . UTF_8 ) ) { String name = params . getName ( ) ; List < String > value... | Parse a query string into a map of key - value pairs . |
2,527 | public static boolean sendEndEvent ( Object filter , FilterDescriptor descriptor , String id , FilterEventParameters parameters ) throws FilterException { FilterElementDescriptor elementDescriptor = descriptor . getElement ( id ) ; if ( elementDescriptor != null && elementDescriptor . getEndMethod ( ) != null ) { sendE... | Call passed end event if possible . |
2,528 | public static boolean sendOnEvent ( Object filter , FilterDescriptor descriptor , String id , FilterEventParameters parameters ) throws FilterException { FilterElementDescriptor elementDescriptor = descriptor . getElement ( id ) ; if ( elementDescriptor != null && elementDescriptor . getOnMethod ( ) != null ) { sendEve... | Call passed on event if possible . |
2,529 | private void onEventListenerComponentAdded ( ComponentDescriptorAddedEvent event , ComponentManager componentManager , ComponentDescriptor < EventListener > descriptor ) { try { EventListener eventListener = componentManager . getInstance ( EventListener . class , event . getRoleHint ( ) ) ; if ( getListener ( eventLis... | An Event Listener Component has been dynamically registered in the system add it to our cache . |
2,530 | private void onEventListenerComponentRemoved ( ComponentDescriptorRemovedEvent event , ComponentManager componentManager , ComponentDescriptor < ? > descriptor ) { EventListener removedEventListener = null ; for ( EventListener eventListener : getListenersByName ( ) . values ( ) ) { if ( eventListener . getClass ( ) ==... | An Event Listener Component has been dynamically unregistered in the system remove it from our cache . |
2,531 | protected org . bouncycastle . crypto . CipherParameters getBcCipherParameter ( AsymmetricCipherParameters parameters ) { if ( parameters instanceof BcAsymmetricKeyParameters ) { return ( ( BcAsymmetricKeyParameters ) parameters ) . getParameters ( ) ; } throw new UnsupportedOperationException ( "Cipher parameters are ... | Convert cipher parameters to Bouncy Castle equivalent . |
2,532 | public int getDirective ( char [ ] array , int currentIndex , StringBuffer velocityBlock , VelocityParserContext context ) throws InvalidVelocityException { int i = currentIndex + 1 ; StringBuffer directiveNameBuffer = new StringBuffer ( ) ; i = getDirectiveName ( array , i , directiveNameBuffer , null , context ) ; St... | Get any valid Velocity block starting with a sharp character except comments . |
2,533 | public int getVelocityIdentifier ( char [ ] array , int currentIndex , StringBuffer velocityBlock , VelocityParserContext context ) throws InvalidVelocityException { if ( ! Character . isLetter ( array [ currentIndex ] ) ) { throw new InvalidVelocityException ( ) ; } int i = currentIndex + 1 ; while ( i < array . lengt... | Get a valid Velocity identifier used for variable of macro . |
2,534 | public int getTableElement ( char [ ] array , int currentIndex , StringBuffer velocityBlock , VelocityParserContext context ) { return getParameters ( array , currentIndex , velocityBlock , ']' , context ) ; } | Get a Velocity table . |
2,535 | protected boolean tryInstallExtension ( ExtensionId extensionId , String namespace ) { DefaultExtensionPlanTree currentTree = this . extensionTree . clone ( ) ; try { installExtension ( extensionId , namespace , currentTree ) ; setExtensionTree ( currentTree ) ; return true ; } catch ( InstallException e ) { if ( getRe... | Try to install the provided extension and update the plan if it s working . |
2,536 | public static String encode ( String str ) { String encoded ; try { encoded = URLEncoder . encode ( str , "UTF-8" ) . replace ( "." , "%2E" ) . replace ( "*" , "%2A" ) ; } catch ( UnsupportedEncodingException e ) { encoded = str ; } return encoded ; } | Protect passed String to work with as much filesystems as possible . |
2,537 | public static boolean isWebjar ( Extension extension ) { if ( extension . getType ( ) . equals ( WEBJAR ) ) { return true ; } if ( StringUtils . startsWithAny ( extension . getId ( ) . getId ( ) , "org.webjars:" , "org.webjars." ) ) { return true ; } if ( JarExtensionHandler . WEBJAR . equals ( extension . getProperty ... | Find of the passes extension if a webjar . |
2,538 | private ExtensionHandler getExtensionHandler ( LocalExtension localExtension ) throws ComponentLookupException { return this . componentManager . getInstance ( ExtensionHandler . class , localExtension . getType ( ) . toLowerCase ( ) ) ; } | Get the handler corresponding to the provided extension . |
2,539 | public static boolean matches ( Pattern patternMatcher , Collection < Filter > filters , Extension extension ) { if ( matches ( patternMatcher , extension . getId ( ) . getId ( ) , extension . getDescription ( ) , extension . getSummary ( ) , extension . getName ( ) , ExtensionIdConverter . toStringList ( extension . g... | Matches an extension in a case insensitive way . |
2,540 | public static boolean matches ( Collection < Filter > filters , Extension extension ) { if ( filters != null ) { for ( Filter filter : filters ) { if ( ! matches ( filter , extension ) ) { return false ; } } } return true ; } | Make sure the passed extension matches all filters . |
2,541 | public static boolean matches ( Pattern patternMatcher , Object ... elements ) { if ( patternMatcher == null ) { return true ; } for ( Object element : elements ) { if ( matches ( patternMatcher , element ) ) { return true ; } } return false ; } | Matches a set of elements in a case insensitive way . |
2,542 | public static void sort ( List < ? extends Extension > extensions , Collection < SortClause > sortClauses ) { Collections . sort ( extensions , new SortClauseComparator ( sortClauses ) ) ; } | Sort the passed extensions list based on the passed sort clauses . |
2,543 | public static < E extends Extension > IterableResult < E > appendSearchResults ( IterableResult < E > previousSearchResult , IterableResult < E > result ) { AggregatedIterableResult < E > newResult ; if ( previousSearchResult instanceof AggregatedIterableResult ) { newResult = ( ( AggregatedIterableResult < E > ) previ... | Merge provided search results . |
2,544 | public static IterableResult < Extension > search ( ExtensionQuery query , Iterable < ExtensionRepository > repositories ) throws SearchException { IterableResult < Extension > searchResult = null ; int currentOffset = query . getOffset ( ) > 0 ? query . getOffset ( ) : 0 ; int currentNb = query . getLimit ( ) ; for ( ... | Search passed repositories based of the provided query . |
2,545 | public static IterableResult < Extension > search ( ExtensionRepository repository , ExtensionQuery query , IterableResult < Extension > previousSearchResult ) throws SearchException { IterableResult < Extension > result ; if ( repository instanceof Searchable ) { if ( repository instanceof AdvancedSearchable ) { Advan... | Search one repository . |
2,546 | private < E , F > void displayInlineDiff ( UnifiedDiffElement < E , F > previous , UnifiedDiffElement < E , F > next , UnifiedDiffConfiguration < E , F > config ) { try { List < F > previousSubElements = config . getSplitter ( ) . split ( previous . getValue ( ) ) ; List < F > nextSubElements = config . getSplitter ( )... | Computes the changes between two versions of an element by splitting the element into sub - elements and displays the result using the in - line format . |
2,547 | protected List < Element > filterChildren ( Element parent , String tagName ) { List < Element > result = new ArrayList < Element > ( ) ; Node current = parent . getFirstChild ( ) ; while ( current != null ) { if ( current . getNodeName ( ) . equals ( tagName ) ) { result . add ( ( Element ) current ) ; } current = cur... | Utility method for filtering an element s children with a tagName . |
2,548 | protected List < Element > filterDescendants ( Element parent , String [ ] tagNames ) { List < Element > result = new ArrayList < Element > ( ) ; for ( String tagName : tagNames ) { NodeList nodes = parent . getElementsByTagName ( tagName ) ; for ( int i = 0 ; i < nodes . getLength ( ) ; i ++ ) { Element element = ( El... | Utility method for filtering an element s descendants by their tag names . |
2,549 | protected boolean hasAttribute ( List < Element > elements , String attributeName , boolean checkValue ) { boolean hasAttribute = true ; if ( ! checkValue ) { for ( Element e : elements ) { hasAttribute = e . hasAttribute ( attributeName ) ? hasAttribute : false ; } } else { String attributeValue = null ; for ( Element... | Utility method for checking if a list of elements have the same attribute set . If the checkValue is true the values of the given attribute will be checked for equivalency . |
2,550 | protected void moveChildren ( Element parent , Element destination ) { NodeList children = parent . getChildNodes ( ) ; while ( children . getLength ( ) > 0 ) { destination . appendChild ( parent . removeChild ( parent . getFirstChild ( ) ) ) ; } } | Moves all child elements of the parent into destination element . |
2,551 | static org . bouncycastle . crypto . params . DHParameters getDhParameters ( SecureRandom random , DHKeyParametersGenerationParameters params ) { DHParametersGenerator paramGen = new DHParametersGenerator ( ) ; paramGen . init ( params . getStrength ( ) * 8 , params . getCertainty ( ) , random ) ; return paramGen . gen... | Generate DH parameters . |
2,552 | private DefaultLocalExtension loadDescriptor ( File descriptor ) throws InvalidExtensionException { FileInputStream fis ; try { fis = new FileInputStream ( descriptor ) ; } catch ( FileNotFoundException e ) { throw new InvalidExtensionException ( "Failed to open descriptor for reading" , e ) ; } try { DefaultLocalExten... | Local extension descriptor from a file . |
2,553 | private String getFilePath ( ExtensionId id , String fileExtension ) { String encodedId = PathUtils . encode ( id . getId ( ) ) ; String encodedVersion = PathUtils . encode ( id . getVersion ( ) . toString ( ) ) ; String encodedType = PathUtils . encode ( fileExtension ) ; return encodedId + File . separator + encodedV... | Get file path in the local extension repository . |
2,554 | public void removeExtension ( DefaultLocalExtension extension ) throws IOException { File descriptorFile = extension . getDescriptorFile ( ) ; if ( descriptorFile == null ) { throw new IOException ( "Exception does not exists" ) ; } descriptorFile . delete ( ) ; DefaultLocalExtensionFile extensionFile = extension . get... | Remove extension from storage . |
2,555 | private void parse ( ) { this . elements = new ArrayList < > ( ) ; try { for ( Tokenizer tokenizer = new Tokenizer ( this . rawVersion ) ; tokenizer . next ( ) ; ) { Element element = new Element ( tokenizer ) ; this . elements . add ( element ) ; if ( element . getVersionType ( ) != Type . STABLE ) { this . type = ele... | Parse the string representation of the version into separated elements . |
2,556 | private static void trimPadding ( List < Element > elements ) { for ( ListIterator < Element > it = elements . listIterator ( elements . size ( ) ) ; it . hasPrevious ( ) ; ) { Element element = it . previous ( ) ; if ( element . compareTo ( null ) == 0 ) { it . remove ( ) ; } else { break ; } } } | Remove empty elements . |
2,557 | private static int comparePadding ( List < Element > elements , int index , Boolean number ) { int rel = 0 ; for ( Iterator < Element > it = elements . listIterator ( index ) ; it . hasNext ( ) ; ) { Element element = it . next ( ) ; if ( number != null && number . booleanValue ( ) != element . isNumber ( ) ) { break ;... | Compare the end of the version with 0 . |
2,558 | public static Collection < String > importProperty ( MutableExtension extension , String propertySuffix , Collection < String > def ) { Object obj = importProperty ( extension , propertySuffix ) ; if ( obj == null ) { return def ; } else if ( obj instanceof Collection ) { return ( Collection ) obj ; } else if ( obj ins... | Delete and return the value of the passed special property as a Collection of Strings . |
2,559 | protected void sendEntryAddedEvent ( CacheEntryEvent < T > event ) { for ( org . xwiki . cache . event . CacheEntryListener < T > listener : this . cacheEntryListeners . getListeners ( org . xwiki . cache . event . CacheEntryListener . class ) ) { listener . cacheEntryAdded ( event ) ; } } | Helper method to send event when a new cache entry is inserted . |
2,560 | protected void sendEntryRemovedEvent ( CacheEntryEvent < T > event ) { for ( org . xwiki . cache . event . CacheEntryListener < T > listener : this . cacheEntryListeners . getListeners ( org . xwiki . cache . event . CacheEntryListener . class ) ) { listener . cacheEntryRemoved ( event ) ; } disposeCacheValue ( event .... | Helper method to send event when an existing cache entry is removed . |
2,561 | protected void sendEntryModifiedEvent ( CacheEntryEvent < T > event ) { for ( org . xwiki . cache . event . CacheEntryListener < T > listener : this . cacheEntryListeners . getListeners ( org . xwiki . cache . event . CacheEntryListener . class ) ) { listener . cacheEntryModified ( event ) ; } } | Helper method to send event when a cache entry is modified . |
2,562 | protected void disposeCacheValue ( T value ) { if ( value instanceof DisposableCacheValue ) { try { ( ( DisposableCacheValue ) value ) . dispose ( ) ; } catch ( Throwable e ) { LOGGER . warn ( "Error when trying to dispose a cache object of cache [{}]" , this . configuration != null ? this . configuration . getConfigur... | Dispose the value being removed from the cache . |
2,563 | public X509ExtensionBuilder addExtension ( ASN1ObjectIdentifier oid , boolean critical , ASN1Encodable value ) { try { this . extensions . addExtension ( oid , critical , value . toASN1Primitive ( ) . getEncoded ( ASN1Encoding . DER ) ) ; } catch ( IOException e ) { throw new IllegalArgumentException ( "Invalid extensi... | Add an extension . |
2,564 | public Version getVersion ( String rawVersion ) { Version version = this . versions . get ( rawVersion ) ; if ( version == null ) { version = new DefaultVersion ( rawVersion ) ; this . versions . put ( rawVersion , version ) ; } return version ; } | Store and return a weak reference equals to the passed version . |
2,565 | public VersionConstraint getVersionConstraint ( String rawConstraint ) { VersionConstraint constraint = this . versionConstrains . get ( rawConstraint ) ; if ( constraint == null ) { constraint = new DefaultVersionConstraint ( rawConstraint ) ; this . versionConstrains . put ( rawConstraint , constraint ) ; } return co... | Store and return a weak reference equals to the passed version constraint . |
2,566 | protected void extendsTBSCertificate ( BcX509TBSCertificateBuilder builder , CertifiedPublicKey issuer , PrincipalIndentifier subjectName , PublicKeyParameters subject , X509CertificateParameters parameters ) throws IOException { } | Extend TBS certificate depending of certificate version . |
2,567 | public TBSCertificate buildTBSCertificate ( PrincipalIndentifier subjectName , PublicKeyParameters subject , X509CertificateParameters parameters ) throws IOException { PrincipalIndentifier issuerName ; CertifiedPublicKey issuer = null ; if ( this . signer instanceof CertifyingSigner ) { issuer = ( ( CertifyingSigner )... | Build the TBS Certificate . |
2,568 | private void runInitializers ( ExecutionContext context ) throws ExecutionContextException { for ( ExecutionContextInitializer initializer : this . initializerProvider . get ( ) ) { initializer . initialize ( context ) ; } } | Run the initializers . |
2,569 | private Class < ? > getFieldRole ( Field field , Requirement requirement ) { Class < ? > role ; if ( isDependencyOfListType ( field . getType ( ) ) ) { role = getGenericRole ( field ) ; } else { role = field . getType ( ) ; } return role ; } | Extract component role from the field to inject . |
2,570 | private void openTag ( String qName , Attributes atts ) { this . result . append ( '<' ) . append ( qName ) ; for ( int i = 0 ; i < atts . getLength ( ) ; i ++ ) { this . result . append ( ' ' ) . append ( atts . getQName ( i ) ) . append ( "=\"" ) . append ( atts . getValue ( i ) ) . append ( '\"' ) ; } this . result ... | Append an open tag with the given specification to the result buffer . |
2,571 | private void checkValue ( Object value ) { if ( this . nonNull && value == null ) { throw new IllegalArgumentException ( String . format ( "The property [%s] may not be null!" , getKey ( ) ) ) ; } if ( getType ( ) != null && value != null && ! getType ( ) . isAssignableFrom ( value . getClass ( ) ) ) { throw new Illega... | Check that the value is compatible with the configure constraints . |
2,572 | protected static int [ ] newKeySizeArray ( int minSize , int maxSize , int step ) { int [ ] result = new int [ ( ( maxSize - minSize ) / step ) + 1 ] ; for ( int i = minSize , j = 0 ; i <= maxSize ; i += step , j ++ ) { result [ j ] = i ; } return result ; } | Helper function to create supported key size arrays . |
2,573 | public BcX509v3TBSCertificateBuilder setExtensions ( CertifiedPublicKey issuer , PublicKeyParameters subject , X509Extensions extensions1 , X509Extensions extensions2 ) throws IOException { DefaultX509ExtensionBuilder extBuilder = new DefaultX509ExtensionBuilder ( ) ; extBuilder . addAuthorityKeyIdentifier ( issuer ) .... | Set the extensions of a v3 certificate . |
2,574 | public < E > List < E > unmodifiable ( List < E > input ) { if ( input == null ) { return null ; } return Collections . unmodifiableList ( input ) ; } | Returns an unmodifiable view of the specified list . |
2,575 | public < K , V > Map < K , V > unmodifiable ( Map < K , V > input ) { if ( input == null ) { return null ; } return Collections . unmodifiableMap ( input ) ; } | Returns an unmodifiable view of the specified map . |
2,576 | public < E > Set < E > unmodifiable ( Set < E > input ) { if ( input == null ) { return null ; } return Collections . unmodifiableSet ( input ) ; } | Returns an unmodifiable view of the specified set . |
2,577 | public < E > Collection < E > unmodifiable ( Collection < E > input ) { if ( input == null ) { return null ; } return Collections . unmodifiableCollection ( input ) ; } | Returns an unmodifiable view of the specified collection . |
2,578 | public < E > boolean reverse ( List < E > input ) { if ( input == null ) { return false ; } try { Collections . reverse ( input ) ; return true ; } catch ( UnsupportedOperationException ex ) { return false ; } } | Reverse the order of the elements within a list so that the last element is moved to the beginning of the list the next - to - last element to the second position and so on . The input list is modified in place so this operation will succeed only if the list is modifiable . |
2,579 | public < E extends Comparable < E > > boolean sort ( List < E > input ) { if ( input == null ) { return false ; } try { Collections . sort ( input ) ; return true ; } catch ( UnsupportedOperationException ex ) { return false ; } } | Sort the elements within a list according to their natural order . The input list is modified in place so this operation will succeed only if the list is modifiable . |
2,580 | private < E > boolean isFullyModified ( List commonAncestor , Patch < E > patchCurrent ) { return patchCurrent . size ( ) == 1 && commonAncestor . size ( ) == patchCurrent . get ( 0 ) . getPrevious ( ) . size ( ) ; } | Check if the content is completely different between the ancestor and the current version |
2,581 | public Iterator getIterator ( Object obj , Info i ) throws Exception { if ( obj != null ) { SecureIntrospectorControl sic = ( SecureIntrospectorControl ) this . introspector ; if ( sic . checkObjectExecutePermission ( obj . getClass ( ) , null ) ) { return super . getIterator ( obj , i ) ; } else { this . log . warn ( ... | Get an iterator from the given object . Since the superclass method this secure version checks for execute permission . |
2,582 | protected void unpackXARToOutputDirectory ( Artifact artifact , String [ ] includes , String [ ] excludes ) throws MojoExecutionException { if ( ! this . outputBuildDirectory . exists ( ) ) { this . outputBuildDirectory . mkdirs ( ) ; } File file = artifact . getFile ( ) ; unpack ( file , this . outputBuildDirectory , ... | Unpacks A XAR artifacts into the build output directory along with the project s XAR files . |
2,583 | protected Set < Artifact > resolveArtifactDependencies ( Artifact artifact ) throws ArtifactResolutionException , ArtifactNotFoundException , ProjectBuildingException { Artifact pomArtifact = this . factory . createArtifact ( artifact . getGroupId ( ) , artifact . getArtifactId ( ) , artifact . getVersion ( ) , "" , "p... | This method resolves all transitive dependencies of an artifact . |
2,584 | protected XWikiDocument getDocFromXML ( File file ) throws MojoExecutionException { XWikiDocument doc ; try { doc = new XWikiDocument ( ) ; doc . fromXML ( file ) ; } catch ( Exception e ) { throw new MojoExecutionException ( String . format ( "Failed to parse [%s]." , file . getAbsolutePath ( ) ) , e ) ; } return doc ... | Load a XWiki document from its XML representation . |
2,585 | private void repair ( ) throws IOException { File folder = this . configuration . getStorage ( ) ; if ( folder . exists ( ) ) { if ( ! folder . isDirectory ( ) ) { throw new IOException ( "Not a directory: " + folder ) ; } repairFolder ( folder ) ; } } | Load jobs from directory . |
2,586 | public void runJob ( ) { try { this . currentJob = this . jobQueue . take ( ) ; ExecutionContext context = new ExecutionContext ( ) ; try { this . executionContextManager . initialize ( context ) ; } catch ( ExecutionContextException e ) { throw new RuntimeException ( "Failed to initialize Job " + this . currentJob + "... | Execute one job . |
2,587 | private void initRepositoryFeatures ( ) { if ( this . repositoryVersion == null ) { this . repositoryVersion = new DefaultVersion ( Resources . VERSION10 ) ; this . filterable = false ; this . sortable = false ; CloseableHttpResponse response ; try { response = getRESTResource ( this . rootUriBuider ) ; } catch ( IOExc... | Check what is supported by the remote repository . |
2,588 | public void fromXML ( Document domdoc ) throws DocumentException { this . encoding = domdoc . getXMLEncoding ( ) ; Element rootElement = domdoc . getRootElement ( ) ; this . reference = readDocumentReference ( domdoc ) ; this . locale = rootElement . attributeValue ( "locale" ) ; if ( this . locale == null ) { this . l... | Parse XML document to extract document information . |
2,589 | public static String readElement ( Element rootElement , String elementName ) throws DocumentException { String result = null ; Element element = rootElement . element ( elementName ) ; if ( element != null ) { if ( ! element . isTextOnly ( ) ) { throw new DocumentException ( "Unexpected non-text content found in eleme... | Read an element from the XML . |
2,590 | public static X509CertificateHolder getX509CertificateHolder ( CertifiedPublicKey cert ) { if ( cert instanceof BcX509CertifiedPublicKey ) { return ( ( BcX509CertifiedPublicKey ) cert ) . getX509CertificateHolder ( ) ; } else { try { return new X509CertificateHolder ( cert . getEncoded ( ) ) ; } catch ( IOException e )... | Convert certified public key to certificate holder . |
2,591 | public static AsymmetricKeyParameter getAsymmetricKeyParameter ( PublicKeyParameters publicKey ) { if ( publicKey instanceof BcAsymmetricKeyParameters ) { return ( ( BcAsymmetricKeyParameters ) publicKey ) . getParameters ( ) ; } else { try { return PublicKeyFactory . createKey ( publicKey . getEncoded ( ) ) ; } catch ... | Convert public key parameters to asymmetric key parameter . |
2,592 | public static SubjectPublicKeyInfo getSubjectPublicKeyInfo ( PublicKeyParameters publicKey ) { try { if ( publicKey instanceof BcPublicKeyParameters ) { return ( ( BcPublicKeyParameters ) publicKey ) . getSubjectPublicKeyInfo ( ) ; } else { return SubjectPublicKeyInfoFactory . createSubjectPublicKeyInfo ( getAsymmetric... | Convert public key parameter to subject public key info . |
2,593 | public static X509CertificateHolder getX509CertificateHolder ( TBSCertificate tbsCert , byte [ ] signature ) { ASN1EncodableVector v = new ASN1EncodableVector ( ) ; v . add ( tbsCert ) ; v . add ( tbsCert . getSignature ( ) ) ; v . add ( new DERBitString ( signature ) ) ; return new X509CertificateHolder ( Certificate ... | Build the structure of an X . 509 certificate . |
2,594 | public static boolean isAlgorithlIdentifierEqual ( AlgorithmIdentifier id1 , AlgorithmIdentifier id2 ) { if ( ! id1 . getAlgorithm ( ) . equals ( id2 . getAlgorithm ( ) ) ) { return false ; } if ( id1 . getParameters ( ) == null ) { return ! ( id2 . getParameters ( ) != null && ! id2 . getParameters ( ) . equals ( DERN... | Compare two algorithm identifier . |
2,595 | public static Signer updateDEREncodedObject ( Signer signer , ASN1Encodable tbsObj ) throws IOException { OutputStream sOut = signer . getOutputStream ( ) ; DEROutputStream dOut = new DEROutputStream ( sOut ) ; dOut . writeObject ( tbsObj ) ; sOut . close ( ) ; return signer ; } | DER encode an ASN . 1 object into the given signer and return the signer . |
2,596 | public static X500Name getX500Name ( PrincipalIndentifier principal ) { if ( principal instanceof BcPrincipalIdentifier ) { return ( ( BcPrincipalIdentifier ) principal ) . getX500Name ( ) ; } else { return new X500Name ( principal . getName ( ) ) ; } } | Convert principal identifier to X . 500 name . |
2,597 | public static AlgorithmIdentifier getSignerAlgoritmIdentifier ( Signer signer ) { if ( signer instanceof ContentSigner ) { return ( ( ContentSigner ) signer ) . getAlgorithmIdentifier ( ) ; } else { return AlgorithmIdentifier . getInstance ( signer . getEncoded ( ) ) ; } } | Get the algorithm identifier of a signer . |
2,598 | public static CertifiedPublicKey convertCertificate ( CertificateFactory certFactory , X509CertificateHolder cert ) { if ( cert == null ) { return null ; } if ( certFactory instanceof BcX509CertificateFactory ) { return ( ( BcX509CertificateFactory ) certFactory ) . convert ( cert ) ; } else { try { return certFactory ... | Convert a Bouncy Castle certificate holder into a certified public key . |
2,599 | protected void addCachedExtension ( E extension ) { if ( ! this . extensions . containsKey ( extension . getId ( ) ) ) { this . extensions . put ( extension . getId ( ) , extension ) ; addCachedExtensionVersion ( extension . getId ( ) . getId ( ) , extension ) ; if ( ! this . strictId ) { for ( String feature : extensi... | Register a new extension . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.