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

Base tests #1

Merged
merged 327 commits into from
Feb 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
327 commits
Select commit Hold shift + click to select a range
7a69cf7
.
josephmoresena Jul 29, 2023
b9c1f13
.
josephmoresena Jul 29, 2023
4efa614
Update Program.cs
josephmoresena Jul 29, 2023
d57814b
.
josephmoresena Jul 29, 2023
74644b8
JDataTypeMetadata
josephmoresena Jul 30, 2023
392aaa6
Simplify
josephmoresena Jul 30, 2023
1562c66
JPrimitiveMetadata over JDataTypeMetadata in primitives
josephmoresena Jul 31, 2023
6856656
.
josephmoresena Jul 31, 2023
7eabcf2
.
josephmoresena Jul 31, 2023
6ac4fc6
.
josephmoresena Aug 1, 2023
9f07ad6
.
josephmoresena Aug 1, 2023
88de651
.
josephmoresena Aug 1, 2023
16790b2
.
josephmoresena Aug 3, 2023
0d27d88
Update ValidationUtilities.cs
josephmoresena Aug 3, 2023
44ff847
.
josephmoresena Aug 3, 2023
3b036bd
.
josephmoresena Aug 3, 2023
060c4bd
Update IInterfaceImplementation.cs
josephmoresena Aug 3, 2023
dc38216
Access Namespace
josephmoresena Aug 3, 2023
6225465
Types namespace
josephmoresena Aug 3, 2023
d65a379
.
josephmoresena Aug 3, 2023
f2bb165
Internal.Types namespace
josephmoresena Aug 3, 2023
f342efd
.
josephmoresena Aug 3, 2023
a6decc5
.
josephmoresena Aug 3, 2023
b31027a
.
josephmoresena Aug 3, 2023
8ed5e66
Cleanup
josephmoresena Aug 3, 2023
970c405
Generic constraint
josephmoresena Aug 3, 2023
9ac1b0b
JInterfaceObject
josephmoresena Aug 5, 2023
cf1f5d5
Class interfaces
josephmoresena Aug 5, 2023
06934e9
.
josephmoresena Aug 6, 2023
3e928f4
Generic JInterfaceObject
josephmoresena Aug 6, 2023
1664bd1
Initial JEnumObject
josephmoresena Aug 8, 2023
87b7d05
.
josephmoresena Aug 10, 2023
264de30
Enum Type Metadata
josephmoresena Sep 3, 2023
2d07792
.
josephmoresena Sep 3, 2023
a3fd87d
.
josephmoresena Sep 3, 2023
0db5ec5
JArrayObject
josephmoresena Sep 5, 2023
eb6a96d
Update JArrayObject.cs
josephmoresena Sep 10, 2023
cb2e37a
Implements/Extends
josephmoresena Oct 7, 2023
7995ade
.
josephmoresena Oct 8, 2023
d194480
Sequence + Context
josephmoresena Oct 9, 2023
15f82d5
.
josephmoresena Oct 9, 2023
2711daf
JPrimitiveMemory
josephmoresena Nov 5, 2023
f2c049c
Fix JPrimitiveMemory
josephmoresena Nov 5, 2023
ebb1e10
NativeType in Primitives
josephmoresena Nov 6, 2023
6ceb74b
Numerics
josephmoresena Nov 6, 2023
bca67f3
Primitive operators
josephmoresena Nov 6, 2023
a29b824
.
josephmoresena Nov 6, 2023
07011f2
JNumberObject
josephmoresena Nov 6, 2023
67bd207
JNumberObject wrappers
josephmoresena Nov 7, 2023
755baba
Primitive wrappers
josephmoresena Nov 7, 2023
031be61
.
josephmoresena Nov 8, 2023
e84c32c
.
josephmoresena Nov 9, 2023
a5a2c46
JThrowableObject
josephmoresena Nov 12, 2023
c137ebc
.
josephmoresena Nov 15, 2023
63e6662
.
josephmoresena Nov 15, 2023
20d1eeb
.
josephmoresena Nov 15, 2023
d41a3d1
Remove Internal.Native and Internal.Types
josephmoresena Nov 15, 2023
d1bdd8e
.
josephmoresena Nov 15, 2023
92ce79c
ComReserved as InlineArray
josephmoresena Nov 15, 2023
4d99dd2
IReferenceType to Native
josephmoresena Nov 15, 2023
f439609
.
josephmoresena Nov 15, 2023
cce1a73
.
josephmoresena Nov 16, 2023
5326421
.
josephmoresena Nov 16, 2023
08484b9
AssignableTypes
josephmoresena Nov 18, 2023
38d4ea8
JPrimitiveWrapper Extensions
josephmoresena Nov 18, 2023
46d71aa
Update JArrayMemoryExtensions.cs
josephmoresena Nov 18, 2023
561e706
InlineArray
josephmoresena Nov 19, 2023
4f7a796
Implementation init.
josephmoresena Nov 20, 2023
a70a2c0
.
josephmoresena Nov 22, 2023
bdbc948
IPrimitiveEquatable
josephmoresena Nov 23, 2023
c7c01c5
JVirtualMachine and JThread
josephmoresena Nov 23, 2023
7493ff1
ArrayProvider
josephmoresena Nov 24, 2023
777d81b
Upgrade PInvoke.Extensions
josephmoresena Dec 2, 2023
18f7dee
Remove JFixedContexts
josephmoresena Dec 2, 2023
620a160
String provider.
josephmoresena Dec 2, 2023
460669a
JEnvironment Extensions
josephmoresena Dec 2, 2023
80b4954
.
josephmoresena Dec 3, 2023
e453fa8
Latest VM version.
josephmoresena Dec 3, 2023
8d037a7
Invocation API fixes
josephmoresena Dec 3, 2023
76eac1a
.
josephmoresena Dec 4, 2023
a04198b
Update JInvoked.cs
josephmoresena Dec 4, 2023
67d383a
JMetadataHelper
josephmoresena Dec 4, 2023
0204570
Cleanup
josephmoresena Dec 4, 2023
bdf5822
Update Rxmxnx.JNetInterface.ApplicationTest.csproj
josephmoresena Dec 4, 2023
361e653
Class provider initial
josephmoresena Dec 4, 2023
6e42e89
JLocalObject memebers to ObjectLifetime
josephmoresena Dec 7, 2023
b5a391b
.
josephmoresena Dec 9, 2023
a633989
.
josephmoresena Dec 9, 2023
efdfc98
.
josephmoresena Dec 12, 2023
d4d416b
.
josephmoresena Dec 12, 2023
700897c
Synchronization JObjectLifetime
josephmoresena Dec 13, 2023
89eb4f0
.
josephmoresena Dec 13, 2023
a6ba03e
Update IPrimitiveIntegerType.cs
josephmoresena Dec 14, 2023
ee6c72c
In transform
josephmoresena Dec 15, 2023
f9d551d
Remove invalid delegates
josephmoresena Dec 15, 2023
b030330
Update IDataType.cs
josephmoresena Dec 15, 2023
e084099
ObjectCache
josephmoresena Dec 16, 2023
e8452b8
LocalFrame
josephmoresena Dec 16, 2023
6e7591c
Global and Weak
josephmoresena Dec 17, 2023
f395189
.
josephmoresena Dec 17, 2023
8e6b531
AccesProvider P1
josephmoresena Dec 17, 2023
1ad996f
More access
josephmoresena Dec 17, 2023
c91130b
AccessProvider
josephmoresena Dec 18, 2023
5b0e069
ClassProvider P1
josephmoresena Dec 19, 2023
2350294
ClassProvider P2
josephmoresena Dec 19, 2023
13e8831
CallFrame
josephmoresena Dec 19, 2023
bd777f1
JniCall P1
josephmoresena Dec 20, 2023
7c07be2
ArrayTypeMetadata
josephmoresena Dec 20, 2023
b0b2140
Update JArrayTypeMetadata.cs
josephmoresena Dec 20, 2023
074c550
.
josephmoresena Dec 21, 2023
31f2eb1
Complete array feature.
josephmoresena Dec 22, 2023
9fa16c1
Some missing
josephmoresena Dec 22, 2023
d5845fa
.
josephmoresena Dec 22, 2023
85bfc8c
Update JEnvironmentCache.cs
josephmoresena Dec 22, 2023
aaa0508
JniTransaction
josephmoresena Dec 23, 2023
290a6d7
CString -> ReadOnlySpan<Byte> P1
josephmoresena Dec 23, 2023
a6d4fcc
CString -> ReadOnlySpan<Byte> P2
josephmoresena Dec 23, 2023
3334f85
MetadatataBuilder -> ref struct
josephmoresena Dec 24, 2023
cc60812
FunctionCache
josephmoresena Dec 24, 2023
7eaa0a6
Wrapper Constructor
josephmoresena Dec 26, 2023
bdf2115
RegisterNatives
josephmoresena Dec 27, 2023
cdd362e
Cleanup
josephmoresena Dec 27, 2023
30f323a
JniCall result.
josephmoresena Dec 28, 2023
1705529
Access improvements
josephmoresena Dec 28, 2023
647c195
Fix ArrayCasting
josephmoresena Dec 28, 2023
5d6ac75
Update ClassProvider.cs
josephmoresena Dec 28, 2023
b0c761a
Fix static access.
josephmoresena Dec 28, 2023
6cf42aa
Fix array class.
josephmoresena Dec 28, 2023
499b050
Optimizations P1
josephmoresena Dec 28, 2023
a950438
CString -> Span<Byte> P1
josephmoresena Dec 28, 2023
e0d0d49
.
josephmoresena Dec 29, 2023
e5b2efe
Global fixes
josephmoresena Dec 31, 2023
bb4ec53
Primitive class support.
josephmoresena Dec 31, 2023
2cfd5ab
Simplify interface access
josephmoresena Jan 1, 2024
292c886
Remove basetypes set
josephmoresena Jan 1, 2024
0157dd0
CString class names.
josephmoresena Jan 2, 2024
cd89aa8
.
josephmoresena Jan 2, 2024
0d5b892
CString methods name
josephmoresena Jan 2, 2024
95013f2
Update GenerateUtf8ContainerInitializer.cs
josephmoresena Jan 4, 2024
f0eb588
CString -> Generated ReadOnlySpan<Byte>
josephmoresena Jan 4, 2024
abde351
Update Program.cs
josephmoresena Jan 4, 2024
d399834
Update Program.cs
josephmoresena Jan 4, 2024
966e56e
Improvements
josephmoresena Jan 4, 2024
9e4ff73
NIO P1
josephmoresena Jan 4, 2024
9043d64
IArrayObject P1
josephmoresena Jan 5, 2024
64b44eb
Fix dispose
josephmoresena Jan 5, 2024
61f389a
IInterfaceObject P2
josephmoresena Jan 6, 2024
8089be7
Void class
josephmoresena Jan 6, 2024
2c49f07
Features
josephmoresena Jan 7, 2024
c475797
Use reflection for array metadata
josephmoresena Jan 8, 2024
ba6dedd
Update JArrayTypeMetadata.cs
josephmoresena Jan 8, 2024
61a8c68
Update JArrayTypeMetadata.cs
josephmoresena Jan 8, 2024
6877602
Update JArrayTypeMetadata.cs
josephmoresena Jan 8, 2024
1f4afc4
Optimizations
josephmoresena Jan 8, 2024
2a2f650
NIO P2
josephmoresena Jan 8, 2024
70043ab
Code improvements
josephmoresena Jan 8, 2024
1dfca3f
View improvements
josephmoresena Jan 8, 2024
989a71d
Update JLocalObject.cs
josephmoresena Jan 8, 2024
740fc1c
JNI Monitor Enter/Exit
josephmoresena Jan 9, 2024
454245d
Unify native transactions
josephmoresena Jan 9, 2024
6557b2f
Fix namespaces and packages
josephmoresena Jan 9, 2024
1009691
.
josephmoresena Jan 13, 2024
2b83b8e
Create HelloJni.java
josephmoresena Jan 13, 2024
74e1f35
Initializers
josephmoresena Jan 14, 2024
cbc65d6
Simplify CStringSequence use
josephmoresena Jan 18, 2024
4ed512c
InternalClassInitializer
josephmoresena Jan 18, 2024
aaab475
Standard constructors
josephmoresena Jan 24, 2024
20f6fd9
Fix internal initializer
josephmoresena Jan 24, 2024
3fa1936
Casting
josephmoresena Jan 24, 2024
52df69e
Update ClassFeature.cs
josephmoresena Jan 24, 2024
e63f5ea
Optimize heap allocation
josephmoresena Jan 27, 2024
25488c0
Optimize JNI call builder
josephmoresena Jan 28, 2024
42b6d96
Update JniCall.cs
josephmoresena Jan 28, 2024
b4fdecf
Void exceptions
josephmoresena Jan 28, 2024
0af0eee
ReflectionMetadata
josephmoresena Jan 28, 2024
5965fbf
IUninstantiableType
josephmoresena Jan 29, 2024
3adec72
Update AccessFeature.cs
josephmoresena Jan 29, 2024
a10f0ca
Nullability fixes
josephmoresena Jan 29, 2024
86e1dc1
IndexOf
josephmoresena Jan 29, 2024
4af205d
Uninstantiable
josephmoresena Jan 29, 2024
dddb248
CopyTo
josephmoresena Jan 30, 2024
8ce2a6e
Reflected VoidMethod invocation.
josephmoresena Jan 30, 2024
75dd892
Reflected FunctionMethod and Constructor invocation.
josephmoresena Jan 30, 2024
2951284
Update MetadataHelper.cs
josephmoresena Jan 30, 2024
226dc18
Update MetadataHelper.cs
josephmoresena Jan 30, 2024
4105b31
Update MetadataHelper.cs
josephmoresena Jan 30, 2024
9a46d0f
ToReflectedMethod
josephmoresena Jan 31, 2024
f690185
JFieldObject
josephmoresena Jan 31, 2024
b6a92cc
ToReflectedField
josephmoresena Jan 31, 2024
e623057
Get/Set reflected field
josephmoresena Jan 31, 2024
e221817
Get/Set static reflected field
josephmoresena Jan 31, 2024
cbc363a
UntypedField reflected
josephmoresena Jan 31, 2024
2be23ff
INativeMemoryHandle
josephmoresena Feb 1, 2024
bca87ad
NativeStringMemoryHandle
josephmoresena Feb 1, 2024
6c62537
Update NativeStringMemoryHandle.cs
josephmoresena Feb 1, 2024
e86fff6
NativeArrayMemoryHandle
josephmoresena Feb 1, 2024
b5a1631
JNativeMemoryHandler -> NativeStringMemoryHandle
josephmoresena Feb 1, 2024
eb12e83
JNativeMemoryHandler -> NativeArrayMemoryHandle
josephmoresena Feb 1, 2024
5ed5686
IDummyEnvironment improvements
josephmoresena Feb 1, 2024
18b0401
Organize application test
josephmoresena Feb 1, 2024
8ccbaca
Update JCompiler.cs
josephmoresena Feb 1, 2024
9e8967c
Simplify .java source
josephmoresena Feb 1, 2024
6293674
Simplify LocalMainClasses
josephmoresena Feb 2, 2024
a1c3ebc
Update JEnvironmentCache.cs
josephmoresena Feb 2, 2024
1c54fd2
Simplify JEnvironmentCache initialize
josephmoresena Feb 2, 2024
13ba298
Organize solution
josephmoresena Feb 2, 2024
4fd336f
Simplify GlobalMainClasses
josephmoresena Feb 2, 2024
930096b
Handle -> Adapter
josephmoresena Feb 2, 2024
25901b9
Fix documentation
josephmoresena Feb 2, 2024
4524819
Partial VirtualMachineCache
josephmoresena Feb 2, 2024
df2701c
Partials EnvironmentCache P1
josephmoresena Feb 2, 2024
3950958
Partials EnvironmentCache P2
josephmoresena Feb 2, 2024
dc16646
Partials EnvironmentCache P3
josephmoresena Feb 2, 2024
0066637
Partials + ToString
josephmoresena Feb 3, 2024
291ba79
ToSimplifiedString
josephmoresena Feb 3, 2024
919a9a3
Optimize interfaces
josephmoresena Feb 3, 2024
a6bcd82
Merge branch 'main' into building
josephmoresena Feb 4, 2024
9ee2bae
ClassLoader
josephmoresena Feb 5, 2024
f37e3ce
Sonar fixes.
josephmoresena Feb 5, 2024
8bce42e
Simplify InterfaceSet implementation.
josephmoresena Feb 5, 2024
f17dc81
Sonar fixes
josephmoresena Feb 5, 2024
943eac4
Simplify IConvertible
josephmoresena Feb 5, 2024
94b3831
Update IPrimitiveValue.cs
josephmoresena Feb 5, 2024
93c416b
Sonar fixes
josephmoresena Feb 6, 2024
f1f6c84
JNI Exceptions
josephmoresena Feb 6, 2024
10f5202
Initial tests
josephmoresena Feb 6, 2024
fce4567
Proxies
josephmoresena Feb 6, 2024
6a20666
Update StringFeature.cs
josephmoresena Feb 6, 2024
76e8362
Update Static.cs
josephmoresena Feb 6, 2024
5bd0cd1
JValueTests
josephmoresena Feb 6, 2024
1007bba
Simplify metadata
josephmoresena Feb 8, 2024
ba6e00b
Simplify throws
josephmoresena Feb 8, 2024
9a32e51
DataTypeTests (P1)
josephmoresena Feb 8, 2024
5a19a7b
Delete JDerivationKind.cs
josephmoresena Feb 8, 2024
031771c
Simplify IPrimitiveWrapperType
josephmoresena Feb 8, 2024
7b8eb94
Browsable(false)
josephmoresena Feb 8, 2024
433f40f
INativeType Test
josephmoresena Feb 9, 2024
848cb07
Create JEnvironmentValueTests.cs
josephmoresena Feb 10, 2024
bd57e0f
IntPtr -> ReadOnlyValPtr
josephmoresena Feb 10, 2024
3213020
JEnvironmentTests
josephmoresena Feb 10, 2024
9f49394
JVirtualMachineTests
josephmoresena Feb 10, 2024
21c044d
JIdentifierTest
josephmoresena Feb 11, 2024
eddecc2
IsDefault
josephmoresena Feb 11, 2024
9fdfbab
IEqualityOperators
josephmoresena Feb 11, 2024
226e4e4
JReferenceTests
josephmoresena Feb 11, 2024
4d99be1
.
josephmoresena Feb 11, 2024
97c8d8a
JArgumentMetadataTests
josephmoresena Feb 12, 2024
998880f
PrimitiveObjectTests
josephmoresena Feb 14, 2024
a0624dc
.
josephmoresena Feb 14, 2024
6385f0a
ReferenceObjectTests
josephmoresena Feb 15, 2024
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
  •  
  •  
  •  
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
using System.Diagnostics;
using System.Diagnostics.CodeAnalysis;

namespace Rxmxnx.JNetInterface.ApplicationTest;

/// <summary>
/// Java compiler.
/// </summary>
[ExcludeFromCodeCoverage]
public sealed partial record JCompiler
{
/// <summary>
Expand Down Expand Up @@ -35,7 +37,7 @@ public async Task<Byte[]> CompileHelloJniClassAsync()
await File.WriteAllTextAsync(javaFilePath, JHelloDotnetObject.JavaCode);
ProcessStartInfo info = new(Path.Combine(this.JdkPath, this.CompilerPath))
{
ArgumentList = { javaFilePath, }, WindowStyle = ProcessWindowStyle.Hidden,
ArgumentList = { javaFilePath, },
};
Process javac = Process.Start(info)!;
await javac.WaitForExitAsync();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
using System.Diagnostics.CodeAnalysis;

using Rxmxnx.JNetInterface.Native;
using Rxmxnx.JNetInterface.Types;
using Rxmxnx.JNetInterface.Types.Metadata;
Expand All @@ -7,10 +9,13 @@ namespace Rxmxnx.JNetInterface.ApplicationTest;
/// <summary>
/// .NET representation of <c>com.rxmxnx.dotnet.test.HelloDotnet</c> java class.
/// </summary>
[ExcludeFromCodeCoverage]
internal sealed partial class JHelloDotnetObject : JLocalObject, IClassType<JHelloDotnetObject>
{
public static JDataTypeMetadata Metadata { get; } = JTypeMetadataBuilder<JHelloDotnetObject>
.Create("com/rxmxnx/dotnet/test/HelloDotnet"u8).Build();
public static JClassTypeMetadata<JHelloDotnetObject> Metadata { get; } = JTypeMetadataBuilder<JHelloDotnetObject>
.Create(
"com/rxmxnx/dotnet/test/HelloDotnet"u8)
.Build();

private JHelloDotnetObject(IReferenceType.ClassInitializer initializer) : base(initializer) { }
private JHelloDotnetObject(IReferenceType.GlobalInitializer initializer) : base(initializer) { }
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
using System.Runtime.InteropServices;
using System.Diagnostics.CodeAnalysis;
using System.Runtime.InteropServices;

using Rxmxnx.JNetInterface.Io;
using Rxmxnx.JNetInterface.Lang;
Expand All @@ -14,6 +15,7 @@

namespace Rxmxnx.JNetInterface.ApplicationTest;

[ExcludeFromCodeCoverage]
public static class Program
{
public static async Task Main(String[] args)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ public interface ITypeInformation
/// <summary>
/// JNI class name.
/// </summary>
public CString ClassName { get; }
CString ClassName { get; }
/// <summary>
/// JNI signature for object instances of this type.
/// </summary>
public CString Signature { get; }
CString Signature { get; }
/// <summary>
/// Current datatype hash.
/// </summary>
public String Hash { get; }
String Hash { get; }

/// <summary>
/// Retrieves length of a segment in <paramref name="utf8Sequence"/>
Expand All @@ -27,7 +27,7 @@ public interface ITypeInformation
internal static Int32 GetSegmentLength(ReadOnlySpan<Byte> utf8Sequence, Int32 offset)
{
Int32 end = offset;
while (utf8Sequence.Length < end)
while (utf8Sequence.Length > end)
{
if (utf8Sequence[end] == default) break;
end++;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,6 @@ internal static class ClassNames
/// </summary>
public const String NioPackage = "java/nio/";
/// <summary>
/// JNI representation of <c>java.util</c> package.
/// </summary>
public const String UtilPackage = "java/util/";
/// <summary>
/// JNI representation of <c>java.lang.reflect</c> package.
/// </summary>
public const String ReflectPackage = ClassNames.LangPackage + "reflect/";
Expand Down Expand Up @@ -167,11 +163,10 @@ internal static class ClassNames
/// JNI name of <c>java.lang.StackTraceElement</c> class.
/// </summary>
public const String StackTraceElementObject = ClassNames.LangPackage + "StackTraceElement";

/// <summary>
/// JNI name of <c>java.util.Arrays</c> class.
/// JNI name of <c>java.lang.ClassLoader</c> class.
/// </summary>
public const String ArraysObject = ClassNames.UtilPackage + "Arrays";
public const String ClassLoaderObject = ClassNames.LangPackage + "ClassLoader";

/// <summary>
/// JNI name of <c>java.nio.Buffer</c> class.
Expand All @@ -194,6 +189,85 @@ internal static class ClassNames
/// </summary>
public const String DirectBufferObject = ClassNames.SunNioChPackage + "DirectBuffer";

/// <summary>
/// JNI name of <c>java.lang.RuntimeException</c> class.
/// </summary>
public const String ExceptionObject = ClassNames.LangPackage + "Exception";
/// <summary>
/// JNI name of <c>java.lang.Exception</c> class.
/// </summary>
public const String RuntimeExceptionObject = ClassNames.LangPackage + "RuntimeException";
/// <summary>
/// JNI name of <c>java.lang.Error</c> class.
/// </summary>
public const String ErrorObject = ClassNames.LangPackage + "Error";
/// <summary>
/// JNI name of <c>java.lang.LinkageError</c> class.
/// </summary>
public const String LinkageErrorObject = ClassNames.LangPackage + "LinkageError";
/// <summary>
/// JNI name of <c>java.lang.VirtualMachineError</c> class.
/// </summary>
public const String VirtualMachineErrorObject = ClassNames.LangPackage + "VirtualMachineError";
/// <summary>
/// JNI name of <c>java.lang.ClassFormatError</c> class.
/// </summary>
public const String ClassFormatErrorObject = ClassNames.LangPackage + "ClassFormatError";
/// <summary>
/// JNI name of <c>java.lang.ClassCircularityError</c> class.
/// </summary>
public const String ClassCircularityErrorObject = ClassNames.LangPackage + "ClassCircularityError";
/// <summary>
/// JNI name of <c>java.lang.OutOfMemoryError</c> class.
/// </summary>
public const String OutOfMemoryErrorObject = ClassNames.LangPackage + "OutOfMemoryError";
/// <summary>
/// JNI name of <c>java.lang.ExceptionInInitializerError</c> class.
/// </summary>
public const String ExceptionInInitializerErrorObject = ClassNames.LangPackage + "ExceptionInInitializerError";
/// <summary>
/// JNI name of <c>java.lang.IncompatibleClassChangeError</c> class.
/// </summary>
public const String IncompatibleClassChangeErrorObject = ClassNames.LangPackage + "IncompatibleClassChangeError";
/// <summary>
/// JNI name of <c>java.lang.NoSuchMethodError</c> class.
/// </summary>
public const String NoSuchMethodErrorObject = ClassNames.LangPackage + "NoSuchMethodError";
/// <summary>
/// JNI name of <c>java.lang.NoSuchFieldError</c> class.
/// </summary>
public const String NoSuchFieldErrorObject = ClassNames.LangPackage + "NoSuchFieldError";
/// <summary>
/// JNI name of <c>java.lang.SecurityException</c> class.
/// </summary>
public const String SecurityExceptionObject = ClassNames.LangPackage + "SecurityException";
/// <summary>
/// JNI name of <c>java.lang.ReflectiveOperationException</c> class.
/// </summary>
public const String ReflectiveOperationExceptionObject = ClassNames.LangPackage + "ReflectiveOperationException";
/// <summary>
/// JNI name of <c>java.lang.InstantiationException</c> class.
/// </summary>
public const String InstantiationExceptionObject = ClassNames.LangPackage + "InstantiationException";
/// <summary>
/// JNI name of <c>java.lang.IndexOutOfBoundsException</c> class.
/// </summary>
public const String IndexOutOfBoundsExceptionObject = ClassNames.LangPackage + "IndexOutOfBoundsException";
/// <summary>
/// JNI name of <c>java.lang.StringIndexOutOfBoundsException</c> class.
/// </summary>
public const String StringIndexOutOfBoundsExceptionObject =
ClassNames.LangPackage + "StringIndexOutOfBoundsException";
/// <summary>
/// JNI name of <c>java.lang.ArrayIndexOutOfBoundsException</c> class.
/// </summary>
public const String ArrayIndexOutOfBoundsExceptionObject =
ClassNames.LangPackage + "ArrayIndexOutOfBoundsException";
/// <summary>
/// JNI name of <c>java.lang.ArrayStoreException</c> class.
/// </summary>
public const String ArrayStoreExceptionObject = ClassNames.LangPackage + "ArrayStoreException";

/// <summary>
/// JNI name of <c>java.lang.reflect.AccessibleObject</c> interface.
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,24 +5,13 @@
/// </summary>
internal static class CommonConstants
{
public const String NativeReferenceFormat = "*{0}: {1}";
public const String VirtualMachineGuidFormat = ".NET{0}";
public const String GuidToStringFormat = "N";
public const String IntPtrToStringFormat = "X";

public const String CriticalExceptionMessage =
"The execution is in critical state. No calls can be made through native interface.";

public const String CodeQuality = "CodeQuality";
public const String CSharpSquid = "csharpsquid";
public const String CheckId0051 = "IDE0051:Remove unused private members";
public const String CheckIdS1144 = "S1144:Remove the unused private field";
public const String CheckIdS2292 = "S2292:Trivial properties should be auto-implemented";
public const String BinaryStructJustification = "This struct is created only by binary operations.";
public const String JEnvironmentError = "Local object is not owned by the this JEnvironment instance.";

public const String ExceptionMessageUnavailable = "Exception message unavailable.";

public const String JNetVersionError = "JNI version must be at least "; //+ JVirtualMachine.MinimalVersion;
public const String AttachingThreadError = "Could not attach the current thread to the JVM.";
public const String PrimitiveTypeError = "Primitive type is not valid for JNI.";
public const String ArrayClassConstructorError = "Cannot get a constructor from an array class.";
public const String InvalidLocalReference = "Local object has no reference.";
}
Original file line number Diff line number Diff line change
Expand Up @@ -83,9 +83,9 @@ internal static partial class UnicodeClassNames
[DefaultValue(ClassNames.StackTraceElementObject)]
public static partial ReadOnlySpan<Byte> StackTraceElementObject();

/// <inheritdoc cref="ClassNames.ArraysObject"/>
[DefaultValue(ClassNames.ArraysObject)]
public static partial ReadOnlySpan<Byte> ArraysObject();
/// <inheritdoc cref="ClassNames.ClassLoaderObject"/>
[DefaultValue(ClassNames.ClassLoaderObject)]
public static partial ReadOnlySpan<Byte> ClassLoaderObject();

/// <inheritdoc cref="ClassNames.BufferObject"/>
[DefaultValue(ClassNames.BufferObject)]
Expand All @@ -103,6 +103,65 @@ internal static partial class UnicodeClassNames
[DefaultValue(ClassNames.DirectBufferObject)]
public static partial ReadOnlySpan<Byte> DirectBufferObject();

/// <inheritdoc cref="ClassNames.ExceptionObject"/>
[DefaultValue(ClassNames.ExceptionObject)]
public static partial ReadOnlySpan<Byte> ExceptionObject();

/// <inheritdoc cref="ClassNames.RuntimeExceptionObject"/>
[DefaultValue(ClassNames.RuntimeExceptionObject)]
public static partial ReadOnlySpan<Byte> RuntimeExceptionObject();
/// <inheritdoc cref="ClassNames.ErrorObject"/>
[DefaultValue(ClassNames.ErrorObject)]
public static partial ReadOnlySpan<Byte> ErrorObject();
/// <inheritdoc cref="ClassNames.LinkageErrorObject"/>
[DefaultValue(ClassNames.LinkageErrorObject)]
public static partial ReadOnlySpan<Byte> LinkageErrorObject();
/// <inheritdoc cref="ClassNames.VirtualMachineErrorObject"/>
[DefaultValue(ClassNames.VirtualMachineErrorObject)]
public static partial ReadOnlySpan<Byte> VirtualMachineErrorObject();
/// <inheritdoc cref="ClassNames.ClassFormatErrorObject"/>
[DefaultValue(ClassNames.ClassFormatErrorObject)]
public static partial ReadOnlySpan<Byte> ClassFormatErrorObject();
/// <inheritdoc cref="ClassNames.ClassCircularityErrorObject"/>
[DefaultValue(ClassNames.ClassCircularityErrorObject)]
public static partial ReadOnlySpan<Byte> ClassCircularityErrorObject();
/// <inheritdoc cref="ClassNames.OutOfMemoryErrorObject"/>
[DefaultValue(ClassNames.OutOfMemoryErrorObject)]
public static partial ReadOnlySpan<Byte> OutOfMemoryErrorObject();
/// <inheritdoc cref="ClassNames.ExceptionInInitializerErrorObject"/>
[DefaultValue(ClassNames.ExceptionInInitializerErrorObject)]
public static partial ReadOnlySpan<Byte> ExceptionInInitializerErrorObject();
/// <inheritdoc cref="ClassNames.IncompatibleClassChangeErrorObject"/>
[DefaultValue(ClassNames.IncompatibleClassChangeErrorObject)]
public static partial ReadOnlySpan<Byte> IncompatibleClassChangeErrorObject();
/// <inheritdoc cref="ClassNames.NoSuchMethodErrorObject"/>
[DefaultValue(ClassNames.NoSuchMethodErrorObject)]
public static partial ReadOnlySpan<Byte> NoSuchMethodErrorObject();
/// <inheritdoc cref="ClassNames.NoSuchFieldErrorObject"/>
[DefaultValue(ClassNames.NoSuchFieldErrorObject)]
public static partial ReadOnlySpan<Byte> NoSuchFieldErrorObject();
/// <inheritdoc cref="ClassNames.SecurityExceptionObject"/>
[DefaultValue(ClassNames.SecurityExceptionObject)]
public static partial ReadOnlySpan<Byte> SecurityExceptionObject();
/// <inheritdoc cref="ClassNames.ReflectiveOperationExceptionObject"/>
[DefaultValue(ClassNames.ReflectiveOperationExceptionObject)]
public static partial ReadOnlySpan<Byte> ReflectiveOperationExceptionObject();
/// <inheritdoc cref="ClassNames.InstantiationExceptionObject"/>
[DefaultValue(ClassNames.InstantiationExceptionObject)]
public static partial ReadOnlySpan<Byte> InstantiationExceptionObject();
/// <inheritdoc cref="ClassNames.IndexOutOfBoundsExceptionObject"/>
[DefaultValue(ClassNames.IndexOutOfBoundsExceptionObject)]
public static partial ReadOnlySpan<Byte> IndexOutOfBoundsExceptionObject();
/// <inheritdoc cref="ClassNames.StringIndexOutOfBoundsExceptionObject"/>
[DefaultValue(ClassNames.StringIndexOutOfBoundsExceptionObject)]
public static partial ReadOnlySpan<Byte> StringIndexOutOfBoundsExceptionObject();
/// <inheritdoc cref="ClassNames.ArrayIndexOutOfBoundsExceptionObject"/>
[DefaultValue(ClassNames.ArrayIndexOutOfBoundsExceptionObject)]
public static partial ReadOnlySpan<Byte> ArrayIndexOutOfBoundsExceptionObject();
/// <inheritdoc cref="ClassNames.ArrayStoreExceptionObject"/>
[DefaultValue(ClassNames.ArrayStoreExceptionObject)]
public static partial ReadOnlySpan<Byte> ArrayStoreExceptionObject();

/// <inheritdoc cref="ClassNames.VoidPrimitive"/>
[DefaultValue(ClassNames.VoidPrimitive)]
public static partial ReadOnlySpan<Byte> VoidPrimitive();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,22 @@ namespace Rxmxnx.JNetInterface.Internal;
/// This interface exposes an object that represents a java primitive wrapper.
/// </summary>
/// <typeparam name="TValue">Type of the .NET equivalent structure.</typeparam>
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
internal interface IPrimitiveValue<TValue> : IObject, IComparable, IConvertible, IWrapper<TValue>, IComparable<TValue>
where TValue : unmanaged, IComparable, IConvertible, IComparable<TValue>, IEquatable<TValue>
where TValue : unmanaged, IComparable, IConvertible, IEquatable<TValue>
{
[MethodImpl(MethodImplOptions.AggressiveInlining)]
Int32 IComparable<TValue>.CompareTo(TValue other) => this.Value.CompareTo(other);
Int32 IComparable.CompareTo(Object? obj)
=> obj switch
{
TValue value => this.Value.CompareTo(value),
IWrapper<TValue> wrapper => this.Value.CompareTo(wrapper.Value),
_ => this.Value.CompareTo(obj),
};
[MethodImpl(MethodImplOptions.AggressiveInlining)]
Int32 IComparable<TValue>.CompareTo(TValue other)
=> (this.Value as IComparable<TValue>)?.CompareTo(other) ?? this.Value.CompareTo(other);
TypeCode IConvertible.GetTypeCode() => this.Value.GetTypeCode();
Boolean IConvertible.ToBoolean(IFormatProvider? provider) => this.Value.ToBoolean(provider);
Byte IConvertible.ToByte(IFormatProvider? provider) => this.Value.ToByte(provider);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,7 @@ namespace Rxmxnx.JNetInterface.Internal;
/// <see cref="IComparable{TSelf}"/> interfaces.
/// </summary>
/// <typeparam name="TSelf">Type of object.</typeparam>
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
internal interface ISelfEquatableComparable<TSelf> : IEquatable<TSelf>, IComparable<TSelf>
where TSelf : ISelfEquatableComparable<TSelf>;
Loading
Loading