Two code reported by LGTM, those issues need investigate

https://lgtm.com/projects/g/apache/dubbo/snapshot/001162d4f461e28561b01e2f90b15c1627706cf7/files/dubbo-common/src/main/java/org/apache/dubbo/common/config/Environment.java?sort=name&dir=ASC&mode=heatmap
https://lgtm.com/projects/g/apache/dubbo/snapshot/001162d4f461e28561b01e2f90b15c1627706cf7/files/dubbo-metadata/dubbo-metadata-processor/src/main/java/org/apache/dubbo/metadata/annotation/processing/rest/ServiceRestMetadataStorage.java?sort=name&dir=ASC&mode=heatmap
import static org.apache.dubbo.metadata.rest.RestMetadataConstants.SERVICE_REST_METADATA_RESOURCE_PATH;
/**
 * The storage for {@link ServiceRestMetadata}
 */
public class ServiceRestMetadataStorage {
    private final ClassPathMetadataStorage storage;
    public ServiceRestMetadataStorage(ProcessingEnvironment processingEnv) {
        this.storage = new ClassPathMetadataStorage(processingEnv);
    }
    public void append(Set<ServiceRestMetadata> serviceRestMetadata) throws IOException {
        Set<ServiceRestMetadata> allServiceRestMetadata = new LinkedHashSet<>();
        storage.read(SERVICE_REST_METADATA_RESOURCE_PATH, reader -> {
            Gson gson = new Gson();
            return (List) gson.fromJson(reader, getParameterized(List.class, ServiceRestMetadata.class).getType());
        }).ifPresent(existedMetadata -> {
            
            allServiceRestMetadata.addAll(existedMetadata);
        });
        
        allServiceRestMetadata.addAll(serviceRestMetadata);
        write(serviceRestMetadata);
    }
    public void write(Set<ServiceRestMetadata> serviceRestMetadata) throws IOException {
        if (serviceRestMetadata.isEmpty()) {
            return;
        }
        storage.write(() -> new Gson().toJson(serviceRestMetadata), SERVICE_REST_METADATA_RESOURCE_PATH);
    }
}