Skip to content

Commit

Permalink
GEODE-9758: Move ClassUtils to geode-common (apache#7166)
Browse files Browse the repository at this point in the history
  • Loading branch information
kirklund authored Dec 10, 2021
1 parent 53c353b commit b6fca29
Show file tree
Hide file tree
Showing 11 changed files with 19 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
* the License.
*/

package org.apache.geode.internal.lang;
package org.apache.geode.internal.lang.utils;

import org.apache.geode.annotations.Immutable;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
*/
package org.apache.geode.internal.lang;
package org.apache.geode.internal.lang.utils;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
Expand All @@ -22,20 +22,20 @@
import java.util.Calendar;
import java.util.Date;

import org.apache.commons.lang3.StringUtils;
import org.junit.Test;


/**
* The ClassUtilsJUnitTest class is a test suite with test cases to test the contract and
* functionality of the ClassUtils class.
* <p/>
*
* @see org.apache.geode.internal.lang.ClassUtils
* @see ClassUtils
* @see org.junit.Assert
* @see org.junit.Test
* @since GemFire 7.0
*/
public class ClassUtilsJUnitTest {
public class ClassUtilsTest {

@Test
public void testForNameWithExistingClass() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,9 @@
import static org.apache.commons.lang3.StringUtils.join;
import static org.apache.commons.lang3.StringUtils.lowerCase;
import static org.apache.geode.distributed.ConfigurationProperties.NAME;
import static org.apache.geode.internal.lang.ClassUtils.forName;
import static org.apache.geode.internal.lang.StringUtils.defaultString;
import static org.apache.geode.internal.lang.SystemUtils.CURRENT_DIRECTORY;
import static org.apache.geode.internal.lang.utils.ClassUtils.forName;

import java.io.File;
import java.io.FileReader;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@
import org.apache.geode.internal.cache.tier.sockets.OldClientSupportService;
import org.apache.geode.internal.cache.tier.sockets.Part;
import org.apache.geode.internal.classloader.ClassPathLoader;
import org.apache.geode.internal.lang.ClassUtils;
import org.apache.geode.internal.lang.utils.ClassUtils;
import org.apache.geode.internal.logging.log4j.LogMarker;
import org.apache.geode.internal.serialization.BasicSerializable;
import org.apache.geode.internal.serialization.DSCODE;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
import static java.util.Collections.emptySet;
import static org.apache.geode.distributed.internal.DistributionConfig.SERIALIZABLE_OBJECT_FILTER_NAME;
import static org.apache.geode.distributed.internal.DistributionConfig.VALIDATE_SERIALIZABLE_OBJECTS_NAME;
import static org.apache.geode.internal.lang.ClassUtils.isClassAvailable;
import static org.apache.geode.internal.lang.utils.ClassUtils.isClassAvailable;
import static org.assertj.core.api.Assertions.assertThat;
import static org.assertj.core.api.Assertions.catchThrowable;
import static org.junit.Assume.assumeTrue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

import static java.util.Collections.emptySet;
import static org.apache.geode.distributed.internal.DistributionConfig.VALIDATE_SERIALIZABLE_OBJECTS_NAME;
import static org.apache.geode.internal.lang.ClassUtils.isClassAvailable;
import static org.apache.geode.internal.lang.utils.ClassUtils.isClassAvailable;
import static org.apache.geode.internal.serialization.KnownVersion.CURRENT;
import static org.junit.Assume.assumeTrue;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

import org.apache.geode.cache.execute.ResultCollector;
import org.apache.geode.distributed.DistributedMember;
import org.apache.geode.internal.lang.ClassUtils;
import org.apache.geode.internal.lang.utils.ClassUtils;
import org.apache.geode.management.cli.CliMetaData;
import org.apache.geode.management.cli.ConverterHint;
import org.apache.geode.management.cli.GfshCommand;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

import static java.lang.System.lineSeparator;
import static org.apache.geode.internal.util.ProductVersionUtil.getDistributionVersion;
import static org.apache.geode.internal.util.ProductVersionUtil.getFullVersion;

import java.io.BufferedReader;
import java.io.File;
Expand Down Expand Up @@ -50,7 +49,7 @@
import org.apache.geode.annotations.internal.MakeNotStatic;
import org.apache.geode.annotations.internal.MutableForTesting;
import org.apache.geode.internal.SystemDescription;
import org.apache.geode.internal.lang.ClassUtils;
import org.apache.geode.internal.lang.utils.ClassUtils;
import org.apache.geode.internal.logging.Banner;
import org.apache.geode.internal.process.signal.AbstractSignalNotificationHandler;
import org.apache.geode.internal.serialization.KnownVersion;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@
*/
package org.apache.geode.codeAnalysis;

import static org.apache.commons.lang3.StringUtils.isBlank;

import java.io.BufferedReader;
import java.io.BufferedWriter;
import java.io.File;
Expand Down Expand Up @@ -300,11 +302,11 @@ public static List<ClassAndVariableDetails> loadClassesAndVariables(InputStream
String line;
while ((line = in.readLine()) != null) {
line = line.trim();
if (line.startsWith("#") || line.startsWith("//")) {
if (isBlank(line) || line.startsWith("#") || line.startsWith("//")) {
// comment line
} else {
result.add(new ClassAndVariableDetails(line));
continue;
}
result.add(new ClassAndVariableDetails(line));
}
return result;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ public class SerializationDependenciesTest {
resideInAPackage("org.apache.geode.internal.serialization..")
.or(not(resideInAPackage("org.apache.geode..")))
.or(resideInAPackage("org.apache.geode.annotations.."))
.or(resideInAPackage("org.apache.geode.logging.."))
.or(resideInAPackage("org.apache.geode.internal.lang.utils.."))
.or(resideInAPackage("org.apache.geode.logging.internal.log4j.api.."))
.or(resideInAPackage("org.apache.geode.test..")));
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

import org.springframework.util.StringUtils;

import org.apache.geode.internal.lang.ClassUtils;
import org.apache.geode.internal.lang.utils.ClassUtils;

/**
* The NumberUtils class is a utility class for working with numbers.
Expand Down

0 comments on commit b6fca29

Please sign in to comment.