-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add fixtures default_values_{before,after}_rectification
Summary: To compare generated output in preparation of custom value cleanup: the "before" module.thrift shows the possible custom default values today, and the "after" shows what the desired corresponding file would look like without these values. Reviewed By: praihan, createdbysk Differential Revision: D68504535 fbshipit-source-id: c015cb74fc4aa35de19ad4ceeb3863f0e2e17a08
- Loading branch information
1 parent
52ae2e2
commit 1c14921
Showing
106 changed files
with
15,129 additions
and
0 deletions.
There are no files selected for viewing
13 changes: 13 additions & 0 deletions
13
third-party/thrift/src/thrift/compiler/test/fixtures/default_values_rectification_after/cmd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
android: android src/module.thrift | ||
ast: thrift2ast-ast:protocol=debug,root_program_only,use_hash,no_backcompat src/module.thrift | ||
cpp2: mstch_cpp2 src/module.thrift | ||
go: mstch_go src/module.thrift | ||
hack: hack:hack_collections=1 src/module.thrift | ||
java: mstch_java src/module.thrift | ||
java_deprecated: java_deprecated src/module.thrift | ||
json: json src/module.thrift | ||
json_experimental: json_experimental src/module.thrift | ||
py3: mstch_py3 src/module.thrift | ||
py: py src/module.thrift | ||
python: mstch_python src/module.thrift | ||
rust: mstch_rust src/module.thrift |
114 changes: 114 additions & 0 deletions
114
...test/fixtures/default_values_rectification_after/out/android/gen-android/EmptyStruct.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,114 @@ | ||
/** | ||
* Autogenerated by Thrift | ||
* | ||
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING | ||
* @generated | ||
*/ | ||
import java.util.List; | ||
import java.util.ArrayList; | ||
import java.util.Map; | ||
import java.util.HashMap; | ||
import java.util.Set; | ||
import java.util.HashSet; | ||
import java.util.Collections; | ||
import java.util.BitSet; | ||
import java.util.Arrays; | ||
import com.facebook.thrift.*; | ||
import com.facebook.thrift.annotations.*; | ||
import com.facebook.thrift.async.*; | ||
import com.facebook.thrift.meta_data.*; | ||
import com.facebook.thrift.server.*; | ||
import com.facebook.thrift.transport.*; | ||
import com.facebook.thrift.protocol.*; | ||
|
||
@SuppressWarnings({ "unused", "serial" }) | ||
public class EmptyStruct implements TBase, java.io.Serializable, Cloneable { | ||
private static final TStruct STRUCT_DESC = new TStruct("EmptyStruct"); | ||
|
||
|
||
public EmptyStruct() { | ||
} | ||
|
||
/** | ||
* Performs a deep copy on <i>other</i>. | ||
*/ | ||
public EmptyStruct(EmptyStruct other) { | ||
} | ||
|
||
public EmptyStruct deepCopy() { | ||
return new EmptyStruct(this); | ||
} | ||
|
||
@Override | ||
public boolean equals(Object _that) { | ||
if (_that == null) | ||
return false; | ||
if (this == _that) | ||
return true; | ||
if (!(_that instanceof EmptyStruct)) | ||
return false; | ||
EmptyStruct that = (EmptyStruct)_that; | ||
|
||
return true; | ||
} | ||
|
||
@Override | ||
public int hashCode() { | ||
return Arrays.deepHashCode(new Object[] {}); | ||
} | ||
|
||
// This is required to satisfy the TBase interface, but can't be implemented on immutable struture. | ||
public void read(TProtocol iprot) throws TException { | ||
throw new TException("unimplemented in android immutable structure"); | ||
} | ||
|
||
public static EmptyStruct deserialize(TProtocol iprot) throws TException { | ||
TField __field; | ||
iprot.readStructBegin(); | ||
while (true) | ||
{ | ||
__field = iprot.readFieldBegin(); | ||
if (__field.type == TType.STOP) { | ||
break; | ||
} | ||
switch (__field.id) | ||
{ | ||
default: | ||
TProtocolUtil.skip(iprot, __field.type); | ||
break; | ||
} | ||
iprot.readFieldEnd(); | ||
} | ||
iprot.readStructEnd(); | ||
|
||
EmptyStruct _that; | ||
_that = new EmptyStruct( | ||
); | ||
_that.validate(); | ||
return _that; | ||
} | ||
|
||
public void write(TProtocol oprot) throws TException { | ||
validate(); | ||
|
||
oprot.writeStructBegin(STRUCT_DESC); | ||
oprot.writeFieldStop(); | ||
oprot.writeStructEnd(); | ||
} | ||
|
||
@Override | ||
public String toString() { | ||
return toString(1, true); | ||
} | ||
|
||
@Override | ||
public String toString(int indent, boolean prettyPrint) { | ||
return TBaseHelper.toStringHelper(this, indent, prettyPrint); | ||
} | ||
|
||
public void validate() throws TException { | ||
// check for required fields | ||
} | ||
|
||
} | ||
|
Oops, something went wrong.