Skip to content

Commit 31a8660

Browse files
authored
Update java generator code to output updated prt imports (#819)
1 parent 27a1d2f commit 31a8660

File tree

2 files changed

+12
-28
lines changed

2 files changed

+12
-28
lines changed

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

Lines changed: 7 additions & 23 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 = "prt";
18+
public static readonly string PRTNamespaceName = "com.amazon.pobserve.runtime";
1919

2020
public static readonly string TryAssertMethodName = "tryAssert";
2121
public static readonly string TryRaiseEventMethodName = "tryRaiseEvent";
@@ -130,22 +130,6 @@ internal static string AsFFIComment(string line)
130130
</properties>
131131
<packaging>jar</packaging>
132132
133-
<dependencies>
134-
<dependency>
135-
<groupId>p.runtime</groupId>
136-
<artifactId>PJavaRuntime</artifactId>
137-
<version>1.0-SNAPSHOT</version>
138-
139-
<!-- Do not transitively bundle log4j as whoever uses this jar will also depend on it. -->
140-
<exclusions>
141-
<exclusion>
142-
<groupId>org.apache.logging.log4j</groupId>
143-
<artifactId>*</artifactId>
144-
</exclusion>
145-
</exclusions>
146-
</dependency>
147-
</dependencies>
148-
149133
<build>
150134
<plugins>
151135
-foreign-include-
@@ -201,35 +185,35 @@ internal static string AsFFIComment(string line)
201185
/// The fully-qualified name of the static `deepClone(PrtValue)` method exposed by
202186
/// the Java PRT runtime.
203187
/// </summary>
204-
internal static readonly string PrtDeepCloneMethodName = "prt.values.Clone.deepClone";
188+
internal static readonly string PrtDeepCloneMethodName = "com.amazon.pobserve.runtime.values.Clone.deepClone";
205189

206190
/// <summary>
207191
/// The fully-qualified name of the static `deepEquality(Object, Object)` method
208192
/// exposed by the Java PRT runtime.
209193
/// </summary>
210-
internal static readonly string PrtDeepEqualsMethodName = "prt.values.Equality.deepEquals";
194+
internal static readonly string PrtDeepEqualsMethodName = "com.amazon.pobserve.runtime.values.Equality.deepEquals";
211195

212196
/// <summary>
213197
/// The fully-qualified name of the static `compare(Comparable, Comparable)` method
214198
/// exposed by the Java PRT runtime.
215199
/// </summary>
216-
internal static readonly string PrtCompareMethodName = "prt.values.Equality.compare";
200+
internal static readonly string PrtCompareMethodName = "com.amazon.pobserve.runtime.values.Equality.compare";
217201

218202
/// <summary>
219203
/// The fully-qualified name of the static `elementAt(LinkedHashSet, long)` method
220204
/// exposed by the Java PRT runtime.
221205
/// </summary>
222-
internal static readonly string PrtSetElementAtMethodName = "prt.values.SetIndexing.elementAt";
206+
internal static readonly string PrtSetElementAtMethodName = "com.amazon.pobserve.runtime.values.SetIndexing.elementAt";
223207

224208
/// <summary>
225209
/// The fully-qualified class name of the Java P runtime's PValue class.
226210
/// </summary>
227-
internal static readonly string PValueClass = "prt.values.PValue";
211+
internal static readonly string PValueClass = "com.amazon.pobserve.runtime.values.PValue";
228212

229213
/// <summary>
230214
/// The fully-qualified class name of the Java P runtime's PEvent class.
231215
/// </summary>
232-
internal static readonly string EventsClass = "prt.events.PEvent";
216+
internal static readonly string EventsClass = "com.amazon.pobserve.runtime.events.PEvent";
233217

234218
#endregion
235219

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

8181
WriteLine();
8282
WriteSupplierCDef(cname);
@@ -230,11 +230,11 @@ private void WriteFunctionSignature(Function f)
230230
var throwables = new List<string>();
231231
if (f.CanChangeState)
232232
{
233-
throwables.Add("prt.exceptions.TransitionException");
233+
throwables.Add("com.amazon.pobserve.runtime.exceptions.TransitionException");
234234
}
235235
if (f.CanRaiseEvent)
236236
{
237-
throwables.Add("prt.exceptions.RaiseEventException");
237+
throwables.Add("com.amazon.pobserve.runtime.exceptions.RaiseEventException");
238238
}
239239
if (throwables.Count > 0)
240240
{
@@ -284,9 +284,9 @@ private void WriteEventsAccessor()
284284
private void WriteStateBuilderDecl(State s, bool isConstructor)
285285
{
286286
if (isConstructor) {
287-
WriteLine($"addState(prt.State.keyedOn({Names.IdentForState(s)})");
287+
WriteLine($"addState(com.amazon.pobserve.runtime.State.keyedOn({Names.IdentForState(s)})");
288288
} else {
289-
WriteLine($"registerState(prt.State.keyedOn({Names.IdentForState(s)})");
289+
WriteLine($"registerState(com.amazon.pobserve.runtime.State.keyedOn({Names.IdentForState(s)})");
290290
}
291291

292292
if (s.IsStart)

0 commit comments

Comments
 (0)