REMOVING WARNINGS

This commit is contained in:
Daniele Teti 2017-02-07 16:32:47 +01:00
parent 26c0eb5eb8
commit 9ef9ede924
3 changed files with 9 additions and 4 deletions

View File

@ -46,6 +46,7 @@ type
TJSONValueHelper = class helper for TJSONValue
public
function ToJSON: String;
function Count: Integer;
end;
{$ENDIF}
@ -56,6 +57,11 @@ implementation
{$IFNDEF TOJSON}
function TJSONValueHelper.Count: Integer;
begin
Result := Size;
end;
function TJSONValueHelper.ToJSON: String;
begin
Result := Self.ToString;

View File

@ -230,7 +230,7 @@ begin
begin
cref := attr.Value;
list := WrapAsList(o);
for I := 0 to Arr.Size - 1 do
for I := 0 to Arr.Count - 1 do
begin
list.Add(Mapper.JSONObjectToObject(cref,
Arr.Get(I) as TJSONObject));
@ -241,7 +241,7 @@ begin
ListMethod := CTX.GetType(o.ClassInfo).GetMethod('Add');
if (ListMethod <> nil) then
begin
for I := 0 to Arr.Size - 1 do
for I := 0 to Arr.Count - 1 do
begin
ListItem := TValue.Empty;
@ -595,7 +595,7 @@ begin
if (lJValue = nil) or (not(lJValue is TJSONArray)) then
raise EMVCDeserializationException.Create('Serialized data is not a valid JSON Array');
lJArr := TJSONArray(lJValue);
for I := 0 to lJArr.Size - 1 do
for I := 0 to lJArr.Count - 1 do
begin
AList.Add(JSONObjectToObject(AClazz, lJArr.Get(I) as TJSONObject));
end;

View File

@ -80,7 +80,6 @@ end;
procedure TTestJSONSerializer.TestSerUnSerObjectList;
var
Obj: TMyObject;
ObjList, Obj2List: TObjectList<TMyObject>;
lJSON: String;
I: Integer;