Skip to content

Commit

Permalink
Replace StringBuffer with StringBuilder inside the method (apache#816)
Browse files Browse the repository at this point in the history
  • Loading branch information
wangxu0 authored and gary0416 committed Sep 23, 2019
1 parent a6fca7c commit 87d11a2
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ private void runCommand() throws IOException {
BufferedReader inReader =
new BufferedReader(new InputStreamReader(process
.getInputStream()));
final StringBuffer errMsg = new StringBuffer();
final StringBuilder errMsg = new StringBuilder();

// read error and input streams as this would free up the buffers
// free the error stream buffer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ public String countInstanceStateByUser(Map<String, Object> parameter){
* @return
*/
public String listByStatus(Map<String, Object> parameter) {
StringBuffer strStates = new StringBuffer();
StringBuilder strStates = new StringBuilder();
int[] stateArray = (int[]) parameter.get("states");

for(int i=0;i<stateArray.length;i++){
Expand Down Expand Up @@ -387,7 +387,7 @@ public String listByStatus(Map<String, Object> parameter) {
* @return
*/
public String queryByHostAndStatus(Map<String, Object> parameter) {
StringBuffer strStates = new StringBuffer();
StringBuilder strStates = new StringBuilder();
int[] stateArray = (int[]) parameter.get("states");

for(int i=0;i<stateArray.length;i++){
Expand Down Expand Up @@ -425,7 +425,7 @@ public String queryByHostAndStatus(Map<String, Object> parameter) {
* @return
*/
public String setFailoverByHostAndStateArray(Map<String, Object> parameter) {
StringBuffer strStates = new StringBuffer();
StringBuilder strStates = new StringBuilder();
int[] stateArray = (int[]) parameter.get("states");

for(int i=0;i<stateArray.length;i++){
Expand Down Expand Up @@ -563,7 +563,7 @@ public String queryLastManualProcess(Map<String, Object> parameter) {
}

public String queryLastRunningProcess(Map<String, Object> parameter) {
StringBuffer strStates = new StringBuffer();
StringBuilder strStates = new StringBuilder();
int[] stateArray = (int[]) parameter.get("states");

for(int i=0;i<stateArray.length;i++){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ public String querySchedulerListByProjectName(Map<String, Object> parameter) {
*/
public String selectAllByProcessDefineArray(Map<String, Object> parameter) {

StringBuffer strIds = new StringBuffer();
StringBuilder strIds = new StringBuilder();
int[] idsArray = (int[]) parameter.get("processDefineIds");
for(int i=0;i<idsArray.length;i++){
strIds.append(idsArray[i]);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ public String countTaskInstanceStateByUser(Map<String, Object> parameter){
* @return
*/
public String queryByHostAndStatus(Map<String, Object> parameter) {
StringBuffer strStates = new StringBuffer();
StringBuilder strStates = new StringBuilder();
int[] stateArray = (int[]) parameter.get("states");
for(int i=0;i<stateArray.length;i++){
strStates.append(stateArray[i]);
Expand Down Expand Up @@ -246,7 +246,7 @@ public String queryByHostAndStatus(Map<String, Object> parameter) {
* @return
*/
public String queryLimitNumByHostAndStatus(Map<String, Object> parameter) {
StringBuffer strStates = new StringBuffer();
StringBuilder strStates = new StringBuilder();
int[] stateArray = (int[]) parameter.get("states");
for(int i=0;i<stateArray.length;i++){
strStates.append(stateArray[i]);
Expand Down Expand Up @@ -278,7 +278,7 @@ public String queryLimitNumByHostAndStatus(Map<String, Object> parameter) {
* @return
*/
public String setFailoverByHostAndStateArray(Map<String, Object> parameter) {
StringBuffer strStates = new StringBuffer();
StringBuilder strStates = new StringBuilder();
int[] stateArray = (int[]) parameter.get("states");
int state = ExecutionStatus.NEED_FAULT_TOLERANCE.ordinal();
for(int i=0;i<stateArray.length;i++){
Expand Down Expand Up @@ -419,7 +419,7 @@ public String queryByInstanceIdAndName(Map<String, Object> parameter){
*/
public String countTask(Map<String, Object> parameter){

StringBuffer taskIdsStr = new StringBuffer();
StringBuilder taskIdsStr = new StringBuilder();
int[] stateArray = (int[]) parameter.get("taskIds");
for(int i=0;i<stateArray.length;i++){
taskIdsStr.append(stateArray[i]);
Expand Down

0 comments on commit 87d11a2

Please sign in to comment.