- Timestamp:
- 07/12/13 23:41:06 (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
java/main/src/main/java/com/framsticks/params/types/ArrayListParam.java
r87 r100 1 1 package com.framsticks.params.types; 2 2 3 import com.framsticks.params.Access Interface;3 import com.framsticks.params.Access; 4 4 import com.framsticks.params.ArrayListAccess; 5 5 import com.framsticks.params.CastFailure; … … 7 7 import com.framsticks.params.ReassignResult; 8 8 import com.framsticks.util.lang.Casting; 9 import com.framsticks.util.lang.Containers;10 9 import com.framsticks.util.lang.Numbers; 11 10 12 import java.util.ArrayList;13 11 import java.util.List; 14 12 … … 32 30 33 31 @Override 34 public Access Interface prepareAccessInterface(AccessInterfaceaccess) {32 public Access prepareAccess(Access access) { 35 33 return new ArrayListAccess(access); 36 34 } … … 49 47 if (size != null) { 50 48 //return oldValue; 51 List<?> list; 52 if (oldValue == null) { 53 list = new ArrayList<Object>(); 54 } else { 55 list = Casting.tryCast(List.class, oldValue); 56 if (list == null) { 57 throw new CastFailure(); 58 } 59 } 60 Containers.resizeList(list, size); 61 return new ReassignResult<List<?>>(list); 49 // List<?> list; 50 // if (oldValue == null) { 51 // list = new ArrayList<Object>(); 52 // } else { 53 // list = Casting.tryCast(List.class, oldValue); 54 // if (list == null) { 55 // throw new CastFailure(); 56 // } 57 // } 58 // Containers.resizeList(list, size); 59 return new ReassignResult<List<?>>(Casting.tryCast(List.class, oldValue)); 60 // return new ReassignResult<List<?>>(list); 62 61 } 63 if (oldValue != null) {64 return new ReassignResult<List<?>>(Casting.throwCast(List.class, oldValue));65 }62 // if (oldValue != null) { 63 // return new ReassignResult<List<?>>(Casting.throwCast(List.class, oldValue)); 64 // } 66 65 return new ReassignResult<List<?>>(Casting.throwCast(List.class, newValue)); 67 66 }
Note: See TracChangeset
for help on using the changeset viewer.