Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,26 @@
===========================


## [2.2.1](https://github.com/buession/buession-security/releases/tag/v2.2.1) (2023-03-31)

### 🔨依赖升级

- [依赖库版本升级和安全漏洞修复](https://github.com/buession/buession-parent/releases/tag/v2.2.1)
- **buession-geoip:** 升级 IP 库


### 🔔 变化
- **buession-web:** Servlet AbstractHandlerExceptionResolver doResolve 方法支持接收 handler


### ⭐ 新特性

- **buession-web:** 新增实验性 User-Agent 解析工具


---


## [2.2.0](https://github.com/buession/buession-security/releases/tag/v2.2.0) (2023-03-10)

### 🔨依赖升级
Expand Down
4 changes: 2 additions & 2 deletions buession-aop/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
<groupId>com.buession</groupId>
<artifactId>buession-parent</artifactId>
<relativePath>../buession-parent</relativePath>
<version>2.2.0</version>
<version>2.2.1</version>
</parent>
<artifactId>buession-aop</artifactId>
<url>https://github.com/buession/buessionframework</url>
<url>http://www.buession.com/</url>
<description>Buession Framework Aop</description>
<packaging>jar</packaging>

Expand Down
4 changes: 2 additions & 2 deletions buession-beans/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
<groupId>com.buession</groupId>
<artifactId>buession-parent</artifactId>
<relativePath>../buession-parent</relativePath>
<version>2.2.0</version>
<version>2.2.1</version>
</parent>
<artifactId>buession-beans</artifactId>
<url>https://github.com/buession/buessionframework</url>
<url>http://www.buession.com/</url>
<description>Buession Framework Beans</description>
<packaging>jar</packaging>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* +-------------------------------------------------------------------------------------------------------+
* | License: http://www.apache.org/licenses/LICENSE-2.0.txt |
* | Author: Yong.Teng <webmaster@buession.com> |
* | Copyright @ 2013-2022 Buession.com Inc. |
* | Copyright @ 2013-2023 Buession.com Inc. |
* +-------------------------------------------------------------------------------------------------------+
*/
package com.buession.beans;
Expand Down Expand Up @@ -188,15 +188,15 @@ public HumpBeanUtilsBean(ConvertUtilsBean convertUtilsBean, PropertyUtilsBean pr
}

@Override
public void populate(Object bean, Map<String, ? extends Object> properties)
public void populate(Object bean, Map<String, ?> properties)
throws IllegalAccessException, InvocationTargetException{
if(bean != null && properties != null){
if(logger.isDebugEnabled()){
logger.debug("BeanUtils.populate(" + bean + ", " + properties + ")");
}

for(Map.Entry<String, ? extends Object> e : properties.entrySet()){
if(StringUtils.contains(e.getKey(), "_")){
for(Map.Entry<String, ?> e : properties.entrySet()){
if(StringUtils.contains(e.getKey(), '_')){
StringBuilder sb = new StringBuilder(e.getKey().length());

for(int i = 0; i < e.getKey().length(); i++){
Expand Down
4 changes: 2 additions & 2 deletions buession-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
<groupId>com.buession</groupId>
<artifactId>buession-parent</artifactId>
<relativePath>../buession-parent</relativePath>
<version>2.2.0</version>
<version>2.2.1</version>
</parent>
<artifactId>buession-core</artifactId>
<url>https://github.com/buession/buessionframework</url>
<url>http://www.buession.com/</url>
<description>Buession Framework Core</description>
<packaging>jar</packaging>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
* +-------------------------------------------------------------------------------------------------------+
* | License: http://www.apache.org/licenses/LICENSE-2.0.txt |
* | Author: Yong.Teng <webmaster@buession.com> |
* | Copyright @ 2013-2022 Buession.com Inc. |
* | Copyright @ 2013-2023 Buession.com Inc. |
* +-------------------------------------------------------------------------------------------------------+
*/
package com.buession.core.builder;
Expand Down Expand Up @@ -138,7 +138,7 @@ public static <V, S extends List<V>> ListBuilder<V> create(final Class<S> clazz)
data = clazz.newInstance();
}catch(Exception e){
logger.error("Create {} instance error: {}", clazz.getName(), e.getMessage());
data = new ArrayList<>(16);
data = new ArrayList<>();
}

return new ListBuilder<>(data);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
/*
* 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.
*
* =========================================================================================================
*
* This software consists of voluntary contributions made by many individuals on behalf of the
* Apache Software Foundation. For more information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
* +-------------------------------------------------------------------------------------------------------+
* | License: http://www.apache.org/licenses/LICENSE-2.0.txt |
* | Author: Yong.Teng <webmaster@buession.com> |
* | Copyright @ 2013-2023 Buession.com Inc. |
* +-------------------------------------------------------------------------------------------------------+
*/
package com.buession.core.builder;

import com.buession.core.utils.Assert;
Expand Down Expand Up @@ -127,7 +151,7 @@ public static <K, V, M extends Map<K, V>> MapBuilder<K, V> create(final Class<M>
data = clazz.newInstance();
}catch(Exception e){
logger.error("Create {} instance error: {}", clazz.getName(), e.getMessage());
data = new HashMap<>(16);
data = new HashMap<>();
}

return new MapBuilder<>(data);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
/*
* 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.
*
* =========================================================================================================
*
* This software consists of voluntary contributions made by many individuals on behalf of the
* Apache Software Foundation. For more information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
* +-------------------------------------------------------------------------------------------------------+
* | License: http://www.apache.org/licenses/LICENSE-2.0.txt |
* | Author: Yong.Teng <webmaster@buession.com> |
* | Copyright @ 2013-2023 Buession.com Inc. |
* +-------------------------------------------------------------------------------------------------------+
*/
package com.buession.core.builder;

import com.buession.core.utils.Assert;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,3 +1,27 @@
/*
* 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.
*
* =========================================================================================================
*
* This software consists of voluntary contributions made by many individuals on behalf of the
* Apache Software Foundation. For more information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
* +-------------------------------------------------------------------------------------------------------+
* | License: http://www.apache.org/licenses/LICENSE-2.0.txt |
* | Author: Yong.Teng <webmaster@buession.com> |
* | Copyright @ 2013-2023 Buession.com Inc. |
* +-------------------------------------------------------------------------------------------------------+
*/
package com.buession.core.builder;

import com.buession.core.utils.Assert;
Expand Down Expand Up @@ -132,7 +156,7 @@ public static <V, S extends Set<V>> SetBuilder<V> create(final Class<S> clazz){
data = clazz.newInstance();
}catch(Exception e){
logger.error("Create {} instance error: {}", clazz.getName(), e.getMessage());
data = new HashSet<>(16);
data = new HashSet<>();
}

return new SetBuilder<>(data);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@
* +------------------------------------------------------------------------------------------------+
* | License: http://www.apache.org/licenses/LICENSE-2.0.txt |
* | Author: Yong.Teng <webmaster@buession.com> |
* | Copyright @ 2013-2020 Buession.com Inc. |
* | Copyright @ 2013-2023 Buession.com Inc. |
* +------------------------------------------------------------------------------------------------+
*/
package com.buession.core.codec;

import java.io.Serializable;
import java.util.Objects;

/**
* 消息
Expand Down Expand Up @@ -65,4 +66,23 @@ public void setText(String text){
this.text = text;
}

@Override
public int hashCode(){
return Objects.hash(code, text);
}

@Override
public boolean equals(Object o){
if(this == o){
return true;
}

if((o instanceof MessageObject)){
MessageObject that = (MessageObject) o;
return code == that.code;
}

return false;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* +------------------------------------------------------------------------------------------------+
* | License: http://www.apache.org/licenses/LICENSE-2.0.txt |
* | Author: Yong.Teng <webmaster@buession.com> |
* | Copyright @ 2013-2022 Buession.com Inc. |
* | Copyright @ 2013-2023 Buession.com Inc. |
* +------------------------------------------------------------------------------------------------+
*/
package com.buession.core.codec;
Expand Down Expand Up @@ -130,11 +130,7 @@ private static Object getCglibProxyTargetObject(Object proxy) throws Exception{
}

private static String buildProperty(final String prefix, final String value){
final StringBuilder sb = new StringBuilder(prefix.length() + value.length() + 1);

sb.append(prefix).append('.').append(value);

return sb.toString();
return prefix + '.' + value;
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
* +------------------------------------------------------------------------------------------------+
* | License: http://www.apache.org/licenses/LICENSE-2.0.txt |
* | Author: Yong.Teng <webmaster@buession.com> |
* | Copyright @ 2013-2022 Buession.com Inc. |
* | Copyright @ 2013-2023 Buession.com Inc. |
* +------------------------------------------------------------------------------------------------+
*/
package com.buession.core.utils;
Expand Down Expand Up @@ -60,9 +60,7 @@ public static boolean isStatic(Field field){
public static void setAccessible(Field field){
Assert.isNull(field, "The field cloud not be null.");

if((Modifier.isPublic(field.getModifiers()) == false ||
Modifier.isPublic(field.getDeclaringClass().getModifiers()) == false ||
Modifier.isFinal(field.getModifiers())) && field.isAccessible() == false){
if(MemberUtils.isNotAccessible(field) == false && field.isAccessible() == false){
field.setAccessible(true);
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
/*
* 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.
*
* =========================================================================================================
*
* This software consists of voluntary contributions made by many individuals on behalf of the
* Apache Software Foundation. For more information on the Apache Software Foundation, please see
* <http://www.apache.org/>.
*
* +-------------------------------------------------------------------------------------------------------+
* | License: http://www.apache.org/licenses/LICENSE-2.0.txt |
* | Author: Yong.Teng <webmaster@buession.com> |
* | Copyright @ 2013-2023 Buession.com Inc. |
* +-------------------------------------------------------------------------------------------------------+
*/
package com.buession.core.utils;

import java.lang.reflect.Member;
import java.lang.reflect.Modifier;

/**
* @author Yong.Teng
* @since 2.2.1
*/
class MemberUtils {

public static boolean isNotAccessible(final Member member){
return (Modifier.isPublic(member.getModifiers()) == false ||
Modifier.isPublic(member.getDeclaringClass().getModifiers()) == false ||
Modifier.isFinal(member.getModifiers()));
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,7 @@ public static boolean isStatic(Method method){
public static void setAccessible(Method method){
Assert.isNull(method, "The method cloud not be null.");

if((Modifier.isPublic(method.getModifiers()) == false ||
Modifier.isPublic(method.getDeclaringClass().getModifiers()) == false ||
Modifier.isFinal(method.getModifiers())) && method.isAccessible() == false){
if(MemberUtils.isNotAccessible(method) == false && method.isAccessible() == false){
method.setAccessible(true);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ public void snowflake(){

@Test
public void nanoId(){
NanoIDIdGenerator idGenerator = new NanoIDIdGenerator();
NanoIDIdGenerator idGenerator = new NanoIDIdGenerator(
"0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ".toCharArray());
System.out.println(idGenerator.nextId());
}

Expand Down
4 changes: 2 additions & 2 deletions buession-cron/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
<groupId>com.buession</groupId>
<artifactId>buession-parent</artifactId>
<relativePath>../buession-parent</relativePath>
<version>2.2.0</version>
<version>2.2.1</version>
</parent>
<artifactId>buession-cron</artifactId>
<url>https://github.com/buession/buessionframework</url>
<url>http://www.buession.com/</url>
<description>Buession Framework Crontab</description>
<packaging>jar</packaging>

Expand Down
4 changes: 2 additions & 2 deletions buession-dao/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@
<groupId>com.buession</groupId>
<artifactId>buession-parent</artifactId>
<relativePath>../buession-parent</relativePath>
<version>2.2.0</version>
<version>2.2.1</version>
</parent>
<artifactId>buession-dao</artifactId>
<url>https://github.com/buession/buessionframework</url>
<url>http://www.buession.com/</url>
<description>Buession Framework Data Access Object</description>
<packaging>jar</packaging>

Expand Down
Loading