Repository: logging-log4j2 Updated Branches: refs/heads/master 562e5162e -> 98cb89bd2
Add missing '@Override' annotations. Project: http://git-wip-us.apache.org/repos/asf/logging-log4j2/repo Commit: http://git-wip-us.apache.org/repos/asf/logging-log4j2/commit/98cb89bd Tree: http://git-wip-us.apache.org/repos/asf/logging-log4j2/tree/98cb89bd Diff: http://git-wip-us.apache.org/repos/asf/logging-log4j2/diff/98cb89bd Branch: refs/heads/master Commit: 98cb89bd20c451bf2c1632cd765cfa60dce5dc5a Parents: 562e516 Author: ggregory <[email protected]> Authored: Thu Jul 9 00:15:58 2015 -0700 Committer: ggregory <[email protected]> Committed: Thu Jul 9 00:15:58 2015 -0700 ---------------------------------------------------------------------- .../java/org/apache/logging/log4j/Marker.java | 208 ++++++++++--------- .../rolling/DefaultRolloverStrategy.java | 6 + 2 files changed, 111 insertions(+), 103 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/98cb89bd/log4j-api/src/main/java/org/apache/logging/log4j/Marker.java ---------------------------------------------------------------------- diff --git a/log4j-api/src/main/java/org/apache/logging/log4j/Marker.java b/log4j-api/src/main/java/org/apache/logging/log4j/Marker.java index 41f9e91..8bad2fc 100644 --- a/log4j-api/src/main/java/org/apache/logging/log4j/Marker.java +++ b/log4j-api/src/main/java/org/apache/logging/log4j/Marker.java @@ -1,103 +1,105 @@ -/* - * Licensed to the Apache Software Foundation (ASF) under one or more - * contributor license agreements. See the NOTICE file distributed with - * this work for additional information regarding copyright ownership. - * The ASF licenses this file to You under the Apache license, Version 2.0 - * (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the license for the specific language governing permissions and - * limitations under the license. - */ -package org.apache.logging.log4j; - -import java.io.Serializable; - -/** - * Markers are objects that are used to add easily filterable information to log messages. - * - * Markers can be hierarchical - each Marker may have a parent. This allows for broad categories - * being subdivided into more specific categories. An example might be a Marker named "Error" with - * children named "SystemError" and "ApplicationError". - */ -public interface Marker extends Serializable { - - /** - * Adds a Marker as a parent to this Marker. - * @param markers The parent markers to add. - * @return The current Marker object, thus allowing multiple adds to be concatenated. - * @throws IllegalArgumentException if the argument is {@code null} - */ - Marker addParents(Marker... markers); - - /** - * Returns true if the given marker has the same name as this marker. - * - * @param obj the reference object with which to compare. - * @return true if the given marker has the same name as this marker. - * @since 2.4 - */ - public boolean equals(Object obj); - - /** - * Returns the name of this Marker. - * @return The name of the Marker. - */ - String getName(); - - /** - * Returns a list of parents of this Marker. - * @return The parent Markers or {@code null} if this Marker has no parents. - */ - Marker[] getParents(); - - /** - * Returns a hash code value based on the name of this marker. - * Markers are equal if they have the same name. - * @return the computed hash code - * @since 2.4 - */ - public int hashCode(); - - /** - * Indicates whether this Marker has references to any other Markers. - * @return {@code true} if the Marker has parent Markers - */ - boolean hasParents(); - - /** - * Checks whether this Marker is an instance of the specified Marker. - * @param m The Marker to check. - * @return {@code true} if this Marker or one of its ancestors is the specified Marker, {@code false} otherwise. - * @throws IllegalArgumentException if the argument is {@code null} - */ - boolean isInstanceOf(Marker m); - - /** - * Checks whether this Marker is an instance of the specified Marker. - * @param name The name of the Marker. - * @return {@code true} if this Marker or one of its ancestors matches the specified name, {@code false} otherwise. - * @throws IllegalArgumentException if the argument is {@code null} - */ - boolean isInstanceOf(String name); - - /** - * Removes the specified Marker as a parent of this Marker. - * @param marker The marker to remove. - * @return {@code true} if the marker was removed. - * @throws IllegalArgumentException if the argument is {@code null} - */ - boolean remove(Marker marker); - - /** - * Replaces the set of parent Markers with the provided Markers. - * @param markers The new set of parent Markers or {@code null} to clear the parents. - * @return The current Marker object. - */ - Marker setParents(Marker... markers); -} +/* + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with + * this work for additional information regarding copyright ownership. + * The ASF licenses this file to You under the Apache license, Version 2.0 + * (the "License"); you may not use this file except in compliance with + * the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the license for the specific language governing permissions and + * limitations under the license. + */ +package org.apache.logging.log4j; + +import java.io.Serializable; + +/** + * Markers are objects that are used to add easily filterable information to log messages. + * + * Markers can be hierarchical - each Marker may have a parent. This allows for broad categories + * being subdivided into more specific categories. An example might be a Marker named "Error" with + * children named "SystemError" and "ApplicationError". + */ +public interface Marker extends Serializable { + + /** + * Adds a Marker as a parent to this Marker. + * @param markers The parent markers to add. + * @return The current Marker object, thus allowing multiple adds to be concatenated. + * @throws IllegalArgumentException if the argument is {@code null} + */ + Marker addParents(Marker... markers); + + /** + * Returns true if the given marker has the same name as this marker. + * + * @param obj the reference object with which to compare. + * @return true if the given marker has the same name as this marker. + * @since 2.4 + */ + @Override + public boolean equals(Object obj); + + /** + * Returns the name of this Marker. + * @return The name of the Marker. + */ + String getName(); + + /** + * Returns a list of parents of this Marker. + * @return The parent Markers or {@code null} if this Marker has no parents. + */ + Marker[] getParents(); + + /** + * Returns a hash code value based on the name of this marker. + * Markers are equal if they have the same name. + * @return the computed hash code + * @since 2.4 + */ + @Override + public int hashCode(); + + /** + * Indicates whether this Marker has references to any other Markers. + * @return {@code true} if the Marker has parent Markers + */ + boolean hasParents(); + + /** + * Checks whether this Marker is an instance of the specified Marker. + * @param m The Marker to check. + * @return {@code true} if this Marker or one of its ancestors is the specified Marker, {@code false} otherwise. + * @throws IllegalArgumentException if the argument is {@code null} + */ + boolean isInstanceOf(Marker m); + + /** + * Checks whether this Marker is an instance of the specified Marker. + * @param name The name of the Marker. + * @return {@code true} if this Marker or one of its ancestors matches the specified name, {@code false} otherwise. + * @throws IllegalArgumentException if the argument is {@code null} + */ + boolean isInstanceOf(String name); + + /** + * Removes the specified Marker as a parent of this Marker. + * @param marker The marker to remove. + * @return {@code true} if the marker was removed. + * @throws IllegalArgumentException if the argument is {@code null} + */ + boolean remove(Marker marker); + + /** + * Replaces the set of parent Markers with the provided Markers. + * @param markers The new set of parent Markers or {@code null} to clear the parents. + * @return The current Marker object. + */ + Marker setParents(Marker... markers); +} http://git-wip-us.apache.org/repos/asf/logging-log4j2/blob/98cb89bd/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/DefaultRolloverStrategy.java ---------------------------------------------------------------------- diff --git a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/DefaultRolloverStrategy.java b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/DefaultRolloverStrategy.java index 5f2d606..10b2340 100644 --- a/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/DefaultRolloverStrategy.java +++ b/log4j-core/src/main/java/org/apache/logging/log4j/core/appender/rolling/DefaultRolloverStrategy.java @@ -82,6 +82,7 @@ public class DefaultRolloverStrategy implements RolloverStrategy { private enum FileExtensions { ZIP(".zip") { + @Override Action createCompressAction(final String renameTo, final String compressedName, final boolean deleteSource, final int compressionLevel) { return new ZipCompressAction(new File(baseName(renameTo)), new File(compressedName), deleteSource, @@ -89,12 +90,14 @@ public class DefaultRolloverStrategy implements RolloverStrategy { } }, GZIP(".gz") { + @Override Action createCompressAction(final String renameTo, final String compressedName, final boolean deleteSource, final int compressionLevel) { return new GzCompressAction(new File(baseName(renameTo)), new File(compressedName), deleteSource); } }, BZIP2(".bz2") { + @Override Action createCompressAction(final String renameTo, final String compressedName, final boolean deleteSource, final int compressionLevel) { // One of "gz", "bzip2", "xz", "pack200", or "deflate". @@ -102,6 +105,7 @@ public class DefaultRolloverStrategy implements RolloverStrategy { } }, DEFALTE(".deflate") { + @Override Action createCompressAction(final String renameTo, final String compressedName, final boolean deleteSource, final int compressionLevel) { // One of "gz", "bzip2", "xz", "pack200", or "deflate". @@ -109,6 +113,7 @@ public class DefaultRolloverStrategy implements RolloverStrategy { } }, PACK200(".pack200") { + @Override Action createCompressAction(final String renameTo, final String compressedName, final boolean deleteSource, final int compressionLevel) { // One of "gz", "bzip2", "xz", "pack200", or "deflate". @@ -116,6 +121,7 @@ public class DefaultRolloverStrategy implements RolloverStrategy { } }, XY(".xy") { + @Override Action createCompressAction(final String renameTo, final String compressedName, final boolean deleteSource, final int compressionLevel) { // One of "gz", "bzip2", "xz", "pack200", or "deflate".
