Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PAYARA-4030 Upgrade HK2 to 2.6.1 and ASM to 7.1 #4183

Merged
merged 1 commit into from Aug 29, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Expand Up @@ -60,7 +60,6 @@
import java.util.logging.Logger;

import com.sun.enterprise.module.ModulesRegistry;
import com.sun.enterprise.module.Module;

import org.glassfish.admingui.connector.TOC;
import org.glassfish.admingui.connector.TOCItem;
Expand Down
Expand Up @@ -37,12 +37,13 @@
* only if the new code is made subject to such option by the copyright
* holder.
*/
// Portions Copyright [2019] Payara Foundation and/or affiliates

package org.glassfish.appclient.server.core;

import com.sun.enterprise.config.serverbeans.Config;
import com.sun.enterprise.config.serverbeans.Applications;
import com.sun.enterprise.module.Module;
import com.sun.enterprise.module.HK2Module;
import java.io.IOException;
import com.sun.enterprise.config.serverbeans.Domain;
import com.sun.enterprise.deployment.Application;
Expand Down Expand Up @@ -211,7 +212,7 @@ public AppClientDeployer() {
public void postConstruct() {
logger = Logger.getLogger(JavaWebStartInfo.APPCLIENT_SERVER_MAIN_LOGGER,
JavaWebStartInfo.APPCLIENT_SERVER_LOGMESSAGE_RESOURCE);
for (Module module : modulesRegistry.getModules(GF_CLIENT_MODULE_NAME)) {
for (HK2Module module : modulesRegistry.getModules(GF_CLIENT_MODULE_NAME)) {
gfClientModuleClassLoader = module.getClassLoader();
}
}
Expand Down
Expand Up @@ -37,14 +37,13 @@
* only if the new code is made subject to such option by the copyright
* holder.
*/
// Portions Copyright [2019] Payara Foundation and/or affiliates

package com.sun.enterprise.connectors.connector.module;

import org.glassfish.hk2.api.ServiceLocator;
import org.glassfish.internal.deployment.GenericSniffer;
import com.sun.enterprise.module.Module;
import com.sun.enterprise.deployment.annotation.introspection.EjbComponentAnnotationScanner;
import com.sun.enterprise.deployment.annotation.introspection.ResourceAdapterAnnotationScanner;
import com.sun.enterprise.module.HK2Module;
import com.sun.appserv.connectors.internal.api.ConnectorConstants;
import org.glassfish.api.container.Sniffer;
import org.glassfish.api.deployment.DeploymentContext;
Expand Down Expand Up @@ -97,7 +96,7 @@ public ConnectorSniffer() {
* @throws java.io.IOException exception if something goes sour
*/
@Override
public Module[] setup(String containerHome, Logger logger) throws IOException {
public HK2Module[] setup(String containerHome, Logger logger) throws IOException {
// do nothing, we are embedded in GFv3 for now
return null;
}
Expand Down
Expand Up @@ -37,14 +37,12 @@
* only if the new code is made subject to such option by the copyright
* holder.
*/
// Portions Copyrigh [2019] Payara Foundation and/or affiliates

package org.glassfish.ejb.deployment.archive;

import org.glassfish.internal.deployment.GenericSniffer;
import com.sun.enterprise.module.Module;
import com.sun.enterprise.module.ModuleDefinition;
import com.sun.enterprise.module.common_impl.DirectoryBasedRepository;
import com.sun.enterprise.module.common_impl.AbstractModulesRegistryImpl;
import com.sun.enterprise.module.HK2Module;

import org.glassfish.api.deployment.archive.ReadableArchive;
import org.glassfish.api.deployment.archive.ArchiveType;
Expand Down
4 changes: 0 additions & 4 deletions appserver/ejb/ejb-container/pom.xml
Expand Up @@ -218,10 +218,6 @@
<artifactId>gf-ejb-connector</artifactId>
<version>${project.version}</version>
</dependency>
<dependency>
<groupId>org.glassfish.hk2.external</groupId>
<artifactId>asm-repackaged</artifactId>
</dependency>
<dependency>
<groupId>org.glassfish.pfl</groupId>
<artifactId>pfl-dynamic</artifactId>
Expand Down
Expand Up @@ -37,10 +37,10 @@
* only if the new code is made subject to such option by the copyright
* holder.
*/
//Portions Copyright [2016-2018] [Payara Foundation and/or its affiliates]
//Portions Copyright [2016-2019] [Payara Foundation and/or its affiliates]
package com.sun.ejb.codegen;

import org.glassfish.hk2.external.org.objectweb.asm.*;
import org.objectweb.asm.*;

import java.io.Serializable;
import java.lang.annotation.Annotation;
Expand All @@ -51,8 +51,7 @@
import java.security.PrivilegedAction;
import java.security.ProtectionDomain;

public class AsmSerializableBeanGenerator
implements Opcodes {
public class AsmSerializableBeanGenerator implements Opcodes {

private static final int INTF_FLAGS = ClassWriter.COMPUTE_MAXS | ClassWriter.COMPUTE_FRAMES;

Expand Down
Expand Up @@ -37,7 +37,7 @@
* only if the new code is made subject to such option by the copyright
* holder.
*/
//Portions Copyright [2016] [Payara Foundation]
//Portions Copyright [2016-2019] [Payara Foundation and/or affiliates]
package com.sun.ejb.codegen;

import com.sun.enterprise.container.common.spi.util.IndirectlySerializable;
Expand All @@ -58,9 +58,9 @@
import java.security.Permission;

import com.sun.enterprise.deployment.util.TypeUtil;
import org.glassfish.hk2.external.org.objectweb.asm.*;
import org.glassfish.hk2.external.org.objectweb.asm.commons.GeneratorAdapter;
import org.glassfish.hk2.external.org.objectweb.asm.commons.Method;
import org.objectweb.asm.*;
import org.objectweb.asm.commons.GeneratorAdapter;
import org.objectweb.asm.commons.Method;

public class EjbOptionalIntfGenerator
implements Opcodes {
Expand Down
Expand Up @@ -79,9 +79,8 @@
import java.util.logging.Level;
import java.util.logging.Logger;

import com.sun.enterprise.module.Module;
import com.sun.enterprise.module.HK2Module;
import com.sun.enterprise.module.ModulesRegistry;
import org.glassfish.internal.api.ServerContext;

import org.jvnet.hk2.config.types.Property;

Expand Down Expand Up @@ -575,12 +574,12 @@ private void initORB(Properties props) {

if( processType.isServer()) {

Module corbaOrbModule = null;
HK2Module corbaOrbModule = null;

// start glassfish-corba-orb bundle
ModulesRegistry modulesRegistry = services.getService(ModulesRegistry.class);

for(Module m : modulesRegistry.getModules()) {
for(HK2Module m : modulesRegistry.getModules()) {
if( m.getName().equals("org.glassfish.corba.glassfish-corba-orb") ) {
corbaOrbModule = m;
break;
Expand Down
5 changes: 5 additions & 0 deletions appserver/packager/microprofile-package/pom.xml
Expand Up @@ -288,6 +288,11 @@
<artifactId>asm-util</artifactId>
<version>${asm.version}</version>
</dependency>
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm-analysis</artifactId>
<version>${asm.version}</version>
</dependency>
<dependency>
<groupId>net.minidev</groupId>
<artifactId>accessors-smart</artifactId>
Expand Down
Expand Up @@ -159,7 +159,7 @@ public class ModuleMap {
put("org.glassfish.hk2.config", 100);
put("org.glassfish.hk2.config-types", 101);
put("org.glassfish.hk2.core", 102);
put("org.glassfish.hk2.external.asm-repackaged", 103);
//put("org.glassfish.hk2.external.asm-repackaged", 103);
//put("org.glassfish.hk2.external.bean-validator", 104);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should commented code be removed?

put("org.glassfish.hk2.hk2", 105);
put("org.glassfish.hk2.osgi-adapter", 106);
Expand Down Expand Up @@ -325,6 +325,11 @@ public class ModuleMap {
put("stax2-api", 266);
put("woodstox-core-asl", 267);
put("com.fasterxml.jackson.dataformat.xml", 268);
put("org.objectweb.asm", 269);
put("org.objectweb.asm.commons", 270);
put("org.objectweb.asm.tree", 271)
put("org.objectweb.asm.tree.analysis", 272);
put("org.objectweb.asm.util", 273)
}});

public ModuleMap() {
Expand Down
Expand Up @@ -37,7 +37,7 @@
* only if the new code is made subject to such option by the copyright
* holder.
*/
//Portions Copyright [2016-2018] [Payara Foundation and/or its affiliates]
//Portions Copyright [2016-2019] [Payara Foundation and/or its affiliates]

package com.sun.enterprise.security.ee;

Expand All @@ -56,7 +56,7 @@
import java.util.logging.Logger;
import java.io.IOException;

import com.sun.enterprise.module.Module;
import com.sun.enterprise.module.HK2Module;
import java.lang.annotation.Annotation;

import javax.inject.Inject;
Expand Down Expand Up @@ -116,7 +116,7 @@ public boolean handles(ReadableArchive location) {
* @throws java.io.IOException exception if something goes sour
*/
@Override
public Module[] setup(String containerHome, Logger logger) throws IOException {
public HK2Module[] setup(String containerHome, Logger logger) throws IOException {
lifecycle = habitat.getServiceHandle(SecurityLifecycle.class);
lifecycle.getService();
return null;
Expand Down
Expand Up @@ -37,6 +37,7 @@
* only if the new code is made subject to such option by the copyright
* holder.
*/
// Portions Copyright [2019] Payara Foundation and/or affiliates

package org.glassfish.main.web.jersey.server.mvc.jsp.integration;

Expand All @@ -63,7 +64,7 @@
import org.glassfish.api.web.TldProvider;
import org.glassfish.web.loader.LogFacade;

import com.sun.enterprise.module.Module;
import com.sun.enterprise.module.HK2Module;
import com.sun.enterprise.module.ModulesRegistry;
import com.sun.enterprise.util.net.JarURIPattern;

Expand Down Expand Up @@ -104,7 +105,7 @@ public void postConstruct() {
final Class jerseyIncludeClass = org.glassfish.jersey.server.mvc.jsp.Include.class;

URI[] uris = null;
Module m = null;
HK2Module m = null;
if (jerseyIncludeClass != null) {
m = registry.find(jerseyIncludeClass);
}
Expand Down
Expand Up @@ -37,10 +37,11 @@
* only if the new code is made subject to such option by the copyright
* holder.
*/
// Portions Copyright [2019] Payara Foundation and/or affiliates

package org.glassfish.faces.integration;

import com.sun.enterprise.module.Module;
import com.sun.enterprise.module.HK2Module;
import com.sun.enterprise.module.ModulesRegistry;
import com.sun.enterprise.util.net.JarURIPattern;
import org.jvnet.hk2.annotations.Service;
Expand Down Expand Up @@ -127,7 +128,7 @@ public void postConstruct() {
}

URI[] uris = null;
Module m = null;
HK2Module m = null;
if (jsfImplClass != null) {
m = registry.find(jsfImplClass);
}
Expand Down
Expand Up @@ -37,6 +37,7 @@
* only if the new code is made subject to such option by the copyright
* holder.
*/
// Portions Copyright [2019] Payara Foundation and/or affiliates

package org.glassfish.jspcaching.integration;

Expand All @@ -48,7 +49,7 @@
import com.sun.appserv.web.taglibs.cache.CacheTag;
import com.sun.enterprise.config.serverbeans.Config;
import com.sun.enterprise.util.net.JarURIPattern;
import com.sun.enterprise.module.Module;
import com.sun.enterprise.module.HK2Module;
import com.sun.enterprise.module.ModulesRegistry;
import javax.inject.Inject;
import javax.inject.Singleton;
Expand Down Expand Up @@ -125,7 +126,7 @@ public void postConstruct() {
*/
Class jspCachingImplClass = CacheTag.class;
URI[] uris = null;
Module m = null;
HK2Module m = null;
if (jspCachingImplClass != null) {
m = registry.find(jspCachingImplClass);
}
Expand Down
Expand Up @@ -37,6 +37,7 @@
* only if the new code is made subject to such option by the copyright
* holder.
*/
// Portions Copyright [2019] Payara Foundation and/or affiliates

package org.glassfish.jstl.integration;

Expand Down Expand Up @@ -66,7 +67,7 @@
import org.glassfish.web.loader.LogFacade;
import org.jvnet.hk2.annotations.Service;

import com.sun.enterprise.module.Module;
import com.sun.enterprise.module.HK2Module;
import com.sun.enterprise.module.ModulesRegistry;
import com.sun.enterprise.util.net.JarURIPattern;

Expand Down Expand Up @@ -94,7 +95,7 @@ public class GlassFishTldProvider implements TldProvider, PostConstruct {
public void postConstruct() {

URI[] uris = null;
Module module = registry.find(Version.class);
HK2Module module = registry.find(Version.class);

if (module != null) {
uris = module.getModuleDefinition().getLocations();
Expand Down
Expand Up @@ -37,14 +37,14 @@
* only if the new code is made subject to such option by the copyright
* holder.
*/
//Portions Copyright [2016] [Payara Foundation]
//Portions Copyright [2016-2019] [Payara Foundation and/or affiliates]
package com.sun.enterprise.admin.cli.schemadoc;

import org.glassfish.api.admin.config.PropertiesDesc;
import org.glassfish.api.admin.config.PropertyDesc;
import org.glassfish.hk2.external.org.objectweb.asm.AnnotationVisitor;
import org.glassfish.hk2.external.org.objectweb.asm.MethodVisitor;
import org.glassfish.hk2.external.org.objectweb.asm.Opcodes;
import org.objectweb.asm.AnnotationVisitor;
import org.objectweb.asm.MethodVisitor;
import org.objectweb.asm.Opcodes;
import org.jvnet.hk2.config.Attribute;

public class AttributeMethodVisitor extends MethodVisitor {
Expand Down
Expand Up @@ -37,14 +37,14 @@
* only if the new code is made subject to such option by the copyright
* holder.
*/
//Portions Copyright [2016] [Payara Foundation]
//Portions Copyright [2016-2019] [Payara Foundation and/or affiliates]

package com.sun.enterprise.admin.cli.schemadoc;

import java.util.ArrayList;
import java.util.List;

import org.glassfish.hk2.external.org.objectweb.asm.*;
import org.objectweb.asm.*;

public class DocClassVisitor extends ClassVisitor {
private boolean hasConfiguredAnnotation = false;
Expand Down
Expand Up @@ -37,7 +37,7 @@
* only if the new code is made subject to such option by the copyright
* holder.
*/
//Portions Copyright [2016] [Payara Foundation]
//Portions Copyright [2016-2019] [Payara Foundation and/or affiliates]
package com.sun.enterprise.admin.cli.schemadoc;

import java.io.File;
Expand All @@ -60,7 +60,7 @@
import org.glassfish.config.support.TargetType;

import org.glassfish.hk2.api.ServiceLocator;
import org.glassfish.hk2.external.org.objectweb.asm.ClassReader;
import org.objectweb.asm.ClassReader;
import org.jvnet.hk2.annotations.Service;

import org.glassfish.hk2.api.PerLookup;
Expand Down