Skip to content

Commit 6da7a31

Browse files
generatedunixname89002005232357facebook-github-bot
authored andcommitted
Revert D79466105
Summary: This diff reverts D79466105 false positive Depends on D79466105 Differential Revision: D79467372 fbshipit-source-id: 1eaab4f66dec134aead9686ccb2e3e2b402f03a3
1 parent 8006a27 commit 6da7a31

File tree

67 files changed

+9522
-10
lines changed

Some content is hidden

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

67 files changed

+9522
-10
lines changed

third-party/thrift/src/thrift/annotation/hack.thrift

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,3 +210,21 @@ struct ModuleInternal {}
210210
@scope.Service
211211
@scope.Function
212212
struct GenerateClientMethodsWithHeaders {}
213+
214+
/**
215+
* Generated Hack types are being changed to `final` by default.
216+
*
217+
* For existing thrift types that are inherited from and cannot be easily migrated,
218+
* use this annotation to make the generated class non-final.
219+
*/
220+
@scope.Structured
221+
struct MigrationBlockingAllowInheritance {}
222+
223+
/**
224+
* Hack Unions without the `protected` compiler option may rely on `fb_json_serialize` for JSON serialization.
225+
* Adding this annotation will implement the JSONSerializable Hack interface allowing `fb_json_serialize` to continue being used.
226+
*
227+
* Note: This should only be used for migration purposes. Use `JSONThriftSerializer` instead.
228+
*/
229+
@scope.Union
230+
struct MigrationBlockingLegacyJSONSerialization {}

third-party/thrift/src/thrift/compiler/ast/uri.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -186,6 +186,10 @@ inline constexpr auto kHackModuleInternalUri =
186186
"facebook.com/thrift/annotation/hack/ModuleInternal";
187187
inline constexpr auto kHackGenerateClientMethodsWithHeaders =
188188
"facebook.com/thrift/annotation/hack/GenerateClientMethodsWithHeaders";
189+
inline constexpr auto kHackMigrationBlockingAllowInheritance =
190+
"facebook.com/thrift/annotation/hack/MigrationBlockingAllowInheritance";
191+
inline constexpr auto kHackMigrationBlockingLegacyJSONSerialization =
192+
"facebook.com/thrift/annotation/hack/MigrationBlockingLegacyJSONSerialization";
189193

190194
// Go:
191195
inline constexpr auto kGoNameUri = "facebook.com/thrift/annotation/go/Name";
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
/**
2+
* Autogenerated by Thrift
3+
*
4+
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5+
* @generated
6+
*/
7+
package com.facebook.thrift.annotation.hack_deprecated;
8+
9+
import java.util.List;
10+
import java.util.ArrayList;
11+
import java.util.Map;
12+
import java.util.HashMap;
13+
import java.util.Set;
14+
import java.util.HashSet;
15+
import java.util.Collections;
16+
import java.util.BitSet;
17+
import java.util.Arrays;
18+
import com.facebook.thrift.*;
19+
import com.facebook.thrift.annotations.*;
20+
import com.facebook.thrift.async.*;
21+
import com.facebook.thrift.meta_data.*;
22+
import com.facebook.thrift.server.*;
23+
import com.facebook.thrift.transport.*;
24+
import com.facebook.thrift.protocol.*;
25+
26+
/**
27+
* Generated Hack types are being changed to `final` by default.
28+
*
29+
* For existing thrift types that are inherited from and cannot be easily migrated,
30+
* use this annotation to make the generated class non-final.
31+
*/
32+
@SuppressWarnings({ "unused", "serial" })
33+
public class MigrationBlockingAllowInheritance implements TBase, java.io.Serializable, Cloneable {
34+
private static final TStruct STRUCT_DESC = new TStruct("MigrationBlockingAllowInheritance");
35+
36+
37+
public MigrationBlockingAllowInheritance() {
38+
}
39+
40+
/**
41+
* Performs a deep copy on <i>other</i>.
42+
*/
43+
public MigrationBlockingAllowInheritance(MigrationBlockingAllowInheritance other) {
44+
}
45+
46+
public MigrationBlockingAllowInheritance deepCopy() {
47+
return new MigrationBlockingAllowInheritance(this);
48+
}
49+
50+
@Override
51+
public boolean equals(Object _that) {
52+
if (_that == null)
53+
return false;
54+
if (this == _that)
55+
return true;
56+
if (!(_that instanceof MigrationBlockingAllowInheritance))
57+
return false;
58+
MigrationBlockingAllowInheritance that = (MigrationBlockingAllowInheritance)_that;
59+
60+
return true;
61+
}
62+
63+
@Override
64+
public int hashCode() {
65+
return Arrays.deepHashCode(new Object[] {});
66+
}
67+
68+
// This is required to satisfy the TBase interface, but can't be implemented on immutable struture.
69+
public void read(TProtocol iprot) throws TException {
70+
throw new TException("unimplemented in android immutable structure");
71+
}
72+
73+
public static MigrationBlockingAllowInheritance deserialize(TProtocol iprot) throws TException {
74+
TField __field;
75+
iprot.readStructBegin();
76+
while (true)
77+
{
78+
__field = iprot.readFieldBegin();
79+
if (__field.type == TType.STOP) {
80+
break;
81+
}
82+
switch (__field.id)
83+
{
84+
default:
85+
TProtocolUtil.skip(iprot, __field.type);
86+
break;
87+
}
88+
iprot.readFieldEnd();
89+
}
90+
iprot.readStructEnd();
91+
92+
MigrationBlockingAllowInheritance _that;
93+
_that = new MigrationBlockingAllowInheritance(
94+
);
95+
_that.validate();
96+
return _that;
97+
}
98+
99+
public void write(TProtocol oprot) throws TException {
100+
validate();
101+
102+
oprot.writeStructBegin(STRUCT_DESC);
103+
oprot.writeFieldStop();
104+
oprot.writeStructEnd();
105+
}
106+
107+
@Override
108+
public String toString() {
109+
return toString(1, true);
110+
}
111+
112+
@Override
113+
public String toString(int indent, boolean prettyPrint) {
114+
return TBaseHelper.toStringHelper(this, indent, prettyPrint);
115+
}
116+
117+
public void validate() throws TException {
118+
// check for required fields
119+
}
120+
121+
}
122+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
/**
2+
* Autogenerated by Thrift
3+
*
4+
* DO NOT EDIT UNLESS YOU ARE SURE THAT YOU KNOW WHAT YOU ARE DOING
5+
* @generated
6+
*/
7+
package com.facebook.thrift.annotation.hack_deprecated;
8+
9+
import java.util.List;
10+
import java.util.ArrayList;
11+
import java.util.Map;
12+
import java.util.HashMap;
13+
import java.util.Set;
14+
import java.util.HashSet;
15+
import java.util.Collections;
16+
import java.util.BitSet;
17+
import java.util.Arrays;
18+
import com.facebook.thrift.*;
19+
import com.facebook.thrift.annotations.*;
20+
import com.facebook.thrift.async.*;
21+
import com.facebook.thrift.meta_data.*;
22+
import com.facebook.thrift.server.*;
23+
import com.facebook.thrift.transport.*;
24+
import com.facebook.thrift.protocol.*;
25+
26+
/**
27+
* Hack Unions without the `protected` compiler option may rely on `fb_json_serialize` for JSON serialization.
28+
* Adding this annotation will implement the JSONSerializable Hack interface allowing `fb_json_serialize` to continue being used.
29+
*
30+
* Note: This should only be used for migration purposes. Use `JSONThriftSerializer` instead.
31+
*/
32+
@SuppressWarnings({ "unused", "serial" })
33+
public class MigrationBlockingLegacyJSONSerialization implements TBase, java.io.Serializable, Cloneable {
34+
private static final TStruct STRUCT_DESC = new TStruct("MigrationBlockingLegacyJSONSerialization");
35+
36+
37+
public MigrationBlockingLegacyJSONSerialization() {
38+
}
39+
40+
/**
41+
* Performs a deep copy on <i>other</i>.
42+
*/
43+
public MigrationBlockingLegacyJSONSerialization(MigrationBlockingLegacyJSONSerialization other) {
44+
}
45+
46+
public MigrationBlockingLegacyJSONSerialization deepCopy() {
47+
return new MigrationBlockingLegacyJSONSerialization(this);
48+
}
49+
50+
@Override
51+
public boolean equals(Object _that) {
52+
if (_that == null)
53+
return false;
54+
if (this == _that)
55+
return true;
56+
if (!(_that instanceof MigrationBlockingLegacyJSONSerialization))
57+
return false;
58+
MigrationBlockingLegacyJSONSerialization that = (MigrationBlockingLegacyJSONSerialization)_that;
59+
60+
return true;
61+
}
62+
63+
@Override
64+
public int hashCode() {
65+
return Arrays.deepHashCode(new Object[] {});
66+
}
67+
68+
// This is required to satisfy the TBase interface, but can't be implemented on immutable struture.
69+
public void read(TProtocol iprot) throws TException {
70+
throw new TException("unimplemented in android immutable structure");
71+
}
72+
73+
public static MigrationBlockingLegacyJSONSerialization deserialize(TProtocol iprot) throws TException {
74+
TField __field;
75+
iprot.readStructBegin();
76+
while (true)
77+
{
78+
__field = iprot.readFieldBegin();
79+
if (__field.type == TType.STOP) {
80+
break;
81+
}
82+
switch (__field.id)
83+
{
84+
default:
85+
TProtocolUtil.skip(iprot, __field.type);
86+
break;
87+
}
88+
iprot.readFieldEnd();
89+
}
90+
iprot.readStructEnd();
91+
92+
MigrationBlockingLegacyJSONSerialization _that;
93+
_that = new MigrationBlockingLegacyJSONSerialization(
94+
);
95+
_that.validate();
96+
return _that;
97+
}
98+
99+
public void write(TProtocol oprot) throws TException {
100+
validate();
101+
102+
oprot.writeStructBegin(STRUCT_DESC);
103+
oprot.writeFieldStop();
104+
oprot.writeStructEnd();
105+
}
106+
107+
@Override
108+
public String toString() {
109+
return toString(1, true);
110+
}
111+
112+
@Override
113+
public String toString(int indent, boolean prettyPrint) {
114+
return TBaseHelper.toStringHelper(this, indent, prettyPrint);
115+
}
116+
117+
public void validate() throws TException {
118+
// check for required fields
119+
}
120+
121+
}
122+

0 commit comments

Comments
 (0)