Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
Tags
- 스프링 부트 기능
- REST API 규칙
- 스프링부트오류
- jpa에러
- json
- JoinColumn
- 최종 프로젝트
- REST란
- Unsatisfied dependency
- jpa회원가입
- JPA
- 스프링 부트 공식 문서
- 1차캐시
- spring서버
- queryDSL
- Error creating bean with name
- JPA주의사항
- 인텔리제이
- git
- uncheck Exception
- Spring Spring boot 차이
- jwt메서드
- 복합키
- @IdClass
- json gson 차이
- Q 클래스
- ERD 작성
- 빈생성안됨
- Filter
- github
Archives
- Today
- Total
목록ConcurrentModificationException (1)
Everyday Dev System
0602_TIL : ConcurrentModificationException
# 문제점 : List 타입의 객체에서 요소를 순회하는 중에 요소를 삭제한 후에 index가 변경되어 일부 요소는 순회가 안됐다. 아래와 같은 오류가 발생했다. List saleFoods 변수 내에서 특정 조건에 맞을 경우, saleFoods 내에서 sf라는 객체의 요소를 삭제하는 코드 부분이다. for (Food sf : saleFoods) { if(resultCnt == 0){ saleFoods.remove(sf); } } # 시도 : saleFoods.remove(sf); saleFoods.add(new Food("",0.0,"",0)); 삭제를 하고, 빈 객체를 생성해보았지만, salesFoods를 순회하며 출력할 때, 아래와 같이 출력이 되어, 출력이 되지 않도록 해야 하므로 이 방법은 옳지 않..
내배캠 주요 학습/TIL : Today I Learned
2023. 6. 2. 19:28