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

Generics take2 #1294

Open
wants to merge 101 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
101 commits
Select commit Hold shift + click to select a range
ce133b9
Initial commit of generics
LadyCailin Nov 1, 2021
368e90e
Merge branch 'master' into generics
LadyCailin Nov 1, 2021
5c4344d
Still working on changes to add environment in places
LadyCailin Nov 4, 2021
64fb221
Finish refactoring process
LadyCailin Nov 5, 2021
d521be5
Compiles again
LadyCailin Nov 11, 2021
d431fc2
Move instanceof logic to InstanceofUtil + Fix SA instanceof reference…
Pieter12345 Nov 11, 2021
32d16fc
Merge branch 'master' into genericsTake2
PseudoKnight Dec 3, 2021
b0d46a0
Merge branch 'master' into genericsTake2
PseudoKnight Dec 17, 2021
bcaf404
Additional changes. Mostly code complete, though not working.
LadyCailin Feb 11, 2022
edc959c
Merge remote-tracking branch 'origin/master' into genericsTake2
LadyCailin Feb 11, 2022
b737796
Merge branch 'master' into genericsTake2
LadyCailin Feb 13, 2022
958a03b
Merge remote-tracking branch 'origin/master' into genericsTake2
LadyCailin Feb 25, 2022
e3825c1
Finish generic constraint validation
LadyCailin Feb 27, 2022
ee55d6a
typeof needs Environment
LadyCailin Mar 3, 2022
239a132
Fix provisonal-build and 2 unit tests
LadyCailin Mar 21, 2022
592ab47
Add LeftHandSideType, and rework generics to fix all unit tests.
LadyCailin Mar 23, 2022
921a0c8
Fix tests
LadyCailin Mar 23, 2022
0465349
Merge branch 'master' into genericsTake2
LadyCailin Mar 24, 2022
6121779
Fix player_command bind
LadyCailin Mar 24, 2022
036b753
Use a static cache for native classes
LadyCailin Mar 24, 2022
ba7ebd5
Add back in more deprecated methods
LadyCailin Mar 24, 2022
668e37e
Add @AggressiveDeprecation annotation
LadyCailin Mar 25, 2022
ab14f00
Readd all no-env methods with AggressiveDeprecation
LadyCailin Mar 29, 2022
5d5ba81
Fix javadoc
LadyCailin Mar 29, 2022
809a724
Merge remote-tracking branch 'origin/master' into genericsTake2
LadyCailin Mar 29, 2022
8ca78e4
Merge remote-tracking branch 'origin/master' into genericsTake2
LadyCailin Mar 30, 2022
89aba77
Change return type and parameter of merged code
LadyCailin Mar 30, 2022
7a09ff0
Update syntax in NewObjects
LadyCailin Mar 30, 2022
23cd8f5
Fix null assignments
LadyCailin Mar 31, 2022
c68d103
Apply changes based on PR comments
LadyCailin Mar 31, 2022
b70b209
Merge remote-tracking branch 'origin/master' into genericsTake2
LadyCailin Mar 31, 2022
b9aae16
Bugfixes
LadyCailin Mar 31, 2022
265949e
Fix and() function signature
Pieter12345 Mar 31, 2022
32f2d4a
Cache ClassMirror's JVM name
LadyCailin Apr 1, 2022
f861f77
Merge branch 'genericsTake2' of github.com:EngineHub/CommandHelper in…
LadyCailin Apr 1, 2022
24117ca
Merge remote-tracking branch 'origin/master' into genericsTake2
LadyCailin Apr 1, 2022
26151e4
Merge remote-tracking branch 'origin/master' into genericsTake2
LadyCailin Apr 2, 2022
cde5f4c
Pass GenericParameters in to functions.
LadyCailin Apr 2, 2022
0a6bd55
Also convert leftover test method
LadyCailin Apr 2, 2022
f40c67d
Provide runtime backwards compatible Event for extensions
LadyCailin Apr 2, 2022
2510cf2
CS
LadyCailin Apr 2, 2022
5b645c1
Merge branch 'master' into genericsTake2
LadyCailin Apr 3, 2022
8438464
Add back old CArray constructors as aggressively deprecated
LadyCailin Apr 3, 2022
9aab1c1
Merge remote-tracking branch 'origin/master' into genericsTake2
LadyCailin Apr 3, 2022
4327ee0
Rework how generics are stored in Construct
LadyCailin Apr 3, 2022
aa5bc2c
Support GenericDeclaration in function signatures
LadyCailin Apr 3, 2022
6ba3f82
Merge remote-tracking branch 'origin/master' into genericsTake2
LadyCailin Apr 4, 2022
6dc811d
Remove erroneous code
LadyCailin Apr 4, 2022
ee4379c
Better error message
LadyCailin Apr 4, 2022
5bc8cc0
Resolve typename before returning up further.
LadyCailin Apr 5, 2022
ab74ad2
Unbundle and rethrow CREs in exec when using reflection
LadyCailin Apr 5, 2022
205e3b3
Add more AggressiveDeprecations.
LadyCailin Apr 5, 2022
ef358b7
Merge branch 'master' into genericsTake2
LadyCailin Apr 6, 2022
f18e0f8
Add aggressivedeprecation on IncludeCache.registerAutoIncludes
LadyCailin Apr 6, 2022
37d1ed4
Merge remote-tracking branch 'origin/master' into genericsTake2
LadyCailin Apr 6, 2022
c8221fa
Add deprecated versions of set back to CArray
LadyCailin Apr 6, 2022
f0faa0b
Oops
LadyCailin Apr 6, 2022
5516d5e
Remove registerAutoIncludes
LadyCailin Apr 6, 2022
722495f
Add a log output if the aggressive deprecation meets criteria for rem…
LadyCailin Apr 6, 2022
e42666e
cleanup
LadyCailin Apr 7, 2022
8ad1434
Allow "teeing up" of aggressive deprecations.
LadyCailin Apr 7, 2022
85ed2f4
Support type inference for generic typenames
LadyCailin Apr 10, 2022
9900ee1
CS
LadyCailin Apr 11, 2022
0e3667f
Add cast().
LadyCailin Apr 11, 2022
082cd9b
CS
LadyCailin Apr 11, 2022
28a037a
Speculative fix for reported issue
LadyCailin Apr 12, 2022
f658e57
Add additional unit tests
LadyCailin Apr 12, 2022
f091c99
Merge remote-tracking branch 'origin/master' into genericsTake2
LadyCailin Apr 12, 2022
909efe8
Missed a change
LadyCailin Apr 12, 2022
c6834b2
Use the correct SA object
LadyCailin Apr 12, 2022
1726fd2
cs
LadyCailin Apr 12, 2022
0d78170
Speculative fix and additional logging
LadyCailin Apr 13, 2022
94910ec
Resolve type unions also, for when there is only one inferred type
LadyCailin Apr 13, 2022
0a2b7d3
cs
LadyCailin Apr 13, 2022
7a9ffe8
Fix centry typechecking
LadyCailin Apr 13, 2022
b0af7fd
cs
LadyCailin Apr 13, 2022
8f1a8a0
Make constants their actual type in strict mode, auto otherwise.
LadyCailin Apr 14, 2022
7e00c25
Merge branch 'master' into genericsTake2
LadyCailin Apr 19, 2022
f0f9a6c
Merge branch 'master' into genericsTake2
LadyCailin Apr 19, 2022
3cd8334
dev drop
LadyCailin Apr 22, 2022
d376ad5
Merge branch 'master' into genericsTake2
LadyCailin Apr 22, 2022
8d15bee
Create GenericTypeParameters, which are the typechecking generics
LadyCailin Apr 27, 2022
3817ae9
Merge branch 'master' into genericsTake2
LadyCailin Apr 27, 2022
5fc3192
URL encode spaces in ClassMirror
LadyCailin Apr 27, 2022
48d21b6
Use proper URL escaping
LadyCailin Apr 27, 2022
641a316
Revert "Use proper URL escaping"
LadyCailin Apr 27, 2022
031e0ad
Maybe fixed now
LadyCailin Apr 27, 2022
97ff952
Add asserts to track down failures
LadyCailin Apr 27, 2022
957f176
Decode that shit
LadyCailin Apr 27, 2022
535f9bc
Cleanup build output and clarify logs
LadyCailin Apr 27, 2022
44fe145
Merge branch 'master' into genericsTake2
LadyCailin Apr 28, 2022
8488d39
Merge branch 'master' into genericsTake2
LadyCailin May 5, 2022
1131858
Add support for `as` keyword for cast.
LadyCailin May 5, 2022
2946044
Merge remote-tracking branch 'origin/master' into genericsTake2
LadyCailin May 5, 2022
937576b
Begin initial implementation of VariadicGenericTypes.
LadyCailin May 6, 2022
0f91e3f
Merge branch 'master' into genericsTake2
LadyCailin May 7, 2022
199b33b
Implement generics in Callables.
LadyCailin May 8, 2022
78eb89a
Merge branch 'master' into genericsTake2
PseudoKnight Jun 15, 2022
f5aeffb
Merge branch 'master' into genericsTake2
PseudoKnight Jul 5, 2022
1cade80
Merge remote-tracking branch 'origin/master' into genericsTake2
LadyCailin Jan 9, 2023
0f3dc21
Merge branch 'master' into genericsTake2
LadyCailin Sep 7, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -338,3 +338,4 @@ ASALocalRun/
# MethodScript
persistence.db
persistence.json
/targett/
3 changes: 3 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Empty file.
1 change: 0 additions & 1 deletion nb-configuration.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,5 @@
<org-netbeans-modules-editor-indent.text.plain.CodeStyle.project.wrapArrayInit>WRAP_ALWAYS</org-netbeans-modules-editor-indent.text.plain.CodeStyle.project.wrapArrayInit>
<org-netbeans-modules-editor-indent.text.plain.CodeStyle.project.wrapArrayInitItems>WRAP_ALWAYS</org-netbeans-modules-editor-indent.text.plain.CodeStyle.project.wrapArrayInitItems>
<org-netbeans-modules-editor-indent.text.plain.CodeStyle.project.wrapObjects>WRAP_ALWAYS</org-netbeans-modules-editor-indent.text.plain.CodeStyle.project.wrapObjects>
<netbeans.hint.jdkPlatform>JDK_16</netbeans.hint.jdkPlatform>
</properties>
</project-shared-configuration>
50 changes: 47 additions & 3 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,8 @@
<threetenbp-version>1.3.5</threetenbp-version>
<maven.compiler.source>16</maven.compiler.source>
<maven.compiler.target>16</maven.compiler.target>
<!-- Empty argLine, to allow for non-code coverage execution -->
<argLine></argLine>
</properties>
<repositories>
<repository>
Expand Down Expand Up @@ -360,7 +362,7 @@
<dependency>
<groupId>org.ow2.asm</groupId>
<artifactId>asm</artifactId>
<version>9.1</version>
<version>9.2</version>
</dependency>
<dependency>
<groupId>jline</groupId>
Expand Down Expand Up @@ -987,7 +989,7 @@
<!-- Include custom, none specific classes -->
<include>**/RandomTests.java</include>
</includes>
<argLine>-Dfile.encoding=UTF-8 --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED</argLine>
<argLine>@{argLine} -Dfile.encoding=UTF-8 --add-opens java.base/java.lang.reflect=ALL-UNNAMED --add-opens java.base/java.lang=ALL-UNNAMED --add-opens java.base/java.util=ALL-UNNAMED</argLine>
</configuration>
</plugin>

Expand Down Expand Up @@ -1044,6 +1046,36 @@
<version>2.7</version>
</plugin>

<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.7</version>
<executions>
<execution>
<id>default-prepare-agent</id>
<goals>
<goal>prepare-agent</goal>
</goals>
</execution>
<execution>
<id>default-report</id>
<phase>prepare-package</phase>
<goals>
<goal>report</goal>
</goals>
</execution>
<execution>
<id>default-check</id>
<goals>
<goal>check</goal>
</goals>
<configuration>
<rules></rules>
</configuration>
</execution>
</executions>
</plugin>

<!-- Checkstyle plugin -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
Expand Down Expand Up @@ -1183,7 +1215,19 @@
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>cobertura-maven-plugin</artifactId>
<version>2.1</version>
<version>2.7</version>
</plugin>
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.8.7</version>
<reportSets>
<reportSet>
<reports>
<report>report</report>
</reports>
</reportSet>
</reportSets>
</plugin>
</plugins>
</reporting>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ public static void main(String[] args) throws Exception {
AnnotationChecks.checkForTypeInTypeofClasses();
AnnotationChecks.verifyExhaustiveVisitors();
AnnotationChecks.verifyNonInheritImplements();
AnnotationChecks.rewriteAggressiveDeprecations();

Implementation.setServerType(Implementation.Type.SHELL);
List<String> uhohs = new ArrayList<>();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import static org.objectweb.asm.Opcodes.ACC_SYNTHETIC;
import static org.objectweb.asm.Opcodes.ACC_VARARGS;
import org.objectweb.asm.Type;

/**
* An {@link AbstractMethodMirror} encompasses both methods and constructors.
Expand All @@ -14,6 +17,38 @@ public abstract class AbstractMethodMirror extends AbstractElementMirror {

private static final long serialVersionUID = 1L;

public static AbstractMethodMirror fromVisitParameters(int access, String name, String desc, String signature, String[] exceptions, ClassReferenceMirror classReferenceMirror) {
List<ClassReferenceMirror> parameterMirrors = new ArrayList<>();
for(Type type : Type.getArgumentTypes(desc)) {
parameterMirrors.add(new ClassReferenceMirror(type.getDescriptor()));
}
final AbstractMethodMirror methodMirror;
if(ConstructorMirror.INIT.equals(name)) {
methodMirror = new ConstructorMirror(
classReferenceMirror,
new ModifierMirror(ModifierMirror.Type.METHOD, access),
new ClassReferenceMirror(Type.getReturnType(desc).getDescriptor()),
name,
parameterMirrors,
(access & ACC_VARARGS) == ACC_VARARGS,
(access & ACC_SYNTHETIC) == ACC_SYNTHETIC,
signature
);
} else {
methodMirror = new MethodMirror(
classReferenceMirror,
new ModifierMirror(ModifierMirror.Type.METHOD, access),
new ClassReferenceMirror(Type.getReturnType(desc).getDescriptor()),
name,
parameterMirrors,
(access & ACC_VARARGS) == ACC_VARARGS,
(access & ACC_SYNTHETIC) == ACC_SYNTHETIC,
signature
);
}
return methodMirror;
}

private final List<ClassReferenceMirror> params;
private boolean isVararg = false;
private boolean isSynthetic = false;
Expand Down
Loading
Loading