Skip to content

Commit dfb8a4c

Browse files
zhangskzcopybara-github
authored andcommitted
Breaking change: Remove deprecated TextFormat print methods. These should be replaced by corresponding TextFormat.printer() methods.
These methods have been deprecated as of v3.9.0 (09cab82). PiperOrigin-RevId: 587088638
1 parent 5d44a3f commit dfb8a4c

File tree

1 file changed

+0
-176
lines changed

1 file changed

+0
-176
lines changed

java/core/src/main/java/com/google/protobuf/TextFormat.java

Lines changed: 0 additions & 176 deletions
Original file line numberDiff line numberDiff line change
@@ -38,58 +38,6 @@ private TextFormat() {}
3838

3939
private static final String DEBUG_STRING_SILENT_MARKER = "\t ";
4040

41-
/**
42-
* Outputs a textual representation of the Protocol Message supplied into the parameter output.
43-
* (This representation is the new version of the classic "ProtocolPrinter" output from the
44-
* original Protocol Buffer system)
45-
*
46-
* @deprecated Use {@code printer().print(MessageOrBuilder, Appendable)}
47-
*/
48-
@Deprecated
49-
@InlineMe(
50-
replacement = "TextFormat.printer().print(message, output)",
51-
imports = "com.google.protobuf.TextFormat")
52-
public static void print(final MessageOrBuilder message, final Appendable output)
53-
throws IOException {
54-
printer().print(message, output);
55-
}
56-
57-
/**
58-
* Outputs a textual representation of {@code fields} to {@code output}.
59-
*
60-
* @deprecated Use {@code printer().print(UnknownFieldSet, Appendable)}
61-
*/
62-
@Deprecated
63-
public static void print(final UnknownFieldSet fields, final Appendable output)
64-
throws IOException {
65-
printer().print(fields, output);
66-
}
67-
68-
/**
69-
* Same as {@code print()}, except that non-ASCII characters are not escaped.
70-
*
71-
* @deprecated Use {@code printer().escapingNonAscii(false).print(MessageOrBuilder, Appendable)}
72-
*/
73-
@Deprecated
74-
@InlineMe(
75-
replacement = "TextFormat.printer().escapingNonAscii(false).print(message, output)",
76-
imports = "com.google.protobuf.TextFormat")
77-
public static void printUnicode(final MessageOrBuilder message, final Appendable output)
78-
throws IOException {
79-
printer().escapingNonAscii(false).print(message, output);
80-
}
81-
82-
/**
83-
* Same as {@code print()}, except that non-ASCII characters are not escaped.
84-
*
85-
* @deprecated Use {@code printer().escapingNonAscii(false).print(UnknownFieldSet, Appendable)}
86-
*/
87-
@Deprecated
88-
public static void printUnicode(final UnknownFieldSet fields, final Appendable output)
89-
throws IOException {
90-
printer().escapingNonAscii(false).print(fields, output);
91-
}
92-
9341
/**
9442
* Generates a human readable form of this message, useful for debugging and other purposes, with
9543
* no newline characters. This is just a trivial wrapper around {@link
@@ -99,130 +47,6 @@ public static String shortDebugString(final MessageOrBuilder message) {
9947
return printer().shortDebugString(message);
10048
}
10149

102-
/**
103-
* Generates a human readable form of the field, useful for debugging and other purposes, with
104-
* no newline characters.
105-
*
106-
* @deprecated Use {@code printer().shortDebugString(FieldDescriptor, Object)}
107-
*/
108-
@Deprecated
109-
public static String shortDebugString(final FieldDescriptor field, final Object value) {
110-
return printer().shortDebugString(field, value);
111-
}
112-
113-
/**
114-
* Generates a human readable form of the unknown fields, useful for debugging and other
115-
* purposes, with no newline characters.
116-
*
117-
* @deprecated Use {@code printer().shortDebugString(UnknownFieldSet)}
118-
*/
119-
@Deprecated
120-
public static String shortDebugString(final UnknownFieldSet fields) {
121-
return printer().shortDebugString(fields);
122-
}
123-
124-
/**
125-
* Like {@code print()}, but writes directly to a {@code String} and returns it.
126-
*
127-
* @deprecated Use {@code message.toString()}
128-
*/
129-
@Deprecated
130-
@InlineMe(
131-
replacement = "TextFormat.printer().printToString(message)",
132-
imports = "com.google.protobuf.TextFormat")
133-
public static String printToString(final MessageOrBuilder message) {
134-
return printer().printToString(message);
135-
}
136-
137-
/**
138-
* Like {@code print()}, but writes directly to a {@code String} and returns it.
139-
*
140-
* @deprecated Use {@link UnknownFieldSet#toString()}
141-
*/
142-
@Deprecated
143-
public static String printToString(final UnknownFieldSet fields) {
144-
return printer().printToString(fields);
145-
}
146-
147-
/**
148-
* Same as {@code printToString()}, except that non-ASCII characters in string type fields are not
149-
* escaped in backslash+octals.
150-
*
151-
* @deprecated Use {@code printer().escapingNonAscii(false).printToString(MessageOrBuilder)}
152-
*/
153-
@Deprecated
154-
@InlineMe(
155-
replacement = "TextFormat.printer().escapingNonAscii(false).printToString(message)",
156-
imports = "com.google.protobuf.TextFormat")
157-
public static String printToUnicodeString(final MessageOrBuilder message) {
158-
return printer().escapingNonAscii(false).printToString(message);
159-
}
160-
161-
/**
162-
* Same as {@code printToString()}, except that non-ASCII characters in string type fields are
163-
* not escaped in backslash+octals.
164-
*
165-
* @deprecated Use {@code printer().escapingNonAscii(false).printToString(UnknownFieldSet)}
166-
*/
167-
@Deprecated
168-
public static String printToUnicodeString(final UnknownFieldSet fields) {
169-
return printer().escapingNonAscii(false).printToString(fields);
170-
}
171-
172-
/** @deprecated Use {@code printer().printField(FieldDescriptor, Object, Appendable)} */
173-
@Deprecated
174-
public static void printField(
175-
final FieldDescriptor field, final Object value, final Appendable output)
176-
throws IOException {
177-
printer().printField(field, value, output);
178-
}
179-
180-
/** @deprecated Use {@code printer().printFieldToString(FieldDescriptor, Object)} */
181-
@Deprecated
182-
public static String printFieldToString(final FieldDescriptor field, final Object value) {
183-
return printer().printFieldToString(field, value);
184-
}
185-
186-
/**
187-
* Outputs a unicode textual representation of the value of given field value.
188-
*
189-
* <p>Same as {@code printFieldValue()}, except that non-ASCII characters in string type fields
190-
* are not escaped in backslash+octals.
191-
*
192-
* @deprecated Use {@code printer().escapingNonAscii(false).printFieldValue(FieldDescriptor,
193-
* Object, Appendable)}
194-
* @param field the descriptor of the field
195-
* @param value the value of the field
196-
* @param output the output to which to append the formatted value
197-
* @throws ClassCastException if the value is not appropriate for the given field descriptor
198-
* @throws IOException if there is an exception writing to the output
199-
*/
200-
@Deprecated
201-
public static void printUnicodeFieldValue(
202-
final FieldDescriptor field, final Object value, final Appendable output)
203-
throws IOException {
204-
printer().escapingNonAscii(false).printFieldValue(field, value, output);
205-
}
206-
207-
/**
208-
* Outputs a textual representation of the value of given field value.
209-
*
210-
* @deprecated Use {@code printer().printFieldValue(FieldDescriptor, Object, Appendable)}
211-
* @param field the descriptor of the field
212-
* @param value the value of the field
213-
* @param output the output to which to append the formatted value
214-
* @throws ClassCastException if the value is not appropriate for the given field descriptor
215-
* @throws IOException if there is an exception writing to the output
216-
*/
217-
@Deprecated
218-
@InlineMe(
219-
replacement = "TextFormat.printer().printFieldValue(field, value, output)",
220-
imports = "com.google.protobuf.TextFormat")
221-
public static void printFieldValue(
222-
final FieldDescriptor field, final Object value, final Appendable output) throws IOException {
223-
printer().printFieldValue(field, value, output);
224-
}
225-
22650
/**
22751
* Outputs a textual representation of the value of an unknown field.
22852
*

0 commit comments

Comments
 (0)