Skip to content
Draft
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
Original file line number Diff line number Diff line change
Expand Up @@ -42,5 +42,6 @@ public interface LoadBalancerVMMapDao extends GenericDao<LoadBalancerVMMapVO, Lo
LoadBalancerVMMapVO findByLoadBalancerIdAndVmIdVmIp(long loadBalancerId, long instanceId, String instanceIp);

void remove(long id, long instanceId, String instanceIp, Boolean revoke);

int expungeByVmList(List<Long> vmIds, Long batchSize);
}
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ public void remove(long loadBalancerId, long instanceId, String instanceIp, Bool
expunge(sc);
}


@Override
public List<LoadBalancerVMMapVO> listByInstanceId(long instanceId) {
SearchCriteria<LoadBalancerVMMapVO> sc = createSearchCriteria();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2002,7 +2002,7 @@ private UserVmVO startNewVM(long vmId) {
}

private boolean assignLBruleToNewVm(long vmId, AutoScaleVmGroupVO asGroup) {
List<Long> lstVmId = new ArrayList<Long>();
List<Long> vmIds = new ArrayList<>();
long lbId = asGroup.getLoadBalancerId();

List<LoadBalancerVMMapVO> lbVmMapVos = lbVmMapDao.listByLoadBalancerId(lbId);
Expand All @@ -2015,9 +2015,9 @@ private boolean assignLBruleToNewVm(long vmId, AutoScaleVmGroupVO asGroup) {
}
}
}
lstVmId.add(new Long(vmId));
vmIds.add(new Long(vmId));
Copy link

Copilot AI Jan 16, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The explicit Long constructor call is unnecessary and deprecated. Use Long.valueOf(vmId) or simply add vmId directly since autoboxing will handle the conversion.

Suggested change
vmIds.add(new Long(vmId));
vmIds.add(vmId);

Copilot uses AI. Check for mistakes.
try {
return loadBalancingRulesService.assignToLoadBalancer(lbId, lstVmId, new HashMap<>(), true);
return loadBalancingRulesService.assignToLoadBalancer(lbId, vmIds, new HashMap<>(), true);
} catch (CloudRuntimeException ex) {
logger.warn("Caught exception: ", ex);
return false;
Expand Down
Loading
Loading