Skip to content

Commit e1f5e52

Browse files
blicklycopybara-github
authored andcommitted
Stop marking explicit visibility for members that are effectively private
PiperOrigin-RevId: 893047126
1 parent 2dfc108 commit e1f5e52

51 files changed

Lines changed: 190 additions & 213 deletions

Some content is hidden

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

src/com/google/javascript/jscomp/AbstractMessageFormatter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ private static enum Color {
6060
this.controlCharacter = controlCharacter;
6161
}
6262

63-
public String getControlCharacter() {
63+
String getControlCharacter() {
6464
return controlCharacter;
6565
}
6666
}

src/com/google/javascript/jscomp/CheckAccessControls.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1182,7 +1182,7 @@ private static enum IdentifierBehaviour {
11821182
ES6_CLASS_INVOCATION,
11831183
ES6_CLASS_NAMESPACE;
11841184

1185-
public static IdentifierBehaviour select(Node target) {
1185+
static IdentifierBehaviour select(Node target) {
11861186
JSType type = target.getJSType();
11871187
if (type == null || !type.isFunctionType()) {
11881188
// If we aren't sure what we're dealing with be more strict.

src/com/google/javascript/jscomp/ChromePass.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,7 @@ private class RenameInternalsToExternalsCallback extends AbstractPostOrderCallba
311311
private final Map<String, String> exports;
312312
private final Node namespaceBlock;
313313

314-
public RenameInternalsToExternalsCallback(
314+
RenameInternalsToExternalsCallback(
315315
String namespaceName, Map<String, String> exports, Node namespaceBlock) {
316316
this.namespaceName = namespaceName;
317317
this.exports = exports;

src/com/google/javascript/jscomp/ClosureCodeRemoval.java

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,7 @@ private class RemovableAssignment {
9797
* @param assignNode The parent ASSIGN node
9898
* @param traversal Access to further levels, assumed to start at 1
9999
*/
100-
public RemovableAssignment(Node nameNode, Node assignNode,
101-
NodeTraversal traversal) {
100+
RemovableAssignment(Node nameNode, Node assignNode, NodeTraversal traversal) {
102101
this.node = nameNode;
103102
this.parent = assignNode;
104103

@@ -111,10 +110,8 @@ public RemovableAssignment(Node nameNode, Node assignNode,
111110
lastAncestor = ancestor.getParent();
112111
}
113112

114-
/**
115-
* Remove this node.
116-
*/
117-
public void remove() {
113+
/** Remove this node. */
114+
void remove() {
118115
Node rhs = node.getNext();
119116
Node last = parent;
120117
for (Node ancestor : assignAncestors) {

src/com/google/javascript/jscomp/ClosureRewriteModule.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -308,11 +308,11 @@ private static final class ScriptDescription {
308308
// For recognizing top level names.
309309
Node rootNode;
310310

311-
public void addChildScript(ScriptDescription childScript) {
311+
void addChildScript(ScriptDescription childScript) {
312312
childScripts.addLast(childScript);
313313
}
314314

315-
public ScriptDescription removeFirstChildScript() {
315+
ScriptDescription removeFirstChildScript() {
316316
return childScripts.removeFirst();
317317
}
318318

src/com/google/javascript/jscomp/CoalesceVariableNames.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -644,7 +644,7 @@ void setCrossingVariables(BitSet[] interferenceBitSet) {
644644
}
645645

646646
/** Returns whether any LiveRangeChecker would be interested in the node. */
647-
public static boolean shouldVisit(Node n) {
647+
static boolean shouldVisit(Node n) {
648648
return (n.isName() || (n.hasChildren() && n.getFirstChild().isName()));
649649
}
650650

src/com/google/javascript/jscomp/CodePrinter.java

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -60,10 +60,10 @@ private abstract static class MappedCodePrinter extends CodeConsumer {
6060
private final boolean createSrcMap;
6161
private final SourceMap.DetailLevel sourceMapDetailLevel;
6262
private final @Nullable LicenseTracker licenseTracker;
63-
protected final StringBuilder code = new StringBuilder(1024);
64-
protected final int lineLengthThreshold;
65-
protected int lineLength = 0;
66-
protected int lineIndex = 0;
63+
final StringBuilder code = new StringBuilder(1024);
64+
final int lineLengthThreshold;
65+
int lineLength = 0;
66+
int lineIndex = 0;
6767

6868
MappedCodePrinter(
6969
int lineLengthThreshold,
@@ -207,7 +207,7 @@ private static FilePosition convertPositionAfterLineCut(
207207
}
208208
}
209209

210-
public String getCode() {
210+
String getCode() {
211211
return code.toString();
212212
}
213213

@@ -216,11 +216,11 @@ char getLastChar() {
216216
return (code.length() > 0) ? code.charAt(code.length() - 1) : '\0';
217217
}
218218

219-
protected final int getCurrentCharIndex() {
219+
final int getCurrentCharIndex() {
220220
return lineLength;
221221
}
222222

223-
protected final int getCurrentLineIndex() {
223+
final int getCurrentLineIndex() {
224224
return lineIndex;
225225
}
226226

src/com/google/javascript/jscomp/Compiler.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -300,9 +300,9 @@ public SourceFile loadSource(String filename) {
300300
* given originalPath+sourceMapPath, what sourceFile did we find?
301301
*/
302302
private static class ResolvedSourceMap {
303-
public String originalPath;
304-
public String sourceMapPath;
305-
public String relativePath;
303+
String originalPath;
304+
String sourceMapPath;
305+
String relativePath;
306306
}
307307

308308
/**
@@ -2806,11 +2806,11 @@ private abstract static class SeenSetLicenseTracker implements LicenseTracker {
28062806
private final Set<String> currentlySeenLicenses = new LinkedHashSet<>();
28072807
private String lastSeenFile = "";
28082808

2809-
public SeenSetLicenseTracker(AbstractCompiler compiler) {
2809+
SeenSetLicenseTracker(AbstractCompiler compiler) {
28102810
this.compiler = compiler;
28112811
}
28122812

2813-
protected boolean shouldUseLicenseInfo(Node node) {
2813+
boolean shouldUseLicenseInfo(Node node) {
28142814
return !node.isRoot() && !node.isScript();
28152815
}
28162816

src/com/google/javascript/jscomp/CompilerInput.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -640,7 +640,7 @@ private final class JsAst {
640640
private @Nullable Node root;
641641
private FeatureSet features;
642642

643-
public Node getAstRoot(AbstractCompiler compiler) {
643+
Node getAstRoot(AbstractCompiler compiler) {
644644
if (this.isParsed()) {
645645
return this.root;
646646
}
@@ -660,7 +660,7 @@ public Node getAstRoot(AbstractCompiler compiler) {
660660
return this.root;
661661
}
662662

663-
public void clearAst() {
663+
void clearAst() {
664664
root = null;
665665
// While we're at it, clear out any saved text in the source file on
666666
// the assumption that if we're dumping the parse tree, then we probably

src/com/google/javascript/jscomp/ConvertChunksToESModules.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,7 +348,7 @@ public boolean shouldTraverse(NodeTraversal t, Node n, Node parent) {
348348
return true;
349349
}
350350

351-
public void visitScript(NodeTraversal t, Node script) {
351+
void visitScript(NodeTraversal t, Node script) {
352352
checkState(script.isScript());
353353
JSChunk chunk = t.getChunk();
354354
ImmutableList<JSChunk> chunkDependencies = chunk.getDependencies();

0 commit comments

Comments
 (0)