auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private ResultSet getNextResultSet() { closeCurrentResultSet(); if (!tableIds.hasNext()) { return null; } Long tableId = tableIds.next(); Long columnId = metadataDao.getTemporalColumnId(tableId); List<String> columnNames; if (columnId == null) { columnNames = getMappedColumnNames(DEFAULT_COLUMN_NAME, DEFAULT_COLUMN_NAME, DEFAULT_COLUMN_NAME, DEFAULT_COLUMN_NAME); } else { Type temporalType = metadataDao.getTableColumn(tableId, columnId).getDataType(); checkState(temporalType.equals(DATE) || temporalType.equals(TIMESTAMP), "Temporal column should be of type date or timestamp: %s", temporalType); if (temporalType.equals(DATE)) { columnNames = getMappedColumnNames(DEFAULT_COLUMN_NAME, DEFAULT_COLUMN_NAME, minColumn(columnId), maxColumn(columnId)); } else { columnNames = getMappedColumnNames(minColumn(columnId), maxColumn(columnId), DEFAULT_COLUMN_NAME, DEFAULT_COLUMN_NAME); } } try { connection = dbi.open().getConnection(); statement = PreparedStatementBuilder.create( connection, constructSqlTemplate(columnNames, tableId), columnNames, TYPES, ImmutableSet.of(getColumnIndex(SHARD_METADATA, SHARD_UUID)), tupleDomain); return statement.executeQuery(); } catch (SQLException | DBIException e) { close(); throw metadataError(e); } }

Target:
private ResultSet getNextResultSet() { closeCurrentResultSet(); if (!tableIds.hasNext()) { return null; } Long tableId = tableIds.next(); Long columnId = metadataDao.getTemporalColumnId(tableId); List<String> columnNames; if (columnId == null) { columnNames = getMappedColumnNames("null", "null", "null", "null"); } else { Type temporalType = metadataDao.getTableColumn(tableId, columnId).getDataType(); if (temporalType.equals(DATE)) { columnNames = getMappedColumnNames("null", "null", minColumn(columnId), maxColumn(columnId)); } else if (temporalType.equals(TIMESTAMP)) { columnNames = getMappedColumnNames(minColumn(columnId), maxColumn(columnId), "null", "null"); } else { throw new PrestoException(RAPTOR_CORRUPT_METADATA, "Temporal column should be of type date or timestamp, not " + temporalType.getDisplayName()); } } try { connection = dbi.open().getConnection(); statement = PreparedStatementBuilder.create( connection, constructSqlTemplate(columnNames, tableId), columnNames, TYPES, ImmutableSet.of(getColumnIndex(SHARD_METADATA, SHARD_UUID)), tupleDomain); return statement.executeQuery(); } catch (SQLException | DBIException e) { close(); throw metadataError(e); } }
Source:
protected Iterator<TimelineRecord> readFile( File file ) { final ArrayList<TimelineRecord> result = new ArrayList<TimelineRecord>(); InputStream in = null; try { in = new FileInputStream( file ); TimelineRecord rec = fromProto( TimeLineRecordProtos.TimeLineRecord.parseDelimitedFrom( in ) ); while ( rec != null ) { result.add( rec ); rec = fromProto( TimeLineRecordProtos.TimeLineRecord.parseDelimitedFrom( in ) ); } } catch ( Exception e ) { } finally { IOUtil.close( in ); } return result.iterator(); }

Target:
protected Iterator<TimelineRecord> readFile( File file ) { final ArrayList<TimelineRecord> result = new ArrayList<TimelineRecord>(); InputStream in = null; try { in = new BufferedInputStream( new FileInputStream( file ) ); TimelineRecord rec = fromProto( TimeLineRecordProtos.TimeLineRecord.parseDelimitedFrom( in ) ); while ( rec != null ) { result.add( rec ); rec = fromProto( TimeLineRecordProtos.TimeLineRecord.parseDelimitedFrom( in ) ); } } catch ( Exception e ) { } finally { IOUtil.close( in ); } return result.iterator(); }
Source:
public void testUpdateBeforeSave() throws Exception { ParseCurrentInstallationController controller = mock(ParseCurrentInstallationController.class); when(controller.isCurrent(any(ParseInstallation.class))).thenReturn(true); ParseCorePlugins.getInstance().registerCurrentInstallationController(controller); RobolectricPackageManager packageManager = spy(RuntimeEnvironment.getRobolectricPackageManager()); doReturn("parseTest").when(packageManager).getApplicationLabel(any(ApplicationInfo.class)); RuntimeEnvironment.setRobolectricPackageManager(packageManager); ParsePlugins.Android plugins = mock(ParsePlugins.Android.class); InstallationId installationId = mock(InstallationId.class); when(installationId.get()).thenReturn("installationId"); when(plugins.installationId()).thenReturn(installationId); when(plugins.applicationContext()).thenReturn(RuntimeEnvironment.application); ParsePlugins.set(plugins); ParseInstallation installation = new ParseInstallation(); installation.updateBeforeSave(); String zone = TimeZone.getDefault().getID(); assertEquals(zone, installation.getString(KEY_TIME_ZONE)); Context context = Parse.getApplicationContext(); String packageName = context.getPackageName(); PackageManager pm = context.getPackageManager(); PackageInfo pkgInfo = pm.getPackageInfo(packageName, 0); String appVersion = pkgInfo.versionName; String appName = pm.getApplicationLabel(pm.getApplicationInfo(packageName, 0)).toString(); assertEquals(packageName, installation.getString(KEY_APP_IDENTIFIER)); assertEquals(appName, installation.getString(KEY_APP_NAME)); assertEquals(appVersion, installation.getString(KEY_APP_VERSION)); assertEquals("android", installation.getString(KEY_DEVICE_TYPE)); assertEquals(installationId.get(), installation.getString(KEY_INSTALLATION_ID)); assertEquals("en-US", installation.getString(KEY_LOCALE_IDENTIFIER)); }

Target:
public void testUpdateBeforeSave() throws Exception { mocksForUpdateBeforeSave(); Locale.setDefault(new Locale("en", "US")); ParseInstallation installation = new ParseInstallation(); installation.updateBeforeSave(); String zone = TimeZone.getDefault().getID(); assertEquals(zone, installation.getString(KEY_TIME_ZONE)); Context context = Parse.getApplicationContext(); String packageName = context.getPackageName(); PackageManager pm = context.getPackageManager(); PackageInfo pkgInfo = pm.getPackageInfo(packageName, 0); String appVersion = pkgInfo.versionName; String appName = pm.getApplicationLabel(pm.getApplicationInfo(packageName, 0)).toString(); assertEquals(packageName, installation.getString(KEY_APP_IDENTIFIER)); assertEquals(appName, installation.getString(KEY_APP_NAME)); assertEquals(appVersion, installation.getString(KEY_APP_VERSION)); assertEquals("android", installation.getString(KEY_DEVICE_TYPE)); assertEquals("installationId", installation.getString(KEY_INSTALLATION_ID)); assertEquals("en-US", installation.getString(KEY_LOCALE_IDENTIFIER)); }
Source:
protected Map getMapProperty(String key) { Object value = getProperty(key); if (value != null) { if (value instanceof Map) { return (Map) value; } } return null; }

Target:
protected Map getMapProperty(String key) { Object value = getProperty(key); if (value != null) { if (value instanceof Map) { return (Map) value; } String msg = "'" + key + "' property value type does not match the specified type. Specified type: Map. " + "Existing type: " + value.getClass().getName(); msg += (isPrintableProperty(key) ? ". Value: " + value : "."); throw new IllegalArgumentException(msg); } return null; }
Source:
static boolean validValue( long[] arr, int width ) { if ( arr.length != width ) { throw new AssertionError( "all elements in the set must have the same size" ); } for ( long l : arr ) { if ( l == -1 || l == -2 ) { throw new AssertionError( "magic values -1 and -2 not allowed in keys" ); } } return true; }

Target:
static boolean validValue( long[] arr, int width ) { if ( arr.length != width ) { throw new AssertionError( "all elements in the set must have the same size" ); } for ( long l : arr ) { if ( l == NOT_IN_USE ) { throw new AssertionError( "magic value " + NOT_IN_USE + " not allowed in keys" ); } } return true; }
Source:
private void calcMedicalSupportHoursNeeded() { ArrayList<Person> activePersonnel = new ArrayList<>(); for (Person p : getCampaign().getPersonnel()) { if (p.isActive()) { activePersonnel.add(p); } } int numSquads = new BigDecimal(activePersonnel.size()) .divide(new BigDecimal(7), 0, RoundingMode.DOWN).intValue(); int leftOver = activePersonnel.size() - (numSquads * 7); medSupportNeeded = (numSquads * 4) + (3 + (new BigDecimal(leftOver).divide( new BigDecimal(5), 0, RoundingMode.HALF_EVEN).intValue())); }

Target:
private void calcMedicalSupportHoursNeeded() { int activePersonnelCount = getCampaign().getActivePersonnel().size(); int numSquads = new BigDecimal(activePersonnelCount) .divide(new BigDecimal(7), 0, RoundingMode.DOWN).intValue(); int leftOver = activePersonnelCount - (numSquads * 7); medSupportNeeded = (numSquads * 4) + (3 + (new BigDecimal(leftOver).divide( new BigDecimal(5), 0, RoundingMode.HALF_EVEN).intValue())); }
Source:
private void executeScript(List<Operation> operations) throws IOException { for (Operation operation : operations) { echo("Start operation: " + operation.getDescription()); for (SimulateParticipantProcess process : _processMap.values()) { process.getAndResetTransitions(); } if (operation.execute(_admin, _zkClient, _clusterName)) { ClusterStateVerifier.verifyByPolling(() -> { for (SimulateParticipantProcess process : _processMap.values()) { if (process.getTransitionCount() > 0) { return true; } } return false; }, DEFAULT_WAIT_TIME); if (!isClusterConverged()) { echo("Cluster does not converge after operation " + operation.getDescription() + ". Stop the next operation."); break; } printState("Done operation: " + operation.getDescription()); } else { echo("Operation " + operation.getDescription() + " failed. Stop the next operation."); break; } } }

Target:
private void executeScript(List<Operation> operations) throws IOException { for (Operation operation : operations) { echo("Start operation: " + operation.getDescription()); for (SimulateParticipantProcess process : _participantProcessMap.values()) { process.getAndResetTransitions(); } if (!operation.execute(_admin, _zkClient, _clusterName)) { echo("Operation " + operation.getDescription() + " failed. Stop the next operation."); break; } if (!checkAndPrint(operation.getDescription())) { break; } } }
Source:
public Builder visitArray(List<? extends AnnotationValue> values, Entry entry) { Visitor visitor = new Visitor(builder); for (AnnotationValue value : values) { value.accept(visitor, new Entry(entry.name, value)); } return builder; }

Target:
public Builder visitArray(List<? extends AnnotationValue> values, Entry entry) { for (AnnotationValue value : values) { value.accept(this, new Entry(entry.name, value)); } return builder; }
Source:
void onTrackSelected(@NonNull PlayerWrapper player, @NonNull TrackInfo trackInfo) { if (trackInfo.getTrackType() == TrackInfo.MEDIA_TRACK_TYPE_SUBTITLE) { for (int i = 0; i < mSubtitleTracks.size(); i++) { if (mSubtitleTracks.get(i).equals(trackInfo)) { mSelectedSubtitleTrackIndex = i; continue; } } if (mSettingsMode == SETTINGS_MODE_SUBTITLE_TRACK) { mSubSettingsAdapter.setCheckPosition(mSelectedSubtitleTrackIndex + 1); } mSubtitleButton.setImageDrawable( mResources.getDrawable(R.drawable.ic_subtitle_on)); mSubtitleButton.setContentDescription( mResources.getString(R.string.mcv2_cc_is_on)); } else if (trackInfo.getTrackType() == TrackInfo.MEDIA_TRACK_TYPE_AUDIO) { for (int i = 0; i < mAudioTracks.size(); i++) { if (mAudioTracks.get(i).equals(trackInfo)) { mSelectedAudioTrackIndex = i; continue; } } mSettingsSubTextsList.set(SETTINGS_MODE_AUDIO_TRACK, mSubSettingsAdapter.getMainText(mSelectedAudioTrackIndex)); } }

Target:
void onTrackSelected(@NonNull PlayerWrapper player, @NonNull TrackInfo trackInfo) { if (player != mPlayer) return; if (trackInfo.getTrackType() == TrackInfo.MEDIA_TRACK_TYPE_SUBTITLE) { for (int i = 0; i < mSubtitleTracks.size(); i++) { if (mSubtitleTracks.get(i).equals(trackInfo)) { mSelectedSubtitleTrackIndex = i; if (mSettingsMode == SETTINGS_MODE_SUBTITLE_TRACK) { mSubSettingsAdapter.setCheckPosition(mSelectedSubtitleTrackIndex + 1); } mSubtitleButton.setImageDrawable( mResources.getDrawable(R.drawable.ic_subtitle_on)); mSubtitleButton.setContentDescription( mResources.getString(R.string.mcv2_cc_is_on)); break; } } } else if (trackInfo.getTrackType() == TrackInfo.MEDIA_TRACK_TYPE_AUDIO) { for (int i = 0; i < mAudioTracks.size(); i++) { if (mAudioTracks.get(i).equals(trackInfo)) { mSelectedAudioTrackIndex = i; mSettingsSubTextsList.set(SETTINGS_MODE_AUDIO_TRACK, mSubSettingsAdapter.getMainText(mSelectedAudioTrackIndex)); break; } } } }
Source:
public Response getConsent(final @PathParam("clientId") String clientId) { checkAccountApiEnabled(); auth.requireOneOf(AccountRoles.MANAGE_ACCOUNT, AccountRoles.VIEW_PROFILE, AccountRoles.VIEW_CONSENT, AccountRoles.MANAGE_CONSENT); ClientModel client = realm.getClientByClientId(clientId); if (client == null) { return Cors.add(request, Response.status(Response.Status.NOT_FOUND).entity("No client with clientId: " + clientId + " found.")).build(); } UserConsentModel consent = session.users().getConsentByClient(realm, user.getId(), client.getId()); if (consent == null) { return Cors.add(request, Response.noContent()).build(); } return Cors.add(request, Response.ok(modelToRepresentation(consent))).build(); }

Target:
public Response getConsent(final @PathParam("clientId") String clientId) { checkAccountApiEnabled(); auth.requireOneOf(AccountRoles.MANAGE_ACCOUNT, AccountRoles.VIEW_CONSENT, AccountRoles.MANAGE_CONSENT); ClientModel client = realm.getClientByClientId(clientId); if (client == null) { return Cors.add(request, Response.status(Response.Status.NOT_FOUND).entity("No client with clientId: " + clientId + " found.")).build(); } UserConsentModel consent = session.users().getConsentByClient(realm, user.getId(), client.getId()); if (consent == null) { return Cors.add(request, Response.noContent()).build(); } return Cors.add(request, Response.ok(modelToRepresentation(consent))).build(); }
Source:
public void testSetExpirationOnDoc() throws CouchbaseLiteException, Exception { Date dto3 = new Date(System.currentTimeMillis() + 3000L); MutableDocument doc1a = new MutableDocument("doc1"); doc1a.setInt("answer", 12); doc1a.setValue("question", "What is six plus six?"); save(doc1a); MutableDocument doc1b = new MutableDocument("doc2"); doc1b.setInt("answer", 12); doc1b.setValue("question", "What is six plus six?"); save(doc1b); db.setDocumentExpiration("doc2", new Date(System.currentTimeMillis())); Thread.sleep(500); assertNull(db.getDocument("doc2")); db.setDocumentExpiration("doc1", dto3); Thread.sleep(3 * 1000); assertNull(db.getDocument("doc1")); }

Target:
public void testSetExpirationOnDoc() throws Exception { Date dto3 = new Date(System.currentTimeMillis() + 3000L); MutableDocument doc1 = new MutableDocument("doc1"); doc1.setInt("answer", 12); doc1.setValue("question", "What is six plus six?"); save(doc1); MutableDocument doc2 = new MutableDocument("doc2"); doc2.setInt("answer", 12); doc2.setValue("question", "What is six plus six?"); save(doc2); db.setDocumentExpiration("doc2", new Date(System.currentTimeMillis())); Thread.sleep(500); assertNull(db.getDocument("doc2")); db.setDocumentExpiration("doc1", dto3); Thread.sleep(3 * 1000); assertNull(db.getDocument("doc1")); }
Source:
public void showTable(Table table) { this.table = table; nameLabel.setText(table.getName()); DecimalFormat formatter = new DecimalFormat("#,###"); if (table.getRowCount() > 0) { rowCountLabel.setText(formatter.format(table.getRowCount())); } else { rowCountLabel.setText(">= " + formatter.format(table.getRowsCheckedCount())); } fieldTable.clear(); for (Field field : table.getFields()){ fieldTable.add(field.outputName(), field.getType(),field.getDescription()); } commentsArea.setText(table.getComment()); }

Target:
public void showTable(Table table) { this.table = table; nameLabel.setText(table.getName()); if (table.getRowCount() > 0) { rowCountLabel.setText(numberFormat.format(table.getRowCount())); } else { rowCountLabel.setText(">= " + numberFormat.format(table.getRowsCheckedCount())); } fieldTable.clear(); for (Field field : table.getFields()){ fieldTable.add(field.outputName(), field.getType(),field.getDescription()); } commentsArea.setText(table.getComment()); }
Source:
protected void readSpecificHeader(ByteBuffer buffer) { int size = getConfig().getMaxChildren(); extension = buffer.getInt(); nbChildren = buffer.getInt(); children = new int[size]; for (int i = 0; i < nbChildren; i++) { children[i] = buffer.getInt(); } for (int i = nbChildren; i < size; i++) { buffer.getInt(); } this.childStart = new long[size]; for (int i = 0; i < nbChildren; i++) { childStart[i] = buffer.getLong(); } this.childEnd = new long[size]; for (int i = 0; i < nbChildren; i++) { childEnd[i] = buffer.getLong(); } for (int i = nbChildren; i < size; i++) { buffer.getLong(); } }

Target:
protected void readSpecificHeader(ByteBuffer buffer) { int size = getConfig().getMaxChildren(); extension = buffer.getInt(); nbChildren = buffer.getInt(); children = new int[size]; for (int i = 0; i < nbChildren; i++) { children[i] = buffer.getInt(); } for (int i = nbChildren; i < size; i++) { buffer.getInt(); } this.childStart = new long[size]; for (int i = 0; i < nbChildren; i++) { childStart[i] = buffer.getLong(); } for (int i = nbChildren; i < size; i++) { buffer.getLong(); } this.childEnd = new long[size]; for (int i = 0; i < nbChildren; i++) { childEnd[i] = buffer.getLong(); } for (int i = nbChildren; i < size; i++) { childEnd[i] = Long.MAX_VALUE; buffer.getLong(); } }
Source:
private void shutdown() { logger.info("OperationController is shutting down"); try { if (shutDownLatch.await(SHUTDOWN_WAIT_MS, TimeUnit.MILLISECONDS)) { logger.error("RequestResponseHandler thread did not shut down gracefully, forcing shut down"); } } catch (InterruptedException e) { logger.error("Exception while shutting down, forcing shutdown", e); } connectionManager.close(); }

Target:
private void shutdown() { logger.info("OperationController is shutting down"); try { if (shutDownLatch.await(SHUTDOWN_WAIT_MS, TimeUnit.MILLISECONDS)) { logger.error("RequestResponseHandler thread did not shut down gracefully, forcing shut down"); } } catch (InterruptedException e) { logger.error("Exception while shutting down, forcing shutdown", e); } connectionManager.close(); selector.close(); }
Source:
public void init() { filterSettingsManager.getDefaultActiveFilterKey(defaultFilter -> loadSavedFilters(defaultFilter)); }

Target:
public void init() { loadSavedFilters(); }
Source:
public void testTimerStreamCancellation() throws Exception { TimeoutStream timer = vertx.timerStream(10); AtomicBoolean called = new AtomicBoolean(); timer.handler(l -> { called.set(true); }); timer.cancel(); vertx.setTimer(500, id -> { assertFalse(called.get()); testComplete(); }); await(); }

Target:
public void testTimerStreamCancellation() throws Exception { vertx.runOnContext(v -> { TimeoutStream timer = vertx.timerStream(200); AtomicBoolean called = new AtomicBoolean(); timer.handler(l -> { called.set(true); }); timer.cancel(); vertx.setTimer(500, id -> { assertFalse(called.get()); testComplete(); }); }); await(); }
Source:
public List<KeySlice> getRows(String kvsMethodName, KeyRange keyRange, SlicePredicate slicePredicate) { InetSocketAddress host = clientPool.getRandomHostForKey(keyRange.getStart_key()); return clientPool.runWithRetryOnHost( host, new FunctionCheckedException<CassandraClient, List<KeySlice>, RuntimeException>() { @Override public List<KeySlice> apply(CassandraClient client) throws RuntimeException { try { return queryRunner.run(client, tableRef, () -> client.get_range_slices(kvsMethodName, tableRef, slicePredicate, keyRange, consistency)); } catch (UnavailableException e) { throw new InsufficientConsistencyException("get_range_slices requires " + consistency + " Cassandra nodes to be up and available.", e); } catch (Exception e) { throw QosAwareThrowables.unwrapAndThrowRateLimitExceededOrAtlasDbDependencyException(e); } } @Override public String toString() { return "get_range_slices(" + tableRef + ")"; } }); }

Target:
public List<KeySlice> getRows(String kvsMethodName, KeyRange keyRange, SlicePredicate slicePredicate) { InetSocketAddress host = clientPool.getRandomHostForKey(keyRange.getStart_key()); return clientPool.runWithRetryOnHost( host, new FunctionCheckedException<CassandraClient, List<KeySlice>, RuntimeException>() { @Override public List<KeySlice> apply(CassandraClient client) { try { return queryRunner.run(client, tableRef, () -> client.get_range_slices(kvsMethodName, tableRef, slicePredicate, keyRange, consistency)); } catch (UnavailableException e) { throw new InsufficientConsistencyException("get_range_slices requires " + consistency + " Cassandra nodes to be up and available.", e); } catch (Exception e) { throw QosAwareThrowables.unwrapAndThrowRateLimitExceededOrAtlasDbDependencyException(e); } } @Override public String toString() { return "get_range_slices(" + tableRef + ")"; } }); }
Source:
private MemoizedMessage(Diagnostic.Kind kind, CharSequence message) { this.kind = kind; this.message = message; }

Target:
private MemoizedMessage(Diagnostic.Kind kind, CharSequence message) { this.kind = kind; this.message = message.toString(); }
Source:
public void configure(Binder binder) { JsonConfigProvider.bind(binder, STATIC_CONFIG_PREFIX, NamespaceLookupStaticConfig.class); PolyBind.createChoiceWithDefault( binder, TYPE_PREFIX, Key.get(NamespaceExtractionCacheManager.class), Key.get(OnHeapNamespaceExtractionCacheManager.class), "onheap" ).in(LazySingleton.class); PolyBind .optionBinder(binder, Key.get(NamespaceExtractionCacheManager.class)) .addBinding("offheap") .to(OffHeapNamespaceExtractionCacheManager.class) .in(LazySingleton.class); getNamespaceFactoryMapBinder(binder) .addBinding(JDBCExtractionNamespace.class) .to(JDBCExtractionNamespaceFunctionFactory.class) .in(LazySingleton.class); getNamespaceFactoryMapBinder(binder) .addBinding(URIExtractionNamespace.class) .to(URIExtractionNamespaceFunctionFactory.class) .in(LazySingleton.class); AnnouncementListenerResource .getPOSTHandlerMap(binder) .addBinding("namespace") .toProvider(NamespaceAnnouncementPostHandlerProvider.class) .in(LazySingleton.class); AnnouncementListenerResource .getDELETEHandlerMap(binder) .addBinding("namespace") .toProvider(NamespaceAnnouncementDeleteHandlerProvider.class) .in(LazySingleton.class); AnnouncementListenerResource .getGETHandlerMap(binder) .addBinding("namespace") .toProvider(NamespaceAnnouncementGetHandlerProvider.class) .in(LazySingleton.class); JsonConfigProvider.bind(binder, "druid.zk.paths", NamespaceLookupConfig.class); LifecycleModule.register(binder, NamespaceProcessorAnnouncer.class); Jerseys.addResource(binder, AnnouncementListenerResource.class); LifecycleModule.register(binder, NamespaceStaticConfiguration.class); Jerseys.addResource(binder, NamespacesCacheResource.class); }

Target:
public void configure(Binder binder) { JsonConfigProvider.bind(binder, STATIC_CONFIG_PREFIX, NamespaceLookupStaticConfig.class); PolyBind.createChoiceWithDefault( binder, TYPE_PREFIX, Key.get(NamespaceExtractionCacheManager.class), Key.get(OnHeapNamespaceExtractionCacheManager.class), "onheap" ).in(LazySingleton.class); PolyBind .optionBinder(binder, Key.get(NamespaceExtractionCacheManager.class)) .addBinding("offheap") .to(OffHeapNamespaceExtractionCacheManager.class) .in(LazySingleton.class); getNamespaceFactoryMapBinder(binder) .addBinding(JDBCExtractionNamespace.class) .to(JDBCExtractionNamespaceFunctionFactory.class) .in(LazySingleton.class); getNamespaceFactoryMapBinder(binder) .addBinding(URIExtractionNamespace.class) .to(URIExtractionNamespaceFunctionFactory.class) .in(LazySingleton.class); LifecycleModule.register(binder, NamespaceStaticConfiguration.class); Jerseys.addResource(binder, NamespacesCacheResource.class); }
Source:
public void hook(ExtensionHook extensionHook) { super.hook(extensionHook); ExtensionSpider spider = Control.getSingleton().getExtensionLoader().getExtension(ExtensionSpider.class); graphQlSpider = new GraphQlSpider(); graphQlParseFilter = new GraphQlParseFilter(); if (spider != null && !"2.9.0".equals(Constant.PROGRAM_VERSION)) { spider.addCustomParseFilter(graphQlParseFilter); spider.addCustomParser(graphQlSpider); LOG.debug("Added GraphQl spider."); } else { LOG.warn("Could not add GraphQl spider."); } if (getView() != null) { extensionHook.getHookMenu().addImportMenuItem(getMenuImportLocalGraphQl()); extensionHook.getHookMenu().addImportMenuItem(getMenuImportUrlGraphQl()); } extensionHook.addApiImplementor(new GraphQlApi()); extensionHook.addCommandLine(getCommandLineArguments()); }

Target:
public void hook(ExtensionHook extensionHook) { super.hook(extensionHook); if (!"2.9.0".equals(Constant.PROGRAM_VERSION)) { ExtensionSpider spider = Control.getSingleton().getExtensionLoader().getExtension(ExtensionSpider.class); graphQlSpider = new GraphQlSpider(); graphQlParseFilter = new GraphQlParseFilter(); if (spider != null) { spider.addCustomParseFilter(graphQlParseFilter); spider.addCustomParser(graphQlSpider); LOG.debug("Added GraphQl spider."); } else { LOG.debug("Could not add GraphQl spider."); } } if (getView() != null) { extensionHook.getHookMenu().addImportMenuItem(getMenuImportLocalGraphQl()); extensionHook.getHookMenu().addImportMenuItem(getMenuImportUrlGraphQl()); } extensionHook.addApiImplementor(new GraphQlApi()); extensionHook.addCommandLine(getCommandLineArguments()); }
Source:
private int lookupSymbol(char chr) throws IOException { int result = -1; Character chrObj = chr; int index = Collections.binarySearch(symbols, chrObj); if (index >= 0) { while (index > 0 && symbols.get(index - 1).compareTo(chrObj) == 0) { index--; } while (index < symbols.size()) { TokenizerSymbol symbol = (symbols.get(index)); if (symbol.compareTo(chrObj) == 0) { if (compare(symbol.startText.toCharArray(), 1)) { result = index; break; } index++; } else { break; } } } return result; }

Target:
private int lookupSymbol(char chr) throws IOException { int result = -1; Character chrObj = chr; int index = Collections.binarySearch(symbols, chrObj); if (index >= 0) { while (index > 0 && ((TokenizerSymbol) symbols.get(index - 1)).compareTo(chrObj) == 0) { index--; } while (index < symbols.size()) { TokenizerSymbol symbol = ((TokenizerSymbol) symbols.get(index)); if (symbol.compareTo(chrObj) == 0) { if (compare(symbol.startText.toCharArray(), 1)) { result = index; break; } index++; } else { break; } } } return result; }
Source:
public Command getCloneRepoCommand() { return cloneRepoCommand; }

Target:
Command getCloneRepoCommand() { return cloneRepoCommand; }
Source:
public Object get(DataFetchingEnvironment env) { Object source = env.getSource(); if (source == null || !(source instanceof Map)) return null; return ((Map<?, ?>) source).get(keyName); }

Target:
public Object get(DataFetchingEnvironment env) { Object source = env.getSource(); if (source == null || !(source instanceof Map)) return null; return getValue(source); }
Source:
public void init() throws DBException { System.out.println("Init this.toString() = " + this.toString()); super.init(); Properties props = getProperties(); String tableName = props.getProperty(CoreWorkload.TABLENAME_PROPERTY, CoreWorkload.TABLENAME_PROPERTY_DEFAULT); String igniteIPs = props.getProperty(IGNITE_IPS, "127.0.0.1,127.0.0.1:47500..47509"); asyncInsert = Boolean.valueOf(props.getProperty(INSERT_ASYNC, "false")); batchSize = Integer.parseInt(props.getProperty(BATCH_SIZE, "1")); createIgniteClient(tableName, igniteIPs); System.out.println( "" + this + ":" + "\n\tBATCH_SIZE = " + batchSize + "\n\tINSERT_ASYNC = " +asyncInsert); }

Target:
public void init() throws DBException { super.init(); Properties props = getProperties(); tableName = props.getProperty(CoreWorkload.TABLENAME_PROPERTY, CoreWorkload.TABLENAME_PROPERTY_DEFAULT); String igniteIPs = props.getProperty(IGNITE_IPS, "127.0.0.1,127.0.0.1:47500..47509"); asyncInsert = Boolean.valueOf(props.getProperty(INSERT_ASYNC, "false")); batchSize = Integer.parseInt(props.getProperty(BATCH_SIZE, "1")); createIgniteClient(tableName, igniteIPs); LOG.info( "" + this + ":" + "\n\tBATCH_SIZE = " + batchSize + "\n\tINSERT_ASYNC = " +asyncInsert); }
Source:
private static long getSliceArrayRetainedSizeInBytes(Slice[] values) { long sizeInBytes = SizeOf.sizeOf(values); Map<Object, Boolean> uniqueRetained = new IdentityHashMap<>(values.length); for (Slice value : values) { if (value != null && value.getBase() != null && uniqueRetained.put(value.getBase(), true) == null) { sizeInBytes += value.getRetainedSize(); } } return sizeInBytes; }

Target:
private static long getSliceArrayRetainedSizeInBytes(Slice[] values) { long sizeInBytes = sizeOf(values); Map<Object, Boolean> uniqueRetained = new IdentityHashMap<>(values.length); for (Slice value : values) { if (value == null) { continue; } if (value.getBase() != null && uniqueRetained.put(value.getBase(), true) == null) { sizeInBytes += value.getRetainedSize(); } } return sizeInBytes; }
Source:
public void writeInstalled() { record.setStatus(ApplicationRecord.STATUS_INSTALLED); record.setUniqueId(getUniqueId()); record.setDisplayName(getDisplayName()); record.setResourcesStatus(areResourcesValidated()); record.setPreMultipleAppsProfile(checkFromOldProfile()); try { CommCareApplication._().getGlobalStorage(ApplicationRecord.class).write(record); } catch (StorageFullException e) { throw new RuntimeException(e); } }

Target:
public void writeInstalled() { record.setStatus(ApplicationRecord.STATUS_INSTALLED); record.setResourcesStatus(areMMResourcesValidated()); record.setPropertiesFromProfile(getCommCarePlatform().getCurrentProfile()); try { CommCareApplication._().getGlobalStorage(ApplicationRecord.class).write(record); } catch (StorageFullException e) { throw new RuntimeException(e); } }
Source:
public boolean isValidBackupDir(File keyspaceDir, File columnFamilyDir, File backupDir) { if (!backupDir.isDirectory() && !backupDir.exists()) return false; String keyspaceName = keyspaceDir.getName(); if (FILTER_KEYSPACE.contains(keyspaceName)) { logger.debug(keyspaceName + " is not consider a valid keyspace backup directory, will be bypass."); return false; } String dirName = columnFamilyDir.getName(); String columnFamilyName = dirName.split("-")[0]; if (FILTER_COLUMN_FAMILY.containsKey(keyspaceName) && FILTER_COLUMN_FAMILY.get(keyspaceName).contains(columnFamilyName)) { logger.debug(dirName + " is not consider a valid CF backup directory, will be bypass."); return false; } return true; }

Target:
public boolean isValidBackupDir(File keyspaceDir, File columnFamilyDir, File backupDir) { if (!backupDir.isDirectory() && !backupDir.exists()) return false; String keyspaceName = keyspaceDir.getName(); if (FILTER_KEYSPACE.contains(keyspaceName)) { logger.debug(keyspaceName + " is not consider a valid keyspace backup directory, will be bypass."); return false; } String columnFamilyName = columnFamilyDir.getName(); if (FILTER_COLUMN_FAMILY.containsKey(keyspaceName) && FILTER_COLUMN_FAMILY.get(keyspaceName).contains(columnFamilyName)) { logger.debug(columnFamilyName + " is not consider a valid CF backup directory, will be bypass."); return false; } return true; }
Source:
public void onAppendColumnEvent() { AppendColumnEvent event = new AppendColumnEvent(COLUMN_GROUP); scenarioSimulationEventHandler.onEvent(event); verify(scenarioSimulationEventHandler, times(1)).commonExecution(eq(scenarioSimulationContextLocal), isA(AppendColumnCommand.class)); verify(scenarioGridPanelMock).setFocus(true); }

Target:
public void onAppendColumnEvent() { AppendColumnEvent event = new AppendColumnEvent(COLUMN_GROUP); scenarioSimulationEventHandler.onEvent(event); verify(scenarioSimulationEventHandler).commonExecution(eq(scenarioSimulationContextLocal), isA(AppendColumnCommand.class), eq(true)); }
Source:
void queueViewPortChange( @NotNull String path, @Nullable Editor editor, @Nullable LineRange range, @Nullable TextSelection selection) { QueuedViewPortChange requestedViewportChange = new QueuedViewPortChange(editor, range, selection); QueuedViewPortChange previouslyQueuedRequest = queuedViewPortChanges.put(path, requestedViewportChange); if (previouslyQueuedRequest != null) { if (log.isTraceEnabled()) { log.trace( "Dropping previously queued viewport change request for " + path + "; old request: " + previouslyQueuedRequest + ", new request: " + requestedViewportChange); } } }

Target:
void queueViewPortChange( @NotNull String path, @Nullable Editor editor, @Nullable LineRange range, @Nullable TextSelection selection) { QueuedViewPortChange requestedViewportChange = new QueuedViewPortChange(editor, range, selection); queuedViewPortChanges.put(path, requestedViewportChange); }
Source:
public Laplace(List params) { if (params.size() == 0) { fixedMean = false; fixedDiversity = false; } else if (params.size() == 1) { fixedMean = false; fixedDiversity = true; setDiversity(params.get(0)); } else if (params.size() == 2) { fixedMean = true; setMean(params.get(0)); fixedDiversity = true; setDiversity(params.get(1)); } else { throw new IllegalArgumentException( "Laplace CPD expects at most 2 parameters, not " + params.size()); } }

Target:
public Laplace(List params) { if (params.size() == 0) { expectMeanAsArg = true; expectDiversityAsArg = true; } else if (params.size() == 1) { expectMeanAsArg = false; expectDiversityAsArg = true; initParams(params); expectMeanAsArg = true; expectDiversityAsArg = false; } else if (params.size() == 2) { expectMeanAsArg = true; expectDiversityAsArg = true; initParams(params); expectMeanAsArg = false; expectDiversityAsArg = false; } else { throw new IllegalArgumentException( "Laplace CPD expects at most 2 parameters, not " + params.size()); } }
Source:
public static MaxAttemptsBuilder builder() { return new MaxAttemptsBuilder(DEFAULT_THREAD_SLEEP); }

Target:
public static MaxAttemptsBuilder builder() { return builder(DEFAULT_THREAD_SLEEP); }
Source:
private static FileMetrics metrics(String fileName) { File baseDir = new File("src/test/resources/metrics/"); File file = new File(baseDir, fileName); String fileContent; try { fileContent = Files.toString(file, StandardCharsets.UTF_8); } catch (IOException e) { throw new IllegalStateException(e); } PyFile pyFile = new org.sonar.python.frontend.PythonParser().parse(fileContent); return new FileMetrics(TestPythonVisitorRunner.createContext(file), true, pyFile); }

Target:
private static FileMetrics metrics(String fileName) { File baseDir = new File("src/test/resources/metrics/"); File file = new File(baseDir, fileName); return new FileMetrics(TestPythonVisitorRunner.createContext(file), true, PythonParser.parse(file)); }
Source:
@Test public void testListSavedSearches() { Service service = connect(); SavedSearchCollectionArgs ascArgs = new SavedSearchCollectionArgs(); ascArgs.setSortDir(SortDir.ASC); SavedSearchCollection savedSearchesAsc = service.getSavedSearches(ascArgs); List<String> savedSearchNamesAsc = new ArrayList<String>(savedSearchesAsc.keySet()); SavedSearchCollectionArgs descArgs = new SavedSearchCollectionArgs(); descArgs.setSortDir(SortDir.DESC); SavedSearchCollection savedSearchesDesc = service.getSavedSearches(descArgs); List<String> savedSearchNamesDesc = new ArrayList<String>(savedSearchesDesc.keySet()); List<String> savedSearchNamesDescReversed = savedSearchNamesDesc; Collections.reverse(savedSearchNamesDescReversed); assertEquals(savedSearchNamesAsc, savedSearchNamesDescReversed); }

Target:
@Test public void testListSavedSearches() { Service service = connect(); SavedSearchCollectionArgs ascArgs = new SavedSearchCollectionArgs(); ascArgs.setSortDirection(CollectionArgs.SortDirection.ASC); SavedSearchCollection savedSearchesAsc = service.getSavedSearches(ascArgs); List<String> savedSearchNamesAsc = new ArrayList<String>(savedSearchesAsc.keySet()); SavedSearchCollectionArgs descArgs = new SavedSearchCollectionArgs(); descArgs.setSortDirection(CollectionArgs.SortDirection.DESC); SavedSearchCollection savedSearchesDesc = service.getSavedSearches(descArgs); List<String> savedSearchNamesDesc = new ArrayList<String>(savedSearchesDesc.keySet()); List<String> savedSearchNamesDescReversed = savedSearchNamesDesc; Collections.reverse(savedSearchNamesDescReversed); assertEquals(savedSearchNamesAsc, savedSearchNamesDescReversed); }
Source:
public boolean calculateIsFailure() { int randomValue = random.nextInt(100) + 1; return randomValue <= errorPct; }

Target:
public boolean calculateIsFailure() { int randomValue = random.nextInt(100); return randomValue < errorPercent; }
Source:
public static TitleMessage[] fromTitle(Title title) { TextMessage titleMessage = title.getTitle() != null ? asTextMessage(BaseComponent.toLegacyText(title.getTitle())) : asTextMessage(null); TextMessage subTitleMessage = title.getSubtitle() != null ? asTextMessage(BaseComponent.toLegacyText(title.getSubtitle())) : asTextMessage(null); return new TitleMessage[]{ new TitleMessage(Action.TITLE, titleMessage), new TitleMessage(Action.SUBTITLE, subTitleMessage), new TitleMessage(Action.TIMES, title.getFadeIn(), title.getStay(), title.getFadeOut()) }; }

Target:
public static TitleMessage[] fromTitle(Title title) { TextMessage titleMessage = asTextMessage(BaseComponent.toLegacyText(title.getTitle())); TextMessage subTitleMessage = title.getSubtitle() != null ? asTextMessage(BaseComponent.toLegacyText(title.getSubtitle())) : asTextMessage(null); return new TitleMessage[]{ new TitleMessage(Action.TITLE, titleMessage), new TitleMessage(Action.SUBTITLE, subTitleMessage), new TitleMessage(Action.TIMES, title.getFadeIn(), title.getStay(), title.getFadeOut()) }; }
Source:
public void markCanBeCompleted(Long id) { completedOperationIds.offer(id); if (this.isFlushing.get() && completedOperationIds.size() == pendingOperationsWithSize.size()) { synchronized (this) { notify(); } } }

Target:
public void markCanBeCompleted(Long id) { completedOperationIds.offer(id); int inflightOperationCount = pendingOperationCount.decrementAndGet(); if (this.isFlushing.get() && inflightOperationCount <= 0) { int count = 0; synchronized (pendingOperationsWithSize) { cleanupFinishedOperations(); count = pendingOperationsWithSize.size(); } if (count == 0) { synchronized (this) { notifyAll(); } } } }
Source:
public void runMultipleActions(final List<VdcActionType> actionTypes, final List<VdcActionParametersBase> parameters, final List<IFrontendActionAsyncCallback> callbacks, final IFrontendActionAsyncCallback failureCallback, final Object state) { runMultipleActions(actionTypes, parameters, callbacks, failureCallback, state, false, null, null); }

Target:
public void runMultipleActions(final List<VdcActionType> actionTypes, final List<VdcActionParametersBase> parameters, final List<IFrontendActionAsyncCallback> callbacks, final IFrontendActionAsyncCallback failureCallback, final Object state) { runMultipleActions(actionTypes, parameters, callbacks, failureCallback, state, false); }
Source:
public FileBasedConfig openSystemConfig(Config parent, FS fs) { if (systemConfig.get() == null) { systemConfig.compareAndSet(null, createSystemConfig(parent, fs)); } return systemConfig.get(); }

Target:
public FileBasedConfig openSystemConfig(Config parent, FS fs) { FileBasedConfig c = systemConfig.get(); if (c == null) { systemConfig.compareAndSet(null, createSystemConfig(parent, fs)); c = systemConfig.get(); } return c; }
Source:
private EventTypeStatistics validateStatisticsUpdate( final EventTypeStatistics existing, final EventTypeStatistics newStatistics) throws InvalidEventTypeException { if (existing != null && newStatistics == null) { return existing; } if (!Objects.equals(existing, newStatistics)) { throw new InvalidEventTypeException("default statistics must not be changed"); } return newStatistics; }

Target:
private void validateStatisticsUpdate( final EventTypeStatistics existing, final EventTypeStatistics newStatistics) throws InvalidEventTypeException { if (!Objects.equals(existing, newStatistics)) { throw new InvalidEventTypeException("default statistics must not be changed"); } }
Source:
public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + ((fDefinition == null) ? 0 : fDefinition.hashCode()); return result; }

Target:
public int hashCode() { final int prime = 31; int result = super.hashCode(); result = prime * result + ((fDefinition == null) ? 0 : fDefinition.hashCode()); result = prime * result + ((customEventTimestamp == null) ? 0 : customEventTimestamp.hashCode()); result = prime * result + ((customEventContent == null) ? 0 : customEventContent.hashCode()); result = prime * result + ((customEventType == null) ? 0 : customEventType.hashCode()); return result; }
Source:
public CompletionStage<KairosQuery> queryMetrics(final MetricsQuery query) { try { final HttpRequest request = HttpRequest.POST(createUri(METRICS_QUERY_PATH)) .withEntity(ContentTypes.APPLICATION_JSON, _mapper.writeValueAsString(query)); return fireRequest(request, MetricsQueryResponse.class) .thenApply(response -> new KairosQuery.Builder().setRequest(query).setResponse(response).build()); } catch (final JsonProcessingException e) { throw new RuntimeException(e); } }

Target:
public CompletionStage<MetricsQueryResponse> queryMetrics(final MetricsQuery query) { try { final HttpRequest request = HttpRequest.POST(createUri(METRICS_QUERY_PATH).toString()) .withEntity(ContentTypes.APPLICATION_JSON, _mapper.writeValueAsString(query)); return fireRequest(request, MetricsQueryResponse.class); } catch (final JsonProcessingException e) { throw new RuntimeException(e); } }
Source:
private void doOreoLaunch(Context context, View v) { final LauncherApps launcherApps = (LauncherApps) context.getSystemService(Context.LAUNCHER_APPS_SERVICE); assert launcherApps != null; if (!launcherApps.hasShortcutHostPermission()) { return; } LauncherApps.ShortcutQuery query = new LauncherApps.ShortcutQuery(); query.setPackage(shortcutPojo.packageName); query.setShortcutIds(Collections.singletonList(shortcutPojo.getOreoId())); query.setQueryFlags(LauncherApps.ShortcutQuery.FLAG_MATCH_PINNED); List<UserHandle> userHandles = launcherApps.getProfiles(); for (UserHandle userHandle : userHandles) { List<ShortcutInfo> shortcuts = launcherApps.getShortcuts(query, userHandle); if (shortcuts != null && shortcuts.size() > 0 && shortcuts.get(0).isEnabled()) { launcherApps.startShortcut(shortcuts.get(0), v.getClipBounds(), null); return; } } }

Target:
private void doOreoLaunch(Context context, View v) { final LauncherApps launcherApps = (LauncherApps) context.getSystemService(Context.LAUNCHER_APPS_SERVICE); assert launcherApps != null; if (!launcherApps.hasShortcutHostPermission()) { Toast.makeText(context, context.getString(R.string.shortcuts_no_host_permission), Toast.LENGTH_LONG).show(); return; } LauncherApps.ShortcutQuery query = new LauncherApps.ShortcutQuery(); query.setPackage(shortcutPojo.packageName); query.setShortcutIds(Collections.singletonList(shortcutPojo.getOreoId())); query.setQueryFlags(LauncherApps.ShortcutQuery.FLAG_MATCH_PINNED); List<UserHandle> userHandles = launcherApps.getProfiles(); for (UserHandle userHandle : userHandles) { List<ShortcutInfo> shortcuts = launcherApps.getShortcuts(query, userHandle); if (shortcuts != null && shortcuts.size() > 0 && shortcuts.get(0).isEnabled()) { launcherApps.startShortcut(shortcuts.get(0), v.getClipBounds(), null); return; } } Toast.makeText(context, R.string.application_not_found, Toast.LENGTH_LONG).show(); }
Source:
public static void restoreIndex(final File file, final String alias, String index, final boolean clear) throws DotDataException { if(LicenseUtil.getLevel() >= LicenseLevel.STANDARD.level) { if(UtilMethods.isSet(alias)) { String indexName=APILocator.getESIndexAPI() .getAliasToIndexMap(APILocator.getSiteSearchAPI().listIndices()) .get(alias); if(UtilMethods.isSet(indexName)) index=indexName; } else if(!UtilMethods.isSet(index)) { index=APILocator.getIndiciesAPI().loadIndicies().site_search; } } if(UtilMethods.isSet(index)) { final String indexToRestore=index; new Thread() { public void run() { try { if(clear) APILocator.getESIndexAPI().clearIndex(indexToRestore); APILocator.getESIndexAPI().restoreIndex(file, indexToRestore); Logger.info(this, "finished restoring index "+indexToRestore); } catch(Exception ex) { Logger.error(ESIndexResource.class, "Error restoring "+indexToRestore,ex); }finally { try { HibernateUtil.closeSession(); } catch (DotHibernateException e) { Logger.warn(this, e.getMessage(), e); } } } }.start(); } }

Target:
public static void restoreIndex(final File file, final String alias, String index, final boolean clear) throws DotDataException { if(LicenseUtil.getLevel() >= LicenseLevel.STANDARD.level) { if(UtilMethods.isSet(alias)) { String indexName=APILocator.getESIndexAPI() .getAliasToIndexMap(APILocator.getSiteSearchAPI().listIndices()) .get(alias); if(UtilMethods.isSet(indexName)) index=indexName; } else if(!UtilMethods.isSet(index)) { index=APILocator.getIndiciesAPI().loadIndicies().site_search; } } if(UtilMethods.isSet(index)) { final String indexToRestore=index; new Thread() { @CloseDBIfOpened public void run() { try { if(clear) APILocator.getESIndexAPI().clearIndex(indexToRestore); APILocator.getESIndexAPI().restoreIndex(file, indexToRestore); Logger.info(this, "finished restoring index "+indexToRestore); } catch(Exception ex) { Logger.error(ESIndexResource.class, "Error restoring "+indexToRestore,ex); } } }.start(); } }
Source:
public String getQualifiedName() { String name = getName(); if (getParent() == null) { return name == null ? "" : name; } if(name == null && this instanceof HaxeAnonymousType) { HaxeTypedefDeclaration typedefDecl = (HaxeTypedefDeclaration)(getParent().getParent()); if(typedefDecl != null) { name = typedefDecl.getName(); } } final String fileName = FileUtil.getNameWithoutExtension(getContainingFile().getName()); String packageName = HaxeResolveUtil.getPackageName(getContainingFile()); if (name != null && !packageName.isEmpty() && isAncillaryClass(name, fileName)) { packageName = HaxeResolveUtil.joinQName(packageName, fileName); } return HaxeResolveUtil.joinQName(packageName, name); }

Target:
public String getQualifiedName() { String name = getName(); if (getParent() == null) { return name == null ? "" : name; } if(name == null && this instanceof HaxeAnonymousType) { HaxeTypedefDeclaration typedefDecl = (HaxeTypedefDeclaration)(getParent().getParent()); if(typedefDecl != null) { name = typedefDecl.getName(); } } final String fileName = FileUtil.getNameWithoutExtension(getContainingFile().getName()); String packageName = HaxeResolveUtil.getPackageName(getContainingFile()); if (name != null && isAncillaryClass(packageName, name, fileName)) { packageName = HaxeResolveUtil.joinQName(packageName, fileName); } return HaxeResolveUtil.joinQName(packageName, name); }
Source:
private static void mutateRandomly(Connection conn, String tableName, int maxOrgId) { try { Statement stmt = conn.createStatement(); String sqlStr = "UPSERT INTO " + tableName + " VALUES(?, ?, ?, ?)"; PreparedStatement stmt = conn.prepareStatement(sqlStr); for (int i = 0; i < 10000; i++) { stmt.setString(1, getRandomOrgId(maxOrgId); stmt.setInt(2, i); stmt.setInt(3, i + 1); stmt.setInt(4, i + 2); stmt.executeUpdate(); } conn.commit(); } catch (Exception e) { LOG.error("Client side exception:" + e); } }

Target:
private static void mutateRandomly(Connection conn, String tableName, int maxOrgId) { try { String sqlStr = "UPSERT INTO " + tableName + " VALUES(?, ?, ?, ?)"; PreparedStatement stmt = conn.prepareStatement(sqlStr); for (int i = 0; i < 10000; i++) { stmt.setString(1, getRandomOrgId(maxOrgId)); stmt.setInt(2, i); stmt.setInt(3, i + 1); stmt.setInt(4, i + 2); stmt.executeUpdate(); } conn.commit(); } catch (Exception e) { LOGGER.error("Client side exception:" + e); } }