RFR 8130888: Typos in nashorn sources [was Re: [PATCH] typos]

Hannes Wallnoefer hannes.wallnoefer at oracle.com
Fri Jul 10 07:14:48 UTC 2015


+1

Wondering how we managed to produce so many typos. Thanks Ahmed!

Hannes

Am 2015-07-10 um 05:07 schrieb A. Sundararajan:
> Hi,
>
> Please review http://cr.openjdk.java.net/~sundar/8130888/ for 
> https://bugs.openjdk.java.net/browse/JDK-8130888
>
> Hi Ahmed,
>
> No problem! Initial problems are normal :) Thanks for the contribution!
>
> -Sundar
>
> On Thursday 09 July 2015 10:10 PM, Ahmed Ashour wrote:
>> Hi all,
>>
>> Apologies, but it seems the email web interface is not helpful to 
>> send plain text.
>>
>> Please find the blow patch, I hope you find it useful.
>>
>> Thanks,
>> Ahmed
>>
>>
>> diff -r 3cb11f4d617e 
>> buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ConstructorGenerator.java
>> --- 
>> a/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ConstructorGenerator.javaWed 
>> Jul 08 17:28:08 2015 +0530
>> +++ 
>> b/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ConstructorGenerator.javaThu 
>> Jul 09 08:44:05 2015 +0200
>> @@ -55,7 +55,7 @@
>>  import jdk.internal.org.objectweb.asm.Handle;
>>  /**
>> - * This class generates constructor class for a @ClassInfo annotated 
>> class.
>> + * This class generates constructor class for a @ScriptClass 
>> annotated class.
>>   *
>>   */
>>  public class ConstructorGenerator extends ClassGenerator {
>> @@ -75,7 +75,7 @@
>>      }
>>      byte[] getClassBytes() {
>> -        // new class extensing from ScriptObject
>> +        // new class extending from ScriptObject
>>          final String superClass = (constructor != null)? 
>> SCRIPTFUNCTIONIMPL_TYPE : SCRIPTOBJECT_TYPE;
>>  cw.visit(V1_7, ACC_FINAL, className, null, superClass, null);
>>          if (memberCount > 0) {
>> diff -r 3cb11f4d617e 
>> buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/MemberInfo.java
>> --- 
>> a/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/MemberInfo.javaWed 
>> Jul 08 17:28:08 2015 +0530
>> +++ 
>> b/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/MemberInfo.javaThu 
>> Jul 09 08:44:05 2015 +0200
>> @@ -161,7 +161,7 @@
>>      }
>>      /**
>> -     * Tag something as optimitic builtin or not
>> +     * Tag something as optimistic builtin or not
>>       * @param isOptimistic boolean, true if builtin constructor
>>       */
>>      public void setIsOptimistic(final boolean isOptimistic) {
>> @@ -178,7 +178,7 @@
>>      }
>>      /**
>> -     * Set thre SpecializedFunction link logic class for 
>> specializations, i.e. optimistic
>> +     * Set the SpecializedFunction link logic class for 
>> specializations, i.e. optimistic
>>       * builtins
>>       * @param linkLogicClass link logic class
>>       */
>> diff -r 3cb11f4d617e 
>> buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/PrototypeGenerator.java
>> --- 
>> a/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/PrototypeGenerator.javaWed 
>> Jul 08 17:28:08 2015 +0530
>> +++ 
>> b/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/PrototypeGenerator.javaThu 
>> Jul 09 08:44:05 2015 +0200
>> @@ -42,7 +42,7 @@
>>  import java.io.IOException;
>>  /**
>> - * This class generates prototype class for a @ClassInfo annotated 
>> class.
>> + * This class generates prototype class for a @ScriptClass annotated 
>> class.
>>   *
>>   */
>>  public class PrototypeGenerator extends ClassGenerator {
>> @@ -57,7 +57,7 @@
>>      }
>>      byte[] getClassBytes() {
>> -        // new class extensing from ScriptObject
>> +        // new class extending from PrototypeObject
>>          cw.visit(V1_7, ACC_FINAL | ACC_SUPER, className, null, 
>> PROTOTYPEOBJECT_TYPE, null);
>>          if (memberCount > 0) {
>>              // add fields
>> @@ -155,7 +155,7 @@
>>       */
>>      public static void main(final String[] args) throws IOException {
>>          if (args.length != 1) {
>> -            System.err.println("Usage: " + 
>> ConstructorGenerator.class.getName() + " <class>");
>> +            System.err.println("Usage: " + 
>> PrototypeGenerator.class.getName() + " <class>");
>>              System.exit(1);
>>          }
>> diff -r 3cb11f4d617e 
>> buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ScriptClassInfo.java
>> --- 
>> a/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ScriptClassInfo.javaWed 
>> Jul 08 17:28:08 2015 +0530
>> +++ 
>> b/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ScriptClassInfo.javaThu 
>> Jul 09 08:44:05 2015 +0200
>> @@ -48,7 +48,7 @@
>>   *
>>   */
>>  public final class ScriptClassInfo {
>> -    // descriptots for various annotations
>> +    // descriptors for various annotations
>>      static final String SCRIPT_CLASS_ANNO_DESC  = 
>> Type.getDescriptor(ScriptClass.class);
>>      static final String CONSTRUCTOR_ANNO_DESC   = 
>> Type.getDescriptor(Constructor.class);
>>      static final String FUNCTION_ANNO_DESC      = 
>> Type.getDescriptor(Function.class);
>> @@ -140,7 +140,7 @@
>>      }
>>      boolean isPrototypeNeeded() {
>> -        // Prototype class generation is needed if we have atleast one
>> +        // Prototype class generation is needed if we have at least one
>>          // prototype property or @Constructor defined in the class.
>>          for (final MemberInfo memInfo : members) {
>>              if (memInfo.getWhere() == Where.PROTOTYPE || 
>> memInfo.isConstructor()) {
>> diff -r 3cb11f4d617e 
>> buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ScriptClassInfoCollector.java
>> --- 
>> a/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ScriptClassInfoCollector.javaWed 
>> Jul 08 17:28:08 2015 +0530
>> +++ 
>> b/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ScriptClassInfoCollector.javaThu 
>> Jul 09 08:44:05 2015 +0200
>> @@ -118,7 +118,7 @@
>>  addScriptMember(memInfo);
>>                      return new AnnotationVisitor(Main.ASM_VERSION, 
>> delegateAV) {
>> -                        // These could be "null" if values are not 
>> suppiled,
>> +                        // These could be "null" if values are not 
>> supplied,
>>                          // in which case we have to use the default 
>> values.
>>                          private String  name;
>>                          private Integer attributes;
>> @@ -194,7 +194,7 @@
>>                      final MemberInfo memInfo = new MemberInfo();
>> -                    //annokind == e.g. GETTER or SPECIALIZED_FUNCTION
>> +                    //annoKind == e.g. GETTER or SPECIALIZED_FUNCTION
>>  memInfo.setKind(annoKind);
>>  memInfo.setJavaName(methodName);
>>  memInfo.setJavaDesc(methodDesc);
>> @@ -203,7 +203,7 @@
>>  addScriptMember(memInfo);
>>                      return new AnnotationVisitor(Main.ASM_VERSION, 
>> delegateAV) {
>> -                        // These could be "null" if values are not 
>> suppiled,
>> +                        // These could be "null" if values are not 
>> supplied,
>>                          // in which case we have to use the default 
>> values.
>>                          private String  name;
>>                          private Integer attributes;
>> diff -r 3cb11f4d617e 
>> buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ScriptClassInstrumentor.java
>> --- 
>> a/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ScriptClassInstrumentor.javaWed 
>> Jul 08 17:28:08 2015 +0530
>> +++ 
>> b/buildtools/nasgen/src/jdk/nashorn/internal/tools/nasgen/ScriptClassInstrumentor.javaThu 
>> Jul 09 08:44:05 2015 +0200
>> @@ -64,7 +64,6 @@
>>   * 2) add "Map" type static field named "$map".
>>   * 3) add static initializer block to initialize map.
>>   */
>> -
>>  public class ScriptClassInstrumentor extends ClassVisitor {
>>      private final ScriptClassInfo scriptClassInfo;
>>      private final int memberCount;
>> @@ -266,7 +265,7 @@
>>       */
>>      public static void main(final String[] args) throws IOException {
>>          if (args.length != 1) {
>> -            System.err.println("Usage: " + 
>> ScriptClassInfoCollector.class.getName() + " <class>");
>> +            System.err.println("Usage: " + 
>> ScriptClassInstrumentor.class.getName() + " <class>");
>>              System.exit(1);
>>          }
>> diff -r 3cb11f4d617e 
>> src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/AbstractJSObject.java
>> --- 
>> a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/AbstractJSObject.javaWed 
>> Jul 08 17:28:08 2015 +0530
>> +++ 
>> b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/AbstractJSObject.javaThu 
>> Jul 09 08:44:05 2015 +0200
>> @@ -180,7 +180,7 @@
>>      /**
>>       * Checking whether the given object is an instance of 'this' 
>> object.
>>       *
>> -     * @param instance instace to check
>> +     * @param instance instance to check
>>       * @return true if the given 'instance' is an instance of this 
>> 'function' object
>>       */
>>      @Override
>> diff -r 3cb11f4d617e 
>> src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/JSObject.java
>> --- 
>> a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/JSObject.javaWed 
>> Jul 08 17:28:08 2015 +0530
>> +++ 
>> b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/api/scripting/JSObject.javaThu 
>> Jul 09 08:44:05 2015 +0200
>> @@ -142,7 +142,7 @@
>>      /**
>>       * Checking whether the given object is an instance of 'this' 
>> object.
>>       *
>> -     * @param instance instace to check
>> +     * @param instance instance to check
>>       * @return true if the given 'instance' is an instance of this 
>> 'function' object
>>       */
>>      public boolean isInstance(final Object instance);
>> diff -r 3cb11f4d617e 
>> src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeDataView.java
>> --- 
>> a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeDataView.javaWed 
>> Jul 08 17:28:08 2015 +0530
>> +++ 
>> b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeDataView.javaThu 
>> Jul 09 08:44:05 2015 +0200
>> @@ -22,6 +22,7 @@
>>   * or visit www.oracle.com if you need additional information or 
>> have any
>>   * questions.
>>   */
>> +
>>  package jdk.nashorn.internal.objects;
>>  import static jdk.nashorn.internal.runtime.ECMAErrors.rangeError;
>> diff -r 3cb11f4d617e 
>> src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeFunction.java
>> --- 
>> a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeFunction.javaWed 
>> Jul 08 17:28:08 2015 +0530
>> +++ 
>> b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/objects/NativeFunction.javaThu 
>> Jul 09 08:44:05 2015 +0200
>> @@ -108,7 +108,7 @@
>>          throw new AssertionError("Should not reach here");
>>      }
>> -     /**
>> +    /**
>>       * Given an array-like object, converts it into a Java object 
>> array suitable for invocation of ScriptRuntime.apply
>>       * or for direct invocation of the applied function.
>>       * @param array the array-like object. Can be null in which case 
>> a zero-length array is created.
>> diff -r 3cb11f4d617e 
>> src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/GlobalFunctions.java
>> --- 
>> a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/GlobalFunctions.javaWed 
>> Jul 08 17:28:08 2015 +0530
>> +++ 
>> b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/GlobalFunctions.javaThu 
>> Jul 09 08:44:05 2015 +0200
>> @@ -187,14 +187,14 @@
>>          double result = 0.0;
>>          int digit;
>> -        // we should see atleast one valid digit
>> +        // we should see at least one valid digit
>>          boolean entered = false;
>>          while (idx < length) {
>>              digit = fastDigit(str.charAt(idx++), radix);
>>              if (digit < 0) {
>>                  break;
>>              }
>> -            // we have seen atleast one valid digit in the specified 
>> radix
>> +            // we have seen at least one valid digit in the 
>> specified radix
>>              entered = true;
>>              result *= radix;
>>              result += digit;
>> diff -r 3cb11f4d617e 
>> src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/ScriptObject.java
>> --- 
>> a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/ScriptObject.javaWed 
>> Jul 08 17:28:08 2015 +0530
>> +++ 
>> b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/ScriptObject.javaThu 
>> Jul 09 08:44:05 2015 +0200
>> @@ -224,7 +224,7 @@
>>       * same combination of prototype and property map.
>>       *
>>       * @param proto the prototype object
>> -     * @param map intial {@link PropertyMap}
>> +     * @param map initial {@link PropertyMap}
>>       */
>>      protected ScriptObject(final ScriptObject proto, final 
>> PropertyMap map) {
>>          this(map);
>> @@ -1247,7 +1247,7 @@
>>          if (oldProto != newProto) {
>>              proto = newProto;
>> -  // Let current listeners know that the protototype has changed and 
>> set our map
>> +  // Let current listeners know that the prototype has changed and 
>> set our map
>>  final PropertyListeners listeners = getMap().getListeners();
>>  if (listeners != null) {
>>    listeners.protoChanged();
>> @@ -1442,7 +1442,7 @@
>>       * in {@link ScriptFunction} for hasInstance implementation, walks
>>       * the proto chain
>>       *
>> -     * @param instance instace to check
>> +     * @param instance instance to check
>>       * @return true if 'instance' is an instance of this object
>>       */
>>      public boolean isInstance(final ScriptObject instance) {
>> @@ -1859,7 +1859,7 @@
>>       * @param desc    the call site descriptor.
>>       * @param request the link request
>>       *
>> -     * @return GuardedInvocation to be invoed at call site.
>> +     * @return GuardedInvocation to be invoked at call site.
>>       */
>>      protected GuardedInvocation findCallMethod(final 
>> CallSiteDescriptor desc, final LinkRequest request) {
>>          return notAFunction();
>> diff -r 3cb11f4d617e 
>> src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/linker/Bootstrap.java
>> --- 
>> a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/linker/Bootstrap.javaWed 
>> Jul 08 17:28:08 2015 +0530
>> +++ 
>> b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/linker/Bootstrap.javaThu 
>> Jul 09 08:44:05 2015 +0200
>> @@ -69,7 +69,7 @@
>>      private static final MethodHandle VOID_TO_OBJECT = 
>> MH.constant(Object.class, ScriptRuntime.UNDEFINED);
>>      /**
>> -     * The default dynalink relink threshold for megamorphisism is 
>> 8. In the case
>> +     * The default dynalink relink threshold for megamorphism is 8. 
>> In the case
>>       * of object fields only, it is fine. However, with dual fields, 
>> in order to get
>>       * performance on benchmarks with a lot of object instantiation 
>> and then field
>>       * reassignment, it can take slightly more relinks to become 
>> stable with type
>> @@ -213,7 +213,7 @@
>>       * @param type           method type
>>       * @param programPoint   program point to bind to callsite
>>       *
>> -     * @return callsite for a math instrinic node
>> +     * @return callsite for a math intrinsic node
>>       */
>>      public static CallSite mathBootstrap(final MethodHandles.Lookup 
>> lookup, final String name, final MethodType type, final int 
>> programPoint) {
>>          final MethodHandle mh;
>> diff -r 3cb11f4d617e 
>> src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/linker/JavaAdapterBytecodeGenerator.java
>> --- 
>> a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/linker/JavaAdapterBytecodeGenerator.javaWed 
>> Jul 08 17:28:08 2015 +0530
>> +++ 
>> b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/linker/JavaAdapterBytecodeGenerator.javaThu 
>> Jul 09 08:44:05 2015 +0200
>> @@ -571,7 +571,7 @@
>>              mv.visitVarInsn(ALOAD, 0);
>>              if (fromFunction && !mi.getName().equals(samName)) {
>>                  // Constructors initializing from a ScriptFunction 
>> only initialize methods with the SAM name.
>> -                // NOTE: if there's a concrete overloaded method 
>> sharing the SAM name, it'll be overriden too. This
>> +                // NOTE: if there's a concrete overloaded method 
>> sharing the SAM name, it'll be overridden too. This
>>    // is a deliberate design choice. All other method handles are 
>> initialized to null.
>>  mv.visitInsn(ACONST_NULL);
>>              } else {
>> diff -r 3cb11f4d617e 
>> src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/linker/LinkerCallSite.java
>> --- 
>> a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/linker/LinkerCallSite.javaWed 
>> Jul 08 17:28:08 2015 +0530
>> +++ 
>> b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/linker/LinkerCallSite.javaThu 
>> Jul 09 08:44:05 2015 +0200
>> @@ -500,7 +500,7 @@
>>           * @param desc callsite descriptor string
>>           * @param args arguments to function
>>           *
>> -         * @throws Throwable if invocation failes or throws 
>> exception/error
>> +         * @throws Throwable if invocation fails or throws 
>> exception/error
>>           */
>>          @SuppressWarnings("unused")
>>          public void traceMiss(final String desc, final Object... 
>> args) throws Throwable {
>> diff -r 3cb11f4d617e 
>> src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/linker/NashornBeansLinker.java
>> --- 
>> a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/linker/NashornBeansLinker.javaWed 
>> Jul 08 17:28:08 2015 +0530
>> +++ 
>> b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/linker/NashornBeansLinker.javaThu 
>> Jul 09 08:44:05 2015 +0200
>> @@ -169,7 +169,7 @@
>>          }
>>          for (final Class<?> iface : clazz.getInterfaces()) {
>> -            // check accessiblity up-front
>> +            // check accessibility up-front
>>              if (! Context.isAccessibleClass(iface)) {
>>                  continue;
>>              }
>> diff -r 3cb11f4d617e 
>> src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/linker/NashornCallSiteDescriptor.java
>> --- 
>> a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/linker/NashornCallSiteDescriptor.javaWed 
>> Jul 08 17:28:08 2015 +0530
>> +++ 
>> b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/linker/NashornCallSiteDescriptor.javaThu 
>> Jul 09 08:44:05 2015 +0200
>> @@ -274,7 +274,7 @@
>>       * {@code NashornCallSiteDescriptor}. This allows for graceful 
>> interoperability when linking Nashorn with code
>>       * generated outside of Nashorn.
>>       * @param flag the tested flag
>> -     * @return true if the flag is set, false otherwise (it will be 
>> false if the decriptor is not a Nashorn call site
>> +     * @return true if the flag is set, false otherwise (it will be 
>> false if the descriptor is not a Nashorn call site
>>       * descriptor).
>>       */
>>      private static boolean isFlag(final CallSiteDescriptor desc, 
>> final int flag) {
>> diff -r 3cb11f4d617e 
>> src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/options/OptionTemplate.java
>> --- 
>> a/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/options/OptionTemplate.javaWed 
>> Jul 08 17:28:08 2015 +0530
>> +++ 
>> b/src/jdk.scripting.nashorn/share/classes/jdk/nashorn/internal/runtime/options/OptionTemplate.javaThu 
>> Jul 09 08:44:05 2015 +0200
>> @@ -163,7 +163,7 @@
>>      /**
>>       * Does this option automatically enable another option, i.e. a 
>> dependency.
>> -     * @return the dependecy or null if non exists
>> +     * @return the dependency or null if non exists
>>       */
>>      public String getDependency() {
>>          return this.dependency;
>>
>



More information about the nashorn-dev mailing list