Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ public void linkTypeNoneButIncludesLink() {
explanation = "linkType none but includes link",
severity = SeverityLevel.ERROR,
linkType = LinkType.NONE,
link = "http://foo")
link = "https://foo")
final class BugPatternTestClass {}

BugPattern annotation = BugPatternTestClass.class.getAnnotation(BugPattern.class);
Expand All @@ -85,7 +85,7 @@ public void linkTypeCustomAndIncludesLink() throws Exception {
explanation = "linkType custom and includes link",
severity = SeverityLevel.ERROR,
linkType = LinkType.CUSTOM,
link = "http://foo")
link = "https://foo")
final class BugPatternTestClass {}

BugPattern annotation = BugPatternTestClass.class.getAnnotation(BugPattern.class);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
* public class Foo {
* @RestrictedApi(
* explanation="You could shoot yourself in the foot with Foo.bar if you aren't careful",
* link="http://edsger.dijkstra/foo_bar_consider_harmful.html",
* link="https://edsger.dijkstra/foo_bar_consider_harmful.html",
* allowedOnPath="testsuite/.*", // Unsafe behavior in tests is ok.
* allowlistAnnotations = {ReviewedFooBar.class},
* allowlistWithWarningAnnotations = {LegacyUnsafeFooBar.class})
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
* }</pre>
*
* <p>The need for using the {@code local} variable is detailed in
* http://jeremymanson.blogspot.com/2008/12/benign-data-races-in-java.html (see, particularly, the
* https://jeremymanson.blogspot.com/2008/12/benign-data-races-in-java.html (see, particularly, the
* part after "Now, let's break the code").
*
* <p>Also note that {@code LazyInit} must not be used on 64-bit primitives ({@code long}s and
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ install:
Add-Type -AssemblyName System.IO.Compression.FileSystem
if (!(Test-Path -Path "C:\maven" )) {
(new-object System.Net.WebClient).DownloadFile(
'http://www.us.apache.org/dist/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.zip',
'https://www.us.apache.org/dist/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.zip',
'C:\maven-bin.zip'
)
[System.IO.Compression.ZipFile]::ExtractToDirectory("C:\maven-bin.zip", "C:\maven")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ private boolean finishedCompilation(CompilationUnitTree tree) {
case IMPORT -> {
// The spec disallows mixing imports and empty top-level declarations (";"), but
// javac has a bug that causes it to accept empty declarations interspersed with imports:
// http://mail.openjdk.java.net/pipermail/compiler-dev/2013-August/006968.html
// https://mail.openjdk.java.net/pipermail/compiler-dev/2013-August/006968.html
//
// Any import declarations after the first semi are incorrectly added to the list
// of type declarations, so we have to skip over them here.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -499,7 +499,7 @@ Nullness visitAssignment(AssignmentNode node, SubNodeValues inputs, Updates upda
* It's not clear to me that this is technically correct, but it works in practice with the
* bytecode generated by both javac and ecj.
*
* http://stackoverflow.com/q/12850676/28465
* https://stackoverflow.com/q/12850676/28465
*/
return value;
}
Expand Down Expand Up @@ -903,7 +903,7 @@ private static boolean isEqualsMethod(
MemberName calleeName, List<Node> arguments, Types types, Symtab symtab) {
// we don't care about class name -- we're matching against Object.equals(Object)
// this implies that non-overriding methods are assumed to be null-guaranteeing.
// Also see http://errorprone.info/bugpattern/NonOverridingEquals
// Also see https://errorprone.info/bugpattern/NonOverridingEquals
if (!calleeName.member.equals("equals") || arguments.size() != 1) {
return false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
* that, for example editing {@code Christopher} into {@code Chris} (dropping 6 characters) is not 6
* times as expensive as editing {@code Christopher} into {@code Christophe}.
*
* <p>See http://en.wikipedia.org/wiki/Needleman-Wunsch_algorithm
* <p>See https://en.wikipedia.org/wiki/Needleman-Wunsch_algorithm
*
* @author alanw@google.com (Alan Wendt)
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
/**
* The precedence for an operator kind in the {@link com.sun.source.tree} API.
*
* <p>As documented at: http://docs.oracle.com/javase/tutorial/java/nutsandbolts/operators.html
* <p>As documented at: https://docs.oracle.com/javase/tutorial/java/nutsandbolts/operators.html
*/
public enum OperatorPrecedence {
POSTFIX(14),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ private SourceCodeEscapers() {}
// For each xxxEscaper() method, please add links to external reference pages
// that are considered authoritative for the behavior of that escaper.

// From: http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters
// From: https://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters
private static final char PRINTABLE_ASCII_MIN = 0x20; // ' '
private static final char PRINTABLE_ASCII_MAX = 0x7E; // '~'

Expand All @@ -46,7 +46,7 @@ private SourceCodeEscapers() {}
* safely be included in either a Java character literal or string literal. This is the preferred
* way to escape Java characters for use in String or character literals.
*
* <p>See: <a href= "http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#101089"
* <p>See: <a href= "https://java.sun.com/docs/books/jls/third_edition/html/lexical.html#101089"
* >The Java Language Specification</a> for more details.
*/
public static CharEscaper javaCharEscaper() {
Expand Down Expand Up @@ -93,7 +93,7 @@ public static CharEscaper getJavaTextBlockEscaper() {
'\\', "\\\\"));

// This escaper does not produce octal escape sequences. See:
// http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#101089
// https://java.sun.com/docs/books/jls/third_edition/html/lexical.html#101089
// "Octal escapes are provided for compatibility with C, but can express
// only Unicode values \u0000 through \u00FF, so Unicode escapes are
// usually preferred."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -133,8 +133,8 @@ public void customLinkOverride() {
new CustomLinkChecker()
.buildDescription((DiagnosticPosition) new MockTree())
.setMessage("custom message")
.setLinkUrl("http://foo")
.setLinkUrl("https://foo")
.build();
assertThat(description.getMessage()).contains("http://foo");
assertThat(description.getMessage()).contains("https://foo");
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ static Replacement getReplacement(String id, boolean inJodaTimeContext, String m
}

// American time zones for which the TLA doesn't observe daylight savings.
// http://www-01.ibm.com/support/docview.wss?uid=swg21250503#3char
// https://www-01.ibm.com/support/docview.wss?uid=swg21250503#3char
// How we handle it depends upon whether we are in a JodaTime context or not.
static Replacement handleNonDaylightSavingsZone(
boolean inJodaTimeContext, String daylightSavingsZone, String fixedOffset, String message) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@

/**
* Replacement of misleading <a
* href="http://developer.android.com/reference/android/R.string.html">android.R.string</a>
* href="https://developer.android.com/reference/android/R.string.html">android.R.string</a>
* constants with more intuitive ones.
*
* @author kmb@google.com (Kevin Bierhoff)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ public final Description matchClass(ClassTree classTree, VisitorState state) {
if (ctorsWithInject.size() != 1) {
// Injection frameworks don't support multiple @Inject ctors.
// There is already an ERROR check for it.
// http://errorprone.info/bugpattern/MoreThanOneInjectableConstructor
// https://errorprone.info/bugpattern/MoreThanOneInjectableConstructor
return Description.NO_MATCH;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
*/

/**
* Bug patterns related to <a href="http://en.wikipedia.org/wiki/Dependency_injection">dependency
* Bug patterns related to <a href="https://en.wikipedia.org/wiki/Dependency_injection">dependency
* injection</a> and <a href="https://jcp.org/en/jsr/detail?id=330">JSR 330</a>. See the various
* subpackages for checks related to specific DI frameworks.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ public static TreeAndTimeUnit of(
return null;
}

// http://grepcode.com/file/repo1.maven.org/maven2/mysql/mysql-connector-java/5.1.33/com/mysql/jdbc/TimeUtil.java#336
// https://grepcode.com/file/repo1.maven.org/maven2/mysql/mysql-connector-java/5.1.33/com/mysql/jdbc/TimeUtil.java#336
if (name.equals("secondsPart")) {
return NANOSECONDS;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ private static int getPrecedence(JCTree leaf, Context context) {

if (parent instanceof JCConditional conditional) {
// This intentionally differs from Pretty, because Pretty appears buggy:
// http://mail.openjdk.java.net/pipermail/compiler-dev/2013-September/007303.html
// https://mail.openjdk.java.net/pipermail/compiler-dev/2013-September/007303.html
return TreeInfo.condPrec + ((conditional.cond == leaf) ? 1 : 0);
} else if (parent instanceof JCAssign assign) {
return TreeInfo.assignPrec + ((assign.lhs == leaf) ? 1 : 0);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ public void template() {
interface Test {
// BUG: Diagnostic contains: OutlineNone
@Template(
".body {color: red;outline: 0px;}<a href=http://outlinenone.com style=\\"outline:none\\">")
".body {color: red;outline: 0px;}<a href=https://outlinenone.com style=\\"outline:none\\">")
SafeHtml myElement();

// BUG: Diagnostic contains: OutlineNone
Expand All @@ -62,7 +62,7 @@ public void templateMutliline() {

interface Test {
// BUG: Diagnostic contains: OutlineNone
@Template(".body {color: red;}\\n" + "<a href=http://outlinenone.com style=\\"outline:none\\">")
@Template(".body {color: red;}\\n" + "<a href=https://outlinenone.com style=\\"outline:none\\">")
SafeHtml myElement();
}
""")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,15 +41,15 @@ public void httpLink() {
"Test.java",
"""
interface Test {
/** {@link http://foo/bar/baz} */
/** {@link https://foo/bar/baz} */
void foo();
}
""")
.addOutputLines(
"Test.java",
"""
interface Test {
/** <a href="http://foo/bar/baz">link</a> */
/** <a href="https://foo/bar/baz">link</a> */
void foo();
}
""")
Expand All @@ -63,15 +63,15 @@ public void httpLink_lineBreak() {
"Test.java",
"""
interface Test {
/** {@link http://foo/bar/baz foo} */
/** {@link https://foo/bar/baz foo} */
void foo();
}
""")
.addOutputLines(
"Test.java",
"""
interface Test {
/** <a href="http://foo/bar/baz">foo</a> */
/** <a href="https://foo/bar/baz">foo</a> */
void foo();
}
""")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ public void badSee() {

interface Test {
/**
* @see <a href="http://google.com">google</a>
* @see <a href="https://google.com">google</a>
*/
void foo(List<Integer> foos);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ public void positive() {
"Test.java",
"""
/**
* @see http://foo for more details
* @see https://foo for more details
*/
class Test {}
""")
.addOutputLines(
"Test.java",
"""
/** See http://foo for more details */
/** See https://foo for more details */
class Test {}
""")
.doTest(TEXT_MATCH);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1609,7 +1609,7 @@ void method() {
* We'd prefer for this to be non-null, but we don't run the analysis over the enclosing
* class's enclosing method, so our captured-variable handling is limited to compile-time
* constants, which include only primitives and strings:
* http://docs.oracle.com/javase/specs/jls/se7/html/jls-15.html#jls-15.28
* https://docs.oracle.com/javase/specs/jls/se7/html/jls-15.html#jls-15.28
*/
// BUG: Diagnostic contains: (Nullable)
triggerNullnessChecker(nonnull);
Expand Down
2 changes: 1 addition & 1 deletion docs/bugpattern/BindingToUnqualifiedCommonType.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,5 +36,5 @@ bind(Integer.class).toInstance(80);
To avoid confusion in these circumstances, please use a Qualifier annotation
when binding simple value types.

[`@Qualifier`]: http://docs.oracle.com/javaee/6/api/javax/inject/Qualifier.html
[`@Qualifier`]: https://docs.oracle.com/javaee/6/api/javax/inject/Qualifier.html
[`@BindingAnnotation`]: https://github.com/google/guice/wiki/BindingAnnotations
4 changes: 2 additions & 2 deletions docs/bugpattern/DateFormatConstant.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ private static final DateFormat dateFormat =

```

[`DateFormat`]: http://docs.oracle.com/javase/8/docs/api/java/text/DateFormat.html
[`ThreadLocal`]: http://docs.oracle.com/javase/8/docs/api/java/lang/ThreadLocal.html
[`DateFormat`]: https://docs.oracle.com/javase/8/docs/api/java/text/DateFormat.html
[`ThreadLocal`]: https://docs.oracle.com/javase/8/docs/api/java/lang/ThreadLocal.html
[`DateTimeFormatter`]: https://docs.oracle.com/javase/8/docs/api/java/time/format/DateTimeFormatter.html
[style]: https://google.github.io/styleguide/javaguide.html#s5.2.4-constant-names
4 changes: 2 additions & 2 deletions docs/bugpattern/DefaultCharset.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ A [`Charset`][charset] is a mapping between sequences of
when encoding characters into bytes and decoding bytes into characters.

[charset]: https://docs.oracle.com/javase/8/docs/api/java/nio/charset/Charset.html
[codeunit]: http://unicode.org/glossary/#code_unit
[codeunit]: https://unicode.org/glossary/#code_unit

Using APIs that rely on the JVM's default Charset under the hood is dangerous.
The default charset can vary from machine to machine or JVM to JVM. This can
Expand All @@ -18,4 +18,4 @@ If you need stable encoding/decoding, you must specify an explicit charset. The

When in doubt, use [UTF-8].

[UTF-8]: http://www.utf8everywhere.org/
[UTF-8]: https://www.utf8everywhere.org/
2 changes: 1 addition & 1 deletion docs/bugpattern/DoubleBraceInitialization.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ Luckily, there are more readable and more performant alternatives in the factory
methods and builders for `ImmutableList`, `ImmutableSet`, and `ImmutableMap`.

The `List.of`, `Set.of`, and `Map.of` static factories
[added in Java 9](http://openjdk.java.net/jeps/269) are also a good choice.
[added in Java 9](https://openjdk.java.net/jeps/269) are also a good choice.

That is, prefer this:

Expand Down
6 changes: 3 additions & 3 deletions docs/bugpattern/DoubleCheckedLocking.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ thread-safe.
If the field is not volatile, the compiler may re-order the code in the
accessor. For more information, see:

* http://jeremymanson.blogspot.com/2008/05/double-checked-locking.html
* http://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html
* https://jeremymanson.blogspot.com/2008/05/double-checked-locking.html
* https://www.cs.umd.edu/~pugh/java/memoryModel/DoubleCheckedLocking.html
* Java Concurrency in Practice, §16.2.4
* [Effective Java 3rd Edition §83][ej3e-83]

Expand Down Expand Up @@ -83,7 +83,7 @@ static Object get() {
## Double-checked locking and immutability

If the object being initialized with double-checked locking is
[immutable](http://jeremymanson.blogspot.com/2008/04/immutability-in-java.html),
[immutable](https://jeremymanson.blogspot.com/2008/04/immutability-in-java.html),
then it is safe for the field to be non-volatile. *However*, the use of volatile
is still encouraged because it is almost free on x86 and makes the code more
obviously correct.
Expand Down
2 changes: 1 addition & 1 deletion docs/bugpattern/EqualsIncompatibleType.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,6 +146,6 @@ if (set.contains(hi)) {
}
```

[equalstester]: http://static.javadoc.io/com.google.guava/guava-testlib/19.0/com/google/common/testing/EqualsTester.html
[equalstester]: https://static.javadoc.io/com.google.guava/guava-testlib/19.0/com/google/common/testing/EqualsTester.html
[objeq]: https://docs.oracle.com/javase/7/docs/api/java/lang/Object.html#equals(java.lang.Object)
[av]: https://github.com/google/auto/blob/master/value/userguide/index.md
2 changes: 1 addition & 1 deletion docs/bugpattern/ExpectedExceptionChecker.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,4 @@ public void testRemoveFails() {
}
```

[`ExpectedException`]: http://junit.org/junit4/javadoc/latest/org/junit/rules/ExpectedException.html
[`ExpectedException`]: https://junit.org/junit4/javadoc/latest/org/junit/rules/ExpectedException.html
2 changes: 1 addition & 1 deletion docs/bugpattern/IdentityHashMapUsage.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
`java.util.IdentityHashMap` uses reference equality to compare keys. This is
[in violation of the contract of `java.util.Map`](http://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/IdentityHashMap.html),
[in violation of the contract of `java.util.Map`](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/util/IdentityHashMap.html),
which states that object equality (the keys' `equals` methods) should be used
for key comparison. This peculiarity can lead to confusion and subtle bugs,
especially when the two types of maps are used together. This check attempts to
Expand Down
2 changes: 1 addition & 1 deletion docs/bugpattern/InterruptedExceptionSwallowed.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ handled properly, however `try` blocks that catch `Exception` or `Throwable` (or
methods that `throws` either type) make it difficult to recognize that
interruption may occur.

For advice on how to handle `InterruptedException`, see http://web.archive.org/web/20201025132525/https://www.ibm.com/developerworks/library/j-jtp05236/index.html
For advice on how to handle `InterruptedException`, see https://web.archive.org/web/20201025132525/https://www.ibm.com/developerworks/library/j-jtp05236/index.html

## Suppression

Expand Down
4 changes: 2 additions & 2 deletions docs/bugpattern/JUnit4ClassAnnotationNonStatic.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ JUnit4 runs `@BeforeClass` and `@AfterClass` methods without making an instance
of the test class, meaning that the methods must be `static`. JUnit4 will fail
to run any `@BeforeClass` or `@AfterClass` method that isn't also `static`.

[beforeclass]: http://junit.sourceforge.net/javadoc/org/junit/BeforeClass.html
[afterclass]: http://junit.sourceforge.net/javadoc/org/junit/AfterClass.html
[beforeclass]: https://junit.sourceforge.net/javadoc/org/junit/BeforeClass.html
[afterclass]: https://junit.sourceforge.net/javadoc/org/junit/AfterClass.html
2 changes: 1 addition & 1 deletion docs/bugpattern/JavaLangClash.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
Class names from `java.lang` should never be reused. From
[Java Puzzlers](http://www.javapuzzlers.com/java-puzzlers-sampler.pdf):
[Java Puzzlers](https://www.javapuzzlers.com/java-puzzlers-sampler.pdf):

> Avoid reusing the names of platform classes, and never reuse class names from
> `java.lang`, because these names are automatically imported everywhere.
Expand Down
2 changes: 1 addition & 1 deletion docs/bugpattern/JavaxInjectOnAbstractMethod.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,6 @@ frameworks may allow this, since the default methods are not abstract.

See the [Guice wiki] page on JSR-330 for more.

[`Inject`]: http://javax-inject.github.io/javax-inject/api/javax/inject/Inject.html
[`Inject`]: https://javax-inject.github.io/javax-inject/api/javax/inject/Inject.html
[OverridesJavaxInjectableMethod]: OverridesJavaxInjectableMethod
[Guice wiki]: https://github.com/google/guice/wiki/JSR330
4 changes: 2 additions & 2 deletions docs/bugpattern/MissingRuntimeRetention.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,5 +27,5 @@ NOTE: Even for dependency injection frameworks traditionally considered to be
compile-time dependent, the JSR-330 specification still requires runtime
retention for both [`Qualifier`] and [`Scope`].

[`Qualifier`]: http://docs.oracle.com/javaee/6/api/javax/inject/Qualifier.html
[`Scope`]: http://docs.oracle.com/javaee/6/api/javax/inject/Scope.html
[`Qualifier`]: https://docs.oracle.com/javaee/6/api/javax/inject/Qualifier.html
[`Scope`]: https://docs.oracle.com/javaee/6/api/javax/inject/Scope.html
2 changes: 1 addition & 1 deletion docs/bugpattern/MockitoUsage.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ verify(mock.execute()); // oops!

For more information, see the [Mockito documentation][docs].

[docs]: http://github.com/mockito/mockito/wiki/FAQ#what-are-unfinished-verificationstubbing-errors
[docs]: https://github.com/mockito/mockito/wiki/FAQ#what-are-unfinished-verificationstubbing-errors
Loading