Skip to content

Commit 0d8a666

Browse files
chore: clean up final keyword and javaDoc typo (#969)
* chore: clean up unnecessary keyword and javaDoc typo * chore: javaDoc formatting * 🦉 Updates from OwlBot post-processor See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
1 parent 39008e5 commit 0d8a666

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

src/main/java/com/google/cloud/logging/logback/LoggingAppender.java

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ public class LoggingAppender extends UnsynchronizedAppenderBase<ILoggingEvent> {
102102
private static final String TYPE =
103103
"type.googleapis.com/google.devtools.clouderrorreporting.v1beta1.ReportedErrorEvent";
104104
private static final List<LoggingEventEnhancer> DEFAULT_LOGGING_EVENT_ENHANCERS =
105-
ImmutableList.<LoggingEventEnhancer>of(new MDCEventEnhancer());
105+
ImmutableList.of(new MDCEventEnhancer());
106106
public static final String JAVA_LOGBACK_LIBRARY_NAME = "java-logback";
107107
// Using release-please annotations to update DEFAULT_INSTRUMENTATION_VERSION with latest version.
108108
// See
@@ -111,7 +111,7 @@ public class LoggingAppender extends UnsynchronizedAppenderBase<ILoggingEvent> {
111111
public static final String DEFAULT_INSTRUMENTATION_VERSION = "0.129.9-alpha-SNAPSHOT";
112112
// {x-version-update-end}
113113
private static boolean instrumentationAdded = false;
114-
private static Object instrumentationLock = new Object();
114+
private static final Object instrumentationLock = new Object();
115115

116116
private volatile Logging logging;
117117
private LoggingOptions loggingOptions;
@@ -158,7 +158,7 @@ public void setLog(String log) {
158158
* Sets the name of the monitored resource (Optional). If not define the appender will try to
159159
* identify the resource type automatically. Currently support resource types include "gae_app",
160160
* "gce_instance", "k8s_container", "cloud_run_revision" and "cloud_function". If the appender
161-
* fails to identify the resource type it will be set to "global".
161+
* fails to identify the resource type, it will be set to "global".
162162
*
163163
* <p>Must be a one of the <a href=
164164
* "https://cloud.google.com/logging/docs/api/v2/resource-list">supported</a> resource types.
@@ -248,7 +248,7 @@ public void addLoggingEventEnhancer(String enhancerClassName) {
248248
/**
249249
* Returns the current value of the ingestion mode.
250250
*
251-
* <p>The method is deprecated. Use appender configuration to setup the ingestion
251+
* <p>The method is deprecated. Use appender configuration to set up the ingestion
252252
*
253253
* @return a {@link Synchronicity} value of the ingestion module.
254254
*/
@@ -344,7 +344,7 @@ String getProjectId() {
344344

345345
@Override
346346
protected void append(ILoggingEvent e) {
347-
List<LogEntry> entriesList = new ArrayList<LogEntry>();
347+
List<LogEntry> entriesList = new ArrayList<>();
348348
entriesList.add(logEntryFor(e));
349349
// Check if instrumentation was already added - if not, create a log entry with instrumentation
350350
// data
@@ -531,7 +531,7 @@ private static Severity severityFor(Level level) {
531531
* The package-private helper method used to set the flag which indicates if instrumentation info
532532
* already written or not.
533533
*
534-
* @returns The value of the flag before it was set.
534+
* @return The value of the flag before it was set.
535535
*/
536536
static boolean setInstrumentationStatus(boolean value) {
537537
if (instrumentationAdded == value) return instrumentationAdded;

src/main/java/com/google/cloud/logging/logback/MDCEventEnhancer.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030
final class MDCEventEnhancer implements LoggingEventEnhancer {
3131

3232
@Override
33-
public final void enhanceLogEntry(LogEntry.Builder builder, ILoggingEvent e) {
33+
public void enhanceLogEntry(LogEntry.Builder builder, ILoggingEvent e) {
3434
for (Map.Entry<String, String> entry : e.getMDCPropertyMap().entrySet()) {
3535
if (null != entry.getKey() && null != entry.getValue()) {
3636
builder.addLabel(entry.getKey(), entry.getValue());

src/test/java/com/google/cloud/logging/logback/LoggingAppenderTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,9 @@ public class LoggingAppenderTest {
6363
private static final String OVERRIDED_PROJECT_ID = "some-project-id";
6464
private static final String DUMMY_CRED_FILE_PATH =
6565
"src/test/java/com/google/cloud/logging/logback/dummy-credentials.json";
66-
private static Payload.JsonPayload JSON_PAYLOAD =
66+
private static final Payload.JsonPayload JSON_PAYLOAD =
6767
Payload.JsonPayload.of(ImmutableMap.of("message", "this is a test"));
68-
private static Payload.JsonPayload JSON_ERROR_PAYLOAD =
68+
private static final Payload.JsonPayload JSON_ERROR_PAYLOAD =
6969
Payload.JsonPayload.of(
7070
ImmutableMap.of(
7171
"message",

0 commit comments

Comments
 (0)