~ubuntu-branches/ubuntu/vivid/eclipse-wtp/vivid

« back to all changes in this revision

Viewing changes to org.eclipse.wst.jsdt.debug.rhino.debugger/src/org/eclipse/wst/jsdt/debug/internal/rhino/transport/JSONUtil.java

  • Committer: Package Import Robot
  • Author(s): Jakub Adam
  • Date: 2013-06-28 08:42:01 UTC
  • mfrom: (1.1.2)
  • Revision ID: package-import@ubuntu.com-20130628084201-houvqyt5uc6a3p27
Tags: 3.5.0-1
* New upstream release.
* Refreshed d/patches:
  - debian-custom-build.patch
  - regenerate-xpath2-parser.patch.
* Add patch for compatibility with rhino 1.7R4.
* Regenerate code from EMF models.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*******************************************************************************
2
 
 * Copyright (c) 2010 IBM Corporation and others All rights reserved. This
 
2
 * Copyright (c) 2010, 2012 IBM Corporation and others All rights reserved. This
3
3
 * program and the accompanying materials are made available under the terms of
4
4
 * the Eclipse Public License v1.0 which accompanies this distribution, and is
5
5
 * available at http://www.eclipse.org/legal/epl-v10.html
365
365
                        buffer.append(value.toString());
366
366
                else if (value instanceof Number)
367
367
                        writeNumber((Number) value, buffer);
368
 
                else if (value instanceof String)
369
 
                        writeString((String) value, buffer);
 
368
                else if (value instanceof CharSequence)
 
369
                        writeCharSequence((CharSequence) value, buffer);
370
370
                else if (value instanceof Collection)
371
371
                        writeArray((Collection) value, buffer);
372
372
                else if (value instanceof Map)
399
399
                        Object key = iterator.next();
400
400
                        if (!(key instanceof String))
401
401
                                throw error("Map keys must be an instance of String but was '" + key.getClass().getName() + "'"); //$NON-NLS-1$ //$NON-NLS-2$););
402
 
                        writeString((String) key, buffer);
 
402
                        writeCharSequence((CharSequence) key, buffer);
403
403
                        buffer.append(':');
404
404
                        writeValue(map.get(key), buffer);
405
405
                        buffer.append(',');
422
422
                        buffer.append(']');
423
423
        }
424
424
 
425
 
        private static void writeString(String string, StringBuffer buffer) {
 
425
        private static void writeCharSequence(CharSequence string, StringBuffer buffer) {
426
426
                buffer.append('"');
427
427
                int length = string.length();
428
428
                for (int i = 0; i < length; i++) {