Skip to content

Commit

Permalink
Fixes REST ASM resource generator
Browse files Browse the repository at this point in the history
Signed-off-by: Alexander Pinčuk <alexander.v.pinchuk@gmail.com>
  • Loading branch information
avpinchuk committed Jan 22, 2024
1 parent d77a57d commit c727721
Showing 1 changed file with 4 additions and 3 deletions.
@@ -1,4 +1,5 @@
/*
* Copyright (c) 2024 Contributors to the Eclipse Foundation.
* Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
Expand All @@ -24,6 +25,7 @@
public class ASMResourcesGenerator extends ResourcesGeneratorBase {

protected final static String GENERATED_PATH = "org/glassfish/admin/rest/resources/generatedASM/";

protected final static String GENERATED_PACKAGE = GENERATED_PATH.replace("/", ".");

public ASMResourcesGenerator(ServiceLocator habitat) {
Expand All @@ -33,11 +35,10 @@ public ASMResourcesGenerator(ServiceLocator habitat) {
@Override
public ClassWriter getClassWriter(String className, String baseClassName, String resourcePath) {
try {
Class.forName(GENERATED_PACKAGE + "." + className);
Class.forName(GENERATED_PACKAGE + className);
return null;
} catch (ClassNotFoundException ex) {
ClassWriter writer = new ASMClassWriter(habitat, GENERATED_PATH, className, baseClassName, resourcePath);
return writer;
return new ASMClassWriter(habitat, GENERATED_PATH, className, baseClassName, resourcePath);
}
}

Expand Down

0 comments on commit c727721

Please sign in to comment.