| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| | |
[WIP] Fix leaking file handlers
|
| | |
|
| |\
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
# Conflicts:
# pom.xml
# src/main/javassist/ByteArrayClassPath.java
# src/main/javassist/ClassClassPath.java
# src/main/javassist/ClassPoolTail.java
# src/main/javassist/LoaderClassPath.java
# src/main/javassist/URLClassPath.java
|
| | | |
|
| | |
| | |
| | |
| | | |
with try/catch)
|
| | | |
|
| | | |
|
|\ \ \
| | | |
| | | | |
Fixes to javassist.scopepool
|
| | |/
| |/|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Applied parameters and squashed all compiler warnings.
Changed loops to enhanced for where appropriate.
Fixed SoftValueHashMap:
Made it a raw type.
Overwritten implementation of the `get` method correctly unwrapped the reference but the methods
`containsValue` and `entrySet` needed to be fixed.
Implemented the remaining outstanding methods from the `java.util.Map` contract `values`, `putAll`
and `keySet`.
Dropped `AbstractMap` inheritance as we were not inheriting anything anymore.
Changed internal map to `ConcurrentHashMap' to be atomic and parallel safe.
Found original unit tests from jboss retro which are now updated to reflect the javassist
versions of the scoped pool classes. Added tests for the SoftValueHashMap including
test which overloads the heap to ensure the cache cleans itself appropriately.
|
|\ \ \
| | | |
| | | | |
Secure privileged
|
| | | | |
|
| | | | |
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Runtime still throws warnings illegal actions even after all that, there's
just no logic to it. We can use Unsafe but don't touch setAccessible. O well
might as well enjoy Unsafe while we still can.
Wrapped the Unsafe and added method cache with varargs method for invoke calls.
Can still do a lot with it but it does what it needs to for now.
|
| | | |
| | | |
| | | |
| | | | |
Yes it is deprecated but seems the right thing to do
|
| | | |
| | | |
| | | |
| | | |
| | | | |
Wont stop you from getting an instance but it makes it more trouble at least.
Also reduce the visibility of the enum method.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
The only thing remotely inforceable is caller class checking. You cannot
bypass an exception with setAccesible. Oracle went and removed
Reflection.getCallerClass() completely in favour of StackWalker. At least
we can share the SecurityManage ClassContext, SecurityActions seems the
appropriate venue for our stack trace peek to support the older versions
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
Java 7 and 8 does support method handles so we can cater for them. When doing
repeated invokes to the same method, keeping a reference to the Method handle
is much faster than reflection. Also the API is cleaner not having to Object[]
args etc. Worth the effort...
|
| | | |
| | | |
| | | |
| | | | |
Remembered that 1.6 won't know about MethodHandles so must use reflection methods for them still.
|
| | | |
| | | |
| | | |
| | | | |
Also do it anonomously so as not to raise the alarms and upset the powers to be.
|
| | | |
| | | |
| | | |
| | | | |
Some whitespace got shunted around a bit too.
|
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | |
| | | | |
The main advantage is that we can do the privileged setAccessible during creation and
then freely invoke via the authorized method handle.
As per the javadocs:
Access checks are applied in the factory methods of Lookup, when a method handle is created.
his is a key difference from the Core Reflection API, since java.lang.reflect.Method.invoke
performs access checking against every caller, on every call.
The performance boost is just a bonus.
|
| |/ /
| | |
| | |
| | |
| | |
| | | |
Oracle (or maybe it was still Sun) warns that we should prevent from exposing access we gain to
privileged functionality like the unsafe etc. Before Oracle decides to restrict us even more lets
make an effort at least.
|
|/ /
| |
| |
| |
| | |
Applied fix for #152 "Wrong modifiers returned for nested classes" as suggested by @pietrobraione.
Includes unit tests for all access modifiers and static.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The following were applied during multiple itterations through the source.
* Parameterize raw types.
* Mark unused members.
* Annotate override and deprecated methods.
* Convert loops to enhance for loop.
* Remove redundant else statements.
* Widening collection type references.
* Optimize code for improved readability.
* Squash compiler warnings.
* Identify smells.
|
| |
| |
| |
| | |
To honour the Object.equals contract.
|
| |
| |
| |
| | |
To honour the Object.equals contract.
|
| |
| |
| |
| | |
To honour the Object.equals contract.
|
| |
| |
| |
| | |
To honour the Object.equals contract.
|
| | |
|
| | |
|
|/ |
|
|
|
|
| |
ClassClassPath when the JVM is earlier than 9.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
| |
be attached after the JVM starts
|
| |
|
| |
|
| |
|
|
|
|
| |
Javassist uses java.lang.invoke.MethodHandles.Lookup to load a class.
|
|\
| |
| | |
A fix for older JDK8 versions: https://bugs.openjdk.java.net/browse/JDK-8041920
|
| |
| |
| |
| | |
A fix for older JDK8 versions: https://bugs.openjdk.java.net/browse/JDK-8041920
This caused random failures a little time after startup. Reported now so that when we upgrade javassist for JDK9 then we would not have to fork this class.
|
|/
|
|
| |
jigsaw
|
|
|
|
|
|
|
|
| |
Due to the specification change of jigsaw, ClassLoader#defineClass()
cannot be invoked through reflection API. As a workaround,
--add-opens java.base/java.lang=ALL-UNNAMED
must be given to the JVM. The ant target "runtest9" adds this jvm
argument.
|
|
|
|
|
|
| |
See #ClassFilesAsResources in JSR 376. We don't need to hack the module system to read a class file in java.lang.
http://openjdk.java.net/projects/jigsaw/spec/issues/
|
|
|
|
| |
create a proxy object due to access controls by jigsaw.
|
| |
|
|\ |
|