Skip to content

Commit 3da78ee

Browse files
committed
Merge branch '7.0' into 7.1
# Conflicts: # core/src/main/java/lucee/transformer/library/ClassDefinitionImpl.java # loader/build.xml # loader/pom.xml
2 parents dab12bc + 1979560 commit 3da78ee

File tree

7 files changed

+72
-47
lines changed

7 files changed

+72
-47
lines changed

core/src/main/cfml/context/admin/admin_layout.cfm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@
4848
<div id="header">
4949
<a id="logo" href="index.cfm"></a>
5050
</div>
51-
<div class="version-number">#server.lucee.version#</div>
51+
<cfif hasNavigation><div class="version-number">#server.lucee.version#</div></cfif>
5252
</td>
5353
</tr>
5454
<tr>

core/src/main/cfml/context/res/css/admin.css

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -387,8 +387,7 @@ td#logintd {
387387
#login {
388388
max-width: 100%;
389389
margin: 0px auto;
390-
width: 220px;
391-
height: 300px;
390+
width: fit-content;
392391
}
393392

394393
/* Content Area */

core/src/main/java/lucee/runtime/functions/FunctionHandlerPool.java

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
import lucee.runtime.listener.JavaSettingsImpl;
2828
import lucee.runtime.op.Caster;
2929
import lucee.runtime.reflection.Reflector;
30+
import lucee.transformer.library.ClassDefinitionImpl;
3031

3132
// TODO kann man nicht auf context ebene
3233

@@ -44,6 +45,10 @@ public static Object invoke(PageContext pc, Object[] args, String className) thr
4445
return use(pc, className).invoke(pc, args);
4546
}
4647

48+
public static Object invoke(PageContext pc, Object[] args, String className, String maven) throws PageException {
49+
return use(pc, className, maven).invoke(pc, args);
50+
}
51+
4752
/**
4853
* return a tag to use from a class
4954
*
@@ -77,6 +82,32 @@ public static BIF use(PageContext pc, String className, String bundleName, Strin
7782
return bif;
7883
}
7984

85+
public static BIF use(PageContext pc, String className, String maven) throws PageException {
86+
String id = toId(className, maven, null);
87+
BIF bif = map.get(id);
88+
if (bif != null) return bif;
89+
90+
try {
91+
Class<?> clazz;
92+
// Maven
93+
if (!StringUtil.isEmpty(maven)) {
94+
clazz = new ClassDefinitionImpl(className, maven).getClazz();
95+
}
96+
// JAR
97+
else {
98+
clazz = ClassUtil.loadClass(pc, className);
99+
}
100+
101+
if (Reflector.isInstaneOf(clazz, BIF.class, false)) bif = (BIF) ClassUtil.newInstance(clazz);
102+
else bif = new BIFProxy(clazz);
103+
}
104+
catch (Exception e) {
105+
throw Caster.toPageException(e);
106+
}
107+
map.put(id, bif);
108+
return bif;
109+
}
110+
80111
public static BIF use(PageContext pc, String className) throws PageException {
81112
BIF bif = map.get(className);
82113
if (bif != null) return bif;

core/src/main/java/lucee/transformer/bytecode/expression/var/VariableImpl.java

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,7 @@
7171
import lucee.transformer.expression.var.NamedMember;
7272
import lucee.transformer.expression.var.Variable;
7373
import lucee.transformer.interpreter.literal.LitStringImpl;
74+
import lucee.transformer.library.ClassDefinitionImpl;
7475
import lucee.transformer.library.function.FunctionLibFunction;
7576
import lucee.transformer.library.function.FunctionLibFunctionArg;
7677
import lucee.transformer.library.tag.TagLibTag;
@@ -127,6 +128,7 @@ public final class VariableImpl extends ExpressionBase implements Variable {
127128
private static final Method STATIC_GET1 = new Method("staticGet", Types.OBJECT, new Type[] { Types.OBJECT });
128129
private static final Method STATIC_TOUCH1 = new Method("staticTouch", Types.OBJECT, new Type[] { Types.OBJECT });
129130
private static final Method INVOKE3 = new Method("invoke", Types.OBJECT, new Type[] { Types.PAGE_CONTEXT, Types.OBJECT_ARRAY, Types.STRING });
131+
private static final Method INVOKE4 = new Method("invoke", Types.OBJECT, new Type[] { Types.PAGE_CONTEXT, Types.OBJECT_ARRAY, Types.STRING, Types.STRING });
130132
private static final Method INVOKE5 = new Method("invoke", Types.OBJECT, new Type[] { Types.PAGE_CONTEXT, Types.OBJECT_ARRAY, Types.STRING, Types.STRING, Types.STRING });
131133

132134
// GET
@@ -549,8 +551,7 @@ static Type _writeOutFirstBIF(BytecodeContext bc, BIF bif, int mode, boolean las
549551
try {
550552
if (clazzz.getMethods("call", true, -1).size() == 0) core = false;
551553
}
552-
catch (Exception e) {
553-
}
554+
catch (Exception e) {}
554555
}
555556
// load method
556557
List<lucee.transformer.dynamic.meta.Method> methods = null;
@@ -559,8 +560,7 @@ static Type _writeOutFirstBIF(BytecodeContext bc, BIF bif, int mode, boolean las
559560
methods = clazzz.getMethods("call", true, args.length + 1);
560561
if (methods != null && methods.size() == 0) methods = null;
561562
}
562-
catch (Exception e) {
563-
}
563+
catch (Exception e) {}
564564
}
565565

566566
if (bif.getArgType() == FunctionLibFunction.ARG_FIX && !bifCD.isBundle() && core) {
@@ -719,9 +719,14 @@ static Type _writeOutFirstBIF(BytecodeContext bc, BIF bif, int mode, boolean las
719719
else ASMConstants.NULL(adapter);
720720
if (bifCD.getVersionAsString() != null) adapter.push(bifCD.getVersionAsString());// bundle version
721721
else ASMConstants.NULL(adapter);
722-
723722
adapter.invokeStatic(Types.FUNCTION_HANDLER_POOL, INVOKE5);
724723
}
724+
else if (((ClassDefinitionImpl) bifCD).isMaven()) {
725+
adapter.push(((ClassDefinitionImpl) bifCD).getMavenRaw());// maven data
726+
727+
adapter.invokeStatic(Types.FUNCTION_HANDLER_POOL, INVOKE4);
728+
}
729+
725730
else adapter.invokeStatic(Types.FUNCTION_HANDLER_POOL, INVOKE3);
726731
rtnType = Types.OBJECT;
727732
}

core/src/main/java/lucee/transformer/library/ClassDefinitionImpl.java

Lines changed: 27 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -140,39 +140,7 @@ public static ClassDefinitionImpl toClassDefinitionImpl(Struct sct, String prefi
140140
return new ClassDefinitionImpl(cl, null, null, id);
141141
}
142142

143-
public static ClassDefinition toClassDefinition(String className, Identification id, Map<String, String> attributes) {
144-
if (StringUtil.isEmpty(className, true)) return null;
145-
146-
if (attributes != null) {
147-
148-
// OSGi?
149-
String bn = attributes.get("name");
150-
if (StringUtil.isEmpty(bn)) bn = attributes.get("bundle-name");
151-
String bv = attributes.get("version");
152-
if (StringUtil.isEmpty(bv)) bv = attributes.get("bundle-version");
153-
if (!StringUtil.isEmpty(bn)) {
154-
return new ClassDefinitionImpl(className, bn, bv, id);
155-
}
156-
157-
// Maven?
158-
String mvn = attributes.get("maven");
159-
if (!StringUtil.isEmpty(mvn, true)) {
160-
return new ClassDefinitionImpl(className, mvn);
161-
}
162-
163-
// Component?
164-
String cfcName = attributes.get("component");
165-
if (!StringUtil.isEmpty(cfcName, true)) {
166-
Class<? extends Object> proxyClass = cfmlToClass(cfcName, null);
167-
if (proxyClass != null) {
168-
return new ClassDefinitionImpl(proxyClass);
169-
}
170-
}
171-
}
172-
return new ClassDefinitionImpl(className, null, null, id);
173-
}
174-
175-
public static ClassDefinitionImpl toClassDefinition(Map<String, ?> map, boolean strict, Identification id) {
143+
public static ClassDefinition toClassDefinition(Map<String, ?> map, boolean strict, Identification id) {
176144
return toClassDefinitionImpl(MapAsStruct.toStruct(map, false), null, strict, id);
177145
}
178146

@@ -263,8 +231,7 @@ public static String toBundleVersion(Struct sct, String prefix, boolean strict)
263231
/**
264232
* only used by deserializer!
265233
*/
266-
public ClassDefinitionImpl() {
267-
}
234+
public ClassDefinitionImpl() {}
268235

269236
public ClassDefinitionImpl<T> setVersionOnlyMattersWhenDownloading(boolean versionOnlyMattersWhenDownloading) {
270237
this.versionOnlyMattersWhenDownloading = versionOnlyMattersWhenDownloading;
@@ -399,8 +366,7 @@ else if (isMaven()) {
399366
try {
400367
maven = MavenUtil.toString(getMaven());
401368
}
402-
catch (Exception e) {
403-
}
369+
catch (Exception e) {}
404370
sb.append("class:").append(className).append(";maven:").append(maven).append(";");
405371
}
406372
else {
@@ -414,6 +380,30 @@ public int hashCode() {
414380
return toString().hashCode();
415381
}
416382

383+
public static ClassDefinition toClassDefinition(String className, Identification id, Map<String, String> attributes) {
384+
if (StringUtil.isEmpty(className, true)) return null;
385+
386+
if (attributes != null) {
387+
// bundle
388+
String bn = attributes.get("name");
389+
if (StringUtil.isEmpty(bn)) bn = attributes.get("bundle-name");
390+
391+
if (!StringUtil.isEmpty(bn)) {
392+
String bv = attributes.get("version");
393+
if (StringUtil.isEmpty(bv)) bv = attributes.get("bundle-version");
394+
return new ClassDefinitionImpl(className, bn, bv, id);
395+
}
396+
397+
// maven
398+
String mvn = attributes.get("maven");
399+
if (StringUtil.isEmpty(mvn)) mvn = attributes.get("mvn");
400+
if (!StringUtil.isEmpty(mvn)) {
401+
return new ClassDefinitionImpl(className, mvn);
402+
}
403+
}
404+
return new ClassDefinitionImpl(className);
405+
}
406+
417407
@Override
418408
public String getClassName() {
419409
return className;

loader/build.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<project default="core" basedir="." name="Lucee"
33
xmlns:resolver="antlib:org.apache.maven.resolver.ant">
44

5-
<property name="version" value="7.1.0.48-SNAPSHOT"/>
5+
<property name="version" value="7.1.0.49-SNAPSHOT"/>
66

77
<taskdef uri="antlib:org.apache.maven.resolver.ant" resource="org/apache/maven/resolver/ant/antlib.xml">
88
<classpath>

loader/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
<groupId>org.lucee</groupId>
55
<artifactId>lucee</artifactId>
6-
<version>7.1.0.48-SNAPSHOT</version>
6+
<version>7.1.0.49-SNAPSHOT</version>
77
<packaging>jar</packaging>
88

99
<name>Lucee Loader Build</name>

0 commit comments

Comments
 (0)