{@code method} causes runtime error when running --api-export

Bug #492202 reported by James Knight
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
as2api
Fix Committed
Undecided
David Holroyd

Bug Description

Error output:
===================
./output/diff/api_serializer.rb:217:in `serialize_comment_inlines': unhandled inline #<CodeTag:0x33de4a8 @text=" method", @lineno=31> (RuntimeError)
        from ./doc_comment.rb:262:in `each_inline'
        from ./doc_comment.rb:261:in `each'
        from ./doc_comment.rb:261:in `each_inline'
        from ./output/diff/api_serializer.rb:210:in `serialize_comment_inlines'
        from ./output/diff/api_serializer.rb:184:in `serialize_description'
        from (eval):3:in `api_description'
        from ./output/xml/xml_formatter.rb:34:in `element'
        from ./xmlwriter.rb:30:in `element'
         ... 69 levels...
        from ./ui/cli.rb:414
        from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `gem_original_require'
        from C:/Ruby/lib/ruby/site_ruby/1.8/rubygems/custom_require.rb:31:in `require'
        from as2api.rb:1

AS2 Code comment
========================
/**
   * Register a listener with a given target ({@link Dispatcher} client, i.e. an event dispatcher) for an event of a
   * given type. Listeners are identified and managed according to the {@code method} and {@code instance} arguments.
   ...

This works when outputting the normal HTML API reference, but throws the error when generating XML.

Revision history for this message
James Knight (james-knight) wrote :

Here's a potential fix, I respectfully submit.

PATCH
==============
Index: lib/output/diff/api_serializer.rb
===================================================================
--- lib/output/diff/api_serializer.rb (revision 381)
+++ lib/output/diff/api_serializer.rb (working copy)
@@ -213,6 +213,8 @@
    pcdata(inline)
  when LinkTag
    serialize_link_tag(inline)
+ when CodeTag
+ serialize_code_tag(inline)
  else
    raise "unhandled inline #{inline.inspect}"
       end
@@ -218,6 +220,11 @@
       end
     end
   end
+
+ def serialize_code_tag(code)
+ attrs = {}
+ api_code(code.text, attrs)
+ end

   def serialize_link_tag(link)
     attrs = {}

Revision history for this message
David Holroyd (dholroyd) wrote :

Patch committed (plus some additional, related bits) in r383.

Cheers James!

Changed in as2api:
assignee: nobody → David Holroyd (dave-badgers-in-foil)
status: New → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.