做 java jdk1.8 中优化下面这段代码,要求保持功能不变 private List<AppIdInfoDetailRemoteResponse>…
- User
做 java jdk1.8 中优化下面这段代码,要求保持功能不变 private List addConfigTerminalAppId(List halleyAppIdList) { User userInfo = UserUtils.getUserInfo(); String terminalUser = permissionConfigProperties.getTerminalUser(); if (userInfo == null || StringUtils.isBlank(userInfo.getEmail()) || StringUtils.isBlank(terminalUser)) { return halleyAppIdList; } String accountName = CommonUtil.getAccountByEmail(userInfo.getEmail()); if (halleyAppIdList == null){ halleyAppIdList = new ArrayList<>(); } if(ArrayUtils.contains(terminalUser.split(","),accountName)){ String notHalleyAppIds = permissionConfigProperties.getNotHalleyAppIds(); if (StringUtils.isNotBlank(notHalleyAppIds)) { String[] notHalleyAppId = notHalleyAppIds.split(","); for (String terminalAppid : notHalleyAppId) { AppIdInfoDetailRemoteResponse appIdInfoDetailRemoteResponse = new AppIdInfoDetailRemoteResponse(); appIdInfoDetailRemoteResponse.setAppId(terminalAppid); appIdInfoDetailRemoteResponse.setDesc(terminalAppid); halleyAppIdList.add(appIdInfoDetailRemoteResponse); } } } return halleyAppIdList; }
- Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.