code
stringlengths
73
34.1k
label
stringclasses
1 value
private void tryToEliminateTheScope() { for( int i = 0; i < _statements.length; i++ ) { Statement statement = _statements[i]; if( statement instanceof VarStatement || (!(statement instanceof StatementList) && statement.getContainedParsedElementsByType( EvalExpression.class, nu...
java
public static String escapeAttribute( String string ) { if( string == null || string.length() == 0 ) { return string; } StringBuilder resultBuffer = null; for( int i = 0, length = string.length(); i < length; i++ ) { String entity = null; char ch = string.charAt( i ); s...
java
public static Map<String, ISettings> makeDefaultSettings( Experiment experiment ) { Map<String, ISettings> settings = new TreeMap<>(); CompilerSettings compilerSettings = new CompilerSettings(); compilerSettings.resetToDefaultSettings( experiment ); settings.put( compilerSettings.getPath(), compilerS...
java
public static Map<String, ISettings> makeDefaultSettings() { Map<String, ISettings> settings = new TreeMap<>(); AppearanceSettings appearanceSettings = new AppearanceSettings(); appearanceSettings.resetToDefaultSettings( null ); settings.put( appearanceSettings.getPath(), appearanceSettings ); r...
java
public static Map<String, ISettings> mergeSettings( Map<String, ISettings> old, Experiment experiment ) { Map<String, ISettings> defaultSettings = makeDefaultSettings( experiment ); old.keySet().forEach( key -> defaultSettings.put( key, old.get( key ) ) ); return defaultSettings; }
java
public void setSrcdir(Path srcDir) { if (_src == null) { _src = srcDir; } else { _src.append(srcDir); } }
java
public Curve25519KeyPair generateKeyPair() { byte[] privateKey = provider.generatePrivateKey(); byte[] publicKey = provider.generatePublicKey(privateKey); return new Curve25519KeyPair(publicKey, privateKey); }
java
public byte[] calculateAgreement(byte[] publicKey, byte[] privateKey) { if (publicKey == null || privateKey == null) { throw new IllegalArgumentException("Keys must not be null!"); } if (publicKey.length != 32 || privateKey.length != 32) { throw new IllegalArgumentException("Keys must be 32 byt...
java
public boolean verifySignature(byte[] publicKey, byte[] message, byte[] signature) { if (publicKey == null || publicKey.length != 32) { throw new IllegalArgumentException("Invalid public key!"); } if (message == null || signature == null || signature.length != 64) { return false; } ret...
java
public byte[] calculateVrfSignature(byte[] privateKey, byte[] message) { if (privateKey == null || privateKey.length != 32) { throw new IllegalArgumentException("Invalid private key!"); } byte[] random = provider.getRandom(64); return provider.calculateVrfSignature(random, privateKey, message); ...
java
public byte[] verifyVrfSignature(byte[] publicKey, byte[] message, byte[] signature) throws VrfSignatureVerificationFailedException { if (publicKey == null || publicKey.length != 32) { throw new IllegalArgumentException("Invalid public key!"); } if (message == null || signature == null || sig...
java
private Record setDefault(Record record) { int size = record.size(); for (int i = 0; i < size; i++) if (record.get(i) == null) { @SuppressWarnings("unchecked") Field<Object> field = (Field<Object>) record.field(i); if (!field.getDataType().null...
java
protected Object convertToAsyncDriverTypes(Object object){ if(object instanceof Enum){ return ((Enum)object).name(); }else if(object instanceof LocalDateTime){ LocalDateTime convert = (LocalDateTime) object; return new org.joda.time.LocalDateTime(convert.getYear(),con...
java
@Override public void sql(BindingSQLContext<JsonArray> ctx) { // Depending on how you generate your SQL, you may need to explicitly distinguish // between jOOQ generating bind variables or inlined literals. If so, use this check: // ctx.render().paramType() == INLINED RenderContext c...
java
@Override public void register(BindingRegisterContext<JsonArray> ctx) throws SQLException { ctx.statement().registerOutParameter(ctx.index(), Types.VARCHAR); }
java
@Override public void set(BindingSetStatementContext<JsonArray> ctx) throws SQLException { ctx.statement().setString(ctx.index(), Objects.toString(ctx.convert(converter()).value(), null)); }
java
@Override public void get(BindingGetResultSetContext<JsonArray> ctx) throws SQLException { ctx.convert(converter()).value(ctx.resultSet().getString(ctx.index())); }
java
protected Collection<JavaWriter> writeExtraData(SchemaDefinition definition, Function<File,JavaWriter> writerGenerator){ return Collections.emptyList(); }
java
@Override protected void generateDao(TableDefinition table, JavaWriter out1) { UniqueKeyDefinition key = table.getPrimaryKey(); if (key == null) { logger.info("Skipping DAO generation", out1.file().getName()); return; } VertxJavaWriter out = (VertxJavaWriter) ...
java
@Override public void get(BindingGetStatementContext<JsonObject> ctx) throws SQLException { ctx.convert(converter()).value(ctx.statement().getString(ctx.index())); }
java
boolean startsWith(final Literal literal) { // Check whether the answer is already in the cache final int index = literal.getIndex(); final Boolean cached = myPrefixCache.get(index); if (cached != null) { return cached.booleanValue(); } // Get the answer and...
java
boolean endsWith(final Literal literal) { // Check whether the answer is already in the cache final int index = literal.getIndex(); final Boolean cached = myPostfixCache.get(index); if (cached != null) { return cached.booleanValue(); } // Get the answer and ...
java
int[] getIndices(final Literal literal) { // Check whether the answer is already in the cache final int index = literal.getIndex(); final int[] cached = myIndices[index]; if (cached != null) { return cached; } // Find all indices final int[] values =...
java
private int[] findIndices(final Literal literal) { int count = 0; final char s = literal.getFirstChar(); for (int i = 0; i < myChars.length; i++) { // Check the first char for better performance and check the complete string if ((myChars[i] == s || s == '?') && literal....
java
boolean matches(final char[] value, final int from) { // Check the bounds final int len = myCharacters.length; if (len + from > value.length || from < 0) { return false; } // Bounds are ok, check all characters. // Allow question marks to match any character...
java
boolean requires(final String value) { if (requires(myPrefix, value) || requires(myPostfix, value)) { return true; } if (mySuffixes == null) { return false; } for (final Literal suffix : mySuffixes) { if (requires(suffix, value)) { ...
java
private static int checkWildCard(final SearchableString value, final Literal suffix, final int start) { for (final int index : value.getIndices(suffix)) { if (index >= start) { return index; } } return -1; }
java
String getPattern() { final StringBuilder result = new StringBuilder(); if (myPrefix != null) { result.append(myPrefix); } if (mySuffixes != null) { result.append("*"); for (final Literal sub : mySuffixes) { result.append(sub); ...
java
static Rule[] getOrderedRules(final Rule[] rules) { final Comparator<Rule> c = Comparator.comparing(Rule::getSize).reversed().thenComparing(Rule::getPattern); final Rule[] result = Arrays.copyOf(rules, rules.length); parallelSort(result, c); return result; }
java
public static UserAgentParser parse(final Reader input, final Collection<BrowsCapField> fields) throws IOException, ParseException { return new UserAgentFileParser(fields).parse(input); }
java
public UserAgentParser loadParser() throws IOException, ParseException { // Use all default fields final Set<BrowsCapField> defaultFields = Stream.of(BrowsCapField.values()).filter(BrowsCapField::isDefault).collect(toSet()); return createParserWithFields(defaultFields); }
java
private InputStream getCsvFileStream() throws FileNotFoundException { if (myZipFileStream == null) { if (myZipFilePath == null) { final String csvFileName = getBundledCsvFileName(); return getClass().getClassLoader().getResourceAsStream(csvFileName); } els...
java
public static long sizeOfInstance(Class<?> type) { long size = SPEC.getObjectHeaderSize() + sizeOfDeclaredFields(type); while ((type = type.getSuperclass()) != Object.class && type != null) size += roundTo(sizeOfDeclaredFields(type), SPEC.getSuperclassFieldPadding()); return roundTo(...
java
public static long sizeOfInstanceWithUnsafe(Class<?> type) { while (type != null) { long size = 0; for (Field f : declaredFieldsOf(type)) size = Math.max(size, unsafe.objectFieldOffset(f) + sizeOf(f)); if (size > 0) return roundTo(size,...
java
public static long sizeOfArray(int length, long elementSize) { return roundTo(SPEC.getArrayHeaderSize() + length * elementSize, SPEC.getObjectPadding()); }
java
private static int getAlignment() { RuntimeMXBean runtimeMxBean = ManagementFactory.getRuntimeMXBean(); for (String arg : runtimeMxBean.getInputArguments()) { if (arg.startsWith("-XX:ObjectAlignmentInBytes=")) { try { return Integer.parseInt(arg.substring(...
java
public void configure(Object obj, Element cfg, int startIdx) throws Exception { String id = getAttribute(cfg, "id"); if (id != null) { _idMap.put(id, obj); } Element[] children = getChildren(cfg); for (int i = startIdx; i < children.length; i++) { Element node = children[i]; //CHECKSTYLE:OFF ...
java
protected void scanJspConfig() throws IOException, SAXException { JspConfigDescriptor jspConfigDescriptor = context.getJspConfigDescriptor(); if (jspConfigDescriptor == null) { return; } Collection<TaglibDescriptor> descriptors = jspConfigDescriptor.getTaglibs(); for...
java
protected void scanResourcePaths(String startPath) throws IOException, SAXException { Set<String> dirList = context.getResourcePaths(startPath); if (dirList != null) { for (String path : dirList) { if (path.startsWith("/WEB-INF/classes/")) { // Skip: JSP....
java
private void trackHttpContexts(final BundleContext bundleContext, ExtendedHttpServiceRuntime httpServiceRuntime) { final ServiceTracker<HttpContext, HttpContextElement> httpContextTracker = HttpContextTracker .createTracker(extenderContext, bundleContext, httpServiceRuntime); httpContextTracker.open(); ...
java
private void trackResources(final BundleContext bundleContext) { ServiceTracker<Object, ResourceWebElement> resourceTracker = ResourceTracker.createTracker(extenderContext, bundleContext); resourceTracker.open(); trackers.add(0, resourceTracker); final ServiceTracker<ResourceMapping, ResourceMappingWebE...
java
private void trackFilters(final BundleContext bundleContext) { final ServiceTracker<Filter, FilterWebElement> filterTracker = FilterTracker .createTracker(extenderContext, bundleContext); filterTracker.open(); trackers.add(0, filterTracker); // FIXME needed? final ServiceTracker<FilterMapping, F...
java
private void trackListeners(final BundleContext bundleContext) { final ServiceTracker<EventListener, ListenerWebElement> listenerTracker = ListenerTracker .createTracker(extenderContext, bundleContext); listenerTracker.open(); trackers.add(0, listenerTracker); // FIXME needed? final ServiceTrack...
java
private void trackJspMappings(final BundleContext bundleContext) { final ServiceTracker<JspMapping, JspWebElement> jspMappingTracker = JspMappingTracker .createTracker(extenderContext, bundleContext); jspMappingTracker.open(); trackers.add(0, jspMappingTracker); }
java
private void trackWelcomeFiles(final BundleContext bundleContext) { final ServiceTracker<WelcomeFileMapping, WelcomeFileWebElement> welcomeFileTracker = WelcomeFileMappingTracker .createTracker(extenderContext, bundleContext); welcomeFileTracker.open(); trackers.add(0, welcomeFileTracker); }
java
private void trackErrorPages(final BundleContext bundleContext) { final ServiceTracker<ErrorPageMapping, ErrorPageWebElement> errorPagesTracker = ErrorPageMappingTracker .createTracker(extenderContext, bundleContext); errorPagesTracker.open(); trackers.add(0, errorPagesTracker); }
java
public void sessionCreated(final HttpSessionEvent event) { counter++; final HttpSession session = event.getSession(); final String id = session.getId(); SESSIONS.put(id, session); }
java
public void sessionDestroyed(final HttpSessionEvent event) { final HttpSession session = event.getSession(); final String id = session.getId(); SESSIONS.remove(id); counter--; }
java
public static synchronized List<Object> getAttributes(final String name) { final List<Object> data = new ArrayList<>(); for (final String id : SESSIONS.keySet()) { final HttpSession session = SESSIONS.get(id); try { final Object o = session.getAttribute(name); data.add(o); //CHECKSTYLE:OFF } c...
java
public void start(BundleContext bc) throws Exception { httpServiceRef = bc.getServiceReference(HttpService.class); if (httpServiceRef != null) { httpService = (HttpService) bc.getService(httpServiceRef); httpService.registerServlet("/status", new StatusServlet(), null, null); httpService.registerServl...
java
public void stop(BundleContext bc) throws Exception { if (httpService != null) { bc.ungetService(httpServiceRef); httpServiceRef = null; httpService = null; } }
java
@Override public void setAttribute(final String name, Object value) { if (HttpContext.AUTHENTICATION_TYPE.equals(name)) { handleAuthenticationType(value); } else if (HttpContext.REMOTE_USER.equals(name)) { handleRemoteUser(value); } super.setAttribute(name, value); }
java
private void handleAuthenticationType(final Object authenticationType) { if (request != null) { if (authenticationType != null) { // be defensive if (!(authenticationType instanceof String)) { final String message = "Attribute " + HttpContext.AUTHENTICATION_TYPE + " expected to be...
java
private void handleRemoteUser(final Object remoteUser) { if (request != null) { Principal userPrincipal = null; if (remoteUser != null) { // be defensive if (!(remoteUser instanceof String)) { final String message = "Attribute " + HttpContext.REMOTE_USER + " expected to be a S...
java
public Compiler createCompiler() { if (jspCompiler != null ) { return jspCompiler; } jspCompiler = null; if (options.getCompilerClassName() != null) { jspCompiler = createCompiler(options.getCompilerClassName()); } else { if (options.ge...
java
public String resolveRelativeUri(String uri) { // sometimes we get uri's massaged from File(String), so check for // a root directory separator char if (uri.startsWith("/") || uri.startsWith(File.separator)) { return uri; } else { return baseURI + uri; ...
java
public String getRealPath(String path) { if (context != null) { return context.getRealPath(path); } return path; }
java
public String getServletPackageName() { if (isTagFile()) { String className = tagInfo.getTagClassName(); int lastIndex = className.lastIndexOf('.'); String pkgName = ""; if (lastIndex != -1) { pkgName = className.substring(0, lastIndex); ...
java
public void visit(final WebAppServlet webAppServlet) { NullArgumentException.validateNotNull(webAppServlet, "Web app servlet"); final String[] urlPatterns = webAppServlet.getAliases(); if (urlPatterns == null || urlPatterns.length == 0) { LOG.warn("Servlet [" + webAppServlet + "] does not have any ma...
java
public void visit(final WebAppFilter webAppFilter) { NullArgumentException.validateNotNull(webAppFilter, "Web app filter"); LOG.debug("registering filter: {}", webAppFilter); final String[] urlPatterns = webAppFilter.getUrlPatterns(); final String[] servletNames = webAppFilter.getServletNames(); if ((url...
java
public void visit(final WebAppListener webAppListener) { NullArgumentException.validateNotNull(webAppListener, "Web app listener"); try { final EventListener listener = RegisterWebAppVisitorHS.newInstance( EventListener.class, bundleClassLoader, webAppListener.getListenerClass()); webAppL...
java
public void visit(final WebAppErrorPage webAppErrorPage) { NullArgumentException.validateNotNull(webAppErrorPage, "Web app error page"); try { webContainer.registerErrorPage(webAppErrorPage.getError(), webAppErrorPage.getLocation(), httpContext); //CHECKSTYLE:OFF } catch (Exception ignore) {...
java
private static void parseContextParams(final ParamValueType contextParam, final WebApp webApp) { final WebAppInitParam initParam = new WebAppInitParam(); initParam.setParamName(contextParam.getParamName().getValue()); initParam.setParamValue(contextParam.getParamValue().getValue()); webApp.addContextParam(i...
java
private static void parseSessionConfig(final SessionConfigType sessionConfigType, final WebApp webApp) { // Fix for PAXWEB-201 if (sessionConfigType.getSessionTimeout() != null) { webApp.setSessionTimeout(sessionConfigType.getSessionTimeout().getValue().toString()); } if (sessionConfigType.getCookieConf...
java
private static void parseServlets(final ServletType servletType, final WebApp webApp) { final WebAppServlet servlet = new WebAppServlet(); servlet.setServletName(servletType.getServletName().getValue()); if (servletType.getServletClass() != null) { servlet.setServletClassName(servletType.getServletClass()....
java
private static void parseFilters(final FilterType filterType, final WebApp webApp) { final WebAppFilter filter = new WebAppFilter(); if (filterType.getFilterName() != null) { filter.setFilterName(filterType.getFilterName().getValue()); } if (filterType.getFilterClass() != null) { filter.setFilterCla...
java
private static void parseErrorPages(final ErrorPageType errorPageType, final WebApp webApp) { final WebAppErrorPage errorPage = new WebAppErrorPage(); if (errorPageType.getErrorCode() != null) { errorPage.setErrorCode(errorPageType.getErrorCode().getValue().toString()); } if (errorPageType.getExceptionT...
java
private static void parseWelcomeFiles(final WelcomeFileListType welcomeFileList, final WebApp webApp) { if (welcomeFileList != null && welcomeFileList.getWelcomeFile() != null && !welcomeFileList.getWelcomeFile().isEmpty()) { welcomeFileList.getWelcomeFile().forEach(webApp::addWelcomeFile); } }
java
private static void parseMimeMappings(final MimeMappingType mimeMappingType, final WebApp webApp) { final WebAppMimeMapping mimeMapping = new WebAppMimeMapping(); mimeMapping.setExtension(mimeMappingType.getExtension().getValue()); mimeMapping.setMimeType(mimeMappingType.getMimeType().getValue()); webApp.ad...
java
private static String getTextContent(final Element element) { if (element != null) { String content = element.getTextContent(); if (content != null) { content = content.trim(); } return content; } return null; }
java
public static int parseInt(byte[] b, int offset, int length, int base) { int value = 0; //CHECKSTYLE:OFF if (length < 0) { length = b.length - offset; } //CHECKSTYLE:ON for (int i = 0; i < length; i++) { char c = (char) (_0XFF & b[offset + i]); int digit = c - '0'; if (digit < 0 || digit >= b...
java
@Override public HttpService addingService( final ServiceReference<HttpService> serviceReference) { LOG.debug("HttpService available {}", serviceReference); lock.lock(); HttpService addedHttpService = null; try { if (httpService != null) { return super.addingService(serviceReference); } ...
java
@Override public void removedService( final ServiceReference<HttpService> serviceReference, final HttpService service) { LOG.debug("HttpService removed {}", serviceReference); lock.lock(); HttpService removedHttpService = null; try { if (context != null) { super.removedService(serviceRefe...
java
public void start(BundleContext bc) throws Exception { /* * The pax-web-war service can take a little longer to start, we can't * say how much it will take, so we do need to sit down a while and wait * it's availability in order to use it's reference. * * This is a MUST, it's really important - mostly ...
java
private static void printAttribute(final PrintWriter writer, final HttpServletRequest request, final String attribute) { writer.println("<tr><td>" + attribute + "</td><td>" + (request.getAttribute(attribute) != null ? request .getAttribute(attribute) : "") + "</td></tr>"); }
java
@Override public Enumeration<URL> getResources(String name) throws IOException { return bundleClassLoader.getResources(name); }
java
public List<URL> scanBundlesInClassSpace(String directory, String filePattern, boolean recursive) { Set<Bundle> bundlesInClassSpace = ClassPathUtil.getBundlesInClassSpace( bundleClassLoader.getBundle(), new HashSet<>()); List<URL> matching = new ArrayList<>(); for (Bundle bundle : bundlesInClassS...
java
public BindingInfo bindingInfo(String socketBindingName) { SocketBinding sb = socketBinding(socketBindingName); if (sb == null) { throw new IllegalArgumentException("Can't find socket binding with name \"" + socketBindingName + "\""); } Interface iface = interfaceRef(sb.getInterfaceRef()); if (iface == nul...
java
public void configureWelcomeFiles(List<String> welcomePages) { this.welcomePages = welcomePages; ((ResourceHandler) handler).setWelcomeFiles(); ((ResourceHandler) handler).addWelcomeFiles(welcomePages.toArray(new String[welcomePages.size()])); }
java
public static String getStringProperty( final ServiceReference<?> serviceReference, final String key) { NullArgumentException.validateNotNull(serviceReference, "Service reference"); NullArgumentException.validateNotEmpty(key, true, "Property key"); Object value = serviceReference.getProperty(key); if ...
java
public static Integer getIntegerProperty(final ServiceReference<?> serviceReference, final String key) { NullArgumentException.validateNotNull(serviceReference, "Service reference"); NullArgumentException.validateNotEmpty(key, true, "Property key"); final Object value = serviceReference.getProperty(key); if...
java
public static Map<String, Object> getSubsetStartingWith( final ServiceReference<?> serviceReference, final String prefix) { final Map<String, Object> subset = new HashMap<>(); for (String key : serviceReference.getPropertyKeys()) { if (key != null && key.startsWith(prefix) && key.trim().length() > p...
java
public static String extractHttpContextId(final ServiceReference<?> serviceReference) { String httpContextId = getStringProperty(serviceReference, ExtenderConstants.PROPERTY_HTTP_CONTEXT_ID); //TODO: Make sure the current HttpContextSelect works together with R6 if (httpContextId == null) { String httpCo...
java
public static Boolean extractSharedHttpContext(final ServiceReference<?> serviceReference) { Boolean sharedHttpContext = Boolean .parseBoolean((String) serviceReference .getProperty(ExtenderConstants.PROPERTY_HTTP_CONTEXT_SHARED)); if (serviceReference.getProperty(HttpWhiteboardConstants.HTTP_WHITEB...
java
public void addInitParam(final WebAppInitParam param) { NullArgumentException.validateNotNull(param, "Init param"); NullArgumentException.validateNotNull(param.getParamName(), "Init param name"); NullArgumentException.validateNotNull(param.getParamValue(), "Init param value"); initParams.add(param); }
java
public Extension createExtension(final Bundle bundle) { NullArgumentException.validateNotNull(bundle, "Bundle"); if (bundle.getState() != Bundle.ACTIVE) { LOG.debug("Bundle is not in ACTIVE state, ignore it!"); return null; } // Check compatibility Boolean canSeeServletClass = canSeeClass(bundle, Servl...
java
public static String normalizeResourcePath(final String path) { if (path == null) { return null; } String normalizedPath = replaceSlashes(path.trim()); if (normalizedPath.startsWith("/") && normalizedPath.length() > 1) { normalizedPath = normalizedPath.substring(1); } return normalizedPath; }
java
public static String[] normalizePatterns(final String[] urlPatterns) { String[] normalized = null; if (urlPatterns != null) { normalized = new String[urlPatterns.length]; for (int i = 0; i < urlPatterns.length; i++) { normalized[i] = normalizePattern(urlPatterns[i]); } } return normalized; }
java
public static URL[] getClassPathJars(final Bundle bundle) { final List<URL> urls = new ArrayList<>(); final String bundleClasspath = (String) bundle.getHeaders().get( "Bundle-ClassPath"); if (bundleClasspath != null) { String[] segments = bundleClasspath.split(","); for (String segment : segments) { ...
java
public static Set<Bundle> getBundlesInClassSpace(Bundle bundle, Set<Bundle> bundleSet) { return getBundlesInClassSpace(bundle.getBundleContext(), bundle, bundleSet); }
java
public void addServletModel(final ServletModel model) throws NamespaceException, ServletException { servletLock.writeLock().lock(); try { associateBundle(model.getContextModel().getVirtualHosts(), model.getContextModel().getBundle()); for (String virtualHost:resolveVirtualHosts(model)) {...
java
public void removeServletModel(final ServletModel model) { servletLock.writeLock().lock(); try { deassociateBundle(model.getContextModel().getVirtualHosts(), model.getContextModel().getBundle()); for (String virtualHost:resolveVirtualHosts(model)) { if (model.getAlias() ...
java
public void addFilterModel(final FilterModel model) { if (model.getUrlPatterns() != null) { try { filterLock.writeLock().lock(); associateBundle(model.getContextModel().getVirtualHosts(), model.getContextModel().getBundle()); for (String virtualHost : resolveVirtualHosts(model)) { for (Strin...
java
public void removeFilterModel(final FilterModel model) { if (model.getUrlPatterns() != null) { try { deassociateBundle(model.getContextModel().getVirtualHosts(), model.getContextModel().getBundle()); filterLock.writeLock().lock(); for (String virtualHost:resolveVirtualHosts(model)) { for (St...
java
public void associateHttpContext(final WebContainerContext httpContext, final Bundle bundle, final boolean allowReAsssociation) { List<String> virtualHosts = resolveVirtualHosts(bundle); for (String virtualHost : virtualHosts) { ConcurrentMap<WebContainerContext, Bundle> virtualHostHttpContexts = h...
java
protected final ServiceTracker<T, W> create(String filter) { try { return new ServiceTracker<>(bundleContext, bundleContext.createFilter(filter), this); } catch (InvalidSyntaxException e) { throw new IllegalArgumentException("Unexpected InvalidSyntaxException: " + e.getMessage()); } }
java
public void visit(final WebApp webApp) { NullArgumentException.validateNotNull(webApp, "Web app"); bundleClassLoader = new BundleClassLoader(webApp.getBundle()); httpContext = new WebAppHttpContext( httpService.createDefaultHttpContext(), webApp.getRootPath(), webApp.getBundle(), webApp.getMimeMappin...
java
public void visit(final WebAppServlet webAppServlet) { NullArgumentException.validateNotNull(webAppServlet, "Web app servlet"); final String[] aliases = webAppServlet.getAliases(); if (aliases != null && aliases.length > 0) { for (final String alias : aliases) { try { final Servlet servlet = new...
java
public static <T> T newInstance(final Class<T> clazz, final ClassLoader classLoader, final String className) throws ClassNotFoundException, IllegalAccessException, InstantiationException { return loadClass(clazz, classLoader, className).newInstance(); }
java
@SuppressWarnings("unchecked") public static <T> Class<? extends T> loadClass(final Class<T> clazz, final ClassLoader classLoader, final String className) throws ClassNotFoundException, IllegalAccessException { NullArgumentException.validateNotNull(clazz, "Class"); NullArgumentException.vali...
java