/*
 * Copyright (C) 2015 Brett Wooldridge
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 * http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package com.zaxxer.hikari.util;

import java.util.concurrent.atomic.AtomicLong;
import java.util.concurrent.atomic.LongAdder;


/**
 * A monotonically increasing long sequence.
 *
 * @author brettw
 */
public interface Sequence
{
   /**
    * Increment the sequence.
    */
   void increment();

   /**
    * Get the current sequence (imprecise on Java 8, but it doesn't matter for
    * our purposes).
    *
    * @return the current sequence.
    */
   long get();

   /**
    * Factory class used to create a platform-specific ClockSource. 
    */
   class Factory
   {
      @SuppressWarnings("serial")
      public static Sequence create()
      {
         class Java7Sequence extends AtomicLong implements Sequence {
            @Override
            public void increment() {
               this.incrementAndGet();
            }
         }

         class Java8Sequence extends LongAdder implements Sequence {
            @Override
            public long get() {
               return this.sum();
            }
         }

         Sequence sequence = null;
         try {
            if (Sequence.class.getClassLoader().loadClass("java.util.concurrent.atomic.LongAdder") != null) {
               sequence = new Java8Sequence();
            }
         }
         catch (ClassNotFoundException e) {
         }

         return sequence != null ? sequence : new Java7Sequence();
      }
   }
}

@@ -1309,32 +1309,102 @@
 ents Sequence %7B%0A
+            Java7Sequence() %7B%0A               super(1);%0A            %7D%0A%0A
             @Ove
@@ -1573,32 +1573,117 @@
 ents Sequence %7B%0A
+            public Java8Sequence() %7B%0A               this.increment();%0A            %7D%0A%0A
             @Ove

Remove our "ported" Java 8 LongAdder and Striped64.