设为首页收藏本站

LUPA开源社区

 找回密码
 注册
文章 帖子 博客
LUPA开源社区 首页 业界资讯 软件追踪 查看内容

feilong-core 1.11.5,让Java开发更简便的工具包

2018-7-11 22:28| 发布者: joejoe0332| 查看: 446| 评论: 0|原作者: oschina|来自: oschina

摘要: 首先预览下,本次发布的核心内容 :精细化异常信息输出,以便快速的定位问题 :new:#666 com.feilong.core.lang.NumberUtil.getAddValue(Number…) 要允许null值所有数加起来.说明:支持跳过null 元素相加 (since 1.11.5) ...

首先预览下,本次发布的核心内容 :

  • 精细化异常信息输出,以便快速的定位问题

[Feature] :new:

  • #666 com.feilong.core.lang.NumberUtil.getAddValue(Number…) 要允许null值所有数加起来.

说明:

  • 支持跳过null 元素相加 (since 1.11.5)

  • 但是如果所有元素都是null ,将会抛出 IllegalArgumentException

示例:

 NumberUtil.getAddValue(2, 4, 5)              =   11
 NumberUtil.getAddValue(new BigDecimal(6), 5) =   11
 NumberUtil.getAddValue(new BigDecimal(6), null) =   6

  • #751 新建 feilong runtime exception DefaultRuntimeException

主要作用,是在异常message 中追加 cause exception信息,方便查看排查问题

对比

empty message

如下代码

public void testRuntimeException(){
        try{
            int i = 1 / 0;
        }catch (Exception e){
            throw new RuntimeException("", e);
        }
}

抛出的异常情况在控制台是这样的

java.lang.RuntimeException:
    at com.feilong.core.DefaultRuntimeExceptionTest.testRuntimeException(DefaultRuntimeExceptionTest.java:63)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at java.lang.reflect.Method.invoke(Method.java:606)
Caused by: java.lang.ArithmeticException: / by zero
    at com.feilong.core.DefaultRuntimeExceptionTest.testRuntimeException(DefaultRuntimeExceptionTest.java:61)
    ... 23 more

而如果使用 DefaultRuntimeException

    public void testDefaultRuntimeException(){
        try{
            int i = 1 / 0;
        }catch (Exception e){
            throw new DefaultRuntimeException("", e);
        }
    }

抛出来的信息是这样的

com.feilong.core.DefaultRuntimeException: **java.lang.ArithmeticException: / by zero**
    at com.feilong.core.DefaultRuntimeExceptionTest.testDefaultRuntimeException(DefaultRuntimeExceptionTest.java:53)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)

Caused by: java.lang.ArithmeticException: / by zero
    at com.feilong.core.DefaultRuntimeExceptionTest.testDefaultRuntimeException(DefaultRuntimeExceptionTest.java:51)
    ... 23 more

[Update]

  • #747 MethodUtil.invokeStaticMethod(Class<?>, String, Object[], Class<?>[]) 支持 私有的静态方法

[Remove]

  • none

[Fix Bug] :bug:

  • none

[javadoc]

  • #742 ConvertUtil 修改 toBoolean(Object toBeConvertedValue) javadoc

[test]

  • #753 CollectionsUtil new 相关方法添加单元测试

[help wanted]

  • #750 修改 FieldUtil 异常信息

  • #746 修改 PropertyUtil 异常信息

  • #749 修改 ConstructorUtil 异常消息

  • #748 修改 ClassUtil 类异常提示

  • #739 更改 com.feilong.core.bean.BeanUtil 异常提示

  • #745 修改 Stringutil getBytes 异常提示信息

  • #744 修改 URLUtil 异常提示信息

  • #743 修改 URIUtil 相关异常message

  • #742 修改 SortUtil parsePropertyNameAndOrder 方法异常message

  • #741 修改 DateUtil toDate 的报错异常信息

本次升级共有 15 处变更, 具体参见 [1.11.5 milestone]

1.11.5 文档地址: http://feilong-core.mydoc.io/


酷毙

雷人

鲜花

鸡蛋

漂亮
  • 快毕业了,没工作经验,
    找份工作好难啊?
    赶紧去人才芯片公司磨练吧!!

最新评论

关于LUPA|人才芯片工程|人才招聘|LUPA认证|LUPA教育|LUPA开源社区 ( 浙B2-20090187 浙公网安备 33010602006705号   

返回顶部