Fix Smile issue#8

diff --git a/release-notes/VERSION b/release-notes/VERSION
index 1e0454f..0023d27 100644
--- a/release-notes/VERSION
+++ b/release-notes/VERSION
@@ -1,13 +1,15 @@
 Version: 1.9.11
 
 Release date:
-  xx-Nov-2012
+  xx-Oct-2012
 
 Description:
   Another patch release for 1.9.
 
 Fixes:
 
+* [Issue#8]: Problem with 'SmileGenerator', addSeenName()
+
 ------------------------------------------------------------------------
 === History: ===
 ------------------------------------------------------------------------
diff --git a/src/java/org/codehaus/jackson/JsonFactory.java b/src/java/org/codehaus/jackson/JsonFactory.java
index bf47e7e..0612d64 100644
--- a/src/java/org/codehaus/jackson/JsonFactory.java
+++ b/src/java/org/codehaus/jackson/JsonFactory.java
@@ -77,7 +77,7 @@
      */
 
     /**
-     * This <code>ThreadLocal</code> contains a {@link java.lang.ref.SoftRerefence}
+     * This <code>ThreadLocal</code> contains a {@link java.lang.ref.SoftReference}
      * to a {@link BufferRecycler} used to provide a low-cost
      * buffer recycling between reader and writer instances.
      */
diff --git a/src/java/org/codehaus/jackson/JsonToken.java b/src/java/org/codehaus/jackson/JsonToken.java
index 268f6ca..592d7ad 100644
--- a/src/java/org/codehaus/jackson/JsonToken.java
+++ b/src/java/org/codehaus/jackson/JsonToken.java
@@ -120,7 +120,7 @@
     final byte[] _serializedBytes;
 
     /**
-     * @param Textual representation for this token, if there is a
+     * @param token Textual representation for this token, if there is a
      *   single static representation; null otherwise
      */
     JsonToken(String token)
diff --git a/src/java/org/codehaus/jackson/io/JsonStringEncoder.java b/src/java/org/codehaus/jackson/io/JsonStringEncoder.java
index b0ed0f0..b0798d0 100644
--- a/src/java/org/codehaus/jackson/io/JsonStringEncoder.java
+++ b/src/java/org/codehaus/jackson/io/JsonStringEncoder.java
@@ -33,7 +33,7 @@
     private final static int INT_0 = '0';
     
     /**
-     * This <code>ThreadLocal</code> contains a {@link java.lang.ref.SoftRerefence}
+     * This <code>ThreadLocal</code> contains a {@link java.lang.ref.SoftReference}
      * to a {@link BufferRecycler} used to provide a low-cost
      * buffer recycling between reader and writer instances.
      */
diff --git a/src/java/org/codehaus/jackson/io/SerializedString.java b/src/java/org/codehaus/jackson/io/SerializedString.java
index 50ca637..ef7d057 100644
--- a/src/java/org/codehaus/jackson/io/SerializedString.java
+++ b/src/java/org/codehaus/jackson/io/SerializedString.java
@@ -41,16 +41,16 @@
     /**********************************************************
      */
 
-    @Override
+    //@Override
     public final String getValue() { return _value; }
     
     /**
      * Returns length of the String as characters
      */
-    @Override
+    //@Override
     public final int charLength() { return _value.length(); }
     
-    @Override
+    //@Override
     public final char[] asQuotedChars()
     {
         char[] result = _quotedChars;
@@ -65,7 +65,7 @@
      * Accessor for accessing value that has been quoted using JSON
      * quoting rules, and encoded using UTF-8 encoding.
      */
-    @Override
+    //@Override
     public final byte[] asUnquotedUTF8()
     {
         byte[] result = _unquotedUTF8Ref;
@@ -80,7 +80,7 @@
      * Accessor for accessing value as is (without JSON quoting)
      * encoded using UTF-8 encoding.
      */
-    @Override
+    //@Override
     public final byte[] asQuotedUTF8()
     {
         byte[] result = _quotedUTF8Ref;
diff --git a/src/java/org/codehaus/jackson/util/DefaultPrettyPrinter.java b/src/java/org/codehaus/jackson/util/DefaultPrettyPrinter.java
index ef8a6df..ab86966 100644
--- a/src/java/org/codehaus/jackson/util/DefaultPrettyPrinter.java
+++ b/src/java/org/codehaus/jackson/util/DefaultPrettyPrinter.java
@@ -74,14 +74,14 @@
     /**********************************************************
      */
 
-    @Override
+    //@Override
     public void writeRootValueSeparator(JsonGenerator jg)
         throws IOException, JsonGenerationException
     {
         jg.writeRaw(' ');
     }
 
-    @Override
+    //@Override
     public void writeStartObject(JsonGenerator jg)
         throws IOException, JsonGenerationException
     {
@@ -91,7 +91,7 @@
         }
     }
 
-    @Override
+    //@Override
     public void beforeObjectEntries(JsonGenerator jg)
         throws IOException, JsonGenerationException
     {
@@ -107,7 +107,7 @@
      * to output a colon as well, but can surround that with other
      * (white-space) decoration.
      */
-    @Override
+    //@Override
     public void writeObjectFieldValueSeparator(JsonGenerator jg)
         throws IOException, JsonGenerationException
     {
@@ -127,7 +127,7 @@
      * to output a comma as well, but can surround that with other
      * (white-space) decoration.
      */
-    @Override
+    //@Override
     public void writeObjectEntrySeparator(JsonGenerator jg)
         throws IOException, JsonGenerationException
     {
@@ -135,7 +135,7 @@
         _objectIndenter.writeIndentation(jg, _nesting);
     }
 
-    @Override
+    //@Override
     public void writeEndObject(JsonGenerator jg, int nrOfEntries)
         throws IOException, JsonGenerationException
     {
@@ -150,7 +150,7 @@
         jg.writeRaw('}');
     }
 
-    @Override
+    //@Override
     public void writeStartArray(JsonGenerator jg)
         throws IOException, JsonGenerationException
     {
@@ -160,7 +160,7 @@
         jg.writeRaw('[');
     }
 
-    @Override
+    //@Override
     public void beforeArrayValues(JsonGenerator jg)
         throws IOException, JsonGenerationException
     {
@@ -176,7 +176,7 @@
      * to output a comma as well, but can surround that with other
      * (white-space) decoration.
      */
-    @Override
+    //@Override
     public void writeArrayValueSeparator(JsonGenerator jg)
         throws IOException, JsonGenerationException
     {
@@ -184,7 +184,7 @@
         _arrayIndenter.writeIndentation(jg, _nesting);
     }
 
-    @Override
+    //@Override
     public void writeEndArray(JsonGenerator jg, int nrOfValues)
         throws IOException, JsonGenerationException
     {
@@ -212,9 +212,9 @@
         implements Indenter
     {
         public NopIndenter() { }
-        @Override
+        //@Override
         public void writeIndentation(JsonGenerator jg, int level) { }
-        @Override
+        //@Override
         public boolean isInline() { return true; }
     }
 
@@ -228,14 +228,14 @@
     {
         public FixedSpaceIndenter() { }
 
-        @Override
+        //@Override
         public void writeIndentation(JsonGenerator jg, int level)
             throws IOException, JsonGenerationException
         {
             jg.writeRaw(' ');
         }
 
-        @Override
+        //@Override
         public boolean isInline() { return true; }
     }
 
@@ -263,20 +263,22 @@
 
         public Lf2SpacesIndenter() { }
 
-        @Override
+        //@Override
         public boolean isInline() { return false; }
 
-        @Override
+        //@Override
         public void writeIndentation(JsonGenerator jg, int level)
             throws IOException, JsonGenerationException
         {
             jg.writeRaw(SYSTEM_LINE_SEPARATOR);
-            level += level; // 2 spaces per level
-            while (level > SPACE_COUNT) { // should never happen but...
-                jg.writeRaw(SPACES, 0, SPACE_COUNT); 
-                level -= SPACES.length;
-            }
-            jg.writeRaw(SPACES, 0, level);
+	    if (level > 0) { 
+		level += level; // 2 spaces per level
+		while (level > SPACE_COUNT) { // should never happen but...
+		    jg.writeRaw(SPACES, 0, SPACE_COUNT); 
+		    level -= SPACES.length;
+		}
+		jg.writeRaw(SPACES, 0, level);
+	    }
         }
     }
 }
diff --git a/src/java/org/codehaus/jackson/util/JsonParserDelegate.java b/src/java/org/codehaus/jackson/util/JsonParserDelegate.java
index b038efb..5f307e1 100644
--- a/src/java/org/codehaus/jackson/util/JsonParserDelegate.java
+++ b/src/java/org/codehaus/jackson/util/JsonParserDelegate.java
@@ -168,6 +168,7 @@
     /**********************************************************
      */
 
+    @Override
     public boolean getBooleanValue() throws IOException, JsonParseException {
         return delegate.getBooleanValue();
     }
diff --git a/src/java/org/codehaus/jackson/util/MinimalPrettyPrinter.java b/src/java/org/codehaus/jackson/util/MinimalPrettyPrinter.java
index cdd6a6b..9364c3f 100644
--- a/src/java/org/codehaus/jackson/util/MinimalPrettyPrinter.java
+++ b/src/java/org/codehaus/jackson/util/MinimalPrettyPrinter.java
@@ -58,7 +58,7 @@
     /**********************************************************
      */
 
-    @Override
+    //@Override
     public void writeRootValueSeparator(JsonGenerator jg) throws IOException, JsonGenerationException
     {
         if (_rootValueSeparator != null) {
@@ -66,14 +66,14 @@
         }
     }
     
-    @Override
+    //@Override
     public void writeStartObject(JsonGenerator jg)
         throws IOException, JsonGenerationException
     {
         jg.writeRaw('{');
     }
     
-    @Override
+    //@Override
     public void beforeObjectEntries(JsonGenerator jg)
         throws IOException, JsonGenerationException
     {
@@ -87,7 +87,7 @@
      * Default handling will just output a single
      * colon to separate the two, without additional spaces.
      */
-    @Override
+    //@Override
     public void writeObjectFieldValueSeparator(JsonGenerator jg)
         throws IOException, JsonGenerationException
     {
@@ -101,28 +101,28 @@
      * Default handling (without pretty-printing) will output a single
      * comma to separate the two.
      */
-    @Override
+    //@Override
     public void writeObjectEntrySeparator(JsonGenerator jg)
         throws IOException, JsonGenerationException
     {
         jg.writeRaw(',');
     }
 
-    @Override
+    //@Override
     public void writeEndObject(JsonGenerator jg, int nrOfEntries)
         throws IOException, JsonGenerationException
     {
         jg.writeRaw('}');
     }
     
-    @Override
+    //@Override
     public void writeStartArray(JsonGenerator jg)
         throws IOException, JsonGenerationException
     {
         jg.writeRaw('[');
     }
     
-    @Override
+    //@Override
     public void beforeArrayValues(JsonGenerator jg)
         throws IOException, JsonGenerationException
     {
@@ -136,14 +136,14 @@
      * Default handling (without pretty-printing) will output a single
      * comma to separate values.
      */
-    @Override
+    //@Override
     public void writeArrayValueSeparator(JsonGenerator jg)
         throws IOException, JsonGenerationException
     {
         jg.writeRaw(',');
     }
     
-    @Override
+    //@Override
     public void writeEndArray(JsonGenerator jg, int nrOfValues)
         throws IOException, JsonGenerationException
     {
diff --git a/src/jaxrs/java/org/codehaus/jackson/jaxrs/JacksonJsonProvider.java b/src/jaxrs/java/org/codehaus/jackson/jaxrs/JacksonJsonProvider.java
index 2393838..535a3a4 100644
--- a/src/jaxrs/java/org/codehaus/jackson/jaxrs/JacksonJsonProvider.java
+++ b/src/jaxrs/java/org/codehaus/jackson/jaxrs/JacksonJsonProvider.java
@@ -489,6 +489,7 @@
     /**
      * Method that JAX-RS container calls to serialize given value.
      */
+    @SuppressWarnings("deprecation")
     @Override
     public void writeTo(Object value, Class<?> type, Type genericType, Annotation[] annotations, MediaType mediaType,
             MultivaluedMap<String,Object> httpHeaders, OutputStream entityStream) 
diff --git a/src/mapper/java/org/codehaus/jackson/map/ObjectMapper.java b/src/mapper/java/org/codehaus/jackson/map/ObjectMapper.java
index 41b9f91..02f4c87 100644
--- a/src/mapper/java/org/codehaus/jackson/map/ObjectMapper.java
+++ b/src/mapper/java/org/codehaus/jackson/map/ObjectMapper.java
@@ -413,7 +413,7 @@
      * 
      * @since 1.6
      */
-    @Override
+    //@Override
     public Version version() {
         return VersionUtil.versionFor(getClass());
     }
@@ -455,105 +455,105 @@
         {
             // // // Accessors
 
-            @Override
+            //@Override
             public Version getMapperVersion() {
                 return version();
             }
 
-            @Override
+            //@Override
             public DeserializationConfig getDeserializationConfig() {
                 return mapper.getDeserializationConfig();
             }
 
-            @Override
+            //@Override
             public SerializationConfig getSerializationConfig() {
                 return mapper.getSerializationConfig();
             }
 
-            @Override
+            //@Override
             public boolean isEnabled(DeserializationConfig.Feature f) {
                 return mapper.isEnabled(f);
             }
 
-            @Override
+            //@Override
             public boolean isEnabled(SerializationConfig.Feature f) {
                 return mapper.isEnabled(f);
             }
 
-            @Override
+            //@Override
             public boolean isEnabled(JsonParser.Feature f) {
                 return mapper.isEnabled(f);
             }
 
-            @Override
+            //@Override
             public boolean isEnabled(JsonGenerator.Feature f) {
                 return mapper.isEnabled(f);
             }
             
             // // // Methods for registering handlers: deserializers, serializers
             
-            @Override
+            //@Override
             public void addDeserializers(Deserializers d) {
                 mapper._deserializerProvider = mapper._deserializerProvider.withAdditionalDeserializers(d);
             }
 
-            @Override
+            //@Override
             public void addKeyDeserializers(KeyDeserializers d) {
                 mapper._deserializerProvider = mapper._deserializerProvider.withAdditionalKeyDeserializers(d);
             }
             
-            @Override
+            //@Override
             public void addSerializers(Serializers s) {
                 mapper._serializerFactory = mapper._serializerFactory.withAdditionalSerializers(s);
             }
 
-            @Override
+            //@Override
             public void addKeySerializers(Serializers s) {
                 mapper._serializerFactory = mapper._serializerFactory.withAdditionalKeySerializers(s);
             }
             
-            @Override
+            //@Override
             public void addBeanSerializerModifier(BeanSerializerModifier modifier) {
                 mapper._serializerFactory = mapper._serializerFactory.withSerializerModifier(modifier);
             }
 
-            @Override
+            //@Override
             public void addBeanDeserializerModifier(BeanDeserializerModifier modifier) {
                 mapper._deserializerProvider = mapper._deserializerProvider.withDeserializerModifier(modifier);
             }
 
             // // // Methods for registering handlers: other
             
-            @Override
+            //@Override
             public void addAbstractTypeResolver(AbstractTypeResolver resolver) {
                 mapper._deserializerProvider = mapper._deserializerProvider.withAbstractTypeResolver(resolver);
             }
 
-            @Override
+            //@Override
             public void addTypeModifier(TypeModifier modifier) {
                 TypeFactory f = mapper._typeFactory;
                 f = f.withModifier(modifier);
                 mapper.setTypeFactory(f);
             }
 
-            @Override
+            //@Override
             public void addValueInstantiators(ValueInstantiators instantiators) {
                 mapper._deserializerProvider = mapper._deserializerProvider.withValueInstantiators(instantiators);
             }
             
-            @Override
+            //@Override
             public void insertAnnotationIntrospector(AnnotationIntrospector ai) {
                 mapper._deserializationConfig = mapper._deserializationConfig.withInsertedAnnotationIntrospector(ai);
                 mapper._serializationConfig = mapper._serializationConfig.withInsertedAnnotationIntrospector(ai);
             }
             
-            @Override
+            //@Override
             public void appendAnnotationIntrospector(AnnotationIntrospector ai) {
                 mapper._deserializationConfig = mapper._deserializationConfig.withAppendedAnnotationIntrospector(ai);
                 mapper._serializationConfig = mapper._serializationConfig.withAppendedAnnotationIntrospector(ai);
             }
 
-            @Override
+            //@Override
             public void setMixInAnnotations(Class<?> target, Class<?> mixinSource) {
                 mapper._deserializationConfig.addMixInAnnotations(target, mixinSource);
                 mapper._serializationConfig.addMixInAnnotations(target, mixinSource);
diff --git a/src/smile/java/org/codehaus/jackson/smile/SmileGenerator.java b/src/smile/java/org/codehaus/jackson/smile/SmileGenerator.java
index d1c8cdd..15ba4d5 100644
--- a/src/smile/java/org/codehaus/jackson/smile/SmileGenerator.java
+++ b/src/smile/java/org/codehaus/jackson/smile/SmileGenerator.java
@@ -267,7 +267,7 @@
      */
     
     /**
-     * This <code>ThreadLocal</code> contains a {@link java.lang.ref.SoftRerefence}
+     * This <code>ThreadLocal</code> contains a {@link java.lang.ref.SoftReference}
      * to a buffer recycler used to provide a low-cost
      * buffer recycling for Smile-specific buffers.
      */
@@ -2046,10 +2046,12 @@
                 _seenNames = new SharedStringNode[MAX_SHARED_NAMES];
                 final int mask = MAX_SHARED_NAMES-1;
                 for (SharedStringNode node : old) {
-                    for (; node != null; node = node.next) {
+		    while (node != null) {
                         int ix = node.value.hashCode() & mask;
+			SharedStringNode next = node.next;
                         node.next = _seenNames[ix];
                         _seenNames[ix] = node;
+			node = next;
                     }
                 }
             }
diff --git a/src/smile/java/org/codehaus/jackson/smile/SmileParser.java b/src/smile/java/org/codehaus/jackson/smile/SmileParser.java
index cf908e3..c0fb87a 100644
--- a/src/smile/java/org/codehaus/jackson/smile/SmileParser.java
+++ b/src/smile/java/org/codehaus/jackson/smile/SmileParser.java
@@ -192,7 +192,7 @@
      */
     
     /**
-     * <code>ThreadLocal</code> contains a {@link java.lang.ref.SoftRerefence}
+     * <code>ThreadLocal</code> contains a {@link java.lang.ref.SoftReference}
      * to a buffer recycler used to provide a low-cost
      * buffer recycling for Smile-specific buffers.
      */
diff --git a/src/test/org/codehaus/jackson/jaxrs/TestJsonView.java b/src/test/org/codehaus/jackson/jaxrs/TestJsonView.java
index a0717ae..e51b17f 100644
--- a/src/test/org/codehaus/jackson/jaxrs/TestJsonView.java
+++ b/src/test/org/codehaus/jackson/jaxrs/TestJsonView.java
@@ -40,10 +40,10 @@
         ByteArrayOutputStream out = new ByteArrayOutputStream();
         Bean bean = new Bean();
         Annotation ann = new JsonView() {
-            @Override
+            //@Override
             public Class<?>[] value() { return new Class[] { MyView1.class }; }
 
-            @Override
+            //@Override
             public Class<? extends Annotation> annotationType() {
                 return JsonView.class;
             }
diff --git a/src/test/org/codehaus/jackson/map/deser/TestGenericCollectionDeser.java b/src/test/org/codehaus/jackson/map/deser/TestGenericCollectionDeser.java
index 701d7f6..a66de01 100644
--- a/src/test/org/codehaus/jackson/map/deser/TestGenericCollectionDeser.java
+++ b/src/test/org/codehaus/jackson/map/deser/TestGenericCollectionDeser.java
@@ -19,7 +19,7 @@
     static class ListSubClass extends ArrayList<StringWrapper> { }
 
     /**
-     * Map class that should behave like {@link MapSubClass}, but by
+     * Map class that should behave like {@link ListSubClass}, but by
      * using annotations.
      */
     @JsonDeserialize(contentAs=StringWrapper.class)
diff --git a/src/test/org/codehaus/jackson/map/ser/TestAnnotationJsonSerialize.java b/src/test/org/codehaus/jackson/map/ser/TestAnnotationJsonSerialize.java
index 3028b05..3b77d92 100644
--- a/src/test/org/codehaus/jackson/map/ser/TestAnnotationJsonSerialize.java
+++ b/src/test/org/codehaus/jackson/map/ser/TestAnnotationJsonSerialize.java
@@ -70,7 +70,7 @@
     }
 
     /**
-     * Test bean that has an invalid {@link JsonClass} annotation.
+     * Test bean that has an invalid {@link JsonSerialize} annotation.
      */
     static class BrokenClass
     {
diff --git a/src/test/org/codehaus/jackson/map/ser/TestAnnotationJsonSerialize2.java b/src/test/org/codehaus/jackson/map/ser/TestAnnotationJsonSerialize2.java
index 9cf1959..4f42a09 100644
--- a/src/test/org/codehaus/jackson/map/ser/TestAnnotationJsonSerialize2.java
+++ b/src/test/org/codehaus/jackson/map/ser/TestAnnotationJsonSerialize2.java
@@ -121,6 +121,7 @@
     // force use of interface
     @JsonSerialize(as=Fooable.class)
     public static class FooImpl implements Fooable {
+        @Override
         public int getFoo() { return 42; }
         public int getBar() { return 15; }
     }
diff --git a/src/test/org/codehaus/jackson/map/ser/TestViews.java b/src/test/org/codehaus/jackson/map/ser/TestViews.java
index c9aaf04..57caec0 100644
--- a/src/test/org/codehaus/jackson/map/ser/TestViews.java
+++ b/src/test/org/codehaus/jackson/map/ser/TestViews.java
@@ -7,6 +7,7 @@
 
 import org.codehaus.jackson.annotate.*;
 import org.codehaus.jackson.map.*;
+import org.codehaus.jackson.map.annotate.JsonSerialize.Inclusion;
 import org.codehaus.jackson.map.annotate.JsonView;
 
 /**
@@ -70,6 +71,14 @@
         @JsonView(ViewA.class)
         public String value = "x";
     }   
+
+    // [JACKSON-868]
+    public static class WebView { }
+    public static class OtherView { }
+    public static class Foo {
+      @JsonView(WebView.class)
+      public int getFoo() { return 3; }
+    }
     
     /*
     /**********************************************************
@@ -166,4 +175,15 @@
         //json = mapper.writeValueAsString(bean);
         assertEquals("{\"id\":\"id\"}", json);
     }
+
+    // [JACKSON-868]
+    public void testWithInclusionSettings() throws IOException
+    {
+        ObjectMapper mapper = new ObjectMapper();
+        mapper.setSerializationInclusion(Inclusion.NON_DEFAULT);
+        SerializationConfig dbViewConfig = mapper.getSerializationConfig().withView(OtherView.class);
+        mapper.setSerializationConfig(dbViewConfig);
+        String json = mapper.writeValueAsString(new Foo());
+        assertEquals(json, "{}");
+    }
 }
diff --git a/src/tools/VerifySmileDocs.java b/src/tools/VerifySmileDocs.java
index 20bbd5f..262e181 100644
--- a/src/tools/VerifySmileDocs.java
+++ b/src/tools/VerifySmileDocs.java
@@ -27,7 +27,6 @@
     private void verifyAll(File inputDir) throws IOException
     {
         File[] files = inputDir.listFiles(new FilenameFilter() {
-            @Override
             public boolean accept(File dir, String name) {
                 int i = name.lastIndexOf('.');
                 if (i > 0) {