Skip to content

Commit 40038c8

Browse files
authored
Update java generator code to generate updated imports from maven (#894)
1 parent 9dca1bc commit 40038c8

File tree

2 files changed

+15
-15
lines changed

2 files changed

+15
-15
lines changed

Src/PCompiler/CompilerCore/Backend/Java/Constants.cs

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ internal static class Constants
1515
{
1616
#region P Java runtime constants
1717

18-
public static readonly string PRTNamespaceName = "com.amazon.pobserve.runtime";
18+
public static readonly string PRTNamespaceName = "pobserve.runtime";
1919

2020
public static readonly string TryAssertMethodName = "tryAssert";
2121
public static readonly string TryRaiseEventMethodName = "tryRaiseEvent";
@@ -117,15 +117,15 @@ internal static string AsFFIComment(string line)
117117
xsi:schemaLocation=""http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"">
118118
<modelVersion>4.0.0</modelVersion>
119119
120-
<groupId>com.amazon.p</groupId>
120+
<groupId>io.github.p</groupId>
121121
<artifactId>-package-name-</artifactId>
122122
<version>1.0-SNAPSHOT</version>
123123
124124
<name>-package-name-</name>
125125
<properties>
126126
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
127-
<maven.compiler.source>11</maven.compiler.source>
128-
<maven.compiler.target>11</maven.compiler.target>
127+
<maven.compiler.source>17</maven.compiler.source>
128+
<maven.compiler.target>17</maven.compiler.target>
129129
<buildDirectory>${{project.basedir}}/PObserve</buildDirectory>
130130
</properties>
131131
<packaging>jar</packaging>
@@ -185,35 +185,35 @@ internal static string AsFFIComment(string line)
185185
/// The fully-qualified name of the static `deepClone(PrtValue)` method exposed by
186186
/// the Java PRT runtime.
187187
/// </summary>
188-
internal static readonly string PrtDeepCloneMethodName = "com.amazon.pobserve.runtime.values.Clone.deepClone";
188+
internal static readonly string PrtDeepCloneMethodName = "pobserve.runtime.values.Clone.deepClone";
189189

190190
/// <summary>
191191
/// The fully-qualified name of the static `deepEquality(Object, Object)` method
192192
/// exposed by the Java PRT runtime.
193193
/// </summary>
194-
internal static readonly string PrtDeepEqualsMethodName = "com.amazon.pobserve.runtime.values.Equality.deepEquals";
194+
internal static readonly string PrtDeepEqualsMethodName = "pobserve.runtime.values.Equality.deepEquals";
195195

196196
/// <summary>
197197
/// The fully-qualified name of the static `compare(Comparable, Comparable)` method
198198
/// exposed by the Java PRT runtime.
199199
/// </summary>
200-
internal static readonly string PrtCompareMethodName = "com.amazon.pobserve.runtime.values.Equality.compare";
200+
internal static readonly string PrtCompareMethodName = "pobserve.runtime.values.Equality.compare";
201201

202202
/// <summary>
203203
/// The fully-qualified name of the static `elementAt(LinkedHashSet, long)` method
204204
/// exposed by the Java PRT runtime.
205205
/// </summary>
206-
internal static readonly string PrtSetElementAtMethodName = "com.amazon.pobserve.runtime.values.SetIndexing.elementAt";
206+
internal static readonly string PrtSetElementAtMethodName = "pobserve.runtime.values.SetIndexing.elementAt";
207207

208208
/// <summary>
209209
/// The fully-qualified class name of the Java P runtime's PValue class.
210210
/// </summary>
211-
internal static readonly string PValueClass = "com.amazon.pobserve.runtime.values.PValue";
211+
internal static readonly string PValueClass = "pobserve.runtime.values.PValue";
212212

213213
/// <summary>
214214
/// The fully-qualified class name of the Java P runtime's PEvent class.
215215
/// </summary>
216-
internal static readonly string EventsClass = "com.amazon.pobserve.runtime.events.PEvent";
216+
internal static readonly string EventsClass = "pobserve.runtime.events.PEvent";
217217

218218
#endregion
219219

Src/PCompiler/CompilerCore/Backend/Java/MachineGenerator.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ private void WriteMonitorDecl()
7676
{
7777
var cname = Names.GetNameForDecl(_currentMachine);
7878

79-
WriteLine($"public static class {cname} extends com.amazon.pobserve.runtime.Monitor<{cname}.{Constants.StateEnumName}> implements Serializable {{");
79+
WriteLine($"public static class {cname} extends pobserve.runtime.Monitor<{cname}.{Constants.StateEnumName}> implements Serializable {{");
8080

8181
WriteLine();
8282
WriteSupplierCDef(cname);
@@ -229,11 +229,11 @@ private void WriteFunctionSignature(Function f)
229229
var throwables = new List<string>();
230230
if (f.CanChangeState)
231231
{
232-
throwables.Add("com.amazon.pobserve.runtime.exceptions.TransitionException");
232+
throwables.Add("pobserve.runtime.exceptions.TransitionException");
233233
}
234234
if (f.CanRaiseEvent)
235235
{
236-
throwables.Add("com.amazon.pobserve.runtime.exceptions.RaiseEventException");
236+
throwables.Add("pobserve.runtime.exceptions.RaiseEventException");
237237
}
238238
if (throwables.Count > 0)
239239
{
@@ -283,9 +283,9 @@ private void WriteEventsAccessor()
283283
private void WriteStateBuilderDecl(State s, bool isConstructor)
284284
{
285285
if (isConstructor) {
286-
WriteLine($"addState(com.amazon.pobserve.runtime.State.keyedOn({Names.IdentForState(s)})");
286+
WriteLine($"addState(pobserve.runtime.State.keyedOn({Names.IdentForState(s)})");
287287
} else {
288-
WriteLine($"registerState(com.amazon.pobserve.runtime.State.keyedOn({Names.IdentForState(s)})");
288+
WriteLine($"registerState(pobserve.runtime.State.keyedOn({Names.IdentForState(s)})");
289289
}
290290

291291
if (s.IsStart)

0 commit comments

Comments
 (0)