Merge pull request #1634 from cal101/erefactor/v5-dev-project/1/jdt/jdt-RemoveAllTrailingWhitespaceCleanUp-3

[cleanup] erefactor/EclipseJdt - Remove trailing whitespace - All lines
This commit is contained in:
Golden Looly 2021-06-07 02:02:44 +08:00 committed by GitHub
commit 5ef8fab528
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
20 changed files with 112 additions and 112 deletions

View File

@ -7,7 +7,7 @@ import java.util.Set;
/**
* Boolean类型相关工具类
*
*
* @author looly
* @since 4.1.16
*/
@ -18,7 +18,7 @@ public class BooleanUtil {
/**
* 取相反值
*
*
* @param bool Boolean值
* @return 相反的Boolean值
*/
@ -63,7 +63,7 @@ public class BooleanUtil {
/**
* 取相反值
*
*
* @param bool Boolean值
* @return 相反的Boolean值
*/
@ -73,7 +73,7 @@ public class BooleanUtil {
/**
* 转换字符串为boolean值
*
*
* @param valueStr 字符串
* @return boolean值
*/
@ -87,7 +87,7 @@ public class BooleanUtil {
/**
* boolean值转为int
*
*
* @param value Boolean值
* @return int值
*/
@ -97,7 +97,7 @@ public class BooleanUtil {
/**
* boolean值转为Integer
*
*
* @param value Boolean值
* @return Integer值
*/
@ -107,7 +107,7 @@ public class BooleanUtil {
/**
* boolean值转为char
*
*
* @param value Boolean值
* @return char值
*/
@ -117,7 +117,7 @@ public class BooleanUtil {
/**
* boolean值转为Character
*
*
* @param value Boolean值
* @return Character值
*/
@ -127,7 +127,7 @@ public class BooleanUtil {
/**
* boolean值转为byte
*
*
* @param value Boolean值
* @return byte值
*/
@ -137,7 +137,7 @@ public class BooleanUtil {
/**
* boolean值转为Byte
*
*
* @param value Boolean值
* @return Byte值
*/
@ -147,7 +147,7 @@ public class BooleanUtil {
/**
* boolean值转为long
*
*
* @param value Boolean值
* @return long值
*/
@ -157,7 +157,7 @@ public class BooleanUtil {
/**
* boolean值转为Long
*
*
* @param value Boolean值
* @return Long值
*/
@ -167,7 +167,7 @@ public class BooleanUtil {
/**
* boolean值转为short
*
*
* @param value Boolean值
* @return short值
*/
@ -177,7 +177,7 @@ public class BooleanUtil {
/**
* boolean值转为Short
*
*
* @param value Boolean值
* @return Short值
*/
@ -187,7 +187,7 @@ public class BooleanUtil {
/**
* boolean值转为float
*
*
* @param value Boolean值
* @return float值
*/
@ -197,7 +197,7 @@ public class BooleanUtil {
/**
* boolean值转为Float
*
*
* @param value Boolean值
* @return float值
*/
@ -207,7 +207,7 @@ public class BooleanUtil {
/**
* boolean值转为double
*
*
* @param value Boolean值
* @return double值
*/
@ -217,7 +217,7 @@ public class BooleanUtil {
/**
* boolean值转为double
*
*
* @param value Boolean值
* @return double值
*/
@ -437,7 +437,7 @@ public class BooleanUtil {
/**
* 给定类是否为Boolean或者boolean
*
*
* @param clazz
* @return 是否为Boolean或者boolean
* @since 4.5.2

View File

@ -15,7 +15,7 @@ import java.util.concurrent.ConcurrentHashMap;
/**
* {@link ClassLoader}工具类
*
*
* @author Looly
* @since 3.0.9
*/
@ -57,7 +57,7 @@ public class ClassLoaderUtil {
/**
* 获取当前线程的{@link ClassLoader}
*
*
* @return 当前线程的class loader
* @see Thread#getContextClassLoader()
*/
@ -68,13 +68,13 @@ public class ClassLoaderUtil {
/**
* 获取{@link ClassLoader}<br>
* 获取顺序如下<br>
*
*
* <pre>
* 1获取当前线程的ContextClassLoader
* 2获取当前类对应的ClassLoader
* 3获取系统ClassLoader{@link ClassLoader#getSystemClassLoader()}
* </pre>
*
*
* @return 类加载器
*/
public static ClassLoader getClassLoader() {
@ -92,13 +92,13 @@ public class ClassLoaderUtil {
/**
* 加载类通过传入类的字符串返回其对应的类名使用默认ClassLoader并初始化类调用static模块内容和初始化static属性<br>
* 扩展{@link Class#forName(String, boolean, ClassLoader)}方法支持以下几类类名的加载
*
*
* <pre>
* 1原始类型例如int
* 2数组类型例如int[]Long[]String[]
* 3内部类例如java.lang.Thread.State会被转为java.lang.Thread$State加载
* </pre>
*
*
* @param name 类名
* @return 类名对应的类
* @throws UtilException 包装{@link ClassNotFoundException}没有类名对应的类时抛出此异常
@ -110,13 +110,13 @@ public class ClassLoaderUtil {
/**
* 加载类通过传入类的字符串返回其对应的类名使用默认ClassLoader<br>
* 扩展{@link Class#forName(String, boolean, ClassLoader)}方法支持以下几类类名的加载
*
*
* <pre>
* 1原始类型例如int
* 2数组类型例如int[]Long[]String[]
* 3内部类例如java.lang.Thread.State会被转为java.lang.Thread$State加载
* </pre>
*
*
* @param name 类名
* @param isInitialized 是否初始化类调用static模块内容和初始化static属性
* @return 类名对应的类
@ -131,13 +131,13 @@ public class ClassLoaderUtil {
* 此方法支持缓存第一次被加载的类之后会读取缓存中的类<br>
* 加载失败的原因可能是此类不存在或其关联引用类不存在<br>
* 扩展{@link Class#forName(String, boolean, ClassLoader)}方法支持以下几类类名的加载
*
*
* <pre>
* 1原始类型例如int
* 2数组类型例如int[]Long[]String[]
* 3内部类例如java.lang.Thread.State会被转为java.lang.Thread$State加载
* </pre>
*
*
* @param name 类名
* @param classLoader {@link ClassLoader}{@code null} 则使用系统默认ClassLoader
* @param isInitialized 是否初始化类调用static模块内容和初始化static属性
@ -193,7 +193,7 @@ public class ClassLoaderUtil {
/**
* 加载原始类型的类包括原始类型原始类型数组和void
*
*
* @param name 原始类型名比如 int
* @return 原始类型类
*/
@ -210,7 +210,7 @@ public class ClassLoaderUtil {
/**
* 创建新的{@link JarClassLoader}并使用此Classloader加载目录下的class文件和jar文件
*
*
* @param jarOrDir jar文件或者包含jar和class文件的目录
* @return {@link JarClassLoader}
* @since 4.4.2
@ -221,7 +221,7 @@ public class ClassLoaderUtil {
/**
* 加载外部类
*
*
* @param jarOrDir jar文件或者包含jar和class文件的目录
* @param name 类名
* @return
@ -240,7 +240,7 @@ public class ClassLoaderUtil {
* 指定类是否被提供使用默认ClassLoader<br>
* 通过调用{@link #loadClass(String, ClassLoader, boolean)}方法尝试加载指定类名的类如果加载失败返回false<br>
* 加载失败的原因可能是此类不存在或其关联引用类不存在
*
*
* @param className 类名
* @return 是否被提供
*/
@ -252,7 +252,7 @@ public class ClassLoaderUtil {
* 指定类是否被提供<br>
* 通过调用{@link #loadClass(String, ClassLoader, boolean)}方法尝试加载指定类名的类如果加载失败返回false<br>
* 加载失败的原因可能是此类不存在或其关联引用类不存在
*
*
* @param className 类名
* @param classLoader {@link ClassLoader}
* @return 是否被提供
@ -269,7 +269,7 @@ public class ClassLoaderUtil {
// ----------------------------------------------------------------------------------- Private method start
/**
* 尝试转换并加载内部类例如java.lang.Thread.State =java.lang.Thread$State
*
*
* @param name 类名
* @param classLoader {@link ClassLoader}{@code null} 则使用系统默认ClassLoader
* @param isInitialized 是否初始化类调用static模块内容和初始化static属性

View File

@ -14,15 +14,15 @@ import java.lang.ref.WeakReference;
* 2. {@link WeakReference} 弱引用在GC时发现弱引用会回收其对象
* 3. {@link PhantomReference} 虚引用在GC时发现虚引用对象会将{@link PhantomReference}插入{@link ReferenceQueue} 此时对象未被真正回收要等到{@link ReferenceQueue}被真正处理后才会被回收
* </pre>
*
*
* @author looly
* @since 3.1.2
*/
public class ReferenceUtil {
/**
* 获得引用
*
*
* @param <T> 被引用对象类型
* @param type 引用类型枚举
* @param referent 被引用对象
@ -34,7 +34,7 @@ public class ReferenceUtil {
/**
* 获得引用
*
*
* @param <T> 被引用对象类型
* @param type 引用类型枚举
* @param referent 被引用对象
@ -56,7 +56,7 @@ public class ReferenceUtil {
/**
* 引用类型
*
*
* @author looly
*
*/

View File

@ -1,6 +1,6 @@
/**
* 提供各种工具方法按照归类入口为XXXUtil如字符串工具StrUtil等
*
*
* @author looly
*
*/

View File

@ -8,7 +8,7 @@ import java.lang.annotation.Target;
/**
* 用于单元测试的注解类<br>
* 注解类相关说明见https://www.cnblogs.com/xdp-gacl/p/3622275.html
*
*
* @author looly
*
*/
@ -17,10 +17,10 @@ import java.lang.annotation.Target;
// Target注解决定MyAnnotation注解可以加在哪些成分上如加在类身上或者属性身上或者方法身上等成分
@Target({ ElementType.METHOD, ElementType.TYPE })
public @interface AnnotationForTest {
/**
* 注解的默认属性值
*
*
* @return 属性值
*/
String value();

View File

@ -14,7 +14,7 @@ import cn.hutool.core.lang.test.bean.UserInfoDict;
/**
* {@link BeanPath} 单元测试
*
*
* @author looly
*
*/
@ -66,7 +66,7 @@ public class BeanPathTest {
Assert.assertEquals("id", pattern.patternParts.get(3));
}
@Test
public void beanPathTest2() {
BeanPath pattern = new BeanPath("[userInfo][examInfoDict][0][id]");
@ -75,7 +75,7 @@ public class BeanPathTest {
Assert.assertEquals("0", pattern.patternParts.get(2));
Assert.assertEquals("id", pattern.patternParts.get(3));
}
@Test
public void beanPathTest3() {
BeanPath pattern = new BeanPath("['userInfo']['examInfoDict'][0]['id']");

View File

@ -11,10 +11,10 @@ import org.junit.Test;
*
*/
public class CloneTest {
@Test
public void cloneTest(){
//实现Cloneable接口
Cat cat = new Cat();
Cat cat2 = cat.clone();
@ -28,7 +28,7 @@ public class CloneTest {
Dog dog2 = dog.clone();
Assert.assertEquals(dog, dog2);
}
//------------------------------------------------------------------------------- private Class for test
/**
* 猫猫类使用实现Cloneable方式
@ -39,7 +39,7 @@ public class CloneTest {
static class Cat implements Cloneable<Cat>{
private String name = "miaomiao";
private int age = 2;
@Override
public Cat clone() {
try {
@ -49,7 +49,7 @@ public class CloneTest {
}
}
}
/**
* 狗狗类用于继承CloneSupport类
* @author Looly

View File

@ -4,11 +4,11 @@ import org.junit.Assert;
import org.junit.Test;
public class BCDTest {
@Test
public void bcdTest(){
String strForTest = "123456ABCDEF";
//转BCD
byte[] bcd = BCD.strToBcd(strForTest);
String str = BCD.bcdToStr(bcd);

View File

@ -4,13 +4,13 @@ import org.junit.Assert;
import org.junit.Test;
public class Base32Test {
@Test
public void encodeAndDecodeTest(){
String a = "伦家是一个非常长的字符串";
String encode = Base32.encode(a);
Assert.assertEquals("4S6KNZNOW3TJRL7EXCAOJOFK5GOZ5ZNYXDUZLP7HTKCOLLMX46WKNZFYWI", encode);
String decodeStr = Base32.decodeStr(encode);
Assert.assertEquals(a, decodeStr);
}

View File

@ -5,7 +5,7 @@ import org.junit.Test;
/**
* Base62单元测试
*
*
* @author looly
*
*/

View File

@ -4,7 +4,7 @@ import org.junit.Assert;
import org.junit.Test;
public class CaesarTest {
@Test
public void caesarTest() {
String str = "1f2e9df6131b480b9fdddc633cf24996";

View File

@ -4,7 +4,7 @@ import org.junit.Assert;
import org.junit.Test;
public class MorseTest {
private final Morse morseCoder = new Morse();
@Test

View File

@ -4,14 +4,14 @@ import org.junit.Assert;
import org.junit.Test;
public class RotTest {
@Test
public void rot13Test() {
String str = "1f2e9df6131b480b9fdddc633cf24996";
String encode13 = Rot.encode13(str);
Assert.assertEquals("4s5r2qs9464o713o2sqqqp966ps57229", encode13);
String decode13 = Rot.decode13(encode13);
Assert.assertEquals(str, decode13);
}

View File

@ -11,7 +11,7 @@ import java.util.*;
*
*/
public class IterUtilTest {
@Test
public void fieldValueMapTest() {
ArrayList<Car> carList = CollUtil.newArrayList(new Car("123", "大众"), new Car("345", "奔驰"), new Car("567", "路虎"));
@ -27,11 +27,11 @@ public class IterUtilTest {
ArrayList<String> list = CollUtil.newArrayList("1", "2", "3", "4");
String join = IterUtil.join(list.iterator(), ":");
Assert.assertEquals("1:2:3:4", join);
ArrayList<Integer> list1 = CollUtil.newArrayList(1, 2, 3, 4);
String join1 = IterUtil.join(list1.iterator(), ":");
Assert.assertEquals("1:2:3:4", join1);
ArrayList<String> list2 = CollUtil.newArrayList("1", "2", "3", "4");
String join2 = IterUtil.join(list2.iterator(), ":", "\"", "\"");
Assert.assertEquals("\"1\":\"2\":\"3\":\"4\"", join2);

View File

@ -11,20 +11,20 @@ import org.junit.Test;
import cn.hutool.core.map.MapProxy;
public class MapProxyTest {
@Test
public void mapProxyTest() {
Map<String, String> map = new HashMap<>();
map.put("a", "1");
map.put("b", "2");
MapProxy mapProxy = new MapProxy(map);
Integer b = mapProxy.getInt("b");
Assert.assertEquals(new Integer(2), b);
Set<Object> keys = mapProxy.keySet();
Assert.assertFalse(keys.isEmpty());
Set<Entry<Object,Object>> entrys = mapProxy.entrySet();
Assert.assertFalse(entrys.isEmpty());
}

View File

@ -5,42 +5,42 @@ import org.junit.Test;
/**
* 版本比较单元测试
*
*
* @author looly
*
*/
public class VersionComparatorTest {
@Test
public void versionComparatorTest1() {
int compare = VersionComparator.INSTANCE.compare("1.2.1", "1.12.1");
Assert.assertTrue(compare < 0);
}
@Test
public void versionComparatorTest2() {
int compare = VersionComparator.INSTANCE.compare("1.12.1", "1.12.1c");
Assert.assertTrue(compare < 0);
}
@Test
public void versionComparatorTest3() {
int compare = VersionComparator.INSTANCE.compare(null, "1.12.1c");
Assert.assertTrue(compare < 0);
}
@Test
public void versionComparatorTest4() {
int compare = VersionComparator.INSTANCE.compare("1.13.0", "1.12.1c");
Assert.assertTrue(compare > 0);
}
@Test
public void versionComparatorTest5() {
int compare = VersionComparator.INSTANCE.compare("V1.2", "V1.1");
Assert.assertTrue(compare > 0);
}
@Test
public void versionComparatorTes6() {
int compare = VersionComparator.INSTANCE.compare("V0.0.20170102", "V0.0.20170101");

View File

@ -63,11 +63,11 @@ public class ConvertOtherTest {
double a = 67556.32;
String digitUppercase = Convert.digitToChinese(a);
Assert.assertEquals("陆万柒仟伍佰伍拾陆元叁角贰分", digitUppercase);
a = 1024.00;
digitUppercase = Convert.digitToChinese(a);
Assert.assertEquals("壹仟零贰拾肆元整", digitUppercase);
a = 1024;
digitUppercase = Convert.digitToChinese(a);
Assert.assertEquals("壹仟零贰拾肆元整", digitUppercase);

View File

@ -14,7 +14,7 @@ import java.util.ArrayList;
/**
* 类型转换工具单元测试<br>
* 转换为数组
*
*
* @author Looly
*
*/
@ -23,13 +23,13 @@ public class ConvertToArrayTest {
@Test
public void toIntArrayTest() {
String[] b = { "1", "2", "3", "4" };
Integer[] integerArray = Convert.toIntArray(b);
Assert.assertArrayEquals(integerArray, new Integer[]{1,2,3,4});
int[] intArray = Convert.convert(int[].class, b);
Assert.assertArrayEquals(intArray, new int[]{1,2,3,4});
long[] c = {1,2,3,4,5};
Integer[] intArray2 = Convert.toIntArray(c);
Assert.assertArrayEquals(intArray2, new Integer[]{1,2,3,4,5});
@ -43,49 +43,49 @@ public class ConvertToArrayTest {
Integer[] integerArray = (Integer[]) arrayConverter.convert(b, null);
Assert.assertArrayEquals(integerArray, new Integer[]{null, 1});
}
@Test
public void toLongArrayTest() {
String[] b = { "1", "2", "3", "4" };
Long[] longArray = Convert.toLongArray(b);
Assert.assertArrayEquals(longArray, new Long[]{1L,2L,3L,4L});
long[] longArray2 = Convert.convert(long[].class, b);
Assert.assertArrayEquals(longArray2, new long[]{1L,2L,3L,4L});
int[] c = {1,2,3,4,5};
Long[] intArray2 = Convert.toLongArray(c);
Assert.assertArrayEquals(intArray2, new Long[]{1L,2L,3L,4L,5L});
}
@Test
public void toDoubleArrayTest() {
String[] b = { "1", "2", "3", "4" };
Double[] doubleArray = Convert.toDoubleArray(b);
Assert.assertArrayEquals(doubleArray, new Double[]{1D,2D,3D,4D});
double[] doubleArray2 = Convert.convert(double[].class, b);
Assert.assertArrayEquals(doubleArray2, new double[]{1D,2D,3D,4D}, 2);
int[] c = {1,2,3,4,5};
Double[] intArray2 = Convert.toDoubleArray(c);
Assert.assertArrayEquals(intArray2, new Double[]{1D,2D,3D,4D,5D});
}
@Test
public void toPrimitiveArrayTest(){
//数组转数组测试
int[] a = new int[]{1,2,3,4};
long[] result = ConverterRegistry.getInstance().convert(long[].class, a);
Assert.assertArrayEquals(new long[]{1L, 2L, 3L, 4L}, result);
//数组转数组测试
byte[] resultBytes = ConverterRegistry.getInstance().convert(byte[].class, a);
Assert.assertArrayEquals(new byte[]{1, 2, 3, 4}, resultBytes);
//字符串转数组
String arrayStr = "1,2,3,4,5";
//获取Converter类的方法2自己实例化相应Converter对象
@ -93,32 +93,32 @@ public class ConvertToArrayTest {
int[] result3 = (int[]) c3.convert(arrayStr, null);
Assert.assertArrayEquals(new int[]{1,2,3,4,5}, result3);
}
@Test
public void collectionToArrayTest() {
ArrayList<Object> list = new ArrayList<>();
list.add("a");
list.add("b");
list.add("c");
String[] result = Convert.toStrArray(list);
Assert.assertEquals(list.get(0), result[0]);
Assert.assertEquals(list.get(1), result[1]);
Assert.assertEquals(list.get(2), result[2]);
}
@Test
public void strToCharArrayTest() {
String testStr = "abcde";
Character[] array = Convert.toCharArray(testStr);
//包装类型数组
Assert.assertEquals(new Character('a'), array[0]);
Assert.assertEquals(new Character('b'), array[1]);
Assert.assertEquals(new Character('c'), array[2]);
Assert.assertEquals(new Character('d'), array[3]);
Assert.assertEquals(new Character('e'), array[4]);
//原始类型数组
char[] array2 = Convert.convert(char[].class, testStr);
Assert.assertEquals('a', array2[0]);
@ -126,16 +126,16 @@ public class ConvertToArrayTest {
Assert.assertEquals('c', array2[2]);
Assert.assertEquals('d', array2[3]);
Assert.assertEquals('e', array2[4]);
}
@Test
@Ignore
public void toUrlArrayTest() {
File[] files = FileUtil.file("D:\\workspace").listFiles();
URL[] urls = Convert.convert(URL[].class, files);
for (URL url : urls) {
Console.log(url.getPath());
}

View File

@ -12,7 +12,7 @@ import java.util.Map;
/**
* 类型转换工具单元测试<br>
* 转换为数组
*
*
* @author Looly
*
*/
@ -25,7 +25,7 @@ public class ConvertToBeanTest {
person.setOpenid("11213232");
person.setName("测试A11");
person.setSubName("sub名字");
Map<?, ?> map = Convert.convert(Map.class, person);
Assert.assertEquals(map.get("name"), "测试A11");
Assert.assertEquals(map.get("age"), 14);
@ -67,7 +67,7 @@ public class ConvertToBeanTest {
Assert.assertEquals("3", map2.get("key3"));
Assert.assertEquals("4", map2.get("key4"));
}
@Test
public void mapToBeanTest() {
HashMap<String, Object> map = new HashMap<>();
@ -76,7 +76,7 @@ public class ConvertToBeanTest {
map.put("openid", "11213232");
map.put("name", "测试A11");
map.put("subName", "sub名字");
SubPerson subPerson = Convert.convert(SubPerson.class, map);
Assert.assertEquals("88dc4b28-91b1-4a1a-bab5-444b795c7ecd", subPerson.getId().toString());
Assert.assertEquals(14, subPerson.getAge());

View File

@ -14,7 +14,7 @@ import java.util.List;
/**
* 转换为集合测试
*
*
* @author looly
*
*/
@ -41,7 +41,7 @@ public class ConvertToCollectionTest {
Assert.assertEquals("", list.get(3));
Assert.assertEquals(1, list.get(4));
}
@Test
public void toListTest2() {
Object[] a = { "a", "", "", "", 1 };
@ -52,7 +52,7 @@ public class ConvertToCollectionTest {
Assert.assertEquals("", list.get(3));
Assert.assertEquals("1", list.get(4));
}
@Test
public void toListTest3() {
Object[] a = { "a", "", "", "", 1 };
@ -63,7 +63,7 @@ public class ConvertToCollectionTest {
Assert.assertEquals("", list.get(3));
Assert.assertEquals("1", list.get(4));
}
@Test
public void toListTest4() {
Object[] a = { "a", "", "", "", 1 };
@ -90,7 +90,7 @@ public class ConvertToCollectionTest {
Assert.assertEquals(1, list2.size());
Assert.assertEquals("a", list2.get(0));
}
@Test
public void strToListTest2() {
String a = "a,你,好,123";