apache / apache/cloudstack

remove instanceof checks and use reflection for admin cmd invocations

Open
#6,966 5 comments 0 reactions 0 assignees View on GitHub
no-issue-activity status:needs-work status:stale type:technical-debt
Dominant language
Java
Stars
3.1k
Forks
1.4k
Avg merge
6d 19h
Merged PRs (30d)
32

Description

##### ISSUE TYPE
* cleanup

##### COMPONENT NAME

~~~
API
~~~

##### CLOUDSTACK VERSION

~~~
4.17
~~~

##### CONFIGURATION

##### OS / ENVIRONMENT

##### SUMMARY

the API classes have instances that are for root admin only, these are checked for using `instanceof` in the service layer. This should be cleaned up in favour for reflection invocations as in #6951. It would be better to do all in one go but the fix in #6951 really needs it and is for a point release, so postponing.

##### STEPS TO REPRODUCE

~~~

~~~

##### EXPECTED RESULTS

~~~

~~~

##### ACTUAL RESULTS

~~~

~~~

Contributor guide

Open the contributing guide

Research direction

Start in the API classes and service layer handling admin command invocations, then compare the reflection approach described in #6951. Trace the existing instanceof checks for root-admin-only instances and identify the affected invocation paths. Done means those checks use the intended reflection approach while preserving the admin-only behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
api, cloud
Issue type
Refactor
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.