Skip to content

Commit 88427c9

Browse files
Ted SteinChad Walters
Ted Stein
authored and
Chad Walters
committed
Move Java world to org.bondlib.
1 parent 849a9a4 commit 88427c9

File tree

167 files changed

+798
-909
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

167 files changed

+798
-909
lines changed

compiler/src/Language/Bond/Codegen/Java/Class_java.hs

+72-72
Large diffs are not rendered by default.

compiler/src/Language/Bond/Codegen/Java/Enum_java.hs

+4-4
Original file line numberDiff line numberDiff line change
@@ -29,15 +29,15 @@ package #{javaPackage};
2929

3030
typeDefinition Enum {..} = [lt|
3131
#{Java.generatedClassAnnotations}
32-
public final class #{declName} implements com.microsoft.bond.BondEnum<#{declName}> {
32+
public final class #{declName} implements org.bondlib.BondEnum<#{declName}> {
3333

3434
public static final class Values {
3535
private Values() {}
3636

3737
#{newlineSep 2 constantIntValueDecl enumConstantsWithInt}
3838
}
3939

40-
private static final class EnumBondTypeImpl extends com.microsoft.bond.EnumBondType<#{declName}> {
40+
private static final class EnumBondTypeImpl extends org.bondlib.EnumBondType<#{declName}> {
4141

4242
@Override
4343
public java.lang.Class<#{declName}> getValueClass() { return #{declName}.class; }
@@ -46,7 +46,7 @@ public final class #{declName} implements com.microsoft.bond.BondEnum<#{declName
4646
public final #{declName} getEnumValue(int value) { return get(value); }
4747
}
4848

49-
public static final com.microsoft.bond.EnumBondType<#{declName}> BOND_TYPE = new EnumBondTypeImpl();
49+
public static final org.bondlib.EnumBondType<#{declName}> BOND_TYPE = new EnumBondTypeImpl();
5050

5151
#{newlineSep 1 constantObjectDecl enumConstantsWithInt}
5252

@@ -63,7 +63,7 @@ public final class #{declName} implements com.microsoft.bond.BondEnum<#{declName
6363
public final String getLabel() { return this.label; }
6464

6565
@Override
66-
public final com.microsoft.bond.EnumBondType<#{declName}> getBondType() { return BOND_TYPE; }
66+
public final org.bondlib.EnumBondType<#{declName}> getBondType() { return BOND_TYPE; }
6767

6868
@Override
6969
public final int compareTo(#{declName} o) { return this.value < o.value ? -1 : (this.value > o.value ? 1 : 0); }

compiler/src/Language/Bond/Codegen/Java/Util.hs

+3-3
Original file line numberDiff line numberDiff line change
@@ -33,9 +33,9 @@ generatedClassAnnotations = [lt|@javax.annotation.Generated("gbc")|]
3333

3434
-- returns the qualified name of Modifier constant
3535
modifierConstantName :: Modifier -> Text
36-
modifierConstantName Optional = [lt|com.microsoft.bond.Modifier.Optional|]
37-
modifierConstantName Required = [lt|com.microsoft.bond.Modifier.Required|]
38-
modifierConstantName RequiredOptional = [lt|com.microsoft.bond.Modifier.RequiredOptional|]
36+
modifierConstantName Optional = [lt|org.bondlib.Modifier.Optional|]
37+
modifierConstantName Required = [lt|org.bondlib.Modifier.Required|]
38+
modifierConstantName RequiredOptional = [lt|org.bondlib.Modifier.RequiredOptional|]
3939

4040
-- returns a value indicating whether a type is a non-enum Bond primitive type
4141
isPrimitiveNonEnumBondType :: Type -> Bool

compiler/src/Language/Bond/Codegen/TypeMapping.hs

+14-14
Original file line numberDiff line numberDiff line change
@@ -511,29 +511,29 @@ javaType BT_String = pure "java.lang.String"
511511
javaType BT_WString = pure "java.lang.String"
512512
javaType BT_MetaName = pure "java.lang.String"
513513
javaType BT_MetaFullName = pure "java.lang.String"
514-
javaType BT_Blob = pure "com.microsoft.bond.Blob"
514+
javaType BT_Blob = pure "org.bondlib.Blob"
515515
javaType (BT_IntTypeArg x) = pureText x
516-
javaType (BT_Maybe BT_Int8) = pure "com.microsoft.bond.SomethingByte"
517-
javaType (BT_Maybe BT_Int16) = pure "com.microsoft.bond.SomethingShort"
518-
javaType (BT_Maybe BT_Int32) = pure "com.microsoft.bond.SomethingInteger"
519-
javaType (BT_Maybe BT_Int64) = pure "com.microsoft.bond.SomethingLong"
520-
javaType (BT_Maybe BT_UInt8) = pure "com.microsoft.bond.SomethingByte"
521-
javaType (BT_Maybe BT_UInt16) = pure "com.microsoft.bond.SomethingShort"
522-
javaType (BT_Maybe BT_UInt32) = pure "com.microsoft.bond.SomethingInteger"
523-
javaType (BT_Maybe BT_UInt64) = pure "com.microsoft.bond.SomethingLong"
524-
javaType (BT_Maybe BT_Float) = pure "com.microsoft.bond.SomethingFloat"
525-
javaType (BT_Maybe BT_Double) = pure "com.microsoft.bond.SomethingDouble"
526-
javaType (BT_Maybe BT_Bool) = pure "com.microsoft.bond.SomethingBoolean"
516+
javaType (BT_Maybe BT_Int8) = pure "org.bondlib.SomethingByte"
517+
javaType (BT_Maybe BT_Int16) = pure "org.bondlib.SomethingShort"
518+
javaType (BT_Maybe BT_Int32) = pure "org.bondlib.SomethingInteger"
519+
javaType (BT_Maybe BT_Int64) = pure "org.bondlib.SomethingLong"
520+
javaType (BT_Maybe BT_UInt8) = pure "org.bondlib.SomethingByte"
521+
javaType (BT_Maybe BT_UInt16) = pure "org.bondlib.SomethingShort"
522+
javaType (BT_Maybe BT_UInt32) = pure "org.bondlib.SomethingInteger"
523+
javaType (BT_Maybe BT_UInt64) = pure "org.bondlib.SomethingLong"
524+
javaType (BT_Maybe BT_Float) = pure "org.bondlib.SomethingFloat"
525+
javaType (BT_Maybe BT_Double) = pure "org.bondlib.SomethingDouble"
526+
javaType (BT_Maybe BT_Bool) = pure "org.bondlib.SomethingBoolean"
527527
javaType (BT_UserDefined a@Alias {} args) = javaType (resolveAlias a args)
528528
javaType (BT_Maybe (BT_UserDefined a@Alias {} args)) = javaType (BT_Maybe (resolveAlias a args))
529-
javaType (BT_Maybe fieldType) = "com.microsoft.bond.SomethingObject<" <>> javaBoxedType fieldType <<> ">"
529+
javaType (BT_Maybe fieldType) = "org.bondlib.SomethingObject<" <>> javaBoxedType fieldType <<> ">"
530530
javaType (BT_Nullable elementType) = javaBoxedType elementType
531531
javaType (BT_List elementType) = "java.util.List<" <>> elementTypeName elementType <<> ">"
532532
javaType (BT_Vector elementType) = "java.util.List<" <>> elementTypeName elementType <<> ">"
533533
javaType (BT_Set elementType) = "java.util.Set<" <>> elementTypeName elementType <<> ">"
534534
javaType (BT_Map keyType valueType) = "java.util.Map<" <>> elementTypeName keyType <<>> ", " <>> elementTypeName valueType <<> ">"
535535
javaType (BT_TypeParam param) = pureText $ paramName param
536-
javaType (BT_Bonded structType) = "com.microsoft.bond.Bonded<" <>> javaBoxedType structType <<> ">"
536+
javaType (BT_Bonded structType) = "org.bondlib.Bonded<" <>> javaBoxedType structType <<> ">"
537537
javaType (BT_UserDefined decl args) =
538538
declQualifiedTypeName decl <<>> (angles <$> localWith (const javaBoxedTypeMapping) (commaSepTypeNames args))
539539

compiler/tests/generated/aliases_concatenated.java

+34-34
Original file line numberDiff line numberDiff line change
@@ -2,22 +2,22 @@
22
package tests;
33

44
@javax.annotation.Generated("gbc")
5-
public class Foo<T> implements com.microsoft.bond.BondSerializable {
5+
public class Foo<T> implements org.bondlib.BondSerializable {
66

77
public static abstract class GenericBondTypeBuilder {
88

99
private GenericBondTypeBuilder() {
1010
}
1111

12-
public abstract <T> com.microsoft.bond.StructBondType<Foo<T>> makeGenericType(com.microsoft.bond.BondType<T> T);
12+
public abstract <T> org.bondlib.StructBondType<Foo<T>> makeGenericType(org.bondlib.BondType<T> T);
1313
}
1414

15-
private static final class StructBondTypeImpl<T> extends com.microsoft.bond.StructBondType<Foo<T>> {
15+
private static final class StructBondTypeImpl<T> extends org.bondlib.StructBondType<Foo<T>> {
1616

17-
static final class StructBondTypeBuilderImpl extends com.microsoft.bond.StructBondType.StructBondTypeBuilder<Foo> {
17+
static final class StructBondTypeBuilderImpl extends org.bondlib.StructBondType.StructBondTypeBuilder<Foo> {
1818

19-
private <T> com.microsoft.bond.StructBondType<Foo<T>> makeGenericType(com.microsoft.bond.BondType<T> T) {
20-
com.microsoft.bond.helpers.ArgumentHelper.ensureNotNull(T, "T");
19+
private <T> org.bondlib.StructBondType<Foo<T>> makeGenericType(org.bondlib.BondType<T> T) {
20+
org.bondlib.helpers.ArgumentHelper.ensureNotNull(T, "T");
2121
return (StructBondTypeImpl) this.getInitializedFromCache(T);
2222
}
2323

@@ -27,25 +27,25 @@ public final int getGenericTypeParameterCount() {
2727
}
2828

2929
@Override
30-
protected final com.microsoft.bond.StructBondType<Foo> buildNewInstance(com.microsoft.bond.BondType[] genericTypeArguments) {
31-
return new StructBondTypeImpl(new com.microsoft.bond.GenericTypeSpecialization(genericTypeArguments));
30+
protected final org.bondlib.StructBondType<Foo> buildNewInstance(org.bondlib.BondType[] genericTypeArguments) {
31+
return new StructBondTypeImpl(new org.bondlib.GenericTypeSpecialization(genericTypeArguments));
3232
}
3333

3434
static void register() {
3535
registerStructType(Foo.class, new StructBondTypeBuilderImpl());
3636
}
3737
}
3838

39-
private com.microsoft.bond.StructBondType.ObjectStructField<java.util.List<java.util.List<T>>> aa;
39+
private org.bondlib.StructBondType.ObjectStructField<java.util.List<java.util.List<T>>> aa;
4040

41-
private StructBondTypeImpl(com.microsoft.bond.GenericTypeSpecialization genericTypeSpecialization) {
41+
private StructBondTypeImpl(org.bondlib.GenericTypeSpecialization genericTypeSpecialization) {
4242
super(genericTypeSpecialization);
4343
}
4444

4545
@Override
4646
protected final void initialize() {
47-
com.microsoft.bond.BondType<T> T = this.getGenericSpecialization().getGenericTypeArgument(0);
48-
this.aa = new com.microsoft.bond.StructBondType.ObjectStructField<java.util.List<java.util.List<T>>>(this, vectorOf(vectorOf(T)), 0, "aa", com.microsoft.bond.Modifier.Optional);
47+
org.bondlib.BondType<T> T = this.getGenericSpecialization().getGenericTypeArgument(0);
48+
this.aa = new org.bondlib.StructBondType.ObjectStructField<java.util.List<java.util.List<T>>>(this, vectorOf(vectorOf(T)), 0, "aa", org.bondlib.Modifier.Optional);
4949
super.initializeBaseAndFields(null, this.aa);
5050
}
5151

@@ -70,12 +70,12 @@ public final Foo<T> newInstance() {
7070
}
7171

7272
@Override
73-
protected final void serializeStructFields(com.microsoft.bond.BondType.SerializationContext context, Foo<T> value) throws java.io.IOException {
73+
protected final void serializeStructFields(org.bondlib.BondType.SerializationContext context, Foo<T> value) throws java.io.IOException {
7474
this.aa.serialize(context, value.aa);
7575
}
7676

7777
@Override
78-
protected final void deserializeStructFields(com.microsoft.bond.BondType.TaggedDeserializationContext context, Foo<T> value) throws java.io.IOException {
78+
protected final void deserializeStructFields(org.bondlib.BondType.TaggedDeserializationContext context, Foo<T> value) throws java.io.IOException {
7979
boolean __has_aa = false;
8080
while (this.readField(context)) {
8181
switch (context.readFieldResult.id) {
@@ -92,7 +92,7 @@ protected final void deserializeStructFields(com.microsoft.bond.BondType.TaggedD
9292
}
9393

9494
@Override
95-
protected final void deserializeStructFields(com.microsoft.bond.BondType.UntaggedDeserializationContext context, Foo<T> value) throws java.io.IOException {
95+
protected final void deserializeStructFields(org.bondlib.BondType.UntaggedDeserializationContext context, Foo<T> value) throws java.io.IOException {
9696
value.aa = this.aa.deserialize(context);
9797
}
9898

@@ -112,7 +112,7 @@ protected final void cloneStructFields(Foo<T> fromValue, Foo<T> toValue) {
112112
final StructBondTypeImpl.StructBondTypeBuilderImpl builder = new StructBondTypeImpl.StructBondTypeBuilderImpl();
113113

114114
@Override
115-
public final <T> com.microsoft.bond.StructBondType<Foo<T>> makeGenericType(com.microsoft.bond.BondType<T> T) {
115+
public final <T> org.bondlib.StructBondType<Foo<T>> makeGenericType(org.bondlib.BondType<T> T) {
116116
return this.builder.makeGenericType(T);
117117
}
118118
};
@@ -128,7 +128,7 @@ public static void initializeBondType() {
128128

129129
public java.util.List<java.util.List<T>> aa;
130130

131-
public Foo(com.microsoft.bond.StructBondType<Foo<T>> genericType) {
131+
public Foo(org.bondlib.StructBondType<Foo<T>> genericType) {
132132
super();
133133
this.__genericType = (StructBondTypeImpl<T>)genericType;
134134
this.__genericType.initializeStructFields(this);
@@ -153,7 +153,7 @@ public int hashCode() {
153153
}
154154

155155
@Override
156-
public com.microsoft.bond.StructBondType<? extends Foo<T>> getBondType() {
156+
public org.bondlib.StructBondType<? extends Foo<T>> getBondType() {
157157
return this.__genericType;
158158
}
159159
}
@@ -162,15 +162,15 @@ public com.microsoft.bond.StructBondType<? extends Foo<T>> getBondType() {
162162

163163

164164
@javax.annotation.Generated("gbc")
165-
public final class EnumToWrap implements com.microsoft.bond.BondEnum<EnumToWrap> {
165+
public final class EnumToWrap implements org.bondlib.BondEnum<EnumToWrap> {
166166

167167
public static final class Values {
168168
private Values() {}
169169

170170
public static final int anEnumValue = 0;
171171
}
172172

173-
private static final class EnumBondTypeImpl extends com.microsoft.bond.EnumBondType<EnumToWrap> {
173+
private static final class EnumBondTypeImpl extends org.bondlib.EnumBondType<EnumToWrap> {
174174

175175
@Override
176176
public java.lang.Class<EnumToWrap> getValueClass() { return EnumToWrap.class; }
@@ -179,7 +179,7 @@ private static final class EnumBondTypeImpl extends com.microsoft.bond.EnumBondT
179179
public final EnumToWrap getEnumValue(int value) { return get(value); }
180180
}
181181

182-
public static final com.microsoft.bond.EnumBondType<EnumToWrap> BOND_TYPE = new EnumBondTypeImpl();
182+
public static final org.bondlib.EnumBondType<EnumToWrap> BOND_TYPE = new EnumBondTypeImpl();
183183

184184
public static final EnumToWrap anEnumValue = new EnumToWrap(Values.anEnumValue, "anEnumValue");
185185

@@ -196,7 +196,7 @@ private static final class EnumBondTypeImpl extends com.microsoft.bond.EnumBondT
196196
public final String getLabel() { return this.label; }
197197

198198
@Override
199-
public final com.microsoft.bond.EnumBondType<EnumToWrap> getBondType() { return BOND_TYPE; }
199+
public final org.bondlib.EnumBondType<EnumToWrap> getBondType() { return BOND_TYPE; }
200200

201201
@Override
202202
public final int compareTo(EnumToWrap o) { return this.value < o.value ? -1 : (this.value > o.value ? 1 : 0); }
@@ -231,19 +231,19 @@ public static EnumToWrap valueOf(String str) {
231231
package tests;
232232

233233
@javax.annotation.Generated("gbc")
234-
public class WrappingAnEnum implements com.microsoft.bond.BondSerializable {
234+
public class WrappingAnEnum implements org.bondlib.BondSerializable {
235235

236-
private static final class StructBondTypeImpl extends com.microsoft.bond.StructBondType<WrappingAnEnum> {
236+
private static final class StructBondTypeImpl extends org.bondlib.StructBondType<WrappingAnEnum> {
237237

238-
static final class StructBondTypeBuilderImpl extends com.microsoft.bond.StructBondType.StructBondTypeBuilder<WrappingAnEnum> {
238+
static final class StructBondTypeBuilderImpl extends org.bondlib.StructBondType.StructBondTypeBuilder<WrappingAnEnum> {
239239

240240
@Override
241241
public final int getGenericTypeParameterCount() {
242242
return 0;
243243
}
244244

245245
@Override
246-
protected final com.microsoft.bond.StructBondType<WrappingAnEnum> buildNewInstance(com.microsoft.bond.BondType[] genericTypeArguments) {
246+
protected final org.bondlib.StructBondType<WrappingAnEnum> buildNewInstance(org.bondlib.BondType[] genericTypeArguments) {
247247
return new StructBondTypeImpl(null);
248248
}
249249

@@ -252,15 +252,15 @@ static void register() {
252252
}
253253
}
254254

255-
private com.microsoft.bond.StructBondType.EnumStructField<tests.EnumToWrap> aWrappedEnum;
255+
private org.bondlib.StructBondType.EnumStructField<tests.EnumToWrap> aWrappedEnum;
256256

257-
private StructBondTypeImpl(com.microsoft.bond.GenericTypeSpecialization genericTypeSpecialization) {
257+
private StructBondTypeImpl(org.bondlib.GenericTypeSpecialization genericTypeSpecialization) {
258258
super(genericTypeSpecialization);
259259
}
260260

261261
@Override
262262
protected final void initialize() {
263-
this.aWrappedEnum = new com.microsoft.bond.StructBondType.EnumStructField<tests.EnumToWrap>(this, tests.EnumToWrap.BOND_TYPE, 0, "aWrappedEnum", com.microsoft.bond.Modifier.Optional);
263+
this.aWrappedEnum = new org.bondlib.StructBondType.EnumStructField<tests.EnumToWrap>(this, tests.EnumToWrap.BOND_TYPE, 0, "aWrappedEnum", org.bondlib.Modifier.Optional);
264264
super.initializeBaseAndFields(null, this.aWrappedEnum);
265265
}
266266

@@ -285,12 +285,12 @@ public final WrappingAnEnum newInstance() {
285285
}
286286

287287
@Override
288-
protected final void serializeStructFields(com.microsoft.bond.BondType.SerializationContext context, WrappingAnEnum value) throws java.io.IOException {
288+
protected final void serializeStructFields(org.bondlib.BondType.SerializationContext context, WrappingAnEnum value) throws java.io.IOException {
289289
this.aWrappedEnum.serialize(context, value.aWrappedEnum);
290290
}
291291

292292
@Override
293-
protected final void deserializeStructFields(com.microsoft.bond.BondType.TaggedDeserializationContext context, WrappingAnEnum value) throws java.io.IOException {
293+
protected final void deserializeStructFields(org.bondlib.BondType.TaggedDeserializationContext context, WrappingAnEnum value) throws java.io.IOException {
294294
boolean __has_aWrappedEnum = false;
295295
while (this.readField(context)) {
296296
switch (context.readFieldResult.id) {
@@ -307,7 +307,7 @@ protected final void deserializeStructFields(com.microsoft.bond.BondType.TaggedD
307307
}
308308

309309
@Override
310-
protected final void deserializeStructFields(com.microsoft.bond.BondType.UntaggedDeserializationContext context, WrappingAnEnum value) throws java.io.IOException {
310+
protected final void deserializeStructFields(org.bondlib.BondType.UntaggedDeserializationContext context, WrappingAnEnum value) throws java.io.IOException {
311311
value.aWrappedEnum = this.aWrappedEnum.deserialize(context);
312312
}
313313

@@ -322,7 +322,7 @@ protected final void cloneStructFields(WrappingAnEnum fromValue, WrappingAnEnum
322322
}
323323
}
324324

325-
public static final com.microsoft.bond.StructBondType<WrappingAnEnum> BOND_TYPE = new StructBondTypeImpl.StructBondTypeBuilderImpl().getInitializedFromCache();
325+
public static final org.bondlib.StructBondType<WrappingAnEnum> BOND_TYPE = new StructBondTypeImpl.StructBondTypeBuilderImpl().getInitializedFromCache();
326326

327327
public static void initializeBondType() {
328328
StructBondTypeImpl.StructBondTypeBuilderImpl.register();
@@ -359,7 +359,7 @@ public int hashCode() {
359359
}
360360

361361
@Override
362-
public com.microsoft.bond.StructBondType<? extends WrappingAnEnum> getBondType() {
362+
public org.bondlib.StructBondType<? extends WrappingAnEnum> getBondType() {
363363
return BOND_TYPE;
364364
}
365365
}

0 commit comments

Comments
 (0)