auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private int lockAndUnlockAndCountExceptions(List<LockService> lockServices, int numRequestsPerClient) throws Exception { ExecutorService executorService = Executors.newFixedThreadPool(lockServices.size() * numRequestsPerClient); Map<LockService, LockRefreshToken> tokenMap = new HashMap<>(); for (LockService service : lockServices) { LockRefreshToken token = service.lock(CLIENT_1, REQUEST_LOCK_WITH_LONG_TIMEOUT); assertNotNull(token); tokenMap.put(service, token); } List<Future<LockRefreshToken>> futures = Lists.newArrayList(); for (LockService lockService : lockServices) { for (int i = 0; i < numRequestsPerClient; i++) { int currentTrial = i; futures.add(executorService.submit(() -> lockService.lock(CLIENT_2 + String.valueOf(currentTrial), REQUEST_LOCK_WITH_LONG_TIMEOUT)) ); } } executorService.shutdown(); executorService.awaitTermination(2, TimeUnit.SECONDS); AtomicInteger exceptionCounter = new AtomicInteger(0); futures.forEach(future -> { try { LockRefreshToken test = future.get(); assertNull(test); } catch (ExecutionException e) { Throwable cause = e.getCause(); assertThat(cause.getClass().getName()).contains("RetryableException"); assertRemoteExceptionWithStatus(cause.getCause(), HttpStatus.TOO_MANY_REQUESTS_429); exceptionCounter.getAndIncrement(); } catch (InterruptedException e) { throw Throwables.propagate(e); } }); tokenMap.forEach((service, token) -> assertTrue(service.unlock(token))); return exceptionCounter.get(); }

Target:
private int lockAndUnlockAndCountExceptions(List<LockService> lockServices, int numRequestsPerClient) throws Exception { ExecutorService executorService = Executors.newFixedThreadPool(lockServices.size() * numRequestsPerClient); Map<LockService, LockRefreshToken> tokenMap = new HashMap<>(); for (LockService service : lockServices) { LockRefreshToken token = service.lock(CLIENT_1, REQUEST_LOCK_WITH_LONG_TIMEOUT); assertThat(token).isNotNull(); tokenMap.put(service, token); } List<Future<LockRefreshToken>> futures = Lists.newArrayList(); for (LockService lockService : lockServices) { for (int i = 0; i < numRequestsPerClient; i++) { int currentTrial = i; futures.add(executorService.submit(() -> lockService.lock(CLIENT_2 + String.valueOf(currentTrial), REQUEST_LOCK_WITH_LONG_TIMEOUT)) ); } } executorService.shutdown(); executorService.awaitTermination(2, TimeUnit.SECONDS); AtomicInteger exceptionCounter = new AtomicInteger(0); futures.forEach(future -> { try { assertThat(future.get()).isNull(); } catch (ExecutionException e) { Throwable cause = e.getCause(); assertThat(cause.getClass().getName()).contains("RetryableException"); assertRemoteExceptionWithStatus(cause.getCause(), HttpStatus.TOO_MANY_REQUESTS_429); exceptionCounter.getAndIncrement(); } catch (InterruptedException e) { throw Throwables.propagate(e); } }); tokenMap.forEach((service, token) -> assertThat(service.unlock(token)).isTrue()); return exceptionCounter.get(); }
Source:
private void updateData(OCShare share) { share.setPath(mPath); if (mPath.endsWith(FileUtils.PATH_SEPARATOR)) { share.setIsFolder(true); } else { share.setIsFolder(false); } share.setPermissions(READ_ONLY); getStorageManager().saveShare(share); OCFile file = getStorageManager().getFileByPath(mPath); if (file!=null) { file.setShareWithSharee(true); getStorageManager().saveFile(file); } }

Target:
private void updateData(OCShare share) { share.setPath(mPath); share.setIsFolder(mPath.endsWith(FileUtils.PATH_SEPARATOR)); share.setPermissions(READ_ONLY); getStorageManager().saveShare(share); OCFile file = getStorageManager().getFileByPath(mPath); if (file!=null) { file.setShareWithSharee(true); getStorageManager().saveFile(file); } }
Source:
public DbBenchmarkSuiteSupplier(Jdbi jdbi, BenchmarkSuiteConfig config) { this.jdbi = requireNonNull(jdbi, "jdbi is null"); this.suitesTableName = config.getSuitesTableName(); this.queriesTableName = config.getQueriesTableName(); this.suite = config.getSuite(); }

Target:
public DbBenchmarkSuiteSupplier(Jdbi jdbi, BenchmarkSuiteConfig config) { this.jdbi = requireNonNull(jdbi, "jdbi is null"); this.suitesTableName = requireNonNull(config.getSuitesTableName(), "suites-table-name is null"); this.queriesTableName = requireNonNull(config.getQueriesTableName(), "queries-table-name is null"); this.suite = requireNonNull(config.getSuite(), "suite name is null"); }
Source:
protected BlobHolder buildResult(List<String> cmdOutput, CmdParameters cmdParams) { try { return super.buildResult(cmdOutput, cmdParams); } finally { Path path = userInstallationDir.get(); if (path != null && Files.exists(path)) { try { FileUtils.deleteDirectory(path.toFile()); } catch (IOException e) { log.error(e); log.debug(e, e); } } } }

Target:
protected BlobHolder buildResult(List<String> cmdOutput, CmdParameters cmdParams) { try { return super.buildResult(cmdOutput, cmdParams); } finally { String userInstallationPath = cmdParams.getParameter(USER_INSTALLATION_PATH_KEY); if (userInstallationPath != null) { deleteTempDirectory(userInstallationPath); } } }
Source:
public void storeSettings() { preferencesService.storeEntryEditorPreferences(new EntryEditorPreferences( initialEntryEditorPreferences.getEntryEditorTabList(), openOnNewEntryProperty.getValue(), enableRelatedArticlesTabProperty.getValue(), acceptRecommendationsProperty.getValue(), enableLatexCitationsTabProperty.getValue(), defaultSourceProperty.getValue(), enableValidationProperty.getValue())); AutoCompletePreferences.NameFormat nameFormat = AutoCompletePreferences.NameFormat.BOTH; if (autoCompleteFirstLastProperty.getValue()) { nameFormat = AutoCompletePreferences.NameFormat.FIRST_LAST; } else if (autoCompleteLastFirstProperty.getValue()) { nameFormat = AutoCompletePreferences.NameFormat.LAST_FIRST; } AutoCompleteFirstNameMode firstNameMode = AutoCompleteFirstNameMode.BOTH; if (firstNameModeAbbreviatedProperty.getValue()) { firstNameMode = AutoCompleteFirstNameMode.ONLY_ABBREVIATED; } else if (firstNameModeFullProperty.getValue()) { firstNameMode = AutoCompleteFirstNameMode.ONLY_FULL; } if(initialAutoCompletePreferences.shouldAutoComplete()!=enableAutoCompleteProperty.getValue()){ if(enableAutoCompleteProperty.getValue()){ restartWarnings.add(Localization.lang("Auto complete enabled.")); }else{ restartWarnings.add(Localization.lang("Auto complete disabled.")); } } preferencesService.storeAutoCompletePreferences(new AutoCompletePreferences( enableAutoCompleteProperty.getValue(), firstNameMode, nameFormat, FieldFactory.parseFieldList(autoCompleteFieldsProperty.getValue()), preferencesService.getJournalAbbreviationPreferences())); }

Target:
public void storeSettings() { preferencesService.storeEntryEditorPreferences(new EntryEditorPreferences( initialEntryEditorPreferences.getEntryEditorTabList(), openOnNewEntryProperty.getValue(), enableRelatedArticlesTabProperty.getValue(), acceptRecommendationsProperty.getValue(), enableLatexCitationsTabProperty.getValue(), defaultSourceProperty.getValue(), enableValidationProperty.getValue())); AutoCompletePreferences.NameFormat nameFormat = AutoCompletePreferences.NameFormat.BOTH; if (autoCompleteFirstLastProperty.getValue()) { nameFormat = AutoCompletePreferences.NameFormat.FIRST_LAST; } else if (autoCompleteLastFirstProperty.getValue()) { nameFormat = AutoCompletePreferences.NameFormat.LAST_FIRST; } AutoCompleteFirstNameMode firstNameMode = AutoCompleteFirstNameMode.BOTH; if (firstNameModeAbbreviatedProperty.getValue()) { firstNameMode = AutoCompleteFirstNameMode.ONLY_ABBREVIATED; } else if (firstNameModeFullProperty.getValue()) { firstNameMode = AutoCompleteFirstNameMode.ONLY_FULL; } if (initialAutoCompletePreferences.shouldAutoComplete() != enableAutoCompleteProperty.getValue()) { if (enableAutoCompleteProperty.getValue()) { restartWarnings.add(Localization.lang("Auto complete enable.")); } else { restartWarnings.add(Localization.lang("Auto complete disable.")); } } preferencesService.storeAutoCompletePreferences(new AutoCompletePreferences( enableAutoCompleteProperty.getValue(), firstNameMode, nameFormat, FieldFactory.parseFieldList(autoCompleteFieldsProperty.getValue()), preferencesService.getJournalAbbreviationPreferences())); }
Source:
public static Test suite() { return new TestSuite(TextViewerUndoManagerTest.class); }

Target:
public static Test suite() { return new TestSuite(TextViewerTest.class); }
Source:
public OnkyoConnection(String serialPortName) { this.serialPortName = serialPortName; connection = (EiscpInterface)new EiscpSerial(serialPortName); }

Target:
public OnkyoConnection(String serialPortName) { this.serialPortName = serialPortName; connection = new EiscpSerial(serialPortName); }
Source:
public Builder<ExecutorFactoryConfiguration> configure(OperationContext context, ModelNode model) throws OperationFailedException { int maxThreads = this.definition.getMaxThreads().resolveModelAttribute(context, model).asInt(); int minThreads = this.definition.getMinThreads().resolveModelAttribute(context, model).asInt(); int queueLength = this.definition.getQueueLength().resolveModelAttribute(context, model).asInt(); long keepAliveTime = this.definition.getKeepAliveTime().resolveModelAttribute(context, model).asLong(); ExecutorFactory factory = new DefaultAsyncExecutorFactory() { @Override public ExecutorService getExecutor(Properties p) { ThreadFactory clThreadFactory = new ClassLoaderThreadFactory(runnable -> { Thread thread = new Thread(runnable, THREAD_NAME + "-" + counter.getAndIncrement()); thread.setDaemon(true); return thread; }, AccessController.doPrivileged((PrivilegedAction<ClassLoader>) ClassLoaderThreadFactory.class::getClassLoader)); return new ThreadPoolExecutor(minThreads, maxThreads, keepAliveTime, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(queueLength), clThreadFactory); } }; this.builder.factory(factory); return this; }

Target:
public Builder<ExecutorFactoryConfiguration> configure(OperationContext context, ModelNode model) throws OperationFailedException { int maxThreads = this.definition.getMaxThreads().resolveModelAttribute(context, model).asInt(); int minThreads = this.definition.getMinThreads().resolveModelAttribute(context, model).asInt(); int queueLength = this.definition.getQueueLength().resolveModelAttribute(context, model).asInt(); long keepAliveTime = this.definition.getKeepAliveTime().resolveModelAttribute(context, model).asLong(); ExecutorFactory factory = properties -> { ThreadFactory clThreadFactory = new ClassLoaderThreadFactory(runnable -> { Thread thread = new Thread(runnable, DefaultAsyncExecutorFactory.THREAD_NAME + "-" + DefaultAsyncExecutorFactory.counter.getAndIncrement()); thread.setDaemon(true); return thread; }, AccessController.doPrivileged((PrivilegedAction<ClassLoader>) ClassLoaderThreadFactory.class::getClassLoader)); return new ThreadPoolExecutor(minThreads, maxThreads, keepAliveTime, TimeUnit.MILLISECONDS, new LinkedBlockingQueue<>(queueLength), clThreadFactory); }; this.builder.factory(factory); return this; }
Source:
private RevCommit doSquashFixup(boolean isSquash, RevCommit commitToPick, RebaseTodoLine nextStep, File messageFixup, File messageSquash) throws IOException, GitAPIException { if (!messageSquash.exists()) { ObjectId headId = repo.resolve(Constants.HEAD); RevCommit previousCommit = walk.parseCommit(headId); initializeSquashFixupFile(MESSAGE_SQUASH, previousCommit.getFullMessage()); if (!isSquash) initializeSquashFixupFile(MESSAGE_FIXUP, previousCommit.getFullMessage()); } String currSquashMessage = rebaseState .readFile(MESSAGE_SQUASH); int count = parseSquashFixupSequenceCount(currSquashMessage) + 1; String content = composeSquashMessage(isSquash, commitToPick, currSquashMessage, count); rebaseState.createFile(MESSAGE_SQUASH, content); if (messageFixup.exists()) { rebaseState.createFile(MESSAGE_FIXUP, content); } return squashIntoPrevious( !messageFixup.exists(), nextStep); }

Target:
private RevCommit doSquashFixup(boolean isSquash, RevCommit commitToPick, RebaseTodoLine nextStep, File messageFixup, File messageSquash) throws IOException, GitAPIException { if (!messageSquash.exists()) { ObjectId headId = repo.resolve(Constants.HEAD); RevCommit previousCommit = walk.parseCommit(headId); initializeSquashFixupFile(MESSAGE_SQUASH, previousCommit.getFullMessage()); if (!isSquash) initializeSquashFixupFile(MESSAGE_FIXUP, previousCommit.getFullMessage()); } String currSquashMessage = rebaseState .readFile(MESSAGE_SQUASH); int count = parseSquashFixupSequenceCount(currSquashMessage) + 1; String content = composeSquashMessage(isSquash, commitToPick, currSquashMessage, count); rebaseState.createFile(MESSAGE_SQUASH, content); if (messageFixup.exists()) rebaseState.createFile(MESSAGE_FIXUP, content); return squashIntoPrevious( !messageFixup.exists(), nextStep); }
Source:
public void updateInstanceMaxUsage(Map<String, Double> maxUsageMap) { for (Map.Entry<String, Double> entry : maxUsageMap.entrySet()) { InstanceMonitor monitor = _instanceMonitorMap.get(entry.getKey()); if (monitor == null || !monitor.isRegister()) { LOG.warn("Failed to update max usage because instance monitor is not found, instance: {}.", entry.getKey()); continue; } monitor.updateMaxCapacityUsage(entry.getValue()); } }

Target:
public void updateInstanceMaxUsage(Map<String, Double> maxUsageMap) { synchronized (_instanceMonitorMap) { for (Map.Entry<String, Double> entry : maxUsageMap.entrySet()) { InstanceMonitor monitor = _instanceMonitorMap.get(entry.getKey()); if (monitor == null) { LOG.warn("Failed to update max usage because instance monitor is not found, instance: {}.", entry.getKey()); continue; } monitor.updateMaxCapacityUsage(entry.getValue()); } } }
Source:
public static SandboxedInstance createSandboxedInstance(RuntimeInfo runtimeInfo, ClassLoader parentClassLoader, boolean useCurrentJvmProperties) { if (runtimeInfo.getRuntimeClassName() == null) { throw new IllegalArgumentException("classToInstantiate should not be null"); } if (classLoaderCache.containsKey(runtimeInfo) && classLoaderCache.get(runtimeInfo) != null) { return new SandboxedInstance(runtimeInfo.getRuntimeClassName(), useCurrentJvmProperties, classLoaderCache.get(runtimeInfo)); } else { ClassLoader sandboxClassLoader = new URLClassLoader( runtimeInfo.getMavenUrlDependencies().toArray(new URL[runtimeInfo.getMavenUrlDependencies().size()]), parentClassLoader); classLoaderCache.put(runtimeInfo, sandboxClassLoader); return new SandboxedInstance(runtimeInfo.getRuntimeClassName(), useCurrentJvmProperties, sandboxClassLoader); } }

Target:
public static SandboxedInstance createSandboxedInstance(RuntimeInfo runtimeInfo, ClassLoader parentClassLoader, boolean useCurrentJvmProperties) { if (runtimeInfo.getRuntimeClassName() == null) { throw new IllegalArgumentException("classToInstantiate should not be null"); } synchronized (classLoaderCache) { if (classLoaderCache.containsKey(runtimeInfo) && classLoaderCache.get(runtimeInfo) != null) { return new SandboxedInstance(runtimeInfo.getRuntimeClassName(), useCurrentJvmProperties, classLoaderCache.get(runtimeInfo)); } else { ClassLoader sandboxClassLoader = new URLClassLoader( runtimeInfo.getMavenUrlDependencies().toArray(new URL[runtimeInfo.getMavenUrlDependencies().size()]), parentClassLoader) { @Override public void close() throws IOException { super.close(); ClassLoaderIsolatedSystemProperties.getInstance().stopIsolateClassLoader(this); } }; classLoaderCache.put(runtimeInfo, sandboxClassLoader); return new SandboxedInstance(runtimeInfo.getRuntimeClassName(), useCurrentJvmProperties, sandboxClassLoader); } } }
Source:
public static void createIndex(final SeekableStream in, final OutputStream out, final long granularity) throws IOException { long recordStart = SAMUtils.findVirtualOffsetOfFirstRecordInBam(in); try (BlockCompressedInputStream blockIn = new BlockCompressedInputStream(in)) { blockIn.seek(recordStart); final ByteBuffer byteBuffer = ByteBuffer.allocate(4).order(ByteOrder.LITTLE_ENDIAN); SBIIndexWriter indexWriter = new SBIIndexWriter(out, granularity); while (true) { try { recordStart = blockIn.getFilePointer(); InputStreamUtils.readFully(blockIn, byteBuffer.array(), 0, 4); final int blockSize = byteBuffer.getInt(0); indexWriter.processRecord(recordStart); InputStreamUtils.skipFully(blockIn, blockSize); } catch (EOFException e) { break; } } indexWriter.finish(recordStart, in.length()); } }

Target:
public static void createIndex(final SeekableStream in, final OutputStream out, final long granularity) throws IOException { long recordStart = SAMUtils.findVirtualOffsetOfFirstRecordInBam(in); try (BlockCompressedInputStream blockIn = new BlockCompressedInputStream(in)) { blockIn.seek(recordStart); final ByteBuffer byteBuffer = ByteBuffer.allocate(4).order(ByteOrder.LITTLE_ENDIAN); final SBIIndexWriter indexWriter = new SBIIndexWriter(out, granularity); while (true) { try { recordStart = blockIn.getFilePointer(); InputStreamUtils.readFully(blockIn, byteBuffer.array(), 0, 4); final int blockSize = byteBuffer.getInt(0); indexWriter.processRecord(recordStart); InputStreamUtils.skipFully(blockIn, blockSize); } catch (EOFException e) { break; } } indexWriter.finish(recordStart, in.length()); } }
Source:
public void testRefLocation() throws Exception { File repository = new File(verifier.getBasedir(), "target/repository"); assertThat(new File(repository, "content.xml"), isFile()); File artifactXml = new File(repository, "artifacts.xml"); assertThat(artifactXml, isFile()); assertThat(new File(repository, "category.xml"), isFile()); Map<String, String> expected = new HashMap<>(3, 1.f); expected.put("p2.statsURI", "<LINK_0>"); expected.put("p2.mirrorsURL", "<LINK_0>.else"); expected.put("foo", "bar"); Document artifactsDocument = XMLParser.parse(artifactXml); artifactsDocument.getChild("repository").getChild("properties").getChildren("property").forEach(element -> { String propertyName = element.getAttributeValue("name"); if (expected.containsKey(propertyName) && expected.get(propertyName).equals(element.getAttributeValue("value"))) { expected.remove(propertyName); } }); assertEquals("Missing properties in artifact repository", Collections.emptyMap(), expected); }

Target:
public void testRefLocation() throws Exception { File repository = new File(verifier.getBasedir(), "target/repository"); assertThat(new File(repository, "content.xml"), isFile()); File artifactXml = new File(repository, "artifacts.xml"); assertThat(artifactXml, isFile()); assertThat(new File(repository, "category.xml"), isFile()); Map<String, String> expected = new HashMap<>(2, 1.f); expected.put("<LINK_0>", "false"); expected.put("<LINK_0>.else", "true"); Document artifactsDocument = XMLParser.parse(artifactXml); artifactsDocument.getChild("repository").getChild("repository-references").getChildren("repository-reference") .forEach(element -> { String location = element.getAttributeValue("location"); if (expected.containsKey(location) && expected.get(location).equals(element.getAttributeValue("enabled"))) { expected.remove(location); } else { fail("Unexpected repository-reference in artifact repository " + element); } }); assertEquals("Missing repository-reference in artifact repository", Collections.emptyMap(), expected); }
Source:
public void run() { Logging.putPrefix(Syslogd.LOG4J_CATEGORY); SimpleRegistry registry = new SimpleRegistry(); NettyComponent nettyComponent=new NettyComponent(); m_camel = new DefaultCamelContext(registry); m_camel.addComponent("netty", nettyComponent); try { m_camel.addRoutes(new RouteBuilder() { @Override public void configure() throws Exception { String from = String.format("netty:udp://%s:%s?sync=false&textline=true&receiveBufferSize=%d&connectTimeout=%d", InetAddressUtils.str(m_host), m_port, Integer.MAX_VALUE, SOCKET_TIMEOUT ); from(from) .process(new Processor() { @Override public void process(Exchange exchange) throws Exception { ChannelBuffer buffer = ChannelBuffers.copiedBuffer(exchange.getIn().getBody().toString().getBytes()); InetSocketAddress source = (InetSocketAddress)exchange.getIn().getHeader(NettyConstants.NETTY_REMOTE_ADDRESS); SyslogConnection connection = new SyslogConnection(source.getAddress(), source.getPort(), buffer.toByteBuffer(), m_config); try { for (SyslogConnectionHandler handler : m_syslogConnectionHandlers) { handler.handleSyslogConnection(connection); } } catch (Throwable e) { LOG.error("Handler execution failed in {}", this.getClass().getSimpleName(), e); } } }); } }); m_camel.start(); } catch (Exception e) { LOG.error("Could not configure Camel routes for syslog receiver", e); } }

Target:
public void run() { Logging.putPrefix(Syslogd.LOG4J_CATEGORY); SimpleRegistry registry = new SimpleRegistry(); NettyComponent nettyComponent=new NettyComponent(); m_camel = new DefaultCamelContext(registry); m_camel.addComponent("netty", nettyComponent); try { m_camel.addRoutes(new RouteBuilder() { @Override public void configure() throws Exception { String from = String.format("netty:udp://%s:%s?sync=false&allowDefaultCodec=false&receiveBufferSize=%d&connectTimeout=%d", InetAddressUtils.str(m_host), m_port, Integer.MAX_VALUE, SOCKET_TIMEOUT ); from(from) .process(new Processor() { @Override public void process(Exchange exchange) throws Exception { ChannelBuffer buffer = exchange.getIn().getBody(ChannelBuffer.class); InetSocketAddress source = (InetSocketAddress)exchange.getIn().getHeader(NettyConstants.NETTY_REMOTE_ADDRESS); SyslogConnection connection = new SyslogConnection(source.getAddress(), source.getPort(), buffer.toByteBuffer(), m_config); try { for (SyslogConnectionHandler handler : m_syslogConnectionHandlers) { handler.handleSyslogConnection(connection); } } catch (Throwable e) { LOG.error("Handler execution failed in {}", this.getClass().getSimpleName(), e); } } }); } }); m_camel.start(); } catch (Exception e) { LOG.error("Could not configure Camel routes for syslog receiver", e); } }
Source:
protected Directory readIndexDirectory() throws IOException { Directory dir = new RAMDirectory(); byte[] buffer = new byte[BUFSIZ]; ZipInputStream zip = new ZipInputStream( DocQueryLucene.class.getClass().getResourceAsStream(INDEX_PATH)); ZipEntry entry; while ((entry = zip.getNextEntry()) != null) { IndexOutput out = dir.createOutput(entry.getName(), null); int count; while ((count = zip.read(buffer)) != -1) { out.writeBytes(buffer, count); } out.close(); } zip.close(); return dir; }

Target:
protected Directory readIndexDirectory() throws IOException { Directory dir = new RAMDirectory(); byte[] buffer = new byte[BUFSIZE]; ZipInputStream zip = new ZipInputStream( DocQueryLucene.class.getClass().getResourceAsStream(INDEX_PATH)); ZipEntry entry; while ((entry = zip.getNextEntry()) != null) { IndexOutput out = dir.createOutput(entry.getName(), null); int count; while ((count = zip.read(buffer)) != -1) { out.writeBytes(buffer, count); } out.close(); } zip.close(); return dir; }
Source:
protected void performAction() { extFormHandler.addFormHandlerFieldName(getNameTextField().getText().toLowerCase(), getValueField().getEditor().getItem().toString()); }

Target:
protected void performAction() { extFormHandler.addFormHandlerFieldName(getNameTextField().getText().toLowerCase(), getValueField().getSelectedItem().toString()); }
Source:
public RealmFCMPushNotifications getFSMPushNotifications() { return null; }

Target:
public RealmPushNotifications getFSMPushNotifications() { return null; }
Source:
public ServiceStatus getStatus(Coordinate coordinate) { String statusPath = ZkCoordinatePath.getStatusPath(coordinate); ZkStatusEndpoint statusEndpoint = new ZkStatusEndpoint(zk, statusPath); statusEndpoint.loadFromZooKeeper(); return statusEndpoint.getStatus(); }

Target:
public ServiceStatus getStatus(Coordinate coordinate) { String statusPath = ZkCoordinatePath.getStatusPath(coordinate); ZkStatusAndEndpoints statusAndEndpoints = new ZkStatusAndEndpoints.Builder(zk, statusPath).load().build(); return statusAndEndpoints.getServiceStatus(); }
Source:
public static FindPatientListener createFindPatientListener(String lastQuery, int searchId, FindPatientsSearchActivity caller) { try { URI uri = new URI(null,null,null,lastQuery); lastQuery = uri.toString().substring(1); }catch (Exception e){ e.printStackTrace(); } return new FindPatientListener(lastQuery, searchId, caller); }

Target:
public static FindPatientListener createFindPatientListener(String lastQuery, int searchId, FindPatientsSearchActivity caller) { try { lastQuery = URLEncoder.encode(lastQuery,"UTF-8").toString(); } catch (Exception exception) { mLogger.e(exception.toString()); } return new FindPatientListener(lastQuery, searchId, caller); }
Source:
public String getinternal_drive_mapping() { int mapping = disk.getInternalDriveMapping(); return (mapping != 0) ? Integer.toString(mapping) : null; }

Target:
public String getinternal_drive_mapping() { return Integer.toString(disk.getInternalDriveMapping()); }
Source:
public List<String> infixNotation() { final List<String> infix = new ArrayList<String>(); Tokenizer tokenizer = new Tokenizer(expression); while (tokenizer.hasNext()) { Token token = tokenizer.next(); StringBuilder sb = new StringBuilder(); sb.append("{") .append(token.type) .append(":") .append(token.surface) .append("}"); infix.add(sb.toString()); } return infix; }

Target:
public List<String> infixNotation() { final List<String> infix = new ArrayList<String>(); Tokenizer tokenizer = new Tokenizer(expression); while (tokenizer.hasNext()) { Token token = tokenizer.next(); String infixNotation = "{" + token.type + ":" + token.surface + "}"; infix.add(infixNotation); } return infix; }
Source:
<T, R> Collector<T, ?, R> createCollectorFor(Class<R> type) { for (CollectorFactory<?, ?, ?> factory : factories) { if (factory.accepts(type)) { return ((CollectorFactory<T, ?, R>) factory).newCollector(type); } } throw new IllegalStateException("No collector builder available for " + type.getName()); }

Target:
<T, R> Collector<T, ?, R> createCollectorFor(Class<R> type) { for (CollectorFactory<?, ?> factory : factories) { if (factory.accepts(type)) { return ((CollectorFactory<T, R>) factory).newCollector(type); } } throw new IllegalStateException("No collector builder available for " + type.getName()); }
Source:
private void copyResources(String file) throws IOException { ClassLoader classLoader = getClass().getClassLoader(); InputStream source = classLoader.getResourceAsStream("html/templates/" + file); File destination = new File(targetDir + File.separator + file); Files.copy(source, destination.toPath(), StandardCopyOption.REPLACE_EXISTING); }

Target:
private void copyResources(String file) throws IOException { ClassLoader classLoader = getClass().getClassLoader(); try (InputStream source = classLoader.getResourceAsStream("html/templates/" + file)) { File destination = new File(targetDir + File.separator + file); Files.copy(source, destination.toPath(), StandardCopyOption.REPLACE_EXISTING); } catch (Exception e) { log.error("Exception while copying resources", e); } }
Source:
public void setField(GeolocationField field) { this.field = field; if (this.field.isShowLabel()) { if (labelTextView != null) { labelTextView.setText(this.field.getLabel()); labelTextView.setVisibility(VISIBLE); } } else { if (labelTextView != null) { labelTextView.setVisibility(GONE); } } refresh(); }

Target:
public void setField(GeolocationField field) { this.field = field; if (labelTextView != null) { labelTextView.setVisibility(this.field.isShowLabel() ? VISIBLE : GONE); labelTextView.setText(this.field.getLabel()); } refresh(); }
Source:
public static boolean isSourceOfReplication(Database db) { if (db == null) { LOG.warn("db object passed is null. isSourceOfReplication is returning false"); return false; } String replPolicyIds = getReplPolicyIdString(db); return replPolicyIds != null && !replPolicyIds.isEmpty(); }

Target:
public static boolean isSourceOfReplication(Database db) { assert (db != null); String replPolicyIds = getReplPolicyIdString(db); return !StringUtils.isEmpty(replPolicyIds); }
Source:
public IAtsInsertion createInsertion(ArtifactId programArtifact, JaxNewInsertion newInsertion) { Long uuid = newInsertion.getUuid(); if (uuid == null || uuid <= 0) { uuid = Lib.generateArtifactIdAsInt(); } AtsChangeSet changes = (AtsChangeSet) atsServer.getStoreService().createAtsChangeSet("Create new Insertion", atsServer.getUserService().getCurrentUser()); ArtifactReadable insertionArt = (ArtifactReadable) changes.createArtifact(AtsArtifactTypes.Insertion, newInsertion.getName(), GUID.create(), uuid); changes.add(insertionArt); changes.relate(programArtifact, AtsRelationTypes.ProgramToInsertion_Insertion, insertionArt); changes.execute(); return getInsertion(insertionArt); }

Target:
public IAtsInsertion createInsertion(ArtifactId programArtifact, JaxNewInsertion newInsertion) { Long uuid = newInsertion.getUuid(); if (uuid == null || uuid <= 0) { uuid = Lib.generateArtifactIdAsInt(); } AtsChangeSet changes = (AtsChangeSet) atsServer.getStoreService().createAtsChangeSet("Create new Insertion", atsServer.getUserService().getCurrentUser()); ArtifactReadable insertionArt = (ArtifactReadable) changes.createArtifact(AtsArtifactTypes.Insertion, newInsertion.getName(), GUID.create(), uuid); changes.relate(programArtifact, AtsRelationTypes.ProgramToInsertion_Insertion, insertionArt); changes.execute(); return getInsertion(insertionArt); }
Source:
protected void start(BundleContext bundleContext) throws ConfigurationException { ConfigProvider configProvider = DataHolder.getInstance().getConfigProvider(); if (configProvider.getConfigurationObject(IdPClientConstants.SP_AUTH_NAMESPACE) == null) { DataHolder.getInstance().setInterceptorEnabled(true); DataHolder.getInstance().setExcludeURLList(new ArrayList<>()); } else { IdPClientConfiguration idPClientConfiguration = configProvider. getConfigurationObject(IdPClientConfiguration.class); String enableInterceptor = idPClientConfiguration.getProperties() .getOrDefault(IdPClientConstants.ENABLE_INTERCEPTOR, "true"); String exclude = idPClientConfiguration.getProperties().get(IdPClientConstants.EXCLUDE_INTERCEPTOR); Boolean isInterceptorEnabled = Boolean.parseBoolean(enableInterceptor); DataHolder.getInstance().setInterceptorEnabled(isInterceptorEnabled); List<String> excludeURLList = new ArrayList<>(); if (exclude != null) { excludeURLList = Arrays.stream(exclude.replaceAll("\\s*", "") .split(",")).collect(Collectors.toList()); } DataHolder.getInstance().setExcludeURLList(excludeURLList); } }

Target:
protected void start(BundleContext bundleContext) throws ConfigurationException { ConfigProvider configProvider = DataHolder.getInstance().getConfigProvider(); if (configProvider.getConfigurationObject(IdPClientConstants.SP_AUTH_NAMESPACE) == null) { DataHolder.getInstance().setInterceptorEnabled(true); DataHolder.getInstance().setExcludeURLList(new ArrayList<>()); } else { IdPClientConfiguration idPClientConfiguration = configProvider. getConfigurationObject(IdPClientConfiguration.class); String enableInterceptor = idPClientConfiguration.getProperties() .getOrDefault(IdPClientConstants.ENABLE_INTERCEPTOR, "true"); String exclude = idPClientConfiguration.getProperties().get(IdPClientConstants.EXCLUDE_INTERCEPTOR); Boolean isInterceptorEnabled = Boolean.parseBoolean(enableInterceptor); DataHolder.getInstance().setInterceptorEnabled(isInterceptorEnabled); List<String> excludeURLList = new ArrayList<>(); if (exclude != null) { excludeURLList = Arrays.asList(exclude.replaceAll("\\s*", "").split(",")); } DataHolder.getInstance().setExcludeURLList(excludeURLList); } }
Source:
private void performDownloads(final GoogleRobotCredentials credentials, final FilePath localDir, final DownloadSpec spec, final String version, final String resolvedPrefix) throws IOException { RepeatOperation<IOException> a = new RepeatOperation<IOException>() { private Queue<StorageObject> objects = new LinkedList<StorageObject>( spec.objects); Executor executor = module.newExecutor(); ; Storage service; public void initCredentials() throws IOException { service = module.getStorageService(credentials, version); } public boolean moreWork() { return !objects.isEmpty(); } public void act() throws IOException, InterruptedException, ExecutorException { StorageObject obj = objects.peek(); String addPath = StorageUtil .getStrippedFilename(obj.getName(), resolvedPrefix); FilePath localName = localDir.withSuffix("/" + addPath); performDownloadWithRetry(executor, service, obj, localName, module); objects.remove(); } }; try { RetryStorageOperation.performRequestWithReinitCredentials(a); } catch (ExecutorException e) { throw new IOException(Messages.Download_DownloadException(), e); } catch (InterruptedException e) { throw new IOException(Messages.Download_DownloadException(), e); } }

Target:
private void performDownloads(final GoogleRobotCredentials credentials, final FilePath localDir, final DownloadSpec spec, final String version, final String resolvedPrefix) throws IOException { RepeatOperation<IOException> a = new RepeatOperation<IOException>() { private Queue<StorageObject> objects = new LinkedList<StorageObject>( spec.objects); Executor executor = module.newExecutor(); Storage service; public void initCredentials() throws IOException { service = module.getStorageService(credentials, version); } public boolean moreWork() { return !objects.isEmpty(); } public void act() throws IOException, InterruptedException, ExecutorException { StorageObject obj = objects.peek(); String addPath = StorageUtil .getStrippedFilename(obj.getName(), resolvedPrefix); FilePath localName = localDir.withSuffix("/" + addPath); performDownloadWithRetry(executor, service, obj, localName, module); objects.remove(); } }; try { RetryStorageOperation.performRequestWithReinitCredentials(a); } catch (ExecutorException e) { throw new IOException(Messages.Download_DownloadException(), e); } catch (InterruptedException e) { throw new IOException(Messages.Download_DownloadException(), e); } }
Source:
public void updateMetrics(final Long vmId, final Long size, final Long virtualSize) { TransactionLegacy txn = TransactionLegacy.open(TransactionLegacy.USAGE_DB); try { SearchCriteria<UsageBackupVO> sc = this.createSearchCriteria(); sc.addAnd("vmId", SearchCriteria.Op.EQ, vmId); UsageBackupVO vo = findOneBy(sc); if (vo != null) { vo.setSize(size); vo.setProtectedSize(virtualSize); update(vo.getId(), vo); } } catch (final Exception e) { LOGGER.error("Error updating backup metrics: " + e.getMessage(), e); } finally { txn.close(); } }

Target:
public void updateMetrics(final Long vmId, final Long size, final Long virtualSize) { try (TransactionLegacy txn = TransactionLegacy.open(TransactionLegacy.USAGE_DB)) { SearchCriteria<UsageBackupVO> sc = this.createSearchCriteria(); sc.addAnd("vmId", SearchCriteria.Op.EQ, vmId); UsageBackupVO vo = findOneBy(sc); if (vo != null) { vo.setSize(size); vo.setProtectedSize(virtualSize); update(vo.getId(), vo); } } catch (final Exception e) { LOGGER.error("Error updating backup metrics: " + e.getMessage(), e); } }
Source:
private boolean hasEmptyLineBefore(DetailAST token) { boolean result = false; final int lineNo = token.getLineNo(); if (lineNo != 1) { final List<EnumSet<LineFlag>> flags = categorizeLines(); for (int i = lineNo - 2; i >= 0; i--) { final EnumSet<LineFlag> lineFlags = flags.get(i); if (!lineFlags.contains(LineFlag.COMMENT)) { if (lineFlags.contains(LineFlag.EMPTY)) { result = true; } if (lineFlags.contains(LineFlag.CODE)) { result = false; } break; } } } return result; }

Target:
private boolean hasEmptyLineBefore(DetailAST token) { boolean result = false; final int lineNo = token.getLineNo(); if (lineNo != 1) { final List<EnumSet<LineFlag>> flags = categorizeLines(); for (int i = lineNo - 2; i >= 0; i--) { final EnumSet<LineFlag> lineFlags = flags.get(i); if (!lineFlags.contains(LineFlag.COMMENT)) { if (lineFlags.contains(LineFlag.EMPTY)) { result = true; break; } } } } return result; }
Source:
private List<RuleEntry> getSortedEntries() { List<RuleEntry> ruleEntries = new ArrayList<RuleEntry>(); for (MethodRule rule : methodRules) { ruleEntries.add(new MethodRuleEntry(rule, orderValues.get(rule))); } for (TestRule rule : testRules) { ruleEntries.add(new TestRuleEntry(rule, orderValues.get(rule))); } Collections.sort(ruleEntries, ENTRY_COMPARATOR); return ruleEntries; }

Target:
private List<RuleEntry> getSortedEntries() { List<RuleEntry> ruleEntries = new ArrayList<RuleEntry>( methodRules.size() + testRules.size()); for (MethodRule rule : methodRules) { ruleEntries.add(new RuleEntry(rule, RuleEntry.TYPE_METHOD_RULE, orderValues.get(rule))); } for (TestRule rule : testRules) { ruleEntries.add(new RuleEntry(rule, RuleEntry.TYPE_TEST_RULE, orderValues.get(rule))); } Collections.sort(ruleEntries, ENTRY_COMPARATOR); return ruleEntries; }
Source:
public int compareTo(IntervalBase comparedInterval) { int res = getEnd().compareTo(comparedInterval.getEnd()); if (res == 0 && !this.equals(comparedInterval)) { res = -1; } return res; }

Target:
public int compareTo(IntervalBase comparedInterval) { int res = getEnd().compareTo(comparedInterval.getEnd()); if (res == 0 && !this.equals(comparedInterval)) { res = getStart().compareTo(comparedInterval.getStart()); if (res == 0) { res = getType().compareTo(comparedInterval.getType()) > 0 ? 1 : -1; } } return res; }
Source:
public Session create() throws Exception { JSch jsch = new JSch(); session = jsch .getSession(loginCredentials.getUser(), hostAndPort.getHostText(), hostAndPort.getPortOrDefault(22)); if (sessionTimeout != 0) session.setTimeout(sessionTimeout); if (loginCredentials.getPrivateKey() == null) { session.setPassword(loginCredentials.getPassword()); } else if (JschSshClient.hasValidPrivateKey(loginCredentials)) { byte[] privateKey = loginCredentials.getPrivateKey().getBytes(); jsch.addIdentity(loginCredentials.getUser(), privateKey, null, emptyPassPhrase); } else { Connector con = JschSshClient.getSSHAgentConnector(); if(con != null ){ IdentityRepository irepo = new RemoteIdentityRepository(con); jsch.setIdentityRepository(irepo); } } java.util.Properties config = new java.util.Properties(); config.put("StrictHostKeyChecking", "no"); session.setConfig(config); if (proxy.isPresent()) session.setProxy(proxy.get()); session.connect(connectTimeout); return session; }

Target:
public Session create() throws Exception { JSch jsch = new JSch(); session = jsch .getSession(loginCredentials.getUser(), hostAndPort.getHostText(), hostAndPort.getPortOrDefault(22)); if (sessionTimeout != 0) session.setTimeout(sessionTimeout); if (loginCredentials.getPrivateKey() == null) { session.setPassword(loginCredentials.getPassword()); } else if (loginCredentials.hasUnencryptedPrivateKey()) { byte[] privateKey = loginCredentials.getPrivateKey().getBytes(); jsch.addIdentity(loginCredentials.getUser(), privateKey, null, emptyPassPhrase); } else if (agentConnector.isPresent()) { JSch.setConfig("PreferredAuthentications", "publickey"); jsch.setIdentityRepository(new RemoteIdentityRepository(agentConnector.get())); } java.util.Properties config = new java.util.Properties(); config.put("StrictHostKeyChecking", "no"); session.setConfig(config); if (proxy.isPresent()) session.setProxy(proxy.get()); session.connect(connectTimeout); return session; }
Source:
private static Block asBlock(IBlock block) { Object internal = block.getDefinition().getInternal(); if (!(internal instanceof Block)) { CraftTweakerAPI.logError("Not a valid block: " + block); } return (Block) internal; }

Target:
private static Block asBlock(IBlock block) { Object internal = block.getDefinition().getInternal(); if (!(internal instanceof Block)) { CraftTweakerAPI.logError("Not a valid block: " + block); return null; } return (Block) internal; }
Source:
public boolean compareWithOther(Feed other) { if (super.compareWithOther(other)) { return true; } if (other.imageUrl != null) { if (imageUrl == null || !TextUtils.equals(imageUrl, other.imageUrl)) { return true; } } if (!TextUtils.equals(feedTitle, other.feedTitle)) { return true; } if (other.feedIdentifier != null) { if (feedIdentifier == null || !feedIdentifier.equals(other.feedIdentifier)) { return true; } } if (other.link != null) { if (link == null || !link.equals(other.link)) { return true; } } if (other.description != null) { if (description == null || !description.equals(other.description)) { return true; } } if (other.language != null) { if (language == null || !language.equals(other.language)) { return true; } } if (other.author != null) { if (author == null || !author.equals(other.author)) { return true; } } if (other.paymentLink != null) { if (paymentLink == null || !paymentLink.equals(other.paymentLink)) { return true; } } if (other.isPaged() && !this.isPaged()) { return true; } return !TextUtils.equals(other.getNextPageLink(), this.getNextPageLink()); }

Target:
public boolean compareWithOther(Feed other) { if (super.compareWithOther(other)) { return true; } if (other.imageUrl != null) { if (imageUrl == null || !TextUtils.equals(imageUrl, other.imageUrl)) { return true; } } if (!TextUtils.equals(feedTitle, other.feedTitle)) { return true; } if (other.feedIdentifier != null) { if (feedIdentifier == null || !feedIdentifier.equals(other.feedIdentifier)) { return true; } } if (other.link != null) { if (link == null || !link.equals(other.link)) { return true; } } if (other.description != null) { if (description == null || !description.equals(other.description)) { return true; } } if (other.language != null) { if (language == null || !language.equals(other.language)) { return true; } } if (other.author != null) { if (author == null || !author.equals(other.author)) { return true; } } if (other.paymentLink != null) { if (paymentLink == null || !paymentLink.equals(other.paymentLink)) { return true; } } if (other.isPaged() && !this.isPaged()) { return true; } if (!TextUtils.equals(other.getNextPageLink(), this.getNextPageLink())) { return true; } return false; }
Source:
public long calculateRelativeIndex(int index) { if (CHECK_BOUNDS && index > capacity) { throw new IndexOutOfBoundsException( "index " + index + " is out of bounds, capacity is " + capacity); } long relativeIndex; long mask; if (index >= twoRelativeIndex) { relativeIndex = twoReadIndex + (index - oneReadableBytes); mask = TWO_MASK; } else { relativeIndex = oneReadIndex + index; mask = ONE_MASK; } return relativeIndex | mask; }

Target:
long calculateRelativeIndex(int index) { checkIndex(index, 0); long relativeIndex; long mask; if (index >= twoRelativeIndex) { relativeIndex = twoReadIndex + (index - oneReadableBytes); mask = TWO_MASK; } else { relativeIndex = oneReadIndex + index; mask = ONE_MASK; } return relativeIndex | mask; }
Source:
public static IPSecEncryptionAlgorithm forValue(String v) { return valueOf(IPSecSiteConnection.convertFromIpsecString(v)); }

Target:
public static IPSecEncryptionAlgorithm forValue(String v) { return valueOf(IPSecSiteConnection.normalizeIpSecEnumString(v)); }
Source:
public void doNotKillProcessWithCookie() throws Exception { ProcessTree.enabled = true; SpawnBuilder spawner = new SpawnBuilder(); FreeStyleProject p = j.createFreeStyleProject(); p.getBuildersList().add(spawner); try { j.buildAndAssertSuccess(p); assertTrue("Process should be running", spawner.proc.isAlive()); } finally { spawner.proc.kill(); assertTrue("Process should be dead", !spawner.proc.isAlive()); } }

Target:
public void doNotKillProcessWithCookie() throws Exception { Assume.assumeFalse("This test does not involve windows", Functions.isWindows()); ProcessTree.enabled = true; SpawnBuilder spawner = new SpawnBuilder(); FreeStyleProject p = j.createFreeStyleProject(); p.getBuildersList().add(spawner); try { j.buildAndAssertSuccess(p); assertTrue("Process should be running", spawner.proc.isAlive()); } finally { spawner.proc.kill(); assertTrue("Process should be dead", !spawner.proc.isAlive()); } }
Source:
public KeyPair getKeyPair() throws NoSuchAlgorithmException { if (keyPairs.isEmpty()) { synchronized (keyPairs) { keyPairs.notify(); } } try { KeyPair keyPair = null; if (!future.isDone()) { keyPair = keyPairs.poll(loopTimeout * 3, timeUnit); if (keyPair == null) { LOGGER.warn("Background thread is still working but there is nothing in the queue."); keyPair = generateAndAddKeyPairs(); } } else { LOGGER.error("Background thread is dead so we generate key by ourselves."); keyPair = generateAndAddKeyPairs(); } return keyPair; } catch (InterruptedException e) { LOGGER.error(e); return generateAndAddKeyPairs(); } }

Target:
public KeyPair getKeyPair() throws NoSuchAlgorithmException { KeyPair keyPair = keyPairs.poll(); if (keyPair == null) { LOGGER.warn("Key pair queue is empty, generating a key pair now"); keyPair = generateAndAddKeyPairs(); } return keyPair; }
Source:
public void shouldConnectorMatchWithConnectorDefinition() throws IOException { processRuntime.start(ProcessPayloadBuilder.start() .withProcessDefinitionKey(CATEGORIZE_IMAGE_CONNECTORS_PROCESS) .withVariable("input-variable-name-1", "input-variable-name-1") .withVariable("input-variable-name-2", "input-variable-name-2") .withVariable("expectedKey", true) .build()); }

Target:
public void shouldConnectorMatchWithConnectorDefinition() { processRuntime.start(ProcessPayloadBuilder.start() .withProcessDefinitionKey(CATEGORIZE_IMAGE_CONNECTORS_PROCESS) .withVariable("input-variable-name-1", "input-variable-name-1") .withVariable("input-variable-name-2", "input-variable-name-2") .withVariable("expectedKey", true) .build()); }
Source:
public boolean deletePersonname() { if (selectedPersonname != null) { if (CollectionUtils.isNotEmpty(personnameList) && personnameList.size() > 1) { LOG.info("deleting-Personname"); return loadTestDataService.deletePersonname(selectedPersonname); } else { addPatientErrorMessages("Patient-personname cannot be empty: fail to delete the last record"); } } else { addPatientErrorMessages("Personname have to be select to be deleted"); } return false; }

Target:
public boolean deletePersonname() { boolean result = false; if (selectedPersonname != null) { if (CollectionUtils.isNotEmpty(personnameList) && personnameList.size() > 1) { LOG.info("deleting-Personname"); result = loadTestDataService.deletePersonname(selectedPersonname); } else { addPatientErrorMessages("Patient-personname cannot be empty: fail to delete the last record"); } } else { addPatientErrorMessages(msgForSelectDelete("additional-name")); } return result; }
Source:
private int updateStopTimesForPatternStop(ObjectNode patternStop, int previousTravelTime) throws SQLException { String sql = String.format( "update %s.stop_times st set arrival_time = ?, departure_time = ? from %s.trips t " + "where st.trip_id = t.trip_id AND t.%s = ? AND st.%s = ?", tablePrefix, tablePrefix, "pattern_id", "stop_sequence" ); PreparedStatement statement = connection.prepareStatement(sql); int oneBasedIndex = 1; int travelTime = patternStop.get("default_travel_time").asInt(); int arrivalTime = previousTravelTime + travelTime; statement.setInt(oneBasedIndex++, arrivalTime); int dwellTime = patternStop.get("default_dwell_time").asInt(); statement.setInt(oneBasedIndex++, arrivalTime + dwellTime); statement.setString(oneBasedIndex++, patternStop.get("pattern_id").asText()); statement.setInt(oneBasedIndex++, patternStop.get("stop_sequence").asInt()); LOG.debug(statement.toString()); int entitiesUpdated = statement.executeUpdate(); LOG.debug("{} stop_time arrivals/departures updated", entitiesUpdated); return travelTime + dwellTime; }

Target:
private int updateStopTimesForPatternStop(ObjectNode patternStop, int previousTravelTime) throws SQLException { String sql = String.format( "update %s.stop_times st set arrival_time = ?, departure_time = ? from %s.trips t " + "where st.trip_id = t.trip_id AND t.pattern_id = ? AND st.stop_sequence = ?", tablePrefix, tablePrefix ); PreparedStatement statement = connection.prepareStatement(sql); int oneBasedIndex = 1; int travelTime = patternStop.get("default_travel_time").asInt(); int arrivalTime = previousTravelTime + travelTime; statement.setInt(oneBasedIndex++, arrivalTime); int dwellTime = patternStop.get("default_dwell_time").asInt(); statement.setInt(oneBasedIndex++, arrivalTime + dwellTime); statement.setString(oneBasedIndex++, patternStop.get("pattern_id").asText()); statement.setInt(oneBasedIndex++, patternStop.get("stop_sequence").asInt()); LOG.debug(statement.toString()); int entitiesUpdated = statement.executeUpdate(); LOG.debug("{} stop_time arrivals/departures updated", entitiesUpdated); return travelTime + dwellTime; }
Source:
EnumerableValues(RelOptCluster cluster, RelDataType rowType, ImmutableList<ImmutableList<RexLiteral>> tuples, RelTraitSet traitSet) { super(cluster, rowType, tuples, traitSet); }

Target:
private EnumerableValues(RelOptCluster cluster, RelDataType rowType, ImmutableList<ImmutableList<RexLiteral>> tuples, RelTraitSet traitSet) { super(cluster, rowType, tuples, traitSet); }