]> err.no Git - sope/blobdiff - sope-core/NGExtensions/FdExt.subproj/NGPropertyListParser.m
do not use -setUserInfo:
[sope] / sope-core / NGExtensions / FdExt.subproj / NGPropertyListParser.m
index 8e9fb4cc706a685d8cab2fced2147ebe669fdd77..04d039da7a475c2d8efdffab6d834155c569da3f 100644 (file)
@@ -1,5 +1,6 @@
 /*
-  Copyright (C) 2000-2005 SKYRIX Software AG
+  Copyright (C) 2000-2008 SKYRIX Software AG
+  Copyright (C) 2008      Helge Hess
 
   This file is part of SOPE.
 
@@ -424,25 +425,19 @@ static NSException *_makeException(NSException *_exception,
     int         numLines   = _numberOfLines(_buffer, _idx);
     BOOL        atEof      = (_idx >= _len) ? YES : NO;
 
-    if (_exception) // error resulted from a previous error (exception already set)
+    if (_exception != nil) 
+       // error resulted from a previous error (exception already set)
         return _exception;
 
-    exception = [NSException exceptionWithName:@"SyntaxErrorException"
-                             reason:nil
-                             userInfo:nil];
-
     _text = atEof
         ? [NSString stringWithFormat:@"Unexpected end: %@", _text]
-        : [NSString stringWithFormat:@"Syntax error in line %i: %@", numLines,_text];
-  
-    [exception setReason:_text];
-
+        : [NSString stringWithFormat:@"Syntax error in line %i: %@",
+                   numLines,_text];
+    
     // user info
     {
-        ui = [[exception userInfo] mutableCopy];
-        if (ui == nil)
-            ui = [[NSMutableDictionary alloc] initWithCapacity:8];
-
+       ui = [[NSMutableDictionary alloc] initWithCapacity:8];
+       
         [ui setObject:[NSNumber numberWithInt:numLines] forKey:@"line"];
         [ui setObject:[NSNumber numberWithInt:_len]     forKey:@"size"];
         [ui setObject:[NSNumber numberWithInt:_idx]     forKey:@"position"];
@@ -486,12 +481,13 @@ static NSException *_makeException(NSException *_exception,
             else
                 NSLog(@"startPos=0x%p endPos=0x%p", startPos, endPos);
         }
-    
-        [exception setUserInfo:ui];
-    
-        [ui release]; ui = nil;
     }
 
+    exception = [NSException exceptionWithName:@"SyntaxErrorException"
+                             reason:_text
+                             userInfo:ui];
+    [ui release]; ui = nil;
+    
     return exception;
 }