You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Breaking]: Visibility of fields/properties/classes does not match upstream tm4e implementation #123
I'm working on fixing this now as we discussed here. I'm creating this issue to document the changes here.
Note
I didn't examine other folders/files for similar discrepancies so there may be other changes needed.
The upstream java implementation declares StateStack (and some other classes in the .internal.grammar package as final (sealed in .NET). So if you wanted to have parity with the upstream impl, we should include a breaking change by declaring these classes as sealed. Also, notice it's in the .internal.grammar package, suggesting it's not meant for public extension anyways. Implementers could still implement IStateStack if desired.
Here is a list of upstream differences I found - I only looked in this folder/namespace. So, there may also be others:
changed the title [-]Visibililty of fields/properties/classes does not match upstream t4me implementation[/-][+]Visibililty of fields/properties/classes does not match upstream tm4e implementation[/+]on Mar 7, 2026
changed the title [-]Visibililty of fields/properties/classes does not match upstream tm4e implementation[/-][+]Visibility of fields/properties/classes does not match upstream tm4e implementation[/+]on Mar 7, 2026
changed the title [-]Visibility of fields/properties/classes does not match upstream tm4e implementation[/-][+][Breaking]: Visibility of fields/properties/classes does not match upstream tm4e implementation[/+]on Mar 7, 2026
I don't know how important the following is, so just lmk if it isn't a big deal...cool? Just wanted to bring it to your attention if you weren't aware....
I'm already fixing your CaptureRule class by making it sealed and changing the ctor to internal. But I also noticed diffs in the methods:
Even though there is no implementation in the upstream, you don't have a CompileAG method. Should I add one?
The upstream's Compile methods throws UnsupportedException, but yours returns null. Should this throw NotImplementedException instead of returning null?
I know there are others that have the method discrepancies but want to get your thoughts on how tight the parity should be.
When I originally ported the code, I did it as a fairly direct line-by-line translation from the Java implementation so the structure matched closely.
However, since then the upstream Java code has continued to evolve and those changes haven’t always been ported over.
So at this point I treat the upstream implementation more as a reference than a strict mirror. The goal is to keep behavioral compatibility where it matters, but not necessarily maintain a 1:1 API surface if it isn’t needed by the C# implementation.
Regarding the specific points:
If CompileAG is not actually required by the current flow in our implementation, I wouldn’t add it just for parity.
Returning null vs throwing NotImplementedException was mostly a pragmatic choice at the time since the method should never be hit in practice.
So in general: parity where it affects behavior is important, but we don’t need to mechanically replicate every upstream change unless it impacts functionality.
Activity
[-]Visibililty of fields/properties/classes does not match upstream t4me implementation[/-][+]Visibililty of fields/properties/classes does not match upstream tm4e implementation[/+][-]Visibililty of fields/properties/classes does not match upstream tm4e implementation[/-][+]Visibility of fields/properties/classes does not match upstream tm4e implementation[/+][-]Visibility of fields/properties/classes does not match upstream tm4e implementation[/-][+][Breaking]: Visibility of fields/properties/classes does not match upstream tm4e implementation[/+]udlose commentedon Mar 8, 2026
I don't know how important the following is, so just lmk if it isn't a big deal...cool? Just wanted to bring it to your attention if you weren't aware....
@danipen I was looking at the parity of some of the classes under https://github.com/eclipse-tm4e/tm4e/tree/main/org.eclipse.tm4e.core/src/main/java/org/eclipse/tm4e/core/internal/rule folder.
I was comparing the CaptureRule java class:
to your CaptureRule class:
I'm already fixing your CaptureRule class by making it
sealedand changing the ctor tointernal. But I also noticed diffs in the methods:CompileAGmethod. Should I add one?Compilemethods throwsUnsupportedException, but yours returnsnull. Should this throwNotImplementedExceptioninstead of returningnull?I know there are others that have the method discrepancies but want to get your thoughts on how tight the parity should be.
danipen commentedon Mar 8, 2026
When I originally ported the code, I did it as a fairly direct line-by-line translation from the Java implementation so the structure matched closely.
However, since then the upstream Java code has continued to evolve and those changes haven’t always been ported over.
So at this point I treat the upstream implementation more as a reference than a strict mirror. The goal is to keep behavioral compatibility where it matters, but not necessarily maintain a 1:1 API surface if it isn’t needed by the C# implementation.
Regarding the specific points:
CompileAGis not actually required by the current flow in our implementation, I wouldn’t add it just for parity.nullvs throwingNotImplementedExceptionwas mostly a pragmatic choice at the time since the method should never be hit in practice.So in general: parity where it affects behavior is important, but we don’t need to mechanically replicate every upstream change unless it impacts functionality.
udlose commentedon Mar 8, 2026
ok that helps and makes sense. thanks for the clarification!
Completes danipen#123
contributes to fixing danipen#123
Merge pull request #125 from udlose/fix/gethashcode-sealed-visibility…
Contributes to fixing danipen#123, sealed TMState