diff --git a/src/main/java/in/koreatech/koin/domain/timetableV2/dto/response/TimetableLectureResponse.java b/src/main/java/in/koreatech/koin/domain/timetableV2/dto/response/TimetableLectureResponse.java index 55ff30a42..bfc9c46a4 100644 --- a/src/main/java/in/koreatech/koin/domain/timetableV2/dto/response/TimetableLectureResponse.java +++ b/src/main/java/in/koreatech/koin/domain/timetableV2/dto/response/TimetableLectureResponse.java @@ -91,24 +91,24 @@ public static List of(String classTime, String classPlace) { String[] classTimeSegment = classTime.substring(1, classTime.length() - 1).trim().split(",\\s*"); List classInfos = new ArrayList<>(); - List tempClassTimes = new ArrayList<>(); + List currentTimes = new ArrayList<>(); int index = 0; for (String segment : classTimeSegment) { int parseInt = Integer.parseInt(segment); if (parseInt == -1) { - if (!tempClassTimes.isEmpty()) { - classInfos.add(new ClassInfo(new ArrayList<>(tempClassTimes), classPlaceSegment[index++])); - tempClassTimes.clear(); + if (!currentTimes.isEmpty()) { + classInfos.add(new ClassInfo(new ArrayList<>(currentTimes), classPlaceSegment[index++])); + currentTimes.clear(); } } else { - tempClassTimes.add(parseInt); + currentTimes.add(parseInt); } } - if (!tempClassTimes.isEmpty()) { - classInfos.add(new ClassInfo(new ArrayList<>(tempClassTimes), classPlaceSegment[index])); + if (!currentTimes.isEmpty()) { + classInfos.add(new ClassInfo(new ArrayList<>(currentTimes), classPlaceSegment[index])); } return classInfos;