test_class.declarator: mysql
test_class.modifier: @Mock private
test_class.original_string: @Mock private DataSource mysql;
test_class.type: DataSource
test_class.var_name: mysql
test_class.declarator: oracle
test_class.modifier: @Mock private
test_class.original_string: @Mock private DataSource oracle;
test_class.type: DataSource
test_class.var_name: oracle
test_class.declarator: bad
test_class.modifier: @Mock private
test_class.original_string: @Mock private DataSource bad;
test_class.type: DataSource
test_class.var_name: bad
test_class.file: rice-framework/krad-data/src/test/java/org/kuali/rice/krad/data/platform/MaxValueIncrementerFactoryTest.java
test_class.identifier: MaxValueIncrementerFactoryTest
test_case.body: @Test
      public void testGetIncrementer_MySQL() throws Exception {
          DataFieldMaxValueIncrementer incrementer = MaxValueIncrementerFactory.getIncrementer(mysql, "MY_SEQUENCE");
          assertTrue(incrementer instanceof MaxValueIncrementerFactory.EnhancedMySQLMaxValueIncrementer);
          MaxValueIncrementerFactory.EnhancedMySQLMaxValueIncrementer mysqlIncrementer =
                  (MaxValueIncrementerFactory.EnhancedMySQLMaxValueIncrementer)incrementer;
          assertEquals("MY_SEQUENCE", mysqlIncrementer.getIncrementerName());
          assertEquals("ID", mysqlIncrementer.getColumnName());
  
          // ensure that it's caching the incrementer
          assertSame(incrementer, MaxValueIncrementerFactory.getIncrementer(mysql, "MY_SEQUENCE"));
          // ensure that different sequence gives a different incrementer
          assertNotSame(incrementer, MaxValueIncrementerFactory.getIncrementer(mysql, "MY_SEQUENCE_2"));
  
      }
test_case.class_method_signature: MaxValueIncrementerFactoryTest.testGetIncrementer_MySQL()
test_case.full_signature: @Test public void testGetIncrementer_MySQL()
test_case.identifier: testGetIncrementer_MySQL
test_case.invocations: getIncrementer assertTrue assertEquals getIncrementerName assertEquals getColumnName assertSame getIncrementer assertNotSame getIncrementer
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testGetIncrementer_MySQL()
focal_class.declarator: ID_COLUMN_NAME = "ID"
focal_class.modifier: private static final
focal_class.original_string: private static final String ID_COLUMN_NAME = "ID";
focal_class.type: String
focal_class.var_name: ID_COLUMN_NAME
focal_class.declarator: PLATFORM_INCREMENTER_PREFIX = "rice.krad.data.platform.incrementer."
focal_class.modifier: public static final
focal_class.original_string: public static final String PLATFORM_INCREMENTER_PREFIX = "rice.krad.data.platform.incrementer.";
focal_class.type: String
focal_class.var_name: PLATFORM_INCREMENTER_PREFIX
focal_class.declarator: cache
              = Collections.synchronizedMap(new IdentityHashMap<DataSource, ConcurrentMap<String, DataFieldMaxValueIncrementer>>(8))
focal_class.modifier: private static final
focal_class.original_string: private static final Map<DataSource, ConcurrentMap<String, DataFieldMaxValueIncrementer>> cache
              = Collections.synchronizedMap(new IdentityHashMap<DataSource, ConcurrentMap<String, DataFieldMaxValueIncrementer>>(8));
focal_class.type: Map<DataSource, ConcurrentMap<String, DataFieldMaxValueIncrementer>>
focal_class.var_name: cache
focal_class.file: rice-framework/krad-data/src/main/java/org/kuali/rice/krad/data/platform/MaxValueIncrementerFactory.java
focal_class.identifier: MaxValueIncrementerFactory
focal_class.class_method_signature: MaxValueIncrementerFactory.getIncrementer(DataSource dataSource, String incrementerName)
focal_class.full_signature: public static DataFieldMaxValueIncrementer getIncrementer(DataSource dataSource, String incrementerName)
focal_class.identifier: getIncrementer
focal_class.modifiers: public static
focal_class.parameters: (DataSource dataSource, String incrementerName)
focal_class.return: DataFieldMaxValueIncrementer
focal_class.signature: DataFieldMaxValueIncrementer getIncrementer(DataSource dataSource, String incrementerName)
focal_class.class_method_signature: MaxValueIncrementerFactory.createIncrementer(DataSource dataSource, String incrementerName)
focal_class.full_signature: private static DataFieldMaxValueIncrementer createIncrementer(DataSource dataSource, String incrementerName)
focal_class.identifier: createIncrementer
focal_class.modifiers: private static
focal_class.parameters: (DataSource dataSource, String incrementerName)
focal_class.return: DataFieldMaxValueIncrementer
focal_class.signature: DataFieldMaxValueIncrementer createIncrementer(DataSource dataSource, String incrementerName)
focal_class.class_method_signature: MaxValueIncrementerFactory.getCustomizedIncrementer(DatabasePlatformInfo platformInfo, DataSource dataSource, String incrementerName, String columnName)
focal_class.full_signature: private static DataFieldMaxValueIncrementer getCustomizedIncrementer(DatabasePlatformInfo platformInfo, DataSource dataSource, String incrementerName, String columnName)
focal_class.identifier: getCustomizedIncrementer
focal_class.modifiers: private static
focal_class.parameters: (DatabasePlatformInfo platformInfo, DataSource dataSource, String incrementerName, String columnName)
focal_class.return: DataFieldMaxValueIncrementer
focal_class.signature: DataFieldMaxValueIncrementer getCustomizedIncrementer(DatabasePlatformInfo platformInfo, DataSource dataSource, String incrementerName, String columnName)
focal_class.class_method_signature: MaxValueIncrementerFactory.MaxValueIncrementerFactory()
focal_class.full_signature: private  MaxValueIncrementerFactory()
focal_class.identifier: MaxValueIncrementerFactory
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.signature:  MaxValueIncrementerFactory()
focal_method.body: public static DataFieldMaxValueIncrementer getIncrementer(DataSource dataSource, String incrementerName) {
          if (dataSource == null) {
              throw new IllegalArgumentException("DataSource must not be null");
          }
          if (StringUtils.isBlank(incrementerName)) {
              throw new IllegalArgumentException("Incrementer name must not be null or blank");
          }
  
          // yes, we want to check if it's there first, then put if absent, for max speed! This is like ConcurrentMap's
          // version of double-checked locking.
          ConcurrentMap<String, DataFieldMaxValueIncrementer> incrementerCache = cache.get(dataSource);
  
          if (incrementerCache == null) {
              cache.put(dataSource,
                      new ConcurrentHashMap<String, DataFieldMaxValueIncrementer>(8, 0.9f, 1));
              if (incrementerCache == null) {
                  incrementerCache = cache.get(dataSource);
              }
          }
  
          // now check if we have a cached incrementer
          DataFieldMaxValueIncrementer incrementer = incrementerCache.get(incrementerName.toUpperCase());
          if (incrementer == null) {
              incrementer = incrementerCache.putIfAbsent(incrementerName.toUpperCase(), createIncrementer(dataSource,
                      incrementerName));
              if (incrementer == null) {
                  incrementer = incrementerCache.get(incrementerName.toUpperCase());
              }
          }
          return incrementer;
  
      }
focal_method.class_method_signature: MaxValueIncrementerFactory.getIncrementer(DataSource dataSource, String incrementerName)
focal_method.full_signature: public static DataFieldMaxValueIncrementer getIncrementer(DataSource dataSource, String incrementerName)
focal_method.identifier: getIncrementer
focal_method.invocations: isBlank get put get get toUpperCase putIfAbsent toUpperCase createIncrementer get toUpperCase
focal_method.modifiers: public static
focal_method.parameters: (DataSource dataSource, String incrementerName)
focal_method.return: DataFieldMaxValueIncrementer
focal_method.signature: DataFieldMaxValueIncrementer getIncrementer(DataSource dataSource, String incrementerName)