Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug with P21 (var in the middle) #596

Open
KatGarmash opened this issue Aug 6, 2020 · 1 comment
Open

Bug with P21 (var in the middle) #596

KatGarmash opened this issue Aug 6, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@KatGarmash
Copy link
Member

Aibolit detects P21 in lines 6,7,8, but it should not, since becase the only preceding expression in super invocation.

   1             Group(String objectNameBase, List<String> objectNames,
   2                             List<? extends PlatformManagedObject> implementations,
   3                             Set<Class<?>> interfaceTypes) {
   4                     super(objectNameBase.concat(",name=*"), interfaceTypes); //$NON-NLS-1$
   5
   6                     int beanCount = implementations.size();
   7                    Map<String, Object> beanMap = new HashMap<>(beanCount);
   8                     String namePrefix = objectNameBase.concat(",name="); //$NON-NLS-1$
   9
   10                     for (int i = 0; i < beanCount; ++i) {
....
@KatGarmash KatGarmash added the bug Something isn't working label Aug 6, 2020
@KatGarmash
Copy link
Member Author

KatGarmash commented Aug 6, 2020

Also, it detects the P21 here:

 private static final class Group extends Component {

                private final Map<String, Object> nameToMBeanMap;

                Group(String objectNameBase, List<String> objectNames,
                                List<? extends PlatformManagedObject> implementations,
                                Set<Class<?>> interfaceTypes) {

                        int beanCount = implementations.size();
                        Map<String, Object> beanMap = new HashMap<>(beanCount);
                        String namePrefix = objectNameBase.concat(",name="); //$NON-NLS-1$

                        for (int i = 0; i < beanCount; ++i) {
                                String objectName = namePrefix.concat(objectNames.get(i));
                                PlatformManagedObject implementation = implementations.get(i);

                                beanMap.put(objectName, implementation);
                        }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant