spring-projects / spring-projects/spring-tools

[feature] Warning for overriding bean names in same xml files

Open
#339 1 comment 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

theme: sts3-feature-request theme: xml-support type: enhancement
Dominant language
Java
Stars
983
Forks
240
Avg merge
7d 1h
Merged PRs (30d)
7

Description

Add support for diagnostics for xml file configurations.

<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
       xsi:schemaLocation="
        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">

    <!-- bean definitions here -->
    <bean class="com.example.demo.NonBootBean"/>
    <bean class="com.example.demo.NonBootBean">
        <property name="age" ref="nonBootBean"/>
    </bean>
    <bean class="org.apache.commons.dbcp2.BasicDataSource" name="datasource">
    	<property name="driver"></property>
    </bean>
    
    <bean class="org.apache.commons.dbcp2.BasicDataSource" name="datasource">
    	<property name="driver"></property>
    </bean>
</beans>

it would be nice to provide a warning about the overriding bean in this case, think if this was a large file a accidental overriding can be avoided.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

The issue names no files, tests, or entry points. Start by locating the Spring XML configuration diagnostics entry point and its tests, then reproduce the duplicate bean-name example and define the warning's expected scope; done means duplicate bean names in one XML file produce a warning without affecting valid configurations.

Written by the indexing model from the issue text.

Assessment

Tech stack
java, spring
Domain
developer-experience, tooling
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.